|
|
(18 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| if(wgNamespaceNumber == -1 && /MovePage(\/.+)?/.test(wgTitle)){
| | console.log('__MOVEUTIL_LOG__'); |
| if($('#mw-movepage-table').length){ | |
| $('#wpMovetalk').attr('checked', 'checked');
| |
| $('#wpLeaveRedirect').removeAttr('checked');
| |
| $('#wpMovesubpages').attr('checked', 'checked');
| |
| /* Bind to Submit Event */
| |
| $('#movepage').submit(function(event){
| |
| var from, ns, to, wiki, api, new_wiki;
| |
| api = new mw.Api();
| |
| | |
| from = $('#mw-movepage-table strong').first().text();
| |
| ns = mw.config.get('wgFormatteNamespaces', wgFormattedNamespaces);
| |
| ns = ns[$('#wpNewTitleNs').val()];
| |
| to = $('#wpNewTitleMain').val();
| |
| | |
| event.preventDefault();
| |
| | |
| /* Add Line in MoveList */
| |
| api.postWithToken('edit', {
| |
| 'minor': '',
| |
| 'recreate': '',
| |
| 'bot': '',
| |
| 'action': 'edit',
| |
| 'title': 'User:Boxsnake/MoveList',
| |
| 'summary': 'Bot Adding From Page Move. --[[Special:Gadgets|Move Util]]',
| |
| 'contentmodel': 'wikitext',
| |
| 'appendtext': from + ' -> ' + (ns == '' ? '' : ns + ':') + to
| |
| }).done(function(){
| |
| return;
| |
| });
| |
| });
| |
| }
| |
| }
| |