r65890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65889‎ | r65890 | r65891 >
Date:03:43, 4 May 2010
Author:neilk
Status:deferred
Tags:
Comment:
choosing custom deeds basically working
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
@@ -86,7 +86,8 @@
8787
8888 "mwe-prevent-close": "Your files are still uploading. Are you sure you want to navigate away from this page?",
8989
90 - "mwe-upwiz-files-complete": "Your files finished uploading!"
 90+ "mwe-upwiz-files-complete": "Your files finished uploading!",
 91+ "mwe-upwiz-deeds-later": "Set deeds and licenses for each file individually on the next page"
9192 } );
9293
9394
@@ -1865,8 +1866,9 @@
18661867
18671868 + '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-deeds">'
18681869 + '<div id="mwe-upwiz-deeds-intro"></div>'
1869 - + '<div id="mwe-upwiz-deeds-thumbnails"></div>'
1870 - + '<div id="mwe-upwiz-deeds"></div>'
 1870+ + '<div id="mwe-upwiz-deeds-thumbnails" class="ui-helper-clearfix"></div>'
 1871+ + '<div id="mwe-upwiz-deeds" class="ui-helper-clearfix"></div>'
 1872+ + '<div id="mwe-upwiz-deeds-custom" class="ui-helper-clearfix"></div>'
18711873 + '<div class="mwe-upwiz-buttons"/>'
18721874 + '<button class="mwe-upwiz-button-next" disabled="true" />'
18731875 + '</div>'
@@ -1907,12 +1909,6 @@
19081910 // within FILE step div
19091911 $j('#mwe-upwiz-upload-ctrl').click( function() {
19101912 _this.removeEmptyUploads();
1911 -
1912 - // we set up deed chooser here, because it's only now that we know how many uploads there are
1913 - // possibly it could have some kind of morphing interface for singular/plural, but this doesn't
1914 - // seem too bad for now.
1915 - _this.deedChooser = new mw.UploadWizardDeedChooser( '#mwe-upwiz-deeds', ( _this.uploads.length > 1 ) );
1916 -
19171913 _this.startUploads();
19181914 } );
19191915
@@ -1921,12 +1917,63 @@
19221918 } );
19231919
19241920 // DEEDS div
 1921+ _this.deedChooser = new mw.UploadWizardDeedChooser( '#mwe-upwiz-deeds' );
 1922+
 1923+ var customDeed = $j.extend( new mw.UploadWizardDeed(), {
 1924+ isReady: function() { return true; },
 1925+ setQuantity: function( n ) { return; }
 1926+ } );
 1927+
 1928+ $j( '#mwe-upwiz-deeds-custom' ).append(
 1929+ $j( '<div id="mwe-upwiz-deeds-later" style="hidden"/>' )
 1930+ .append( $j( '<label>' )
 1931+ .append(
 1932+ $j( '<input />')
 1933+ .attr( { type: 'checkbox', value: 'deeds-later' } )
 1934+ .addClass( 'mwe-accept-deed' )
 1935+ .click( function() {
 1936+ if ( $j( this ).is( ':checked' ) ) {
 1937+ _this.deedChooser.showDeedChoice();
 1938+ _this.deedChooser.choose( customDeed );
 1939+ } else {
 1940+ _this.deedChooser.choose( mw.UploadWizardNullDeed );
 1941+ }
 1942+ } ),
 1943+ $j( '<span />').append( gM( 'mwe-upwiz-deeds-later' ) )
 1944+ )
 1945+ )
 1946+ );
 1947+
 1948+ $j( _this.deedChooser ).bind( 'setQuantity', function() {
 1949+ if ( _this.count > 1 ) {
 1950+ $j( '#mwe-upwiz-deeds-later' ).show();
 1951+ } else {
 1952+ $j( '#mwe-upwiz-deeds-later' ).hide();
 1953+ }
 1954+ } );
 1955+
19251956 $j( '#mwe-upwiz-deeds-intro' ).html( gM( 'mwe-upwiz-deeds-intro' ) );
19261957
19271958 $j( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next').click( function() {
19281959 _this.moveToStep('details');
19291960 } );
19301961
 1962+ $j( _this.deedChooser ).bind( 'chooseDeed', function() {
 1963+ $j( '#mwe-upwiz-stepdiv-deeds' ).enableNextButton();
 1964+ var isCustom = ( _this.deedChooser.deed === customDeed );
 1965+ $j.each( _this.uploads, function( i, upload ) {
 1966+ upload.details.toggleCustomDeed( isCustom );
 1967+ } );
 1968+ } );
 1969+
 1970+ $j( _this.deedChooser ).bind( 'chooseNullDeed', function() {
 1971+ $j( '#mwe-upwiz-stepdiv-deeds' ).disableNextButton();
 1972+ $j.each( _this.uploads, function( i, upload ) {
 1973+ upload.details.toggleCustomDeed( false );
 1974+ } );
 1975+ } );
 1976+
 1977+
19311978 // DETAILS div
19321979 $j( '#mwe-upwiz-stepdiv-details' ).click( function() {
19331980 _this.detailsSubmit( function() {
@@ -2032,13 +2079,19 @@
20332080 */
20342081 setUploadFilled: function( upload ) {
20352082 var _this = this;
 2083+
20362084 // XXX check if it has a file?
 2085+
20372086 _this.uploads.push( upload );
20382087 _this.updateFileCounts();
20392088
2040 - upload.deedPreview = new mw.UploadWizardDeedPreview( upload );
2041 - upload.deedChooser = _this.deedChooser;
2042 -
 2089+ upload.deedPreview = new mw.UploadWizardDeedPreview( upload );
 2090+
 2091+ // this will modify upload, so it has a .deedChooser property.
 2092+ // We use a method to so we notify deedChooser that it has a new upload -- interface
 2093+ // will change based on quantity etc. Maybe we could be clever with bind here.
 2094+ _this.deedChooser.attach( upload );
 2095+
20432096 // set up details
20442097 upload.details = new mw.UploadWizardDetails( upload, $j( '#mwe-upwiz-macro-files' ));
20452098 },
@@ -2054,7 +2107,10 @@
20552108 */
20562109 removeUpload: function( upload ) {
20572110 var _this = this;
2058 - upload.unbind(); // everything
 2111+ $j( upload ).unbind(); // everything
 2112+ if ( upload.deedChooser ) {
 2113+ upload.deedChooser.detach( upload );
 2114+ }
20592115 mw.UploadWizardUtil.removeItem( _this.uploads, upload );
20602116 _this.updateFileCounts();
20612117 },
@@ -2352,35 +2408,35 @@
23532409 };
23542410
23552411 mw.UploadWizardNullDeed = $j.extend( new mw.UploadWizardDeed(), {
2356 - isReady: function() {
2357 - return false;
2358 - }
 2412+ isReady: function() { return false; },
 2413+
 2414+ setQuantity: function( n ) { return; }
 2415+
23592416 } );
23602417
23612418
23622419
 2420+
 2421+
23632422 /**
23642423 * @param selector where to put this deed chooser
23652424 * @param isPlural whether this chooser applies to multiple files (changes messaging mostly)
23662425 */
2367 -mw.UploadWizardDeedChooser = function( selector, isPlural ) {
 2426+mw.UploadWizardDeedChooser = function( selector ) {
23682427 var _this = this;
23692428 _this.selector = selector;
23702429 _this.deed = mw.UploadWizardNullDeed;
23712430
23722431 items = [];
23732432 $j.each( [ 'ownwork', 'thirdparty' ], function (i, key) {
2374 - gMkey = isPlural ? key + '-plural' : key;
23752433 var item =
23762434 '<div class="mwe-upwiz-macro-deed-' + key + ' mwe-upwiz-deed">'
23772435 + '<div class="mwe-upwiz-deed-option-title">'
23782436 + '<span class="mwe-upwiz-deed-header mwe-closed">'
2379 - + '<a class="mwe-upwiz-deed-header-link mwe-upwiz-deed-name">'
2380 - + gM( 'mwe-upwiz-source-' + gMkey )
2381 - + '</a>'
 2437+ + '<a class="mwe-upwiz-deed-header-link mwe-upwiz-deed-name"></a>'
23822438 + '</span>'
23832439 + '<span class="mwe-upwiz-deed-header mwe-open" style="display: none;">'
2384 - + '<span class="mwe-upwiz-deed-name">' + gM( 'mwe-upwiz-source-' + gMkey ) + '</span>'
 2440+ + '<span class="mwe-upwiz-deed-name"></span>'
23852441 + ' <a class="mwe-upwiz-macro-deeds-return">' + gM( 'mwe-upwiz-change' ) + '</a>'
23862442 + '</span>'
23872443 + '</div>'
@@ -2391,17 +2447,63 @@
23922448
23932449 $j( selector ).html( items.join('') );
23942450
2395 - $j( '.mwe-upwiz-macro-deeds-return' ).click( function() { _this.showDeedChoice(); } );
 2451+ $j( '.mwe-upwiz-macro-deeds-return' ).click( function() {
 2452+ _this.choose( mw.UploadWizardNullDeed );
 2453+ _this.showDeedChoice();
 2454+ } );
23962455
2397 - // this sets up the hidden divs propertly, so we can set up deeds behind the scenes.
 2456+ _this.choose( mw.UploadWizardNullDeed );
23982457 _this.showDeedChoice();
23992458
24002459 // set up the deed interfaces
2401 - _this.setupDeedOwnWork( isPlural );
2402 - _this.setupDeedThirdParty( isPlural );
 2460+ _this.deeds = {
 2461+ 'ownwork' : _this.setupDeedOwnWork(),
 2462+ 'thirdparty' : _this.setupDeedThirdParty()
 2463+ };
 2464+
 2465+ _this.setQuantity(1);
24032466 };
24042467
 2468+
24052469 mw.UploadWizardDeedChooser.prototype = {
 2470+
 2471+ count: 0,
 2472+
 2473+ attach: function( upload ) {
 2474+ var _this = this;
 2475+ upload.deedChooser = _this;
 2476+ _this.count++;
 2477+ _this.setQuantity();
 2478+ },
 2479+
 2480+ detach: function( upload ) {
 2481+ _this.count--;
 2482+ _this.setQuantity();
 2483+ },
 2484+
 2485+ // modify various interface strings depending on singular, multiple deeds
 2486+ setQuantity: function() {
 2487+ var _this = this;
 2488+ mw.log( "setting quantity of deed to " + _this.count );
 2489+ var isPlural = _this.count > 1;
 2490+ $j.each( [ 'ownwork', 'thirdparty' ], function (i, key) {
 2491+
 2492+ // fix the deed title that opens and closes
 2493+ gMkey = isPlural ? key + '-plural' : key;
 2494+ $j( _this.selector )
 2495+ .find( '.mwe-upwiz-macro-deed-' + key)
 2496+ .find( '.mwe-upwiz-deed-name' )
 2497+ .html( gM( 'mwe-upwiz-source-' + gMkey ) );
 2498+
 2499+ // any other internal strings in the deed
 2500+ if ( _this.deeds[key] ) {
 2501+ _this.deeds[key].setQuantity( _this.count );
 2502+ }
 2503+
 2504+ } );
 2505+
 2506+ },
 2507+
24062508 choose: function( deed ) {
24072509 var _this = this;
24082510 _this.deed = deed;
@@ -2425,8 +2527,6 @@
24262528 $j( _this.selector ).find( '.mwe-upwiz-deed-header.mwe-closed' ).show();
24272529 $j( _this.selector ).find( '.mwe-upwiz-deed' ).maskSafeShow();
24282530 $j( _this.selector ).find( '.mwe-upwiz-deed-form' ).maskSafeHide();
2429 - // reset deed
2430 - _this.choose( mw.UploadWizardNullDeed );
24312531 },
24322532
24332533 /**
@@ -2442,7 +2542,7 @@
24432543 /**
24442544 * Set up the form and deed object for the deed option that says these uploads are all the user's own work.
24452545 */
2446 - setupDeedOwnWork: function( isPlural ) {
 2546+ setupDeedOwnWork: function() {
24472547 mw.log("setupdeed own work");
24482548 var _this = this;
24492549
@@ -2454,10 +2554,8 @@
24552555 var licenseInput = new mw.UploadWizardLicenseInput( licenseInputDiv );
24562556 licenseInput.setDefaultValues();
24572557
2458 - var plural = isPlural ? '-plural' : '';
 2558+ var ownWorkDeed = $j.extend( new mw.UploadWizardDeed(), {
24592559
2460 - var ownWorkDeed = $j.extend( new mw.UploadWizardDeed(), {
2461 -
24622560 licenseInput: licenseInput,
24632561
24642562 isReady: function() {
@@ -2484,111 +2582,136 @@
24852583 } );
24862584 wikiText += '}}';
24872585 return wikiText;
2488 - }
2489 - } );
 2586+ },
24902587
2491 - var standardDiv = $j( '<div />' )
2492 - .append(
2493 - $j( '<input />')
2494 - .attr( { type: 'checkbox' } )
2495 - .click( function() {
2496 - if ( $j( this ).is( ':checked' ) ) {
2497 - $j( _this.selector )
2498 - .find( '.mwe-upwiz-deed-accept-ownwork-custom' )
2499 - .attr( 'checked', false );
2500 - ownWorkDeed.licenseInput.setDefaultValues();
2501 - _this.choose( ownWorkDeed );
2502 - } else {
2503 - _this.choose( mw.UploadWizardNullDeed );
2504 - }
2505 - } )
2506 - .addClass( 'mwe-upwiz-deed-accept-ownwork-default mwe-accept-deed mwe-checkbox-hang-indent' ),
2507 - $j( '<p />' )
2508 - .addClass( 'mwe-checkbox-hang-indent-text' )
2509 - .html( gM( 'mwe-upwiz-source-ownwork-assert' + plural,
2510 - $j( '<input />' )
2511 - .attr( { name: 'author' } )
2512 - .addClass( 'mwe-upwiz-sign' ) ) ),
2513 - $j( '<p />' )
2514 - .addClass( 'mwe-checkbox-hang-indent-text' )
2515 - .addClass( 'mwe-small-print' )
2516 - .html( gM ( 'mwe-upwiz-source-ownwork-assert-note' ) )
2517 - );
 2588+ createInterface: function( deedChooser ) {
 2589+ var _this = this;
 2590+ _this.deedChooser = deedChooser;
25182591
2519 - var toggleDiv = $j('<div />');
 2592+ var standardDiv = $j( '<div />' )
 2593+ .append(
 2594+ $j( '<input />')
 2595+ .attr( { type: 'checkbox' } )
 2596+ .click( function() {
 2597+ if ( $j( this ).is( ':checked' ) ) {
 2598+ $j( deedChooser.selector )
 2599+ .find( '.mwe-upwiz-deed-accept-ownwork-custom' )
 2600+ .attr( 'checked', false );
 2601+ _this.licenseInput.setDefaultValues();
 2602+ deedChooser.choose( ownWorkDeed );
 2603+ } else {
 2604+ deedChooser.choose( mw.UploadWizardNullDeed );
 2605+ }
 2606+ } )
 2607+ .addClass( 'mwe-upwiz-deed-accept-ownwork-default mwe-accept-deed mwe-checkbox-hang-indent' ),
25202608
2521 - var customDiv = $j('<div/>')
2522 - .maskSafeHide()
2523 - .append(
2524 - $j( '<input />')
2525 - .attr( { type: 'checkbox' } )
2526 - .click( function() {
2527 - if ( $j( this ).is( ':checked' ) ) {
2528 - $j( _this.selector )
2529 - .find( '.mwe-upwiz-deed-accept-ownwork-default' )
2530 - .attr( 'checked', false )
2531 - _this.choose( ownWorkDeed );
2532 - } else {
2533 - _this.choose( mw.UploadWizardNullDeed );
2534 - }
2535 - } )
2536 - .addClass( 'mwe-upwiz-deed-accept-ownwork-custom mwe-accept-deed mwe-checkbox-hang-indent' ),
2537 - $j( '<p />' )
2538 - .addClass( 'mwe-checkbox-hang-indent-text' )
2539 - .append( gM( 'mwe-upwiz-source-ownwork-assert-custom' + plural,
2540 - '<span class="mwe-custom-author-input"></span>' ) ),
2541 - licenseInputDiv
2542 - );
 2609+ // text added in setQuantit
 2610+ $j( '<p class="mwe-upwiz-source-ownwork-assert mwe-checkbox-hang-indent-text"/>' ),
25432611
2544 - $j( _this.selector ).find( '.mwe-upwiz-macro-deed-ownwork .mwe-upwiz-deed-form' )
2545 - .append( $j( '<div class="mwe-upwiz-deed-form-internal" />' )
2546 - .append( standardDiv,
2547 - toggleDiv,
2548 - customDiv )
2549 - );
 2612+ $j( '<p />' )
 2613+ .addClass( 'mwe-checkbox-hang-indent-text' )
 2614+ .addClass( 'mwe-small-print' )
 2615+ .html( gM ( 'mwe-upwiz-source-ownwork-assert-note' ) )
 2616+ );
25502617
2551 -
2552 -
2553 - mw.UploadWizardUtil.makeFadingToggler( standardDiv, toggleDiv, customDiv );
 2618+ var toggleDiv = $j('<div />');
25542619
2555 - // if they select 'fewer options', and they have selected the deed in there, we should unselect it
2556 - $j( toggleDiv ).bind( 'close', function(e) {
2557 - e.stopPropagation();
2558 - if ( $j( _this.selector ).find( '.mwe-upwiz-deed-accept-ownwork-custom' ).is( ':checked' ) ) {
2559 - $j( _this.selector )
2560 - .find( '.mwe-upwiz-deed-accept-ownwork-custom' )
2561 - .attr( 'checked', false );
2562 - _this.choose( mw.UploadWizardNullDeed );
2563 - }
2564 - } );
 2620+ var customDiv = $j('<div/>')
 2621+ .maskSafeHide()
 2622+ .append(
 2623+ $j( '<input />')
 2624+ .attr( { type: 'checkbox' } )
 2625+ .click( function() {
 2626+ if ( $j( this ).is( ':checked' ) ) {
 2627+ $j( deedChooser.selector )
 2628+ .find( '.mwe-upwiz-deed-accept-ownwork-default' )
 2629+ .attr( 'checked', false )
 2630+ deedChooser.choose( ownWorkDeed );
 2631+ } else {
 2632+ deedChooser.choose( mw.UploadWizardNullDeed );
 2633+ }
 2634+ } )
 2635+ .addClass( 'mwe-upwiz-deed-accept-ownwork-custom mwe-accept-deed mwe-checkbox-hang-indent' ),
 2636+ $j( '<p class="mwe-upwiz-source-ownwork-assert-custom mwe-checkbox-hang-indent-text" />' ),
 2637+ licenseInputDiv
 2638+ );
25652639
2566 - // have to add the author input this way -- gM() will flatten it to a string and we'll lose it as a dom object
2567 - $j( _this.selector ).find( '.mwe-custom-author-input' ).append( authorInput );
 2640+ $j( deedChooser.selector ).find( '.mwe-upwiz-macro-deed-ownwork .mwe-upwiz-deed-form' )
 2641+ .append( $j( '<div class="mwe-upwiz-deed-form-internal" />' )
 2642+ .append( standardDiv,
 2643+ toggleDiv,
 2644+ customDiv )
 2645+ );
25682646
2569 - // synchronize both username signatures
2570 - // set initial value to configured username
2571 - // if one changes all the others change
2572 - $j( _this.selector ).find( '.mwe-upwiz-sign' )
2573 - .attr( { value: mw.getConfig( 'userName' ) } )
2574 - .keyup( function() {
2575 - var thisInput = this;
2576 - var thisVal = $j( thisInput ).val();
2577 - $j.each( $j( '.mwe-upwiz-sign' ), function( i, input ) {
2578 - if (thisInput !== input) {
2579 - $j( input ).val( thisVal );
 2647+
 2648+
 2649+ mw.UploadWizardUtil.makeFadingToggler( standardDiv, toggleDiv, customDiv );
 2650+
 2651+ // if they select 'fewer options', and they have selected the deed in there, we should unselect it
 2652+ $j( toggleDiv ).bind( 'close', function(e) {
 2653+ e.stopPropagation();
 2654+ if ( $j( deedChooser.selector ).find( '.mwe-upwiz-deed-accept-ownwork-custom' ).is( ':checked' ) ) {
 2655+ $j( deedChooser.selector )
 2656+ .find( '.mwe-upwiz-deed-accept-ownwork-custom' )
 2657+ .attr( 'checked', false );
 2658+ deedChooser.choose( mw.UploadWizardNullDeed );
25802659 }
25812660 } );
2582 - } );
2583 -
25842661
 2662+ _this.setQuantity( 1 );
 2663+ },
 2664+
 2665+
 2666+ setQuantity: function( n ) {
 2667+ var _this = this;
 2668+ var plural = n > 1 ? '-plural' : '';
 2669+ $j( _this.deedChooser.selector )
 2670+ .find( 'p.mwe-upwiz-source-ownwork-assert' )
 2671+ .html( gM( 'mwe-upwiz-source-ownwork-assert' + plural,
 2672+ $j( '<input />' )
 2673+ .attr( { name: 'author' } )
 2674+ .addClass( 'mwe-upwiz-sign' ) ) );
 2675+
 2676+ $j( _this.deedChooser.selector )
 2677+ .find( 'p.mwe-upwiz-source-ownwork-assert-custom' )
 2678+ .html( gM( 'mwe-upwiz-source-ownwork-assert-custom' + plural,
 2679+ '<span class="mwe-custom-author-input"></span>' ) );
 2680+
 2681+ // have to add the author input this way -- gM() will flatten it to a string and we'll lose it as a dom object
 2682+ $j( _this.deedChooser.selector ).find( '.mwe-custom-author-input' ).append( authorInput );
 2683+
 2684+ // synchronize both username signatures
 2685+ // set initial value to configured username
 2686+ // if one changes all the others change
 2687+ $j( _this.deedChooser.selector ).find( '.mwe-upwiz-sign' )
 2688+ .attr( { value: mw.getConfig( 'userName' ) } )
 2689+ .keyup( function() {
 2690+ var thisInput = this;
 2691+ var thisVal = $j( thisInput ).val();
 2692+ $j.each( $j( '.mwe-upwiz-sign' ), function( i, input ) {
 2693+ if (thisInput !== input) {
 2694+ $j( input ).val( thisVal );
 2695+ }
 2696+ } );
 2697+ } );
 2698+
 2699+
 2700+ }
 2701+ } );
 2702+
 2703+ ownWorkDeed.createInterface( _this );
 2704+
25852705 $j( _this.selector ).find( '.mwe-upwiz-macro-deed-ownwork .mwe-upwiz-deed-header-link').click(
25862706 function() {
25872707 _this.showDeed( $j( _this.selector ).find( '.mwe-upwiz-macro-deed-ownwork' ) );
25882708 }
2589 - );
 2709+ );
 2710+
 2711+ return ownWorkDeed;
 2712+
25902713 },
25912714
2592 - setupDeedThirdParty: function( isPlural ) {
 2715+ setupDeedThirdParty: function() {
25932716 var _this = this;
25942717 var sourceInput = $j('<textarea class="mwe-source mwe-long-textarea" name="source" rows="1" cols="40"></textarea>' )
25952718 .growTextArea()
@@ -2607,33 +2730,51 @@
26082731 return (! mw.isEmpty( $j( this.sourceInput ).val() ) )
26092732 && (! mw.isEmpty( $j( this.authorInput ).val() ) )
26102733 && this.licenseInput.isSet()
 2734+ },
 2735+
 2736+ createInterface: function( deedChooser ) {
 2737+ var _this = this;
 2738+ _this.deedChooser = deedChooser;
 2739+
 2740+ $j( deedChooser.selector ).find( '.mwe-upwiz-macro-deed-thirdparty .mwe-upwiz-deed-form' ).append(
 2741+ $j( '<div class="mwe-upwiz-deed-form-internal"/>' )
 2742+ .append(
 2743+ $j( '<div class="mwe-upwiz-source-thirdparty-custom-plural-intro" />' ),
 2744+ $j( '<div />' )
 2745+ .addClass( "mwe-upwiz-thirdparty-fields" )
 2746+ .append( $j( '<label />' )
 2747+ .attr( { 'for' : 'source' } )
 2748+ .text( gM( 'mwe-upwiz-source' ) ) )
 2749+ .append( sourceInput ),
 2750+ $j( '<div />' )
 2751+ .addClass( "mwe-upwiz-thirdparty-fields" )
 2752+ .append( $j( '<label />' )
 2753+ .attr( { 'for' : 'author' } )
 2754+ .text( gM( 'mwe-upwiz-author' ) ) )
 2755+ .append( authorInput ),
 2756+ $j( '<div />' ).addClass( 'mwe-upwiz-thirdparty-license' )
 2757+ .text( gM( 'mwe-upwiz-source-thirdparty-license' ) ),
 2758+ licenseInputDiv
 2759+ )
 2760+ );
 2761+
 2762+ thirdPartyDeed.setQuantity( 1 );
 2763+ },
 2764+
 2765+
 2766+ setQuantity: function( n ) {
 2767+ var _this = this;
 2768+ $j( _this.deedChooser.selector )
 2769+ .find( 'div.mwe-upwiz-source-thirdparty-custom-plural-intro' )
 2770+ .html( n > 1 ? gM( 'mwe-upwiz-source-thirdparty-custom-plural-intro' ) : '' );
26112771 }
 2772+
26122773
26132774 } );
 2775+
 2776+ thirdPartyDeed.createInterface( _this );
26142777
2615 - $j( _this.selector ).find( '.mwe-upwiz-macro-deed-thirdparty .mwe-upwiz-deed-form' ).append(
2616 - $j( '<div class="mwe-upwiz-deed-form-internal"/>' )
2617 - .append(
2618 - ( isPlural ? $j( '<div />' ).append( gM( 'mwe-upwiz-source-thirdparty-custom-plural-intro' ) )
2619 - : '' ),
2620 - $j( '<div />' )
2621 - .addClass( "mwe-upwiz-thirdparty-fields" )
2622 - .append( $j( '<label />' )
2623 - .attr( { 'for' : 'source' } )
2624 - .text( gM( 'mwe-upwiz-source' ) ) )
2625 - .append( sourceInput ),
2626 - $j( '<div />' )
2627 - .addClass( "mwe-upwiz-thirdparty-fields" )
2628 - .append( $j( '<label />' )
2629 - .attr( { 'for' : 'author' } )
2630 - .text( gM( 'mwe-upwiz-author' ) ) )
2631 - .append( authorInput ),
2632 - $j( '<div />' ).addClass( 'mwe-upwiz-thirdparty-license' )
2633 - .text( gM( 'mwe-upwiz-source-thirdparty-license' ) ),
2634 - licenseInputDiv
2635 - )
2636 - );
2637 -
 2778+ // set up the header
26382779 $j( _this.selector ).find( '.mwe-upwiz-macro-deed-thirdparty .mwe-upwiz-deed-header-link').click(
26392780 function() {
26402781 _this.showDeed( $j( _this.selector ).find( '.mwe-upwiz-macro-deed-thirdparty' ) );
@@ -2641,6 +2782,7 @@
26422783 }
26432784 );
26442785
 2786+ return thirdPartyDeed;
26452787 }
26462788 };
26472789
@@ -2949,9 +3091,14 @@
29503092
29513093 $j.fn.enableNextButton = function() {
29523094 this.find( '.mwe-upwiz-button-next' )
2953 - .removeAttr( 'disabled' )
2954 - .effect( 'pulsate', { times: 3 }, 1000 );
 3095+ .removeAttr( 'disabled' );
 3096+ // .effect( 'pulsate', { times: 3 }, 1000 );
29553097 };
 3098+
 3099+ $j.fn.disableNextButton = function() {
 3100+ this.find( '.mwe-upwiz-button-next' )
 3101+ .attr( 'disabled', true );
 3102+ }
29563103
29573104
29583105 } )( jQuery );

Status & tagging log