Loading template/app/ClassRegistry.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /** * Global access to data about all classes. * * Provides access to Docs.data.search. */ Ext.define("Docs.ClassRegistry", { singleton: true, /** * Given class name or alternate class name, returns the true * class name. When the name is neither, returns it back again. * @param {String} name * @return {String} */ canonicalName: function(name) { if (!this.altNames) { this.altNames = {}; Ext.each(Docs.data.search, function(r) { if (r.type === "class" && !/:/.test(r.cls)) { this.altNames[r.cls] = r.id; } }, this); } return this.altNames[name] || name; } }); template/app/controller/Classes.js +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ Ext.define('Docs.controller.Classes', { requires: [ 'Docs.History', 'Docs.Syntax' 'Docs.Syntax', 'Docs.ClassRegistry' ], stores: [ Loading Loading @@ -232,7 +233,7 @@ Ext.define('Docs.controller.Classes', { // separate class and member name var matches = url.match(/^#!\/api\/(.*?)(?:-(.*))?$/); var cls = matches[1]; var cls = Docs.ClassRegistry.canonicalName(matches[1]); var member = matches[2]; if (this.getOverview()) { Loading Loading @@ -262,7 +263,6 @@ Ext.define('Docs.controller.Classes', { }, showClass: function(cls, anchor) { var reRendered = false; if (cls === "in-progress") { Loading Loading
template/app/ClassRegistry.js 0 → 100644 +26 −0 Original line number Diff line number Diff line /** * Global access to data about all classes. * * Provides access to Docs.data.search. */ Ext.define("Docs.ClassRegistry", { singleton: true, /** * Given class name or alternate class name, returns the true * class name. When the name is neither, returns it back again. * @param {String} name * @return {String} */ canonicalName: function(name) { if (!this.altNames) { this.altNames = {}; Ext.each(Docs.data.search, function(r) { if (r.type === "class" && !/:/.test(r.cls)) { this.altNames[r.cls] = r.id; } }, this); } return this.altNames[name] || name; } });
template/app/controller/Classes.js +3 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ Ext.define('Docs.controller.Classes', { requires: [ 'Docs.History', 'Docs.Syntax' 'Docs.Syntax', 'Docs.ClassRegistry' ], stores: [ Loading Loading @@ -232,7 +233,7 @@ Ext.define('Docs.controller.Classes', { // separate class and member name var matches = url.match(/^#!\/api\/(.*?)(?:-(.*))?$/); var cls = matches[1]; var cls = Docs.ClassRegistry.canonicalName(matches[1]); var member = matches[2]; if (this.getOverview()) { Loading Loading @@ -262,7 +263,6 @@ Ext.define('Docs.controller.Classes', { }, showClass: function(cls, anchor) { var reRendered = false; if (cls === "in-progress") { Loading