User:Hlaw/global.js

mw.loader.implement( 'code.js',   [        'http://dev.wikia.com/AjaxRC/code.js',        'http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js'    ], {        css: '' // all your css goes here    }, {        // this part is for any messages you might want        // I personally haven't used it so can't give any pointers on how it works    } );

mw.loader.using( [ 'code.js' ], function {    // execute whatever callback you need here

} );

if (wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk') { $('Hide ').insertAfter('.UserProfileActionButton'); $('Show ').insertAfter('.UserProfileActionButton'); } function hideBar { $('#UserProfileMasthead').hide; } function showBar { $('#UserProfileMasthead').show; }

/* Insert map */ function CreateHideMap { $('.infomap tbody:nth-child(1) tr:nth-child(1)').after('    '); var maplat = $('.infomap').attr('data-lat'); var maplon = $('.infomap').attr('data-lat'); var map = L.map('map').setView([maplat, maplon], 18); var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmAttrib='Map data © OpenStreetMap contributors'; var osm = new L.TileLayer(osmUrl, {minZoom: 9, maxZoom: 19, attribution: osmAttrib}); // start the map map.addLayer(osm); }

//addOnloadHook(CreateHideMap);

$(window).load(function { //   $.getScript( 'http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js').done(function // { CreateHideMap; //  }); });