[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 /*! 2 * JavaScript for Special:Import 3 */ 4 ( function ( $ ) { 5 function updateImportSubprojectList() { 6 var $projectField = $( '#mw-import-table-interwiki #interwiki' ), 7 $subprojectField = $projectField.parent().find( '#subproject' ), 8 $selected = $projectField.find( ':selected' ), 9 oldValue = $subprojectField.val(), 10 option, options; 11 12 if ( $selected.attr( 'data-subprojects' ) ) { 13 options = $.map( $selected.attr( 'data-subprojects' ).split( ' ' ), function ( el ) { 14 option = document.createElement( 'option' ); 15 option.appendChild( document.createTextNode( el ) ); 16 option.setAttribute( 'value', el ); 17 if ( oldValue === el ) { 18 option.setAttribute( 'selected', 'selected' ); 19 } 20 return option; 21 } ); 22 $subprojectField.show().empty().append( options ); 23 } else { 24 $subprojectField.hide(); 25 } 26 } 27 28 $( function () { 29 var $projectField = $( '#mw-import-table-interwiki #interwiki' ); 30 if ( $projectField.length ) { 31 $projectField.change( updateImportSubprojectList ); 32 updateImportSubprojectList(); 33 } 34 } ); 35 }( jQuery ) );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |