mw.ForeignStructuredUpload: Use the right license template for Commons
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 13 Oct 2015 15:27:04 +0000 (17:27 +0200)
committerJames D. Forrester <jforrester@wikimedia.org>
Tue, 13 Oct 2015 15:37:54 +0000 (08:37 -0700)
When uploading locally or to different repo, keep the field empty,
since we don't really know what licenses are appropriate (and we don't
name a specific one in the UI).

Change-Id: I5c8f55653dae42e47ac696d44a7b2082adf6d6f2

resources/src/mediawiki/mediawiki.ForeignStructuredUpload.js

index 4ec92e7..dd28ddd 100644 (file)
        };
 
        /**
-        * Gets the wikitext for the license of the upload. Abstract for now.
+        * Gets the wikitext for the license of the upload.
         *
         * @private
         * @return {string}
         */
        ForeignStructuredUpload.prototype.getLicense = function () {
-               return '';
+               // Make sure this matches the messages for different targets in
+               // mw.ForeignStructuredUpload.BookletLayout.prototype.renderUploadForm
+               return this.target === 'shared' ? '{{self|cc-by-sa-4.0}}' : '';
        };
 
        /**