https://bugzilla.wikimedia.org/show_bug.cgi?id=34848
Krinkle <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10171|1 |0 is patch| | --- Comment #4 from Krinkle <[email protected]> 2012-03-05 06:49:06 UTC --- Comment on attachment 10171 --> https://bugzilla.wikimedia.org/attachment.cgi?id=10171 Example >$(function(){ > var nsList = [], reNS, nsNum, > $title = $('#wpNewTitleMain'), > $ns = $('#wpNewTitleNs'); > $.each(mw.config.get('wgNamespaceIds'), function( ns, num ){ > if(ns!== ''){ > nsList.push( $.escapeRE( ns ) ); > } > }); > nsList = nsList.join('|'); > reNS = new RegExp( '^(:' + nsList + '):(.+)$', 'i' ); > > $title.bind('paste', function(){ > setTimeout(function(){ > var ns, m; > m = decodeURIComponent( $title.val() ).replace(/ /g, > '_').match( reNS ); > if( m && m.length === 3 ){ > m[1] = m[1].toLowerCase(); > nsNum = mw.config.get('wgNamespaceIds')[ m[1] ]; > ns = mw.config.get('wgFormattedNamespaces')[ > nsNum ]; > if( ns !== undefined ){ > $title.val( m[2] ); > $ns.val( nsNum ); > } > } > },0); > }); >}); -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
