Loading template/app/view/HoverMenu.js +3 −6 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ Ext.define('Docs.view.HoverMenu', { extend: 'Ext.view.View', requires: [ 'Docs.Comments' 'Docs.Comments', 'Docs.view.Signature' ], alias: 'widget.hovermenu', Loading Loading @@ -41,12 +42,8 @@ Ext.define('Docs.view.HoverMenu', { columnHeight: this.columnHeight, renderLink: function(values) { var tags = Ext.Array.map(Docs.data.signatures, function(s) { return values.meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["short"])+'</span>' : ''; }).join(' '); var tags = Docs.view.Signature.render(values.meta); var cnt = Docs.Comments.counterHtml(values.commentCount); return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2} {3}</a>', values.url, values.label, tags, cnt); } } Loading template/app/view/Signature.js 0 → 100644 +20 −0 Original line number Diff line number Diff line /** * Renders the list of signature labels for a class or member. */ Ext.define('Docs.view.Signature', { singleton: true, /** * Returns an HTML rendering of the signature * @param {Object} meta class or member data object. * @param {String} [format="short"] Supply "long" do display full * labels instead of abberviated ones. * @return {String} HTML spans. */ render: function(meta, format) { format = format || "short"; return Ext.Array.map(Docs.data.signatures, function(s) { return meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s[format])+'</span>' : ''; }).join(' '); } }); template/app/view/cls/Header.js +6 −5 Original line number Diff line number Diff line Loading @@ -3,12 +3,15 @@ */ Ext.define('Docs.view.cls.Header', { extend: 'Ext.container.Container', requires: [ 'Docs.view.Signature' ], alias: 'widget.classheader', cls: 'classheader', padding: '10 0 17 0', // Initially the component will be empty and so the initial height // will not be correct if not set explicitly height: 55, alias: 'widget.classheader', cls: 'classheader', initComponent: function() { this.tpl = Ext.create('Ext.XTemplate', Loading Loading @@ -63,9 +66,7 @@ Ext.define('Docs.view.cls.Header', { } }, renderMetaTags: function(metaTags) { return ' ' + Ext.Array.map(Docs.data.signatures, function(s) { return metaTags[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["long"])+'</span>' : ''; }).join(' '); return ' ' + Docs.view.Signature.render(metaTags, "long"); } } ); Loading template/app/view/search/Dropdown.js +4 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ Ext.define('Docs.view.search.Dropdown', { extend: 'Ext.view.View', alias: 'widget.searchdropdown', requires: [ 'Docs.view.Signature' ], floating: true, autoShow: false, Loading Loading @@ -63,9 +66,7 @@ Ext.define('Docs.view.search.Dropdown', { return meta["private"] ? "private" : (meta.removed ? "removed" : ""); }, getMetaTags: function(meta) { return Ext.Array.map(Docs.data.signatures, function(s) { return meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["short"])+'</span>' : ''; }).join(' '); return Docs.view.Signature.render(meta); }, getTotal: Ext.bind(this.getTotal, this), getStart: Ext.bind(this.getStart, this), Loading Loading
template/app/view/HoverMenu.js +3 −6 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ Ext.define('Docs.view.HoverMenu', { extend: 'Ext.view.View', requires: [ 'Docs.Comments' 'Docs.Comments', 'Docs.view.Signature' ], alias: 'widget.hovermenu', Loading Loading @@ -41,12 +42,8 @@ Ext.define('Docs.view.HoverMenu', { columnHeight: this.columnHeight, renderLink: function(values) { var tags = Ext.Array.map(Docs.data.signatures, function(s) { return values.meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["short"])+'</span>' : ''; }).join(' '); var tags = Docs.view.Signature.render(values.meta); var cnt = Docs.Comments.counterHtml(values.commentCount); return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2} {3}</a>', values.url, values.label, tags, cnt); } } Loading
template/app/view/Signature.js 0 → 100644 +20 −0 Original line number Diff line number Diff line /** * Renders the list of signature labels for a class or member. */ Ext.define('Docs.view.Signature', { singleton: true, /** * Returns an HTML rendering of the signature * @param {Object} meta class or member data object. * @param {String} [format="short"] Supply "long" do display full * labels instead of abberviated ones. * @return {String} HTML spans. */ render: function(meta, format) { format = format || "short"; return Ext.Array.map(Docs.data.signatures, function(s) { return meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s[format])+'</span>' : ''; }).join(' '); } });
template/app/view/cls/Header.js +6 −5 Original line number Diff line number Diff line Loading @@ -3,12 +3,15 @@ */ Ext.define('Docs.view.cls.Header', { extend: 'Ext.container.Container', requires: [ 'Docs.view.Signature' ], alias: 'widget.classheader', cls: 'classheader', padding: '10 0 17 0', // Initially the component will be empty and so the initial height // will not be correct if not set explicitly height: 55, alias: 'widget.classheader', cls: 'classheader', initComponent: function() { this.tpl = Ext.create('Ext.XTemplate', Loading Loading @@ -63,9 +66,7 @@ Ext.define('Docs.view.cls.Header', { } }, renderMetaTags: function(metaTags) { return ' ' + Ext.Array.map(Docs.data.signatures, function(s) { return metaTags[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["long"])+'</span>' : ''; }).join(' '); return ' ' + Docs.view.Signature.render(metaTags, "long"); } } ); Loading
template/app/view/search/Dropdown.js +4 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ Ext.define('Docs.view.search.Dropdown', { extend: 'Ext.view.View', alias: 'widget.searchdropdown', requires: [ 'Docs.view.Signature' ], floating: true, autoShow: false, Loading Loading @@ -63,9 +66,7 @@ Ext.define('Docs.view.search.Dropdown', { return meta["private"] ? "private" : (meta.removed ? "removed" : ""); }, getMetaTags: function(meta) { return Ext.Array.map(Docs.data.signatures, function(s) { return meta[s.tagname] ? '<span class="signature '+s.tagname+'">'+(s["short"])+'</span>' : ''; }).join(' '); return Docs.view.Signature.render(meta); }, getTotal: Ext.bind(this.getTotal, this), getStart: Ext.bind(this.getStart, this), Loading