Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / src / util / History.js
index a63aa52..435a321 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -33,7 +33,7 @@ Ext.History = (function () {
     }\r
 \r
     function updateIFrame (token) {\r
-        var html = ['<html><body><div id="state">',token,'</div></body></html>'].join('');\r
+        var html = ['<html><body><div id="state">',Ext.util.Format.htmlEncode(token),'</div></body></html>'].join('');\r
         try {\r
             var doc = iframe.contentWindow.document;\r
             doc.open();\r
@@ -117,14 +117,14 @@ Ext.History = (function () {
          * @property\r
          */\r
         iframeId: 'x-history-frame',\r
-        \r
+\r
         events:{},\r
 \r
         /**\r
          * Initialize the global History instance.\r
          * @param {Boolean} onReady (optional) A callback function that will be called once the history\r
          * component is fully initialized.\r
-         * @param {Object} scope (optional) The callback scope\r
+         * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser window.\r
          */\r
         init: function (onReady, scope) {\r
             if(ready) {\r
@@ -141,7 +141,20 @@ Ext.History = (function () {
             if (Ext.isIE) {\r
                 iframe = Ext.getDom(Ext.History.iframeId);\r
             }\r
-            this.addEvents('ready', 'change');\r
+            this.addEvents(\r
+                /**\r
+                 * @event ready\r
+                 * Fires when the Ext.History singleton has been initialized and is ready for use.\r
+                 * @param {Ext.History} The Ext.History singleton.\r
+                 */\r
+                'ready',\r
+                /**\r
+                 * @event change\r
+                 * Fires when navigation back or forwards within the local page's history occurs.\r
+                 * @param {String} token An identifier associated with the page state at that point in its history.\r
+                 */\r
+                'change'\r
+            );\r
             if(onReady){\r
                 this.on('ready', onReady, scope, {single:true});\r
             }\r