Gilles has uploaded a new change for review.

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


Change subject: Fix the i18n source string for the chunked preference
......................................................................

Fix the i18n source string for the chunked preference

Seemed like a good idea to have the chunk size defined in one
place while I was at it.

Bug: 59906
Change-Id: I9a430e9c06f9efd8a22f5632951025a4cc12a0a8
---
M UploadWizard.config.php
M UploadWizard.i18n.php
M UploadWizardHooks.php
M resources/mw.FormDataTransport.js
4 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/11/106711/1

diff --git a/UploadWizard.config.php b/UploadWizard.config.php
index d593e21..6aab616 100644
--- a/UploadWizard.config.php
+++ b/UploadWizard.config.php
@@ -601,6 +601,9 @@
        // set to "opt-in" to control via experimental user preference under 
'Uploads' tab
        'enableChunked' => false,
 
+       // If chunked uploads are enabled, what size, in MB, should each chunk 
be?
+       'chunkSize' => 5,
+
        // Should feature to copy metadata across a batch of uploads be enabled?
        'copyMetadataFeature' => true,
 
diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index a8bacec..5790d17 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -418,7 +418,7 @@
        'mwe-upwiz-prefs-def-license-def' => 'Use whatever the default is',
        'mwe-upwiz-prefs-license-own' => 'Own work - $1',
        'mwe-upwiz-prefs-license-thirdparty' => "Someone else's work - $1",
-       'mwe-upwiz-prefs-chunked' => 'Chunked uploads for files over 1MB in 
Upload Wizard',
+       'mwe-upwiz-prefs-chunked' => 'Chunked uploads for files over $1MB in 
Upload Wizard',
        'mwe-upwiz-prefs-skiptutorial' => 'Skip introductory licensing 
tutorial',
        'mwe-upwiz-prefs-maxsimultaneous-upload' => 'Maximum number of 
concurrent uploads',
 
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 2c80321..5c088b9 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -608,7 +608,7 @@
                        if ( UploadWizardConfig::getSetting( 'enableChunked' ) 
=== 'opt-in' ) {
                                $preferences['upwiz-chunked'] = array(
                                        'type' => 'check',
-                                       'label-message' => 
'mwe-upwiz-prefs-chunked',
+                                       'label-message' => array( 
'mwe-upwiz-prefs-chunked', UploadWizardConfig::getSetting( 'chunkSize' ) ),
                                        'section' => 
'uploads/upwiz-experimental'
                                );
                        }
diff --git a/resources/mw.FormDataTransport.js 
b/resources/mw.FormDataTransport.js
index 89f6e4f..8cef953 100644
--- a/resources/mw.FormDataTransport.js
+++ b/resources/mw.FormDataTransport.js
@@ -17,7 +17,7 @@
 
     this.postUrl = postUrl;
     //set chunk size to 5MB or max php size
-    this.chunkSize = Math.min(5 * 1024 * 1024, 
mw.UploadWizard.config.maxPhpUploadSize);
+    this.chunkSize = Math.min( mw.UploadWizard.config.chunkSize * 1024 * 1024, 
mw.UploadWizard.config.maxPhpUploadSize );
     this.maxRetries = 2;
     this.retries = 0;
     this.firstPoll = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a430e9c06f9efd8a22f5632951025a4cc12a0a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to