MediaWiki:PageFormatter/code.js

////////////////////////////////////////////////////////////////////////////////////// //                                                                                 // // Title: Page Formatter. // // Function: Reformats a template to look appropriate, Replace automatically,etc. // //--// // Authors: Ditto Creeper Bot, KockaAdmiralac (Regex Lord), and Andrey Andrey      // // Inspiration: Pain actually, I saw the fiasco others were going through and I had // // take action. ^-^                                                       // ////////////////////////////////////////////////////////////////////////////////////// // Variables. realpipeSpace = false || window.pipeSpace; // Button Placement. if (wgIsArticle === true) { $('.pph-dropdown-container ul.pph-dropdown').append('Clean! '); $('Clean Up! ').insertAfter('.WikiaPageHeader h1'); }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $('#PageCleaner').on('click',function{   var CleanMod = ' \    box-shadow: 0 10px 60px 0 #615b5b;\    background: rgba(0, 0, 0, 0.47);\    border-width: 5px;\    border-style: solid;\    border-color: #ebebeb;\    border-color: rgba(235,235,235,0.6);\    -moz-background-clip: padding;\    -webkit-background-clip: padding;\    background-clip: padding-box;\    color: #D5D4D4;\    position: absolute;\    border-radius:4pc\ }\ .PFRed {\	border: 1px red solid;\	font-family: sans-serif;\	transition: color 1s ease-in-out 1s, animation 1s ease-in-out 1s, border 1s ease-in-out 1s;\ font-family 1s ease-in-out 1s\ }\ .PFblue {\ font-family: sans-serif;\ border: 1px blue solid;\ transition: color 1s ease-in-out 1s, animation 1s ease-in-out 1s, border 1s ease-in-out 1s;\ font-family 1s ease-in-out 1s\ }\ .modalWrapper {\ width: initial !important;\ height: auto;\ margin-left: -225px;\ top: 50px;\ z-index: 5001102;\ }\ .PFblue:hover {\ animation: Boi 4s ease-in-out infinite;\ }\ @keyframes Boi {\ 0% {\		box-shadow: 0px 0px 0px blue;\ }\	40% {\		box-shadow: 3px 2px 90em blue;\ }\	100% {\		box-shadow: 0px 0px 0px blue;\ }\ }\ .PFRed:hover {\ animation: Boir 4s ease-in-out infinite;\ }\ @keyframes Boir {\ 0% {\		box-shadow: 0px 0px 0px #ff0019;\ }\	40% {\		box-shadow: 3px 2px 90em #c70000;\ }\	100% {\		box-shadow: 0px 0px 0px #ff002e;\ }\ }\   transition:color 1s ease-in-out 1s,content 1s ease-in-out 1s,filter 1s ease-in-out 0s\ }\ .Secretblue{\ color:rgba(0, 114, 255, 0.53)\ }\ .Secretblue:hover{\ filter: drop-shadow(1px 2px 5px blue)\ }\ .Secretred{\ color:rgba(255, 0, 0, 0.68);\ }\ .Secretred:hover{\ filter: drop-shadow(1px 2px 5px red);\ }\ .Secretred:after{\ content:"Unformatter"\ }\ .Secretblue:after{\ content:"Formatter"\ }\ .modalWrapper .boi {\ zoom: 1;\ float: left;\ margin: 20px 20px 0;\ z-index: 1;\ } Page   table#PageClean td button,table#PageCleanTwo {\ width:100% !important\ }\     #PageCleanTwo td button{width:100%}    '; $.showCustomModal('', CleanMod, {       id: "PFVoltron",        //Don't hurt me. I like Voltron. ;-;        callback: function {            $('#PFVoltron').prepend('! ');           $('.wikia-chiclet-button.boi').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', rvtoken: 'rollback', titles: wgPageName, rvprop: 'ids|flags|timestamp|user|userid|size|sha1|comment|parsedcomment|content|tags', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { var ug = mw.config.get("wgUserGroups"); if (ug.indexOf('sysop') + ug.indexOf('bureaucrat') + ug.indexOf('vstf') + ug.indexOf('staff') + ug.indexOf('helper') + ug.indexOf('rollback') + ug.indexOf('content-moderator') + ug.indexOf('threadmoderator') > -8) { var ds = new mw.Api; ds.post({                                   action: 'rollback',                                    user: r.query.pages[i].revisions[0].user,                                    title: wgPageName,                                    token: r.query.pages[i].revisions[0].rollbacktoken,                                }); } else { //Stuff var PFUndoUser = r.query.pages[i].revisions[0].user; for (PFUndoCode = 0,                               PDFUndo = 0; PFUndoUser === r.query.pages[i].revisions[0].user; PFUndoCode++,                                PDFUndo++) { //                	console.log(PFUndoCode) PFUndid = PDFUndo; if (PFUndoUser !== r.query.pages[i].revisions[PFUndoCode].user) { $.getJSON(wgServer + '/api.php?action=compare&fromtitle=' + wgPageName + '&torev=' + r.query.pages[i].revisions[PFUndoCode].revid + '&format=json', function(d) {                                           $.confirm({ title: "Ditto's Rollback :3", cancleMsg: "Nope", okMsg: "Understood", content: "You're reverting edits from " + r.query.pages[i].revisions[0].user + ' to ' + r.query.pages[i].revisions[PFUndid].user + '. ' + ' \ .modalWrapper{   width: 80%;\ left: 16%;\ height: auto;\ margin-left: -100px;\ top: 50px;\ z-index: 5001102;}.PFDiff .diff-addedline {\ background-color: rgba(90, 255, 90, 0.64) !important;\ }\ .PFDiff .diff-deletedline {\ background-color: rgba(255, 255, 0, 0.28) !important\ ;\ }\ .PFDiff .diff-content {\ width: 49%;\ }\ .PFDiff .diffchange {\ color: rgba(255, 0, 0, 0.59);\ font-weight: bold;\ text-decoration: none;\ white-space: pre-wrap;\ }\ .PFDiff td.diff-context {\ background-color: #f2f2f2;\ }\ .PFDiff .disabled {\ color: #888;\ }\ .PFDiff #previo,\ .PFDiff #nexted {\ color: orange;\ font-size: large;\ }\ .PFDiff div.center {\ text-align: center;\ }\ .PFDiff #DiffVi,\ .PFDiff #DiffPr {\ overflow: auto;\ } ' + ' ',                                               onOk: function { var ds; mw.loader.using('mediawiki.api').then(function {                                                       ds = new mw.Api;                                                        var API = new mw.Api;                                                        ds.post({ action: 'edit', title: wgPageName, text: r.query.pages[i].revisions[PFUndoCode]["*"], summary: 'Reverted edits by ' + r.query.pages[i].revisions[0].user + ' to ' + r.query.pages[i].revisions[PFUndid].user + ' using PageFormatter.', token: mw.user.tokens.values.editToken }).done(function { new BannerNotification('Successfully reverted edits. ;3','',4000).show; });                                                   });                                                    console.log(r.query.pages[i].revisions[PFUndoCode]["*"]); }                                           });                                            // console.log(d.compare["*"])                                        }); }                                   PFUndoUser = r.query.pages[i].revisions[PFUndoCode].user; }                           }                        }                    });                });            });            var ds;            $('.TempExtr').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'content', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { var AlterCleanText, finalPrompt; if ($('#CleanTextArea').val !== '') { AlterCleanText = $('#CleanTextArea').val; //This lets you select the thing, make sure the number's above 0. finalPrompt = parseInt(1); } else { AlterCleanText = r.query.pages[i].revisions[0]["*"]; var intialPrompt = prompt("There are " + AlterCleanText.match(/{{/gm).length + " templates in this page, which should I re-format?", "1"); //This lets you select the thing, make sure the number's above 0. finalPrompt = parseInt(intialPrompt); }                           var something = AlterCleanText.replace(/\=\"/gm, 'VzV"').replace(/ \| /gm, '\|').replace(/\| /gm, '\|').replace(/ /g, '_').replace(/ \| /gm, ' \| '); //replace(/\[N\]'); // Don't judge me with this. ;v; startingPoint = new RegExp(/\w*\W*\[*.\|*\]/,"gm"); // I learned a new thing. ^-^                           EndingPoint = something.match(startingPoint); // Had no idea it was that hard. if (EndingPoint != null) { for (i = 0; i < 90; i++) { pipetoReplace = '|' + EndingPoint[i]; pipeReplacedBy = 'XzX' + EndingPoint[i]; // Why not? ^-^                                   something = something.replace(pipetoReplace, pipeReplacedBy); }                           }                            var TemplateOneName = something.split("{{")[finalPrompt]; // Duh? var TemplateTwoName = TemplateOneName.split("|")[0]; // Getting the template's name with this. var initialContentOne = something.split("{{")[finalPrompt]; var initialContentTwo = initialContentOne.split("}}")[0]; var finalContent = initialContentTwo; //.replace(TemplateTwoName, ''); var stageOne = finalContent.replace(/\n/gm, '').replace(/\|/g, '\n|'); //.replace(/\n\n/gm, '\n'); var stageTwo = stageOne.split('\n'); lastNumber = 0; for (stem = 0; stem < stageTwo.length; stem++) { // This creates the spacing. stageThree = stageOne.split('\n')[stem].search("="); if (lastNumber < stageThree) { lastNumber = stageThree; // Stores the larges spaced equal sign. }                           }                            stageFour = stageOne.replace(/_=_/gm, '=').replace(/=/gm, ' = ').replace(/  /gm, ' ').replace(/\n/gm, '\n'), // This cleans the whole thing. stageSeven = [], stageNine = [], stageEleven = [], stageEight = [], stageEleven[0] = '', stageFifteen = '', stageFourteen = [], stageThirteen = '', stageSixteen = 0; for (boom = 1; boom < stageFour.split('\n').length; boom++) { // You may notice the stages? stageFive = stageFour.split('\n')[boom].search(" "); stageSix = lastNumber - stageFive - 1; // Removes one space because of stageFour. stageSeven[boom] = stageFour.split('\n')[boom].split('=')[1]; // This is the text after the equal sign. helpme = boom; // Second choice. stageFifteen = ''; // Resetter. I don't want more spaces. ;v; if (stageSix !== 0) { for (doom = 0; doom <= stageSix; doom++) { stageFifteen = ' ' + stageFifteen; // This is where the magic happens. }                               } else { stageFifteen = ' '; }                               stageNine[boom] = stageFour.split('\n')[boom].split('=')[0].replace(/ /gm, ''); stageEleven[boom] = stageNine[boom] + stageFifteen; plzhelp = boom + 1; helpme = boom; if (stageFour.split('\n')[boom].search('=') !== -1) { // If there's an equal sign. stageEight[helpme] = stageEleven[helpme].replace(/\n\n/gm, '\n') + '=' + stageSeven[helpme].replace(/ /gm, ' ') + '\n'; } else { //otherwise, ignore. stageEight[helpme] = stageFour.split('\n')[boom].replace(/\n\n/gm, '\n') + '\n'; }                           }                            stageTwelve = stageEight.join(''); //Join the entire array as a whole string. // Replaces my boi. for (stageTwelveBeta = 0; stageTwelveBeta < 90; stageTwelveBeta++) { stageNineteen = stageTwelve.replace(/undefined/gm, '').replace(/\n\n/gm, '\n').replace(/= /gm, '= ').replace(/=      /gm, '= ').replace(/=  /gm, '= ').replace(/=    /gm, '= ').replace(/=    /gm, '= ').replace(/=  /gm, '= ').replace(/=  /gm, '= ').replace(/_/gm, ' ').replace(/\=  /gm, '= '); // Cleans out any errors. }                           if (realpipeSpace == true) { //$.showCustomModal Cleansed = '{{' + TemplateTwoName + '\n' + stageNineteen.replace(/\n\|/gm, '\n \| ').replace(/\n\|/gm, '\n \| ').replace(/ \|  /gm, ' \| ').replace(/\_\|/gm, "|").replace(/\|/gm, " | ").replace(/  \|  /gm, " | ").replace(/XzX/gm, '\|').replace(/VzV/gm, '=').replace(/_/gm, ' ') + '}}'; $('#CleanTextArea').val(Cleansed.replace(/\n\n/gm, '\n').replace(/}}\n}}/gm, '}}')); // console.log('') new BannerNotification('Successfully extracted from ' + wgPageName,'confirm','',4000).show; } else { // console.log('') //$.showCustomModal Cleansed = ''; $('#CleanTextArea').val(Cleansed.replace(/\n\n/gm, '\n').replace(/}}\n}}/gm, '}}')); new BannerNotification('Successfully extracted from ' + wgPageName,'confirm','',4000).show; }                       }                    });                });            });            $('#ReversePF').on('click', function { if ($('#CleanTextArea').val !== '') { $('#PFHeaders').click; $('#PFSymbols').click; $('#PFReplace').click; } else { $.confirm({                       title: "Please:",                        content: "Type in something/Dump Content into the Textarea before using this command.",                        cancelMsg: "I'm outta here.",                        okMsg: "Sure thing."                    }); }           });            $('#SekretPF').on('click', function { if ($('#SekretPF').hasClass("Secretblue") === true) { $('.PFblue').addClass('PFRed').removeClass('PFblue'); $('#SekretPF').addClass('Secretred').removeClass('Secretblue'); } else { $('.PFRed').addClass('PFblue').removeClass('PFRed'); $('#SekretPF').addClass('Secretblue').removeClass('Secretred'); }           });            //     $('#reformHeads').on('click', function { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////           //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PFCleanse').on('click', function {                $('#CleanTextArea').val('');            }); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////           //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PFHeaders').on('click', function {                mw.loader.using('mediawiki.api').then(function { ds = new mw.Api; // Work around the api. var API = new mw.Api; ds.get({                       action: 'query',                        prop: 'revisions',                        titles: wgPageName,                        rvprop: 'content',                        rvlimit: 500,                        cb: new Date.getTime                    }).done(function(r) {                        for (var i in r.query.pages) {                            var AlterCleanText;                            if ($('#CleanTextArea').val !== '') {                                AlterCleanText = $('#CleanTextArea').val;                            } else {                                AlterCleanText = r.query.pages[i].revisions[0]["*"];                            }                            if (AlterCleanText.match(/=/gm) !== null) {                                if ($("#PFHeaders").hasClass("PFblue") === true) {                                    AlterCleanText = AlterCleanText.replace(/(^|\n)=(=*)([^=]+)\2=/g, function(_, s1, s2, s3) { return s1 + '=' + s2 + ' ' + s3.trim + ' ' + s2 + '='; });                               } else {                                    for (ei = 0; ei < 20; ei++) {                                        AlterCleanText = AlterCleanText.replace(/(^|\n)=(=*|=+)\s*([^=]+)\s* \2=/gm, '$1=$2$3$2=');                                    }                                }                            }                            var PFSpacer = new RegExp(/([\[\[]+)\1\W*(\w*)(_*)(\W*\w*)( *)(\w*|\W*)\w*([\]\]]*)/,"gm");                            if (AlterCleanText.match(PFSpacer) !== null) {                                if ($("#PFHeaders").hasClass("PFblue") === true) {                                    for (ei = 0; ei < AlterCleanText.match(PFSpacer).length; ei++) {                                        AlterCleanText = AlterCleanText.replace(AlterCleanText.match(PFSpacer)[ei], AlterCleanText.match(PFSpacer)[ei].replace(/_/gm, ' ')); }                               } else { for (ei = 0; ei < AlterCleanText.match(PFSpacer).length; ei++) { AlterCleanText = AlterCleanText.replace(AlterCleanText.match(PFSpacer)[ei], AlterCleanText.match(PFSpacer)[ei].replace(/_/gm, ' ')); }                               }                            }                            $('#CleanTextArea').val(AlterCleanText); }                   });                });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PFSymbols').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'content', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { var AlterCleanText, ColonText, ColonMatch; if ($('#CleanTextArea').val !== '') { AlterCleanText = $('#CleanTextArea').val; } else { AlterCleanText = r.query.pages[i].revisions[0]["*"]; }                           if ($('#PFSymbols').hasClass("PFblue") === true) { ColonText = new RegExp(/(^|\n)((?:\*|#|\:|;)+)\s*([^$\n]+)/gm); ColonMatch = AlterCleanText.match(ColonText); //        console.log(ColonMatch.length) if (AlterCleanText.match(ColonText) !== null) { for (ColonText = 0; ColonText < ColonMatch.length; ColonText++) { AlterCleanText = AlterCleanText.replace(/(^|\n)((?:\*|#|\:|;)+)\s*([^$\n]+)/g, '$1$2 $3'); }                               }                            } else { ColonText = new RegExp(/(^|\n)((?:\*|#|\:|;)+)\s*([^$\n]+)/gm); ColonMatch = AlterCleanText.match(ColonText); //        console.log(ColonMatch.length) if (AlterCleanText.match(ColonText) !== null) { for (ColonText = 0; ColonText < ColonMatch.length; ColonText++) { AlterCleanText = AlterCleanText.replace(/(^|\n)((?:\*|#|\:|;)+)\s*([^$\n]+)/g, '$1$2$3'); }                               }                            }                            $('#CleanTextArea').val(AlterCleanText); }                   });                });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PFReplace').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'content', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { var AlterCleanText; if ($('#CleanTextArea').val !== '') { AlterCleanText = $('#CleanTextArea').val; } else { AlterCleanText = r.query.pages[i].revisions[0]["*"]; }                           window.CP; CPfinal = window.CP || { :                            };                            if ($('#PFReplace').hasClass("PFblue") === true) { if (CPfinal !== '') { Object.getOwnPropertyNames(CPfinal).forEach(function(val, idx, array) {                                       AlterCleanText = AlterCleanText.replace(RegExp(val, "gm"), CPfinal[val]);                                    }); }                           } else { if (CPfinal !== '') { Object.getOwnPropertyNames(CPfinal).forEach(function(val, idx, array) {                                       AlterCleanText = AlterCleanText.replace(RegExp(CPfinal[val], "gm"), val);                                    }); }                           }                            $('#CleanTextArea').val(AlterCleanText); }                   });                });            });            //     https: //developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames.            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PFCustom').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'content', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { var AlterCleanText, PFCSTM, PFTSM; if ($('#CleanTextArea').val !== '') { AlterCleanText = $('#CleanTextArea').val; } else { AlterCleanText = r.query.pages[i].revisions[0]["*"]; }                           // I know I know, its okay. :3                           if ($('#PFCustom').hasClass("PFblue")) { PFCSTM = prompt("Variable?"); TSRF = new RegExp(PFCSTM,"gm"); PFTSM = prompt("Variable to be replaced by?"); $('#CleanTextArea').val($('#CleanTextArea').val.replace(TSRF, PFTSM)); } else { PFCSTM = prompt("Variable?"); TSRF = new RegExp(PFCSTM,"gm"); PFTSM = prompt("Variable to be replaced by?"); $('#CleanTextArea').val($('#CleanTextArea').val.replace(TSRF, PFTSM)); }                       }                    });                });            });            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PageDump').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'content', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { $('#CleanTextArea').val(r.query.pages[i].revisions[0]["*"]); new BannerNotification('Successfully extracted Content from ' + wgPageName,'confirm','',4000).show; }                   });                });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#SaveDump').on('click', function { var ds; mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    var API = new mw.Api;                    ds.post({ action: 'edit', title: wgPageName, text: $('#CleanTextArea').val, summary: 'Edited via Page Formatter Script.', token: mw.user.tokens.values.editToken }).done(function { new BannerNotification('Successfully Saved content to ' + wgPageName,'confirm','',4000).show; });               });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#AppendDump').on('click', function { var ds; mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    var API = new mw.Api;                    ds.post({ action: 'edit', title: wgPageName, appendtext: $('#CleanTextArea').val, summary: 'Edited via Page Formatter Script.', token: mw.user.tokens.values.editToken }).done(function { new BannerNotification('Successfully appended content to ' + wgPageName,'confirm','',4000).show; });               });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#PrependDump').on('click', function { var ds; mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    var API = new mw.Api;                    ds.post({ action: 'edit', title: wgPageName, prependtext: $('#CleanTextArea').val, summary: 'Edited via Page Formatter Script.', token: mw.user.tokens.values.editToken }).done(function { new BannerNotification('Successfully prepended content to ' + wgPageName,'confirm','',4000).show; });               });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#ChngPg').on('click', function { wgPageName = prompt("Which page would you like to edit to or Get Content from?"); new BannerNotification('Successfully changed editing to ' + wgPageName,'confirm','',4000).show; });           //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////            $('#GetPageData').on('click', function { mw.loader.using('mediawiki.api').then(function {                   ds = new mw.Api;                    // Work around the api.                    var API = new mw.Api;                    ds.get({ action: 'query', prop: 'revisions', titles: wgPageName, rvprop: 'ids|flags|timestamp|user|userid|size|sha1|comment|parsedcomment|content|tags', rvlimit: 500, cb: new Date.getTime }).done(function(r) { for (var i in r.query.pages) { //                                    console.log(r) $.getJSON(wgServer + '/api.php?action=compare&fromrev=' + r.query.pages[i].revisions[0].parentid + '&torev=' + r.query.pages[i].revisions[0].revid + '&format=json', function(d) {                               $.showCustomModal('', ' #PageLD td {\ border: 2px black groove;\ background: rgba(0, 0, 0, 0.08);\ box-shadow: 0px 0px 2px black;\ }#PageLD td:nth-of-type(1){\ text-align:center\ }.modalWrapper{width: 80% !important;\ margin-left: 9.2% !important;\ top: 3% !important;\ left: 0px !important;\ z-index: 5001104;}' + '.PFDiff .diff-addedline {\ background-color: rgba(90, 255, 90, 0.64) !important;\ }\ .PFDiff .diff-deletedline {\ background-color: rgba(255, 255, 0, 0.28) !important\ ;\ }\ .PFDiff .diff-content {\ width: 49%;\ }\ .PFDiff .diffchange {\ color: rgba(255, 0, 0, 0.59);\ font-weight: bold;\ text-decoration: none;\ white-space: pre-wrap;\ }\ .PFDiff td.diff-context {\ background-color: #f2f2f2;\ }\ .PFDiff .disabled {\ color: #888;\ }\ .PFDiff #previo,\ .PFDiff #nexted {\ color: orange;\ font-size: large;\ }\ .PFDiff div.center {\ text-align: center;\ }\ .PFDiff #DiffVi,\ .PFDiff #DiffPr {\ overflow: auto;\ }' + '  Page Details  ');                                new BannerNotification('Successfully loaded content from ' + wgPageName,'confirm','',4000).show;                            }); }                   });                });            });            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        }    }); }); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 * 1) PFVoltron {\
 * 1) SekretPF {\