From 72d26818513dee26e85a18ea2cd8406d2e5701a1 Mon Sep 17 00:00:00 2001 From: Kevin Ji Date: Mon, 8 Jun 2015 20:40:00 -0700 Subject: [PATCH] Remove trailing whitespace --- .gitattributes | 2 +- modules/friendlyshared.js | 4 ++-- modules/friendlytag.js | 6 +++--- modules/friendlytalkback.js | 10 ++++----- modules/twinklearv.js | 28 ++++++++++++------------- modules/twinklebatchdelete.js | 6 +++--- modules/twinklebatchprotect.js | 2 +- modules/twinklebatchundelete.js | 4 ++-- modules/twinkledelimages.js | 2 +- modules/twinkledeprod.js | 6 +++--- modules/twinklefluff.js | 30 +++++++++++++-------------- modules/twinkleprod.js | 6 +++--- modules/twinkleprotect.js | 6 +++--- modules/twinklespeedy.js | 8 ++++---- modules/twinkleunlink.js | 6 +++--- modules/twinklewarn.js | 2 +- modules/twinklexfd.js | 2 +- morebits-test.js | 36 ++++++++++++++++----------------- 18 files changed, 83 insertions(+), 83 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1ca6bf623..9acf740d4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text \ No newline at end of file +* text diff --git a/modules/friendlyshared.js b/modules/friendlyshared.js index 64e696186..b2dfe82d6 100644 --- a/modules/friendlyshared.js +++ b/modules/friendlyshared.js @@ -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(); @@ -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' }, diff --git a/modules/friendlytag.js b/modules/friendlytag.js index 50230820e..c65274844 100644 --- a/modules/friendlytag.js +++ b/modules/friendlytag.js @@ -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 @@ -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]); @@ -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); diff --git a/modules/friendlytalkback.js b/modules/friendlytalkback.js index 5c082870a..2849b4bdd 100644 --- a/modules/friendlytalkback.js +++ b/modules/friendlytalkback.js @@ -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", @@ -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", @@ -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."); @@ -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) { @@ -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|"; diff --git a/modules/twinklearv.js b/modules/twinklearv.js index 0543ad5df..87ac62d39 100644 --- a/modules/twinklearv.js +++ b/modules/twinklearv.js @@ -81,7 +81,7 @@ Twinkle.arv.callback = function ( uid ) { name: 'uid', value: uid } ); - + var result = form.render(); Window.setContent( result ); Window.display(); @@ -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:' ) + ']]'; @@ -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(); @@ -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 ); @@ -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.' ); @@ -638,7 +638,7 @@ Twinkle.arv.callback.evaluate = function(e) { uaaPage.save(); } ); break; - + // WP:SPI case "sock": /* falls through */ @@ -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 ); @@ -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 ) + '%'; @@ -754,7 +754,7 @@ Twinkle.arv.processSock = function( params ) { statusIndicator.info( now + ' (completed)' ); } }; - + var socks = params.sockpuppets; // notify each puppet account @@ -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"; } @@ -799,7 +799,7 @@ Twinkle.arv.processSock = function( params ) { break; } spiPage.append(); - + Morebits.wiki.removeCheckpoint(); // all page updates have been started }; diff --git a/modules/twinklebatchdelete.js b/modules/twinklebatchdelete.js index 682867345..5abde6fb4 100644 --- a/modules/twinklebatchdelete.js +++ b/modules/twinklebatchdelete.js @@ -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 @@ -321,7 +321,7 @@ Twinkle.batchdelete.callbacks = { wikipedia_api.params.talkPage = pageTitle.toText(); wikipedia_api.post(); } - } + } } }, deleteRedirectsMain: function( apiobj ) { @@ -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); diff --git a/modules/twinklebatchprotect.js b/modules/twinklebatchprotect.js index 9e7a90628..15034a45f 100644 --- a/modules/twinklebatchprotect.js +++ b/modules/twinklebatchprotect.js @@ -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); diff --git a/modules/twinklebatchundelete.js b/modules/twinklebatchundelete.js index 79108b155..1a74548b7 100644 --- a/modules/twinklebatchundelete.js +++ b/modules/twinklebatchundelete.js @@ -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; diff --git a/modules/twinkledelimages.js b/modules/twinkledelimages.js index de2a7a6ce..609b7ccca 100644 --- a/modules/twinkledelimages.js +++ b/modules/twinkledelimages.js @@ -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' ] diff --git a/modules/twinkledeprod.js b/modules/twinkledeprod.js index 895352ae1..5d05ffcac 100644 --- a/modules/twinkledeprod.js +++ b/modules/twinkledeprod.js @@ -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({ @@ -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', @@ -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 diff --git a/modules/twinklefluff.js b/modules/twinklefluff.js index 7d2fc3cf3..983a59018 100644 --- a/modules/twinklefluff.js +++ b/modules/twinklefluff.js @@ -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(' ') ); @@ -77,7 +77,7 @@ Twinkle.fluff = { } } } else { - + if( mw.config.get('wgCanonicalSpecialPageName') === "Undelete" ) { //You can't rollback deleted pages! return; @@ -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; } @@ -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); }); @@ -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; } @@ -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); @@ -581,7 +581,7 @@ Twinkle.fluff.formatSummary = function(builtInString, userName, userString) { } else { result = result.replace("$USER", userName); } - + return result; }; @@ -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', diff --git a/modules/twinkleprod.js b/modules/twinkleprod.js index edd3c47d2..72cca2ccf 100644 --- a/modules/twinkleprod.js +++ b/modules/twinkleprod.js @@ -17,7 +17,7 @@ Twinkle.prod = function twinkleprod() { if( mw.config.get('wgNamespaceNumber') !== 0 || !mw.config.get('wgCurRevisionId') || Morebits.wiki.isPageRedirect() ) { return; } - + Twinkle.addPortletLink( Twinkle.prod.callback, "PROD", "tw-prod", "Propose deletion via WP:PROD" ); }; @@ -32,7 +32,7 @@ Twinkle.prod.callback = function twinkleprodCallback() { Window.addFooterLink( "Twinkle help", "WP:TW/DOC#prod" ); var form = new Morebits.quickForm( Twinkle.prod.callback.evaluate ); - + var field = form.append( { type: 'field', label: 'PROD type' @@ -67,7 +67,7 @@ Twinkle.prod.callback = function twinkleprodCallback() { var result = form.render(); Window.setContent( result ); Window.display(); - + // fake a change event on the first prod type radio, to initialize the type-dependent controls var evt = document.createEvent( "Event" ); evt.initEvent( 'change', true, true ); diff --git a/modules/twinkleprotect.js b/modules/twinkleprotect.js index 73bf7a9a4..77c9cf692 100644 --- a/modules/twinkleprotect.js +++ b/modules/twinkleprotect.js @@ -99,7 +99,7 @@ Twinkle.protect.callback = function twinkleprotectCallback() { // Current protection level in a human-readable format // (a string, or null if no protection; only filled for sysops) -Twinkle.protect.protectionLevel = null; +Twinkle.protect.protectionLevel = null; // Contains the current protection level in an object // Once filled, it will look something like: // { edit: { level: "sysop", expiry: , cascade: true }, ... } @@ -1364,9 +1364,9 @@ Twinkle.protect.callbacks = { Twinkle.protect.currentProtectionLevels.stabilize && Twinkle.protect.currentProtectionLevels.stabilize.level); if (computeWeight(protInfo.edit, protInfo.stabilize) > editWeight || - computeWeight(protInfo.move) > computeWeight(Twinkle.protect.currentProtectionLevels.move && + computeWeight(protInfo.move) > computeWeight(Twinkle.protect.currentProtectionLevels.move && Twinkle.protect.currentProtectionLevels.move.level) || - computeWeight(protInfo.create) > computeWeight(Twinkle.protect.currentProtectionLevels.create && + computeWeight(protInfo.create) > computeWeight(Twinkle.protect.currentProtectionLevels.create && Twinkle.protect.currentProtectionLevels.create.level)) { increase = true; } diff --git a/modules/twinklespeedy.js b/modules/twinklespeedy.js index 5053fc7ee..f41f1b48a 100644 --- a/modules/twinklespeedy.js +++ b/modules/twinklespeedy.js @@ -315,7 +315,7 @@ Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mod var wantSubgroups = Twinkle.speedy.mode.wantSubgroups(mode); var hasSubmitButton = Twinkle.speedy.mode.hasSubmitButton(mode); - var openSubgroupHandler = function(e) { + var openSubgroupHandler = function(e) { $(e.target.form).find('input').prop('disabled', true); $(e.target.form).children().css('color', 'gray'); $(e.target).parent().css('color', 'black').find('input').prop('disabled', false); @@ -368,7 +368,7 @@ Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mod if (criterion.subgroup && !hasSubmitButton) { if ($.isArray(criterion.subgroup)) { - criterion.subgroup.push({ + criterion.subgroup.push({ type: 'button', name: 'submit', label: 'Submit Query', @@ -1665,7 +1665,7 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) api.post({ async: false }); - + break; case 'redundantimage': // F1 @@ -1828,7 +1828,7 @@ Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSy Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUser(e) { var form = (e.target.form ? e.target.form : e.target); - if (e.target.type === "checkbox" || e.target.type === "text" || + if (e.target.type === "checkbox" || e.target.type === "text" || e.target.type === "select") { return; } diff --git a/modules/twinkleunlink.js b/modules/twinkleunlink.js index d4fe68c91..770c75b10 100644 --- a/modules/twinkleunlink.js +++ b/modules/twinkleunlink.js @@ -50,9 +50,9 @@ Twinkle.unlink.callback = function(presetReason) { form.append( { type: 'div', style: 'margin-bottom: 0.5em', - label: [ - 'This tool allows you to unlink all incoming links ("backlinks") that point to this page' + - (mw.config.get('wgNamespaceNumber') === 6 ? ", and/or hide all inclusions of this file by wrapping them in comment markup" : "") + + label: [ + 'This tool allows you to unlink all incoming links ("backlinks") that point to this page' + + (mw.config.get('wgNamespaceNumber') === 6 ? ", and/or hide all inclusions of this file by wrapping them in comment markup" : "") + ". For instance, ", node1, " would become ", diff --git a/modules/twinklewarn.js b/modules/twinklewarn.js index 64c1681c4..35b536004 100644 --- a/modules/twinklewarn.js +++ b/modules/twinklewarn.js @@ -24,7 +24,7 @@ Twinkle.warn = function twinklewarn() { if ( $vandalTalkLink.length ) { $vandalTalkLink.css("font-weight", "bold"); $vandalTalkLink.wrapInner($("").attr("title", "If appropriate, you can use Twinkle to warn the user about their edits to this page.")); - + var extraParam = "vanarticle=" + mw.util.rawurlencode(Morebits.pageNameNorm); var href = $vandalTalkLink.attr("href"); if (href.indexOf("?") === -1) { diff --git a/modules/twinklexfd.js b/modules/twinklexfd.js index eb8f990bf..75020b807 100644 --- a/modules/twinklexfd.js +++ b/modules/twinklexfd.js @@ -238,7 +238,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory tfd_template_type.append( { type: 'option', value: 'sidebar', label: 'Sidebar/infobox' } ); tfd_template_type.append( { type: 'option', value: 'inline', label: 'Inline template' } ); tfd_template_type.append( { type: 'option', value: 'tiny', label: 'Tiny inline' } ); - + work_area.append( { type: 'checkbox', list: [ diff --git a/morebits-test.js b/morebits-test.js index b935e6a44..41a86e8a4 100644 --- a/morebits-test.js +++ b/morebits-test.js @@ -6,7 +6,7 @@ mw.loader.using( 'jquery.ui.dialog', function() { launchDialog: function( userInterface ) { userInterface.dialog('open'); }, - + initSimpleWindow: function() { var Window = new Morebits.simpleWindow( 600, 400 ); Window.setTitle( "Test morebits.js" ); @@ -47,14 +47,14 @@ mw.loader.using( 'jquery.ui.dialog', function() { var section = $('#runTestForm input[name="sectionNumber"]').val(); if ( section != "" ) { page.setPageSection( Number( section ) ); - } + } page.setCreateOption(morebits_test_createOption); if ( $('#runTestForm input[name="lookupCreator"]').attr('checked') ) { page.lookupCreator(Twinkle.morebitsTest.lookupCreatorCallback); } }, - + loadCallbackInsert: function(page) { var params = page.getCallbackParameters(); var text = page.getPageText(); @@ -66,7 +66,7 @@ mw.loader.using( 'jquery.ui.dialog', function() { page.setPageText(text.substr(0, pos) + params['newText'] + text.substr(pos)); page.save(Twinkle.morebitsTest.finalSaveCallback); }, - + loadCallbackReplace: function(page) { var params = page.getCallbackParameters(); page.setPageText(params['newText']); @@ -75,17 +75,17 @@ mw.loader.using( 'jquery.ui.dialog', function() { lookupCreatorCallback: function(page) { alert("Page was created by: " + page.getCreator()); - }, + }, finalSaveCallback: function(page) { Morebits.wiki.actionCompleted.redirect = page.getPageName(); // get result of redirects - }, + }, initialize: function() { // Define runTest interface // Can also use alternative syntax new to jQuery 1.4: - // $('
').html( 'Text to be added:' ) + // $('
').html( 'Text to be added:' ) // → $('
', { css: { 'margin-top': '0.4em' }, text: 'Text to be added:' } ) morebits_test_createOption = null; @@ -110,45 +110,45 @@ mw.loader.using( 'jquery.ui.dialog', function() { autoOpen: false, title: 'Test Morebits.wiki.page class', modal: true, - buttons: { - "Append": function() { + buttons: { + "Append": function() { $(this).dialog('close'); Twinkle.morebitsTest.initSimpleWindow(); - + var page = new Morebits.wiki.page(wgPageName); page.setAppendText( $('#message').val() ); Twinkle.morebitsTest.setPageOptions(page); page.append(Twinkle.morebitsTest.finalSaveCallback); }, - "Prepend": function(e) { + "Prepend": function(e) { $(this).dialog('close'); Twinkle.morebitsTest.initSimpleWindow(); - + var page = new Morebits.wiki.page(wgPageName); page.setPrependText( $('#message').val() ); Twinkle.morebitsTest.setPageOptions(page); page.prepend(Twinkle.morebitsTest.finalSaveCallback); }, - "Insert": function(e) { + "Insert": function(e) { if ( $('#beforeText').val() == "" ) { alert ("Text to insert before must be specified!"); return; } $(this).dialog('close'); Twinkle.morebitsTest.initSimpleWindow(); - + var page = new Morebits.wiki.page(wgPageName); page.setCallbackParameters( { - beforeText: $('#beforeText').val(), + beforeText: $('#beforeText').val(), newText: $('#message').val() }); Twinkle.morebitsTest.setPageOptions(page); page.load(Twinkle.morebitsTest.loadCallbackInsert); }, - "Replace": function(e) { + "Replace": function(e) { $(this).dialog('close'); Twinkle.morebitsTest.initSimpleWindow(); - + var page = new Morebits.wiki.page(wgPageName); page.setCallbackParameters( { newText: $('#message').val() @@ -162,7 +162,7 @@ mw.loader.using( 'jquery.ui.dialog', function() { } // close initialize function } // close Twinkle.morebitsTest object - + Twinkle.morebitsTest.initialize(); }); // close mw.loader