User:Microsoft for POTUS/vector.js/icu.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes.
- Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
- Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
- Opera, Konqueror and Safari users can just click the Reload button.
- Chrome: press Ctrl+F5 or Shift+F5
(mw.config.values.wgUserGroups.includes("extendedconfirmed")||mw.config.values.wgUserGroups.includes("rollback")||mw.config.values.wgUserGroups.includes("sysop"))&&0==document.querySelectorAll("#ca-icu").length&&-1!=mw.config.values.wgNamespaceNumber&&mw.loader.using("oojs-ui-core").done(function(){0==document.querySelectorAll("#ca-icu").length&&$(function(){var e=new OO.ui.DropdownWidget({label:"Select an option",menu:{items:[new OO.ui.MenuOptionWidget({data:"random",label:"The truth is funnier than nonsense"}),new OO.ui.MenuOptionWidget({data:"format",label:"Very poorly formatted"}),new OO.ui.MenuOptionWidget({data:"short",label:"Very short"}),new OO.ui.MenuOptionWidget({data:"notfunny",label:"Not funny"}),new OO.ui.MenuOptionWidget({data:"list",label:"Random lists are not funny"}),new OO.ui.MenuOptionWidget({data:"encyclopedic",label:"This does not look like an article parodying Wikipedia"})]}});itemSelected=function(e){swal.close(),loadingDialog=document.createElement("p"),loadingDialog.innerHTML='<span style="margin-right:8px;"><img src="https://images.uncyclomedia.co/uncyclopedia/en/4/42/Loading.gif"></span><span>Adding template...</span>',swal({content:loadingDialog,buttons:{}}),(new mw.Api).edit(mw.config.values.wgPageName,function(n){return{text:n.content+`{{ICU|${atob("fn5+fn4=")}|sub=${e.data}}}`,summary:"Adding an [[ICU]] tag",minor:!0}}).then(function(){swal("Done. Would you like to refresh this page?",{buttons:{yes:"Yes",no:"No"}}).then(function(e){"yes"==e&&location.reload()})})},e.getMenu().on("select",itemSelected),icuActionButton=document.createElement("li"),icuActionButton.innerHTML='<a title="Mark for ICU">Mark for ICU</a>',icuActionButton.id="ca-icu",icuActionButton.onclick=function(){swal({text:"Select a reason from the dropdown to add an ICU tag, or press cancel to cancel and close the dialog",content:e.$element[0],buttons:{cancel:!0,confirm:!1}})},0==document.querySelectorAll("#ca-icu").length&&document.querySelector("#p-cactions > .body.vector-menu-content > .menu.vector-menu-content-list").append(icuActionButton)})});