User:CWii/JB2script.js: Difference between revisions

Content deleted Content added
CWii (talk | contribs)
Adding new keeplocal system
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(13 intermediate revisions by 3 users not shown)
Line 1:
function jb2script () {
if( mw.config.get('wgNamespaceNumber') == 6 ) {
mw.util.addPortletLink( 'p-cactions', "javascript:jb2script.callback()", "JB2", "jb2script", "Tag for moval by John Bot II", "");
}
}
Line 8:
jb2script.callback = function jb2scriptCallback() {
var Window = new SimpleWindow( 600, 300 );
Window.setTitle( "John Bot II image movalmover btool" );
var form = new QuickForm( jb2script.callback.evaluate );
var categories = form.append( {
Line 112:
type: 'checkbox',
name: 'keeplocal',
checkedlist: false,[
{ label: 'Keep Locallocal', DO NOT USE YETvalue: 'keeplocal' }
]
 
} );
work_area.append( { type:'submit' } );
Line 177 ⟶ 179:
template = '\{\{jb2move|canMove=yes'
template += '|user=' + mw.config.get('wgUserName');
if ( cc1 != '' ) {
Line 202 ⟶ 204:
}
if(/*var keeplocalform != false ) {e.target;
var checked = template +=form.getChecked( '|keepLocal=yeskeeplocal' );
if( checked.length == 0 ) {
template += '|keepLocal=yes';
}*/
if( keeplocal ) {
template += '|keepLocal=yes';
}
Line 232 ⟶ 240:
var reason = self.params.reason;
template = '\{\{jb2move|canMove=no'
template += '|user=' + mw.config.get('wgUserName');
template += '|reason=' + reason;
template += '\}\}\n'
Line 277 ⟶ 285:
} else {
fText = '\{\{jb2move';
fText += '|user=' + mw.config.get('wgUserName');
fText += '|canMove=moved'
if( newname != '' ) {
Line 309 ⟶ 317:
case 'yes':
var query = {
'title': mw.config.get('wgPageName'),
'action': 'submit',
};
Line 320 ⟶ 328:
var cc6 = form.comCat6.value;
var keeplocal = form.keeplocal.checked;
Status.init( form );
Line 329 ⟶ 338:
case 'no':
var query = {
'title': mw.config.get('wgPageName'),
'action': 'submit',
'unwatch': 'true',
};
var reason = form.reason.value;
Line 342 ⟶ 352:
case 'moved':
var query = {
'title': mw.config.get('wgPageName'),
'action': 'submit',
'unwatch': 'true',
};
var newname = form.newname.value;