User:Njardarlogar/common.js

/* Make x preload options appear just below the article title in the main namespace */

var namespace = mw.config.get('wgNamespaceNumber') var id = mw.config.get('wgArticleId') var title = mw.config.get('wgTitle')

var common = "//en.wiktionary.org/w/index.php?title="+title+"&action=edit&preload=User:Njardarlogar/preload-" var $d = $(" ").appendTo("#contentSub") $d.append($("").attr("href", "//en.wiktionary.org/w/index.php?title=Special:Watchlist&hidebots=1").text("watch-nobots"))

if (namespace == 0 && !(id)) {  $d.append(" | Preloads: ") $d.append($("").attr("href", common + "adverb").text("adverb")) $d.append(" · ") $d.append($("").attr("href", common + "adjective").text("adjective")) $d.append(" ") $d.append($("").attr("href", common + "adjective-adverb").text("+adv")) $d.append(" · ") $d.append($("").attr("href", common + "noun").text("noun")) $d.append(" (") $d.append($("").attr("href", common + "noun-compound").text("comp"))  $d.append(") ") $d.append(" · ") $d.append($("").attr("href", common + "verb").text("verb")) $d.append(" (") $d.append($("").attr("href", common + "verb-compound").text("comp"))  $d.append(") · ") $d.append($("").attr("href", common + "alternative").text("alt")) $d.append(" | ") $d.append($("").attr("href", "http://www.nob-ordbok.uio.no/perl/ordbok.cgi?OPP=" + title + "&nynorsk=+&ordbok=nynorsk").text("dict")) } else if (namespace == 0) { 	var common = "//en.wiktionary.org/w/index.php?title="+title+"00000"+"&action=edit&preload=User:Njardarlogar/preload-" $d.append(" | Preloads (new section): ") $d.append($("").attr("href", common + "adverb").text("adverb")) $d.append(" · ") $d.append($("").attr("href", common + "adjective").text("adjective")) $d.append(" · ") $d.append($("").attr("href", common + "noun").text("noun")) $d.append(" · ") $d.append($("").attr("href", common + "verb").text("verb")) $d.append(" · ") $d.append($("").attr("href", common + "common").text("common")) $d.append(" · ") $d.append($("").attr("href", common + "alternative").text("alt")) $d.append(" | ") $d.append($("<a>").attr("href", "http://www.nob-ordbok.uio.no/perl/ordbok.cgi?OPP=" + title + "&nynorsk=+&ordbok=nynorsk").text("dict")) }