Created
June 26, 2011 21:45
-
-
Save mtrudel/1048001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// windows/*.js look like: | |
definePage( 'main', { | |
load: function() {}, | |
unload: function() {}, | |
show: function() {}, | |
hide: function() {} | |
}) | |
//////// Ti Query side: | |
var $.definePage = function( name, page ) { | |
$.pages[ name ] = page | |
} | |
windowsDir.each { | |
Ti.include(page) | |
} | |
// Now $.pages is filled out | |
var openWindow = function( newName ) { | |
var oldName = $.currentPage | |
var oldPage = $.states[ oldName ] | |
if (! $.states[ newName ] ) $.states[ newName ] = {} | |
var newPage = $.states[ newName ] | |
if (devMode) { | |
$.pages[ newName ] = // get from HTTP | |
// Walk through the state transitions, passing in oldPage / newPage as the value of this | |
// If oldWindow marks itself as persistable, and we have room in states[], save it out | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment