summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js')
-rw-r--r--www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js b/www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js
new file mode 100644
index 00000000..67610f52
--- /dev/null
+++ b/www/wiki/extensions/Translate/resources/js/ext.translate.special.pagetranslation.js
@@ -0,0 +1,26 @@
+/*!
+ * @author Santhosh Thottingal
+ * @author Niklas Laxström
+ * @license GPL-2.0-or-later
+ */
+
+( function () {
+ 'use strict';
+
+ $( function () {
+ $( '#wpUserLanguage' ).multiselectautocomplete( { inputbox: '#tpt-prioritylangs' } );
+
+ $( '#mw-content-text' ).on( 'click', '.mw-translate-jspost', function ( e ) {
+ var params,
+ uri = new mw.Uri( e.target.href );
+
+ params = uri.query;
+ params.token = mw.user.tokens.get( 'csrfToken' );
+ $.post( uri.path, params ).done( function () {
+ location.reload();
+ } );
+
+ e.preventDefault();
+ } );
+ } );
+}() );