Rjain has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71278


Change subject: Added the api endpoint and called the store plugin.
......................................................................

Added the api endpoint and called the store plugin.

Change-Id: I86a87e4fdfe027767f938dc2751e1f2d82b063f4
---
M modules/Annotator.js
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Annotator 
refs/changes/78/71278/1

diff --git a/modules/Annotator.js b/modules/Annotator.js
index d1382f0..ecae1dd 100644
--- a/modules/Annotator.js
+++ b/modules/Annotator.js
@@ -3,7 +3,20 @@
 */
 ( function ( mw, $ ) {
   $( function( $ ) {
-       $('#mw-content-text').annotator();
+    //get the endpoint of the api
+    this.apiUrl = mw.config.get('wgScriptPath') + '/api' + 
mw.config.get('wgScriptExtension');
+    //Call the annotations
+       var annotations = $('#mw-content-text').annotator();
+    //Add the store plugin and modify the urls according to mediawiki api
+    annotations.annotator('addPlugin', 'Store', {
+      prefix: this.apiUrl,
+      urls: {
+        create: '',
+        update: '',
+        read: '',
+        destroy: '',
+      }
+    });
   } )
 }( mediaWiki, jQuery ) );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86a87e4fdfe027767f938dc2751e1f2d82b063f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Annotator
Gerrit-Branch: master
Gerrit-Owner: Rjain <richa.jain1...@gmail.com>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to