Uzanto:ArnoLagrange/vector.js
Notu:Post publikigo forviŝu la kaŝmemoron de via foliumilo por vidi la ŝanĝojn.
- Firefox / Safari: Premu majuskligan klavon klakante Reŝarĝi, aŭ premu aŭ Stir-F5 aŭ Stir-R (⌘-R kun Makintoŝo)
- Google Chrome: Premu Stir-majuskligklavon-R (⌘-Majuskligklavo-R kun Makintoŝo)
- Interreta Esplorilo / Edge: Premu Stir klakante Refreŝu, aŭ premu Stir-F5
- Opera: Premu Stir-F5.
//<source lang="javascript">
/* La JavaSkriptaĵoj ĉi tie estos ŝarĝitaj nur por ĉi tiu uzanto sur ĉiu paĝo.
*/
/* <pre> <nowiki>
*/
/**
* Diverses fonctions manipulant les classes
* Utilise des expressions régulières et un cache pour de meilleures perfs
* isClass et whichClass depuis http://fr.wikibooks.org/w/index.php?title=MediaWiki:Common.js&oldid=140211
* hasClass, addClass, removeClass et eregReplace depuis http://drupal.org.in/doc/misc/drupal.js.source.html
* surveiller l'implémentation de .classList http://www.w3.org/TR/2008/WD-html5-diff-20080122/#htmlelement-extensions
*/
function isClass(element, classe) {
return hasClass(element, classe);
}
function whichClass(element, classes) {
var s=" "+element.className+" ";
for(var i=0;i<classes.length;i++)
if (s.indexOf(" "+classes[i]+" ")>=0) return i;
return -1;
}
function hasClass(node, className) {
if (node.className == className) {
return true;
}
var reg = new RegExp('(^| )'+ className +'($| )')
if (reg.test(node.className)) {
return true;
}
return false;
}
function addClass(node, className) {
if (hasClass(node, className)) {
return false;
}
node.className += ' '+ className;
return true;
}
function removeClass(node, className) {
if (!hasClass(node, className)) {
return false;
}
node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
return true;
}
function eregReplace(search, replace, subject) {
return subject.replace(new RegExp(search,'g'), replace);
}
/*
addCustomButton('http://upload.wikimedia.org/wikipedia/commons/f/fa/Button_bold_ukr.png','AL-subskribo','{{alss}} ~~~~~','','','mw-editbutton-signature');
*/
/** WikiMiniAtlas *******************************************************
*
* Priskribo: WikiMiniAtlas estas ŝprucanta alklakebla kaj tirebla mondmapo.
* La skripto estigas ke ĉiuj viaj koordinataj ligiloj montras la WikiMiniAtlas-ŝprucbutonon.
* La skripto mem estas lokita sur meta ĉar ĝi estas uzata de multaj projektoj.
* Vidu [[Meta:WikiMiniAtlas]] por plia informo.
* Kreita de : [[:en:User:Dschwen]]
*/
/*mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js');
*/
/* Füge Projektportal-Link hinzu */
function addPortal()
{
quickbar = document.getElementById('quickbar');
if (quickbar)
{
neues = document.createElement('a')
neues.href = '/wiki/Wikipedia:Portal'
neues.appendChild(document.createTextNode('Projektportal'))
quickbar.appendChild(neues)
}
}
$(addPortal);
/* Einige link-Tags hinzufügen */
head = document.getElementsByTagName('head')[0]
function verlinke(rel, href, title)
{
link = document.createElement('link')
link.rel = rel
link.href = '/wiki/' + href
link.title = title
head.appendChild(link)
}
if (head) /* sollte immer true ergeben, aber sicher ist sicher */
{
verlinke('start', 'Hauptseite', 'Hauptseite')
verlinke('help', 'Wikipedia:Handbuch', 'Handbuch')
verlinke('index', 'Spezial:Allpages', 'Index')
}
/* decodiere UTF8 (aus Selfhtml) */
function decode_utf8(utftext) {
var plaintext = ""; var i=0; var c=c1=c2=0;
// while-Schleife, weil einige Zeichen uebersprungen werden
while(i<utftext.length)
{
c = utftext.charCodeAt(i);
if (c<128) {
plaintext += String.fromCharCode(c);
i++;}
else if((c>191) && (c<224)) {
c2 = utftext.charCodeAt(i+1);
plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
i+=2;}
else {
c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
i+=3;}
}
return plaintext;
}
/* decodiere die codierten UTF8-Zeichen in Kapitel-Ankern */
function decodeanchor(anchorname)
{
var escaped = anchorname.replace(/\.([0-9A-F][0-9A-F])/g,"%$1");
return decode_utf8(unescape(escaped)).replace(/_/g,' ');
}
/* Füge Link-Tags fürs Inhaltsverzeichnis hinzu */
function addcontents()
{
var head = document.getElementsByTagName('head')[0];
var len = document.anchors.length
for (i = 0; i < len; ++i)
{
anchor = document.anchors[i];
link = document.createElement('link')
link.rel = 'chapter'
link.href = '#' + anchor.name;
link.title = decodeanchor(anchor.name);
head.appendChild(link)
}
}
$(addcontents);
//Bei Dschwen gefunden
// [[Benutzer:Dschwen/wikiminiatlas2.js]] - diese Zeile bitte mitkopieren
// mw.loader.load('//de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js');
// por la verdaj butonetoj laŭ hsbwp, plwp kaj ruwp resp. propra vikio
// mw.loader.load('//eo.wikipedia.org/w/index.php?title=Vikipediisto:Tlustulimu/butonetoj.js');
// Installe wikEd pour l'édition des pages (pour tous)
var wikEdDiffPreset = false;
var wikEdRegExTypoFix = true;
var wikEdRegExTypoFixURL = 'http://fr.wikipedia.org/wiki/Wikipédia:AutoWikiBrowser/Typos?action=raw';
// install the Esperanto translation for [[:en:User:Cacycle/wikEd]]
// instalas esperanto version por [[:en:User:Cacycle/wikEd]]
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:ArnoLagrange/wikEd-eo.js');
// install [[User:Cacycle/diff]] text diff code
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js');
// install [[User:Pilaf/Live_Preview]] page preview tool
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js');
//Aus der englischen Wikipedia von User:Cacycle
// install [[User:Cacycle/wikEd]] in-browser text editor
//mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js');
// [[:en:User:Lupin/popups.js]]
// Traduction de [[:fr:Utilisateur:Leag|Leag]] : [[:fr:Utilisateur:Leag/Navigation popups|Navigation popups]]
//mw.loader.load('//eo.wikipedia.org/w/index.php?title=Vikipediisto:ArnoLagrange/popups-strings-eo.js');
//mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js');
function moveEditsection() {
if (typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false) {
var spans = document.getElementsByTagName("span");
for(var i = 0; i < spans.length; i++) {
if(spans[i].className == "editsection") {
spans[i].style.fontSize = "x-small";
spans[i].style.fontWeight = "normal";
spans[i].style.cssFloat = "none";
spans[i].style.marginLeft = "0px";
spans[i].parentNode.appendChild(document.createTextNode(" "));
spans[i].parentNode.appendChild(spans[i]);
}
}
}
}
// onload
$(moveEditsection);
/** Dynamic Navigation Bars (experimental) *************************************
*
* Description: See [[Wikipedia:NavFrame]].
* Maintainers: UNMAINTAINED
*/
// set up the words in your language
var autoCollapse = 1
var collapseCaption = 'Kaŝi'
var expandCaption = 'Montri'
var Nav1igationBarHide = '[' + collapseCaption + ']';
var Nav1igationBarShow = '[' + expandCaption + ']';
// shows and hides content and picture (if available) of navigation bars
// Parameters:
// indexNav1igationBar: the index of navigation bar to be toggled
function toggleNav1igationBar(indexNav1igationBar)
{
var Nav1Toggle = document.getElementById("Nav1Toggle" + indexNav1igationBar);
var Nav1Frame = document.getElementById("Nav1Frame" + indexNav1igationBar);
if (!Nav1Frame || !Nav1Toggle) {
return false;
}
// if shown now
if (Nav1Toggle.firstChild.data == Nav1igationBarHide) {
for (var Nav1Child = Nav1Frame.firstChild; Nav1Child != null; Nav1Child = Nav1Child.nextSibling) {
if ( hasClass( Nav1Child, 'NavPic' ) ) {
Nav1Child.style.display = 'none';
}
if ( hasClass( Nav1Child, 'Nav1Content') ) {
Nav1Child.style.display = 'none';
}
}
Nav1Toggle.firstChild.data = Nav1igationBarShow;
// if hidden now
} else if (Nav1Toggle.firstChild.data == Nav1igationBarShow) {
for (var Nav1Child = Nav1Frame.firstChild; Nav1Child != null; Nav1Child = Nav1Child.nextSibling) {
if (hasClass(Nav1Child, 'NavPic')) {
Nav1Child.style.display = 'block';
}
if (hasClass(Nav1Child, 'Nav1Content')) {
Nav1Child.style.display = 'block';
}
}
Nav1Toggle.firstChild.data = Nav1igationBarHide;
}
}
// adds show/hide-button to navigation bars
function createNav1igationBarToggleButton()
{
var indexNav1igationBar = 0;
// iterate over all < div >-elements
var divs = document.getElementsByTagName("div");
for (var i = 0; Nav1Frame = divs[i]; i++) {
// if found a navigation bar
if (hasClass(Nav1Frame, "Nav1Frame")) {
indexNav1igationBar++;
var Nav1Toggle = document.createElement("a");
Nav1Toggle.className = 'Nav1Toggle';
Nav1Toggle.setAttribute('id', 'Nav1Toggle' + indexNav1igationBar);
Nav1Toggle.setAttribute('href', 'javascript:toggleNav1igationBar(' + indexNav1igationBar + ');');
var isCollapsed = hasClass( Nav1Frame, "collapsed" );
/*
* Check if any children are already hidden. This loop is here for backwards compatibility:
* the old way of making Nav1Frames start out collapsed was to manually add style="display:none"
* to all the NavPic/Nav1Content elements. Since this was bad for accessibility (no way to make
* the content visible without JavaScript support), the new recommended way is to add the class
* "collapsed" to the Nav1Frame itself, just like with collapsible tables.
*/
for (var Nav1Child = Nav1Frame.firstChild; Nav1Child != null && !isCollapsed; Nav1Child = Nav1Child.nextSibling) {
if ( hasClass( Nav1Child, 'NavPic' ) || hasClass( Nav1Child, 'Nav1Content' ) ) {
if ( Nav1Child.style.display == 'none' ) {
isCollapsed = true;
}
}
}
if (isCollapsed) {
for (var Nav1Child = Nav1Frame.firstChild; Nav1Child != null; Nav1Child = Nav1Child.nextSibling) {
if ( hasClass( Nav1Child, 'NavPic' ) || hasClass( Nav1Child, 'Nav1Content' ) ) {
Nav1Child.style.display = 'none';
}
}
}
var Nav1ToggleText = document.createTextNode(isCollapsed ? Nav1igationBarShow : Nav1igationBarHide);
Nav1Toggle.appendChild(Nav1ToggleText);
// Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
for(var j=0; j < Nav1Frame.childNodes.length; j++) {
if (hasClass(Nav1Frame.childNodes[j], "NavHead")) {
Nav1Frame.childNodes[j].appendChild(Nav1Toggle);
}
}
Nav1Frame.setAttribute('id', 'Nav1Frame' + indexNav1igationBar);
}
}
}
$( createNav1igationBarToggleButton );
// mw.loader.load('//eo.wikipedia.org/w/index.php?title=Vikipediisto:ArnoLagrange/cache.js');
/*
function toggleRevRatings(){
var FlaggedRevTag = document.getElementById('mw-revisiontag');
var SubDiv = document.getElementById('mw-revisionratings');
if (SubDiv.style.display == 'block'){
FlaggedRevTag.style.background = 'none';
SubDiv.style.display = 'none';
FlaggedRevTag.getElementsByTagName('b')[0].style.display = 'none';
}
else {
FlaggedRevTag.style.background = '#F9F9F9';
SubDiv.style.display = 'block';
FlaggedRevTag.getElementsByTagName('b')[0].style.display = 'inline';
}
}
$(toggleRevRatings);
*/
function removeFlaggedRevInfotext(){
var FlaggedRevTag = document.getElementById('mw-revisiontag');
if (FlaggedRevTag != null){
var TextNode = FlaggedRevTag.getElementsByTagName('b')[0];
if (TextNode != null) TextNode.style.display = 'none';
}
}
// addOnloadHook(removeFlaggedRevInfotext);
//mw.loader.load('//eo.wikipedia.org/w/index.php?title=Vikipediisto:ArnoLagrange/aliaj_projektoj.js');
/**
* Forŝovo de la geografiaj koordinatoj supre de la paĝo
*/
function moveCoord() {
var h1 = document.getElementsByTagName("h1")[0];
var coord = document.getElementById('coordinates');
if ( !coord || !h1 ) return;
coord.id = "coordinates-title";
h1.insertBefore(coord, h1.firstChild);
}
$(moveCoord);
/**
* Reskribo de titoloj
* prenita el [[:fr:Mediawiki:common.js]]
* Funkcio uzata de [[Ŝablono:Malsama titolo]]
*
* La funkcio serĉas strion kun formo
* <div id="RealTitleBanner">
* <span id="RealTitle">titolo</span>
* </div>
*
* elemento entenanta id="DisableRealTitle" malaktivigas la funkcion
*/
/* function rewritePageH1() {
var realTitleBanner = document.getElementById('RealTitleBanner');
if (realTitleBanner) {
if (!document.getElementById('DisableRealTitle')) {
var realTitle = document.getElementById('RealTitle');
var h1 = document.getElementById('firstHeading');
if(!h1) h1 = document.getElementsByTagName('h1')[0]; // Nostalgia, Standard
var realH1 = getTextContent(h1);
if (realTitle && h1) {
var titleText = realTitle.innerHTML;
if (titleText == '') h1.style.display = 'none';
else h1.innerHTML = titleText;
realTitleBanner.style.display = 'none';
if(wgNamespaceNumber==0 || wgNamespaceNumber==10) {
var avert = document.createElement('p')
avert.style.fontSize = '90%';
avert.innerHTML = 'Uzenda titolo por krei internan ligilon : <b>'+realH1+'</b>';
insertAfter(document.getElementById('content'),avert,h1);
}
}
}
}
}
addOnloadHook(rewritePageH1);
*/
function lanchuEksteranSkripton(url) {
headID = document.getElementsByTagName("head")[0];
newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = url;
headID.appendChild(newScript);
}
function aldonuLigilon() {
var cwarn = document.getElementById("bodyContent");
if(cwarn) {
cwarn.innerHTML = '<table width="85%" align="center" cellspacing="3" style="border: 1px solid #C0C090; background-color: #F8EABA; margin-bottom: 3px;"><tr><td align="center"><a href="http://epo.wikitrans.net/'+enkodigitaPaghnomo+'">Serĉu tiun ĉi artikolon en Wikitrans</a></td></tr></table>'+cwarn.innerHTML;
}
}
function petuArtikoltekston() {
lanchuEksteranSkripton('http://nlp.fi.muni.cz/~xblah/wikitrans/get.php?'+enkodigitaPaghnomo);
}
function transprenuWikiTrans() {
var adreso= 'http://gramtrans.com/gt/url/mediawiki.php?pair=eng2epo&lang=en&title='+enkodigitaPaghnomo;
var enteno = null;
var xhr_object;
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", adreso, false);
xhr_object.send(null);
if(xhr_object[vlr].readyState == 4) {enteno = xhr_object.responseText;}
var redaktujo= document.getElementById("wpTextbox1");
redaktujo.value=enteno ;
}
function modifuRedaktofenestron() {
ligiloLoko = document.getElementById('bodyContent').children[3];
ligiloLoko.innerHTML = ligiloLoko.innerHTML + '<p><a href="javascript:transprenuWikiTrans();">Transprenu tradukon el WikiTrans</a></p>';
}
function preparuPaghnomon(paghnomo, chuEnkondigi) {
enkodigitaPaghnomo = paghnomo.charAt(0).toLowerCase()+paghnomo.substring(1);
if(chuEnkondigi) enkodigitaPaghnomo = encodeURIComponent(enkodigitaPaghnomo);
}
var enkodigitaPaghnomo='';
if(wgAction == 'edit') {
// estas redaktata artikolo
preparuPaghnomon(wgPageName, true);
// addOnloadHook(modifuRedaktofenestron);
}
else if(wgIsArticle && wgNamespaceNumber==0) {
// petata estas artikolo el la baza nomspaco
preparuPaghnomon(wgPageName, true);
if(wgArticleId != 0) {
// la artikolo jam ekzistas
// addOnloadHook(aldonuLigilon);
}
else {
// la artikolo ankoraŭ ne ekzistas
// addOnloadHook(petuArtikoltekston);
}
}
else if(!wgIsArticle && wgCanonicalSpecialPageName=='Search') {
// petata estas serĉo
var regexS = "[\\?&]search=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if(results == null) alert('Okazis eraro.');
else preparuPaghnomon(results[1], false);
// addOnloadHook(petuArtikoltekston);
}
/* mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:ImageAnnotatorConfig.js');
*/
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
$( function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'miasubskribo': {
label: 'AL ss',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/7/7b/Tilde_button.PNG',
action: {
type: 'encapsulate',
options: {
pre: "\{\{alss\}\} ~~~~~"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'referenco': {
label: 'Referenco',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/3/34/Vector_toolbar_insert_reference_button.png',
action: {
type: 'encapsulate',
options: {
pre: "<ref>",
post: "</ref>"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'referencoj': {
label: 'Referencoj',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/8/8d/Wikieditor-references.png',
action: {
type: 'encapsulate',
options: {
pre: "==Notoj kaj referencoj==\n<references/>",
ownline: true
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'tteksto': {
label: 'T-Teksto',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/5/5e/Wikieditor-tt.png',
action: {
type: 'encapsulate',
options: {
pre: "<tt>",
post: "</tt>"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'kodo': {
label: 'Kodo',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/5/50/Vector_toolbar_italic_C_button.png',
action: {
type: 'encapsulate',
options: {
pre: "<code>",
post: "</code>"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'senformatateksto': {
label: 'Senformata teksto',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/8/81/Toolbaricon_justify-left.png',
action: {
type: 'encapsulate',
options: {
pre: "<pre>",
post: "</pre>"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'neinkluzivu': {
label: 'Ne inkuzivu',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/5/55/Toolbaricon_no_include.png',
action: {
type: 'encapsulate',
options: {
pre: "<noinclude>",
post: "</noinclude>"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'comment': {
label: 'Kaŝita komento',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/1/11/Toolbaricon_hiddencomment.png',
action: {
type: 'encapsulate',
options: {
pre: "<!-- ",
post: " -->"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'hline': {
label: 'Horizontala linio',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/b/b4/Toolbaricon_rule.png',
action: {
type: 'encapsulate',
options: {
pre: "----",
ownline: true
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'citiloj': {
label: 'Citiloj',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/a/ac/Norwegian_quote_sign.png',
action: {
type: 'encapsulate',
options: {
pre: "« ",
post: " »"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'kategorio': {
label: 'Kategorio',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/b/b0/Button_category02.png',
action: {
type: 'encapsulate',
options: {
pre: "\[\[Kategorio:",
post: "\]\]"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'ligilo': {
label: 'Interna ligilo',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/b/ba/Norwegian_link_sign.png',
action: {
type: 'encapsulate',
options: {
pre: "\[\[",
post: "\]\]"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'shablono': {
label: 'Ŝablono',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/2/20/Toolbaricon_transclude.png',
action: {
type: 'encapsulate',
options: {
pre: "\{\{",
post: "\}\}"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'citajho': {
label: 'Citaĵo',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/4/4e/Toolbaricon_quote.png',
action: {
type: 'encapsulate',
options: {
pre: "\{\{cquote|",
post: "\}\}"
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'size',
'tools': {
'strikethrough': {
label: 'Trastrekita',
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/6/6d/Vector_strikeout.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
}
}
} );
} );
}
var wma_settings =
{
enabled: true,
}
if (wgAction == "edit" || wgAction == "submit") {
var chapeligitaj = {
'C':'Ĉ', 'G':'Ĝ', 'H':'Ĥ', 'J':'Ĵ', 'S':'Ŝ', 'U':'Ŭ',
'c':'ĉ', 'g':'ĝ', 'h':'ĥ', 'j':'ĵ', 's':'ŝ', 'u':'ŭ'
};
var rx = /([cghjsu])(x+)/gi;
function dexigi (e) {
var txt = e.value;
e.value = txt.replace(rx, function (s, c, xs) {
if (xs.length % 2 == 1) {
c = chapeligitaj[c];
xs = xs.substr(1);
}
return c + xs.replace(/(x)x/gi, "$1");
});
}
function rexigi (e) {
e.value = e.value.replace(rx, function (s, c, xs) {
return c + xs.replace(/(.)/g, "$1x");
});
}
var tb = document.getElementById("wpTextbox1");
var su = document.getElementById("wpSummary");
if (tb) dexigi(tb);
if (su) dexigi(su);
function rexigi_tb_k_su () {
if (tb) rexigi(tb);
if (su) rexigi(su);
return true;
}
var form = tb.form;
if (form.addEventListener)
form.addEventListener('submit', rexigi_tb_k_su, false);
else if (form.attachEvent)
form.attachEvent('onsubmit', rexigi_tb_k_su);
else
form.onsubmit = rexigi_tb_k_su;
}
if (wgArticleId)
{
var my_short_url = wgScript + "?curid=" + wgArticleId + "&redirect=no";
var my_short_name = "ArticleId:" + wgArticleId;
mw.util.addPortletLink('p-cactions',my_short_url,my_short_name);
};
( function ( mw, $ ) {
var namespace = mw.config.get( 'wgCanonicalNamespace' );
if( namespace === '' ) {
var page = mw.config.get( 'wgTitle' );
} else {
var page = namespace + ':' + mw.config.get( 'wgTitle' );
}
$.ajax( {
url: '//www.wikidata.org/w/api.php',
data: {
'format': 'json',
'action': 'wbgetitems',
'sites': mw.config.get( 'wgDBname' ),
'titles': page,
'language': mw.config.get( 'wgPageContentLanguage' )
},
dataType: 'jsonp',
success: function( data ) {
if( data.success ) {
for( var i in data.items ) {
if( i != -1 ) {
mw.util.addPortletLink( 'p-tb', '//www.wikidata.org/wiki/' + data.items[i].title, 'Vikidatumoj' );
}
}
}
}
} );
} ( mediaWiki, jQuery ) );
/* http://www.wikidata.org/wiki/User:Yair_rand/WikidataInfo.js
*/
location.search.indexOf("printable=yes") == -1 && $(function ($) {
var translate = {
'en': {
notfound: "Wikidata item not found.",
intro: "Wikidata: ",
nolabel: "(No label)",
nodescription: "no description given",
aliases: "Aliases: ",
noaliases: "None"
},
'ca': {
notfound: "No s'ha trobat l'element de Wikidata.",
intro: "Wikidata: ",
nolabel: "(Cap etiqueta)",
nodescription: "cap descripció introduïda",
aliases: "Àlies: ",
noaliases: "Cap"
},
'eo': {
notfound: "Ero de Vikidatumoj ne trovita.",
intro: "Vikidatumoj: ",
nolabel: "(Nerniu etikedo)",
nodescription: "Neniu priskribo provizita",
aliases: "Alia nomo : ",
noaliases: "Neniu"
},
'fi': {
notfound: "Wikidata-nimikettä ei löydy.",
intro: "Wikidata: ",
nolabel: "(Ei otsikkoa)",
nodescription: "kuvausta ei lisätty",
aliases: "Aliakset: ",
noaliases: "ei ole"
},
'fr': {
notfound: "Élement de Wikidata non trouvé.",
intro: "Wikidata: ",
nolabel: "(Aucun label)",
nodescription: "Aucune description fournie",
aliases: "Alias : ",
noaliases: "Aucun"
},
'ilo': {
notfound: "Saan a nabirukan ti Wikidata a banag.",
intro: "Wikidata: ",
nolabel: "(Awan ti etiketa)",
nodescription: "awan ti deskripsion a naited",
aliases: "Sabali a nagan: ",
noaliases: "Awan"
},
'it': {
notfound: "Elemento di Wikidata non trovato.",
intro: "Wikidata: ",
nolabel: "(Nessuna etichetta)",
nodescription: "Nessuna descrizione fornita",
aliases: "Alias: ",
noaliases: "Nessuno"
},
'pl': {
notfound: "Brak elementu Wikidata.",
intro: "Wikidata: ",
nolabel: "(Brak etykiety)",
nodescription: "brak opisu",
aliases: "Inne nazwy: ",
noaliases: "Brak"
},
'ru': {
notfound: "Элемент Wikidata не найден.",
intro: "Wikidata: ",
nolabel: "(нет метки)",
nodescription: "нет описания",
aliases: "Синонимы: ",
noaliases: "нет"
}
}
var namespace = mw.config.get('wgPageName').split(":"),
lang = mw.config.get('wgPageContentLanguage'),
page = namespace.length === 1 ? mw.config.get('wgTitle') : namespace[0].replace(/_/g, ' ') + ':' + mw.config.get('wgTitle');
$.ajax({
url: '//www.wikidata.org/w/api.php',
data: {
'format': 'json',
'action': 'wbgetentities',
'sites': mw.config.get('wgDBname'),
'titles': page,
'props': 'info|labels|descriptions|aliases',
'languages': lang
},
dataType: 'jsonp',
success: function (data) {
if (data.success) {
var $d = $("<div>").appendTo("#contentSub"),
m = translate[ lang ] || translate.en;
for (var i in data.entities) {
if (i == -1) {
$d.append($("<a>").attr("href", "//www.wikidata.org/wiki/Special:CreateItem?site="+mw.config.get("wgDBname")+"&page="+page).text( m.notfound ))
} else {
var item = data.entities[i],
i = 0, aliases = [];
try {
for (; i < item.aliases[lang].length; i++) {
aliases.push(item.aliases[lang][i].value);
}
} catch (e) { }
$d.append($("<a>").attr("href", "//www.wikidata.org/wiki/" + item.title).text(m.intro + ( item.labels ? item.labels[lang].value : m.nolabel ) + " (" + item.title + ")"),$("<span>").text(", "),$("<i>").text(item.descriptions ? item.descriptions[lang].value : m.nodescription),$("<br>"),$("<span>").text(m.aliases + (aliases.join(", ") || m.noaliases)))
}
}
}
}
});
});
/*
$ ( function() { if (wgArticleId) mw.util.addPortletLink("p-tb", wgScript + "?curid=" + wgArticleId + ( ((wgNamespaceNumber == 24) && getParamValue('dataset')) ? "&dataset=" + getParamValue('dataset') : "" ) , "Short url", "t-curid", "Referenco uzanta ties artikolan identigilon "); } );
*/
/* </nowiki> </pre>*/
//</source>