Misplaced Pages

User:Magog the Ogre/monobook.js: Difference between revisions

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:Magog the Ogre Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 19:02, 30 December 2010 view sourceMagog the Ogre (talk | contribs)Administrators100,751 edits User:MGA73/nowcommonsreview.js← Previous edit Revision as of 22:34, 18 February 2011 view source Magog the Ogre (talk | contribs)Administrators100,751 edits updatesNext edit →
Line 3: Line 3:
importScript("User:Tim Song/afchelper4.js"); importScript("User:Tim Song/afchelper4.js");
importScript('User:AWeenieMan/furme.js'); importScript('User:AWeenieMan/furme.js');
importScript('User:Mr.Z-man/refToolbar.js');
importScript("User:Drilnoth/delresized.js"); importScript("User:Drilnoth/delresized.js");
importScript("User:MGA73/nowcommonsreview.js"); importScript("User:MGA73/nowcommonsreview.js");

/******************************************************
* added from User:Mr.Z-man/refToolbar.js *
******************************************************/

var refToolbarInstalled = true;
if (wgServer == "https://secure.wikimedia.org") {
importScriptURI("https://secure.wikimedia.org/wikipedia/en/search/?title=User:Mr.Z-man/refToolbar_2.0/base.js&action=raw&ctype=text/javascript");
} else {
importScriptURI('http://en.wikipedia.org/search/?title=User:Mr.Z-man/refToolbar_2.0/base.js&action=raw&ctype=text/javascript');
}
if( typeof $j.wikiEditor != 'undefined' && (wgAction == 'edit' || wgAction == 'submit') ) {
// if( wgWikiEditorPreferences.toolbar.enable && wgWikiEditorPreferences.toolbar.dialogs /*&& navigator.userAgent.indexOf('MSIE') == -1*/ ) {
importScript('User:Mr.Z-man/refToolbar 2.0.js');
// } else if( wgWikiEditorPreferences.toolbar.enable ) {
// importScript('User:Mr.Z-man/refToolbarIE.js');
// }
} else if (wgAction == 'edit' || wgAction == 'submit') {
importScript('User:Apoc2400/refToolbarPlus.js');
}


/*************************************************************** /***************************************************************
* added from MediaWiki:Gadget-UTCLiveClock.js * * added from mw:MediaWiki:Gadget-UTCLiveClock.js *
**************************************************************/ **************************************************************/
( function( $, undefined ) {
function liveClock()
{
appendCSS( "#utcdate a { font-weight:bolder; font-size:120%; }" );
if (typeof(UTCLiveClockConfig)=='undefined') UTCLiveClockConfig = {};
var portletId = UTCLiveClockConfig.portletId || 'p-personal';
var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById(UTCLiveClockConfig.nextNodeId) : undefined;
liveClock.node = addPortletLink( portletId, wgScript + '?title=' + encodeURIComponent(wgPageName) + '&action=purge', '', 'utcdate', undefined, undefined, nextNode );
if( !liveClock.node ) return;
showTime();
}
addOnloadHook(liveClock)
function showTime() function showTime( $target ) {
var dateNode = UTCLiveClockConfig.node;
{
if( !dateNode ) {
return;
var dateNode = liveClock.node;
}
if( !dateNode ) return;
var now = new Date(); var now = new Date();
Line 34: Line 41:
var mm = now.getUTCMinutes(); var mm = now.getUTCMinutes();
var ss = now.getUTCSeconds(); var ss = now.getUTCSeconds();
if ( typeof $target === 'undefined' ) {
$target = $( dateNode ).find( 'a:first' );
}
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss ); var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
$target.text( time );
dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
window.setTimeout(showTime, 1000); setTimeout( function(){
showTime( $target );
}, 1000 );
} }
function liveClock() {
appendCSS( '#utcdate a { font-weight:bolder; font-size:120%; }' );
if ( typeof( UTCLiveClockConfig ) === 'undefined' ) {
window.UTCLiveClockConfig = {};
}
var portletId = UTCLiveClockConfig.portletId || 'p-personal';
var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById( UTCLiveClockConfig.nextNodeId ) : undefined;
UTCLiveClockConfig.node = addPortletLink(
portletId,
wgScript + '?title=' + encodeURIComponent( wgPageName ) + '&action=purge',
'',
'utcdate',
undefined,
undefined,
nextNode
);
if( !UTCLiveClockConfig.node ) {
return;
}
showTime();
}
$( document ).ready( liveClock );
} )( jQuery );


/*************************************************************** /***************************************************************
Line 79: Line 118:
} }
}) })



/*************************************************************** /***************************************************************
* added from MediaWiki:Gadget-edittop.js * * added from MediaWiki:Gadget-edittop.js *
**************************************************************/ **************************************************************/

// Imported from ], version as of: 2007-06-19T04:28:52 // Imported from ], version as of: 2007-06-19T04:28:52
// Updated from ], version as of: 2009-04-28T11:54:22 // Updated from ], version as of: 2009-04-28T11:54:22
if ((wgAction == 'view' || wgAction == 'purge') && wgNamespaceNumber >=0) if ((wgAction == 'view' || wgAction == 'purge' ) && wgNamespaceNumber >=0) {
addOnloadHook(function edittop_hook(){ addOnloadHook (function edittop_hook () {
var localtitles = { var localtitles = {
cs: 'Editovat úvodní sekci', cs: 'Editovat úvodní sekci',
en: 'Edit lead section', en: 'Edit lead section',
fr: 'Modifier le résumé introductif', fr: 'Modifier le résumé introductif',
ko: '도입부를 편집', ko: '도입부를 편집',
it: 'Modifica della sezione iniziale', it: 'Modifica della sezione iniziale',
ja: '導入部を編集' ja: '導入部を編集'
}; };
var our_content = document.getElementById('content') || document.getElementById('mw_content') || document.body;
var editspans = getElementsByClassName( our_content, "span", "editsection");
var span1;
for( es_count = 0; editspans && es_count < editspans.length; es_count++ )
{
span1 = editspans;
if( span1.className.indexOf( "plainlinks" ) == -1 )
break;
}
if (!span1) return;
var span0 = span1.cloneNode(true);
var editwidth = span1.offsetWidth;
if( skin != "vector" ) editwidth += 10;
var topicons = getElementsByClassName( our_content, 'div', "topicon" );
for( el=0; topicons && el < topicons.length; el++ )
{
topicons.style.marginRight = editwidth+"px";
}
var mwfrtag = document.getElementById( "mw-fr-revisiontag" );
if( mwfrtag ) {
mwfrtag.style.marginRight = editwidth+"px";
}
our_content = document.getElementById('mw_header') || document.getElementById('content') || document.body;
var parent = our_content.getElementsByTagName('H1');
parent.insertBefore(span0, parent.firstChild);
var a = span0.getElementsByTagName('A');
if (a.href.indexOf('&section=T') == -1){
a.title = a.title.replace(/(: |:).*$/,'$1'+'0')
a.setAttribute('href', a.getAttribute('href',2).replace(/&section=\d+/,'&section=0'));
}else{//transcluded
a.title = localtitles
a.setAttribute('href', wgScript+'?title='+encodeURIComponent(wgPageName)+'&action=edit&section=0')
}
if (localtitles) a.title = localtitles
})


var our_content = document.getElementById ("content") || document.getElementById ("mw_content") || document.body;
var editspans = getElementsByClassName (our_content, "span", "editsection");
var span1;

for (es_count = 0; editspans && es_count < editspans.length; es_count++ ) {
span1 = editspans;
if (span1.className.indexOf ("plainlinks") == -1)
break;
}
if (!span1)
return;
var span0 = span1.cloneNode (true);
var editwidth = span1.offsetWidth;
if (skin == "vector")
appendCSS ("h1.firstHeading span.editsection {font-size: 50%;}");
else
editwidth += 10;

var topicons = getElementsByClassName (our_content, "div", "topicon");
for (el = 0; topicons && el < topicons.length; el++) {
topicons.style.marginRight = editwidth + "px";
}
var mwfrtag = document.getElementById ("mw-fr-revisiontag");
if (mwfrtag) {
mwfrtag.style.marginRight = editwidth + "px";
}

our_content = document.getElementById ("mw_header") || document.getElementById ("content") || document.body;
var parent = our_content.getElementsByTagName ("H1");
parent.insertBefore (span0, parent.firstChild);
var a = span0.getElementsByTagName ("A");
if (a.href.indexOf ("&section=T") == -1) {
a.title = a.title.replace (/(: |:).*$/, "$1" + "0");
a.setAttribute ("href", a.getAttribute ("href", 2).replace (/&section=\d+/, "&section=0"));
}
else { //transcluded
a.title = localtitles;
a.setAttribute ("href", wgScript + "?title=" + encodeURIComponent (wgPageName) + "&action=edit&section=0");
}
if (localtitles)
a.title = localtitles;
})
}


/*************************************************************** /***************************************************************

Revision as of 22:34, 18 February 2011

importScript('User:Lupin/recent2.js');
importScript("User:AzaToth/twinkle.js");
importScript("User:Tim Song/afchelper4.js");
importScript('User:AWeenieMan/furme.js');
importScript("User:Drilnoth/delresized.js");
importScript("User:MGA73/nowcommonsreview.js");

/******************************************************
 *      added from User:Mr.Z-man/refToolbar.js        *
 ******************************************************/

var refToolbarInstalled = true;
if (wgServer == "https://secure.wikimedia.org") {
  importScriptURI("https://secure.wikimedia.org/wikipedia/en/search/?title=User:Mr.Z-man/refToolbar_2.0/base.js&action=raw&ctype=text/javascript");
} else {
  importScriptURI('http://en.wikipedia.org/search/?title=User:Mr.Z-man/refToolbar_2.0/base.js&action=raw&ctype=text/javascript');
}
if( typeof $j.wikiEditor != 'undefined' && (wgAction == 'edit' || wgAction == 'submit') ) {
// if( wgWikiEditorPreferences.toolbar.enable && wgWikiEditorPreferences.toolbar.dialogs /*&& navigator.userAgent.indexOf('MSIE') == -1*/ ) {
  importScript('User:Mr.Z-man/refToolbar 2.0.js');
// } else if( wgWikiEditorPreferences.toolbar.enable ) {
//  importScript('User:Mr.Z-man/refToolbarIE.js');
// }
} else if (wgAction == 'edit' || wgAction == 'submit') {
  importScript('User:Apoc2400/refToolbarPlus.js');
}

/***************************************************************
 *      added from mw:MediaWiki:Gadget-UTCLiveClock.js         *
 **************************************************************/
( function( $, undefined ) {
 
function showTime( $target ) {
	var dateNode = UTCLiveClockConfig.node;
	if( !dateNode ) {
		return;
	}
 
	var now = new Date();
	var hh = now.getUTCHours();
	var mm = now.getUTCMinutes();
	var ss = now.getUTCSeconds();
	if ( typeof $target === 'undefined' ) {
		$target = $( dateNode ).find( 'a:first' );
	}
	var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
	$target.text( time );
 
	setTimeout( function(){
		showTime( $target );	
	}, 1000 );
}
 
function liveClock() {
	appendCSS( '#utcdate a { font-weight:bolder; font-size:120%; }' );
 
	if ( typeof( UTCLiveClockConfig ) === 'undefined' ) {
		window.UTCLiveClockConfig = {};
	}
	var portletId = UTCLiveClockConfig.portletId || 'p-personal';
	var nextNode = UTCLiveClockConfig.nextNodeId ? document.getElementById( UTCLiveClockConfig.nextNodeId ) : undefined;
	UTCLiveClockConfig.node = addPortletLink(
		portletId,
		wgScript + '?title=' + encodeURIComponent( wgPageName ) + '&action=purge',
		'',
		'utcdate',
		undefined,
		undefined,
		nextNode
	);
	if( !UTCLiveClockConfig.node ) {
		return;
	}
 
	showTime();
}
$( document ).ready( liveClock );
 
} )( jQuery );

/***************************************************************
 *      added from MediaWiki:Gadget-LongEditSummaries.js       *
 **************************************************************/
addOnloadHook(function() {
    var wpSummary = document.getElementById("wpSummary")
    if (wpSummary) {
        var adjustMaxLength = function () {
            // subtract the number of UTF-8 continuation bytes (0x80-0xBF) from the maxlength
            var maxLength = 250 - encodeURI(wpSummary.value).split(/%/i).length + 1
            wpSummary.maxLength = maxLength
 
            // the last character or group might've pushed us over; if so, inform the user
            var errorMessage = document.getElementById("editSummaryTooLong")
            if (wpSummary.value.length > maxLength) {
                if (!errorMessage) {
                    wpSummary.style.border = "3px solid red"
                    document.getElementById("wpSave").disabled = true
                    var editSummaryTooLong = document.createElement("div")
                    editSummaryTooLong.id = "editSummaryTooLong"
                    editSummaryTooLong.style.color = "red"
                    editSummaryTooLong.style.fontWeight = "bold"
                    editSummaryTooLong.appendChild(document.createTextNode("Your edit summary is too long."))
                    var wpMinoredit = document.getElementById("wpMinoredit")
                    wpMinoredit.parentNode.insertBefore(editSummaryTooLong, wpMinoredit)
                }
            } else {
                if (errorMessage) {
                    wpSummary.style.border = ""
                    document.getElementById("wpSave").disabled = false
                    errorMessage.parentNode.removeChild(errorMessage)
                }
            }
            oldValue = wpSummary.value
        }
        addHandler(wpSummary, "keyup", adjustMaxLength)
        addHandler(wpSummary, "change", adjustMaxLength)
        adjustMaxLength()
    }
})

/***************************************************************
 *         added from MediaWiki:Gadget-edittop.js              *
 **************************************************************/

// Imported from ], version as of: 2007-06-19T04:28:52
// Updated from ], version as of: 2009-04-28T11:54:22
if ((wgAction == 'view' || wgAction == 'purge' ) && wgNamespaceNumber >=0) {
  addOnloadHook (function edittop_hook () {
    var localtitles = {
      cs: 'Editovat úvodní sekci',
      en: 'Edit lead section',
      fr: 'Modifier le résumé introductif',
      ko: '도입부를 편집',
      it: 'Modifica della sezione iniziale',
      ja: '導入部を編集'
    };

  var our_content = document.getElementById ("content") || document.getElementById ("mw_content") || document.body;
  var editspans = getElementsByClassName (our_content, "span", "editsection");
  var span1;

  for (es_count = 0; editspans && es_count < editspans.length; es_count++ ) {
    span1 = editspans;
    if (span1.className.indexOf ("plainlinks") == -1)
      break;
  }  
  if (!span1)
    return;
  var span0 = span1.cloneNode (true);
  var editwidth = span1.offsetWidth;
  if (skin == "vector")
    appendCSS ("h1.firstHeading span.editsection {font-size: 50%;}");
  else
    editwidth += 10;

  var topicons = getElementsByClassName (our_content, "div", "topicon");
  for (el = 0; topicons && el < topicons.length; el++) {
    topicons.style.marginRight = editwidth + "px";
  }
  var mwfrtag = document.getElementById ("mw-fr-revisiontag");
  if (mwfrtag) {
    mwfrtag.style.marginRight = editwidth + "px";
  }

  our_content = document.getElementById ("mw_header") || document.getElementById ("content") || document.body;
  var parent = our_content.getElementsByTagName ("H1");
  parent.insertBefore (span0, parent.firstChild);
  var a = span0.getElementsByTagName ("A");
  if (a.href.indexOf ("&section=T") == -1) {
    a.title = a.title.replace (/(: |:).*$/, "$1" + "0");
    a.setAttribute ("href", a.getAttribute ("href", 2).replace (/&section=\d+/, "&section=0"));
  }
  else { //transcluded
    a.title = localtitles;
    a.setAttribute ("href", wgScript + "?title=" + encodeURIComponent (wgPageName) + "&action=edit&section=0");
  }
  if (localtitles)
    a.title = localtitles;
  })
}

/***************************************************************
 *         added from MediaWiki:Gadget-Friendly.js             *
 **************************************************************/
if ( navigator.appName != "Microsoft Internet Explorer" )  //Doesn't work in IE.
{
	if ( typeof( FriendlyConfig ) == 'undefined' ) FriendlyConfig = {};
	FriendlyConfig.enableClock = false;
	importScript("User:Ioeth/friendly.js");
}
User:Magog the Ogre/monobook.js: Difference between revisions Add topic