X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/js/History.js diff --git a/docs/js/History.js b/docs/js/History.js deleted file mode 100644 index 9f12f206..00000000 --- a/docs/js/History.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Browser history management using Ext.util.History. - */ -Ext.define("Docs.History", { - singleton: true, - - /** - * Initializes history management. - */ - init: function() { - Ext.util.History.init(function() { - this.navigate(Ext.util.History.getToken()); - }, this); - Ext.util.History.on("change", this.navigate, this); - }, - - // Parses current URL and navigates to the page - navigate: function(token) { - var url = this.parseToken(token); - if (url.type === "api") { - Docs.ClassLoader.load(url.key, true); - Ext.getCmp('treePanelCmp').selectClass(url.key.replace(/-.*$/, '')); - } - else if (url.type === "guide") { - Docs.App.setGuideMode(); - Docs.Guides.load(url.key, true); - } - else { - Docs.App.setIndexMode(); - } - }, - - // Parses current browser location - parseToken: function(token) { - var matches = token && token.match(/\/(api|guide)\/(.*)/); - return matches ? {type: matches[1], key: matches[2]} : {}; - }, - - /** - * Adds URL to history - * - * @param {String} token the part of URL after # - */ - push: function(token) { - Ext.util.History.add(token); - } -});