User:WikiGregory/common.js

/** * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see https://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/TemplateScript * @update-token */ /* // $.getScript('https://raw.github.com/pathoschild/wikimedia-contrib/master/pathoschild.templatescript.js', function {       pathoschild.TemplateScript.Add([ { name: 'welcome', template: ' ~', position: 'after', editSummary: 'welcome!', forNamespaces: 3, forActions: 'edit' }, // add your own templates or scripts here ]); }); //

/** * Regex menu framework adds a sidebar menu of user-defined scripts. * @see https://github.com/Pathoschild/Wikimedia-contrib#readme * @update-token */ $.getScript('//meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript'); function rmflinks { regexTool('Custom regex','custom'); // a default tool which performs regex input in a dynamic form regexTool('Change WP txt to WQ','wp2wq'); // a default tool which performs regex case insensitive change Wikipedia (and WP:) to WikiQueer (and WQ:) regexTool('Save WP txt to WQ','wp2wqsave'); // a default tool which performs regex case insensitive change Wikipedia (and WP:) to WikiQueer (and WQ:) then saves } /* Case insensitive change Wikipedia (and WP:) to WikiQueer (and WQ:) */ function wp2wq { regex(/en\.wikipedia\.org\/w\//gi,'www.wikiqueer.org/'); regex(/en\.wikipedia\.org\/wiki\//gi,'www.wikiqueer.org/w/'); regex(/Wikipedian/gi,'WikiQueerian'); regex(/Wikipedia/gi,'WikiQueer'); regex(/WP:/gi,'WQ:'); } /* Case insensitive change Wikipedia (and WP:) to WikiQueer (and WQ:) then save */ function wp2wqsave { regex(/en\.wikipedia\.org\/w\//gi,'www.wikiqueer.org/'); regex(/en\.wikipedia\.org\/wiki\//gi,'www.wikiqueer.org/w/'); regex(/Wikipedian/gi,'WikiQueerian'); regex(/Wikipedia/gi,'WikiQueer'); regex(/WP:/gi,'WQ:'); doaction('save'); }