User:Alexis Jazz/Bawl-core.js

// Bawl is public domain, irrevocably released as WTFPL Version 2 by its author, Alexis Jazz. If you don't like that or think it's invalid where you live you may use Bawl under CC BY-SA 3.0, CC BY 2.5 or CC BY 4.0 instead. Your choice. if(typeof Bawl == 'undefined' && ( ['wikitext','css','javascript'].indexOf(mw.config.get('wgPageContentModel')) != -1 && mw.config.get('wgNamespaceNumber') != -1 && ( ( window.localStorage.BawleditFullPage && $('#ca-edit')[0] ) || $('#ca-addsection')[0] || $('.ext-discussiontools-init-replylink-buttons')[0] || $('.BawlCmt')[0] ) )){ Bawl={}; Bawl.tI=new Date.getTime; // Bawl.vD='16:26, 8 March 2022 (UTC)'; // Bawl.uN=mw.config.get('wgUserName'); Bawl.uL=mw.config.get('wgUserLanguage'); if(Bawl.uN){ Bawl.uNU=Bawl.uN.replace(/ /g, '_'); } Bawl.mO={}; Bawl.bO2={}; Bawl.wMO={}; var api=new mw.Api; Bawl.TS='CC BY-SA 3.0+GFDL'; Bawl.TSIL='ToU'; Bawl.mO.mul={ 'UILabelInterface':'Interface', 'tosNag':'Annoy me with the ToS all the time (you can disable this!)', 'clearEditFullPage':'Hide page content when editing full page', 'editNotice':'Show editnotices', 'dateLinksLocalTime':'Display signature date in local time', 'wrongUI':'Put buttons on the wrong side like DiscussionTools', 'cureDTBlueStreak':'Automatically fade out comment highlighting by DiscussionTools', 'livePreview':'Live preview', 'checkNewComments':'Check for new comments when opening form/preview', 'limitWidth':'Limit interface width', 'grayscale':'Grayscale icons', 'RLmasq':'Masquerade as reply-link', 'warnExit':'Warn before leaving the page with an entered comment', 'UIfontSize':'Interface size:', 'customSummary':'Field to add your own message to the edit summary', 'markup':'Enable basic markup toolbar', 'UILabelLinks':'Links', 'addLinkSetting':'On page load: (automatically adding links might slightly decrease battery life on battery-powered devices)', 'addLinkTS':'Only add reply link for the first comment of each section', 'nSecLink':'Insert link to add a new section', 'replySecLink':'Add extra reply button for the section starter to the bottom of the section if there are >3 commenters', 'secLinks':'Insert links to add subsections', 'inputBoxTO':'Take over InputBoxes', 'editFullPage':'Enable full page editing with Bawl', 'editFullSection':'Enable full section editing with Bawl', 'editLinks':'Insert links to edit my comments', 'dateLinksIconSection':'Permalink generator for sections', 'dateLinksIcon':'Permalink generator for Bawl comments', 'UILabelEditing':'Editing', 'autoPing':'Auto-mention', 'enableCI':'Enable custom inserts', 'enableCIThatRun':'Enable custom regular expressions that are automatically applied on preview/publish', 'rewritun':'Rewrite external URLs to internal ones where possible, clean internal links', 'markdown':'Convert Markdown markup language (partial implementation)', 'bbcode':'Convert BBCode markup language', 'outdent':'Automatically outdent when exceeding level:', 'useLocator':'Add invisible comment locator to comments (improves functionality)', 'sumSnippet':'Add snippet to edit summary', 'saveDraft':'Try to recover unsent comments of >100 characters after unexpected exit', 'pingText':'Yo PINGUSER &#x1F517;,', 'UILabelAdvanced':'Advanced', 'afterPost':'After posting:', 'editor':'Default editor:', 'watchlist':'Watchlist setting:', 'watchlistexpiry':'Watchlist expiration: ', 'editorSwitch':'Enable switching between editors', 'hideThePain':'Hide reply links from DiscussionTools', 'methodLegacy':'Detect comments by legacy method', 'methodLocator':'Detect comments by Bawl locator', 'ffsWHY':'Enable Bawl on diffs/old revisions. Terrible idea. Don\'t do it.', 'killswitch':'If adding links takes more than 3 seconds stop adding links', 'debug':'Enable test/debug mode', 'saveTo':'Save settings to:', 'prefLabelBrowser':' (browser)', 'prefLabelCommonJS':' (account)', 'prefLabelGlobalJS':' (global account)', 'watchlistexpirydays':'DAYS days', 'BawlCustomInsertPlaceholder':'fooNUM:<<[AUTOPOST]bar>>', 'BawlCustomInsertThatRunPlaceholder':'/[Ff]ooNUM/bar/g', 'UIfontSize0875em':'0.875em', 'UIfontSizeTiny':'Tiny!', 'UIfontSizeSmall':'Small', 'UIfontSizeMedium':'Medium', 'UIfontSizeLarge':'Large', 'UIfontSizeHuge':'Huge', 'reloadafter':'Reload the page (slowest)', 'linkafter':'Just show a link (fastest)', 'parsecomment':'Parse comment in place (might be inaccurate)', 'saveToGlobalJS':'Global account (public)', 'saveToCommonJS':'Account (public)', 'saveToBrowser':'This browser', 'editorSource':'Source', 'editorVisualLight':'VisualLight', 'commentDone':'Done!', 'commentPostedThankYou':' Thank you for using <a href="https://en.wikipedia.org/wiki/User:Alexis_Jazz/Bawl" target="_new">Bawl!</a>', 'nopingNotify':'This user doesn\'t want their username to be linked.', 'replyToTitle':'&#x1F5E8; USER', 'newSectionTitle':'Add section', 'editFullSectionTitle':'Edit section', 'editTitle':'Change comment', 'showNewLinesButton':'Show changed and added content', 'restoredDraft':'Restored draft', 'removeDraft':'Deleted draft', 'insertLinkLink':'https://www.example.com/lorem/ or article title', 'insertLinkName':'Link name (optional)', 'addLinksAuto':'Add links automatically', 'addLoadButtonTop':'Add load link to top', 'addLoadButtonSect':'Add load link to top and to each section', 'bawl':'Bawl!', 'messedUp':'Looks like Alexis Jazz messed up. (ERRORDESCRIPTION) <a href="ERRORLINK">Go bawl at \'em here.</a> (just go there and press publish, should be enough)' }; Bawl.mO.en={ 'titlePlaceholder':'Title', 'replyToTitle':'Reply to USER', 'editTitle':'Edit comment', }; Bawl.bO2.mul={ 'BawlUIReplyButton':'  📢  ', 'BawlUIEditButton':'  🖋️  ', 'BawlUIPreviewButton':'  👁  ', 'BawlUIDiffButton':'Diff', 'BawlUICancelButton':'  🗑️  ', 'saveSettings':'Save', 'resetPreferences':'Restore all default settings', 'clipBoardSuccess':'Copied to clipboard.', 'clipBoardFail':'Failed to copy to clipboard.', 'summaryPlaceholder':'Edit summary', 'fail':'Action failed', 'revisionlinkname':'revision $1'.replace('$1','$7'), 'nodifferences':'(no differences)', 'anoneditwarning':'Unless you <a href="' + mw.config.get('wgArticlePath').replace('$1', 'Special:UserLogin') + '?returnto=' + encodeURIComponent(mw.config.get('wgPageName')) + '">log in</a> or <a href="' + mw.config.get('wgArticlePath').replace('$1', 'Special:CreateAccount') + '?returnto=' + encodeURIComponent(mw.config.get('wgPageName')) + '">sign up</a> your IP address will be publicly visible if you post a message!', 'titlePlaceholder':'', 'newsection':'New section', 'protectedpagetext':'This page is protected and cannot be edited.', 'bold':' B ', 'italic':' I ', 'strike':'xyz', }; Bawl.b=Bawl.bO2.mul; Bawl.bO2.en={'BawlUIReplyButton':'Submit','BawlUIEditButton' : 'Edit','BawlUIPreviewButton':'Preview','BawlUICancelButton':'Cancel'}; if(typeof BawlBasicmsgsObj != 'undefined' && BawlBasicmsgsObj[ Bawl.uL ] ) { Bawl.b=Object.assign(Bawl.bO2.mul, BawlBasicmsgsObj[ Bawl.uL ]); } else if(Bawl.uL == 'en'){ Bawl.b=Object.assign(Bawl.bO2.mul, Bawl.bO2.en); } else if(window.localStorage.BawlBasicLang && JSON.parse(window.localStorage.BawlBasicLang)[Bawl.uL] && JSON.parse(window.localStorage.BawlBasicLang)[Bawl.uL].version == Bawl.vD){ Bawl.b=Object.assign(Bawl.bO2.mul, JSON.parse(window.localStorage.BawlBasicLang)[Bawl.uL]); } else { Bawl.bMWT='                 '; api.post( {format: 'json', contentmodel:'wikitext', action: 'parse', uselang: Bawl.uL, text: Bawl.bMWT} ).done( function ( data){ Bawl.bMARE=new RegExp('(?: )(([^<]|<(?!\/span>))*)(?:<\/span>)', 'g'); Bawl.bMA=data.parse.text['*'].match(Bawl.bMARE); if(Bawl.bMA){ Bawl.bO2[Bawl.uL]={ 'BawlUIReplyButton':Bawl.bMA[0].replace(Bawl.bMARE,'$1'), 'BawlUIEditButton':Bawl.bMA[1].replace(Bawl.bMARE,'$1'), 'BawlUIPreviewButton':Bawl.bMA[2].replace(Bawl.bMARE,'$1'), 'BawlUIDiffButton':Bawl.bMA[3].replace(Bawl.bMARE,'$1'), 'BawlUICancelButton':Bawl.bMA[4].replace(Bawl.bMARE,'$1'), 'saveSettings':Bawl.bMA[5].replace(Bawl.bMARE,'$1'), 'resetPreferences':Bawl.bMA[6].replace(Bawl.bMARE,'$1'), 'clipBoardSuccess':Bawl.bMA[7].replace(Bawl.bMARE,'$1'), 'clipBoardFail':Bawl.bMA[8].replace(Bawl.bMARE,'$1'), 'summaryPlaceholder':Bawl.bMA[9].replace(Bawl.bMARE,'$1'), 'fail':Bawl.bMA[10].replace(Bawl.bMARE,'$1'), 'revisionlinkname':Bawl.bMA[11].replace(Bawl.bMARE,'$1').replace('$1','$7'), 'nodifferences':Bawl.bMA[12].replace(Bawl.bMARE,'$1'), 'anoneditwarning':Bawl.bMA[13].replace(Bawl.bMARE,'$1').replace(/\[\$1 ([^\]]*)\]/,'<a href="' + mw.config.get('wgArticlePath').replace('$1', 'Special:UserLogin') + '?returnto=' + encodeURIComponent(mw.config.get('wgPageName')) + '">$1</a>').replace(/\[\$2 ([^\]]*)\]/, '<a href="' + mw.config.get('wgArticlePath').replace('$1', 'Special:CreateAccount') + '?returnto=' + encodeURIComponent(mw.config.get('wgPageName')) + '">$1</a>'), 'titlePlaceholder':Bawl.bMA[14].replace(Bawl.bMARE,'$1').replace(/(\&\#160;|:)/g,''), 'newsection':Bawl.bMA[15].replace(Bawl.bMARE,'$1'), 'protectedpagetext':Bawl.bMA[16].replace(Bawl.bMARE,'$1'), 'version':Bawl.vD }; Bawl.lB={'de':'F','sv':'F','fr':'G','it':'G','es':'N','pt':'N','ru':'ж','uk':'ж'}; Bawl.lI2={'de':'K','es':'K','sv':'K','it':'C','ru':'к','uk':'к'}; if(Bawl.lB[Bawl.uL]){ Bawl.bO2[Bawl.uL].bold=Bawl.lB[Bawl.uL]; } if(Bawl.lI2[Bawl.uL]){ Bawl.bO2[Bawl.uL].italic=Bawl.lI2[Bawl.uL]; } Bawl.bLS={}; if(window.localStorage.BawlBasicLang && JSON.parse(window.localStorage.BawlBasicLang)){ Bawl.bLS=JSON.parse(window.localStorage.BawlBasicLang); } Bawl.bLS[Bawl.uL]=Bawl.bO2[Bawl.uL]; Bawl.bLS=JSON.stringify(Bawl.bLS); window.localStorage.setItem('BawlBasicLang', Bawl.bLS); Bawl.b=Object.assign(Bawl.bO2.mul, Bawl.bO2[Bawl.uL]); } } ); } Bawl.sC2=' (Bawl!)'; Bawl.sCDE=' (Bawl!)'; Bawl.wMO.mul={ 'difflinkname':' (diff $8)', 'difflinknameprevnext':' (diff ~$9)', 'pageHistoryLinkName':'$5 (page history)', 'postCommentSummaryPost':'replying to USER' + Bawl.sC2, 'postSubsectionSummaryPost':'new subsection: SUBSECTION' + Bawl.sC2, 'postCommentSummaryNewSection':'→NEWSECTION: new sectionSUMMARY' + Bawl.sC2, 'editCommentSummary':'editing comment' + Bawl.sC2, 'savePrefsSummary':'Saving preferences' + Bawl.sC2, 'deletePrefsSummary':'Clearing preferences' + Bawl.sC2, }; Bawl.wMO.nl={ 'difflinkname':' (diff $8)', 'difflinknameprevnext':' (diff ~$9)', 'pageHistoryLinkName':'$5 (paginageschiedenis)', 'postCommentSummaryPost':'reactie op USER' + Bawl.sC2, 'postSubsectionSummaryPost':'nieuwe subsectie: SUBSECTION' + Bawl.sC2, 'postCommentSummaryNewSection':'→NEWSECTION: nieuw onderwerpSUMMARY' + Bawl.sC2, 'editCommentSummary':'wijzig reactie' + Bawl.sC2, 'savePrefsSummary':'Voorkeuren opslaan' + Bawl.sC2, 'deletePrefsSummary':'Voorkeuren wissen' + Bawl.sC2, }; Bawl.wMO.de={ 'difflinkname':' (diff $8)', 'difflinknameprevnext':' (diff ~$9)', 'pageHistoryLinkName':'$5 (Versionsgeschichte)', 'postCommentSummaryPost':'Antwort an USER (Bawl!)' + Bawl.sCDE, 'postSubsectionSummaryPost':'neuen Teilabschnitt: SUBSECTION' + Bawl.sCDE, 'postCommentSummaryNewSection':'→NEWSECTION: neuen AbschnittSUMMARY' + Bawl.sCDE, 'editCommentSummary':'Kommentar bearbeiten' + Bawl.sCDE, 'savePrefsSummary':'Einstellungen speichern' + Bawl.sCDE, 'deletePrefsSummary':'Einstellungen löschen' + Bawl.sCDE, }; if(typeof BawlWikiMsgsObj != 'undefined' && BawlWikiMsgsObj[ mw.config.get('wgPageContentLanguage') ] ) { Bawl.wM=Object.assign(Bawl.wMO.mul, BawlWikiMsgsObj[ mw.config.get('wgPageContentLanguage') ]); } else if(Bawl.wMO[ mw.config.get('wgPageContentLanguage') ]){ Bawl.wM=Object.assign(Bawl.wMO.mul, Bawl.wMO[ mw.config.get('wgPageContentLanguage') ]); } else { Bawl.wM=Bawl.wMO.mul; } if(typeof BawlmsgsObj != 'undefined' && BawlmsgsObj[ Bawl.uL ] ) { Bawl.m=Object.assign(Bawl.mO.mul, BawlmsgsObj[ Bawl.uL ]); } else if(window.localStorage.BawlLang && JSON.parse(window.localStorage.BawlLang)[Bawl.uL] && JSON.parse(window.localStorage.BawlLang)[Bawl.uL].date == Bawl.vD){ Bawl.m=Object.assign(Bawl.mO.mul, JSON.parse(window.localStorage.BawlLang)[Bawl.uL] ); } else { Bawl.m=Bawl.mO.mul; } if(typeof BawlExtraFileLocation != "undefined"){ Bawl.eFL=BawlExtraFileLocation; } else { Bawl.eFL='User:Alexis_Jazz/Bawl-extra.js'; } if(['nl','de'].indexOf(Bawl.uL) != -1 ) { mw.loader.getScript('https://en.wikipedia.org/w/index.php?title=' + Bawl.eFL + '&action=raw&ctype=text/javascript'); } Bawl.pT='' + mw.config.get('wgFormattedNamespaces')[2] + ':PINGUSER, '; Bawl.pTA='PINGUSER, '; Bawl.cTIWD='*'; Bawl.nLT=' '; Bawl.mN=mw.config.get('wgMonthNames'); Bawl.tF='$6$7$8:$9$10$11'; Bawl.eOCL=' INNERCONTENT '; if(mw.config.get('wgDBname') == 'enwiki' ) { Bawl.wT='UTC'; Bawl.tF='$6$7$8:$9$10$11, $2$3 MONTHNAME $5'; } else if(mw.config.get('wgDBname') == 'dewiki'){ Bawl.mN={1:'Jan.',2:'Feb.',3:'Mär.',4:'Apr.',5:'Mai',6:'Jun.',7:'Jul.',8:'Aug.',9:'Sep.',10:'Okt.',11:'Nov.',12:'Dez.'}; Bawl.tF='$6$7$8:$9$10$11, $2$3. MONTHNAME $5'; Bawl.wT='CET'; } else if(mw.config.get('wgDBname') == 'nlwiktionary' || mw.config.get('wgDBname') == 'nlwiki'){ Bawl.cTIWD=':'; Bawl.mN={1:'jan',2:'feb',3:'mrt',4:'apr',5:'mei',6:'jun',7:'jul',8:'aug',9:'sep',10:'okt',11:'nov',12:'dec'}; Bawl.tF='$2$3 MONTHNAME $5 $6$7$8:$9$10$11'; Bawl.wT='CET'; } else if([ 'thwikibooks', 'thwiki', 'thwikisource', 'thwiktionary', 'thwikiquote' ].indexOf(mw.config.get('wgDBname')) != -1){ Bawl.wT='Asia/Bangkok'; Bawl.tF='$6$7$8:$9$10$11, $2$3 MONTHNAME'; } Bawl.pLTS=new Date.toISOString; Bawl.eCR=10; Bawl.dS={ 'UILabelInterface':'TAB', 'tosNag':true, 'clearEditFullPage':true, 'editNotice':true, 'dateLinksLocalTime':false, 'wrongUI':false, 'cureDTBlueStreak':true, 'livePreview':false, 'checkNewComments':true, 'limitWidth':false, 'grayscale':false, 'RLmasq':false, 'warnExit':true, 'UIfontSize':'small', 'customSummary':false, 'markup':true, 'UILabelLinks':'TAB', 'addLinkSetting':'addLinksAuto', 'addLinkTS':false, 'nSecLink':true, 'replySecLink':false, 'secLinks':false, 'inputBoxTO':true, 'editFullPage':false, 'editFullSection':false, 'editLinks':true, 'dateLinksIconSection':true, 'dateLinksIcon':false, 'UILabelEditing':'TAB', 'autoPing':true, 'enableCI':true, 'enableCIThatRun':true, 'cI':{}, 'cIThatRun':{}, 'rewritun':true, 'markdown':false, 'bbcode':false, 'outdent':10, 'useLocator':true, 'sumSnippet':true, 'saveDraft':true, 'pingText':Bawl.pT, 'UILabelAdvanced':'TAB', 'afterPost':'parsecomment', 'editor':'source', 'watchlist':'watch', 'watchlistexpiry':'90 days', 'editorSwitch':false, 'hideThePain':true, 'methodLegacy':true, 'methodLocator':true, 'ffsWHY':false, 'killswitch':true, 'debug':false, 'saveTo':'commonjs', }; Bawl.s2=$.extend( true, {}, Bawl.dS ); Bawl.tNC=document.createElement('div'); Bawl.tNC.id='BawltosNagContainer'; if(mw.config.get('wgServer').match(/beta\.wmflabs/) ) { Bawl.metawikiAPI='https://meta.wikimedia.beta.wmflabs.org/w/api.php' } else { Bawl.metawikiAPI='https://meta.wikimedia.org/w/api.php' } Bawl.d=function(errortext){ if(Bawl.s2.debug == true){ if(typeof errortext == "string" || typeof errortext == "number"){ console.log('Bawl: ' + errortext); } else { console.log(errortext); } } }; Bawl.lS=function{ Bawl.cS2=''; if(window.localStorage.Bawl && window.localStorage.Bawl.match(/^\{/)){ Bawl.d(1); Bawl.cS2=JSON.parse(window.localStorage.Bawl); Bawl.s2=Object.assign(Bawl.s2, Bawl.cS2); } else if(window.BawlPrefs && typeof window.BawlPrefs == 'object'){ Bawl.s2=Object.assign(Bawl.s2, window.BawlPrefs); Bawl.cS2=window.BawlPrefs; } else if(window.BawlGlobalPrefs && typeof window.BawlGlobalPrefs == 'object'){ Bawl.s2=Object.assign(Bawl.s2, window.BawlGlobalPrefs); Bawl.cS2=window.BawlGlobalPrefs; } }; Bawl.lS; if(Bawl.wT ) { } else if(typeof BawlTZ == 'string' ) { Bawl.wT=BawlTZ; } else if(window.localStorage.BawlTZ && window.localStorage.BawlTZ.match(/^\{/) && JSON.parse(window.localStorage.BawlTZ).version == Bawl.vD){ Bawl.wT=JSON.parse(window.localStorage.BawlTZ).timezone; Bawl.s2.wikiTZ=JSON.parse(window.localStorage.BawlTZ).timezone; } else if(Bawl.s2.wikiTZ){ Bawl.wT=Bawl.s2.wikiTZ; } else { Bawl.d(2); api.get( { format: 'json', action: 'query', meta: 'siteinfo', siprop: 'general' } ).done( function ( data){ window.localStorage.setItem('BawlTZ', JSON.stringify({'version':Bawl.vD,'timezone':data.query.general.timezone})); Bawl.s2.wikiTZ=data.query.general.timezone; Bawl.wT=data.query.general.timezone; } ); } Bawl.rF=function{ Bawl.lS; Bawl.cR; Bawl.r=true; Bawl.oRF(Bawl.rLPO, 'reload'); }; Bawl.dF=function(setdisableform){ Bawl.UITIT.setReadOnly(setdisableform); Bawl.UITI.setReadOnly(setdisableform); Bawl.UIRB.setDisabled(setdisableform); Bawl.UIPB.setDisabled(setdisableform); Bawl.UICB.setDisabled(setdisableform); Bawl.UISB.setDisabled(setdisableform); if(typeof Bawl.sE != 'undefined'){ Bawl.sE.saveSettingsButton.setDisabled(setdisableform); Bawl.sE.resetPreferencesButton.setDisabled(setdisableform); Bawl.sE.cancelSettingsButton.setDisabled(setdisableform); } }; Bawl.gWFE=function(text){ if(text.match(/[^]*<text bytes[^>]*>([^]*)<\/text>[^]*/)){ return text.replace(/[^]*<text bytes[^>]*>([^]*)<\/text>[^]*/, '$1').replace(/\&lt\;/g, '<').replace(/\&gt\;/g, '>').replace(/\&amp\;/g, '&'); } else { return ''; } }; Bawl.cP=function(params, actionToPerform){ if(Bawl.uN && params.title == 'User:' + Bawl.uN + '/global.js'){ Bawl.d(3); var apiMeta=new mw.ForeignApi( Bawl.metawikiAPI ); api=apiMeta; Bawl.pVN='window.BawlGlobalPrefs'; } else { Bawl.pVN='window.BawlPrefs'; Bawl.d(4); } api.get( { action: 'query', export: 'true', format: 'json', titles: params.title, } ).done( function ( data){ Bawl.d(5); Bawl.nSCJS=Bawl.pVN + ' = ' + Bawl.eP + ';//Preferences for w:en:User:Alexis Jazz/Bawl'; if(data.query.export["*"].match(/[^]*<text bytes[^>]*>([^]*)<\/text>[^]*/)){ Bawl.cJS=Bawl.gWFE(data.query.export["*"]); Bawl.cJSRE=new RegExp('^' + Bawl.eRE(Bawl.pVN) + '.*(\n?)', 'm'); if(actionToPerform == 'delete'){ Bawl.nCJS=Bawl.cJS.replace(Bawl.cJSRE, ''); Bawl.d(6); } else if(Bawl.cJS.match(Bawl.cJSRE)){ Bawl.nCJS=Bawl.cJS.replace(Bawl.cJSRE, Bawl.nSCJS + '$1'); Bawl.d(7); } else if(Bawl.cJS.match(/.*Bawl\.js.*/)){ Bawl.nCJS=Bawl.cJS.replace(/(.*Bawl\.js.*)/, Bawl.nSCJS + '\n$1'); Bawl.d(8); } else { Bawl.nCJS=Bawl.cJS + '\n' + Bawl.nSCJS; Bawl.d(9); } } else if(data.query.export["*"] ) { Bawl.d(10); Bawl.nCJS=Bawl.nSCJS; } if(typeof Bawl.nCJS == 'string' ) { if(actionToPerform	== 'delete'){ Bawl.pS=Bawl.wM.deletePrefsSummary; } else { Bawl.pS=Bawl.wM.savePrefsSummary; } api.postWithEditToken( { format: 'json', title: params.title, action: 'edit', summary: Bawl.pS, text: Bawl.nCJS, } ).done( function ( data){ Bawl.d(11); if(data.edit && data.edit.result == 'Success'){ if(actionToPerform == 'delete'){ Bawl.d(12); } else { Bawl.d(13); } Bawl.rF; } } ); } } ); }; Bawl.sS=function{ Bawl.dF(true); $(document.getElementById('saveSettingsButton')).addClass('BawlPendingBlink'); Bawl.d(14); Bawl.pC=Object.keys(Bawl.dS).length; for (prefint=0; prefint < Bawl.pC; prefint++){ Bawl.pK=Object.keys(Bawl.dS)[prefint]; Bawl.d(15); if(Bawl.sE[ Bawl.pK ] && typeof Bawl.sE[ Bawl.pK ].isSelected == 'function'){ Bawl.s2[ Bawl.pK ] = Bawl.sE[ Bawl.pK ].isSelected; } else if(Bawl.sE[ Bawl.pK ] && typeof Bawl.sE[ Bawl.pK ].getValue == 'function'){ Bawl.s2[ Bawl.pK ] = Bawl.sE[ Bawl.pK ].getValue; } } if(Bawl.s2.pingText == ''){ Bawl.s2.pingText=Bawl.pT; } if(Bawl.s2.editFullPage == true ) { window.localStorage.setItem('BawleditFullPage', 'true'); } else { window.localStorage.removeItem('BawleditFullPage'); } if(! Bawl.s2.editNotice && window.localStorage.BawlEditNotices){ Bawl.d(16); window.localStorage.removeItem('BawlEditNotices'); } if(! Bawl.s2.saveDraft && window.localStorage.BawlDrafts){ window.localStorage.removeItem('BawlDrafts'); } for (int=0; int < 50; int++){ if(int < 30 && Bawl.cITI[int].getValue != ){ Bawl.s2.cI[int]=Bawl.cITI[int].getValue; } else { delete Bawl.s2.cI[int]; } if(Bawl.cITRTI[int].getValue != ){ Bawl.s2.cIThatRun[int]=Bawl.cITRTI[int].getValue; } else { delete Bawl.s2.cIThatRun[int]; } } if(window.BawlGlobalPrefs ) { window.BawlGlobalPrefs=Bawl.sTS } if(window.BawlPrefs ) { window.BawlPrefs=Bawl.sTS } Bawl.pC=Object.keys(Bawl.dS).length; Bawl.sTS=$.extend( true, {}, Bawl.s2 ); Bawl.d(17); for (prefint=0; prefint < Bawl.pC; prefint++) { Bawl.pK=Object.keys(Bawl.dS)[prefint]; Bawl.d(18); if(( typeof Bawl.sTS[Bawl.pK] == "boolean" || typeof Bawl.sTS[Bawl.pK] == "string" ) && Bawl.sTS[Bawl.pK] == Bawl.dS[Bawl.pK]){ Bawl.d(19); delete Bawl.sTS[Bawl.pK]; } else { Bawl.d(20); } } Bawl.d(21); if(Bawl.s2.saveTo == 'globaljs' ) { delete Bawl.sTS.wikiTZ; } Bawl.eP=JSON.stringify(Bawl.sTS); if(Bawl.s2.saveTo == 'browser'){ Bawl.d(22); window.localStorage.setItem('Bawl', Bawl.eP) Bawl.rF; } else if(Bawl.s2.saveTo == 'commonjs'){ Bawl.d(23); Bawl.rP('browser'); Bawl.cPP={ 'title':'User:' + Bawl.uN + '/common.js' }; Bawl.cP(Bawl.cPP); } else if(Bawl.s2.saveTo == 'globaljs'){ Bawl.rP('browser'); Bawl.rP('commonjs'); Bawl.d(24); Bawl.cPP={ 'title':'User:' + Bawl.uN + '/global.js' }; Bawl.cP(Bawl.cPP); } }; Bawl.rP=function(preftype){ if(! preftype ) { Bawl.dF(true); $(document.getElementById('resetPreferencesButton')).addClass('BawlPendingBlink'); } if((preftype && preftype == 'browser') || ( ! preftype && Bawl.sE.saveTo.getValue == 'browser' )){ window.localStorage.removeItem('Bawl'); window.localStorage.removeItem('BawlBasicLang'+Bawl.uL); window.localStorage.removeItem('BawlLang'+Bawl.uL); window.localStorage.removeItem('BawlToSnagText'); window.localStorage.removeItem('BawleditFullPage'); window.localStorage.removeItem('BawlTZ'); Bawl.d(25); if(! preftype){ Bawl.rF; } } else if((preftype && preftype == 'commonjs') || ( ! preftype && Bawl.sE.saveTo.getValue == 'commonjs' )){ Bawl.d(26); Bawl.cPP={ 'title':'User:' + Bawl.uN + '/common.js' }; Bawl.cP(Bawl.cPP, 'delete'); } else if((preftype && preftype == 'globaljs') || ( ! preftype && Bawl.sE.saveTo.getValue == 'globaljs' )){ Bawl.d(27); Bawl.cPP={ 'title':'User:' + Bawl.uN + '/global.js' }; Bawl.cP(Bawl.cPP, 'delete'); } }; Bawl.aSL=function(errorDescription){ $('#BawlReplyForm').prepend(' ' + Bawl.m.messedUp.replace('ERRORDESCRIPTION',errorDescription).replace('ERRORLINK','https://en.wikipedia.org/w/index.php?title=User_talk:Alexis_Jazz/Bawl&action=edit&section=new&preloadtitle=You%20messed%20up!%20(' + encodeURIComponent(errorDescription) + ')&preload=User_talk%3AAlexis%20Jazz/Bawl/preload&preloadparams%5b%5d=' + encodeURIComponent(JSON.stringify(Bawl.rLPO)) + '&preloadparams%5b%5d=' + encodeURIComponent(new Date.toLocaleString('en-GB',{timeZone:'UTC'})) + '%20UTC&preloadparams%5b%5d=' + encodeURIComponent(JSON.stringify(Bawl.cS2))) + ' '); }; Bawl.iTS=function{ if(window.localStorage.BawlToSnagText && JSON.parse(window.localStorage.BawlToSnagText).version == Bawl.vD){ $('#BawltosNagContainer')[0].innerHTML=''; $('#BawltosNagContainer').append(JSON.parse(window.localStorage.BawlToSnagText).text); } else { api.get( { format: 'json', action: 'parse', text: //MediaWiki:Wikimedia-copyrightwarning is the warning for Wikimedia sites in general and incorrect on projects with a different license like Wikinews. If dewiki wants their regular tosnag they'll have to transclude MediaWiki:Wikimedia-copyrightwarning from MediaWiki:Copyrightwarning } ).done( function ( data){ Bawl.TST=data.parse.text['*'].replace('$2', Bawl.TS).replace('$1', Bawl.TSIL).replace(/[\s]*<!\-\-[\s]*\nNewPP[^]*/g,) + ' '; window.localStorage.setItem('BawlToSnagText', JSON.stringify({'version':Bawl.vD,'text':Bawl.TST})); $('#BawltosNagContainer')[0].innerHTML=''; $('#BawltosNagContainer').append(JSON.parse(window.localStorage.BawlToSnagText).text); } ); } }; Bawl.tTN=function{ if(! document.getElementById('BawlToSNag') && Bawl.sE.tosNag.isSelected){ Bawl.iTS; } else if(Bawl.sE.tosNag.isSelected == true){ $('#BawlToSNag').removeClass('BawlNoDisplay'); } else if(Bawl.sE.tosNag.isSelected == false ){ $('#BawlToSNag').addClass('BawlNoDisplay'); } }; Bawl.sH2='<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" '; //Bawl.sBI='width="1080px" height="720px" viewBox="0 0 1080 720"> <rect fill="#FFF" x="0" y="0" width="720" height="720"/><ellipse fill="#000" cx="870" cy="370" rx="300" ry="400"/>  <rect fill="#000" x="820" y="0" width="60" height="320"/><rect fill="#000" x="680" y="130" width="320" height="60"/></g> <circle cx="360" cy="400" r="280" stroke="#000" stroke-width="60" fill="none"/><rect fill="#8af" x="160" y="85" width="400" height="200"/><rect fill="#000" x="320" y="10" width="80" height="400"/></g> <ellipse fill="#8af" cx="700" cy="420" rx="450" ry="280" mask="url(#cut)"/><ellipse fill="#8af" cx="360" cy="310" rx="340" ry="280"/><use xlink:href="#plus"/><use xlink:href="#pwr"/> '; Bawl.sBI='width="1080px" height="720px" viewBox="0 0 1080 720"> <rect fill="#FFF" x="0" y="0" width="720" height="720"/><ellipse fill="#000" cx="870" cy="370" rx="300" ry="400"/>  <rect fill="#000" x="820" y="0" width="60" height="320"/><rect fill="#000" x="680" y="130" width="320" height="60"/></g> <rect fill="#0ff" x="665" y="260" width="640" height="480"/>  <circle cx="985" cy="420" r="260" stroke="#000" stroke-width="60" fill="none" mask="url(#cut2)"/><rect fill="#000" x="945" y="50" width="80" height="400"/></g> <ellipse fill="#8af" cx="700" cy="420" rx="450" ry="280" mask="url(#cut)"/><ellipse fill="#8af" cx="360" cy="310" rx="340" ry="280"/><use xlink:href="#plus"/><use xlink:href="#pwr"/> '; Bawl.sBINSD='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + Bawl.sBI.replace(/<use xlink[^>]*"#pwr"\/>/g,'')); Bawl.sBID='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + Bawl.sBI.replace(/1080/g,'720').replace(/<use xlink[^>]*>/g,'')); Bawl.sBIFRD=Bawl.sBID.replace(/8af/g,'68d'); Bawl.sBIPD='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + Bawl.sBI.replace(/1080/g,'1280').replace(/<use xlink[^>]*"#plus"\/>/g,'').replace(/8af/g,'dadada')); Bawl.sBIED='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + 'width="720px" height="720px" viewBox="0 0 720 720"><g transform="rotate(40)"><g transform="translate(530 200) scale(1 1.5) rotate(45)"><rect fill="#8bf" x="0" y="0" width="127" height="127"/></g><rect fill="#8af" x="440" y="-365" width="180" height="700"/><rect fill="#79e" x="460" y="-230" width="40" height="520"/><rect fill="#67e" x="440" y="-365" width="180" height="100"/></g> '); Bawl.sBILD='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + 'width="720px" height="340px" viewBox="0 0 720 340"> <rect fill="#fff" x="0" y="190" width="170" height="350"/>  <rect fill="#fff" x="300" y="190" width="170" height="220"/>  <rect fill="#fff" x="170" y="470" width="130" height="60"/>  <g mask="url(#c1)"><circle cx="170" cy="360" r="140" stroke="#778" stroke-width="60" fill="none"/></g><g mask="url(#c2)"><circle cx="300" cy="360" r="140" stroke="#778" stroke-width="60" fill="none"/></g><rect fill="#778" x="170" y="190" width="130" height="60"/><g mask="url(#c3)"><circle cx="340" cy="425" r="160" stroke="#778" stroke-width="90" fill="none"/></g></g> <g transform="translate(0,-190)"><use xlink:href="#link"/><g transform="translate(720,720) rotate(180)"><use xlink:href="#link"/></g></g> '); Bawl.sBISD='data:image/svg+xml,' + encodeURIComponent(Bawl.sH2 + 'width="720px" height="720px" viewBox="0 0 720 720"> <clipPath id="cut"><circle fill="#000" cx="360" cy="360" r="355"/></clipPath> <circle fill="#000" cx="360" cy="360" r="250"/><rect fill="#000" x="300" y="0" width="120" height="720" clip-path="url(#cut)"/><rect fill="#000" x="0" y="300" width="720" height="120" clip-path="url(#cut)"/><g clip-path="url(#cut)"><g transform="translate(360,-277)"><g transform="rotate(45)"><rect fill="#000" x="390" y="0" width="120" height="900"/><rect fill="#000" x="0" y="390" width="900" height="120"/></g></g></g><circle fill="#fff" cx="360" cy="360" r="120"/> '); Bawl.sBILB='<img style="height:1.4em !important" src="' + Bawl.sBILD.replace(/\%23778/g, '%23000') + '">'; Bawl.sBIS='<img style="height:1.75em !important" src="' + Bawl.sBISD + '">'; if(Bawl.s2.grayscale){ Bawl.sBID=Bawl.sBID.replace(/8af/g,'bbb'); Bawl.sBINSD=Bawl.sBINSD.replace(/8af/g,'bbb'); Bawl.sBIED=Bawl.sBIED.replace(/8af/g,'bbb').replace(/8bf/g,'c1c1c1').replace(/79e/g,'aaa').replace(/67e/g,'999'); } if($('#mw-content-text')[0].attributes && $('#mw-content-text')[0].attributes.dir && $('#mw-content-text')[0].attributes.dir.value == 'rtl'){ Bawl.CSSFS='left'; } else { Bawl.CSSFS='right'; } mw.util.addCSS('.BawlReplyButton{font-size:0.5em; font}\ .BawlReplyLink:hover{text-decoration:none;background-color:#EEEEFF;cursor: pointer;}\ .BawlReplyLink:active{text-decoration:none;background-color:#EEEEFF;}\ .BawlReplyLinkIcon{margin-left:0.6em; margin-right:0.6em}\ .BawlSVG{background-repeat:no-repeat;background-position:center;height:1em;}\ .BawlSVGLinkIcon{background-image: url("' + Bawl.sBILD + '");background-size:2.1em;padding:0 1em 0 1.1em;}\ .BawlSVGIcon{background-image: url("' + Bawl.sBID + '");background-size:1em;padding:0 0.5em 0 0.5em;}\ .BawlSVGFirstReplyIcon{background-image: url("' + Bawl.sBIFRD + '");background-size:1em;padding:0 0.5em 0 0.5em;}\ .BawlSVGEditIcon{background-image: url("' + Bawl.sBIED + '");background-size:1em;padding:0 0.5em 0 0.5em;}\ .BawlSVGNewSectionIcon{background-image: url("' + Bawl.sBINSD + '");background-size:1.5em;padding:0 0.8em 0 0.7em;}\ .BawlSVGPowerIcon{background-image: url("' + Bawl.sBIPD + '");background-size:1.78em;padding:0 1.5em 0 1.5em;font-size:smaller;}\ .BawlNoDisplay{display:none !important}\ .BawlYesDisplay{display:inline !important}\ .BawlMarginHalfEm{margin-bottom:0.5em}\ .BawlMarginHalfEmTop{margin-top:0.5em;}\ .BawlPreviewBox{padding:0.1em 1em 0.1em 1em;border:thin dashed gray;word-wrap:break-word;}\ .BawlFloatRight{float:' + Bawl.CSSFS + ';}\ .BawlForm{transition: all .5s ease-in;padding:0.5em 0.5em 0em 0.5em;margin:0em 0em 0em 1.5em;font-size:' + Bawl.s2.UIfontSize + ';font-family:sans-serif; font-weight:normal;min-width:50em;}\ .BawlLimitWidth{max-width:50em;}\ .BawlUnsetLimitWidth{max-width:unset !important;}\ .BawlSettings{background:#FEFEFF;padding:0.1em 0.5em 0.1em 0.5em;border:thin solid lightgray;}\ .BawlSettingTabs{padding:0.5em 0.5em 0em 0.5em !important;}\ .BawlDropDownMenu{max-width:30em;}\ .BawlOOuiFieldLayout{margin-top:0.5em !important; margin-bottom:0.75em;}\ .BawlOOuiFieldLayout::after{clear:none;}\ .BawlShakeIt{animation: shake 0.12s; animation-iteration-count: 3;} @keyframes shake{0%{margin:-0.1em 0em 0.6em 0em; } 9%{margin:-0.2em 0em 0.7em 0em; } 18%{margin:-0.3em 0em 0.8em 0em; } 27%{margin:-0.2em 0em 0.7em 0em; } 36%{margin:-0.1em 0em 0.6em 0em; } 45%{margin:0em 0em 0.5em 0em; } 54%{margin:0.1em 0em 0.4em 0em; } 63%{margin:0.2em 0em 0.3em 0em; } 72%{margin:0.3em 0em 0.2em 0em; } 81%{margin:0.2em 0em 0.3em 0em; } 90%{margin:0.1em 0em 0.4em 0em; } 100%{margin:0em 0em 0.5em 0em; }}\ .BawlSmallerText{font-size: 70%;}\ .BawlEditNoticeDiv{max-height:12em;padding:0;margin:0 0 1em 0;overflow:auto;border:0.1em solid #bbb;}\ .BawlEditNoticeDismiss{background:GhostWhite;text-align:right;padding:0.5em;border-bottom:0.1em solid #bbb;clear:both;}\ @keyframes BawlBlinker{50%{opacity: 0.5; }}\ .BawlPendingBlink{animation: BawlBlinker 1s linear infinite;}\ .BawlLeftRightMargin{margin-left: 0.5em; margin-right: 0.5em;}\ .BawlMarkupBold{font-weight: bold;font-size:large;}\ .BawlMarkupItalic{font-weight: normal; font-style: italic;font-size:large;}\ .BawlPreviewAfterPost{transition: all .5s ease-in;margin-left: 0; font-family:sans-serif; font-weight: normal;}\ .BawlFirstReply{text-align:center;margin:-0.6em 0 -0.5em 0;height:1em;}\ .BawlNoMaxWidth{max-width:none;}\ .BawlInsertLinkForm{transition: all .5s ease-in;width:96%;background:#EEEEFF;padding:1em;border:0.2em solid #CCC;}\ .BawlInsertLinkForm:focus{border:0.2em solid #69F;}\ .BawlPurpleBG{background-color: rgba(170, 70, 255, 0.2);}\ .BawlEaseIn{transition: all 1s ease-in;}\ .BawlDiffPlusBig{font-weight:bold;color:#006400;}\ .BawlDiffPlus{color:#006400;}\ .BawlDiffMinBig{font-weight:bold;color:#8b0000;}\ .BawlDiffMin{color:#8b0000;}\ .BawlVisualLight{transition: all .5s ease-in;padding:0.5em;margin:0.5em 0.5em 0.5em 0;border:0.2em solid #CCC;width:98%;height:10em;word-wrap:break-word;overflow:auto;outline:none;}\ .BawlVisualLight:focus{border:0.2em solid #69F;}\ .BawlEditorSwitch{font-weight: bold;font-size:large;font-family:mono;}\ .BawlHalfOpacity{opacity:0.5;}\ .BawlWarning{background:#FFBBBB;padding:1em;}\ .BawlpermaLinkText{width:20em; }'); Bawl.pRSLC={}; Bawl.dAPIC=function( params, mode, callback){ api.postWithEditToken( params ).done( function ( apiResponse){ if(params.action == 'parse' && mode == 'previewposted'){ Bawl.d(28); Bawl.pCP2=apiResponse.parse.text.replace(/^<div class=\"mw-parser-output\">([^]*)<\/div>$/, ' $1 ').replace(/(BawlCommentSpan">) ([^]*)<\/p>([\s]*)?<!--([\s]*)?NewPP[^]*/, '$1$2').replace(/ ((<(a|span) [^>]*>[^<]*<\/(a|span)>|[^<])*)<\/span>/, ''); Bawl.pAPB=' ' + Bawl.pCP2; if(['comment','BCL','newsection','newheading'].indexOf(Bawl.rLPO.type) != -1 || ( Bawl.rLPO.type == 'edit' && document.getElementById('PreviewAfterPost-' + Bawl.rLPO.id) )){ Bawl.wLID=Bawl.pAPB.match(/span id="([^"]*:[0-9]{13,14}:[^"]*)" class="FTTCmt"/, '$1')[1]; Bawl.d(29); } if(Bawl.rLPO.type == 'edit' && document.getElementById('PreviewAfterPost-' + Bawl.rLPO.id)){ Bawl.d(30); document.getElementById('PreviewAfterPost-' + Bawl.rLPO.id).outerHTML=Bawl.pAPB + ' '; } else if(Bawl.rLPO.type == 'edit'){ Bawl.d(31); Bawl.cR; Bawl.lIHTMLRE=new RegExp('([^]*)(<span id="' + Bawl.eRE(Bawl.rLPO.id) + '" class="[^"]*">)(([^<]|<(?![\/]?span>|<span([^<]|<(?!\/span>))*)*)*<\/span>)'); document.getElementById('bawlLink-' + Bawl.rLPO.id).parentElement.parentElement.innerHTML=document.getElementById('bawlLink-' + Bawl.rLPO.id).parentElement.parentElement.innerHTML.replace(Bawl.lIHTMLRE, Bawl.pAPB + '$2$3' + ' '); } else if(document.getElementById('bawlForm-' + Bawl.rLPO.id)){ Bawl.d(32); document.getElementById('bawlForm-' + Bawl.rLPO.id).outerHTML=Bawl.pAPB + ' '; } if(Bawl.pCS == true && Bawl.nCID != '#'){ Bawl.d(33); if(Bawl.rLPO.type != 'edit' && document.getElementById(Bawl.wLID)){ Bawl.d(34); document.getElementById(Bawl.wLID).id=Bawl.nCID.slice(1,); document.getElementById('PreviewAfterPost').id='PreviewAfterPost-' + Bawl.nCID.slice(1,); } $('.BawlPurpleBG').removeClass('BawlPurpleBG'); Bawl.aRLT(Bawl.pPP); $('.BawlLinks').removeClass('BawlNoDisplay'); } } else if(params.action == 'parse' && (mode == 'preview' || mode == 'diff')){ Bawl.d(35); $(document.getElementsByClassName('BawlPreviewBox'))[0].innerHTML=apiResponse.parse.text; } else if(( apiResponse.error && apiResponse.error.code == 'editconflict' ) || ( apiResponse.edit.result == 'Success' && ! apiResponse.edit.newtimestamp ) ) { Bawl.eCR=Bawl.eCR - 1; if(apiResponse.edit.result == 'Success' && ! apiResponse.edit.newtimestamp && Bawl.eCR > 0 ) { Bawl.eCR=1; } if(apiResponse.edit.result == 'Success' && ! apiResponse.edit.newtimestamp){ Bawl.d(36); } else { Bawl.d(37); } if(Bawl.eCR >= 1){ Bawl.pR1(Bawl.rLPO); } else { Bawl.d(38); } } else if(params.action == 'edit' && apiResponse.edit.result == 'Success'){ Bawl.d(39); Bawl.cR; if(Bawl.s2.saveDraft){ Bawl.sD2(Bawl.rLPO, 'remove'); } if(['comment','BCL','newsection','newheading'].indexOf(Bawl.rLPO.type) != -1){ Bawl.nCT=new Date(apiResponse.edit.newtimestamp).getTime.toFixed.slice(0,-3); Bawl.nCID='#'; if(typeof Bawl.lID2 != 'undefined' && Bawl.lID2.match(//)){ Bawl.nCID='#' + Bawl.lID2.replace('', Bawl.nCT); } } else if(Bawl.rLPO.type == 'edit' && typeof Bawl.rLPO.origid == 'undefined'){ Bawl.nCID='#' + encodeURIComponent(Bawl.rLPO.id); } else if(Bawl.rLPO.type == 'heading' && Bawl.rLPO.subtype == 'edit'){ Bawl.nCID='#' + Bawl.rLPO.sectionTitle.replace(/ /g,'_'); } if(['link','reload'].indexOf(Bawl.s2.afterPost) != -1){ document.getElementById('bawlForm-' + Bawl.rLPO.id).outerHTML=document.getElementById('bawlForm-' + Bawl.rLPO.id).outerHTML + ' <a href="?' + Math.floor(Math.random*100000) + Bawl.nCID + '">' + Bawl.m.commentDone + '</a>' + Bawl.m.commentPostedThankYou + ' '; } if(Bawl.s2.afterPost == 'reload' || ( ['comment','edit','newsection','newheading'].indexOf(Bawl.rLPO.type) == -1 && Bawl.s2.afterPost != 'link' )){ if(Bawl.rLPO.type != 'editFullPage'){ window.location=Bawl.nCID; } if(Bawl.s2.debug == false){ var DelayedReload=setInterval(function { clearInterval(DelayedReload); location.reload; }, 2000); } else { Bawl.d(40); } } else if(Bawl.s2.afterPost == 'parsecomment'){ Bawl.pPP={ 'int': Bawl.rLPO.int, 'type':'comment', 'subtype':'locator', 'id': Bawl.nCID.slice(1,), 'origid': Bawl.rLPO.id, 'pageTitle': Bawl.rLPO.pageTitle, 'origReplyTo': Bawl.uN, 'origTimestamp': Bawl.nCT + Bawl.cM, 'sectionTitle': Bawl.rLPO.sectionTitle, 'seq':0, 'sectionseq':Bawl.rLPO.sectionseq }; Bawl.d(41); Bawl.d(42); Bawl.pCS=true; $('.BawlPurpleBG').removeClass('BawlPurpleBG'); if(Bawl.pCP2 && document.getElementById(Bawl.wLID) && Bawl.nCID != '#'){ Bawl.d(43); document.getElementById(Bawl.wLID).id=Bawl.nCID.slice(1,); document.getElementById('PreviewAfterPost').id='PreviewAfterPost-' + Bawl.nCID.slice(1,); Bawl.aRLT(Bawl.pPP); } } Bawl.d(44); Bawl.UITI.setValue(''); Bawl.UITIT.setValue(''); } } ); }; Bawl.eRE=function(text){ if(text){ return mw.util.escapeRegExp(text); } else { return ''; } }; Bawl.eR=function(text){ return text.replace(/\$/g, '$$$$'); }; Bawl.eHTML=function(text){ return text.replace(/\&/g, '&amp;').replace(/\'/g, '&apos;').replace(/\"/g, '&quot;').replace(/\</g, '&lt;').replace(/\>/g, '&gt;'); }; Bawl.cTCB=function(text,permaLinkInt){ navigator.clipboard.writeText(Bawl.pL).then(ok => {mw.notify(Bawl.b.clipBoardSuccess); Bawl.d(45); Bawl.pLL[permaLinkInt].toggle(false);$('#genLink-' + permaLinkInt).removeClass('BawlNoDisplay');}) .catch(fubar => {mw.notify(Bawl.b.clipBoardFail + fubar); Bawl.d(46); }); }; Bawl.pLT={}; Bawl.pLCB={}; Bawl.pLC={}; Bawl.pLL={}; Bawl.gPL=function(replyLinkParams){ delete Bawl.pL; Bawl.cPTP={ 'action':'query', 'export':'true', 'titles': replyLinkParams.pageTitle, 'prop':'revisions' } api.get(Bawl.cPTP).done(function(currentPageText){ Bawl.d(47); if(! currentPageText.query.pages[-1]){ Bawl.d(48); Bawl.pLID=currentPageText.query.pages[ Object.keys(currentPageText.query.pages)[0] ].revisions[0].revid; if(replyLinkParams.subtype == 'locator'){ Bawl.pLA=replyLinkParams.id.replace(/ /g, '_'); } else if(replyLinkParams.type == 'heading'){ Bawl.pLA=replyLinkParams.sectionTitle; if(replyLinkParams.sectionseq > 0){ Bawl.pLA=Bawl.pLA + '_' + ( replyLinkParams.sectionseq + 1); } } Bawl.pL='https://' + mw.config.get('wgServerName') + mw.config.get('wgScriptPath') + '/index.php?title=' + encodeURIComponent(replyLinkParams.pageTitle.replace(/ /g, '_')) + '&oldid=' + Bawl.pLID + '#' + Bawl.pLA.replace(/ /g,'_'); mw.loader.using( [ 'oojs-ui-core' ] ).then( function { Bawl.pLT[replyLinkParams.int]=new OO.ui.TextInputWidget( { value: Bawl.pL, classes: ['BawlpermaLinkText'], readOnly: true } ); Bawl.pLCB[replyLinkParams.int]=new OO.ui.ButtonWidget( { label:new OO.ui.HtmlSnippet('  &#x2702;  '),//&#x2702; = ✂ (scissors) flags:['progressive','primary'] } ); Bawl.pLCB[replyLinkParams.int].on('click', function { Bawl.cTCB(Bawl.pL,replyLinkParams.int); }); Bawl.pLC[replyLinkParams.int]=new OO.ui.ButtonWidget( { icon: 'cancel', flags:['progressive','primary'] } ); Bawl.pLC[replyLinkParams.int].on('click', function { Bawl.pLL[replyLinkParams.int].toggle(false);$('#genLink-' + replyLinkParams.int).removeClass('BawlNoDisplay'); }); Bawl.pLL[replyLinkParams.int]=new OO.ui.HorizontalLayout( { items: [ Bawl.pLT[replyLinkParams.int], Bawl.pLCB[replyLinkParams.int], Bawl.pLC[replyLinkParams.int], ], id: 'BawlpermaLink-' + replyLinkParams.int, } ); Bawl.d(49); document.getElementById('bawlLink-' + Bawl.eHTML(replyLinkParams.id)).appendChild(Bawl.pLL[replyLinkParams.int].$element[0]); $('#genLink-' + replyLinkParams.int).addClass('BawlNoDisplay'); Bawl.pLT[replyLinkParams.int].select; }); } else { mw.notify(Bawl.b.fail); } }) }; Bawl.rUU=function(text){ if(mw.config.get('wgPageContentModel') != 'wikitext'){ Bawl.d(50); return text; } Bawl.d(51); Bawl.rUU2=text; Bawl.d(52); Bawl.rRE2={ 'phabpage':'/([^\[\}\|"\']|^)https\\:\\/\\/phabricator\.wikimedia\.org\\/(([^\\n\\.\\,\\?\\& ]|[\\.\\,\\?\\&][^$ \\n])*)/$1phab:$2/g', 'page':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/wiki\\/(([^\\n\\.\\,\\?\\& ]|[\\.\\,\\?\\&][^$ \\n])*)/$1INTERWIKI:$2.$4:$5/g', 'diff':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\.php\\?(title\=(([^\\n\\.\\,\\?\\& ]|[\\.\\,\\?\\&][^$ \\n])*)\\&)?diff\=([0-9]+)\\&oldid\=[0-9]*/$1$6' + Bawl.wM.difflinkname + '/g', 'diffprevnext':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\.php\\?(title\=(([^\\n\\.\\,\\?\\& ]|[\\.\\,\\?\\&][^$ \\n])*)\\&)?diff\=(next|prev)\\&oldid\=([0-9]*)/$1$6' + Bawl.wM.difflinknameprevnext + '/g', 'spaceremoval':'/(Special\:Diff.[0-9]*)(\\/)?(prev|next)?. /$1$2$3|/g', 'oldid':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\.php\\?title\=(([^\\n\\.\\,\\?\\& ]|[\\.\\,\\?\\&][^$ \\n])*)\\&oldid\=([0-9]*)(#([^ \\n,\?\!]|[\.\?\!][^$\s])*)?/$1$5 (' + Bawl.b.revisionlinkname + ')/g', 'redlink':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\\.php\\?title=([^\\&\\n]*)\\&action=edit\\&redlink=1/$1INTERWIKI:$2.$4:$5/g', 'history':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\\.php\\?title=([^\\&\\n]*)\\&action=history/$1' + Bawl.wM.pageHistoryLinkName + '/g', 'pagetitle':'/([^\[\}\|"\']|^)https\\:\\/\\/([a-z\-]{0,10})(\.m)?\.(wikipedia|wikimedia|mediawiki|wikidata|wikibooks|wiktionary|wikinews|wikiquote|wikisource|wikiversity|wikivoyage)\.org\\/w\\/index\.php\\?(title\=(([^\\n\\.\\,\\?\\!\\& ]|[\\.\\,\\?\\!\\&][^$ \\n])*))/$1INTERWIKI:$2.$4:$6/g', 'localwiki':'/\\[\\[INTERWIKI:' + Bawl.eRE(mw.config.get('wgServer').replace(/\/\/([^\/]*)\.org.*/, '$1')) + '//g', 'testwiki':'/\\[\\[INTERWIKI:test\\.wikipedia/[[:testwiki/g', 'commons':'/\\[\\[INTERWIKI:commons\\.wikimedia/[[:c/g', 'meta':'/\\[\\[INTERWIKI:meta\\.wikimedia/[[:m/g', 'mediawiki':'/\\[\\[INTERWIKI:www\\.mediawiki/[[:mw/g', 'foundation':'/\\[\\[INTERWIKI:foundation\\.wikimedia/[[:foundation/g', 'species':'/\\[\\[INTERWIKI:species\\.wikimedia/[[:species/g', 'wikidata':'/\\[\\[INTERWIKI:wikidata\\.wikimedia/[[:d/g', 'wikipedia':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikipedia/[[:w:$1/g', 'wikibooks':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikibooks/[[:b:$1/g', 'wiktionary':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wiktionary/[[:wikt:$1/g', 'wikinews':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikinews/[[:n:$1/g', 'wikiquote':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikiquote/[[:q:$1/g', 'wikisource':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikisource/[[:s:$1/g', 'wikiversity':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikiversity/[[:v:$1/g', 'wikivoyage':'/\\[\\[INTERWIKI:([a-z\-]{0,10})\\.wikivoyage/[[:voy:$1/g', } for (int=0; int < Object.keys(Bawl.rRE2).length; int++){ Bawl.rR=Bawl.rRE2[Object.keys(Bawl.rRE2)[int.replace(/^\/(.*[^\\])\/(.*[^\\])\/(.*[^\\])/, '$1'); Bawl.rF2=Bawl.rRE2[Object.keys(Bawl.rRE2)[int]].replace(/^\/(.*[^\\])\/(.*[^\\])\/(.*[^\\])/, '$3'); Bawl.rR2=Bawl.rRE2[Object.keys(Bawl.rRE2)[int]].replace(/^\/(.*[^\\])\/(.*[^\\])\/(.*[^\\])/, '$2'); Bawl.d(53); Bawl.rRE=new RegExp(Bawl.rR, Bawl.rF2); Bawl.rUU2=Bawl.rUU2.replace(Bawl.rRE, Bawl.rR2).replace(/SLASHCHAR/g, '/'); } Bawl.rMD=Bawl.rUU2.match(/Special:Diff\/([0-9]+)\|([^\]]*) \([^\)]*[0-9]+[^\)]*\)/g); if(Bawl.rMD){ for (int=0; int < Bawl.rMD.length; int++){ Bawl.rUU2=Bawl.rUU2.replace(Bawl.rMD[int], decodeURIComponent(Bawl.rMD[int].replace(/_/g, ' '))); } } Bawl.d(54); Bawl.d(55); Bawl.rUU2=Bawl.rUU2.replace(/\/\/youtu\.be\/([^\?]*)\?\//g, '\/\/www.youtube.com\/watch\?$1&').replace(/\/\/youtu\.be\//g, '\/\/www.youtube.com\/watch\?'); Bawl.rUU3=Bawl.rUU2; int=0; while ( ( Bawl.rUU2 != Bawl.rUU3 && int < 1000 ) || int == 0){ Bawl.rUU2=Bawl.rUU3; Bawl.rUU3=Bawl.rUU3.replace(/\[\[([^_\]]*)_(.*\]\])/g, '$1 $2'); int=int + 1; Bawl.d(56); } Bawl.rUU4=Bawl.rUU3; Bawl.rUU4RE=new RegExp('(\\[\\[[^\\*\\]\\])', 'g'); Bawl.rUU42=Bawl.rUU4.match(Bawl.rUU4RE); if(Bawl.rUU42){ for (int=0; int < Bawl.rUU42.length; int++){ Bawl.rUU4=Bawl.rUU4.replace(Bawl.rUU42[int], decodeURIComponent(Bawl.rUU42[int])); } } Bawl.UITI.setValue(Bawl.rUU4); return Bawl.rUU4; }; Bawl.aM=function(text){ Bawl.d(57); return text.replace(/\*\*([^\*\n]*)\*\*/g, '\'\'\'$1\'\'\).replace(/(^|\n| )_([^\_]*)_($|\n|[ \.\!\?])/g, '$1\'\'$2\'\'$3').replace(/`([^`]*)`/g, ' ').replace(/(^|\n)---($|\n)/, '$1 $2'); }; Bawl.aBBC=function(text){ Bawl.d(58); Bawl.w=[ 'afwiki','alswiki','barwiki','dawiki','dewiki','enwiki','eswiki','fowiki','guwiki','jvwiki','kabwiki','kswiki','lijwiki','mywiki','nds_nlwiki','nlwiki','nowiki','orwiki','rowiki','scowiki','sdwiki','simplewiki','srwiki','svwiki','tawiki','thwiki','vecwiki','zhwiki' ,'enwikiversity' ,'dewikibooks','nlwikibooks','nowikibooks','enwikinews','eswikinews','enwikinews','nlwikinews','nowikinews','enwikiquote','nlwikiquote','enwikisource','guwikisource','enwikiversity','dewikivoyage','eswikivoyage','enwiktionary','eswiktionary','nlwiktionary','commonswiki','mediawikiwiki','metawiki','wikidatawiki' ]; if(Bawl.w.indexOf(mw.config.get('wgDBname')) != -1){ text=text.replace(/(^| |\n)(:-\)|;-\)\|:-\([^a-zA-Z0-9]|$)/g, '$1$3'); } return text.replace(/\[\/?[Bb]\]/g, '\'\'\).replace(/\[\/?[Ii]\]/g, '\'\).replace(/\[(\/)?[Uu]\]/g, '<$1u>').replace(/\[(\/)?[Ss]\]/g, '<$1s>').replace(/\[url\](http)?(s?)(:\/\/)?([^\/\[]*)([^\[]*)\[\/url\]/gi, '[http$2://$4$5 ' + '$4' + ']').replace(/\[url="?(http)?(s?)(:\/\/)?([^\/\[]*)([^\[]*)"?\]([^\[]*)\[\/url\]/gi, '[http$2://$4$5 ' + '$6' + ']').replace(/\[img\]([^:\[]*:)?([^\[]*)\[\/img\]/g, 'thumb').replace(/\[(\/)?[Cc]ode\]/g, '<$1code>').replace(/\Ss]tyle size="?([0-9]*)"?\]([^\[]*)\[\/(style)?\]/g, '<span style="font-size: $1pt">$2 ').replace(/\[[Ss]tyle size="?([^"\*)"?\]([^\[]*)\[\/(style)?\]/g, '<span style="font-size: $1">$2 ').replace(/\[([Ss]tyle )?color="?([0-9A-Fa-z]*)"?\]([^\[]*)\[\/(style|color)?\]/g, '<span style="color: $2">$3 ').replace(/\[\*\] ?([^\n\[]*)\s*/gm, '<li>$1</li>').replace(/\li)>/g, '</$1>').replace(/\[[Qq](uote)?\]([^\[]*)\[\/[Qq](uote)?\]/g, '"$2"').replace(/\[[Qq](uote)?=?"?([^"\*)"?\]([^\[]*)\[\/[Qq](uote)?\]/g, '"$3 —$2"').replace(/\s*\[(\/)?(td|tr)\]\s*/g, '<$1$2>').replace(/\[[Tt]able\]/g, ' '); }; Bawl.rCI=function(text){ Bawl.rI=text; Bawl.d(59); for (int=0; int < 50; int++){ if(Bawl.s2.cIThatRun && Bawl.s2.cIThatRun[int] && Bawl.s2.cIThatRun[int] != "" ) { Bawl.d(60); Bawl.iIRERE=new RegExp('^\/((?:[^\\/]|\\\/)*)\/((?:[^\\/]|\\/)*)\/([gmi]{0,3})$'); if(Bawl.s2.cIThatRun[int].match(Bawl.iIRERE)){ Bawl.cIRENP=Bawl.s2.cIThatRun[int].match(Bawl.iIRERE); Bawl.cIREN=new RegExp(Bawl.cIRENP[1], Bawl.cIRENP[3]); Bawl.rI=Bawl.UITI.getValue.replace(Bawl.cIREN, Bawl.cIRENP[2]); Bawl.UITI.setValue(Bawl.rI); Bawl.d(61); } } } return Bawl.rI; }; Bawl.cTOLC=function(text, mode){ Bawl.d(62); Bawl.mT1=' \n \n' + text; Bawl.mT2=; Bawl.lI=0; while ( Bawl.mT1 != Bawl.mT2 && Bawl.lI < 1000){ Bawl.lI=Bawl.lI + 1; Bawl.mT2=Bawl.mT1; Bawl.mT1=Bawl.mT1.replace(/(\n[^\#].*\n)(\#[ ]*)/g, '$1' + Bawl.lI + '. '); } Bawl.mT1=Bawl.mT1; return Bawl.mT1.replace(/^[\s]*/, ).replace(/[\s]*$/, ).replace(/[\*]{3}[\s]*(.*)/gm, '<li style="margin-left:3em;">$1</li>').replace(/[\*]{2}[\s]*(.*)/gm, '<li style="margin-left:2em;">$1</li>').replace(/[\*][\s]*(.*)/gm, '<li>$1</li>').replace(/[\n]?(<li( style="margin-left:[1-2]em;")?>(([^<]|<(?!\/li>))*)<\/li>)[\n]?/g, '$1').replace(/((<li( style="margin-left:[2-4]em;")?>(([^<]|<(?!\/li>))*)<\/li>)+)/g, '<ul>$1</ul>').replace( /\n/gm, Bawl.nLT ); } Bawl.aS=function(text){ if(text.match(/NOSIGN$/) || Bawl.rLPO.type == 'edit'){ Bawl.d(63); return text.replace(/[ ]*NOSIGN$/,); } else { Bawl.d(64); if(Bawl.s2.useLocator == true){ if(! Bawl.uN){ Bawl.uN=; } Bawl.lID2=Bawl.eHTML(Bawl.uN) + ':' + Bawl.cM + ':' + Bawl.eHTML(Bawl.rLPO.pageTitle.replace(/:/g, 'FTTCLN')); Bawl.lID2=Bawl.lID2.replace(/ /g, '_'); return text + ' ' + Bawl.eOCL.replace(/INNERCONTENT/g, '~').replace(/USERTIME/g, Bawl.lID2); } else { return text + ' ~'; } } }; Bawl.pPO=function(task){ if($('#BawlProgressIndicator')[0] && (!(Bawl.s2.markup && Bawl.s2.editorSwitch)) ) { $('#BawlProgressIndicator').append('<span title="' + task + '">▮ '); if(task == 'clear'){ $('#BawlProgressIndicator')[0].innerHTML=; } } }; Bawl.cR=function(trigger){ Bawl.d(65); if(document.getElementById('bawlForm-' + Bawl.rLPO.id)){ document.getElementById('bawlForm-' + Bawl.rLPO.id).outerHTML=; Bawl.d(66); if(Bawl.UITI.getValue.length < 40){ Bawl.UITI.setValue(); } } if(trigger == 'user'){ Bawl.sD2(Bawl.rLPO, 'remove', 'user'); Bawl.UITI.setValue(); } $('#mw-content-text').removeClass('BawlNoDisplay'); }; Bawl.pC2=function(text, mode){ if(mode != 'toVisual'){ Bawl.sTS2; } text=text.replace(/^[\s]*/, ).replace(/[\s]*$/, ); if(Bawl.s2.bbcode == true){ text=Bawl.aBBC(text); } Bawl.pPO('applied BBCode'); if(Bawl.s2.markdown == true){ text=Bawl.aM(text); } Bawl.pPO('applied Markdown'); if(Bawl.s2.rewritun == true){ text=Bawl.rUU(text); } Bawl.pPO('Rewritten urls'); if(Bawl.s2.enableCIThatRun == true){ Bawl.d(67); text=Bawl.rCI(text); } Bawl.pPO('Automatic regular expressions applied'); if(Bawl.rLPO.type == 'editFullPage' || ( Bawl.rLPO.type == 'heading' && Bawl.rLPO.subtype == 'edit' )){ return text; } else if(mode == 'toVisual'){ return Bawl.cTOLC(text, 'toVisual'); } else { text=Bawl.aS(text); return Bawl.cTOLC(text); } }; Bawl.dD=function(replyLinkParams){ Bawl.pPO('clear'); if(! Bawl.dCSS){ mw.loader.load('/w/load.php?lang=en&modules=mediawiki.diff.styles&only=styles&skin=' + mw.config.get('skin'),'text/css') Bawl.dCSS=true; } if(Bawl.aE == 'visualLight'){ Bawl.sTS2; } Bawl.pC3=Bawl.pC2(Bawl.UITI.getValue); api.post( { action:'compare',fromtitle:replyLinkParams.pageTitle,'totext-main':Bawl.pC3,toslots:'main',prop:'diff|size' } ).done( function ( data){ $('#BawlPreviewBox')[0].innerHTML=; $('#BawlPreviewBox').removeClass('BawlNoDisplay'); Bawl.d(68); Bawl.d(69); if(! data.compare['*']){ Bawl.dHTML=' ' + Bawl.b.nodifferences + ' '; } else { Bawl.dHTML=' '; } $('#BawlPreviewBox').append(Bawl.dHTML); Bawl.dNS=new Blob([Bawl.UITI.getValue]).size; if(Bawl.dNS >= data.compare.fromsize){ Bawl.dS2=Bawl.dNS - data.compare.fromsize; Bawl.dPM='+'; if(Bawl.dS2 > 100){ Bawl.dSC="BawlDiffPlusBig"; } else { Bawl.dSC="BawlDiffPlus"; } } else { Bawl.dS2=data.compare.fromsize - Bawl.dNS; Bawl.dPM='-'; if(Bawl.dS2 > 100){ Bawl.dSC="BawlDiffMinBig"; } else { Bawl.dSC="BawlDiffMin"; } } Bawl.UIS.setLabel(new OO.ui.HtmlSnippet('<span class="' + Bawl.dSC + '">' + Bawl.dPM + Bawl.dS2 + ' ')); }); }; Bawl.dP=function(mode, replyLinkParams){ Bawl.d(70); if(mode != 'previewposted'){ Bawl.pPO('clear'); $(document.getElementsByClassName('BawlPreviewBox')).removeClass('BawlNoDisplay'); if(Bawl.s2.checkNewComments == true){ Bawl.cFNC(Bawl.rLPO, 'preview'); } } if(Bawl.aE == 'visualLight'){ Bawl.sTS2; } Bawl.pC3=Bawl.pC2(Bawl.UITI.getValue); if(mode == 'previewposted' && Bawl.cTI){ Bawl.d(71); if(Bawl.cTI.match('┌')){ Bawl.d(72); Bawl.pC3=Bawl.cTI.slice(0,1) + Bawl.pC3 + Bawl.rTI(Bawl.pC3); } else { Bawl.pC3=Bawl.cTI.slice(-1,) + Bawl.pC3 + Bawl.rTI(Bawl.pC3); } } if(mode == 'previewposted' && replyLinkParams.type == 'newsection'){ Bawl.pC3='==' + Bawl.UITIT.getValue + '==\n' + Bawl.pC3; } if(mode == 'previewposted' && replyLinkParams.type == 'newheading'){ Bawl.pC3=Bawl.nSL + Bawl.UITIT.getValue + Bawl.nSL + '\n' + Bawl.pC3; } if(mode == 'previewposted' && replyLinkParams.type == 'edit' && document.getElementById('PreviewAfterPost-' + Bawl.rLPO.id)){ Bawl.pC3=Bawl.pC3 + Bawl.wTFESFP; Bawl.pC3=Bawl.pC3 + Bawl.rTI(Bawl.pC3); } if(mode == 'diff'){ Bawl.pC3=; } Bawl.pCP3={ format: 'json', action: 'parse', title: Bawl.rLPO.pageTitle, pst: '1', prop: 'text', formatversion: '2', text: Bawl.pC3 }; Bawl.dAPIC(Bawl.pCP3, mode); }; Bawl.cRTCFC=function(replyLinkParams, mode){ Bawl.d(73); api.get( { action: 'query', prop: 'revisions', format: 'json', titles: replyLinkParams.pageTitle, rvlimit: 1, rvprop: 'timestamp|user|comment|content', rvslots: '*', } ).done( function ( data){ Bawl.d(74); Bawl.d(75); if(data.query && data.query.pages && data.query.pages[ Object.keys(data.query.pages)[0] ] && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0]){ Bawl.pRCT=data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0].slots.main['*']; } else { Bawl.pRCT=; } Bawl.pRCT=Bawl.gIPS(Bawl.pRCT, replyLinkParams).sectiontext; Bawl.pRSLCT=Bawl.gIPS(Bawl.pRSLC[replyLinkParams.pageTitle], replyLinkParams).sectiontext; if(Bawl.pRCT != Bawl.pRSLCT ){ Bawl.pRCS=Bawl.pRCT.split('\n'); Bawl.lSLC=; for (commentCheckInt=0; commentCheckInt < Bawl.pRCS.length; commentCheckInt++){ if(Bawl.pRSLCT.split('\n').indexOf(Bawl.pRCS[commentCheckInt]) == -1){ Bawl.d(76); Bawl.lSLC=Bawl.lSLC + Bawl.pRCS[commentCheckInt] + '\n'; } } Bawl.sNLB=new OO.ui.ButtonWidget( { id: 'BawlshowNewLinesButton', label: Bawl.m.showNewLinesButton, flags: [ 'primary' ], } ); Bawl.sNLB.on('click', function{ Bawl.sNLB.setDisabled(true); api.post( { action: 'parse', prop: 'revisions', format: 'json', title: mw.config.get('wgPageName'), pst: '1', prop: 'text', formatversion: '2', text: Bawl.lSLC } ).done( function ( data){ Bawl.sNLB.setDisabled(false); $('#showNewLinesButton')[0].innerHTML=; $('#BawlPreviewBox')[0].innerHTML=; $('#BawlPreviewBox').removeClass('BawlNoDisplay'); $('#BawlPreviewBox').append(data.parse.text); }); }); $('#showNewLinesButton').removeClass('BawlNoDisplay'); $('#showNewLinesButton').innerHTML=; $('#showNewLinesButton').append(Bawl.sNLB.$element); } else if(mode == 'postreply'){ Bawl.pR1(replyLinkParams, 'checked'); } if(data.query && data.query.pages && data.query.pages[ Object.keys(data.query.pages)[0] ] && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0]){ Bawl.pRSLC[replyLinkParams.pageTitle]=data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0].slots.main['*']; } else { Bawl.pRSLC[replyLinkParams.pageTitle]=; } }); }; Bawl.cFNC=function(replyLinkParams, mode){ Bawl.d(77); if(Bawl.pRSLC[replyLinkParams.pageTitle]){ Bawl.cRTCFC(replyLinkParams, mode); } else { api.get( { action: 'query', prop: 'revisions', format: 'json', titles: replyLinkParams.pageTitle, rvlimit: 1, rvprop: 'timestamp|user|comment|content', rvslots: '*', rvstart: Bawl.pLTS, } ).done( function ( data){ Bawl.d(78); Bawl.d(79); if(data.query && data.query.pages && data.query.pages[ Object.keys(data.query.pages)[0] ] && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions && data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0]){ Bawl.pRSLC[replyLinkParams.pageTitle]=data.query.pages[ Object.keys(data.query.pages)[0] ].revisions[0].slots.main['*']; } else { Bawl.pRSLC[replyLinkParams.pageTitle]=; } Bawl.cRTCFC(replyLinkParams, mode); }); } }; Bawl.sDE=function{ var SaveDraftEvery=setInterval(function { if($('#BawlReplyForm')[0]){ Bawl.sD2(Bawl.rLPO,false,'scheduled'); Bawl.sDE; } clearInterval(SaveDraftEvery); }, 20000); }; Bawl.sD2=function(replyLinkParams, removeDraft, trigger){ Bawl.d(80); if(! $('#BawlReplyForm')[0] && trigger != 'user'){ Bawl.d(81); } else { if(window.localStorage.BawlDrafts){ Bawl.d(82); Bawl.sD=JSON.parse(window.localStorage.BawlDrafts); if(Bawl.sD[encodeURIComponent(replyLinkParams.id)] && ( Bawl.sD[encodeURIComponent(replyLinkParams.id)].text == Bawl.UITI.getValue )){ Bawl.dU=true; } else { delete Bawl.dU; } } else { Bawl.d(83); Bawl.sD={}; delete Bawl.dU; } Bawl.tND2=new Date.getTime; Bawl.tNDLW=Bawl.tND2 - 604800000; for (BawlDraftInt=0; BawlDraftInt < Bawl.sD.length; BawlDraftInt++){ Bawl.d(84); Bawl.pDK=Object.keys(Bawl.sD)[prefint]; if(Bawl.sD[Bawl.pDK].time < Bawl.tNDLW){ Bawl.d(85); delete Bawl.sD[Bawl.pDK]; } } if(Bawl.UITI.getValue.length > 100 && ! removeDraft){ Bawl.sD[encodeURIComponent(replyLinkParams.id)] = {'time':Bawl.tND2,'text':Bawl.UITI.getValue}; } else if(Bawl.sD[encodeURIComponent(replyLinkParams.id)]){ Bawl.d(86); if(trigger == 'user' && Bawl.UITI.getValue > 100){ mw.notify(Bawl.m.removeDraft); } delete Bawl.sD[encodeURIComponent(replyLinkParams.id)]; } else { Bawl.dU=true; } if(! Bawl.dU || trigger == 'user'){ Bawl.d(87); window.localStorage.setItem('BawlDrafts',JSON.stringify(Bawl.sD)); } else { Bawl.d(88); } } }; Bawl.cS=function{ $(document.getElementsByClassName('BawlSettings')).addClass('BawlNoDisplay'); window.BawlUITextInput.scrollIntoView; }; Bawl.cPT2=function(replyLinkParams){ Bawl.d(89); if(replyLinkParams.origReplyTo == ){ return; } Bawl.rIA=replyLinkParams.origReplyTo.match(/(^anon$|^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$|\:)/); Bawl.cHFN=$('.bawlprocess')[replyLinkParams.int].parentElement.innerHTML; Bawl.cLHFNRE=new RegExp('Bawl.eRE(replyLinkParams.origReplyTo).*NOPING.*' + Bawl.eRE(replyLinkParams.origTimestamp)); Bawl.cLHFN=; if(Bawl.cHFN.match(Bawl.cLHFNRE)){ Bawl.cLHFN=Bawl.cHFN.match(Bawl.cLHFNRE)[0]; } Bawl.uHPRE=new RegExp('(' + Bawl.eRE(replyLinkParams.origReplyTo) + '.*)NOPING(\:[^\:\<\>\"]{0,120})?(\:[^\:\<\>\"]{0,120})?(\:[^\:\<\>\"]{0,120})?(\:[^\:\<\>\"]{0,120})?(\:[^\:\<\>\"]{0,120})?(.{0,100}' + Bawl.eRE(replyLinkParams.origTimestamp) + '.*)'); Bawl.uHP=Bawl.cLHFN.match(Bawl.uHPRE); Bawl.cPT=Bawl.s2.pingText.replace(/PINGUSER/g, Bawl.eR(replyLinkParams.origReplyTo.replace(/_/g,' '))).replace(/CMTLINK/g, Bawl.eR(replyLinkParams.pageTitle.replace(/_/g,' ')) + '#' + Bawl.eR(replyLinkParams.id)); if(Bawl.rIA != null){ Bawl.d(90); return Bawl.pTA.replace(/PINGUSER/g, Bawl.eR(replyLinkParams.origReplyTo)); } else if(Bawl.uHP && Bawl.uN){ Bawl.d(91); Bawl.uN2=Bawl.cLHFN.replace(Bawl.uHPRE, '$2$3$4$5$6').replace(/_/g, ' '); if(Bawl.uN2 ==  || Bawl.uN2.match(':' + Bawl.uN + ':')){ Bawl.d(92); if(Bawl.uN2.match(':' + Bawl.uN + ':')){ Bawl.d(93); } mw.notify(Bawl.m.nopingNotify); return replyLinkParams.origReplyTo + ', '; } else { Bawl.d(94); return Bawl.cPT; } } else if(replyLinkParams.origReplyTo.replace(/_/g,' ') == Bawl.uN){ Bawl.d(95); } else if(replyLinkParams.origReplyTo.replace(/_/g,' ') == mw.config.get('wgRelevantUserName') && ! mw.config.get('wgRelevantPageName').match('/')){ Bawl.d(96); } else { return Bawl.cPT; } }; Bawl.lTR=function(text){ return text.replace(/<[\/]?ul>/g, ).replace(/<\/li>([^<])/g, '</li>\n$1').replace(/<li>(([^<]|<(?!\/li>))*)<\/li>/g, '\n*$1').replace(/<li style="margin\-left:2em;">(([^<]|<(?!\/li>))*)<\/li>/g, '\n**$1').replace(/<li style="margin\-left:3em;">(([^<]|<(?!\/li>))*)<\/li>/g, '\n***$1'); }; Bawl.sTV=function{ if(Bawl.aE == 'visualLight'){ Bawl.d(97); Bawl.pPO('clear'); Bawl.vC=Bawl.pC2(Bawl.UITI.getValue, 'toVisual'); Bawl.vC=Bawl.vC.replace(/(^|[^'])(([^']|'[^']|[^'])*)/g, '$1$2').replace(/(^|[^'])(([^']|'[^'])*)/g, '$1$2).replace(/\[([A-Za-z0-9]*):\/\/([^ \]]*)\]/g, '<a class="external" href="$1://$2">[1]</a>').replace(/\[([A-Za-z0-9]*):\/\/([^ \]]*) ([^\]]*)\]/g, '<a class="external" href="$1://$2">$3</a>').replace(/\[\[(([^\]\|]|\][^\]])*)\|\]\]/g, '<a class="BawlUnnamedPipeTrickInternalLink" href="/wiki/$1">$1</a>').replace(/\[\[(([^\]\|]|\][^\]])*)\]\]/g, '<a class="BawlUnnamedInternalLink" href="/wiki/$1">$1</a>').replace(/\[\[([^\|]*)\|(([^\]]|\][^\]])*)\]\]/g, '<a class="BawlNamedInternalLink" href="/wiki/$1">$2</a>').replace(/(<a class="BawlUnnamedInternalLink" href="[^"]*">):/, '$1'); Bawl.UIV.innerHTML=Bawl.vC; } }; Bawl.sTS2=function{ if(Bawl.aE == 'visualLight'){ Bawl.d(98); Bawl.sC=Bawl.UIV.innerHTML.replace(/<i><\/i>/g, ).replace(/<b><\/b>/g, ).replace(/ <\/s>/g, ).replace(/<b>(([^<]|<(?!\/b>))*)<\/b>/g, '\'\'\'$1\'\'\).replace(/<i>(([^<]|<(?!\/i>))*)<\/i>/g, '\'\'$1\'\).replace(/&lt;s&gt;(([^&]|&(?!lt;\/s&gt;))*)&lt;\/s&gt;/g, ' $1 ').replace(/ (([^<]|<(?!\/div>))*)<\/div>/g, Bawl.nLT + '$1').replace(/(<br( \/)?>)+/g, '\n').replace(/[ ]?'/g, ).replace(/([^']|^)[ ]?([^']|$)/g, '$1$2').replace(/<a class="BawlUnnamedPipeTrickInternalLink" href="\/wiki\/([^"]*)">(([^<]|<(?!\/a>))*)<\/a>/g, '$1').replace(/<a class="BawlUnnamedInternalLink" href="\/wiki\/([^"]*)">(([^<]|<(?!\/a>))*)<\/a>/g, '$1').replace(/<a class="BawlNamedInternalLink" href="\/wiki\/([^"]*)">(([^<]|<(?!\/a>))*)<\/a>/g, '$2').replace(/<a class="external" href="([^"]*)">[1]<\/a>/g, '[$1]').replace(/<a class="external" href="([^"]*)">(([^<]|<(?!\/a>))*)<\/a>/g, '[$1 $2]'); Bawl.UITI.setValue(Bawl.lTR(Bawl.sC).replace(/(\n)+/g, '\n').replace(/^[\n ]*/g, )); delete Bawl.sC; } }; Bawl.fI=function{ if(Bawl.aE == 'visualLight'){ document.getSelection.collapse(Bawl.UIV,Bawl.UIV.childNodes.length); } else if(Bawl.aE == 'source'){ Bawl.UITI.focus; } }; Bawl.iM=function(type){ Bawl.mUS={ 'italic':'\'\,'bold':'\'\'\,'struck':' ' }; Bawl.mUE={ 'italic':'\'\,'bold':'\'\'\,'struck':' ' }; if(Bawl.aE == 'visualLight' && type != 'link' ) { Bawl.vAFL=0; for (childNodeInt=0; childNodeInt < Bawl.UIV.childNodes.length; childNodeInt++){ if(Bawl.UIV.childNodes[childNodeInt] == Bawl.aN){ Bawl.hNI=childNodeInt; Bawl.iHTMLAO=Bawl.vAFL + Bawl.aO; if(Bawl.UIV.childNodes[childNodeInt].outerHTML){ Bawl.iHTMLAO=Bawl.iHTMLAO + Bawl.UIV.childNodes[childNodeInt].outerHTML.match(/^<[^>]*>/)[0].length; } } if(Bawl.UIV.childNodes[childNodeInt] == Bawl.fN){ Bawl.hNI=childNodeInt; Bawl.iHTMLFO=Bawl.vAFL + Bawl.fO; if(Bawl.UIV.childNodes[childNodeInt].outerHTML){ Bawl.iHTMLFO=Bawl.iHTMLFO + Bawl.UIV.childNodes[childNodeInt].outerHTML.match(/^<[^>]*>/)[0].length; } } if(Bawl.UIV.childNodes[childNodeInt].data){ Bawl.vAFL=Bawl.vAFL + Bawl.UIV.childNodes[childNodeInt].data.length; Bawl.nT='text'; } else { Bawl.vAFL=Bawl.vAFL + Bawl.UIV.childNodes[childNodeInt].outerHTML.length; Bawl.nT='HTML'; } } if(Bawl.iHTMLAO > Bawl.iHTMLFO){ Bawl.sH=Bawl.iHTMLAO; Bawl.sL=Bawl.iHTMLFO; } else { Bawl.sH=Bawl.iHTMLFO; Bawl.sL=Bawl.iHTMLAO; } if(Bawl.sT4 == 'Caret'){ Bawl.sT3='loremipsum'; } else { Bawl.sT3=Bawl.UIV.innerHTML.slice(Bawl.sL,Bawl.sH); } if(Bawl.UIV.innerHTML.slice(Bawl.sH,) == ){ Bawl.aST=' '; } else { Bawl.aST=Bawl.UIV.innerHTML.slice(Bawl.sH,); } Bawl.UIV.innerHTML=Bawl.UIV.innerHTML.slice(0,Bawl.sL) + Bawl.mUS[type] + Bawl.sT3 + Bawl.mUE[type] + Bawl.aST; Bawl.sTS2; document.getSelection.collapse(Bawl.UIV,Bawl.hNI + 2); Bawl.UIV.append(document.createElement('span')); Bawl.d(99); } else if(Bawl.aE == 'source' || type == 'link'){ if(['italic','bold','struck'].indexOf(type) != -1){ Bawl.UITI.encapsulateContent(Bawl.mUS[type], Bawl.mUE[type]); } else if(type == 'link'){ if(Bawl.UILL.getValue.match(/^(www\.|[A-Za-z0-9]+:\/\/)/)){ Bawl.d(100); if(Bawl.UILL.getValue.match(/^www\./)){ Bawl.lTI='http://' + Bawl.UILL.getValue; } else { Bawl.lTI=Bawl.UILL.getValue; } Bawl.iLS='BAWLINSERTEDLINKLINK ' + Bawl.lTI; Bawl.iLE=' BAWLINSERTEDLINKNAMESTART-' + Bawl.UILN.getValue + '-BAWLINSERTEDLINKNAMEEND'; } else { Bawl.d(101); Bawl.iLS=; Bawl.iLE=Bawl.UILN.getValue + ; } if(Bawl.aE == 'source'){ Bawl.UITI.encapsulateContent(Bawl.iLS, Bawl.iLE); } else if(Bawl.aE == 'visualLight'){ Bawl.sTS2; Bawl.UITI.setValue(Bawl.UITI.getValue + ' ' + Bawl.iLS + Bawl.iLE); } Bawl.iELRE=new RegExp('BAWLINSERTEDLINKLINK ' + Bawl.eRE(Bawl.lTI) + ' BAWLINSERTEDLINKNAMESTART-(([^B]|B(?!AWLINSERTEDLINKNAMEEND))+)-BAWLINSERTEDLINKNAMEEND', 'g'); Bawl.iEULRE=new RegExp('BAWLINSERTEDLINKLINK ' + Bawl.eRE(Bawl.lTI) + ' BAWLINSERTEDLINKNAMESTART--BAWLINSERTEDLINKNAMEEND', 'g'); Bawl.UITI.setValue(Bawl.pC2(Bawl.UITI.getValue, 'toVisual').replace(/BAWLINSERTEDLINKLINK \[\[([^\]]*)\]\] BAWLINSERTEDLINKNAMESTART-(([^B]|B(?!AWLINSERTEDLINKNAMEEND))+)-BAWLINSERTEDLINKNAMEEND/g, '$2').replace(Bawl.iELRE, '[' + encodeURI(Bawl.lTI) + ' $1]').replace(Bawl.iEULRE, '[' + Bawl.lTI + ']').replace(/BAWLINSERTEDLINKLINK (\[\^\*\]\]) BAWLINSERTEDLINKNAMESTART--BAWLINSERTEDLINKNAMEEND/g, '$1')); Bawl.UIV.append(document.createElement('br')); Bawl.UIV.append(document.createElement('br')); if(Bawl.aE == 'source'){ Bawl.sTV; } Bawl.fI; } } }; Bawl.iL=function{ Bawl.pPO('clear'); if($('#UIinsertLinkForm')[0]){ Bawl.UILL.setValue(); Bawl.UILN.setValue(); Bawl.UILF.toggle(true); } else { Bawl.UILL=new OO.ui.TextInputWidget( { classes: [ 'BawlMarginHalfEm',Bawl.BUITITC ], placeholder: Bawl.m.insertLinkLink, } ); Bawl.UILN=new OO.ui.TextInputWidget( { classes: [ 'BawlMarginHalfEm',Bawl.BUITITC ], placeholder: Bawl.m.insertLinkName, } ); Bawl.UILB=new OO.ui.ButtonWidget( { id: 'BawlUIReplyButton', label: Bawl.b.BawlUIReplyButton, flags: [ 'primary', 'progressive' ], classes: [ Bawl.bOTWSC, 'BawlWideButton' ] } ); Bawl.UILB.on('click', function { Bawl.iM('link');Bawl.UILF.toggle(false) }); Bawl.UILC=new OO.ui.ButtonWidget( { id: 'BawlUIReplyButton', label: Bawl.b.BawlUICancelButton, flags: [ 'primary', 'destructive' ], classes: [ Bawl.bOTWSC, 'BawlWideButton' ] } ); Bawl.UILC.on('click', function { Bawl.UILF.toggle(false) }); Bawl.UILBB=new OO.ui.HorizontalLayout( { items: [ Bawl.UILB, Bawl.UILC, ], classes: ['BawlLeftRightMargin'] } ); Bawl.UILF=new OO.ui.FormLayout( { items: [ Bawl.UILL, Bawl.UILN, Bawl.UILBB ], id: 'UIinsertLinkForm', classes: ['BawlInsertLinkForm'], } ); $('#BawlMainButtonBar').prepend(Bawl.UILF.$element); Bawl.UILL.focus; } }; Bawl.iVL=function{ Bawl.UIV=document.createElement('div'); Bawl.UIV.contentEditable=true; Bawl.UIV.className='BawlVisualLight'; Bawl.UIV.id='BawlVisualLight'; Bawl.UITI.on('change', function { Bawl.sTV }); $('body').bind("mouseup keyup touchend", function{ Bawl.fNTC=window.getSelection.focusNode.textContent; Bawl.fN=window.getSelection.focusNode; Bawl.aN=window.getSelection.anchorNode; Bawl.cI=window.getSelection; Bawl.aO=window.getSelection.anchorOffset; Bawl.fO=window.getSelection.focusOffset; Bawl.aN=window.getSelection.anchorNode; Bawl.fN=window.getSelection.focusNode; Bawl.sT4=window.getSelection.type; }); }; Bawl.tE=function{ if(Bawl.aE == 'source'){ Bawl.UITI.toggle(false); if(! Bawl.UIV.id){ Bawl.iVL; } $('#BawlUISwitchEditorButton').addClass('BawlHalfOpacity'); Bawl.UIV.classList.remove('BawlNoDisplay'); Bawl.aE='visualLight'; Bawl.sTV; } else if(Bawl.aE == 'visualLight'){ Bawl.UITI.toggle(true); Bawl.UIV.classList.add('BawlNoDisplay'); $('#BawlUISwitchEditorButton').removeClass('BawlHalfOpacity'); Bawl.sTS2; Bawl.aE='source'; } Bawl.fI; }; Bawl.lEN=function(dismiss){ Bawl.d(102); Bawl.cEN={}; Bawl.dNE='<div class="BawlEditNoticeDismiss" onclick="Bawl.lEN(\'dismissed\')"><a>[X]</a> '; if(window.localStorage.BawlEditNotices){ Bawl.cEN=JSON.parse(window.localStorage.BawlEditNotices); for (editNoticeNum=0; editNoticeNum < Bawl.cEN.length; editNoticeNum++){ if(Bawl.cEN[(Object.keys(Bawl.cEN)[editNoticeNum])].time < (Bawl.tI - 345600000 )){ Bawl.d(103); delete Bawl.cEN[(Object.keys(Bawl.cEN)[editNoticeNum])]; } } if(Bawl.cEN[Bawl.rLPO.pageTitle] && ! dismiss){ Bawl.cEN[Bawl.rLPO.pageTitle]={'time':Bawl.tI,'text':Bawl.cEN[Bawl.rLPO.pageTitle].text}; if(Bawl.cEN[Bawl.rLPO.pageTitle].text.replace(/<[^<>]*>/g, ).replace(/^[ ]*$/, ) != ){ $('#BawlEditNotice').append(Bawl.dNE + ' ' + Bawl.cEN[Bawl.rLPO.pageTitle].text) + ' '; $('#BawlEditNotice').removeClass('BawlNoDisplay'); } } else if(dismiss){ Bawl.cEN[Bawl.rLPO.pageTitle]={'time':Bawl.tI,'text':}; $('#BawlEditNotice').addClass('BawlNoDisplay'); } if(JSON.parse(window.localStorage.BawlEditNotices) != Bawl.cEN){ Bawl.d(104); window.localStorage.setItem('BawlEditNotices',JSON.stringify(Bawl.cEN)); } } if(! Bawl.cEN[Bawl.rLPO.pageTitle] && ! dismiss){ Bawl.eNP={ format: 'json', action: 'parse', title: Bawl.rLPO.pageTitle, pst: '1', prop: 'text', formatversion: '2', uselang: Bawl.uL, text: ' end  ', }; if(Bawl.rLPO.editIntro){ Bawl.eNP.text=; } api.post( Bawl.eNP ).done( function ( data){ if(data.parse){ Bawl.d(105); Bawl.eNE=data.parse.text.replace(/[^]* (([^])*)<span id="BawlNoticeEnd"[^]*/,'$1'); if(Bawl.eNE.replace(/<[^<>]*>/g, ).replace(/^[ ]*$/, ) != ){ $('#BawlEditNotice').append(Bawl.dNE + ' ' + Bawl.eNE + ' '); $('#BawlEditNotice').removeClass('BawlNoDisplay'); } Bawl.cEN[Bawl.rLPO.pageTitle]={'time':Bawl.tI,'text':Bawl.eNE}; window.localStorage.setItem('BawlEditNotices',JSON.stringify(Bawl.cEN)); } }); } }; Bawl.oRF=function(replyLinkParams, trigger){ Bawl.lS; if(typeof replyLinkParams == 'string'){ Bawl.d(106); replyLinkParams=JSON.parse(decodeURIComponent(replyLinkParams.replace(/\%27/g, '\))); } Bawl.pCS=false; if(Bawl.s2.warnExit == true){ window.onbeforeunload=function { if(Bawl.UITI.getValue.length > 30 && document.getElementById('BawlReplyForm') ) { return ; } }; } Bawl.d(107); Bawl.d(108); if(document.getElementById('BawlUITextInput') != null && replyLinkParams.type == 'comment' ) { Bawl.d(109); if(Bawl.UITI.getValue.slice(Bawl.UITI.getValue.length - 1, Bawl.UITI.getValue.length) != " "){ Bawl.sBP=" "; } else { Bawl.sBP=""; } Bawl.uPT=Bawl.cPT2(replyLinkParams); if(Bawl.uPT && Bawl.UITI.getValue.match(Bawl.eRE(Bawl.uPT))){ Bawl.d(110); Bawl.UITI.scrollElementIntoView; Bawl.UIRB.scrollElementIntoView; Bawl.fI; } else if(Bawl.uPT){ Bawl.d(111); Bawl.cP2=Bawl.UITI.getRange.from; Bawl.UITI.setValue(Bawl.UITI.getValue.slice(0, Bawl.cP2) + Bawl.sBP + Bawl.uPT + Bawl.UITI.getValue.slice(Bawl.cP2,)); } } else if(document.getElementById('BawlUITextInput') != null && replyLinkParams.type != 'comment'){ Bawl.d(112); Bawl.UITI.scrollElementIntoView; Bawl.UIRB.scrollElementIntoView; } else if(document.getElementById('BawlUITextInput') == null){ mw.loader.using( [ 'oojs-ui-core' ] ).then( function { if(replyLinkParams.type == 'editFullPage'){ Bawl.aE='source'; } else { Bawl.aE=Bawl.s2.editor; } Bawl.d(113); if($('.BawlPurpleBG')[0]){ Bawl.d(114); mw.notify(Bawl.b.fail); return; } Bawl.rLPO=replyLinkParams; Bawl.bFHTML=document.createElement('div'); Bawl.bFHTML.id='bawlForm-' + replyLinkParams.id; Bawl.bFHTML.classList=[ 'BawlNoDisplay BawlForm' ]; if(replyLinkParams.type == 'comment'){ Bawl.d(115); if(replyLinkParams.subtype == 'locator'){ Bawl.rCE=Bawl.pEA[replyLinkParams.int].parentElement; } else if(replyLinkParams.subtype == 'legacy'){ Bawl.rCE=Bawl.pEA[replyLinkParams.int]; } if(Bawl.rCE && Bawl.rCE.nextElementSibling && ( Bawl.rCE.nextElementSibling.tagName == 'DL' || Bawl.rCE.nextElementSibling.tagName == 'UL' )){ Bawl.d(116); Bawl.rCE.nextElementSibling.append(Bawl.bFHTML); } else { Bawl.d(117); Bawl.d(118); Bawl.rCE.append(Bawl.bFHTML); } } else if(replyLinkParams.type == 'edit' && document.getElementById('bawlLink-' + replyLinkParams.id)){ document.getElementById('bawlLink-' + replyLinkParams.id).append(Bawl.bFHTML); } else if(replyLinkParams.type == 'edit' && document.getElementById('bawlEditLink-' + replyLinkParams.id)){ document.getElementById('bawlEditLink-' + replyLinkParams.id).append(Bawl.bFHTML); } else if(replyLinkParams.type == 'newheading' || replyLinkParams.type == 'heading'){ for (intHeaderNum=1; intHeaderNum < 7; intHeaderNum++){ $('h' + intHeaderNum).addClass('BawlHeader'); } Bawl.fNH=false; Bawl.nNL=Bawl.pEA[replyLinkParams.int].parentElement.nodeName.slice(-1,); delete Bawl.rCE; for (intHeaderElement=0; intHeaderElement < $('.BawlHeader').length; intHeaderElement++){ if($('.BawlHeader')[intHeaderElement] == Bawl.pEA[replyLinkParams.int].parentElement){ Bawl.fNH=true; } else if(Bawl.fNH && $('.BawlHeader')[intHeaderElement].nodeName.slice(-1,) <= Bawl.nNL){ Bawl.rCE=$('.BawlHeader')[intHeaderElement].previousElementSibling; break; } } if(Bawl.rCE){ Bawl.rCE.append(Bawl.bFHTML); } else { $('.mw-body').append(Bawl.bFHTML); } } else if(replyLinkParams.type == 'BCL'){ $('.bawlprocess')[replyLinkParams.int].append(Bawl.bFHTML); } else if(replyLinkParams.type == 'editFullPage'){ if(Bawl.s2.clearEditFullPage){ $('#mw-content-text').addClass('BawlNoDisplay'); $('#content').append(Bawl.bFHTML);content } else { $('#mw-content-text').prepend(Bawl.bFHTML); } } else if(replyLinkParams.type == 'newsection'){ $('#mw-content-text').append(Bawl.bFHTML); } if(Bawl.UITI && Bawl.UITI.getValue != ){ Bawl.d(119); Bawl.pT2=Bawl.UITI.getValue; } else if(replyLinkParams.origReplyTo != 'NO-VALUE-PLEASE-IGNORE' && Bawl.s2.autoPing == true && replyLinkParams.type == "comment" && replyLinkParams.origReplyTo != Bawl.uN && !( replyLinkParams.origReplyTo == mw.config.get('wgTitle') && mw.config.get('wgNamespaceNumber') == 3 ) ) { Bawl.d(120); Bawl.pT2=Bawl.cPT2(replyLinkParams); } else { Bawl.d(121); Bawl.pT2=; } if(Bawl.UITIT ) { Bawl.preloadTitle=Bawl.UITIT.getValue } else { Bawl.preloadTitle= }; if(Bawl.s2.limitWidth == false){ Bawl.BUITITC='BawlNoMaxWidth'; } else { Bawl.BUITITC=; } Bawl.UITIT=new OO.ui.TextInputWidget( { id: 'BawlUITextInputTitle', classes: [ 'BawlMarginHalfEm',Bawl.BUITITC ], value: Bawl.preloadTitle, placeholder: Bawl.b.titlePlaceholder, } ); if(replyLinkParams.type == 'editFullPage'){ Bawl.UITIR=25; } else { Bawl.UITIR=6; } Bawl.UITI=new OO.ui.MultilineTextInputWidget( { id: 'BawlUITextInput', rows: Bawl.UITIR, classes: [ 'BawlMarginHalfEm', 'BawlUnsetLimitWidth' ], value: Bawl.pT2, } ); Bawl.UIV=document.createElement('div'); if(Bawl.s2.debug == false){ Bawl.UIV.className='BawlNoDisplay'; } if(Bawl.aE == 'visualLight' || ( Bawl.s2.editorSwitch == true && replyLinkParams.type != 'editFullPage' )){ Bawl.iVL; } if(Bawl.s2.editor == 'visualLight' && Bawl.s2.debug == false){ Bawl.UITI.toggle(false); } else if(Bawl.s2.editor == 'visualLight' && Bawl.s2.debug == true){ Bawl.UIV.style='background:#FBFFFF'; } if(Bawl.s2.livePreview == true){ Bawl.UITI.on('change', function{ const BawlCurrentInputValue=Bawl.UITI.getValue; var DelayedPreview=setInterval(function  { Bawl.nIV=Bawl.UITI.getValue; clearInterval(DelayedPreview); if(BawlCurrentInputValue == Bawl.nIV){ Bawl.dP('preview'); Bawl.d(122); } else { Bawl.d(123); } delete BawlCurrentInputValue; }, 500); }); } if(Bawl.s2.saveDraft == true && replyLinkParams.type != 'edit'){ Bawl.sDE; } Bawl.bOTWSC=; if(Bawl.s2.wrongUI == true){ Bawl.bOTWSC='BawlFloatRight'; } if(! Bawl.uN){ $(document.getElementById('bawlForm-' + replyLinkParams.id)).append(' ' + Bawl.b.anoneditwarning + ' ') } Bawl.UIRB=new OO.ui.ButtonWidget( { id: 'BawlUIReplyButton', label: Bawl.b.BawlUIReplyButton, flags: [ 'primary', 'progressive' ], classes: [ Bawl.bOTWSC ] } ); Bawl.UIRB.on('click', function { Bawl.pR1(replyLinkParams) }); Bawl.UIDRB=new OO.ui.ButtonWidget( { id: 'BawlUIDryRunButton', label: 'Dry run', flags: [ 'primary', 'progressive' ], classes: [ Bawl.bOTWSC ] } ); Bawl.UIDRB.on('click', function { Bawl.dRO=true;Bawl.pR1(replyLinkParams) }); Bawl.UIPB=new OO.ui.ButtonWidget( { id: 'BawlUIPreviewButton', label: Bawl.b.BawlUIPreviewButton, flags: [ 'primary' ], classes: [ Bawl.bOTWSC ] } ); Bawl.UIPB.on('click', function { Bawl.dP('preview') }); Bawl.UIDB=new OO.ui.ButtonWidget( { id: 'BawlUIDiffButton', label: Bawl.b.BawlUIDiffButton, flags: [ 'primary' ], classes: [ Bawl.bOTWSC ] } ); Bawl.UIDB.on('click', function { Bawl.dD(replyLinkParams) }); Bawl.UICB=new OO.ui.ButtonWidget( { id: 'BawlUICancelButton', label: Bawl.b.BawlUICancelButton, classes: [ Bawl.bOTWSC ] } ); Bawl.UIS=new OO.ui.LabelWidget( { } ); Bawl.UISBI=new OO.ui.HtmlSnippet(Bawl.sBIS); Bawl.UISB=new OO.ui.ButtonWidget( { id: 'BawlUISettingsButton', label: Bawl.UISBI, classes: ['BawlFloatRight'], framed: false, } ); if(Bawl.aE == 'visualLight'){ Bawl.sEC='BawlHalfOpacity'; } else { Bawl.sEC=; } Bawl.UISEB=new OO.ui.ButtonWidget( { id: 'BawlUISwitchEditorButton', label: '</>', framed: false, classes: ['BawlLeftRightMargin','BawlEditorSwitch','BawlFloatRight',Bawl.sEC] } ); Bawl.UISEB.on('click', function { Bawl.tE } ); if(Bawl.s2.editorSwitch == false){ Bawl.UISEB.toggle(false); } Bawl.UICB.on('click', function { Bawl.cR('user') } ); Bawl.UIIHTML=new OO.ui.HtmlSnippet(' '); Bawl.UII=new OO.ui.LabelWidget( { label: Bawl.UIIHTML, } ); Bawl.UIMBB=new OO.ui.ButtonWidget( { id: 'BawlUIMarkupBoldButton', label: Bawl.b.bold, framed: false, classes: ['BawlLeftRightMargin', 'BawlMarkupBold'] } ); Bawl.UIMIB=new OO.ui.ButtonWidget( { id: 'BawlUIMarkupItalicButton', label: Bawl.b.italic, framed: false, classes: ['BawlLeftRightMargin', 'BawlMarkupItalic'] } ); Bawl.UIMSBL=new OO.ui.HtmlSnippet(' ' + Bawl.b.strike + ' '); Bawl.UIMSB=new OO.ui.ButtonWidget( { id: 'BawlUIMarkupStrikeButton', label: Bawl.UIMSBL, framed: false, classes: ['BawlLeftRightMargin', 'BawlMarkupStrike'] } ); Bawl.UIMLBI=new OO.ui.HtmlSnippet(Bawl.sBILB); Bawl.UIMLB=new OO.ui.ButtonWidget( { id: 'BawlUIMarkupLinkButton', label: Bawl.UIMLBI, framed: false, classes: ['BawlLeftRightMargin'] } ); Bawl.UIMBB.on('click', function { Bawl.iM('bold') } ); Bawl.UIMIB.on('click', function { Bawl.iM('italic') } ); Bawl.UIMSB.on('click', function { Bawl.iM('struck') } ); Bawl.UIMLB.on('click', function { Bawl.iL } ); if(Bawl.s2.markup == true){ Bawl.MBB=new OO.ui.HorizontalLayout( { items: [ Bawl.UIMBB, Bawl.UIMIB, Bawl.UIMSB, Bawl.UIMLB ], id: 'BawlMarkupButtonBar', classes: ['BawlLeftRightMargin'] } ); } else { Bawl.MBB=new OO.ui.HorizontalLayout( {} ); } if(Bawl.s2.wrongUI == false){ Bawl.BBI=[ Bawl.UIRB, Bawl.UIPB, Bawl.UICB, Bawl.UIDB, Bawl.UIS, Bawl.UIDRB, Bawl.UII, Bawl.MBB, Bawl.UISB, Bawl.UISEB, ]; } else { Bawl.BBI=[ Bawl.UII, Bawl.UIRB, Bawl.UIPB, Bawl.UICB, Bawl.UIDB, Bawl.UIDRB, Bawl.UISB, Bawl.UISEB, Bawl.MBB, ]; } if(Bawl.s2.debug != true){ Bawl.UIDRB.toggle(false); } if(replyLinkParams.type != 'editFullPage'){ Bawl.UIDB.toggle(false); } Bawl.BB=new OO.ui.HorizontalLayout( { items: Bawl.BBI, id: 'BawlMainButtonBar', } ); Bawl.eNACIAPD='  '; Bawl.UITIS=new OO.ui.TextInputWidget( { id: 'BawlUITextInputSummary', classes: [ 'BawlMarginHalfEm',Bawl.BUITITC ], value: , placeholder: Bawl.b.summaryPlaceholder, } ); Bawl.UIVE=new OO.ui.FormLayout( { id:'BawlUIVisualContainer', } ); Bawl.rFE=[Bawl.UITIT,Bawl.UITI,Bawl.UIVE]; if(Bawl.s2.customSummary == true || replyLinkParams.type == 'editFullPage' || ( replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit' )){ Bawl.rFE.push(Bawl.UITIS); } Bawl.rFE.push(Bawl.BB); Bawl.RF=new OO.ui.FormLayout( { items: Bawl.rFE, id: 'BawlReplyForm', classes: ['BawlReplyForm'], } ); $(document.getElementById('bawlForm-' + replyLinkParams.id)).removeClass('BawlNoDisplay'); $(document.getElementById('bawlForm-' + replyLinkParams.id)).append(Bawl.eNACIAPD).append(Bawl.RF.$element); $('#BawlUIVisualContainer').prepend(Bawl.UIV); if(replyLinkParams.pageTitle == mw.config.get('wgPageName') && mw.config.get('wgIsProbablyEditable') == false){ $(document.getElementById('bawlForm-' + replyLinkParams.id)).prepend(' ' + Bawl.b.protectedpagetext + ' '); Bawl.dF(true); } if(window.localStorage.BawlDrafts){ Bawl.lD=JSON.parse(window.localStorage.BawlDrafts); } if(! Bawl.r && replyLinkParams.type != 'edit' && Bawl.s2.saveDraft == true && Bawl.lD && Bawl.lD[encodeURIComponent(replyLinkParams.id)] && Bawl.lD[encodeURIComponent(replyLinkParams.id)].time > (new Date.getTime - 604800000)){ Bawl.d(124); Bawl.UITI.setValue(Bawl.lD[encodeURIComponent(replyLinkParams.id)].text); mw.notify(Bawl.m.restoredDraft); } else if(! Bawl.r && replyLinkParams.type == 'edit' || replyLinkParams.type == 'editFullPage' || ( replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit' )){ Bawl.d(125); Bawl.UITI.setDisabled(true); Bawl.UIRB.setLabel(Bawl.b.BawlUIEditButton); Bawl.d(126); api.get( { action: 'query', export: 'true', format: 'json', titles: replyLinkParams.pageTitle, } ).done( function ( data){ Bawl.d(127); Bawl.wTFE=Bawl.gWFE(data.query.export["*"]); if(replyLinkParams.type == 'editFullPage'){ Bawl.UITI.setValue(Bawl.wTFE); Bawl.UITI.setDisabled(false); return; } if(replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit'){ Bawl.d(128); Bawl.UITI.setValue(Bawl.gIPS(Bawl.wTFE,Bawl.rLPO).sectiontext); Bawl.UITI.setDisabled(false); return; } Bawl.eOCLRE=new RegExp(' *<span id="[^"]*" class="FTTCmt".*'); Bawl.rNRE=new RegExp(Bawl.eRE(Bawl.nLT), 'g'); Bawl.wTFEC=Bawl.gIPC(Bawl.wTFE, replyLinkParams).relevantComment.replace(/^[\*\:\# ]*/, ); Bawl.wTFESFP=Bawl.wTFEC.match(Bawl.eOCLRE); if(Bawl.wTFESFP){ Bawl.wTFESFP=Bawl.wTFEC.match(Bawl.eOCLRE)[0]; } else { Bawl.wTFESFP=; } Bawl.wTFECS=Bawl.wTFEC.replace(Bawl.eOCLRE, ); Bawl.wTFECM=Bawl.wTFECS.replace( Bawl.rNRE, '\n' ); Bawl.wTFECMRL=Bawl.lTR(Bawl.wTFECM); Bawl.UITI.setValue(Bawl.wTFECMRL); Bawl.UITI.setDisabled(false); Bawl.d(129); Bawl.fI; }); } else if(! Bawl.r && (replyLinkParams.preload || replyLinkParams.preloadtitle) && Bawl.UITI.getValue ==  && Bawl.UITIT.getValue ==  ) { for (intInputBoxPreload=0; intInputBoxPreload < $('.bawlprocess')[replyLinkParams.int].children.length; intInputBoxPreload++){ Bawl.d(130); if($('.bawlprocess')[replyLinkParams.int].children[intInputBoxPreload].name == 'preloadtitle'){ replyLinkParams.preloadtitle=$('.bawlprocess')[replyLinkParams.int].children[intInputBoxPreload].value; } } if(replyLinkParams.preloadtitle){ Bawl.d(131); Bawl.UITIT.setValue(replyLinkParams.preloadtitle); } if(replyLinkParams.preload){ Bawl.UITI.setDisabled(true); Bawl.d(132); api.get( { action: 'query', export: 'true', format: 'json', titles: replyLinkParams.preload, } ).done( function ( data){ Bawl.d(133); Bawl.wTFE=Bawl.gWFE(data.query.export["*"]); if(typeof replyLinkParams.preloadparams == 'string'){ replyLinkParams.preloadparams=JSON.parse(decodeURIComponent(replyLinkParams.preloadparams).replace(/\&quot\;/g, '"')); } for (intInputBoxPreloadParams=0; intInputBoxPreloadParams < replyLinkParams.preloadparams.length; intInputBoxPreloadParams++){ Bawl.d(134); Bawl.rPV=new RegExp('\\$' + ( intInputBoxPreloadParams + 1) + '([^0-9]|$)', 'g') Bawl.wTFE=Bawl.wTFE.replace(Bawl.rPV, replyLinkParams.preloadparams[intInputBoxPreloadParams] + '$1'); } Bawl.UITI.setValue(Bawl.wTFE); Bawl.UITI.setDisabled(false); if(Bawl.UITIT.isVisible == false){ Bawl.d(135); Bawl.fI; } }); } } delete Bawl.r; if(replyLinkParams.type == 'newsection'){ BawlUITextInputTitle.scrollIntoView; } $('#BawlReplyForm').append(Bawl.tNC); if(Bawl.s2.tosNag == true && ! document.getElementById('BawlToSNag')){ Bawl.iTS; }; Bawl.pASD='    <a href="https://en.wikipedia.org/wiki/User:Alexis_Jazz/Bawl" style="font-weight: bold">Bawl!</a> (early access)  '; $(document.getElementById('bawlForm-' + replyLinkParams.id)).append(Bawl.pASD); Bawl.cIB={}; for (int=0; int < 30; int++){ Bawl.d(136); if(Bawl.s2.cI && Bawl.s2.cI[int] && Bawl.s2.cI[int] != "" ) { Bawl.d(137); Bawl.CIF=[]; if(Bawl.s2.cI[int].match(/\:\<\<([^\>]*)\>\>/)){ Bawl.cIL=Bawl.s2.cI[int].replace(/.*\:\<\<([^\>]*)\>\>/, '$1'); if(Bawl.cIL.match(/^AUTOPOST/)){ Bawl.d(138); Bawl.cIL=Bawl.cIL.replace(/^AUTOPOST/,); Bawl.CIF=['progressive']; } } else if(Bawl.s2.cI[int].length > 14){ Bawl.cIL=Bawl.s2.cI[int].slice(0,10) + '..'; } else { Bawl.cIL=Bawl.s2.cI[int]; } Bawl.iIRERE=new RegExp('^\/(.*)([^\])\/(.*)([^\])\/([gmi]*)$'); Bawl.cIB[int]=new OO.ui.ButtonWidget( { label: Bawl.cIL, classes: [ 'BawlMarginHalfEm' ], flags: Bawl.CIF }); Bawl.iCI=function(num){ Bawl.aCI=Bawl.s2.cI[num].replace(/\:\<\<[^\>]*\>\>$/, ); if(Bawl.aCI.match(Bawl.iIRERE) && Bawl.aCI.match(Bawl.iIRERE).length == 6){ Bawl.cIRENP=Bawl.aCI.match(Bawl.iIRERE); Bawl.cIREN=new RegExp(Bawl.cIRENP[1] + Bawl.cIRENP[2], Bawl.cIRENP[5]); Bawl.UITI.setValue(Bawl.UITI.getValue.replace(Bawl.cIREN, Bawl.cIRENP[3] + Bawl.cIRENP[4])); } else { Bawl.UITI.encapsulateContent(Bawl.aCI,); } if(Bawl.s2.cI[num].match(/\:\<\<AUTOPOST[^\>]*\>\>$/)){ Bawl.d(139); Bawl.pR1(Bawl.rLPO); } }; Bawl.iB=function(insNum){ Bawl.cIB[insNum].on('click', function { Bawl.iCI(insNum); }); }; if(int == 0 ) { Bawl.iB(0)//this isn't very pretty but I'm not sure how else to solve it. } else if(int == 1 ) { Bawl.iB(1) } else if(int == 2 ) { Bawl.iB(2) } else if(int == 3 ) { Bawl.iB(3) } else if(int == 4 ) { Bawl.iB(4) } else if(int == 5 ) { Bawl.iB(5) } else if(int == 6 ) { Bawl.iB(6) } else if(int == 7 ) { Bawl.iB(7) } else if(int == 8 ) { Bawl.iB(8) } else if(int == 9 ) { Bawl.iB(9) } else if(int == 10 ) { Bawl.iB(10) } else if(int == 11 ) { Bawl.iB(11) } else if(int == 12 ) { Bawl.iB(12) } else if(int == 13 ) { Bawl.iB(13) } else if(int == 14 ) { Bawl.iB(14) } else if(int == 15 ) { Bawl.iB(15) } else if(int == 16 ) { Bawl.iB(16) } else if(int == 17 ) { Bawl.iB(17) } else if(int == 18 ) { Bawl.iB(18) } else if(int == 19 ) { Bawl.iB(19) } else if(int == 20 ) { Bawl.iB(20) } else if(int == 21 ) { Bawl.iB(21) } else if(int == 22 ) { Bawl.iB(22) } else if(int == 23 ) { Bawl.iB(23) } else if(int == 24 ) { Bawl.iB(24) } else if(int == 25 ) { Bawl.iB(25) } else if(int == 26 ) { Bawl.iB(26) } else if(int == 27 ) { Bawl.iB(27) } else if(int == 28 ) { Bawl.iB(28) } else if(int == 29 ) { Bawl.iB(29) } if(Bawl.CIF[0] == 'progressive'){ $('#BawlCustomInsertsAutoPost').removeClass('BawlNoDisplay'); $('#BawlCustomInsertsAutoPost').append(Bawl.cIB[int].$element); } else { $('#BawlCustomInserts').removeClass('BawlNoDisplay'); $('#BawlCustomInserts').append(Bawl.cIB[int].$element); } } } if(Bawl.s2.limitWidth == true){ $('.BawlForm').addClass('BawlLimitWidth'); Bawl.UIV.classList.add('BawlLimitWidth'); $('BawlUITextInput').removeClass('BawlUnsetLimitWidth'); $('BawlUITextInput').addClass('BawlLimitWidth') } if(replyLinkParams.type == 'comment' || replyLinkParams.type == 'edit' || replyLinkParams.type == 'BCL' || replyLinkParams.type == 'editFullPage' || ( replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit' )){ Bawl.d(140); Bawl.UITIT.setValue(); Bawl.UITIT.setReadOnly(true); Bawl.UITIT.toggle(false); } if(( Bawl.s2.editNotice == true || replyLinkParams.editIntro ) && mw.config.get('wgPageContentModel') == 'wikitext' ) { Bawl.lEN; } if(Bawl.s2.checkNewComments == true){ Bawl.cFNC(replyLinkParams, 'openform'); } Bawl.d(141); Bawl.UIRB.scrollElementIntoView; if(replyLinkParams.type == 'newsection' || replyLinkParams.type == 'newheading'){ Bawl.d(142); Bawl.UITIT.focus; Bawl.UITIT.scrollElementIntoView; } else { Bawl.d(143); Bawl.fI; } Bawl.UISB.on('click', Bawl.oS); if(trigger == 'reload'){ Bawl.d(144); BawlUITextInput.scrollIntoView; } Bawl.sTV; }); } }; Bawl.oS=function(openclose){ mw.loader.using( [ 'oojs-ui-core','oojs-ui-widgets' ] ).then( function { Bawl.UISB.blur; if(document.getElementById('saveSettingsButton') && ! $(document.getElementsByClassName('BawlSettings')).hasClass('BawlNoDisplay') && openclose != 'open'){ Bawl.d(145); Bawl.cS; return; } else if(document.getElementById('saveSettingsButton') && $(document.getElementsByClassName('BawlSettings')).hasClass('BawlNoDisplay')){ Bawl.d(146); $('#BawlPreviewBox').addClass('BawlNoDisplay'); $(document.getElementsByClassName('BawlSettings')).removeClass('BawlNoDisplay'); return; } $('#BawlPreviewBox').addClass('BawlNoDisplay'); $(document.getElementsByClassName('BawlSettings')).removeClass('BawlNoDisplay'); Bawl.sE={}; Bawl.sE.addLinkSetting=new OO.ui.DropdownInputWidget( { options: [{data:'addLinksAuto',label:Bawl.m.addLinksAuto},{data:'addLoadButtonTop',label:Bawl.m.addLoadButtonTop},{data:'addLoadButtonSect',label:Bawl.m.addLoadButtonSect}], value: Bawl.s2.addLinkSetting, classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.addLinkSettingFieldLayout=new OO.ui.FieldLayout( Bawl.sE.addLinkSetting, { label: Bawl.m.addLinkSetting, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.outdent=new OO.ui.DropdownInputWidget( { options: [{data:5},{data:6},{data:7},{data:8},{data:9},{data:10},{data:15},{data:20},{data:30}], value: Bawl.s2.outdent, classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.outdentFieldLayout=new OO.ui.FieldLayout( Bawl.sE.outdent, { label: Bawl.m.outdent, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.editor=new OO.ui.DropdownInputWidget( { options: [ { data: 'source', label: Bawl.m.editorSource }, { data: 'visualLight', label: Bawl.m.editorVisualLight }, ], value: Bawl.s2.editor, classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.editorFieldLayout=new OO.ui.FieldLayout( Bawl.sE.editor, { label: Bawl.m.editor, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.watchlist=new OO.ui.DropdownInputWidget( { options: [ { data: 'nochange', label: Bawl.m.watchlistexpirynochange }, { data: 'preferences', label: Bawl.m.watchlistexpirypreferences }, { data: 'unwatch', label: Bawl.m.watchlistexpiryunwatch }, { data: 'watch', label: Bawl.m.watchlistexpirywatch }, ], value: Bawl.s2.watchlist, id: 'UIwatchlist', classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.watchlistFieldLayout=new OO.ui.FieldLayout( Bawl.sE.watchlist, { label: Bawl.m.watchlist, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.watchlistexpiry=new OO.ui.DropdownInputWidget( { options: [ { data: '14 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '14') }, { data: '30 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '30') }, { data: '90 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '90') }, { data: '180 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '180') }, { data: '365 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '365') }, { data: '730 days', label: Bawl.m.watchlistexpirydays.replace('DAYS', '730') }, { data: 'indefinite', label: Bawl.m.watchlistexpirydays.replace('DAYS', '∞') }, ], value: Bawl.s2.watchlistexpiry, id: 'UIwatchlistexpiry', classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.watchlistexpiryFieldLayout=new OO.ui.FieldLayout( Bawl.sE.watchlistexpiry, { label: Bawl.m.watchlistexpiry, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.UIfontSize=new OO.ui.DropdownInputWidget( { options: [ { data: '0.875em', label: Bawl.m.UIfontSize0875em }, { data: 'x-small', label: Bawl.m.UIfontSizeTiny }, { data: 'small', label: Bawl.m.UIfontSizeSmall }, { data: 'medium', label: Bawl.m.UIfontSizeMedium }, { data: 'large' , label: Bawl.m.UIfontSizeLarge }, { data: 'x-large', label: Bawl.m.UIfontSizeHuge }, ], value: Bawl.s2.UIfontSize, id: 'UIfontSize', classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.UIfontSizeFieldLayout=new OO.ui.FieldLayout( Bawl.sE.UIfontSize, { label: Bawl.m.UIfontSize, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.afterPost=new OO.ui.DropdownInputWidget( { options: [ { data: 'parsecomment', label: Bawl.m.parsecomment }, { data: 'reload', label: Bawl.m.reloadafter } , { data: 'link', label: Bawl.m.linkafter }, ], value: Bawl.s2.afterPost, id: 'BawlAfterPost', classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.afterPostFieldLayout=new OO.ui.FieldLayout( Bawl.sE.afterPost, { label: Bawl.m.afterPost, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.saveOptionsList=[ { data: 'browser', label: Bawl.m.saveToBrowser }, { data: 'commonjs', label: Bawl.m.saveToCommonJS } ]; if(mw.config.get('wgNoticeProject') == 'wikipedia' || mw.config.get('wgServerName').match(/[a-z\-]{0,20}\.wikipedia\.[a-z]*$/) || mw.config.get('wgDBname').match(/([a-z\-]{0,20})?(wiktionary|wikiquote|wikinews|wikisource|wikibooks|wikiversity|wikivoyage|commonswiki|wikidatawiki|specieswiki|metawiki|mediawikiwiki|incubatorwiki)/)){ Bawl.d(147); Bawl.sE.saveOptionsList.push({ data: 'globaljs', label: Bawl.m.saveToGlobalJS }); } Bawl.sE.saveTo=new OO.ui.DropdownInputWidget( { options: Bawl.sE.saveOptionsList, value: Bawl.s2.saveTo, id: 'BawlSaveTo', classes: [ 'BawlDropDownMenu' ], } ); Bawl.sE.saveToFieldLayout=new OO.ui.FieldLayout( Bawl.sE.saveTo, { label: Bawl.m.saveTo, align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.tPBL=function{ if(Bawl.sE.saveTo.getValue == 'browser'){ Bawl.sE.resetPreferencesButton.setLabel(Bawl.b.resetPreferences + Bawl.m.prefLabelBrowser); Bawl.sE.saveSettingsButton.setLabel(Bawl.b.saveSettings + Bawl.m.prefLabelBrowser); } else if(Bawl.sE.saveTo.getValue == 'commonjs'){ Bawl.sE.resetPreferencesButton.setLabel(Bawl.b.resetPreferences + Bawl.m.prefLabelCommonJS); Bawl.sE.saveSettingsButton.setLabel(Bawl.b.saveSettings + Bawl.m.prefLabelCommonJS); } else if(Bawl.sE.saveTo.getValue == 'globaljs'){ Bawl.sE.resetPreferencesButton.setLabel(Bawl.b.resetPreferences + Bawl.m.prefLabelGlobalJS); Bawl.sE.saveSettingsButton.setLabel(Bawl.b.saveSettings + Bawl.m.prefLabelGlobalJS); } }; Bawl.sE.saveTo.on('change', Bawl.tPBL ); Bawl.sE.pingText=new OO.ui.TextInputWidget( { value: Bawl.s2.pingText, id: 'BawlPingTextInput', placeholder: Bawl.m.pingText, classes: [ 'BawlMarginHalfEmTop', 'BawlMarginHalfEm', 'BawlCustomInsertTextInput' ], } ); Bawl.sE.pingTextFieldLayout=new OO.ui.FieldLayout( Bawl.sE.pingText, { align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); Bawl.sE.UIversionDate=new OO.ui.LabelWidget( { label: Bawl.vD + ' (' + Bawl.lTT + Bawl.maybeSkullNBones + 'ms)', classes: [ 'BawlFloatRight', 'BawlSmallerText' ] } ); Bawl.sE.saveSettingsButton=new OO.ui.ButtonWidget( { id: 'saveSettingsButton', flags: [ 'primary', 'progressive' ], } ); Bawl.sE.resetPreferencesButton=new OO.ui.ButtonWidget( { id: 'resetPreferencesButton', flags: [ 'primary', 'destructive' ], } ); Bawl.tPBL; Bawl.sE.cancelSettingsButton=new OO.ui.ButtonWidget( { id: 'cancelSettingsButton', label: Bawl.b.BawlUICancelButton, } ); Bawl.sE.saveSettingsButton.on('click', Bawl.sS ); Bawl.sE.resetPreferencesButton.on('click', Bawl.rP ); Bawl.sE.cancelSettingsButton.on('click', Bawl.cS ); Bawl.sE.SettingsButtonBar=new OO.ui.HorizontalLayout( { items: [ Bawl.sE.saveSettingsButton, Bawl.sE.resetPreferencesButton, Bawl.sE.cancelSettingsButton, Bawl.sE.UIversionDate ], classes: [ 'BawlMarginHalfEmTop' ], } ); Bawl.sT5=new OO.ui.IndexLayout({ classes: ['BawlSettingTabs'], framed: false, expanded: false, autoFocus:false }); Bawl.pC=Object.keys(Bawl.dS).length; for (prefint=0; prefint < Bawl.pC; prefint++){ Bawl.pK=Object.keys(Bawl.dS)[prefint]; Bawl.d(148); if(typeof Bawl.s2[ Bawl.pK ] == 'string' && Bawl.s2[ Bawl.pK ] == 'TAB'){ Bawl.d(149); Bawl.pT3=Bawl.pK; Bawl[Bawl.pT3 + 'Tab'] = new OO.ui.TabPanelLayout( Bawl.pT3, { label: Bawl.m[ Bawl.pK ], expanded:false,classes:['BawlSettingTabs'] } ); Bawl.sT5.addTabPanels( [ Bawl[Bawl.pT3 + 'Tab'] ] ); } else if(typeof Bawl.s2[ Bawl.pK ] != 'object' ) { Bawl.d(150); if(! Bawl.sE[ Bawl.pK ]){ if(typeof Bawl.m[ Bawl.pK ] == 'string' && Bawl.m[ Bawl.pK ].match(/\<a/)){ Bawl.m[ Bawl.pK ] = new OO.ui.HtmlSnippet(Bawl.m[ Bawl.pK ]); } Bawl.sE[ Bawl.pK ] = new OO.ui.CheckboxInputWidget( { id: 'BawlPref' + Bawl.pK, selected: Bawl.s2[ Bawl.pK ], classes: [ 'BawlMarginHalfEm' ], } ); Bawl.sE[ Bawl.pK + 'FieldLayout' ] = new OO.ui.FieldLayout( Bawl.sE[ Bawl.pK ], { id: 'BawlPref' + Bawl.pK + 'FieldLayout', label: Bawl.m[ Bawl.pK ], align: 'inline', classes: [ 'BawlOOuiFieldLayout' ] } ); } } if(Bawl.sE[ Bawl.pK + 'FieldLayout' ]){ Bawl[Bawl.pT3 + 'Tab'].$element.append(Bawl.sE[ Bawl.pK + 'FieldLayout' ].$element); } } Bawl.d(151); Bawl.sE.tosNag.on('change', Bawl.tTN ); $('#BawlSettings').append(Bawl.sT5.$element); $('#BawlSettings').append(Bawl.sE.SettingsButtonBar.$element); Bawl.cITI={}; Bawl.cITRTI={}; Bawl.hFCIIF=false; Bawl.hFCITRIF=false; for (int=0; int < 50; int++){ Bawl.d(152); Bawl.pIPO=int + 1; Bawl.cITI[int]=new OO.ui.TextInputWidget( { value: Bawl.s2.cI[int], id: 'BawlCustomInsert' + int, placeholder: Bawl.m.BawlCustomInsertPlaceholder.replace(/NUM/g, Bawl.pIPO), classes: [ 'BawlMarginHalfEm', 'BawlCustomInsertTextInput' ], } ); Bawl.cITRTI[int]=new OO.ui.TextInputWidget( { value: Bawl.s2.cIThatRun[int], id: 'BawlCustomInsertThatRun' + int, placeholder: Bawl.m.BawlCustomInsertThatRunPlaceholder.replace('NUM', Bawl.pIPO), classes: [ 'BawlMarginHalfEm', 'BawlCustomInsertTextInput' ], } ); if(! Bawl.hFCIIF && ( int.toFixed.slice(-1,) == 4 || int.toFixed.slice(-1,) == 9 ) && ! Bawl.s2.cI[int]){ Bawl.d(153); Bawl.hFCIIF=true; } else if(Bawl.hFCIIF == true){ Bawl.d(154); Bawl.cITI[int].toggle(false); } if(! Bawl.hFCITRIF && ( int.toFixed.slice(-1,) == 4 || int.toFixed.slice(-1,) == 9 ) && ! Bawl.s2.cIThatRun[int]){ Bawl.d(155); Bawl.hFCITRIF=true; } else if(Bawl.hFCITRIF == true){ Bawl.d(156); Bawl.cITRTI[int].toggle(false); } Bawl.uCI=function(num,element){ for (unhideInt=0; unhideInt < 6; unhideInt++){ Bawl.uI=num + unhideInt; Bawl.d(157); if(element == 'ci'){ Bawl.cITI[Bawl.uI].toggle(true); } else { Bawl.cITRTI[Bawl.uI].toggle(true); } } }; if(int == 4 )					{ Bawl.cITI[4].on('change', function { if(Bawl.cITI[4].getValue !=  ) { Bawl.uCI(4, 'ci') } } ); } else if(int == 9 )	{ Bawl.cITI[9].on('change', function { if(Bawl.cITI[9].getValue !=  ) { Bawl.uCI(9, 'ci') } } ); } else if(int == 14 )	{ Bawl.cITI[14].on('change', function { if(Bawl.cITI[14].getValue !=  ) { Bawl.uCI(14, 'ci') } } ); } else if(int == 19 )	{ Bawl.cITI[19].on('change', function { if(Bawl.cITI[19].getValue !=  ) { Bawl.uCI(19, 'ci') } } ); } else if(int == 24 )	{ Bawl.cITI[24].on('change', function { if(Bawl.cITI[24].getValue !=  ) { Bawl.uCI(24, 'ci') } } ); } if(int == 4 )					{ Bawl.cITRTI[4].on('change', function { if(Bawl.cITRTI[4].getValue !=  ) { Bawl.uCI(4, 'runci') } } ); } else if(int == 9 )	{ Bawl.cITRTI[9].on('change', function { if(Bawl.cITRTI[9].getValue !=  ) { Bawl.uCI(9, 'runci') } } ); } else if(int == 14 )	{ Bawl.cITRTI[14].on('change', function { if(Bawl.cITRTI[14].getValue !=  ) { Bawl.uCI(14, 'runci') } } ); } else if(int == 19 )	{ Bawl.cITRTI[19].on('change', function { if(Bawl.cITRTI[19].getValue !=  ) { Bawl.uCI(19, 'runci') } } ); } else if(int == 24 )	{ Bawl.cITRTI[24].on('change', function { if(Bawl.cITRTI[24].getValue !=  ) { Bawl.uCI(24, 'runci') } } ); } else if(int == 29 )	{ Bawl.cITRTI[29].on('change', function { if(Bawl.cITRTI[29].getValue !=  ) { Bawl.uCI(29, 'runci') } } ); } else if(int == 34 )	{ Bawl.cITRTI[34].on('change', function { if(Bawl.cITRTI[34].getValue !=  ) { Bawl.uCI(34, 'runci') } } ); } else if(int == 39 )	{ Bawl.cITRTI[39].on('change', function { if(Bawl.cITRTI[39].getValue !=  ) { Bawl.uCI(39, 'runci') } } ); } else if(int == 44 )	{ Bawl.cITRTI[44].on('change', function { if(Bawl.cITRTI[44].getValue !=  ) { Bawl.uCI(44, 'runci') } } ); } if(int < 30){ $('#BawlPrefenableCIFieldLayout').append(Bawl.cITI[int].$element); } $('#BawlPrefenableCIThatRunFieldLayout').append(Bawl.cITRTI[int].$element); } }); }; Bawl.gSBN=function(wikitext, num){ Bawl.d(158); Bawl.sBNS='\n' + wikitext.replace(/(^|\n)\=/g, '$1=='); Bawl.sBNS=Bawl.sBNS.split('\n='); if(Bawl.sBNS[num]){ Bawl.sBNHL=Bawl.sBNS[num].match(/^[\=]*/)[0].length; Bawl.sBNFE=0; Bawl.sBNWT=Bawl.sBNS[num]; for (int=0; int < Bawl.sBNS.length; int++){ if(int >= num && Bawl.sBNS[int].match(/^[\=]*/)[0].length > Bawl.sBNHL && Bawl.sBNFE == 0){ Bawl.d(159); Bawl.sBNWT=Bawl.sBNWT + '\n' + Bawl.sBNS[int]; } else if(int > num && Bawl.sBNS[int].match(/^[\=]*/)[0].length <= Bawl.sBNHL){ Bawl.sBNFE=1; } } return Bawl.sBNWT.replace(/^\n*/, ).replace(/\n*$/, ); } else { return null; } }; Bawl.rWT=function(text){ Bawl.d(160); return text.replace(/([0-9]{1,2}:[0-5][0-9].*)[\n]{2,}([\\:\\*\\#])/g, '$1\n$2'); }; Bawl.eU2=function(text){ Bawl.eUPTRE=new RegExp('(' + Bawl.eRE(Bawl.pT).replace('PINGUSER', '([^\\]\\}]*)') + '|\\[\\[User:[^\\|\\]]*|\\[\\[' + mw.config.get('wgFormattedNamespaces')[2] + ':[^\\|\\]]*|\{\{[Pp]ing\\|[^}]*|\{\{[Rr]eply to\\|[^}]*)', 'g'); Bawl.eU=text.match(Bawl.eUPTRE); Bawl.eUC=[]; if(Bawl.eU){ for (int=0; int < Bawl.eU.length; int++){ Bawl.cUP=new RegExp('(\\[\\[:?[Uu]ser:|\\[\\[:?' + mw.config.get('wgFormattedNamespaces')[2] + ':|\{\{[Pp]ing\\||\{\{[Rr]eply to\\||\\|\\]\\])', 'g'); Bawl.eUC[int]=Bawl.eU[int].replace(Bawl.cUP, ); } } return Bawl.eUC; }; Bawl.pF=function(origtext,newtext){ Bawl.d(161); Bawl.uIEC=Bawl.eU2(origtext); Bawl.uIUC=Bawl.eU2(newtext); Bawl.uMIS=; for (int=0; int < Bawl.uIEC.length; int++){ Bawl.d(162); if(Bawl.uIEC[int] && Bawl.uIUC.indexOf(Bawl.uIEC[int]) == -1 && ! Bawl.uMIS.match(Bawl.uIEC[int] + '\\|')){ Bawl.uMIS=Bawl.uMIS + ', ' + Bawl.uIEC[int] + ; } } return Bawl.uMIS; }; Bawl.rTI=function(text){ Bawl.d(163); if(text && Bawl.rLPO.type != 'edit'){ Bawl.bT=; Bawl.bTC=text.replace(/\<nowiki\>[^]*\<\/nowiki\>/gm, ).replace(/\{\{([^\{\}]|[\{\}][^\{\}])*\}\}/gm, ).replace(/\{\{([^\{\}]|[\{\}][^\{\}])*\}\}/gm, ).replace(/\{\{([^\{\}]|[\{\}][^\{\}])*\}\}/gm, ).replace(/\{\{([^\{\}]|[\{\}][^\{\}])*\}\}/gm, ).replace(/\{\{([^\{\}]|[\{\}][^\{\}])*\}\}/gm, ); for (int=0; int < 10; int++) { Bawl.bTC=Bawl.bTC.replace(/\<(?![\/]?[bis]\>|[\/]?span( [^>]*)?)/g, ).replace(/\<span( [^\>]*)?\>([^\<]|\<[\/]?[bis]\>)*\<\/span\>/gmi, '$2').replace(/\<b( [^\>]*)?\>([^\<]*|\<[\/]?span[^\>]*\>|\<[\/]?[is]\>)*\<\/b\>/gmi, '$2').replace(/\<i( [^\>]*)?\>([^\<]*|\<[\/]?[bs]\>|\<[\/]?span[^\>]*\>)*\<\/i\>/gmi, '$2').replace(/\<s( [^\>]*)?\>([^\<]*|\<[\/]?[bi]\>|\<[\/]?span[^\>]*\>)*\<\/s\>/gmi, '$2'); } Bawl.d(164); Bawl.bO=0; Bawl.bTTSQ2=Bawl.bTC.match(/(^|[^\'])\'\'($|[^\'])/g); if(Bawl.bTTSQ2 ) { Bawl.bTTSQ2=Bawl.bTTSQ2.length}; Bawl.bTTSQ=Bawl.bTC.match(/(^|[^\'])\'\'\'($|[^\'])/g); if(Bawl.bTTSQ ) { Bawl.bTTSQ=Bawl.bTTSQ.length}; if(Bawl.bTTSQ2 / 2 != (Bawl.bTTSQ2 / 2).toFixed){ Bawl.bO=Bawl.bO + 1; Bawl.d(165); Bawl.bT=Bawl.bT + '\'\; } if(Bawl.bTTSQ / 2 != (Bawl.bTTSQ2 / 2).toFixed){ Bawl.bO=Bawl.bO + 1; Bawl.d(166); Bawl.bT=Bawl.bT + '\'\'\; } Bawl.bTOS2=Bawl.bTC.match(/\<span( [^\>]*)?\>/gi); Bawl.bTOB=Bawl.bTC.match(/\<b( [^\>]*)?\>/gi); Bawl.bTOI=Bawl.bTC.match(/\<i( [^\>]*)?\>/gi); Bawl.bTOS=Bawl.bTC.match(/\<s( [^\>]*)?\>/gi); if(Bawl.bTOS2 ) { Bawl.bTOS2=Bawl.bTOS2.length}; if(Bawl.bTOB ) { Bawl.bTOB=Bawl.bTOB.length}; if(Bawl.bTOI ) { Bawl.bTOI=Bawl.bTOI.length}; if(Bawl.bTOS ) { Bawl.bTOS=Bawl.bTOS.length}; while ( Bawl.bO < 100 && 0+Bawl.bTOS2 > 0){ Bawl.bO=Bawl.bO + 1; Bawl.d(167); Bawl.bTOS2=Bawl.bTOS2 - 1; Bawl.bT=Bawl.bT + ' '; } while ( Bawl.bO < 100 && 0+Bawl.bTOB > 0){ Bawl.bO=Bawl.bO + 1; Bawl.d(168); Bawl.bTOB=Bawl.bTOB - 1; Bawl.bT=Bawl.bT + '</b>'; } while ( Bawl.bO < 100 && 0+Bawl.bTOI > 0){ Bawl.bO=Bawl.bO + 1; Bawl.d(169); Bawl.bTOI=Bawl.bTOI - 1; Bawl.bT=Bawl.bT + '</i>'; } while ( Bawl.bO < 100 && 0+Bawl.bTOS > 0){ Bawl.bO=Bawl.bO + 1; Bawl.d(170); Bawl.bTOS=Bawl.bTOS - 1; Bawl.bT=Bawl.bT + ' '; } Bawl.d(171); return Bawl.bT; } else { Bawl.d(172); return ; } }; Bawl.gMPI=function(fullpagetext, sectiontext){ if(sectiontext){ Bawl.tSI=sectiontext; } else { Bawl.tSI=fullpagetext; } Bawl.d(173); if(Bawl.tSI.match(/^\#/gm) ) { Bawl.countHashtags=Bawl.tSI.match(/^\#/gm).length } else { Bawl.countHashtags=0 } if(Bawl.tSI.match(/^:/gm) ) { Bawl.countColons=Bawl.tSI.match(/^:/gm).length } else { Bawl.countColons=0 } if(Bawl.tSI.match(/^\*/gm) ) { Bawl.countAsterisks=Bawl.tSI.match(/^\*/gm).length } else { Bawl.countAsterisks=0 } Bawl.cC=Bawl.countHashtags + Bawl.countColons + Bawl.countAsterisks; Bawl.d(174); if(Bawl.countAsterisks >= Bawl.countColons && Bawl.countAsterisks >= Bawl.countHashtags && Bawl.cC > 0){ Bawl.d(175); return '*'; } else if(Bawl.countColons >= Bawl.countAsterisks && Bawl.countColons >= Bawl.countHashtags && Bawl.cC > 0){ Bawl.d(176); return ':'; } else if(Bawl.countHashtags > Bawl.countColons || Bawl.countHashtags > Bawl.countAsterisks && Bawl.cC > 0){ Bawl.d(177); return '#'; } else if(sectiontext){ Bawl.d(178); return Bawl.gMPI(fullpagetext); } else { return Bawl.cTIWD; } }; Bawl.gIPC=function(justCurrentPageText, replyLinkParams){ Bawl.d(179); Bawl.oRT=Bawl.eRE(replyLinkParams.origReplyTo).replace(/[_ ]/g, '[_ ]'); Bawl.wTSBURE=new RegExp('(?::' + '[' + Bawl.oRT.slice(0,1).toUpperCase + Bawl.oRT.slice(0,1).toLowerCase + ']' + Bawl.oRT.slice(1,) + '.*' + Bawl.eRE(replyLinkParams.origTimestamp) + '|' + Bawl.oRT + ':' + Bawl.eRE(replyLinkParams.origTimestamp) + ').*', 'g'); Bawl.wTSBU=justCurrentPageText.split(Bawl.wTSBURE); if(typeof replyLinkParams.seq == 'number' && replyLinkParams.seq <= Bawl.wTSBU.length && Bawl.wTSBU.length > 1){ Bawl.d(180); Bawl.wTUTS=; for (wikitextseqint=0; wikitextseqint <= replyLinkParams.seq; wikitextseqint++){ Bawl.wTUTS=Bawl.wTUTS + Bawl.wTSBU[wikitextseqint]; } Bawl.wTN=Bawl.wTUTS.match(/^=.*=[ ]*$/gm); if(Bawl.wTN){ Bawl.sT=Bawl.gSBN(justCurrentPageText,Bawl.wTN.length); } else { Bawl.d(181); Bawl.sT='SECTIONLESS'; } Bawl.rPL=Bawl.wTUTS.split(/\n/)[ Bawl.wTUTS.split(/\n/).length - 2 ] + '\n'; if(Bawl.rPL == '\n' ) { Bawl.rPL == ; } Bawl.rCNS=Bawl.wTUTS.split(/\n/)[ Bawl.wTUTS.split(/\n/).length - 1 ]; Bawl.rCS=justCurrentPageText.match(Bawl.wTSBURE)[replyLinkParams.seq]; Bawl.d(182); return { 'sectiontext':Bawl.sT,'sectionnum':Bawl.wTN.length,'relevantIndentation':Bawl.rCNS.replace(/([\\:\\*\\#]*).*/, '$1'),'relevantComment':Bawl.rCNS + Bawl.rCS,'relevantPrecedingLine':Bawl.rPL}; } else { Bawl.d(183); Bawl.aSL('username+timestamp not found, seq: ' + replyLinkParams.seq); return 'ERRORBAD'; } }; Bawl.gIPS=function(justCurrentPageText, replyLinkParams){ Bawl.wTSBSTRE=new RegExp('(?:^|\n)[=]+[\\[: ]*(?:[^\\|\n]*\\|)?' + Bawl.eRE(replyLinkParams.sectionTitle) + '[\\] ]*[=]+', 'gm'); Bawl.wTSBST=justCurrentPageText.split(Bawl.wTSBSTRE); Bawl.wTUTH=; for (wikitextseqint=0; wikitextseqint <= replyLinkParams.sectionseq; wikitextseqint++){ Bawl.wTUTH=Bawl.wTUTH + Bawl.wTSBST[wikitextseqint]; } Bawl.wTN=Bawl.wTUTH.match(/^=.*=[ ]*$/gm); if(! Bawl.wTN && Bawl.wTSBST.length == 2 ) { return {'sectiontext':Bawl.gSBN(justCurrentPageText,1),'sectionnum':1}; } else if(Bawl.wTN){ return {'sectiontext':Bawl.gSBN(justCurrentPageText,Bawl.wTN.length + replyLinkParams.sectionseq + 1),'sectionnum':Bawl.wTN.length + replyLinkParams.sectionseq + 1}; } else { return {'sectiontext':justCurrentPageText}; } }; Bawl.pR1=function(replyLinkParams, newCommentsChecked){ Bawl.d(184); Bawl.pPO('clear'); if(Bawl.UITIT.getValue ==  && Bawl.UITIT.isVisible){ $('#BawlUITextInputTitle').removeClass('BawlShakeIt'); var BawlShakeTitle=setInterval(function { clearInterval(BawlShakeTitle); $('#BawlUITextInputTitle').addClass('BawlShakeIt'); }, 20); Bawl.d(185); return } Bawl.dF(true); $(document.getElementById('BawlUIReplyButton')).addClass('BawlPendingBlink'); if(Bawl.s2.checkNewComments == true && newCommentsChecked != 'checked' && mw.config.get('wgArticleId') != 0){ Bawl.cFNC(replyLinkParams, 'postreply'); return//kill it for now, Bawl.cFNC will call this function again with newCommentsChecked='checked' if there are no new comments } Bawl.d(186); Bawl.cPTP={ 'action':'query', 'export':'true', 'titles': replyLinkParams.pageTitle, 'prop':'revisions' } api.get(Bawl.cPTP).done(function(currentPageText){ Bawl.d(187); if(! currentPageText.query.pages[-1]){ Bawl.d(188); Bawl.jCPT=Bawl.rWT(Bawl.gWFE(currentPageText.query.export["*"])); Bawl.cRID=currentPageText.query.pages[ Object.keys(currentPageText.query.pages)[0] ].revisions[0].revid; } else { Bawl.d(189); Bawl.jCPT=; Bawl.cRID=0; } Bawl.pPO('got wikitext'); Bawl.pR2(Bawl.jCPT, replyLinkParams, Bawl.cRID); }) } Bawl.pR2=function(justCurrentPageText, replyLinkParams, currentRevID){ Bawl.d(190); if(replyLinkParams.type != 'editFullPage'){ if(replyLinkParams.type == 'edit'){ Bawl.cM=replyLinkParams.origTimestamp.slice(-3,); } else { Bawl.cM=new Date.getTime.toFixed.slice(-3,); } if(replyLinkParams.sectionTitle && replyLinkParams.sectionTitle != ""){ Bawl.pCSSL='→' + replyLinkParams.sectionTitle + ': '; } else { Bawl.pCSSL=; } } if(Bawl.aE == 'visualLight'){ Bawl.sTS2; } Bawl.pC3=Bawl.pC2(Bawl.UITI.getValue); Bawl.pPO('comment processed'); Bawl.d(191); Bawl.d(192); Bawl.pCP={ format: 'json', action: 'edit', title: replyLinkParams.pageTitle, baserevid: currentRevID, nocreate: true, watchlist: Bawl.s2.watchlist, watchlistexpiry: Bawl.s2.watchlistexpiry }; Bawl.d(193); if(replyLinkParams.type == 'comment'){ Bawl.sST=; if(Bawl.s2.sumSnippet == true && replyLinkParams.type == 'comment' && Bawl.pC3){ Bawl.sRR=new RegExp('^' + Bawl.eRE(Bawl.rLPO.origReplyTo) + '[ ,:;]*') Bawl.sFS=Bawl.pC3.replace(/\[\\*)\|?\]\]/g, '$1').replace(/\{\{[^\\|\\\}\\\{]*\|([^\\\}]*)(\|[^\}]*)*\}\}/g, '$1').replace(/\[\]*\\|([^\\)+\\]\\]/g, '$1').replace(/'/g, ).replace(//g, ).replace(/^[\\:\\*\\#]*/, ).replace(/<span.*/g,).replace(Bawl.sRR, ); if(Bawl.sFS.length > 1){ Bawl.sFSS=Bawl.sFS; if(Bawl.sFS.length > 50){ Bawl.sFSS=Bawl.sFS.slice(0,40) + '...'; } Bawl.sST=': ' + Bawl.sFSS; } } Bawl.pCP.summary=Bawl.pCSSL + Bawl.wM.postCommentSummaryPost.replace(/USER/g, Bawl.eR(replyLinkParams.origReplyTo) + Bawl.sST); Bawl.oCD=Bawl.gIPC(justCurrentPageText, replyLinkParams); Bawl.pPO('got insertion point'); Bawl.cHLIRE=new RegExp('^([\:\#\*]{' + (Bawl.oCD.relevantIndentation.length + 1) + '})','m'); if(Bawl.oCD.relevantIndentation.length >= Bawl.s2.outdent && ! Bawl.oCD.sectiontext.match(Bawl.cHLIRE)){ Bawl.d(194); Bawl.oLL=( Bawl.oCD.relevantIndentation.length - 1) * 3; Bawl.cTI=Bawl.oCD.relevantIndentation.slice(Bawl.oCD.relevantIndentation.length - 1,) + '┌'; for (indentint=0; indentint < Bawl.oLL; indentint++){ Bawl.cTI=Bawl.cTI + '─'; } Bawl.cTI=Bawl.cTI + '┘ '; } else if(Bawl.oCD.relevantIndentation.length != 0){ Bawl.d(195); Bawl.cTI=Bawl.oCD.relevantIndentation + Bawl.oCD.relevantIndentation.slice(Bawl.oCD.relevantIndentation.length - 1,); Bawl.d(196); } else { Bawl.cTI=Bawl.gMPI(justCurrentPageText, Bawl.oCD.sectiontext); } if(Bawl.oCD.sectiontext != 'SECTIONLESS'){ Bawl.pCP.section=Bawl.oCD.sectionnum; Bawl.oWT=Bawl.oCD.sectiontext; } else { Bawl.oWT=justCurrentPageText; } Bawl.oCLPO=Bawl.oCD.relevantIndentation.length + 1; Bawl.rBTRE=new RegExp('(' + Bawl.eRE(Bawl.oCD.relevantPrecedingLine + Bawl.oCD.relevantComment) + ')((\n[\\:\\*\\#]{' + Bawl.oCLPO + ',}([^\\:\\*\\#\\=]|[$]).*)*)', 'm'); if(! Bawl.oWT.match(Bawl.rBTRE)){ Bawl.rBTRE=new RegExp('(' + Bawl.eRE(Bawl.oCD.relevantComment) + ')((\n[\\:\\*\\#]{' + Bawl.oCLPO + ',}([^\\:\\*\\#\\=]|[$]).*)*)', 'm'); } Bawl.rBT=Bawl.oWT.match(Bawl.rBTRE)[0]; Bawl.pCP.text=Bawl.oWT.replace(Bawl.rBT, Bawl.rBT + '\n' + Bawl.cTI + Bawl.pC3 + Bawl.rTI(Bawl.pC3)); } else if(replyLinkParams.type == 'BCL'){ Bawl.pCP.summary=Bawl.pCSSL + Bawl.wM.postCommentSummaryPost.replace(/USER/g, Bawl.eR(replyLinkParams.sectionTitle)); Bawl.oCD=Bawl.gIPS(justCurrentPageText, replyLinkParams); if(replyLinkParams.indent){ Bawl.cTI=replyLinkParams.indent; } else { Bawl.cTI=Bawl.gMPI(justCurrentPageText, Bawl.oCD.sectiontext); } Bawl.pCP.section=Bawl.oCD.sectionnum; Bawl.pCP.summary=Bawl.pCSSL + Bawl.sC2; if(replyLinkParams.subtype == 'page'){ delete Bawl.pCP.section; } if(replyLinkParams.indentation && replyLinkParams.indentation.match(/^\#\:\*$/)){ Bawl.cTI=replyLinkParams.indentation; } Bawl.pCP.appendtext='\n' + Bawl.cTI + Bawl.pC3 + Bawl.rTI(Bawl.pC3); } else if(replyLinkParams.type == 'newheading'){ Bawl.pCP.summary=Bawl.pCSSL + Bawl.wM.postSubsectionSummaryPost.replace(/SUBSECTION/g, Bawl.eR(Bawl.UITIT.getValue)); Bawl.oSD=Bawl.gIPS(justCurrentPageText, replyLinkParams); Bawl.pCP.section=Bawl.oSD.sectionnum; Bawl.nSL=Bawl.oSD.sectiontext.match(/^[=]*/)[0]; if(Bawl.nSL.length < 6){ Bawl.nSL=Bawl.nSL + '='; } Bawl.pCP.appendtext='\n' + Bawl.nSL + Bawl.UITIT.getValue + Bawl.nSL + '\n' + Bawl.pC3 + Bawl.rTI(Bawl.pC3); } else if(replyLinkParams.type == 'newsection'){ Bawl.pCP.summary=Bawl.wM.postCommentSummaryNewSection.replace('SUMMARY', ).replace(/NEWSECTION/g, Bawl.eR(Bawl.UITIT.getValue)); if(replyLinkParams.summary){ Bawl.d(197); Bawl.pCP.summary=Bawl.wM.postCommentSummaryNewSection.replace('SUMMARY', ' / ' + replyLinkParams.summary).replace(/NEWSECTION/g, Bawl.eR(Bawl.UITIT.getValue)); } if(replyLinkParams.minor == true){ Bawl.d(198); Bawl.pCP.minor=true; } Bawl.pCP.section='new'; Bawl.pCP.sectiontitle=Bawl.UITIT.getValue; Bawl.pCP.text=Bawl.pC3 + Bawl.rTI(Bawl.pC3); delete Bawl.pCP.nocreate; } else if(replyLinkParams.type == 'edit'){ Bawl.pCP.summary=Bawl.pCSSL + Bawl.wM.editCommentSummary; Bawl.oCD=Bawl.gIPC(justCurrentPageText, replyLinkParams); if(Bawl.oCD.sectiontext != 'SECTIONLESS'){ Bawl.pCP.section=Bawl.oCD.sectionnum; Bawl.oWT=Bawl.oCD.sectiontext; } else { Bawl.oWT=justCurrentPageText; } Bawl.uMIS=Bawl.pF(Bawl.UITI.getValue,Bawl.wTFEC); if(Bawl.uMIS != ){ Bawl.pCP.summary=Bawl.pCP.summary.replace(Bawl.sC2, ' (' + Bawl.uMIS.replace(/^, /, ) + ')' + Bawl.sC2); } Bawl.cTRRE=new RegExp(Bawl.eRE(Bawl.wTFEC)); Bawl.uCNS=Bawl.oWT.match(Bawl.cTRRE)[0].replace(Bawl.wTFESFP,); Bawl.aC=Bawl.oWT.match(Bawl.cTRRE)[0].replace(Bawl.uCNS,Bawl.pC3); Bawl.pCP.text=Bawl.oWT.replace(Bawl.cTRRE, Bawl.aC); } else if(replyLinkParams.type == 'editFullPage'){ Bawl.pCP.summary=Bawl.sC2; Bawl.pCP.text=Bawl.pC3; delete Bawl.pCP.nocreate; } else if(replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit'){ Bawl.pCP.summary=Bawl.sC2; Bawl.pCP.text=Bawl.pC3; Bawl.pCP.section=Bawl.gIPS(justCurrentPageText, replyLinkParams).sectionnum; } if(Bawl.s2.customSummary == true || replyLinkParams.type == 'editFullPage' || ( replyLinkParams.type == 'heading' && replyLinkParams.subtype == 'edit' )){ Bawl.pCP.summary=Bawl.pCP.summary.replace(Bawl.sC2, ' ' + Bawl.UITIS.getValue + Bawl.sC2).replace(/^[ ]*/, ); } Bawl.pPO('ready to post'); if(justCurrentPageText != Bawl.wikiTextWithComment || Bawl.pCP.appendtext){ if(! Bawl.pCP.appendtext){ Bawl.d(199); } Bawl.d(200); if(Bawl.dRO == true){ Bawl.dRO=false; Bawl.d(201); Bawl.dF(false); $(document.getElementById('BawlUIReplyButton')).removeClass('BawlPendingBlink'); } else { Bawl.dAPIC(Bawl.pCP); } if(Bawl.s2.afterPost == 'parsecomment' && ['comment','edit','newsection','newheading'].indexOf(replyLinkParams.type) != -1){ delete Bawl.pCP2; Bawl.dP('previewposted', replyLinkParams); } } else { Bawl.pPO('clear'); Bawl.d(202); Bawl.dF(false); $(document.getElementById('BawlUIReplyButton')).removeClass('BawlPendingBlink'); } }; Bawl.aRL=[]; Bawl.sF=[]; if(Bawl.s2.ffsWHY){ Bawl.vP=(mw.config.get('wgAction') == 'view' && window.location.href.match('veaction=') == null); } else { Bawl.vP=(mw.config.get('wgAction') == 'view' && mw.config.get('wgDiffNewId') == null && window.location.href.match('veaction=') == null && window.location.href.match('oldid=') == null); } if(Bawl.s2.RLmasq == true){ Bawl.rLIT=' ( reply ) '; Bawl.sBIC=; } else { Bawl.rLIT=; Bawl.sBIC='BawlSVGIcon BawlSVG'; } Bawl.rLDI=; Bawl.rLPHE={}; Bawl.rLPE={}; Bawl.aRLT=function(replyLinkParams){ if(! replyLinkParams.origReplyTo){ replyLinkParams.origReplyTo=; } if(! Bawl.vP){ Bawl.d(203); return; } if(( replyLinkParams.type == 'comment' || ( replyLinkParams.type == 'edit' && replyLinkParams.type == 'legacy' ) ) && ! Bawl.fAL){ Bawl.rUD=replyLinkParams.origReplyTo + replyLinkParams.origTimestamp; for (seqint=0; seqint < 100; seqint++){ Bawl.d(204); if(Bawl.aRL.indexOf(Bawl.rUD + '-' + seqint) == -1){ Bawl.aRL.push(Bawl.rUD + '-' + seqint); replyLinkParams.seq=seqint; if(seqint > 0){ replyLinkParams.id=replyLinkParams.id + '_' + seqint; } break; } } } if(! replyLinkParams.sectionseq){ replyLinkParams.sectionseq=Bawl.s; } if(replyLinkParams.type == 'newheading' && Bawl.s > 0){ replyLinkParams.id=replyLinkParams.id + '_' + Bawl.s; } if(Bawl.s2.debug == true && int){ Bawl.rLDI=' (int #' + int + ', replyLinkParams.int #' + replyLinkParams.int + ', subtype: ' + replyLinkParams.subtype + ')'; } if(replyLinkParams.isFirst != true){ Bawl.rLHTML=document.createElement('span'); } else { Bawl.rLHTML=document.createElement('div'); } Bawl.rLHTML.id='bawlLink-' + Bawl.eHTML(replyLinkParams.id); Bawl.rLHTML.className='BawlLinks'; if(replyLinkParams.type == 'comment'){ Bawl.rLT='<span title="' + Bawl.m.replyToTitle.replace('USER', Bawl.eHTML(replyLinkParams.origReplyTo)) + Bawl.rLDI + '" class="BawlReplyLinkIcon BawlReplyLink ' + Bawl.sBIC + '">' + Bawl.rLIT + ' '; } else if(replyLinkParams.type == 'newheading'){ Bawl.rLT='<span title="' + Bawl.m.newSectionTitle + Bawl.rLDI + '" class="BawlReplyLinkIcon BawlReplyLink BawlSVGNewSectionIcon BawlSVG"> '; }	else if(replyLinkParams.type == 'edit'){ Bawl.rLT='<span title="' + Bawl.m.editTitle + Bawl.rLDI + '" class="BawlReplyLinkIcon BawlReplyLink BawlSVGEditIcon BawlSVG"> '; Bawl.rLHTML.id='bawlEditLink-' + Bawl.eHTML(replyLinkParams.id); } if($('#ca-addsection')[0] || replyLinkParams.type != 'newheading'){ if(Bawl.fAL){ Bawl.oCP='\ + encodeURIComponent(JSON.stringify(replyLinkParams)).replace(/\'/g, '%27') + '\''; } else if(replyLinkParams.type == 'edit'){ Bawl.oCP='Bawl.rLPE[' + JSON.stringify(replyLinkParams.int) + ']'; } else { Bawl.oCP='Bawl.rLP[' + JSON.stringify(replyLinkParams.int) + ']'; } Bawl.rLHTML.innerHTML='<a class="BawlReplyLink" onclick="Bawl.oRF(' + Bawl.oCP + ')">' + Bawl.rLT + '</a>'; } if(! replyLinkParams.isFirst && ( ( Bawl.s2.dateLinksIcon && replyLinkParams.type == 'comment' && replyLinkParams.subtype == 'locator' ) || ( Bawl.s2.dateLinksIconSection && replyLinkParams.type == 'newheading' ) )){ Bawl.d(205); Bawl.pLGL=document.createElement('a'); Bawl.pLGL.onclick=function{Bawl.gPL(replyLinkParams)}; Bawl.pLGL.id='genLink-' + replyLinkParams.int; Bawl.pLGL.innerHTML=' '; Bawl.pLGL.classList=[ 'BawlReplyLink' ]; Bawl.rLHTML.prepend(Bawl.pLGL); } if(replyLinkParams.type == 'newheading' && Bawl.s2.editFullSection){ Bawl.eFSLT='<span title="' + Bawl.m.editFullSectionTitle + Bawl.rLDI + '" class="BawlReplyLinkIcon BawlReplyLink BawlSVGEditIcon BawlSVG"> '; Bawl.rLPHE[replyLinkParams.int]=$.extend( true, {}, replyLinkParams ); Bawl.rLPHE[replyLinkParams.int].type='heading'; Bawl.rLPHE[replyLinkParams.int].subtype='edit'; Bawl.eFSL=document.createElement('span'); Bawl.eFSL.innerHTML='<a class="BawlReplyLink" onclick="Bawl.oRF(Bawl.rLPHE[' + JSON.stringify(replyLinkParams.int) + '])">' + Bawl.eFSLT + '</a>'; Bawl.rLHTML.append(Bawl.eFSL); } if(replyLinkParams.isFirst == true){ delete Bawl.rLHTML.id; Bawl.rLHTML.classList.add('BawlFirstReply'); Bawl.rLHTML.innerHTML=Bawl.rLHTML.innerHTML.replace('BawlSVGIcon','BawlSVGFirstReplyIcon BawlFirstReply'); if(int == Bawl.pEA.length -1){ Bawl.pEA[int].append(Bawl.rLHTML); } else { Bawl.pEA[int].parentElement.previousElementSibling.append(Bawl.rLHTML); } } else if(replyLinkParams.type == 'edit'){ Bawl.d(206); document.getElementById('bawlLink-' + replyLinkParams.id).append(Bawl.rLHTML); } else if(replyLinkParams.subtype == 'locator'){ Bawl.d(207); if(! Bawl.fAL){ Bawl.pEA[int].append(Bawl.rLHTML); } else { document.getElementById(replyLinkParams.id).append(Bawl.rLHTML); } } else if(replyLinkParams.subtype == 'legacy'){ if(Bawl.pCN.data){ Bawl.rLHTML.prepend(Bawl.pCN.data) Bawl.pEA[replyLinkParams.int].replaceChild(Bawl.rLHTML, Bawl.pCN) } else if(Bawl.pCN.tagName == 'SPAN'){ Bawl.pCN.append(Bawl.rLHTML); } } else if(replyLinkParams.type == 'newheading' || replyLinkParams.type == 'heading'){ Bawl.d(208); if(mw.config.get('skin') == 'minerva'){ Bawl.rLHTML.classList.add('BawlFloatRight'); Bawl.pEA[int +1 ].prepend(Bawl.rLHTML); } else { Bawl.pEA[int].append(Bawl.rLHTML); } } if(! replyLinkParams.isFirst && replyLinkParams.type == 'comment' && Bawl.uNU && replyLinkParams.origReplyTo == Bawl.uNU && Bawl.s2.editLinks == true ) { Bawl.d(209); Bawl.rLPE[replyLinkParams.int]=$.extend( true, {}, replyLinkParams ); Bawl.rLPE[replyLinkParams.int].type='edit'; Bawl.aRLT(Bawl.rLPE[replyLinkParams.int]); } }; Bawl.aTBL=function(pos,classname,textname,onclickaction,hrefcontent){ if(mw.config.get('skin') == 'minerva'){ Bawl.sLP='padding:0.75em 1.5em 0.75em 1.5em'; } else if(mw.config.get('skin') == 'monobook'){ Bawl.sLP='padding:0'; } else { Bawl.sLP=; } Bawl.nLSIT=; Bawl.nLSC=classname; if(mw.config.get('skin') == 'modern' || mw.config.get('skin') == 'monobook'){ Bawl.nLSIT=textname; Bawl.nLSC=; } Bawl.nLH=; if(typeof hrefcontent != 'undefined'){ Bawl.nLH=' href="' + hrefcontent + '"'; } Bawl.nLO=; if(typeof onclickaction != 'undefined'){ Bawl.nLO=' onclick="' + onclickaction + '"'; } Bawl.nLS=document.createElement('span'); Bawl.nLS.title=textname + ' (Bawl)'; Bawl.nLS.className='BawlYesDisplay'; Bawl.nLS.innerHTML='<a' + Bawl.nLH + Bawl.nLO + ' style="background-image:unset"><span style="' + Bawl.sLP + '" class="BawlReplyLink ' + Bawl.nLSC + '">' + Bawl.nLSIT + ' </a>'; if(typeof $('#ca-edit')[0] != "undefined" && (['vector','vector-2022','timeless','modern'].indexOf(mw.config.get('skin')) != -1 )){ $('#ca-edit').append(Bawl.nLS); if(Bawl.s2.hideThePain == true && mw.user.options.get('discussiontools-newtopictool') == 1	&& $('#ca-addsection')[0]){ $('#ca-addsection')[0].childNodes[0].classList.add('BawlNoDisplay'); } } else if(mw.config.get('skin') == 'monobook' && typeof $('#ca-edit')[0] != "undefined"){ Bawl.nLL=document.createElement('li'); Bawl.nLL.innerHTML=Bawl.nLS.outerHTML; if(pos == -1){ $('#p-cactions .pBody ul').append(Bawl.nLL); } else { $('#p-cactions .pBody ul')[0].insertBefore(Bawl.nLL, $('#p-cactions .pBody ul')[0].children[pos]); } } else if(mw.config.get('skin') == 'minerva' && typeof $('#ca-edit')[0] != "undefined"){ $('#page-actions-edit').append(Bawl.newSectionLinkSpan); if(Bawl.s2.hideThePain == true){ $('.ext-discussiontools-init-new-topic').addClass('BawlNoDisplay'); } } }; if(Bawl.s2.addLinkSetting == 'addLoadButtonTop' || Bawl.s2.addLinkSetting == 'addLoadButtonSect'){ Bawl.aTBL(-1,'BawlSVGPowerIcon BawlSVG',Bawl.m.bawl,'Bawl.sNCL(\'manual\')'); } if(Bawl.s2.nSecLink == true && mw.config.get('wgPageContentModel') == 'wikitext'){ Bawl.rLPS={ 'id':'newSectionForm-' + encodeURIComponent(mw.config.get('wgPageName')), 'type':'newsection', 'pageTitle': mw.config.get('wgPageName'), } Bawl.aTBL(5,'BawlSVGNewSectionIcon BawlSVG',Bawl.b.newsection,'Bawl.oRF(Bawl.rLPS)'); } if(Bawl.s2.hideThePain == true){ $('.ext-discussiontools-init-replylink-buttons').addClass('BawlNoDisplay'); } if(Bawl.s2.editFullPage == true){ Bawl.rLPFP={ 'id':'editFullPage-' + mw.config.get('wgPageName'), 'type':'editFullPage', 'pageTitle': mw.config.get('wgPageName'), } Bawl.aTBL(5,'BawlSVGEditIcon BawlSVG',Bawl.b.BawlUIEditButton,'Bawl.oRF(Bawl.rLPFP)'); } if(Bawl.s2.addLinkSetting == 'addLoadButtonSect' && ( $('#ca-addsection')[0] || $('.BawlCmt')[0] )){ Bawl.d(210); Bawl.pH2EA=Array.from($('H2')); for (inth2Element=0; inth2Element < Bawl.pH2EA.length; inth2Element++){ Bawl.h2A=; for (inth2child=0; inth2child < Bawl.pH2EA[inth2Element].children.length; inth2child++){ if(Bawl.pH2EA[inth2Element].children[inth2child].id){ Bawl.h2A=Bawl.pH2EA[inth2Element].children[inth2child].id; Bawl.d(211); } } if(Bawl.h2A != ){ Bawl.h2PL=document.createElement('span'); Bawl.h2PL.innerHTML='<a href="#' + Bawl.h2A + '" onclick="Bawl.sNCL(\'manual\')" title="Bawl!" style="background-image:unset"> </a>'; $('H2')[inth2Element].append(Bawl.h2PL); } } } if(Bawl.s2.replySecLink == true && ( $('#ca-addsection')[0] || $('.BawlCmt')[0] )){ Bawl.d(212); Bawl.rTSLN=true; } Bawl.cIS=[]; Bawl.mREP=; for (intMonthRegExp=1; intMonthRegExp < 13; intMonthRegExp++){ Bawl.mREP=Bawl.mREP + Bawl.mN[intMonthRegExp] + '|' + Bawl.mN[intMonthRegExp].slice(0,3) + '|'; } Bawl.mREP=Bawl.mREP.slice(0,Bawl.mREP.length - 1); Bawl.sDRE=new RegExp('([0-2]?[0-9]:[0-5][0-9] |[0-3]?[0-9] |(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) |[0-9]{4} |\\([A-Z]{1,9}\\)){5}'); Bawl.sDRELM=new RegExp('([0-2]?[0-9]:[0-5][0-9][\.,]? |[0-3]?[0-9][\.,]? |(' + Bawl.mREP + ')[\.,]? |[0-9]{4}[\.,]? |\\([A-Z]{1,9}\\)){5}'); Bawl.uNFLRE=new RegExp('([\/\=])(User:|User_talk:|' + Bawl.eRE(encodeURIComponent(mw.config.get('wgFormattedNamespaces')[2].replace(/ /g,'_'))) + ':|' + Bawl.eRE(encodeURIComponent(mw.config.get('wgFormattedNamespaces')[3].replace(/ /g,'_'))) + ':)([^\/:"\#\&]+)($|[\/:"\#\&])', 'g'); Bawl.TZOD=new Date; Bawl.TZODW=Bawl.TZOD.toLocaleString("en", {timeZone:Bawl.wT}); Bawl.TZODUTC=Bawl.TZOD.toLocaleString("en", {timeZone:'UTC'}); Bawl.TZODWM=new Date(Bawl.TZODW).getTime; Bawl.TZODUTCM=new Date(Bawl.TZODUTC).getTime; Bawl.TZOS=( Bawl.TZODWM - Bawl.TZODUTCM ); Bawl.rLP={}; Bawl.sNC=function{ if(( ! Bawl.s2.addLinkTS || ( Bawl.s2.addLinkTS && Bawl.nCIFIS ) ) && Bawl.s2.methodLegacy && ['P','LI','DD'].indexOf(Bawl.pEA[int].nodeName) != -1){ Bawl.d(213); Bawl.aLL=true; Bawl.pCNI=Bawl.pEA[int].childNodes.length; for (intCmtChildNode=0; intCmtChildNode < Bawl.pEA[int].childNodes.length; intCmtChildNode++){ Bawl.pCNI=Bawl.pCNI - 1; if(Bawl.pCNI > -1 && Bawl.pCNI < 7){ Bawl.pCN=Bawl.pEA[int].childNodes[Bawl.pEA[int].childNodes.length - 1 - Bawl.pCNI]; Bawl.d(214); if(Bawl.pCN.data || ( Bawl.pCN.classList && Bawl.pCN.classList.contains('BawlCmt') ) || Bawl.pCN.tagName == 'SPAN'){ Bawl.d(215); if(! Bawl.pCN.data && Bawl.pCN.classList && Bawl.pCN.classList.contains('BawlCmt')){ Bawl.d(216); for (intCmtChildNodeBawlCmt=0; intCmtChildNodeBawlCmt < Bawl.pCN.childNodes.length; intCmtChildNodeBawlCmt++){ if(Bawl.pCN.childNodes[intCmtChildNodeBawlCmt].data){ Bawl.d(217); Bawl.pCN=Bawl.pCN.childNodes[intCmtChildNodeBawlCmt]; Bawl.aLL=false; } } if(Bawl.aLL){ Bawl.d(218); break; } } if(Bawl.pCN.tagName == 'SPAN'){ Bawl.tND=Bawl.pCN.innerText; Bawl.nIS=true; } else { Bawl.tND=Bawl.pCN.data; Bawl.nIS=false; } Bawl.nCD=Bawl.tND.match(Bawl.sDRELM); if(Bawl.nCD){ Bawl.d(219); Bawl.lND=Bawl.nCD[0].replace(/^[ ]*/,); if(Bawl.s2.dateLinksLocalTime){ Bawl.EM=[,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; Bawl.mRD=Bawl.lND; for (intMonth=1; intMonth < 13; intMonth++){ Bawl.mRD=Bawl.mRD.replace(Bawl.mN[intMonth], Bawl.EM[intMonth]); Bawl.mRD=Bawl.mRD.replace(' ' + Bawl.mN[intMonth].slice(0,3) + ' ', ' ' + Bawl.EM[intMonth] + ' '); } Bawl.mRDNTZ=Bawl.mRD.replace(/[\.,]/g, ).match(Bawl.sDRE); if(Bawl.mRDNTZ){ Bawl.mRDWTZ=Bawl.mRDNTZ[0].replace(/\(.*\)/,Bawl.wT); Bawl.sDL=new Date(Bawl.mRDWTZ); if(Bawl.sDL != 'Invalid Date'){ Bawl.d(220); Bawl.nST=new Date(Bawl.sDL.getTime + Bawl.TZOS).toString.replace(/ \(.*/, ); if(Bawl.nIS){ Bawl.pCN.innerText=Bawl.tND.replace(/[\.,]/g, ).replace(Bawl.sDRELM, '$1' + Bawl.nST); } else { Bawl.pCN.data=Bawl.tND.replace(/[\.,]/g, ).replace(Bawl.sDRELM, '$1' + Bawl.nST); } } } } Bawl.lU=; Bawl.rSATRE=new RegExp(Bawl.eRE(Bawl.lND) + '[^]*'); Bawl.lCNS=Bawl.pEA[int].innerHTML.replace(Bawl.rSATRE,).replace(Bawl.sDRELM,''); if(Bawl.lCNS.match(Bawl.uNFLRE)){ Bawl.d(221); Bawl.d(222); Bawl.lU=Bawl.lCNS.match(Bawl.uNFLRE)[Bawl.lCNS.match(Bawl.uNFLRE).length - 1].replace(/.*:(.*).$/,'$1'); } Bawl.lID='BawlLegacy:' + Bawl.lU.replace(/ /g, '_').replace(/:/g, 'FTTCLN') + ':' + Bawl.lND.replace(/ /g, '_').replace(/:/g, 'FTTCLN') + ':' + Bawl.pTTE.replace(/ /g, '_').replace(/:/g, 'FTTCLN'); Bawl.rLP[int]={ 'int':int, 'type':'comment', 'subtype':'legacy', 'id': Bawl.lID, 'pageTitle':Bawl.pTTE, 'sectionTitle':Bawl.sT2, 'origReplyTo':Bawl.lU, 'origTimestamp':Bawl.lND, }; if(Bawl.aLL){ if(! Bawl.fRIS){ Bawl.fRIS=$.extend( true, {}, Bawl.rLP[int] ); Bawl.fRIS.isFirst=true; } Bawl.lCC++; Bawl.aRLT(Bawl.rLP[int]); Bawl.nCIFIS=false; if(Bawl.cIS.indexOf(Bawl.lU) == -1){ Bawl.cIS.push(Bawl.lU); } } break; } } } } }	else if(Bawl.pEA[int].classList.contains('mw-editsection') ) { Bawl.d(223); for (findeditlinkint=0; findeditlinkint < Bawl.pEA[int].childNodes.length; findeditlinkint++){ if(Bawl.pEA[int].childNodes[findeditlinkint].href && Bawl.pEA[int].childNodes[findeditlinkint].href.match(/[\&\?]action=edit/)){ Bawl.pTTE=decodeURIComponent(Bawl.pEA[int].childNodes[findeditlinkint].href.replace( /.*title=([^&]*).*/, '$1')).replace(/_/g, ' '); } } Bawl.sPP=Bawl.sT2 + Bawl.pTTE; for (secseqint=0; secseqint < 100; secseqint++){ Bawl.d(224); if(Bawl.sF.indexOf(Bawl.sPP + '-' + secseqint) == -1){ Bawl.sF.push(Bawl.sPP + '-' + secseqint); Bawl.s=secseqint; break; } } Bawl.rLP[int]={ 'int':int, 'id':'heading-' + Bawl.pTTE.replace(/ /g,'_') + Bawl.sT2.replace(/ /g,'_'), 'type':'newheading', 'subtype':'heading', 'pageTitle':Bawl.pTTE, 'sectionTitle':Bawl.sT2, }; if(Bawl.s2.secLinks == true){ Bawl.aRLT(Bawl.rLP[int]); } Bawl.nCIFIS=true; } else if(Bawl.pEA[int].classList.contains('mw-headline') ) { if(Bawl.rTSLN && Bawl.fRIS && Bawl.cIS.length > 3){ Bawl.d(225); Bawl.aRLT(Bawl.fRIS); delete Bawl.fRIS; } Bawl.cIS=[]; if(Bawl.pEA[int].classList.contains('mw-headline')){ Bawl.d(226); Bawl.sT2=Bawl.pEA[int].innerText; delete Bawl.fRIS; } } else if(( ! Bawl.s2.addLinkTS || ( Bawl.s2.addLinkTS && Bawl.nCIFIS ) ) && Bawl.pEA[int].classList.contains('BawlCmt')){ Bawl.d(227); Bawl.lU2=Bawl.pEA[int].id.replace(/(.*)\:([0-9]{13,14})\:([^\:]*).*/, '$1').replace(/(BAWLCOLON|FTTCLN)/g, ':'); Bawl.lT=Bawl.pEA[int].id.replace(/(.*)\:([0-9]{13,14})\:([^\:]*).*/, '$2'); Bawl.lPT=Bawl.pEA[int].id.replace(/(.*)\:([0-9]{13,14})\:([^\:]*).*/, '$3').replace(/(BAWLCOLON|FTTCLN)/g, ':'); Bawl.rLP[int]={ 'int': int, 'type':'comment', 'subtype':'locator', 'id': Bawl.pEA[int].id, 'pageTitle': decodeURIComponent(Bawl.lPT), 'sectionTitle': Bawl.sT2, 'origReplyTo': decodeURIComponent(Bawl.lU2), 'origTimestamp': Bawl.lT, } if(! Bawl.fRIS){ Bawl.fRIS=$.extend( true, {}, Bawl.rLP[int] ); Bawl.fRIS.isFirst=true; } Bawl.aRLT(Bawl.rLP[int]); Bawl.nCIFIS=false; if(Bawl.cIS.indexOf(decodeURIComponent(Bawl.lU2)) == -1){ Bawl.cIS.push(decodeURIComponent(Bawl.lU2)); } } else if(Bawl.pEA[int].className && ( Bawl.pEA[int].className.match('commentbox') || Bawl.pEA[int].className.match('createbox') )){ Bawl.d(228); if(Bawl.s2.inputBoxTO == true){ Bawl.d(229); Bawl.rLP[int]={ 'int': int, 'id':'newSectionForm-InputBox', 'type':'newsection', 'subtype':'InputBox', 'pageTitle': mw.config.get('wgPageName'), 'sectionTitle':'NO-VALUE-PLEASE-IGNORE', 'origReplyTo':'NO-VALUE-PLEASE-IGNORE', 'origTimestamp':'2000-01-01T00:00:00.000Z', 'origReplyTo2':'NO-VALUE-PLEASE-IGNORE', 'preloadparams': [] } for (intInputBox=0; intInputBox < Bawl.pEA[int].children.length; intInputBox++){ Bawl.d(230); if(Bawl.pEA[int].children[intInputBox].name == 'preload'){ Bawl.rLP[int].preload=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].name == 'preloadparams[]'){ Bawl.rLP[int].preloadparams.push(Bawl.pEA[int].children[intInputBox].value); } else if(Bawl.pEA[int].children[intInputBox].name == 'editintro'){ Bawl.rLP[int].editIntro=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].name == 'summary'){ Bawl.rLP[int].summary=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].name == 'minor'){ Bawl.rLP[int].minor=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].name == 'title'){ Bawl.rLP[int].pageTitle=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].name == 'preloadtitle'){ Bawl.rLP[int].preloadtitle=Bawl.pEA[int].children[intInputBox].value; } else if(Bawl.pEA[int].children[intInputBox].type == 'submit'){ Bawl.d(231); Bawl.pEA[int].children[intInputBox].type=; Bawl.pEA[int].children[intInputBox].outerHTML=Bawl.pEA[int].children[intInputBox].outerHTML.replace(/>$/, ' onclick="Bawl.oRF(Bawl.rLP[' + JSON.stringify(Bawl.rLP[int].int) + '])">'); } } } } else if(Bawl.pEA[int].classList.contains('Bawl-comment-link') ) {//&& Bawl.pEA[int].id && Bawl.pEA[int].id.match(/^\{(\"[a-z]*\":\"[^"]*\",)*\"[a-z]*\":\"[^"]*\"\}/)){ Bawl.d(232); Bawl.rLP[int]={ 'int': int, 'id':'Bawl-comment-link', 'type':'BCL', 'subtype':'page', 'pageTitle': Bawl.pTTE, 'sectionTitle': Bawl.sT2, 'origReplyTo':'NO-VALUE-PLEASE-IGNORE', 'origTimestamp':'2000-01-01T00:00:00.000Z', 'preloadparams': [] } delete Bawl.cLID; if(decodeURIComponent(Bawl.pEA[int].id).match(/\{("(type|page|style|name|indent|preload|preloadparams)":"[^"<>]+"[,]?){2,7}\}/)){ Bawl.cLID=JSON.parse(decodeURIComponent(Bawl.pEA[int].id)); } if(Bawl.cLID){ if(Bawl.cLID.type == 'section'){ Bawl.rLP[int].subtype='section'; } if(Bawl.cLID.indent && decodeURIComponent(Bawl.cLID.indent).match(/^[\:\*\#]{1,5}$/)){ Bawl.rLP[int].indent=decodeURIComponent(Bawl.cLID.indent); } if(Bawl.cLID.page){ Bawl.rLP[int].pageTitle=decodeURIComponent(Bawl.cLID.page); } if(Bawl.cLID.preload){ Bawl.rLP[int].preload=decodeURIComponent(Bawl.cLID.preload); } if(Bawl.cLID.preloadparams){ Bawl.rLP[int].preloadparams=decodeURIComponent(Bawl.cLID.preloadparams); } Bawl.pEA[int].childNodes[0].outerHTML=Bawl.pEA[int].childNodes[0].outerHTML.replace(/href=\"[^"]*\"/, 'onclick="Bawl.oRF(\ + encodeURIComponent(JSON.stringify(Bawl.rLP[int])).replace(/\'/g, '\\\'') + '\')"'); if(mw.util.getParamValue('withJS') && mw.util.getParamValue('withJS').match('Bawl.js') && mw.util.getParamValue('Bawlform') == Bawl.pEA[int].innerText){ Bawl.aOFP=$.extend( true, {}, Bawl.rLP[int] ); if(Bawl.aOFP.preloadparams && Bawl.aOFP.preloadparams.length > 0){ Bawl.aOFP.preloadparams=JSON.parse(decodeURIComponent(Bawl.aOFP.preloadparams).replace(/\&quot\;/g, '"')); } } } } }; Bawl.fAL=false; Bawl.sNCL=function(manualload){ Bawl.d(233); Bawl.lTAL=new Date.getTime; if(Bawl.s2.methodLegacy && mw.config.get('wgArticleId') != 0 && ( mw.config.get('wgNamespaceNumber') != 0 || $('#ca-addsection')[0] )){ $('.mw-body li').addClass('bawlprocess'); $('.mw-body dd').addClass('bawlprocess'); $('.mw-body p').addClass('bawlprocess'); } if(Bawl.s2.methodLocator){ $(document.getElementsByClassName('BawlCmt')).addClass('bawlprocess'); } $(document.getElementsByClassName('mw-editsection')).addClass('bawlprocess'); $(document.getElementsByClassName('mw-headline')).addClass('bawlprocess'); $(document.getElementsByClassName('commentbox')).addClass('bawlprocess'); $(document.getElementsByClassName('Bawl-comment-link')).addClass('bawlprocess'); Bawl.pEA=Array.from($('.bawlprocess')); Bawl.pEAL=Bawl.pEA.length; Bawl.pTTE=mw.config.get('wgPageName'); Bawl.sT2=""; Bawl.lCC=0; Bawl.kSI=0; Bawl.kST=false; Bawl.nCIFIS=true; for (int=0; int < Bawl.pEAL; int++){ if(Bawl.s2.killswitch){ Bawl.kSI++; if(Bawl.kSI == 50){ Bawl.kSI=0; if(Bawl.lTAL < (new Date.getTime - 3000)){ Bawl.d(234); Bawl.kST=true; break; } } } Bawl.d(235); if(Bawl.rTSLN && Bawl.fRIS && int == (Bawl.pEAL-1) && Bawl.cIS.length > 1){ Bawl.aRLT(Bawl.fRIS); } Bawl.sNC; } if(manualload == 'manual'){ $('.BawlSVGPowerIcon').addClass('BawlNoDisplay'); Bawl.rJ; } Bawl.fAL=true; }; if(Bawl.s2.addLinkSetting == 'addLinksAuto'){ Bawl.sNCL; } if(window.location.hash.match(/:[0-9]{13,14}:/) && document.getElementById(window.location.hash.slice(1,))){ Bawl.d(236); Bawl.hHTMLRE=new RegExp('([^]*)(' + Bawl.eRE(document.getElementById(window.location.hash.slice(1,)).outerHTML) + ')'); document.getElementById(window.location.hash.slice(1,)).parentElement.innerHTML=document.getElementById(window.location.hash.slice(1,)).parentElement.innerHTML.replace(/class="ext-discussiontools-init-replylink-buttons bawlprocess BawlYesDisplay/, 'class="ext-discussiontools-init-replylink-buttons bawlprocess BawlNoDisplay').replace(Bawl.hHTMLRE, ' $1$2 '); var DelayJump=setInterval(function { clearInterval(DelayJump);document.getElementById('BawlAnchorLocator').scrollIntoView; }, 20); var DelayNormalDisplay=setInterval(function { clearInterval(DelayNormalDisplay);$('#BawlAnchorLocator').removeClass('BawlPurpleBG'); }, 1000); var DelayCleanUp=setInterval(function { clearInterval(DelayCleanUp);$('#BawlAnchorLocator')[0].outerHTML=$('#BawlAnchorLocator')[0].innerHTML; }, 2000); } Bawl.rJ=function{ if(window.location.hash != ){ Bawl.d(237); Bawl.lH=window.location.hash; window.location='#'; window.location=Bawl.lH; } }; Bawl.rJ; if(Bawl.aOFP){ Bawl.oRF(Bawl.aOFP); } if(Bawl.s2.cureDTBlueStreak && window.location.hash != ){ Bawl.wFBS2=0; Bawl.wFBS=function{ Bawl.wFBS2++; var DelayedBS=setInterval(function { clearInterval(DelayedBS); if($('.ext-discussiontools-init-targetcomment')[0]){ $('.ext-discussiontools-init-targetcomment').removeClass('ext-discussiontools-init-targetcomment').addClass('BawlEaseIn').addClass('BawlPurpleBG'); var DelayBlueCure=setInterval(function { clearInterval(DelayBlueCure); $('.BawlPurpleBG').removeClass('BawlPurpleBG'); }, 1500); } else if(Bawl.wFBS2 < 200){ Bawl.wFBS; } }, 50); }; Bawl.wFBS; } Bawl.lT2=new Date.getTime; Bawl.lTT=Bawl.lT2 - Bawl.tI; Bawl.lTAL=Bawl.lT2 - Bawl.lTAL; if(Bawl.kST ) { Bawl.maybeSkullNBones='(F)' } else { Bawl.maybeSkullNBones=''; } if(typeof BawlShowLoadTime != 'undefined' ) { console.log('load time (initialisation): ' + (Bawl.lTT - Bawl.lTAL) + 'ms, adding links: ' +	Bawl.lTAL + 'ms, total: ' + Bawl.lTT); } } else { console.log('Bawl: this doesn\'t seem like an appropriate page to load Bawl on, but if it is, report it'); }; //