jenkins-bot has submitted this change and it was merged.
Change subject: Added BS.store.BSApi
......................................................................
Added BS.store.BSApi
Added base class that lets a developer easily access the API as a source
of an ExtJS data consumer
Change-Id: I554271712a08248173e7c1f4070bbe1c43c9b9b6
---
A resources/bluespice.extjs/BS/store/BSApi.js
1 file changed, 30 insertions(+), 0 deletions(-)
Approvals:
Robert Vogel: Looks good to me, approved
Mglaser: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/bluespice.extjs/BS/store/BSApi.js
b/resources/bluespice.extjs/BS/store/BSApi.js
new file mode 100644
index 0000000..e143b39
--- /dev/null
+++ b/resources/bluespice.extjs/BS/store/BSApi.js
@@ -0,0 +1,30 @@
+Ext.define('BS.store.BSApi', {
+ extend: 'Ext.data.JsonStore',
+ apiAction: null,
+
+ constructor: function( cfg ) {
+ cfg = Ext.apply({
+ proxy: {
+ type: 'ajax',
+ url: mw.util.wikiScript('api'),
+ extraParams: {
+ format: 'json'
+ },
+ reader: {
+ type: 'json',
+ root: 'results',
+ idProperty: 'id',
+ totalProperty: 'total'
+ }
+ },
+ autoLoad: true,
+ remoteSort: true,
+ sortInfo: {
+ field: 'id',
+ direction: 'ASC'
+ }
+ }, cfg);
+ cfg.proxy.extraParams.action = cfg.apiAction;
+ this.callParent([cfg]);
+ }
+});
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/265732
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I554271712a08248173e7c1f4070bbe1c43c9b9b6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Dvogel hallowelt <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits