Santhosh has uploaded a new change for review.

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

Change subject: If autosave is possible, do not show the page unload prompt
......................................................................

If autosave is possible, do not show the page unload prompt

Instead of that, just save the translation in progress.

Change-Id: I87a51fd16a46923766a28a10637ceeba9de929ba
---
M modules/translation/ext.cx.translation.progress.js
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/72/178472/1

diff --git a/modules/translation/ext.cx.translation.progress.js 
b/modules/translation/ext.cx.translation.progress.js
index da5ff70..bbc1930 100644
--- a/modules/translation/ext.cx.translation.progress.js
+++ b/modules/translation/ext.cx.translation.progress.js
@@ -146,7 +146,14 @@
                        any: 0
                } );
                window.onbeforeunload = function () {
-                       var weights = getTranslationWeights( 
getSectionsWithContent() );
+                       var weights;
+
+                       if ( mw.config.get( 'wgContentTranslationDatabase' ) 
!== null ) {
+                               mw.hook( 'mw.cx.save' ).fire();
+                               return;
+                       }
+
+                       weights = getTranslationWeights( 
getSectionsWithContent() );
 
                        // Check if there are unsaved human content
                        if ( weights.human > 0 ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87a51fd16a46923766a28a10637ceeba9de929ba
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

Reply via email to