کارن:Abdul hadi Jk/EditCounterOptIn.js
يادښت: د غوره توبونو د خوندي کولو وروسته، خپل د کتنمل (بروزر) ساتل شوې حافظه تازه کړی.د نور تفصيل لپاره د غځول په تنۍ کلېک وکړئ.
- فايرفاکس/ سفري: په دې کتنمل کې د Reload د ټکوهلو په وخت د Shift تڼۍ نيولې وساتی، او يا هم Ctrl-F5 يا Ctrl-Rتڼۍ کېښکاږۍ (په Apple Mac کمپيوټر باندې ⌘-R کېښکاږۍ)
- گووگل کروم: په دې کتنمل کې د Ctrl-Shift-R تڼۍ کېښکاږۍ (د مک لپاره ⌘-Shift-R)
- انټرنټ اېکسپلورر: په دې کتنمل کې د Refresh د ټکوهلو په وخت کې د Ctrl تڼۍ کېښکاږلې ونيسۍ، او يا هم د Ctrl-F5 تڼۍ کېښکاږۍ
- اوپرا: په دې کتنمل کې د خپل براوزر ساتل شوې حافظه پدې توگه سپينولی شی Tools→Preferences
لاسوند[جوړول]
سمونگران د دې کينډۍ په ازمونمخ (جوړول | هېنداره) او ازمونځايونه (جوړول) مخونو کې خپلې تجربې کولای شي. لطفا وېشنيزې د /لاسوند څېرمه مخ کې ورگډې کړئ. د دې مخ څېرمه مخونه. |
/* JavaScript i denne fila vil bli lastet for alle brukere på hver side. */
/* Test if an element has a certain class **************************************
*
* Description: Uses regular expressions and caching for better performance.
* Note that use of this function indicates that the code isnt up to date.
* Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
*/
var hasClass = (function () {
var reCache = {};
return function (element, className) {
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
};
})();
/**
* Description: Set classes according to specific categories.
* Maintainer:
*/
(function(mw, $, undefined){
var trans = {
'Europaveier' : 'roadsign',
'Stamveier' : 'roadsign',
'Riksveier' : 'roadsign'
}
var cats = mw.config.get('wgCategories');
var keep = [];
if (cats) {
for (var i=0, l=cats.length; i<l; i++)
if (trans[cats[i]])
keep.push(trans[cats[i]]);
if (keep.length) {
$(function(){
var body = $('body');
for (var i=0, l=keep.length; i<l; i++)
body.addClass(keep.pop());
});
}
}
})(mediaWiki, jQuery);
/**
* Description: Vis/skjul definerte seksjoner i linjekart
* Maintainer: BjørnN
*/
// TODO: Bør flyttes ut og starte på bakgrunn av kategori
mw.loader.load(mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=MediaWiki:Linjekart.js&action=raw&ctype=text/javascript');
/**
* Description: Multiple bilder i en enkelt frame
* Maintainer: BjørnN
*/
mw.loader.load(mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=MediaWiki:Multibilde.js&action=raw&ctype=text/javascript');
/** Navbox
* Description: Collapsible navigational boxes
* Note: Interim solution.
* Maintainer:
*/
mw.loader.load(mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=MediaWiki:Navbox.js&action=raw&ctype=text/javascript');
/** Infobokser
* Description: Vis/skjul, samt samle spesielt merkede bokser
* Note: Det er på vei en adskillig bedre løsning som standardfunksjonalitet
*/
mw.loader.load(mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=MediaWiki:Visskjul.js&action=raw&ctype=text/javascript');
/**
* Description: OpenStreetMap embedded inside articles
* Maintainers: [[User:Haros]]
* Note: this script uses text strings that must be passed as global variables
*/
mw.config.set('osm_proj_map','kart'); //"map" in project language
mw.config.set('osm_proj_lang','no'); //project language
mw.loader.load('https://meta.wikimedia.org/w/index.php?title=MediaWiki:OSM.js&action=raw&ctype=text/javascript');
/**
* Description: Move the set of links from a box at the bottom of the page to the siteSub at the top
* Maintainers:
*/
(function(){
$(function(){
var portlinks = $('#portlinks').html();
if (portlinks && portlinks.length) {
if (!window.matchMedia('print').matches) {
portlinks = portlinks.replace(/(?: | |\u00a0|\u000d|\x0d|\r|\u000a|\x0a|\n)*(?:·|·|\|)(?: | |\u00a0|\u000d|\x0d|\r|\u000a|\x0a|\n)*/g, ", ");
$('#siteSub').html(portlinks);
}
$('#portlinks').remove();
}
});
})();
/**
* Description: Reset align as float style in galleries.
* Note: This will be fixed in MW 1.19 if $wgHtml5 is enabled.
* Note: This is still not fixed. :(
* Maintainers: jeblad, sort of...
*/
mw.hook( 'wikipage.content' ).add(function( $content ) {
"use strict";
$('ul.gallery').each(function (i, el) {
var $e = $(el);
switch ($e.attr('align')) {
case 'gleft' :
case 'left' :
$e.css({
'float': 'left',
'clear': 'left',
'margin-left': 0,
'padding-left': 0
});
break;
case 'gright' :
case 'right' :
$e.css({
'float': 'right',
'clear': 'right',
'margin-right': 0,
'padding-right': 0
});
break;
case 'inherit' :
$e.css({
'float': 'inherit',
'clear': 'inherit' // scary...
});
break;
case 'none' :
$e.css({
'float': 'none'
});
break;
}
});
});
/**
* Description: Adapt multiple columns to the actual size of the bodyContent div.
* Maintainers:
*/
(function(mw, $) {
// counter for number of columns
var count = 0;
// width of the #bodyContent and its token
var widths = [
{ size : 450, name : 'multicol-xx-small' },
{ size : 700, name : 'multicol-x-small' },
{ size : 950, name : 'multicol-small' },
{ size : 1200, name : 'multicol-normal' },
{ size : 1500, name : 'multicol-large' },
{ size : 1800, name : 'multicol-x-large' },
{ size : 2100, name : 'multicol-xx-large' }
];
// selectors for default override of large lists
var selectors = [
'#bodyContent h2:has(#Referanser) + ol.large.references',
'#bodyContent h2:has(#Litteratur) + ul.large',
'#bodyContent h2:has(#Eksterne_lenker) + ul.large',
'#bodyContent h2:has(#Kilder) + ul.large',
'#bodyContent h2:has(#Se_ogs\\.C3\\.A5) + ul.large',
'#bodyContent h2:has(#Referanser) + ul.large',
'#bodyContent h2:has(#Litteratur) + ol.large',
'#bodyContent h2:has(#Eksterne_lenker) + ol.large',
'#bodyContent h2:has(#Kilder) + ol.large',
'#bodyContent h2:has(#Se_ogs\\.C3\\.A5) + ol.large'
];
// calculate number of columns and set its token
function calc() {
var found = 0;
var body = $('#bodyContent');
var width = body.width();
// remove any previous definitions
// this is necessary for resize to work
for (var i = 0; i<widths.length; i++)
body.removeClass(widths[i].name);
// if the width is to small we set a special token and exits
if (width < widths[0].size) {
body.addClass('multicol-xx-small');
body.addClass('multicol-verysmall');
return;
}
// test for increasing sizes and set the token
for (var i = 1; i<widths.length; i++) {
count++;
if (width < widths[i].size) {
body.addClass( widths[i].name);
found++;
break;
}
}
// if we didn't find a matching size we set a special token
if (!found) {
body.addClass('multicol-xx-large');
body.addClass('multicol-verylarge');
}
// unless we had a too smalll width we set a common token
body.addClass('multicol-all');
}
// set it all up
$(function() {
calc(); // only on ready
$(window).resize(calc); // only on resize
// identify large lists
count *= 2; // twice the number of columns
$('#bodyContent ol, #bodyContent ul').each(function(i, el) {
if (count < el.children.length) $(el).addClass('large');
});
// override for long lists in specific sections, add later
//$(selectors.join(',')).before('<div class="multicol" style="display:none"></div>');
});
})(mediaWiki, jQuery);
/**
* Description: Clean up the list of templates during ordinary article editing for base templates,
* that is those with a leading dollar ($) sign in the name
* Maintainers:
*/
(function(mw, $) {
if (mw.config.get( 'wgNamespaceNumber' ) != 10 && (mw.config.get( 'wgAction' ) == "edit" || mw.config.get( 'wgAction' ) == "submit")) {
try {
$(function() {
var used = $('.templatesUsed');
var expl = $('.mw-templatesUsedExplanation');
var links = used.find('> ul > li > a').filter('[href*=":$"], [href*="MediaWiki:"]');
if (links.length === 0) return;
links.parent().css('display', 'none');
expl.find('p').append(' (<a class="show-base-templates" href="#">Vis grunnmaler</a><a class="hide-base-templates" href="#">Skjul grunnmaler</a>)');
expl.find('a.hide-base-templates').css('display', 'none');
expl.find('a.show-base-templates').click(function(){
links.parent().css('display', 'list-item');
$(this).css('display', 'none');
$(this).parentsUntil('.mw-templatesUsedExplanation').find('.hide-base-templates').css('display', 'inline');
return false;
});
expl.find('a.hide-base-templates').click(function(){
links.parent().css('display', 'none');
$(this).css('display', 'none');
$(this).parentsUntil('.mw-templatesUsedExplanation').find('.show-base-templates').css('display', 'inline');
return false;
});
});
}
catch (e) {
// Woopsie, die without a notice
}
}
})(mediaWiki, jQuery);
/* Check if external link targets exists **************************************
*
* Description: Make external iw-links through stylyng and make them blue again if they exists
* Maintainers:
*
* Sjekker lenker inni et element merket med CSS-klassen "iwcheck".
* Opprinnelig laget for oversikter ála [[Samiske geografiske navn (Alta)]]
*/
(function(mw, $, undefined){
if (!mw.config.get( 'wgIsArticle' )) return;
// if (mw.config.get( 'wgNamespaceNumber' ) != 0) return;
if (!/^(view)$/.test(mw.config.get( 'wgAction' ))) return;
var found = 0;
for (var x in mw.config.get('wgCategories')) {
if (mw.config.get('wgCategories')[x] == 'IW-check' && ++found) break;
}
if (!found) return;
var api = '//%%.wikipedia.org/w/api.php';
var languages = { 'nn' : {}, 'se' : {}, 'sv' : {}, 'da' : {} };
var lang = 'no';
var numtitles = 50;
var maxtitles = 2000;
var query = {
'action': 'query',
'prop' : 'info',
'format': 'json',
'maxage': 15*60,
'smaxage': 60*60
};
$(function(){
var iwcheck = $('.iwcheck').find('a.extiw');
if (!iwcheck || !iwcheck.length) return;
for (var x in languages) {
languages[x].titles = {},
languages[x].found = 0
}
iwcheck.each(function(i, el){
if (el.title) {
var matches = el.title.match(/^(.*?):(.*)$/);
if (matches.length == 3 && languages[matches[1]] != undefined) {
languages[matches[1]].titles[matches[2]] = true;
languages[matches[1]].found++;
}
}
});
var plang = $('#p-lang');
for (var x in languages) {
if (!languages[x].found) continue;
if (x === lang) continue;
var a = [];
for (var y in languages[x].titles)
if (languages[x].titles[y]) a.push(y);
var a = a.slice(0, maxtitles);
for (var i = 0; i < a.length; i+=numtitles) {
var titles = a.slice(i, (i+numtitles<a.length ? i+numtitles : a.length)).join('|');
$.ajax({
url: api.replace(/%%/, x),
dataType: 'jsonp',
data: jQuery.extend({'titles': titles, requestid: x}, query),
cache: true,
context: document.body,
success: function(data, textStatus){
if (textStatus === null && textStatus != 'success') {
alert('Success, but with "' + textStatus + '"');
return;
}
// this shouldn't happen
if (!languages[data.requestid] && !languages[data.requestid].found) return;
var a = [];
for (var x in data.query.pages) {
if (x<0) continue;
if (languages[data.requestid].titles[data.query.pages[x].title])
a.push('[title="' + data.requestid + ':' + data.query.pages[x].title + '"]');
}
iwcheck.filter(a.join(',')).addClass('exist');
}
});
}
}
});
})(mediaWiki, jQuery);
/**
* Description: Modify parts of the toolbar to better suit this projects needs
* Maintainer:
*/
(function(mw, $, undefined) {
// function to build complete labels, just to get rid of some pesky errors
var label = function (msg, txt, before, after) {
var str = '';
if (before === undefined ? true : before) str += "{" + "{";
str += msg;
if (after === undefined ? true : after) str += "}" + "}";
if (txt) str += " – " + txt;
return str;
};
// function to build pre-parts of the templates, just to get rid of some pesky errors
var pre = function (msg, txt, before) {
var str = '';
if (before === undefined ? true : before) str += "{" + "{";
str += msg;
if (txt) str += txt;
return str;
};
// function to build peri-parts of the templates, just to get rid of some pesky errors
var peri = function (msg, txt, before, after) {
var str = '';
if (before === undefined ? true : before) str += "{" + "{";
str += msg;
if (txt) str += txt;
if (after === undefined ? true : after) str += "}" + "}";
return str;
};
// get timestamp for templates
var now = new Date();
var timestamp = now.getUTCFullYear()
+ '-' + (now.getUTCMonth()<9 ? '0' : '') + (now.getUTCMonth()+1)
+ '-' + (now.getUTCDate()<9 ? '0' : '') + now.getUTCDate();
// customization for the original toolbar
var customizeOrigToolbar = function () {
var buttons = [];
buttons.push({
id: "button-nbsp",
imageFile: "//upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png",
speedTip: "Non-breaking space",
tagOpen: " ",
tagClose: "",
sampleText: ""
});
buttons.push({
id: "button-redirect",
imageFile: "//upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
speedTip: "Omdirigering",
tagOpen: "#OMDIRIGERING [[",
tagClose: "]]",
sampleText: "Målside"
});
buttons.push({
id: "button-strike",
imageFile: "//upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
speedTip: "Overstreking",
tagOpen: "<s>",
tagClose: "</s>",
sampleText: "Overstreket tekst"
});
buttons.push({
id: "button-enter",
imageFile: "//upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png",
speedTip: "Linjeskift",
tagOpen: "<br />",
tagClose: "",
sampleText: ""
});
buttons.push({
id: "button_upper",
imageFile: "//upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png",
speedTip: "Hevet skrift",
tagOpen: "<sup>",
tagClose: "</sup>",
sampleText: "Hevet tekst"
});
buttons.push({
id: "button-lower",
imageFile: "//upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png",
speedTip: "Senket skrift",
tagOpen: "<sub>",
tagClose: "</sub>",
sampleText: "Senket tekst"
});
buttons.push({
id: "button-small",
imageFile: "//upload.wikimedia.org/wikipedia/en/5/58/Button_small.png",
speedTip: "Liten skrift",
tagOpen: "<small>",
tagClose: "</small>",
sampleText: "Liten skrift"
});
buttons.push({
id: "button-hide-comment",
imageFile: "//upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png",
speedTip: "Sett inn skjult tekst (vises kun i kildekoden)",
tagOpen: "<!-- ",
tagClose: " -->",
sampleText: "Skjult tekst"
});
buttons.push({
id: "button-gallery",
imageFile: "//upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png",
speedTip: "Sett inn bildegalleri",
tagOpen: "\n<gallery>\n",
tagClose: "\n</gallery>",
sampleText: "Image:Example.jpg|Bildetekst1\nImage:Example.jpg|Bildetekst2"
});
buttons.push({
id: "button-blockquote",
imageFile: "//upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
speedTip: "Siter tekst",
tagOpen: "{{Sitat|",
tagClose: "|kilde}}",
sampleText: "Legg inn sitatet her"
});
buttons.push({
id: "button-insert-table",
imageFile: "//upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png",
speedTip: "Sett inn tabell",
tagOpen: '{| class="wikitable"\n|-\n',
tagClose: "\n|}",
sampleText: "! overskrift 1\n! overskrift 2\n! overskrift 3\n|-\n| rad 1, celle 1\n| rad 1, celle 2\n| rad 1, celle 3\n|-\n| rad 2, celle 1\n| rad 2, celle 2\n| rad 2, celle 3"
});
buttons.push({
id: "button-latinas",
imageFile: "//upload.wikimedia.org/wikipedia/commons/2/26/Button_latinas.png",
speedTip: "Sett inn «»",
tagOpen: "«",
tagClose: "»",
sampleText: "utsagn"
});
buttons.push({
id: "button-ref",
imageFile: "//upload.wikimedia.org/wikipedia/commons/2/2b/Button_ref_inscription.png",
speedTip: "Sett inn <ref></ref>",
tagOpen: "<ref>",
tagClose: "</ref>",
sampleText: "referanse"
});
for (var i = 0; i < buttons.length; i++) {
mw.toolbar.addButton(
buttons[i].imageFile,
buttons[i].speedTip,
buttons[i].tagOpen,
buttons[i].tagClose,
buttons[i].sampleText,
buttons[i].id,
buttons[i].id
);
}
};
// customization for the beta toolbar
var customizeBetaToolbar = function () {
// Add button for inserting guillemets (popular feature of old toolbar)
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'quote': {
label: 'Anførselstegn',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/a/ac/Norwegian_quote_sign.png',
action: {
type: 'encapsulate',
options: {
pre: "«",
//peri: "«»",
post: "»"
}
}
}
}
});
// Add button for inserting double square brackets (popular feature of old toolbar)
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'link': {
label: 'Lenkeparenteser',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/Norwegian_link_sign.png',
action: {
type: 'encapsulate',
options: {
pre: "[[",
//peri: "[[]]",
post: "]]"
}
}
}
}
});
// Add button for inserting double curly brackets
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'link': {
label: 'Malparenteser',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Norwegian_template_sign.png',
action: {
type: 'encapsulate',
options: {
pre: "{{",
//peri: "{{}}",
post: "}}"
}
}
}
}
});
// Add button for inserting strikethrough
// https://no.wikipedia.org/wiki/MediaWiki-diskusjon:Common.js#Strikethrough
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'strikethrough': {
label: 'Gjennomstrykning',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/f/f9/Toolbaricon_regular_S_stroke.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
//peri: "<s> </s>",
post: "</s>"
}
}
}
}
});
// add an article mark menu in the advanced section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
groups: {
'heading': {
tools: {
'heading': {
label: 'ساتنه',
type: 'select',
list: {
'template-neutral' : {
label: label('Nøytralitet', 'ليکنه اسانه استازیتوب نه لري'),
action: {
type: 'encapsulate',
options: {
pre: pre('Nøytralitet', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-verifiable' : {
label: label('Verifiserbar', 'ليکنه د اعتبار وړ نه ده'),
action: {
type: 'encapsulate',
options: {
pre: pre('Verifiserbar', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-research' : {
label: label('Forskning', 'په دي ليکنه کې اصلي څېړنه شامله ده'),
action: {
type: 'encapsulate',
options: {
pre: pre('Forskning', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-accuracy' : {
label: label('Nøyaktighet', 'ليکنه دقیق استازیتوب نلري'),
action: {
type: 'encapsulate',
options: {
pre: pre('Nøyaktighet', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-spelling' : {
label: label('Språkvask', 'د ليکنې ژبه بیاکتنې ته اړتیا لري'),
action: {
type: 'encapsulate',
options: {
pre: pre('Språkvask', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-format' : {
label: label('Formatering', 'ليکنه معياري کولو ته اړتیا لري'),
action: {
type: 'encapsulate',
options: {
pre: pre('Formatering', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
},
'template-workinprogress' : {
label: label('Arbeid pågår', 'ليکنه تر کار لاندې ده'),
action: {
type: 'encapsulate',
options: {
pre: pre('Arbeid pågår', '|ts=' + timestamp + '|'),
post: '}}',
ownline: false
}
}
}
}
}
}
}
}
});
// add a template menu in the advanced sectionined' ) {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
groups: {
'heading': {
tools: {
'heading': {
label: 'کينډۍ',
type: 'select',
list: {
'template-columns' : {
label: label('kolonner', 'etterfølgende liste fordeles over flere kolonner'),
action: {
type: 'encapsulate',
options: {
pre: pre('kolonner', '|'),
//peri: peri('columns'),
post: '}}',
ownline: true
}
}
},
'template-sorted-columns' : {
label: label('sorterte kolonner', 'etterfølgende liste fordeles over flere sorterbare kolonner'),
action: {
type: 'encapsulate',
options: {
pre: pre('sorterte kolonner', '|tittel='),
//peri: peri('columns'),
post: '}}',
ownline: true
}
}
},
'template-nowrap' : {
label: label('nowrap', 'hindre linjeskift i tekst og tall'),
action: {
type: 'encapsulate',
options: {
pre: pre('nowrap', '|'),
post: '}}',
ownline: false
}
}
},
'template-formatnum' : {
label: label('formatnum', 'tall med mellomrom og desimalkomma'),
action: {
type: 'encapsulate',
options: {
pre: pre('formatnum', ':'),
post: '}}',
ownline: false
}
}
},
'template-defaultsort' : {
label: label('STANDARDSORTERING', 'sortering på etternavn og lignende'),
action: {
type: 'encapsulate',
options: {
pre: pre('STANDARDSORTERING', ':'),
post: '}}',
ownline: false
}
}
}
}
}
}
}
}
});
// add a titles menu in the advanced section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
groups: {
'heading': {
tools: {
'heading': {
label: 'سرليکونه',
type: 'select',
list: {
'titles-see-also' : {
label: '== Se også == – interne lenker til andre prosjekter',
action: {
type: 'encapsulate',
options: {
pre: '== Se også ==',
ownline: true
}
}
},
'titles-notes' : {
label: '== Noter == – oppgitte noter i teksten',
action: {
type: 'encapsulate',
options: {
pre: "== Noter ==\n<references group='note'/>\n",
ownline: true
}
}
},
'titles-references' : {
label: '== Referanser == – oppgitte referanser i teksten',
action: {
type: 'encapsulate',
options: {
pre: "== Referanser ==\n<references />\n",
ownline: true
}
}
},
'titles-literature' : {
label: '== Litteratur == – oppgitt litteratur',
action: {
type: 'encapsulate',
options: {
pre: '== Litteratur ==',
ownline: true
}
}
},
'titles-links' : {
label: '== Eksterne lenker == – lenker til nettsteder',
action: {
type: 'encapsulate',
options: {
pre: "== Eksterne lenker ==\n* {{Offisielt nettsted}}\n",
ownline: true
}
}
}
}
}
}
}
}
});
};
/* Check if we are in edit mode and the required modules are available and then customize the toolbar */
if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor', function () {
$(customizeBetaToolbar);
});
}
else {
$(customizeOrigToolbar);
}
});
}
})(mediaWiki, jQuery);
// Code to set class reflecting number of children for each parent in references
// © John Erling Blad, Creative Commons by Attribution 3.0
(function(){
"use strict";
var $references = $( '#mw-content-text' ).find( '.references' );
$references.each( function(){
var $ol = $(this);
$ol.addClass('has-' + $ol.children('li').length + '-children');
});
}());
/**
* Collation sequence for Norwegian.
* Note that æ, ø, and å are reordered.
* For jquery.tablesorter.js
*/
mw.config.set( 'tableSorterCollation', {
'Æ' : 'Å',
'Ø' : 'Æ',
'Å' : 'Ø',
'Ä' : 'Å',
'Ö' : 'Æ',
'Ü' : 'Y',
'Þ' : 'Th',
'æ' : 'å',
'ø' : 'æ',
'å' : 'ø',
'ä' : 'å',
'ö' : 'æ',
'ü' : 'y',
'þ' : 'th'
} );