User:Codehydro/Auto CSS image crop/script.js

This is an old revision of this page, as edited by Codehydro (talk | contribs) at 16:04, 17 December 2014 (loading bug). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
function showAutoCrop () {
	load = importScript('User:Codehydro/Auto CSS image crop/functions.js');
	document.body.appendChild(document.createElement("div")).id = "autotemp";
	autotemp.style.cssText = "position:fixed;top:25vh;width:50%;height:50vh;";
	loadInit();
}

function loadInit () {
	if (window.initAutoCrop) initAutoCrop();
	else setTimeout(loadInit, 99);
}

if(window.autocrop) {
	load = importScript('User:Codehydro/Auto CSS image crop/functions.js');
	loadInit();
} else if (!window.DisableAutoCropEverywhere) {
	//(userUL = window["p-personal"].getElementsByTagName("ul")[0]).insertBefore(CropPanel = document.createElement("li"), userUL.childNodes[window["AutoCropPos"] || -1]).innerHTML = "<a href='javascript:showAutoCrop();'>CSS image crop</a>";
}