User:Codehydro/Auto CSS image crop/script.js: Difference between revisions

Content deleted Content added
mNo edit summary
show next to editor
Line 1:
acic = "Auto CSS image crop";
function showAutoCrop () {
 
importScript('User:Codehydro/Auto CSS image crop/functions.js');
function showAutoCrop loadAutoCrop() {
importScript('User:Codehydro/Auto' CSS+ imageacic crop+ '/functions.js');
initReady();
}
 
function initReady () {
if (window.initAutoCrop) {
if (!window.autocrop) {
efs = editform.style.cssText = "width:60%;float:left;";
documenteditform.bodyparentNode.appendChildinsertBefore(document.createElement("div"), editform.nextSibling).id = "autocrop";
autocrop.style.cssText = "position:fixed;top:25vh;width:50%;height:50vh;";
croptog.innerHTML = cropTogText[1];
cropOpen = true;
croptog.onclick = function() {
cropOpen = !cropOpen;
autocrop.style.display = cropOpen ? "none" : "";
editform.style.cssText = cropOpen ? "" : efs;
croptog.innerHTML = cropTogText[cropOpen ? 0 : 1];
};
}
initAutoCrop();
if(window.editform) window[autocrop.insertBefore(document.createElement("span"), cform).id = "cropdoc"].innerHTML = "<a href='/wiki/User:Codehydro/" + acic + "' target='_blank'>Help</a>";
}
} else setTimeout(initReady, 9);
}
 
if(window.autocrop) {
loadAutoCrop();
importScript('User:Codehydro/Auto CSS image crop/functions.js');
} else if (window.editform && !window.DisableAutoCropEverywhere) {
initReady();
(cropEditCSS = (document.head || document.getElementsByTagName("head")[0]).appendChild(document.createElement("style"))).type = "text/css";
} else if (!window.DisableAutoCropEverywhere) {
(cropEditCSS.styleSheet || cropEditCSS)[cropEditCSS.styleSheet ? "cssText" : "innerHTML"] = "#croptog,#cropdoc,#autocrop{outline:1px solid;}#croptog{cursor:pointer;z-index:2;right:0}#autocrop{padding-top:3em;width:40%;height:" + (editform.wpTextbox1.offsetHeight + 99) + "px;overflow:auto;}#cropdoc{margin-top:-3em;right:14em;}#croptog,#cropdoc{position:absolute;background-color:#eee;padding:0 0.5em;}#cropdoc a{text-decoration:none;color:#000;}";
//(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>";
window[editform.insertBefore(document.createElement("div"), editform.firstChild).id = "croptog"].innerHTML = (cropTogText = ["Open " + acic, "Hide " + acic])[0];
croptog.onclick = loadAutoCrop;
}