Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/268623
Change subject: Rename ext.cx.translation.draft module to ext.cx.translation.loader ...................................................................... Rename ext.cx.translation.draft module to ext.cx.translation.loader Bug: T125623 Change-Id: Id4270714fef28e58606405395295dbd6cc5a9be0 --- M extension.json R modules/translation/ext.cx.translation.loader.js M modules/translation/ext.cx.translation.storage.init.js 3 files changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/23/268623/1 diff --git a/extension.json b/extension.json index bc733c7..8f7f429 100644 --- a/extension.json +++ b/extension.json @@ -699,15 +699,13 @@ "mediawiki.jqueryMsg" ] }, - "ext.cx.translation.draft": { + "ext.cx.translation.loader": { "scripts": [ - "translation/ext.cx.translation.draft.js" + "translation/ext.cx.translation.loader.js" ], "dependencies": [ "easy-deflate.deflate", "ext.cx.model", - "jquery.throttle-debounce", - "mediawiki.api.edit", "mediawiki.user" ], "messages": [ @@ -731,7 +729,9 @@ "translation/ext.cx.translation.storage.js" ], "dependencies": [ - "easy-deflate.deflate" + "easy-deflate.deflate", + "jquery.throttle-debounce", + "mediawiki.api.edit" ] }, "ext.cx.publish": { diff --git a/modules/translation/ext.cx.translation.draft.js b/modules/translation/ext.cx.translation.loader.js similarity index 92% rename from modules/translation/ext.cx.translation.draft.js rename to modules/translation/ext.cx.translation.loader.js index cbcf5a6..3c0449c 100644 --- a/modules/translation/ext.cx.translation.draft.js +++ b/modules/translation/ext.cx.translation.loader.js @@ -1,5 +1,5 @@ /*! - * ContentTranslation - Save translation as draft + * ContentTranslation - Fetch and restore a saved translation * * @ingroup Extensions * @copyright See AUTHORS.txt @@ -11,7 +11,7 @@ /** * @class */ - function ContentTranslationDraft() { + function ContentTranslationLoader() { this.$draft = null; this.$sourceColumn = null; this.$translationColumn = null; @@ -19,11 +19,11 @@ } /** - * Initalize the draft storage. + * Initalize loader * * @return {jQuery.Promise} */ - ContentTranslationDraft.prototype.init = function () { + ContentTranslationLoader.prototype.init = function () { var self = this; // There is no known consumer for this return value. Just returning it // to help testing in future. @@ -55,7 +55,7 @@ * * @return {string} HTML to save */ - ContentTranslationDraft.prototype.getContent = function () { + ContentTranslationLoader.prototype.getContent = function () { var $content, $translationColumn; $translationColumn = this.$translationColumn || @@ -79,7 +79,7 @@ return $content.html(); }; - ContentTranslationDraft.prototype.showConflictWarning = function ( translation ) { + ContentTranslationLoader.prototype.showConflictWarning = function ( translation ) { mw.loader.using( 'ext.cx.translation.conflict' ).then( function () { mw.hook( 'mw.cx.translation.conflict' ).fire( translation ); } ); @@ -90,7 +90,7 @@ * * @return {jQuery.Promise} */ - ContentTranslationDraft.prototype.find = function () { + ContentTranslationLoader.prototype.find = function () { var api = new mw.Api(); return api.get( { @@ -110,7 +110,7 @@ * * @return {jQuery.Promise} */ - ContentTranslationDraft.prototype.fetch = function () { + ContentTranslationLoader.prototype.fetch = function () { var self = this, api = new mw.Api(); @@ -156,7 +156,7 @@ * @param {jQuery} $section Add it before/after this section. * @param {string} afterOrBefore Whether the orphan to be added after or before $section. */ - ContentTranslationDraft.prototype.addOrphanTranslation = function ( $translation, $section, afterOrBefore ) { + ContentTranslationLoader.prototype.addOrphanTranslation = function ( $translation, $section, afterOrBefore ) { // Add a dummy source section var $dummySourceSection = $( '<' + $translation.prop( 'tagName' ) + '>' ) .css( 'height', 1 ) // Non-zero height to avoid it being ignored by keepAlignment plugin. @@ -184,7 +184,7 @@ /** * Restore this draft to the appropriate placeholders */ - ContentTranslationDraft.prototype.restore = function () { + ContentTranslationLoader.prototype.restore = function () { var i, j, $sourceColumn, $translationColumn, sectionId, sourceId, randomId, $draftSection = [], @@ -315,5 +315,5 @@ ); }; - mw.cx.ContentTranslationDraft = ContentTranslationDraft; + mw.cx.ContentTranslationLoader = ContentTranslationLoader; }( jQuery, mediaWiki ) ); diff --git a/modules/translation/ext.cx.translation.storage.init.js b/modules/translation/ext.cx.translation.storage.init.js index 9e6ab8f..1299e4c 100644 --- a/modules/translation/ext.cx.translation.storage.init.js +++ b/modules/translation/ext.cx.translation.storage.init.js @@ -9,7 +9,7 @@ $( function () { var storageModules = [ - 'ext.cx.translation.draft' + 'ext.cx.translation.loader' ]; if ( mw.config.get( 'wgContentTranslationDatabase' ) === null ) { @@ -21,10 +21,10 @@ } // CX Database configured. mw.loader.using( storageModules ).then( function () { - var storage, draft; + var storage, translationLoader; - draft = new mw.cx.ContentTranslationDraft(); - draft.init(); + translationLoader = new mw.cx.ContentTranslationLoader(); + translationLoader.init(); if ( mw.cx.ContentTranslationStorage ) { storage = new mw.cx.ContentTranslationStorage(); storage.init(); -- To view, visit https://gerrit.wikimedia.org/r/268623 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4270714fef28e58606405395295dbd6cc5a9be0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits