looking at /src/viewer/viewer.js today. thanks for your previous reply about
namespaces and gcapi, Joe. i will work on your approved changes
tomorrow.
- with a renewed focus on namespaces, i looked at the variable
components and thought, since this is a global entity, it should start
with a capital letter? or be moved into the Viewer namespace?
- open returns Viewer.go() on two occasions, but Viewer.go() only
returns a value if the url starts with '#'. the value returned is the
result of LiveHTML.dispatch whose return value depends on the
dispatched function. as you can see, the chain is already fairly
complex. is this ambiguity intentional? Viewer.open seems primarily
used as an onclick-handler and should therefore always return false
(or true)?
- render_item: it looks to me as if it actually renders templates all
the time, rename it to render_template to avoid confusion with
functions that work on items like landmarks/agents?
- set_city/set_item: i see them parallels in these functions, but then
some inconsistencies (perhaps):
+ set_city sets Viewer.selected_city to city.resource_id(), but
set_item sets Viewer.item to item. would it make sense to change
things so that either Viewer.city = city.resource_id() and Viewer.item
= item.resource_id()? or just forget about resource_id() in this step?
+ is it really necessary to cache item.resource() in state.item_r? it
seems like something which could be retrieved easily from Viewer.item.
+ why are Viewer.item/selected_city not part of the state instead of
Viewer directly? is it, because state depends on the current app,
while item/selected_city do not? what about renaming state to
appstate, then?
- what is blank() for?
cheers,
marmorkuchen
--
_ ascii ribbon campaign .oOo. GCSd-s:+aC++ULB+++W++M+PS+++Y+
( )
X Jeden Tag eine Erisische Tat!
/ \