Changes

5,579 bytes removed ,  20:08, 24 June 2009
←Blanked the page
Line 1: Line 1: βˆ’
/* <source lang="javascript"> */
     βˆ’
/**** LiveClock ****/
  βˆ’
function liveClock()
  βˆ’
{
  βˆ’
  βˆ’
liveClock.node = addPortletLink( 'p-personal', wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', '', 'utcdate' );
  βˆ’
liveClock.node.style.fontSize = 'larger';
  βˆ’
liveClock.node.style.fontWeight = 'bolder';
  βˆ’
  βˆ’
showTime();
  βˆ’
}
  βˆ’
addOnloadHook(liveClock)
  βˆ’
  βˆ’
function showTime()
  βˆ’
{
  βˆ’
  βˆ’
var dateNode = liveClock.node;
  βˆ’
if( !dateNode ) {
  βˆ’
return;
  βˆ’
}
  βˆ’
    var now = new Date();
  βˆ’
var hh = now.getUTCHours();
  βˆ’
var mm = now.getUTCMinutes();
  βˆ’
var ss = now.getUTCSeconds();
  βˆ’
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
  βˆ’
dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
  βˆ’
  βˆ’
    window.setTimeout(showTime, 1000);
  βˆ’
}
  βˆ’
/**** End LiveClock ****/
  βˆ’
  βˆ’
  βˆ’
/**** QueryString ****
  βˆ’
* Maps the querystring to an object
  βˆ’
*
  βˆ’
* Functions:
  βˆ’
*
  βˆ’
* QueryString.exists(key)
  βˆ’
*    returns true if the particular key is set
  βˆ’
* QueryString.get(key)
  βˆ’
*    returns the value associated to the key
  βˆ’
* QueryString.equals(key, value)
  βˆ’
*    returns true if the value associated with given key equals given value
  βˆ’
* QueryString.toString()
  βˆ’
*    returns the query string as a string
  βˆ’
* QueryString.create( hash )
  βˆ’
*    creates an querystring and encodes strings via encodeURIComponent and joins arrays with |
  βˆ’
*
  βˆ’
* In static context, the value of location.search.substring(1), else the value given to the constructor is going to be used. The mapped hash is saved in the object.
  βˆ’
*
  βˆ’
* Example:
  βˆ’
*
  βˆ’
* var value = QueryString.get('key');
  βˆ’
* var obj = new QueryString('foo=bar&baz=quux');
  βˆ’
* value = obj.get('foo');
  βˆ’
*/
  βˆ’
function QueryString(qString) {
  βˆ’
this.string = qString;
  βˆ’
this.params = {};
  βˆ’
  βˆ’
if( qString.length == 0 ) {
  βˆ’
return;
  βˆ’
}
  βˆ’
  βˆ’
qString.replace(/\+/, ' ');
  βˆ’
var args = qString.split('&');
  βˆ’
  βˆ’
for( var i in args ) {
  βˆ’
if( typeof( args[i] ) != 'string' ) {
  βˆ’
continue;
  βˆ’
}
  βˆ’
var pair = args[i].split( '=' );
  βˆ’
var key = decodeURIComponent( pair[0] ), value = key;
  βˆ’
  βˆ’
if( pair.length == 2 ) {
  βˆ’
value = decodeURIComponent( pair[1] );
  βˆ’
}
  βˆ’
  βˆ’
this.params[key] = value;
  βˆ’
}
  βˆ’
}
  βˆ’
  βˆ’
QueryString.static = null;
  βˆ’
  βˆ’
QueryString.staticInit = function() {
  βˆ’
if( QueryString.static == null ) {
  βˆ’
QueryString.static = new QueryString(location.search.substring(1));
  βˆ’
}
  βˆ’
}
  βˆ’
  βˆ’
QueryString.get = function(key) {
  βˆ’
QueryString.staticInit();
  βˆ’
return QueryString.static.get(key);
  βˆ’
};
  βˆ’
  βˆ’
QueryString.prototype.get = function(key) {
  βˆ’
return this.params[key] ? this.params[key] : null;
  βˆ’
};
  βˆ’
  βˆ’
QueryString.exists = function(key) {
  βˆ’
QueryString.staticInit();
  βˆ’
return QueryString.static.exists(key);
  βˆ’
}
  βˆ’
  βˆ’
QueryString.prototype.exists = function(key) {
  βˆ’
return this.params[key] ? true : false;
  βˆ’
}
  βˆ’
  βˆ’
QueryString.equals = function(key, value) {
  βˆ’
QueryString.staticInit();
  βˆ’
return QueryString.static.equals(key, value);
  βˆ’
}
  βˆ’
  βˆ’
QueryString.prototype.equals = function(key, value) {
  βˆ’
return this.params[key] == value ? true : false;
  βˆ’
}
  βˆ’
  βˆ’
QueryString.toString = function() {
  βˆ’
QueryString.staticInit();
  βˆ’
return QueryString.static.toString();
  βˆ’
}
  βˆ’
  βˆ’
QueryString.prototype.toString = function() {
  βˆ’
return this.string ? this.string : null;
  βˆ’
}
  βˆ’
  βˆ’
  βˆ’
QueryString.create = function( arr ) {
  βˆ’
var resarr = Array();
  βˆ’
for( var i in arr ) {
  βˆ’
if( typeof arr[i] == 'object' ){
  βˆ’
var v =  Array();
  βˆ’
for(var j in arr[i] ) {
  βˆ’
v[j] = encodeURIComponent( arr[i][j] );
  βˆ’
}
  βˆ’
resarr.push( encodeURIComponent( i ) + '=' +  v.join('|')  );
  βˆ’
} else {
  βˆ’
resarr.push( encodeURIComponent( i ) + '=' + encodeURIComponent( arr[i] ) );
  βˆ’
}
  βˆ’
}
  βˆ’
  βˆ’
return resarr.join('&');
  βˆ’
}
  βˆ’
QueryString.prototype.create = QueryString.create;
  βˆ’
  βˆ’
/**** End QueryString ****/
  βˆ’
  βˆ’
  βˆ’
/**** Quick Preview ****/
  βˆ’
  βˆ’
addOnloadHook(doAddQuickPreview);
  βˆ’
  βˆ’
function doAddQuickPreview() {
  βˆ’
  if ((wgAction != "edit") && (wgAction != "submit")) return;
  βˆ’
  var qbutton = document.getElementById("wpPreview").cloneNode(false);
  βˆ’
  qbutton.value = "Quick preview";
  βˆ’
  qbutton.type="button";
  βˆ’
  qbutton.tabindex="6";
  βˆ’
  qbutton.accessKey="g";
  βˆ’
  qbutton.id="dlQuickPreview";
  βˆ’
  qbutton.title="Preview your changes";
  βˆ’
  qbutton.addEventListener("click", doQuickPreview, false);
  βˆ’
  document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff"));
  βˆ’
}
  βˆ’
  βˆ’
function doQuickPreview() {
  βˆ’
  var bt = document.getElementById("dlQuickPreview");
  βˆ’
  document.getElementById("contentSub").innerHTML = "Getting preview";
  βˆ’
  bt.value="Getting preview";
  βˆ’
  bt.disabled=true;
  βˆ’
  var form = document.editform;
  βˆ’
  var postData = {
  βˆ’
    'wpMinoredit': form.wpMinoredit.checked,
  βˆ’
    'wpWatchthis': form.wpWatchthis.checked,
  βˆ’
    'wpStarttime': form.wpStarttime.value,
  βˆ’
    'wpEdittime': form.wpEdittime.value,
  βˆ’
    'wpAutoSummary': form.wpAutoSummary.value,
  βˆ’
    'wpEditToken': form.wpEditToken.value,
  βˆ’
    'wpSummary': "Quick preview",
  βˆ’
    'wpTextbox1': document.editform.wpTextbox1.value 
  βˆ’
  };
  βˆ’
  βˆ’
  var addr = document.URL;
  βˆ’
  addr = addr.replace("&action=edit", "&action=submit");
  βˆ’
  addr += "&wpPreview=true&live=true";
  βˆ’
  βˆ’
  var qwxmlhttp = sajax_init_object(null);
  βˆ’
  qwxmlhttp.overrideMimeType('text/xml');
  βˆ’
  qwxmlhttp.open( 'POST' , addr, true);
  βˆ’
  qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  βˆ’
  qwxmlhttp.onload = function() {
  βˆ’
  document.getElementById("wikiPreview").innerHTML =  unescape(qwxmlhttp.responseText.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/&quot;/g,'"'));
  βˆ’
  bt.disabled=false;
  βˆ’
  bt.value = "Quick preview";
  βˆ’
  document.getElementById("contentSub").innerHTML = "";
  βˆ’
  }
  βˆ’
  qwxmlhttp.send(QueryString.create(postData));
  βˆ’
}
  βˆ’
/**** End Quick Preview ****/
  βˆ’
  βˆ’
/* </source> */
 
381

edits