Loading template/app/view/comments/FullList.js +2 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,8 @@ Ext.define('Docs.view.comments.FullList', { items: [ { xtype: 'commentsList', id: 'recentcomments' id: 'recentcomments', showTarget: true }, { xtype: 'commentsPager' Loading template/app/view/comments/List.js +7 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,12 @@ Ext.define('Docs.view.comments.List', { emptyText: '<div class="loading">Loading...</div>', deferEmptyText: false, /** * @cfg {Boolean} showTarget * True to show a link to the target in each comment. * Used in Docs.view.comments.FullList. */ initComponent: function() { this.store = Ext.create('Ext.data.Store', { fields: [ Loading @@ -33,7 +39,7 @@ Ext.define('Docs.view.comments.List', { ] }); this.tpl = Docs.view.comments.Template; this.tpl = Docs.view.comments.Template.create({showTarget: this.showTarget}); this.callParent(arguments); Loading template/app/view/comments/Template.js +30 −2 Original line number Diff line number Diff line Loading @@ -3,12 +3,36 @@ */ Ext.define('Docs.view.comments.Template', { extend: 'Ext.XTemplate', singleton: true, requires: [ 'Docs.Auth', 'Docs.Comments' ], statics: { /** * A factory method to get an instance of the template. For * every different config object, returns a cached instance of * the template, avoiding creating a new each time. * * @param {Object} cfg An additional configuration to * apply to the template object. * @return {Docs.view.comments.Template} */ create: function(cfg) { var key = "tpl-" + Ext.JSON.encode(cfg); if (!this[key]) { this[key] = new this(); Ext.apply(this[key], cfg); } return this[key]; } }, /** * @cfg {Boolean} showTarget * True to show a link to the target in each comment. */ constructor: function() { this.callParent([ '<div class="comment-list">', Loading @@ -18,7 +42,7 @@ Ext.define('Docs.view.comments.Template', { '{[Docs.Comments.avatar(values.emailHash)]}', '<div class="author<tpl if="moderator"> moderator" title="Sencha Engineer</tpl>">', '{author}', '<tpl if="showCls">', '<tpl if="this.isTargetVisible()">', '<span class="target"> on {[this.target(values.target)]}</span>', '</tpl>', '</div>', Loading Loading @@ -47,6 +71,10 @@ Ext.define('Docs.view.comments.Template', { ]); }, isTargetVisible: function() { return this.showTarget; }, dateStr: function(date) { try { var now = Math.ceil(Number(new Date()) / 1000); Loading Loading
template/app/view/comments/FullList.js +2 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,8 @@ Ext.define('Docs.view.comments.FullList', { items: [ { xtype: 'commentsList', id: 'recentcomments' id: 'recentcomments', showTarget: true }, { xtype: 'commentsPager' Loading
template/app/view/comments/List.js +7 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,12 @@ Ext.define('Docs.view.comments.List', { emptyText: '<div class="loading">Loading...</div>', deferEmptyText: false, /** * @cfg {Boolean} showTarget * True to show a link to the target in each comment. * Used in Docs.view.comments.FullList. */ initComponent: function() { this.store = Ext.create('Ext.data.Store', { fields: [ Loading @@ -33,7 +39,7 @@ Ext.define('Docs.view.comments.List', { ] }); this.tpl = Docs.view.comments.Template; this.tpl = Docs.view.comments.Template.create({showTarget: this.showTarget}); this.callParent(arguments); Loading
template/app/view/comments/Template.js +30 −2 Original line number Diff line number Diff line Loading @@ -3,12 +3,36 @@ */ Ext.define('Docs.view.comments.Template', { extend: 'Ext.XTemplate', singleton: true, requires: [ 'Docs.Auth', 'Docs.Comments' ], statics: { /** * A factory method to get an instance of the template. For * every different config object, returns a cached instance of * the template, avoiding creating a new each time. * * @param {Object} cfg An additional configuration to * apply to the template object. * @return {Docs.view.comments.Template} */ create: function(cfg) { var key = "tpl-" + Ext.JSON.encode(cfg); if (!this[key]) { this[key] = new this(); Ext.apply(this[key], cfg); } return this[key]; } }, /** * @cfg {Boolean} showTarget * True to show a link to the target in each comment. */ constructor: function() { this.callParent([ '<div class="comment-list">', Loading @@ -18,7 +42,7 @@ Ext.define('Docs.view.comments.Template', { '{[Docs.Comments.avatar(values.emailHash)]}', '<div class="author<tpl if="moderator"> moderator" title="Sencha Engineer</tpl>">', '{author}', '<tpl if="showCls">', '<tpl if="this.isTargetVisible()">', '<span class="target"> on {[this.target(values.target)]}</span>', '</tpl>', '</div>', Loading Loading @@ -47,6 +71,10 @@ Ext.define('Docs.view.comments.Template', { ]); }, isTargetVisible: function() { return this.showTarget; }, dateStr: function(date) { try { var now = Math.ceil(Number(new Date()) / 1000); Loading