User:Adrian Juszczak/modern.js

// Anonymous "self-invoking" function (function {	// Load the script	var script = document.createElement("SCRIPT");	script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';	script.type = 'text/javascript';	document.getElementsByTagName("head")[0].appendChild(script);

// Poll for jQuery to come into existance var checkReady = function(callback) { if (window.jQuery) { callback(jQuery); }		else { window.setTimeout(function { checkReady(callback); }, 100); }	};

// Start polling... checkReady(function($) {		var toggleSpan = document.createElement('span')		var toggleAString = 'toggle';		toggleSpan.innerHTML = ' [' + toggleAString + '] ';

var navigationIcon = document.createElement('i'); navigationIcon.className += 'icon ion-ios7-navigate-outline portlets-toggle';

var searchIcon = document.createElement('i'); searchIcon.className += 'icon ion-ios7-search portlets-toggle';

var interactionIcon = document.createElement('i'); interactionIcon.className += 'icon ion-ios7-help-outline portlets-toggle';

var tbIcon = document.createElement('i'); tbIcon.className += 'icon ion-ios7-filing-outline portlets-toggle'; var printIcon = document.createElement('i'); printIcon.className += 'icon ion-ios7-printer-outline portlets-toggle';

var langIcon = document.createElement('i'); langIcon.className += 'icon ion-ios7-chatbubble-outline portlets-toggle';

var cactionsIcon = document.createElement('i'); cactionsIcon.className += 'icon ion-ios7-gear-outline';

var coordinatesIcon = document.createElement('i'); coordinatesIcon.className += 'icon ion-ios7-location-outline';

var personalIcon = document.createElement('i'); personalIcon.className += 'icon ion-ios7-person-outline';

var contentsIcon = document.createElement('i'); contentsIcon.className += 'icon ion-ios7-eye-outline';

$(document).ready(function{			// $('#mw_portlets div.pBody').css('display', 'none');			$('#mw_portlets div.pBody').css('display', 'none');

// $('#p-navigation h3').append(navigationIcon); // $('#p-search h3').html('').append(searchIcon); // $('#p-interaction h3').html('').append(interactionIcon); // $('#p-tb h3').html('').append(tbIcon); // $('#p-coll-print_export h3').html('').append(printIcon); // $('#p-lang h3').html('').append(langIcon);

$('#p-navigation h3').append(navigationIcon); $('#p-search h3').append(searchIcon); $('#p-interaction h3').append(interactionIcon); $('#p-tb h3').append(tbIcon); $('#p-coll-print_export h3').append(printIcon); $('#p-lang h3').append(langIcon);

$('#p-personal div.pBody').append(personalIcon); $('#p-personal i').click(function{				$(this).parent.toggleClass('hidden');				// $('#mw_header h1').css('text-align', 'center');			});

$('#coordinates').append(coordinatesIcon); $('#coordinates i').click(function{				$(this).parent.toggleClass('coords-active');			}); // $('#coordinates a').before(locationIcon);

$('#p-cactions h3').before(cactionsIcon); $('#p-cactions i').click(function{				$(this).parent.toggleClass('p-cactions-active');			});

$('.toctoggle').html(''); $('#toctitle').append(contentsIcon); $('#toctitle i').click(function{				$('#toc > ul').toggle({duration:500, easing: 'swing'});				$('#toc').toggleClass('tochidden');

});

// $('.toctitle h2').append(tocToggle);

// $('#mw_portlets h3').append(toggleSpan); $('.portlet h3').click(function{			// $(this).parent.parent.parent.find('.pBody').toggle;			// $(this).parent.parent.find('.pBody').toggle;			$(this).parent.find('.pBody').toggle({duration:500, easing: 'swing'});			$(this).parent.toggleClass('portlet-active');			}); });	}); });