jenkins-bot has submitted this change and it was merged.

Change subject: Add collections interface smoke and mirrors
......................................................................


Add collections interface smoke and mirrors

This will unblock frontend work.
Should be wired up later.

Change-Id: I48f194d93e3a453a0f6cdf220c2796e1013790b9
---
M resources/Resources.php
A resources/ext.gather.watchstar/CollectionsApi.js
M resources/ext.gather.watchstar/CollectionsContentOverlay.js
3 files changed, 58 insertions(+), 2 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/Resources.php b/resources/Resources.php
index 4cab774..54a83e1 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -105,6 +105,7 @@
                        'content.hogan' => 'ext.gather.watchstar/content.hogan',
                ),
                'scripts' => array(
+                       'ext.gather.watchstar/CollectionsApi.js',
                        'ext.gather.watchstar/CollectionsContentOverlay.js',
                        'ext.gather.watchstar/CollectionsWatchstar.js',
                        'ext.gather.watchstar/init.js',
diff --git a/resources/ext.gather.watchstar/CollectionsApi.js 
b/resources/ext.gather.watchstar/CollectionsApi.js
new file mode 100644
index 0000000..1dc594e
--- /dev/null
+++ b/resources/ext.gather.watchstar/CollectionsApi.js
@@ -0,0 +1,55 @@
+/*jshint unused:vars */
+( function ( M, $ ) {
+
+       var WatchstarApi = M.require( 'modules/watchstar/WatchstarApi' ),
+               CollectionsApi;
+
+       /**
+        * API for managing collection items
+        *
+        * @class CollectionApi
+        * @extends Api
+        */
+       CollectionsApi = WatchstarApi.extend( {
+               /**
+                * Add page to existing collection.
+                * FIXME: This is currently smoke and mirrors. Doesn't save to 
server.
+                * @method
+                * @param {Number} id Identifier of collection
+                * @param {Page} page Page view object
+                * @return {jQuery.Deferred}
+                */
+               addPageToCollection: function ( id, page ) {
+                       var d = $.Deferred();
+                       return d.resolve( {} );
+               },
+               /**
+                * Remove page from existing collection.
+                * FIXME: This is currently smoke and mirrors. Doesn't save to 
server.
+                * @method
+                * @param {Number} id Identifier of collection
+                * @param {Page} page Page view object
+                * @return {jQuery.Deferred}
+                */
+               removePageFromCollection: function ( id, page ) {
+                       var d = $.Deferred();
+                       return d.resolve( {} );
+               },
+               /**
+                * Create a new collection
+                * FIXME: This is currently smoke and mirrors. Doesn't save to 
server.
+                * @method
+                * @param {String} title of collection
+                */
+               addCollection: function ( title ) {
+                       var d = $.Deferred();
+                       return d.resolve( {
+                               id: 99,
+                               title: title
+                       } );
+               }
+       } );
+
+       M.define( 'ext.gather.watchstar/CollectionsApi', CollectionsApi );
+
+}( mw.mobileFrontend, jQuery ) );
diff --git a/resources/ext.gather.watchstar/CollectionsContentOverlay.js 
b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
index d441fd9..619c7e1 100644
--- a/resources/ext.gather.watchstar/CollectionsContentOverlay.js
+++ b/resources/ext.gather.watchstar/CollectionsContentOverlay.js
@@ -4,7 +4,7 @@
                icons = M.require( 'icons' ),
                toast = M.require( 'toast' ),
                Icon = M.require( 'Icon' ),
-               WatchstarApi = M.require( 'modules/watchstar/WatchstarApi' ),
+               CollectionsApi = M.require( 
'ext.gather.watchstar/CollectionsApi' ),
                ContentOverlay = M.require( 'modules/tutorials/ContentOverlay' 
);
 
        /**
@@ -48,7 +48,7 @@
                },
                /** @inheritdoc */
                initialize: function () {
-                       this.api = new WatchstarApi();
+                       this.api = new CollectionsApi();
                        ContentOverlay.prototype.initialize.apply( this, 
arguments );
                },
                /** @inheritdoc */

-- 
To view, visit https://gerrit.wikimedia.org/r/194428
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I48f194d93e3a453a0f6cdf220c2796e1013790b9
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to