/**
* Originally based of this code... - refactored for Roo...
- *
+ * https://github.com/browserstate/history.js
+
* History.js Core
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
+ *
+ * Hackily modifyed by alan@roojs.com
+ *
+ * this is not initialized automatically..
+ * must call Roo.History.init( { ... options... });
+ *
+ * TOTALLY UNTESTED...
+ *
+ * Documentation to be done....
*/
-
-// this is not initialized automatically..
-// must call Roo.History.init( { ... options... });
-
-
-Roo.History = new Roo.util.Observable({
+Roo.History = {
// ====================================================================
Roo.apply(this,options)
- // Check Load Status of Adapter
- //if ( typeof this.Adapter === 'undefined' ) {
- // return false;
- //}
-
+
// Check Load Status of Core
- if ( typeof this.initCore !== 'undefined' ) {
- this.initCore();
- }
-
+ this.initCore();
+
// Check Load Status of HTML4 Support
- if ( typeof this.initHtml4 !== 'undefined' ) {
- this.initHtml4();
- }
+ //if ( typeof this.initHtml4 !== 'undefined' ) {
+ // this.initHtml4();
+ //}
this.initEmulated();
- this.Adapter.bind(window,'popstate',this.onPopState);
+ Roo.get(window).on('popstate',this.onPopState, this);
/**
this.intervalList.push(setInterval(this.onUnload,this.storeInterval));
// For Other Browsers
- this.Adapter.bind(window,'beforeunload',this.onUnload);
- this.Adapter.bind(window,'unload',this.onUnload);
+ Roo.get(window).on('beforeunload',this.onUnload,this);
+ Roo.get(window).on('unload',this.onUnload, this);
} else {
this.onUnload = emptyFunction;
/**
* Clear Intervals on exit to prevent memory leaks
*/
- this.Adapter.bind(window,"unload",this.clearAllIntervals);
+ Roo.get(window).on('unload',this.clearAllIntervals, this);
/**
* Create the initial State
*/
// Setup Alias
- this.Adapter.bind(window,'hashchange',function(){
+ Roo.get(window).on('hashchange',function(){
Roo.get(window).fireEvent('popstate');
- });
+ }, this);
// Initialise Alias
if ( this.getHash() ) {
}
}
}
-});
-
-
\ No newline at end of file
+};
\ No newline at end of file