r64193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64192‎ | r64193 | r64194 >
Date:21:39, 25 March 2010
Author:neilk
Status:deferred
Tags:
Comment:
Commons deed, Own work case
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/UploadWizard/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/UploadWizard/mw.UploadWizard.js
@@ -17,13 +17,15 @@
1818 "mwe-upwiz-progressbar-uploading": "uploading",
1919 "mwe-upwiz-remaining": "$1 remaining",
2020 "mwe-upwiz-intro-details": "Thank you for uploading your works! Now we need some basic information in order to complete your upload.",
21 - "mwe-upwiz-provenance-ownwork": "They are entirely your own work.",
22 - "mwe-upwiz-provenance-ownwork-assert": "I, $1, the copyright holder of this work, hereby grant anyone the right to use these works for any purpose, as long as they credit me and share derivative work under the same terms.",
23 - "mwe-upwiz-provenance-ownwork-assert-note": "This means you release your work under a double Creative Commons Attribution ShareAlike and GFDL license.",
24 - "mwe-upwiz-provenance-permission": "Their author gave you explicit permission to upload them",
25 - "mwe-upwiz-provenance-website": "They come from a website",
26 - "mwe-upwiz-provenance-custom": "Did you know? You can <a href=\"$1\">customize</a> the default options you see here.",
 21+ "mwe-upwiz-source-ownwork": "They are entirely your own work.",
 22+ "mwe-upwiz-source-ownwork-assert": "I, $1, the copyright holder of this work, hereby grant anyone the right to use these works for any purpose, as long as they credit me and share derivative work under the same terms.",
 23+ "mwe-upwiz-source-ownwork-assert-custom": "I, $1, the copyright holder of this work, hereby publish these works under the following license(s):",
 24+ "mwe-upwiz-source-ownwork-assert-note": "This means you release your work under a double Creative Commons Attribution ShareAlike and GFDL license.",
 25+ "mwe-upwiz-source-permission": "Their author gave you explicit permission to upload them",
 26+ "mwe-upwiz-source-thirdparty": "They come from a website",
 27+ "mwe-upwiz-source-custom": "Did you know? You can <a href=\"$1\">customize</a> the default options you see here.",
2728 "mwe-upwiz-more-options": "more options...",
 29+ "mwe-upwiz-fewer-options": "fewer options...",
2830 "mwe-upwiz-desc": "Description in",
2931 "mwe-upwiz-desc-add-n": "add a description in another language",
3032 "mwe-upwiz-desc-add-0": "add a description",
@@ -45,6 +47,8 @@
4648 "mwe-upwiz-other-prefill": "Free wikitext field",
4749 "mwe-upwiz-showall": "show all",
4850 "mwe-upwiz-source": "Source",
 51+ "mwe-upwiz-macro-edit-intro": "Please add some descriptions and other information to your uploads, and then press 'Update descriptions'",
 52+ "mwe-upwiz-macro-edit": "Update descriptions",
4953 "mwe-upwiz-thanks-intro": "Thanks for uploading your works! You can now use your files on a Wikipedia article or link to them from elsewhere on the web.",
5054 "mwe-upwiz-thanks-link": "This file is now available at <b><tt>$1</tt></b>.",
5155 "mwe-upwiz-thanks-wikitext": "To use it in a Wikipedia article, copy this text into an article: ",
@@ -55,6 +59,7 @@
5660 "mwe-upwiz-upload-error-stashed-anyway": "Post anyway?",
5761 "mwe-upwiz-ok": "OK",
5862 "mwe-upwiz-cancel": "Cancel",
 63+ "mwe-upwiz-change": "(change)",
5964
6065 /* copied from mw.UploadHandler :( */
6166 "mwe-fileexists" : "A file with this name exists already. Please check <b><tt>$1<\/tt><\/b> if you are not sure if you want to replace it.",
@@ -176,11 +181,12 @@
177182 var _this = this;
178183 var c = mw.UploadWizardLicenseInput.prototype.count++;
179184
 185+ // XXX get these for real
180186 _this.licenses = {
181187 pd: { template: 'pd', text: 'Public Domain' },
182188 cc0: { template: 'cc0', text: 'Creative Commons Zero waiver' },
183 - cc_by_30: { template: 'cc_by_30', text: 'Creative Commons Attribution 3.0' },
184 - cc_by_sa_30: { template: 'cc_by_sa_30', text: 'Creative Commons Attribution ShareAlike 3.0' },
 189+ cc_by_30: { template: 'cc-by-30', text: 'Creative Commons Attribution 3.0' },
 190+ cc_by_sa_30: { template: 'cc-by-sa-30', text: 'Creative Commons Attribution ShareAlike 3.0' },
185191 gfdl: { template: 'gfdl', text: 'GFDL (GNU Free Documentation License)' }
186192 };
187193
@@ -195,7 +201,7 @@
196202 );
197203 } );
198204
199 - if (values) {
 205+ if ( values ) {
200206 _this.setValues( values );
201207 }
202208 };
@@ -229,7 +235,34 @@
230236 $j( _this.licenses[key].input ).attr( { 'checked' : 1 } );
231237 }
232238 } );
 239+ },
 240+
 241+ /**
 242+ * Set the default configured licenses - should change per wiki
 243+ */
 244+ setDefaultValues: function() {
 245+ var _this = this;
 246+ var values = {};
 247+ $j.each( mw.getConfig('defaultLicenses'), function( i, license ) {
 248+ values[license] = true;
 249+ } );
 250+ _this.setValues( values );
 251+ },
 252+
 253+ /**
 254+ * Gets which values are set
 255+ * Always returns the full set of licenses, even if most are false
 256+ * @return object of object of license-key to boolean values, e.g. { cc_by: false; cc_by_sa_30: true, gfdl: true }
 257+ */
 258+ getValues: function() {
 259+ var _this = this;
 260+ var values = {};
 261+ $j.each( _this.licenses, function( key, data ) {
 262+ values[key] = $j( _this.licenses[key].input ).is( ':checked' );
 263+ } );
 264+ return values;
233265 }
 266+
234267 };
235268
236269
@@ -780,6 +813,8 @@
781814
782815
783816 _this.dateInput = $j( '<input type="text" class="mwe-date" size="20"/>' );
 817+ // XXX suddenly this isn't working. Seems to be a problem with monobook. If I datepicker-ify an input outside the
 818+ // content area, it works. Vector is fine
784819 $j( _this.dateInput ).datepicker( {
785820 dateFormat: 'yy-mm-dd', // oddly, this means yyyy-mm-dd
786821 buttonImage: '/js/mwEmbed/skins/common/images/calendar.gif',
@@ -803,30 +838,29 @@
804839
805840 // XXX why is rows=1 giving me two rows. Is this growTextArea's fault?
806841 _this.sourceInput = $j('<textarea class="mwe-source" rows="1" cols="40"></textarea>' ).growTextArea();
807 - var sourceDiv = $j( '<div></div>' )
 842+ _this.sourceDiv = $j( '<div></div>' )
808843 .append( $j( '<div class="mwe-details-more-label"></div>' ).append( gM( 'mwe-upwiz-source' ) ) )
809844 .append( $j( '<div class="mwe-details-more-input"></div>' ).append( _this.sourceInput ) );
810845
811846
812847 _this.authorInput = $j('<textarea class="mwe-author" rows="1" cols="40"></textarea>' ).growTextArea();
813 -
 848+ _this.authorDiv = $j( '<div></div>' )
 849+ .append( $j( '<div class="mwe-details-more-label"></div>' ).append( gM( 'mwe-upwiz-author' ) ) )
 850+ .append( $j( '<div class="mwe-details-more-input"></div>' ).append( _this.authorInput ) );
814851
 852+
815853 var licenseInputDiv = $j('<div></div>');
816 - _this.licenseInput = new mw.UploadWizardLicenseInput(licenseInputDiv, { 'cc_by_sa_30': true, 'gfdl' : true } );
 854+ _this.licenseInput = new mw.UploadWizardLicenseInput( licenseInputDiv );
 855+ _this.licenseDiv = $j( '<div></div>' )
 856+ .append( $j( '<div class="mwe-details-more-label"></div>' ).append( gM( 'mwe-upwiz-license' ) ) )
 857+ .append( $j( '<div class="mwe-details-more-input"></div>' ).append( licenseInputDiv ) );
 858+
817859 var copyrightInfoDiv = $j('<div></div>')
818860 .append( $j( '<h5 class="mwe-details-more-subhead">' ).append( gM( 'mwe-upwiz-copyright-info' ) ) )
819861 .append( $j( '<div class="mwe-details-more-subdiv">' )
820 - .append( sourceDiv )
821 - .append( $j( '<div></div>' )
822 - .append( $j( '<div class="mwe-details-more-label"></div>' ).append( gM( 'mwe-upwiz-author' ) ) )
823 - .append( $j( '<div class="mwe-details-more-input"></div>' ).append( _this.authorInput ) )
824 - )
825 - .append( $j( '<div></div>' )
826 - .append( $j( '<div class="mwe-details-more-label"></div>' ).append( gM( 'mwe-upwiz-license' ) ) )
827 - .append( $j( '<div class="mwe-details-more-input"></div>' ).append( licenseInputDiv ) )
828 - )
829 - );
830 -
 862+ .append( _this.sourceDiv,
 863+ _this.authorDiv,
 864+ _this.licenseDiv ) );
831865
832866 _this.filenameInput = $j('<input type="text" class="mwe-filename" size="30" />' )
833867 .keyup( function() {
@@ -1126,6 +1160,7 @@
11271161 /**
11281162 * Set the title of the thing we just uploaded, visibly
11291163 * Note: the interface's notion of "filename" versus "title" is the opposite of MediaWiki
 1164+ * XXX in the mock the title does NOT include the extension, so fix that -- use a mime-type mapping
11301165 */
11311166 prefillTitle: function() {
11321167 var _this = this;
@@ -1212,8 +1247,8 @@
12131248 */
12141249 prefillAuthor: function() {
12151250 var _this = this;
1216 - if (_this.upload.imageinfo.metadata.artist !== undefined) {
1217 - $j( _this.authorInput ).val( _this.upload.imageinfo.metadata.artist );
 1251+ if (_this.upload.imageinfo.metadata.author !== undefined) {
 1252+ $j( _this.authorInput ).val( _this.upload.imageinfo.metadata.author );
12181253 }
12191254
12201255 },
@@ -1424,8 +1459,34 @@
14251460 var _this = this;
14261461 _this.upload.state = 'complete';
14271462 _this.div.css( { background: 'white' } );
 1463+ },
 1464+
 1465+ /**
 1466+ * Sometimes we wish to lock certain copyright or license info from being changed
 1467+ */
 1468+ lockSource: function() {
 1469+ var _this = this;
 1470+ _this.sourceDiv.hide();
 1471+ },
 1472+
 1473+
 1474+ /**
 1475+ * Sometimes we wish to lock certain copyright or license info from being changed
 1476+ */
 1477+ lockAuthor: function() {
 1478+ var _this = this;
 1479+ _this.authorDiv.hide();
 1480+ },
 1481+
 1482+ /**
 1483+ * Sometimes we wish to lock certain copyright or license info from being changed
 1484+ */
 1485+ lockLicense: function() {
 1486+ var _this = this;
 1487+ _this.licenseDiv.hide();
14281488 }
14291489
 1490+
14301491 }
14311492
14321493
@@ -1512,11 +1573,38 @@
15131574 + '</div>'
15141575 + '<div id="mwe-upwiz-tabdiv-details">'
15151576 + '<div id="mwe-upwiz-macro">'
1516 - + '<div id="mwe-upwiz-macro-choice"></div>'
1517 - + '<div id="mwe-upwiz-macro-edit"></div>'
1518 - + '<div id="mwe-upwiz-macro-macro"></div>'
 1577+ + '<div id="mwe-upwiz-macro-choice">'
 1578+ + '<div>' + gM( 'mwe-upwiz-intro-details' ) + '</div>'
 1579+ + '<div id="mwe-upwiz-macro-deeds">'
 1580+ + '<div id="mwe-upwiz-macro-deed-ownwork" class="deed">'
 1581+ + '<div class="mwe-deed-option-title">'
 1582+ + '<span class="deed-header closed"><a id="mwe-upwiz-source-ownwork">' + gM( 'mwe-upwiz-source-ownwork' ) + '</a></span>'
 1583+ + '<span class="deed-header open" style="display: none;">'
 1584+ + gM( 'mwe-upwiz-source-ownwork' )
 1585+ + ' <a id="mwe-upwiz-source-ownwork-close">' + gM( 'mwe-upwiz-change' ) + '</a>'
 1586+ + '</span>'
 1587+ + '</div>' // more deed stuff set up below
 1588+ + '<div id="mwe-upwiz-macro-deed-ownwork-form" class="deed-form" style="display: none"></div>'
 1589+ + '</div>'
 1590+ + '<div id="mwe-upwiz-macro-deed-thirdparty" class="deed">'
 1591+ + '<div class="mwe-deed-option-title">'
 1592+ + '<span class="deed-header closed"><a id="mwe-upwiz-source-thirdparty">' + gM( 'mwe-upwiz-source-thirdparty' ) + '</a></span>'
 1593+ + '<span class="deed-header open" style="display: none;">'
 1594+ + gM( 'mwe-upwiz-source-thirdparty' )
 1595+ + ' <a id="mwe-upwiz-source-thirdparty-close">' + gM( 'mwe-upwiz-change' ) + '</a>'
 1596+ + '</span>'
 1597+ + '</div>' // more deed stuff set up below
 1598+ + '<div id="mwe-upwiz-macro-deed-thirdparty-form" class="deed-form" style="display: none"></div>'
 1599+ + '</div>'
 1600+ + '</div>'
 1601+ + '</div>'
 1602+ + '<div id="mwe-upwiz-macro-edit" style="display: none">'
 1603+ + '<div class="mwe-upwiz-macro-edit-submit">'
 1604+ + '<p>' + gM( 'mwe-upwiz-macro-edit-intro' ) + '</p>'
 1605+ + '</div>' // button added below
15191606 + '<div id="mwe-upwiz-macro-progress"></div>'
15201607 + '<div id="mwe-upwiz-macro-files"></div>'
 1608+ + '<div class="mwe-upwiz-macro-edit-submit"></div>' // button added below
15211609 + '</div>'
15221610 + '</div>'
15231611 + '</div>'
@@ -1532,13 +1620,35 @@
15331621 // place for file interfaces
15341622 $j('#mwe-upwiz-add-file').click( function() { _this.addUpload() } );
15351623 $j('#mwe-upwiz-upload-ctrl').click( function() { _this.startUploads() } );
 1624+
 1625+ _this.setupDeedOwnWork();
 1626+ _this.setupDeedThirdParty();
 1627+
 1628+ $j( '#mwe-upwiz-source-ownwork' ).click( function() { _this.showDeedOwnWork(); } );
 1629+ $j( '#mwe-upwiz-source-ownwork-close' ).click( function() { _this.showDeedChoice() } );
 1630+ $j( '#mwe-upwiz-source-thirdparty' ).click( function() { _this.showDeedThirdParty(); } );
 1631+ $j( '#mwe-upwiz-source-thirdparty' ).click( function() { _this.showDeedChoice() } );
 1632+
 1633+ $j( '.mwe-upwiz-macro-edit-submit' ).each(
 1634+ this.append( $j( '<input />' )
 1635+ .addClass( 'mwe-details-submit' )
 1636+ .attr( { type: 'submit', value: gM( 'mwe-upwiz-macro-edit' ) } )
 1637+ .click( function() {
 1638+ // move to the top of the page to see the progress bar
 1639+ $j( 'html' ).scrollTop( 0 );
 1640+ _this.detailsSubmit( function() {
 1641+ _this.prefillThanksPage();
 1642+ _this.moveToTab('thanks');
 1643+ } );
 1644+ } ) );
 1645+ );
 1646+
15361647
15371648 // add one to start
15381649 _this.addUpload();
1539 -
1540 - $j( '#mwe-upwiz-macro-choice' )
1541 - .append( $j( '<input type="submit" value="submit all"/>' ).click( function( ) { _this.detailsSubmit() } ));
15421650
 1651+
 1652+ // XXX this is the "submit all details" button
15431653
15441654 // "select" the first tab - highlight, make it visible, hide all others
15451655 _this.moveToTab('file');
@@ -1770,7 +1880,7 @@
17711881 * Submit all edited details and other metadata
17721882 * Works just like startUploads -- parallel simultaneous submits with progress bar.
17731883 */
1774 - detailsSubmit: function() {
 1884+ detailsSubmit: function( endCallback ) {
17751885 var _this = this;
17761886 // some details blocks cannot be submitted (for instance, identical file hash)
17771887 _this.removeBlockedDetails();
@@ -1796,10 +1906,7 @@
17971907 function( upload ) {
17981908 upload.details.submit();
17991909 },
1800 - function() {
1801 - _this.prefillThanksPage();
1802 - _this.moveToTab('thanks')
1803 - }
 1910+ endCallback
18041911 );
18051912 },
18061913
@@ -1902,9 +2009,209 @@
19032010 */
19042011 stop: function() {
19052012
1906 - }
 2013+ },
 2014+ /**
 2015+ * Go back to original source choice.
 2016+ * Assumed that we are in details mode.
 2017+ */
 2018+ showDeedChoice: function() {
 2019+ $j( '#mwe-upwiz-macro-deeds' ).find( '.deed-header.open' ).hide();
 2020+ $j( '#mwe-upwiz-macro-deeds' ).find( '.deed-header.closed' ).show();
 2021+ $j( '#mwe-upwiz-macro-deeds' ).find( '.deed' ).fadeIn( 'fast' );
 2022+ $j( '#mwe-upwiz-macro-deeds' ).find( '.deed-form' ).fadeOut('fast');
 2023+ },
19072024
19082025
 2026+ /**
 2027+ *
 2028+ */
 2029+ showDeedOwnWork: function() {
 2030+ $j( '#mwe-upwiz-macro-deed-ownwork' ).find( '.deed-header.open' ).show();
 2031+ $j( '#mwe-upwiz-macro-deed-ownwork' ).find( '.deed-header.closed' ).hide();
 2032+ $j( '#mwe-upwiz-macro-deed-ownwork' ).siblings().fadeOut( 'fast' );
 2033+ $j( '#mwe-upwiz-macro-deed-ownwork-form' ).fadeIn( 'fast' );
 2034+ // transform the header
 2035+ },
 2036+
 2037+
 2038+ /**
 2039+ *
 2040+ */
 2041+ setupDeedOwnWork: function() {
 2042+ var _this = this;
 2043+ // transition ?
 2044+
 2045+ var sourceInput = $j( '<input />').attr( { name: "source", value: "{{ownwork}}" } );
 2046+ var authorInput = $j( '#mwe-upwiz-macro-deed-ownwork-form' ).find( 'input[name=author]' ).get(0);
 2047+ var licenseInputDiv = $j( '<div></div>' );
 2048+ var licenseInput = new mw.UploadWizardLicenseInput( licenseInputDiv );
 2049+ licenseInput.setDefaultValues();
 2050+
 2051+ // we don't use 'customizable' here, but the applyMacroDeed function will use this to determine
 2052+ // what can and can't be customized for each individual file.
 2053+ $j( authorInput ).data( 'customizable', true );
 2054+ $j( licenseInput ).data( 'customizable', true );
 2055+
 2056+ var ownWorkStandardDiv = $j( '<div />' )
 2057+ .attr( { id: 'mwe-deed-accept-standard-div' } )
 2058+ .append(
 2059+ $j( '<input />')
 2060+ .attr( { id: 'mwe-deed-accept-default', type: 'checkbox' } )
 2061+ .click( function() {
 2062+ licenseInput.setDefaultValues();
 2063+ _this.applyMacroDeed( sourceInput, authorInput, licenseInput );
 2064+ _this.showDetailsFiles();
 2065+ } )
 2066+ .addClass( 'mwe-checkbox-hang-indent' ),
 2067+ $j( '<p />' )
 2068+ .addClass( 'mwe-checkbox-hang-indent-text' )
 2069+ .html( gM( 'mwe-upwiz-source-ownwork-assert',
 2070+ $j( authorInput )
 2071+ .addClass( 'mwe-upwiz-sign' ) ) ),
 2072+ $j( '<p />' )
 2073+ .addClass( 'mwe-checkbox-hang-indent-text' )
 2074+ .addClass( 'mwe-small-print' )
 2075+ .html( gM ( 'mwe-upwiz-source-ownwork-assert-note' ) )
 2076+ );
 2077+
 2078+ var ownWorkToggleCustomDiv = $j( '<div />' )
 2079+ // XXX fix open/closed class to use themeroller icons
 2080+ .addClass( 'mwe-more-options closed' )
 2081+ .append( $j( '<a />' )
 2082+ .click( function() {
 2083+ var open = ! ( $j( this ).data( 'open' ) ) ;
 2084+ $j( this ).data( 'open', open );
 2085+ // on toggle:
 2086+ if ( open ) {
 2087+ // set out class to show the "close" message
 2088+ $j( this ).removeClass( "closed" );
 2089+ $j( this ).addClass( "open" );
 2090+ $j( this ).text( gM( 'mwe-upwiz-fewer-options' ) );
 2091+ // show the more options
 2092+ ownWorkCustomDiv.show();
 2093+ // XXX make the standard option less prominent, disable inputs (restorable)
 2094+ ownWorkStandardDiv.disableInputsFade();
 2095+ } else {
 2096+ $j( this ).removeClass( "open" );
 2097+ $j( this ).removeClass( "closed" );
 2098+ $j( this ).text( gM( 'mwe-upwiz-more-options' ) );
 2099+ // hide the more options
 2100+ ownWorkCustomDiv.hide();
 2101+ // XXX make the standard option as prominent as before, enable and restore inputs
 2102+ ownWorkStandardDiv.enableInputsFade();
 2103+ }
 2104+ } )
 2105+ .data( 'open', false )
 2106+ .text( gM( 'mwe-upwiz-more-options' ) ) );
 2107+
 2108+ var ownWorkCustomDiv = $j('<div/>')
 2109+ .attr( { id: 'mwe-deed-accept-custom-div' } )
 2110+ .append(
 2111+ $j( '<input />')
 2112+ .attr( { id: 'mwe-deed-accept-custom', type: 'checkbox' } )
 2113+ .click( function() {
 2114+ _this.applyMacroDeed( sourceInput, authorInput, licenseInput );
 2115+ _this.showDetailsFiles();
 2116+ } )
 2117+ .addClass( 'mwe-checkbox-hang-indent' ),
 2118+ $j( '<p />' )
 2119+ .addClass( 'mwe-checkbox-hang-indent-text' )
 2120+ .html( gM( 'mwe-upwiz-source-ownwork-assert-custom',
 2121+ $j( '<input />' )
 2122+ .attr( { name: 'author' } )
 2123+ .addClass( 'mwe-upwiz-sign' ) ) ),
 2124+ licenseInputDiv )
 2125+ .hide();
 2126+
 2127+
 2128+ ownWorkHiddenInputsDiv = $j( '<span />' ).hide().append( sourceInput );
 2129+
 2130+ $j( '#mwe-upwiz-macro-deed-ownwork-form' ).
 2131+ append( ownWorkStandardDiv,
 2132+ ownWorkToggleCustomDiv,
 2133+ ownWorkCustomDiv,
 2134+ ownWorkHiddenInputsDiv );
 2135+
 2136+ // synchronize both username signatures
 2137+ // set initial value to configured username
 2138+ // if one changes all the others change
 2139+ $j( '.mwe-upwiz-sign' )
 2140+ .attr( { value: mw.getConfig( 'userName' ) } )
 2141+ .keyup( function() {
 2142+ var thisInput = this;
 2143+ var thisVal = $j( thisInput ).val();
 2144+ $j.each( $j( '.mwe-upwiz-sign' ), function( i, input ) {
 2145+ if (thisInput !== input) {
 2146+ $j( input ).val( thisVal );
 2147+ }
 2148+ } );
 2149+ } );
 2150+
 2151+ },
 2152+
 2153+ /**
 2154+ * Given deed / copyright information from the "macro" stage, modify the properties and editable details of each upload
 2155+ * @param sourceInput an HTML text form element input
 2156+ * @param authorInput an HTML text form element input
 2157+ * @param licenseInput an mw.UploadWizardLicenseInput object
 2158+ */
 2159+ applyMacroDeed: function( sourceInput, authorInput, licenseInput ) {
 2160+ var _this = this;
 2161+ // find all the deeds of all the files, contort them so that they use this deed
 2162+ // (with option to break that too)
 2163+ // okay, so all macrodeeds have a source, author, and license input
 2164+ // find those
 2165+
 2166+ var source = $j( sourceInput ).val();
 2167+ var sourceCustomizable = $j( sourceInput ).data( 'customizable' );
 2168+
 2169+ var author = $j( authorInput ).val();
 2170+ var authorCustomizable = $j( authorInput ).data( 'customizable' );
 2171+
 2172+ var licenses = licenseInput.getValues();
 2173+ var licenseCustomizable = $j( licenseInput ).data( 'customizable' );
 2174+
 2175+ // copy the values in, and apply the appropriate disabler to those inputs.
 2176+ // if an element has the $j().data() property 'customizable', it is allowed to appear in the details to be changed
 2177+ // otherwise should unchangeable. We let the details object sort out how a 'locked' interface looks, which could be as simple
 2178+ // as just hiding the input.
 2179+ $j.each( _this.uploads, function( i, upload ) {
 2180+
 2181+ $j( upload.details.sourceInput ).val( source );
 2182+ if ( !sourceCustomizable ) {
 2183+ upload.details.lockSource();
 2184+ }
 2185+
 2186+ $j( upload.details.authorInput ).val( author );
 2187+ if ( !authorCustomizable ) {
 2188+ upload.details.lockAuthor();
 2189+ }
 2190+
 2191+ upload.details.licenseInput.setValues( licenses );
 2192+ if ( !licenseCustomizable ) {
 2193+ upload.details.lockLicense();
 2194+ }
 2195+
 2196+ } );
 2197+
 2198+ },
 2199+
 2200+ /**
 2201+ * Transition from fiddling around with the deeds to editing details
 2202+ */
 2203+ showDetailsFiles: function() {
 2204+ $j( '#mwe-upwiz-macro-choice' ).fadeOut( 'fast' );
 2205+ $j( '#mwe-upwiz-macro-edit' ).fadeIn( 'fast' );
 2206+ },
 2207+
 2208+ /**
 2209+ *
 2210+ */
 2211+ setupDeedThirdParty: function() {
 2212+
 2213+ },
 2214+
 2215+
19092216 };
19102217
19112218 /**
@@ -1986,3 +2293,23 @@
19872294 return this;
19882295 };
19892296
 2297+jQuery.fn.disableInputsFade = function( options ) {
 2298+ this.fadeTo( 'fast', 0.5 );
 2299+ $j.each( this.find( 'input' ), function( i, input ) {
 2300+ if ( input.disabled ) {
 2301+ $j( input ).data( { wasDisabled: true } );
 2302+ }
 2303+ input.disabled = true;
 2304+ } );
 2305+ return this;
 2306+};
 2307+
 2308+jQuery.fn.enableInputsFade = function( options ) {
 2309+ $j.each( this.find( 'input' ), function( i, input ) {
 2310+ if ( ! $j( input ).data( 'wasDisabled' ) ) {
 2311+ input.disabled = false;
 2312+ }
 2313+ } );
 2314+ this.fadeTo( 'fast', 1.0 );
 2315+ return this;
 2316+};

Status & tagging log