Revision 139987 of "User:PerfektesChaos/js/WikiSyntaxTextMod/dX.js" on testwiki/// PerfektesChaos/js/WikisyntaxTextMod/?X.js /// 2012-07-28 [email protected] /// Fingerprint: #0#0# /// <nowiki> /* jshint curly:true, latedef:true, laxbreak:true, trailing:true, undef:true, white:false */ /* global jQuery: true, mw: true, mediaWiki: false, window: false */ /*jslint plusplus: true, regexp: true, sloppy: true, unparam: true, vars: true, white: true, maxerr: 50 */ /*globals jQuery: true, mw: true, mediaWiki: false, window: false */ if (typeof(mediaWiki) !== "object") { // disconnected mw = { libs: { }, log: function () {} }; jQuery = {}; } if (typeof(mw.libs.WikiSyntaxTextMod) !== "object") { // isolated mw.libs.WikiSyntaxTextMod = { debugging: false }; } if (typeof(mw.libs.WikiSyntaxTextMod.X) !== "object") { mw.libs.WikiSyntaxTextMod.X = { }; } mw.libs.WikiSyntaxTextMod.X.vsn = -5.011; if (typeof(mw.libs.WikiSyntaxTextMod.bb) !== "object") { mw.libs.WikiSyntaxTextMod.bb = { }; } if (typeof(mw.libs.WikiSyntaxTextMod.main) !== "object") { mw.libs.WikiSyntaxTextMod.main = { }; } // Requires: JavaScript 1.5 RegExp non-capturing parenthese // mw.log(WSTM.debugging,"",0); //----------------------------------------------------------------------- mw.libs.WikiSyntaxTextMod.bb.chrX = function (WSTM) { if (typeof(WSTM.w) !== "object") { WSTM.w = { }; } if (typeof(WSTM.w.chr) !== "object") { WSTM.w.chr = { detected: { ampersand: false, exchange: 0, nbHyphen: false, ordMasc: false, tab: false, tabEOL: false, white: false }, re: { } }; } }; // .bb.chrX() mw.libs.WikiSyntaxTextMod.bb.chrX(mw.libs.WikiSyntaxTextMod); delete mw.libs.WikiSyntaxTextMod.bb.chrX; //----------------------------------------------------------------------- mw.libs.WikiSyntaxTextMod.bb.linkX = function (WSTM) { // Analysis of link -- web and wiki // 2012-05-18 [email protected] if (typeof(WSTM.w.link) !== "object") { WSTM.w.link = { wiki: { }, web: { } }; } }; // .bb.linkX() mw.libs.WikiSyntaxTextMod.bb.linkX(mw.libs.WikiSyntaxTextMod); delete mw.libs.WikiSyntaxTextMod.bb.linkX; //----------------------------------------------------------------------- /* mw.libs.WikiSyntaxTextMod.w.polish.strong = function () { // Remove superfluous ''' from headlines // Postcondition: // stringDOM_Nodelist Nodes are modified where suitable. // RegExp was used. // Uses: // >< .tx.tree // stringDOM_Nodelist:: // .find() // .getNode() // .modify() // Requires: JavaScript 1.3 charCodeAt() // 2011-12-31 [email protected] with (mw.libs.WikiSyntaxTextMod) { var i; var join; var keep; var node; var reHead = false; var reLine = new RegExp("\n=+.*'''.*= *\n", "g"); var store; var target = [reLine, 0]; var bold = tx.tree.find(target, 0, 0); while (bold) { store = bold[2].substr(1); join = store.length; if (store.charCodeAt(0) === 61) { // '=' if (! reHead) { reHead = new RegExp("^(==+)[^=\n].+[^=\n]\\1 *\n", ""); } if (! reHead.test(store)) { store = false; } } if (store) { i = store.indexOf("'''"); node = tx.tree.getNode(bold[1]); keep = bold[0] - node.beg + 1; while (i >= 0) { store = (i > 0 ? store.substr(0, i) : "") + store.substr(i + 3); i = store.indexOf("'''"); } // while node.modify(keep, store, keep + join); join = store.length; } bold = tx.tree.find(target, bold[0] + join, bold[1]); } // while bold } // with WSTM }; // .w.polish.strong() */ //----------------------------------------------------------------------- mw.libs.WikiSyntaxTextMod.bb.X = function (jQuery, mw, WSTM) { var VorlageBBKL = [ [false, "1", false], [/autor/i, "autor", true], [/artikel/i, "artikel", true], [/band/i, "band", true], [/spalten/i, "spalten", false], [/spalte/i, "spalte", false] ]; if (WSTM.config) { if (! WSTM.config.mod) { WSTM.config.mod = { }; } if (typeof(WSTM.config.mod.template) !== "object") { WSTM.config.mod.template = [ { detect: { title: "^[Ii]nfobox Autobahn$" }, rename: { title: [true, "Infobox hochrangige Straße"] } }, { detect: { title: "[Bb]BKL" }, rename: { title: [true, "BBKL"], params: VorlageBBKL }, order: VorlageBBKL, style: { linebreak: false, leap: false, leave: false, later: false, lastline: false } } ]; } } // Start on import: callback to waiting ... if (typeof(WSTM.main.wait) === "function") { WSTM.main.wait("X", WSTM.X.vsn); } }; mw.libs.WikiSyntaxTextMod.bb.X(jQuery, mw, mw.libs.WikiSyntaxTextMod); // Emacs // Local Variables: // encoding: iso-8859-1-dos // fill-column: 80 // End: /// EOF </nowiki> WikiSyntaxTextMod/?X.js All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://test.wikipedia.org/w/index.php?oldid=139987.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|