Difference between revisions of "MediaWiki:EditTemplates.js"

From Donate
Jump to navigation Jump to search
Line 1: Line 1:
 
if ( wgPageName == "Special:FundraiserLandingPage" ){
 
if ( wgPageName == "Special:FundraiserLandingPage" ){
 
// importScript('MediaWiki:EditTemplates.js');
 
// importScript('MediaWiki:EditTemplates.js');
importStylesheetURI( 'http://bits.pgehres.com/donate/css/MediaWiki:EditTemplates.css' );
+
importStylesheet( 'MediaWiki:EditTemplates.css' );
importScriptURI( 'http://bits.pgehres.com/donate/js/MediaWiki:EditTemplates.js' );
+
// importScriptURI( 'http://bits.pgehres.com/donate/js/MediaWiki:EditTemplates.js' );
  +
  +
  +
$( 'body' ).append( '<div id="editTemplates"><span id="editText">Edit</span><img id="editArrow" width="8" src="//upload.wikimedia.org/wikipedia/commons/thumb/1/10/ArrowRightNavbox.svg/32px-ArrowRightNavbox.svg.png"/></div>' );
  +
  +
$( 'body' ).append( '<div id="editTemplatesList"></div>' );
  +
  +
$( '#editTemplatesList' ).append( '<h4>Templates</h4>' );
  +
  +
var country = getQuerystring( 'country' );
  +
var language = getQuerystring( 'uselang' );
  +
  +
if ( country == '' ){
  +
country = 'XX';
  +
}
  +
if ( language == '' ){
  +
language = 'en';
  +
}
  +
  +
var editList = '' +
  +
'<ul>' +
  +
'<li><a href="/wiki/Template:Lp-layout-default?action=edit">Overall Layout</a></li>' +
  +
'<li><a href="/wiki/Template:2011FR/Appeal-template-default?action=edit">Appeal Template</a><ul>' +
  +
'<li><a href="/wiki/Template:2011FR/Appeal-default/text/@language?action=edit">Appeal Text</a></li>' +
  +
'<li><a href="/wiki/Template:2011FR/Appeal-default/title/@language?action=edit">Appeal Title</a></li></ul></li>' +
  +
'<li><a href="/wiki/Template:2012FR/Form-countryspecific-control/@country?action=edit">Form Layout</a><ul>' +
  +
'<li><a href="/wiki/Template:2012FR/Form-countryspecific-control/@country&action=edit">Radio Buttons</a></li>' +
  +
// '<li><a href="/wiki/Template:2011FR/?action=edit">Payment Methods</a></li>' +
  +
// '<li><a href="/wiki/Template:2011FR/?action=edit">Infobox</a></li>' +
  +
// '<li><a href="/wiki/Template:2011FR/?action=edit">Legalese</a></li></ul</li>' +
  +
'</ul>';
  +
  +
editList = editList.replace( /@country/g, country );
  +
editList = editList.replace( /@language/g, language );
  +
  +
  +
function showEditBox(){
  +
$( '#editTemplatesList' ).css( 'display', 'inline-block' );
  +
$( '#editTemplates' ).click( function(){ hideEditBox() } );
  +
}
  +
function hideEditBox(){
  +
$( '#editTemplatesList' ).css( 'display', 'none' );
  +
$( '#editTemplates' ).click( function(){ showEditBox() } );
  +
}
  +
  +
  +
$( '#editTemplatesList' ).append( editList );
  +
hideEditBox();
 
}
 
}

Revision as of 17:13, 3 July 2012

if ( wgPageName == "Special:FundraiserLandingPage" ){
    // importScript('MediaWiki:EditTemplates.js');
    importStylesheet( 'MediaWiki:EditTemplates.css' );
    // importScriptURI( 'http://bits.pgehres.com/donate/js/MediaWiki:EditTemplates.js' );


$( 'body' ).append( '<div id="editTemplates"><span id="editText">Edit</span><img id="editArrow" width="8" src="//upload.wikimedia.org/wikipedia/commons/thumb/1/10/ArrowRightNavbox.svg/32px-ArrowRightNavbox.svg.png"/></div>' );

$( 'body' ).append( '<div id="editTemplatesList"></div>' );

$( '#editTemplatesList' ).append( '<h4>Templates</h4>' );

var country = getQuerystring( 'country' );
var language = getQuerystring( 'uselang' );

if ( country == '' ){
	country = 'XX';
}
if ( language == '' ){
	language = 'en';
}

var editList = '' +
	'<ul>' +
	'<li><a href="/wiki/Template:Lp-layout-default?action=edit">Overall Layout</a></li>' +
	'<li><a href="/wiki/Template:2011FR/Appeal-template-default?action=edit">Appeal Template</a><ul>' +
	'<li><a href="/wiki/Template:2011FR/Appeal-default/text/@language?action=edit">Appeal Text</a></li>' +
	'<li><a href="/wiki/Template:2011FR/Appeal-default/title/@language?action=edit">Appeal Title</a></li></ul></li>' +
	'<li><a href="/wiki/Template:2012FR/Form-countryspecific-control/@country?action=edit">Form Layout</a><ul>' +
	'<li><a href="/wiki/Template:2012FR/Form-countryspecific-control/@country&action=edit">Radio Buttons</a></li>' +
//	'<li><a href="/wiki/Template:2011FR/?action=edit">Payment Methods</a></li>' +
//	'<li><a href="/wiki/Template:2011FR/?action=edit">Infobox</a></li>' +
//	'<li><a href="/wiki/Template:2011FR/?action=edit">Legalese</a></li></ul</li>' +
	'</ul>';

editList = editList.replace( /@country/g, country );
editList = editList.replace( /@language/g, language );


function showEditBox(){
	$( '#editTemplatesList' ).css( 'display', 'inline-block' );
	$( '#editTemplates' ).click( function(){ hideEditBox() } );	
}
function hideEditBox(){
	$( '#editTemplatesList' ).css( 'display', 'none' );
	$( '#editTemplates' ).click( function(){ showEditBox() } );	
}


$( '#editTemplatesList' ).append( editList );
hideEditBox();
}