Changeset 184:f3e7b654a250
- Timestamp:
- 09/02/08 20:49:48 (2 years ago)
- Author:
- rgrp
- Branch:
- default
- convert_revision:
- svn:10edda23-d834-0410-9182-b00384516d49/trunk@196
- Message:
-
[js/factletdetails][m/l]: add support for inpage updating of factlet details in thread view courtesy of a new factletsdetailview and and a new threadreadpagecontroller.
- factletdetailsview works by pulling templated html directly from server via factlet/read_core. May want to change this to reduce coupling of js and python server side code.
- Location:
- microfacts
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r148
|
r184
|
|
| 1 | 1 | var MicrofactsController = new Class({ |
| 2 | 2 | initialize: function (element) { |
| 3 | | element.getElements('.factlet').each(function (el) { |
| 4 | | new FactletController(el); |
| | 3 | element.getElements('.factlet-details').each(function (el) { |
| | 4 | new FactletDetailsView(el); |
| 5 | 5 | }); |
| 6 | 6 | element.getElements('.thread-factlets').each(function (el) { |
| 7 | | new ThreadFactletsController(el); |
| | 7 | new ThreadFactletsView(el); |
| 8 | 8 | }); |
| 9 | 9 | } |
-
|
r173
|
r184
|
|
| 137 | 137 | |
| 138 | 138 | loader.addModule({ |
| | 139 | name: "factletdetailsview", |
| | 140 | type: "js", |
| | 141 | path: "app/views/factletdetailsview.js?" + Math.random(), |
| | 142 | requires: ['view'], |
| | 143 | varName: "FactletDetailsView" |
| | 144 | }); |
| | 145 | |
| | 146 | loader.addModule({ |
| 139 | 147 | name: "threadfactletsview", |
| 140 | 148 | type: "js", |
| … |
… |
|
| 196 | 204 | type: "js", |
| 197 | 205 | path: "app/microfacts.js?" + Math.random(), |
| 198 | | requires: ['domainobject', 'view', 'controller', 'microfactscontroller', 'factletcontroller', 'threadfactletsview', 'mapview', 'timelineview', 'geochronopagecontroller', 'threadpagecontroller'], |
| | 206 | requires: ['domainobject', 'view', 'controller', 'microfactscontroller', 'factletcontroller', 'factletdetailsview', 'threadfactletsview', 'mapview', 'timelineview', 'geochronopagecontroller', 'threadpagecontroller'], |
| 199 | 207 | varName: "Microfacts" |
| | 208 | }); |
| | 209 | |
| | 210 | loader.addModule({ |
| | 211 | name: "threadreadpagecontroller", |
| | 212 | type: "js", |
| | 213 | path: "app/controllers/threadreadpage_controller.js?" + Math.random(), |
| | 214 | requires: ['model', 'domainobject', 'view', 'controller', 'thread', 'factlet', 'threadfactletsview', 'factletdetailsview'], |
| | 215 | varName: "ThreadReadPageController" |
| 200 | 216 | }); |
| 201 | 217 | |
-
|
r173
|
r184
|
|
| 56 | 56 | <!-- views --> |
| 57 | 57 | <script type="text/javascript" src="spec/view_spec.js?123"></script> |
| | 58 | <script type="text/javascript" src="spec/factletdetailsview_spec.js?123"></script> |
| 58 | 59 | <script type="text/javascript" src="spec/threadfactletsview_spec.js?123"></script> |
| 59 | 60 | <script type="text/javascript" src="spec/factletsearchview_spec.js?123"></script> |
| … |
… |
|
| 97 | 98 | <div id="view"></div> |
| 98 | 99 | |
| | 100 | <div class="factlet-details"> |
| | 101 | </div> |
| | 102 | |
| 99 | 103 | <div class="thread-factlets"> |
| 100 | 104 | <div id="factlet-101" class="factlet"> |
-
|
r183
|
r184
|
|
| 24 | 24 | </dd> |
| 25 | 25 | <dt>Source</dt> |
| 26 | | <dd><a href="${c.factlet.source}">${c.factlet.source}</a></dd> |
| | 26 | <dd> |
| | 27 | <py:if test="c.factlet.source"> |
| | 28 | <a href="${c.factlet.source}">${c.factlet.source}</a> |
| | 29 | </py:if> |
| | 30 | </dd> |
| 27 | 31 | <dt>License</dt> |
| 28 | 32 | <dd>${c.factlet.license}</dd> |
-
|
r110
|
r184
|
|
| 8 | 8 | |
| 9 | 9 | <xi:include href="layout.html" /> |
| | 10 | |
| | 11 | <py:def function="pagecontrollername">threadreadpagecontroller</py:def> |
| 10 | 12 | |
| 11 | 13 | <head> |