MediaWiki:Gadget-legacy.js

Da Wikisionario

Ocio: Daspò ver salvà, podaria esare neçesario snetare ła cache dal propio navegadore web par vedare i canbiamenti.

  • Firefox / Safari: tegner strucà el boton de łe letare grande Shift e schiciare sora Ricarga, o se nò struca Ctrl-F5 o Ctrl-R (⌘-R so Mac)
  • Google Chrome: strucare Ctrl-Shift-R (⌘-Shift-R so on Mac)
  • Internet Explorer / Edge: tegner strucà el boton Ctrl e schiciare so Ajorna, o sinò Ctrl-F5
  • Opera: Va in tel Menu → Inpostasion (Opera → Prefarense so on Mac) e pò in Privacy & sicuresa → Sneta dati del navegadore → Imajini e file in te ła cache.
/** LegacyScripts **/
/*jshint maxerr:1048576, strict:true, undef:true, latedef:true, es5:true */
/*global mw, jQuery, importScript, importScriptURI, $ */

/* ===importScript=== */

/**
 * do NOT use this function
 **/
var importScriptFromWikibits = window.importScript;
window.importScript = function (page, wiki, oldid) {
	if (!wiki && !oldid) return importScriptFromWikibits(page);
	
	mw.log.warn("importScript called with more than one argument. This is deprecated and may be unreliable. Please use mw.loader.load directly");
	var url = (wiki ? encodeURIComponent(wiki) : mw.config.get('wgScript')) + '?title=' +
		mw.util.wikiUrlencode(page) +
		(oldid ? '&oldid=' + encodeURIComponent(oldid) : '') +
		'&action=raw&ctype=text/javascript';
	return importScriptURI(url);
};

/* === DOM creation === */
// Original: en:MediaWiki:Gadget-LegacyScriptsNewNode.js
// this script is deprecated do not use newNode function! use jQuery instead

/**
 * Create a new DOM node for the current document.
 *    Basic usage:
 *        var mySpan = newNode('span', "Hello World!")
 *    Supports attributes and event handlers:
 *        var mySpan = newNode('span', {style:"color: red", focus: function(){alert(this)}, id:"hello"}, "World, Hello!")
 *    Also allows nesting to create trees:
 *        var myPar = newNode('p', newNode('b',{style:"color: blue"},"Hello"), mySpan)
 **/

var newNode = window.newNode = function newNode(tagname) {
	var node = document.createElement(tagname);

	for (var i = 1; i < arguments.length; i++) {
		var argument = arguments[i];
		if (typeof argument == 'string') { //Text
			node.appendChild(document.createTextNode(argument));
		} else if (typeof argument == 'object') {
			if (argument instanceof Node) { // If it is a DOM Node
				node.appendChild(argument);
			} else { // Attributes (hopefully)
				for (var j in argument) {
					if (j === 'class') { // Classname different because...
						node.className = argument[j];
					} else if (j == 'style') { // Style is special
						node.style.cssText = argument[j];
					} else if (typeof argument[j] == 'function') { // Basic event handlers
						node.addEventListener(j, argument[j], false);
					} else {
						node.setAttribute(j, argument[j]); //Normal attributes
					}
				}
			}
		}
	}
 
	return node;
};

/* ===Cookies=== */

window.setCookie = function setCookie(cookieName, cookieValue) {
	/*global escape */
	mw.log.warn("deprecated function setCookie called; use jQuery.cookie instead");
	var today = new Date();
	var expire = new Date();
	var nDays = 30;
	expire.setTime(today.getTime() + (3600000 * 24 * nDays));
	document.cookie = cookieName + "=" + escape(cookieValue) +
		";path=/" +
		";expires=" + expire.toGMTString();
};

window.getCookie = function getCookie(cookieName) {
	/*global unescape */
	mw.log.warn("deprecated function getCookie called; use jQuery.cookie instead");

	cookieName = String(cookieName);
	var start = document.cookie.indexOf(cookieName + "=");
	if (start === -1) return "";
	var len = start + cookieName.length + 1;
	if ((!start) && (cookieName !== document.cookie.substring(0, cookieName.length)))
		return "";
	var end = document.cookie.indexOf(";", len);
	if (end === -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len, end));
};

//Formulari per a entrades noves
jQuery(document).ready(function() {
   if(document.getElementById('necblah')){
      importScript('Utensa:Fierodelveneto/novaentrada.js');
   }
});
Traesto fora da Wikipèdia - L'ençiclopedia łìbara e cołaboradiva in łéngua Vèneta "https://vec.wiktionary.org/w/index.php?title=MediaWiki:Gadget-legacy.js&oldid=36932"