[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: CategoryBoxSelect: Added "tree-trigger"
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/324735 ) Change subject: CategoryBoxSelect: Added "tree-trigger" .. CategoryBoxSelect: Added "tree-trigger" ... that opens a window with an BS.tree.Categories panel Manual merge of https://gerrit.wikimedia.org/r/#/c/322859/ Change-Id: I3020b5903859fabd5782a85fac12188fa304e939 --- M extension.json M i18n/extjs/de.json M i18n/extjs/en.json M i18n/extjs/qqq.json M resources/bluespice.extjs/BS/form/CategoryBoxSelect.js A resources/bluespice.extjs/BS/tree/Categories.js M resources/bluespice.extjs/bluespice.extjs.fixes.css A resources/bluespice.extjs/images/tree-trigger.png 8 files changed, 110 insertions(+), 5 deletions(-) Approvals: Pwirth: Looks good to me, but someone else must approve Robert Vogel: Looks good to me, approved Raimond Spekking: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/extension.json b/extension.json index e45d1a6..5f0c2ea 100644 --- a/extension.json +++ b/extension.json @@ -118,7 +118,8 @@ "bs-extjs-title-warning", "bs-extjs-filter-bool-yes", "bs-extjs-filter-bool-no", -"bs-extjs-categoryboxselect-emptytext" +"bs-extjs-categoryboxselect-emptytext", +"bs-extjs-categorytree-title" ], "dependencies": [ "ext.bluespice.extjs.theme.ux", diff --git a/i18n/extjs/de.json b/i18n/extjs/de.json index 7a11aee..db498de 100644 --- a/i18n/extjs/de.json +++ b/i18n/extjs/de.json @@ -46,5 +46,6 @@ "bs-extjs-filter-bool-no": "nein", "bs-extjs-title-success": "Erfolg", "bs-extjs-title-warning": "Warnung", - "bs-extjs-categoryboxselect-emptytext": "Kategorie hinzufügen" + "bs-extjs-categoryboxselect-emptytext": "Kategorie hinzufügen", + "bs-extjs-categorytree-title": "Kategorien" } diff --git a/i18n/extjs/en.json b/i18n/extjs/en.json index bb973a3..eb8318a 100644 --- a/i18n/extjs/en.json +++ b/i18n/extjs/en.json @@ -46,5 +46,6 @@ "bs-extjs-filter-bool-no": "no", "bs-extjs-title-success": "Success", "bs-extjs-title-warning": "Warning", - "bs-extjs-categoryboxselect-emptytext": "Add a category" + "bs-extjs-categoryboxselect-emptytext": "Add a category", + "bs-extjs-categorytree-title": "Categories" } diff --git a/i18n/extjs/qqq.json b/i18n/extjs/qqq.json index 6e32fca..7a94e9e 100644 --- a/i18n/extjs/qqq.json +++ b/i18n/extjs/qqq.json @@ -49,5 +49,6 @@ "bs-extjs-filter-bool-no": "Label for a filter option that fitlers for datasets where the value of the field is boolean false\n{{Identical|No}}", "bs-extjs-title-success": "Window title for success\n{{Identical|Success}}", "bs-extjs-title-warning": "Window title for warning\n{{Identical|Warning}}", - "bs-extjs-categoryboxselect-emptytext": "The placeholder text of an input field that allows the definition of categories" + "bs-extjs-categoryboxselect-emptytext": "The placeholder text of an input field that allows the definition of categories", + "bs-extjs-categorytree-title": "The title of a panel containing a tree view of the wiki's categories" } diff --git a/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js b/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js index 3ca91b1..618a9d8 100644 --- a/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js +++ b/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js @@ -15,7 +15,17 @@ queryMode: 'local', emptyText: mw.message('bs-extjs-categoryboxselect-emptytext').plain(), delimiter: '|', + deferredSetValueConf: false, + showTreeTrigger: false, + + constructor: function( cfg ) { + if( cfg.showTreeTrigger ) { + cfg.trigger2Cls = Ext.baseCSSPrefix + 'form-search-trigger bs-form-tree-trigger'; + } + this.callParent( [cfg] ); + }, + initComponent: function() { this.store = Ext.create( 'Ext.data.JsonStore', { proxy: { @@ -74,5 +84,67 @@ callback: callback, value: value }; + }, + + onTrigger2Click : function( event ){ + //lazy loading, as this trigger is optional + Ext.require( 'BS.tree.Categories', this.showTree, this ); + }, + + wdTree: null, + showTree: function() { + if( !this.wdTree ) { + var categoryTree = new BS.tree.Categories({ + width: 250, + height: 300 + }); + categoryTree.on( 'itemclick', this.onTreeItemClick, this ); + this.wdTree = new Ext.Window({ +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: CategoryBoxSelect: Added "tree-trigger"
Robert Vogel has uploaded a new change for review. https://gerrit.wikimedia.org/r/324735 Change subject: CategoryBoxSelect: Added "tree-trigger" .. CategoryBoxSelect: Added "tree-trigger" ... that opens a window with an BS.tree.Categories panel Manual merge of https://gerrit.wikimedia.org/r/#/c/322859/ Change-Id: I3020b5903859fabd5782a85fac12188fa304e939 --- M extension.json M i18n/extjs/de.json M i18n/extjs/en.json M i18n/extjs/qqq.json M resources/bluespice.extjs/BS/form/CategoryBoxSelect.js A resources/bluespice.extjs/BS/tree/Categories.js M resources/bluespice.extjs/bluespice.extjs.fixes.css A resources/bluespice.extjs/images/tree-trigger.png 8 files changed, 108 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/35/324735/1 diff --git a/extension.json b/extension.json index e45d1a6..93872ea 100644 --- a/extension.json +++ b/extension.json @@ -118,7 +118,8 @@ "bs-extjs-title-warning", "bs-extjs-filter-bool-yes", "bs-extjs-filter-bool-no", -"bs-extjs-categoryboxselect-emptytext" +"bs-extjs-categoryboxselect-emptytext", + "bs-extjs-categorytree-title" ], "dependencies": [ "ext.bluespice.extjs.theme.ux", diff --git a/i18n/extjs/de.json b/i18n/extjs/de.json index 7a11aee..db498de 100644 --- a/i18n/extjs/de.json +++ b/i18n/extjs/de.json @@ -46,5 +46,6 @@ "bs-extjs-filter-bool-no": "nein", "bs-extjs-title-success": "Erfolg", "bs-extjs-title-warning": "Warnung", - "bs-extjs-categoryboxselect-emptytext": "Kategorie hinzufügen" + "bs-extjs-categoryboxselect-emptytext": "Kategorie hinzufügen", + "bs-extjs-categorytree-title": "Kategorien" } diff --git a/i18n/extjs/en.json b/i18n/extjs/en.json index bb973a3..eb8318a 100644 --- a/i18n/extjs/en.json +++ b/i18n/extjs/en.json @@ -46,5 +46,6 @@ "bs-extjs-filter-bool-no": "no", "bs-extjs-title-success": "Success", "bs-extjs-title-warning": "Warning", - "bs-extjs-categoryboxselect-emptytext": "Add a category" + "bs-extjs-categoryboxselect-emptytext": "Add a category", + "bs-extjs-categorytree-title": "Categories" } diff --git a/i18n/extjs/qqq.json b/i18n/extjs/qqq.json index 6e32fca..7516bf9 100644 --- a/i18n/extjs/qqq.json +++ b/i18n/extjs/qqq.json @@ -50,4 +50,5 @@ "bs-extjs-title-success": "Window title for success\n{{Identical|Success}}", "bs-extjs-title-warning": "Window title for warning\n{{Identical|Warning}}", "bs-extjs-categoryboxselect-emptytext": "The placeholder text of an input field that allows the definition of categories" + "bs-extjs-categorytree-title": "The title of a panel containing a tree view of the wiki's categories" } diff --git a/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js b/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js index 3ca91b1..88abb2a 100644 --- a/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js +++ b/resources/bluespice.extjs/BS/form/CategoryBoxSelect.js @@ -15,7 +15,17 @@ queryMode: 'local', emptyText: mw.message('bs-extjs-categoryboxselect-emptytext').plain(), delimiter: '|', + deferredSetValueConf: false, + showTreeTrigger: false, + + constructor: function( cfg ) { + if( cfg.showTreeTrigger ) { + cfg.trigger2Cls = Ext.baseCSSPrefix + 'form-search-trigger bs-form-tree-trigger'; + } + this.callParent( [cfg] ); + }, + initComponent: function() { this.store = Ext.create( 'Ext.data.JsonStore', { proxy: { @@ -74,5 +84,67 @@ callback: callback, value: value }; + }, + + onTrigger2Click : function( event ){ +//lazy loading, as this trigger is optional +Ext.require( 'BS.tree.Categories', this.showTree, this ); + }, + +wdTree: null, + showTree: function() { +if( !this.wdTree ) { +var categoryTree = new BS.tree.Categories({ +width: 250, +height: 300 +}); +categoryTree.on( 'itemclick', this.onTreeItemClick, this ); +this.wdTree = new Ext.Window({ +title: mw.message('bs-extjs-categorytree-title').plain(), +x: this.getX() + this.getWidth(), +y: this.getY() - 175, + closeAction: 'hide', +items: [ +categoryTree +] +}); + +this.wireUpWithContainerWindow(); +} + +this.wdTree.show(); + }, + +onTreeItemClick: function( tree, record, item, index, e, eOpts ) { + if ( mw.confi