Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinji committed Jun 9, 2015
1 parent 4bab244 commit 72d2681
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
@@ -1 +1 @@
* text
* text
4 changes: 2 additions & 2 deletions modules/friendlyshared.js
Expand Up @@ -67,7 +67,7 @@ Twinkle.shared.callback = function friendlysharedCallback( uid ) {
tooltip: 'You can optionally enter some contact details for the organization. Use this parameter only if the organization has specifically requested that it be added. You can use wikimarkup if necessary.'
}
);

form.append( { type:'submit' } );

var result = form.render();
Expand All @@ -81,7 +81,7 @@ Twinkle.shared.standardList = [
value: 'Shared IP',
tooltip: 'IP user talk page template that shows helpful information to IP users and those wishing to warn, block or ban them'
},
{
{
label: '{{Shared IP edu}}: shared IP address template modified for educational institutions',
value: 'Shared IP edu'
},
Expand Down
6 changes: 3 additions & 3 deletions modules/friendlytag.js
Expand Up @@ -157,7 +157,7 @@ Twinkle.tag.updateSortOrder = function(e) {
if (!Twinkle.tag.checkedTags) {
Twinkle.tag.checkedTags = [];
}

var container = new Morebits.quickForm.element({ type: "fragment" });

// function to generate a checkbox, with appropriate subgroup if needed
Expand Down Expand Up @@ -408,7 +408,7 @@ Twinkle.tag.updateSortOrder = function(e) {
var $checkbox = $(checkbox);
var link = Morebits.htmlNode("a", ">");
link.setAttribute("class", "tag-template-link");
link.setAttribute("href", mw.util.getUrl("Template:" +
link.setAttribute("href", mw.util.getUrl("Template:" +
Morebits.string.toUpperCaseFirstChar(checkbox.values)));
link.setAttribute("target", "_blank");
$checkbox.parent().append(["\u00A0", link]);
Expand Down Expand Up @@ -1143,7 +1143,7 @@ Twinkle.tag.callbacks = {

var userTalkPage = new Morebits.wiki.page('User talk:' + initialContrib,
'Notifying initial contributor (' + initialContrib + ')');
var notifytext = "\n\n== Your article [[" + Morebits.pageNameNorm + "]]==\n" +
var notifytext = "\n\n== Your article [[" + Morebits.pageNameNorm + "]]==\n" +
"{{subst:uw-notenglish|1=" + Morebits.pageNameNorm +
(params.translationPostAtPNT ? "" : "|nopnt=yes") + "}} ~~~~";
userTalkPage.setAppendText(notifytext);
Expand Down
10 changes: 5 additions & 5 deletions modules/friendlytalkback.js
Expand Up @@ -182,7 +182,7 @@ var callback_change_target = function( e ) {
tooltip:"The username of the user on whose talk page you left a message.",
value: prev_page
});

work_area.append({
type:"input",
name:"section",
Expand Down Expand Up @@ -275,7 +275,7 @@ var callback_change_target = function( e ) {
tooltip:"The full page name where you left the message. For example: 'Wikipedia talk:Twinkle'.",
value: prev_page
});

work_area.append({
type:"input",
name:"section",
Expand Down Expand Up @@ -334,7 +334,7 @@ var callback_evaluate = function( e ) {

if( tbtarget === "usertalk" || tbtarget === "other" || tbtarget === "see" ) {
page = e.target.page.value;

if( tbtarget === "usertalk" ) {
if( !page ) {
alert("You must specify the username of the user whose talk page you left a message on.");
Expand Down Expand Up @@ -421,7 +421,7 @@ var callback_evaluate = function( e ) {
}

talkpage.setEditSummary("Notification: You've got mail" + Twinkle.getPref("summaryAd"));

} else if ( tbtarget === "see" ) {
text = "\n\n{{subst:Please see|location=" + tbPageName;
if (section) {
Expand All @@ -430,7 +430,7 @@ var callback_evaluate = function( e ) {
text += "|more=" + message.trim() + "}}";
talkpage.setEditSummary("Please check the discussion at [[" + tbPageName +
(section ? ("#" + section) : "") + "]]" + Twinkle.getPref("summaryAd"));

} else { // tbtarget one of mytalk, usertalk, other
// clean talkback heading: strip section header markers that were erroneously suggested in the documentation
text = "\n\n==" + Twinkle.getFriendlyPref("talkbackHeading").replace( /^\s*=+\s*(.*?)\s*=+$\s*/, "$1" ) + "==\n{{talkback|";
Expand Down
28 changes: 14 additions & 14 deletions modules/twinklearv.js
Expand Up @@ -81,7 +81,7 @@ Twinkle.arv.callback = function ( uid ) {
name: 'uid',
value: uid
} );

var result = form.render();
Window.setContent( result );
Window.display();
Expand Down Expand Up @@ -536,7 +536,7 @@ Twinkle.arv.callback.evaluate = function(e) {


if ( form.page.value !== '' ) {

// add a leading : on linked page namespace to prevent transclusion
reason = 'On [[' + form.page.value.replace( /^(Image|Category|File):/i, ':$1:' ) + ']]';

Expand Down Expand Up @@ -568,7 +568,7 @@ Twinkle.arv.callback.evaluate = function(e) {
var aivPage = new Morebits.wiki.page( 'Wikipedia:Administrator intervention against vandalism', 'Processing AIV request' );
aivPage.setPageSection( 1 );
aivPage.setFollowRedirect( true );

aivPage.load( function() {
var text = aivPage.getPageText();

Expand All @@ -584,11 +584,11 @@ Twinkle.arv.callback.evaluate = function(e) {
aivPage.append();
} );
break;

// Report inappropriate username
case 'username':
types = form.getChecked( 'arvtype' ).map( Morebits.string.toLowerCaseFirstChar );

var hasShared = types.indexOf( 'shared' ) > -1;
if ( hasShared ) {
types.splice( types.indexOf( 'shared' ), 1 );
Expand Down Expand Up @@ -625,7 +625,7 @@ Twinkle.arv.callback.evaluate = function(e) {

uaaPage.load( function() {
var text = uaaPage.getPageText();

// check if user has already been reported
if (new RegExp( "\\{\\{\\s*user-uaa\\s*\\|\\s*(1\\s*=\\s*)?" + RegExp.escape(uid, true) + "\\s*(\\||\\})" ).test(text)) {
uaaPage.getStatusElement().error( 'User is already listed.' );
Expand All @@ -638,7 +638,7 @@ Twinkle.arv.callback.evaluate = function(e) {
uaaPage.save();
} );
break;

// WP:SPI
case "sock":
/* falls through */
Expand Down Expand Up @@ -727,13 +727,13 @@ Twinkle.arv.callback.evaluate = function(e) {

Twinkle.arv.processSock = function( params ) {
Morebits.wiki.addCheckpoint(); // prevent notification events from causing an erronous "action completed"

// notify all user accounts if requested
if (params.notify && params.sockpuppets.length>0) {

var notifyEditSummary = "Notifying about suspicion of sockpuppeteering." + Twinkle.getPref('summaryAd');
var notifyText = "\n\n{{subst:socksuspectnotice|1=" + params.uid + "}} ~~~~";

// notify user's master account
var masterTalkPage = new Morebits.wiki.page( 'User talk:' + params.uid, 'Notifying suspected sockpuppeteer' );
masterTalkPage.setFollowRedirect( true );
Expand All @@ -744,7 +744,7 @@ Twinkle.arv.processSock = function( params ) {
var statusIndicator = new Morebits.status( 'Notifying suspected sockpuppets', '0%' );
var total = params.sockpuppets.length;
var current = 0;

// display status of notifications as they progress
var onSuccess = function( sockTalkPage ) {
var now = parseInt( 100 * ++(current)/total, 10 ) + '%';
Expand All @@ -754,7 +754,7 @@ Twinkle.arv.processSock = function( params ) {
statusIndicator.info( now + ' (completed)' );
}
};

var socks = params.sockpuppets;

// notify each puppet account
Expand All @@ -772,7 +772,7 @@ Twinkle.arv.processSock = function( params ) {
params.sockpuppets.map( function(v) {
return "* {{" + ( Morebits.isIPAddress( v ) ? "checkip" : "checkuser" ) + "|1=" + v + "}}";
} ).join( "\n" ) + "\n|evidence=" + params.evidence + " \n";

if ( params.checkuser ) {
text += "|checkuser=yes";
}
Expand All @@ -799,7 +799,7 @@ Twinkle.arv.processSock = function( params ) {
break;
}
spiPage.append();

Morebits.wiki.removeCheckpoint(); // all page updates have been started
};

Expand Down
6 changes: 3 additions & 3 deletions modules/twinklebatchdelete.js
Expand Up @@ -149,7 +149,7 @@ Twinkle.batchdelete.callback = function twinklebatchdeleteCallback() {
metadata.push("redirect");
}
if (isProtected) {
metadata.push("fully protected" +
metadata.push("fully protected" +
($editprot.attr('expiry') === 'infinity' ? ' indefinitely' : (', expires ' + $editprot.attr('expiry'))));
}
if (ns === "6") { // mimic what delimages used to show for files
Expand Down Expand Up @@ -321,7 +321,7 @@ Twinkle.batchdelete.callbacks = {
wikipedia_api.params.talkPage = pageTitle.toText();
wikipedia_api.post();
}
}
}
}
},
deleteRedirectsMain: function( apiobj ) {
Expand All @@ -330,7 +330,7 @@ Twinkle.batchdelete.callbacks = {
if (!pages.length) {
return;
}

var redirectDeleter = new Morebits.batchOperation("Deleting redirects to " + apiobj.params.page);
redirectDeleter.setOption("chunkSize", Twinkle.getPref('batchdeleteChunks'));
redirectDeleter.setPageList(pages);
Expand Down
2 changes: 1 addition & 1 deletion modules/twinklebatchprotect.js
Expand Up @@ -378,7 +378,7 @@ Twinkle.batchprotect.callback.evaluate = function twinklebatchprotectCallbackEva
Morebits.status.error( 'Error', 'Nothing to protect, aborting' );
return;
}

var batchOperation = new Morebits.batchOperation("Applying protection settings");
batchOperation.setOption("chunkSize", Twinkle.getPref('batchProtectChunks'));
batchOperation.setOption("preserveIndividualStatusLines", true);
Expand Down
4 changes: 2 additions & 2 deletions modules/twinklebatchundelete.js
Expand Up @@ -115,13 +115,13 @@ Twinkle.batchundelete.callback.evaluate = function( event ) {
batchOperation.setOption("preserveIndividualStatusLines", true);
batchOperation.setPageList(pages);
batchOperation.run(function(pageName) {
var query = {
var query = {
'token': mw.user.tokens.get().editToken,
'title': pageName,
'action': 'undelete',
'reason': reason + Twinkle.getPref('deletionSummaryAd')
};
var wikipedia_api = new Morebits.wiki.api( "Undeleting page " + pageName, query,
var wikipedia_api = new Morebits.wiki.api( "Undeleting page " + pageName, query,
batchOperation.workerSuccess, null, batchOperation.workerFailure );
wikipedia_api.statelem.status("undeleting...");
wikipedia_api.pageName = pageName;
Expand Down
2 changes: 1 addition & 1 deletion modules/twinkledelimages.js
Expand Up @@ -69,7 +69,7 @@ Twinkle.delimages.callback = function twinkledeliCallback() {
'generator': 'categorymembers',
'gcmtitle': mw.config.get( 'wgPageName' ),
'gcmnamespace': 6, // File:
'gcmlimit' : Twinkle.getPref('deliMax'),
'gcmlimit' : Twinkle.getPref('deliMax'),
'prop': [ 'imageinfo', 'categories', 'revisions' ],
'grvlimit': 1,
'grvprop': [ 'user' ]
Expand Down
6 changes: 3 additions & 3 deletions modules/twinkledeprod.js
Expand Up @@ -73,7 +73,7 @@ Twinkle.deprod.callback = function() {
metadata.push(concerns[title]);
}
if (isProtected) {
metadata.push("fully protected" +
metadata.push("fully protected" +
($editprot.attr('expiry') === 'infinity' ? ' indefinitely' : (', expires ' + $editprot.attr('expiry'))));
}
list.push({
Expand Down Expand Up @@ -133,7 +133,7 @@ var callback_commit = function(event) {
batchOperation.setPageList(pages);
batchOperation.run(function(pageName) {
var params = { page: pageName, reason: concerns[page] };

var query = {
'action': 'query',
'list': 'backlinks',
Expand All @@ -144,7 +144,7 @@ var callback_commit = function(event) {
var wikipedia_api = new Morebits.wiki.api( 'Grabbing redirects', query, callback_deleteRedirects );
wikipedia_api.params = params;
wikipedia_api.post();

query = {
'action': 'query',
'titles': 'Talk:' + pageName
Expand Down
30 changes: 15 additions & 15 deletions modules/twinklefluff.js
Expand Up @@ -44,25 +44,25 @@ Twinkle.fluff = {
if (logLink.length>0) //#215 -- there is no log link on Special:Contributions with no user
{
var username = decodeURIComponent(/wiki\/Special:Log\/(.+)$/.exec(logLink.attr("href").replace(/_/g, "%20"))[1]);
if( Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
( mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1 ) ||
if( Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
( mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1 ) ||
( mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').indexOf('mine') !== -1 ) ) {
var list = $("#mw-content-text").find("ul li:has(span.mw-uctop)");

var revNode = document.createElement('strong');
var revLink = document.createElement('a');
revLink.appendChild( spanTag( 'Black', '[' ) );
revLink.appendChild( spanTag( 'SteelBlue', 'rollback' ) );
revLink.appendChild( spanTag( 'Black', ']' ) );
revNode.appendChild(revLink);

var revVandNode = document.createElement('strong');
var revVandLink = document.createElement('a');
revVandLink.appendChild( spanTag( 'Black', '[' ) );
revVandLink.appendChild( spanTag( 'Red', 'vandalism' ) );
revVandLink.appendChild( spanTag( 'Black', ']' ) );
revVandNode.appendChild(revVandLink);

list.each(function(key, current) {
var href = $(current).children("a:eq(1)").attr("href");
current.appendChild( document.createTextNode(' ') );
Expand All @@ -77,7 +77,7 @@ Twinkle.fluff = {
}
}
} else {

if( mw.config.get('wgCanonicalSpecialPageName') === "Undelete" ) {
//You can't rollback deleted pages!
return;
Expand All @@ -91,8 +91,8 @@ Twinkle.fluff = {

var otitle, ntitle;
try {
var otitle1 = document.getElementById('mw-diff-otitle1');
var ntitle1 = document.getElementById('mw-diff-ntitle1');
var otitle1 = document.getElementById('mw-diff-otitle1');
var ntitle1 = document.getElementById('mw-diff-ntitle1');
if (!otitle1 || !ntitle1) {
return;
}
Expand Down Expand Up @@ -159,9 +159,9 @@ Twinkle.fluff = {
var vandLink = document.createElement('a');
var normLink = document.createElement('a');

agfLink.href = "#";
vandLink.href = "#";
normLink.href = "#";
agfLink.href = "#";
vandLink.href = "#";
normLink.href = "#";
$(agfLink).click(function(){
Twinkle.fluff.revert('agf', vandal);
});
Expand Down Expand Up @@ -445,7 +445,7 @@ Twinkle.fluff.callbacks = {
userHasAlreadyConfirmedAction = true;
}

summary = Twinkle.fluff.formatSummary("Reverted " + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') +
summary = Twinkle.fluff.formatSummary("Reverted " + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') +
" by $USER", self.params.user, extra_summary);
break;
}
Expand Down Expand Up @@ -553,7 +553,7 @@ Twinkle.fluff.callbacks = {
// by an appropriate user link
Twinkle.fluff.formatSummary = function(builtInString, userName, userString) {
var result = builtInString;

// append user's custom reason with requisite punctuation
if (userString) {
result += ': ' + Morebits.string.toUpperCaseFirstChar(userString);
Expand Down Expand Up @@ -581,7 +581,7 @@ Twinkle.fluff.formatSummary = function(builtInString, userName, userString) {
} else {
result = result.replace("$USER", userName);
}

return result;
};

Expand All @@ -591,7 +591,7 @@ Twinkle.fluff.init = function twinklefluffinit() {
// A list of usernames, usually only bots, that vandalism revert is jumped over; that is,
// if vandalism revert was chosen on such username, then its target is on the revision before.
// This is for handling quick bots that makes edits seconds after the original edit is made.
// This only affects vandalism rollback; for good faith rollback, it will stop, indicating a bot
// This only affects vandalism rollback; for good faith rollback, it will stop, indicating a bot
// has no faith, and for normal rollback, it will rollback that edit.
Twinkle.fluff.whiteList = [
'AnomieBOT',
Expand Down

0 comments on commit 72d2681

Please sign in to comment.