Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/115365
Change subject: Add ext.cx.datamanager.js
......................................................................
Add ext.cx.datamanager.js
Missed in If5d340c979802784e42b9f62dcc603415b832202
Change-Id: If80a54501f417eaf655bef4b53350db8b35820fb
---
A modules/base/ext.cx.datamanager.js
1 file changed, 43 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/65/115365/1
diff --git a/modules/base/ext.cx.datamanager.js
b/modules/base/ext.cx.datamanager.js
new file mode 100644
index 0000000..890ad71
--- /dev/null
+++ b/modules/base/ext.cx.datamanager.js
@@ -0,0 +1,43 @@
+/**
+ * ContentTranslation extension
+ * A tool that allows editors to translate pages from one language
+ * to another with the help of machine translation and other translation aids
+ *
+ * @file
+ * @ingroup Extensions
+ * @copyright See AUTHORS.txt
+ * @license GPL-2.0+
+ */
+( function ( $, mw ) {
+ 'use strict';
+
+ var socket;
+
+ /* global io */
+ function initConnection() {
+ socket = io.connect( mw.config.get(
'wgContentTranslationServerURL' ) );
+ mw.log( '[CX] Connected to server' );
+ }
+
+ function updateModel( data) {
+ mw.log( '[CX] Recieved data from server' );
+ mw.cx.data = data;
+ mw.hook( 'mw.cx.source.ready' ).fire();
+ }
+
+ mw.cx.connect = function () {
+ if ( !socket ) {
+ initConnection();
+ }
+ socket.emit( 'cx.init', {
+ // FIXME
+ sourcePage: 'http://en.wikipedia.org/wiki/' +
mw.cx.sourceTitle,
+ sourceLanguage: mw.cx.sourceLanguage,
+ targetLanguage: mw.cx.targetLanguage,
+ channel: 'cx'
+ } );
+ mw.log( '[CX] Sending context information to server' );
+ socket.on( 'cx.data.update', updateModel );
+ };
+
+}( jQuery, mediaWiki ) );
--
To view, visit https://gerrit.wikimedia.org/r/115365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If80a54501f417eaf655bef4b53350db8b35820fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits