javascript:(function () {
var autoSaveIntervalId,
autoRunIntervalId,
autoDownloadIntervalId,
isActiveAutoSave = false,
isActiveAutoRun = false,
isActiveRightAlign = false,
isAutoDownloadActive = false;
var scriptLoaded = false;
var isPanelOpenedByClick = false;
function createSettingsIcon() {
var icon = document.createElement("div");
icon.id = "settingsIcon";
icon.innerHTML = "⚙";
icon.style.position = "fixed";
icon.style.color = "#724EBF";
icon.style.top = "0px";
icon.style.right = "10px";
icon.style.zIndex = "9999";
icon.style.cursor = "pointer";
icon.style.fontSize = "48px";
icon.style.transition = "transform 0.5s";
document.body.appendChild(icon);
icon.onclick = function () {
toggleSettingsPanel();
};
icon.onmouseover = function () {
openSettingsPanel();
};
icon.onmouseout = function () {
closeSettingsPanelIfNotFocused();
};
}
function toggleSettingsPanel() {
var panel = document.getElementById("settingsPanel");
var icon = document.getElementById("settingsIcon");
if (panel.style.right === "10px") {
panel.style.right = "-250px";
isPanelOpenedByClick = false;
} else {
panel.style.right = "10px";
isPanelOpenedByClick = true;
}
icon.style.transform =
icon.style.transform === "rotate(360deg)" ? "rotate(0deg)" : "rotate(360deg)";
}
function openSettingsPanel() {
if (!isPanelOpenedByClick) {
var panel = document.getElementById("settingsPanel");
panel.style.right = "10px";
document.getElementById("settingsIcon").style.transform = "rotate(360deg)";
}
}
function closeSettingsPanelIfNotFocused() {
if (!isPanelOpenedByClick) {
setTimeout(function () {
var panel = document.getElementById("settingsPanel");
if (
!panel.matches(":hover") &&
!document.getElementById("settingsIcon").matches(":hover")
) {
panel.style.right = "-250px";
document.getElementById("settingsIcon").style.transform = "rotate(0deg)";
}
}, 500);
}
}
function createSettingsPanel() {
var panel = document.createElement("div");
panel.id = "settingsPanel";
panel.style.position = "fixed";
panel.style.top = "52px";
panel.style.right = "-250px";
panel.style.width = "240px";
panel.style.height = "auto";
panel.style.zIndex = "9998";
panel.style.background = "white";
panel.style.padding = "10px";
panel.style.borderRadius = "20px";
panel.style.boxShadow = "0 0 5px rgba(0,0,0,0.2)";
panel.style.transition = "right 0.5s";
document.body.appendChild(panel);
createAutoSaveControl(panel);
createRightAlignControl(panel);
createAutoRunControl(panel);
createAutoDownloadControl(panel);
var firstLine = document.createElement("div");
firstLine.textContent = "תוסף זה פותח על ידי רפאל";
firstLine.style.textAlign = "center";
firstLine.style.fontWeight = "bold";
firstLine.style.borderRadius = "20px";
firstLine.style.color = "#B05CCC";
firstLine.style.fontSize = "10px";
firstLine.style.backgroundColor = "#f7f7f7";
firstLine.style.padding = "2px";
panel.appendChild(firstLine);
}
function createContainer() {
var container = document.createElement("div");
container.style.marginBottom = "20px";
container.style.textAlign = "center";
container.style.border = "1px solid black";
container.style.padding = "10px";
container.style.borderRadius = "20px";
container.style.boxShadow = "5px 5px 10px rgba(0, 0, 0, 0.2)";
container.style.background = "#B05CCC";
container.onmouseover = function () {
container.style.boxShadow = "inset 0 0 10px rgba(0,0,0,0.5)";
};
container.onmouseout = function () {
container.style.boxShadow = "5px 5px 10px rgba(0, 0, 0, 0.2)";
};
return container;
}
function createTitle(text) {
var title = document.createElement("div");
title.style.color = "white";
title.textContent = text;
title.style.marginBottom = "10px";
title.style.fontWeight = "bold";
title.style.fontSize = "20px";
return title;
}
function createToggle(active) {
var toggle = document.createElement("div");
toggle.style.width = "40px";
toggle.style.height = "20px";
toggle.style.background = active ? "green" : "red";
toggle.style.borderRadius = "10px";
toggle.style.cursor = "pointer";
toggle.style.position = "relative";
toggle.style.margin = "auto";
toggle.style.transition = "background-color 0.2s ease";
return toggle;
}
function createIndicator(active) {
var indicator = document.createElement("div");
indicator.style.width = "20px";
indicator.style.height = "20px";
indicator.style.background = "white";
indicator.style.borderRadius = "50%";
indicator.style.position = "absolute";
indicator.style.transition = "left 0.2s ease";
indicator.style.left = active ? "20px" : "0";
return indicator;
}
function createSettingsContainer() {
var settingsContainer = document.createElement("div");
settingsContainer.style.display = "none";
settingsContainer.style.justifyContent = "space-between";
settingsContainer.style.marginTop = "15px";
return settingsContainer;
}
function createTimeSelector() {
var timeSelector = document.createElement("input");
timeSelector.type = "number";
timeSelector.value = 20;
timeSelector.style.width = "40%";
timeSelector.style.padding = "10px";
timeSelector.style.border = "1px solid #ccc";
timeSelector.style.borderRadius = "5px";
timeSelector.style.textAlign = "center";
timeSelector.style.fontSize = "16px";
timeSelector.addEventListener("input", function () {
if (timeSelector.value === "") {
timeSelector.value = 20;
} else {
var currentValue = parseInt(timeSelector.value, 10);
if (currentValue < 1) {
timeSelector.value = 1;
}
}
});
return timeSelector;
}
function createTimeUnits() {
var timeUnits = document.createElement("select");
["שניות", "דקות", "שעות"].forEach(function (unit) {
var option = document.createElement("option");
option.value = unit;
option.textContent = unit;
timeUnits.appendChild(option);
});
timeUnits.value = "דקות";
timeUnits.style.width = "40%";
timeUnits.style.padding = "10px";
timeUnits.style.border = "1px solid #ccc";
timeUnits.style.borderRadius = "5px";
timeUnits.style.fontSize = "16px";
return timeUnits;
}
function createButton(text) {
var button = document.createElement("button");
button.textContent = text;
button.style.backgroundColor = "#6D00CC";
button.style.color = "white";
button.style.padding = "10px 20px";
button.style.border = "none";
button.style.borderRadius = "25px";
button.style.cursor = "pointer";
button.style.marginTop = "15px";
button.style.marginLeft = "auto";
button.style.marginRight = "auto";
button.style.fontWeight = "bold";
button.style.fontSize = "16px";
button.style.boxShadow = "0px 4px 8px rgba(0, 0, 0, 0.2)";
button.style.transition = "background-color 0.2s, box-shadow 0.2s, transform 0.2s";
button.onmouseover = function () {
button.style.backgroundColor = "#9e4db9";
button.style.boxShadow = "0px 6px 12px rgba(0, 0, 0, 0.25)";
};
button.onmouseout = function () {
button.style.backgroundColor = "#6D00CC";
button.style.boxShadow = "0px 4px 8px rgba(0, 0, 0, 0.2)";
};
button.onmousedown = function () {
button.style.transform = "scale(0.95)";
};
button.onmouseup = function () {
button.style.transform = "scale(1)";
};
return button;
}
function startInterval(action, time, unit, message) {
var multiplier;
switch (unit) {
case "שניות":
multiplier = 1000;
break;
case "דקות":
multiplier = 60000;
break;
case "שעות":
multiplier = 3600000;
break;
default:
multiplier = 60000;
break;
}
return setInterval(action, time * multiplier);
}
function createAutoDownloadControl(parentElement) {
var autoDownloadContainer = createContainer();
var autoDownloadTitle = createTitle("הורדה אוטומטית");
autoDownloadContainer.appendChild(autoDownloadTitle);
var autoDownloadToggle = createToggle(isAutoDownloadActive);
var autoDownloadIndicator = createIndicator(isAutoDownloadActive);
autoDownloadToggle.appendChild(autoDownloadIndicator);
autoDownloadContainer.appendChild(autoDownloadToggle);
var settingsContainer = createSettingsContainer();
var timeSelector = createTimeSelector();
var timeUnits = createTimeUnits();
settingsContainer.appendChild(timeUnits);
settingsContainer.appendChild(timeSelector);
autoDownloadContainer.appendChild(settingsContainer);
var downloadButton = createButton("הורדה");
downloadButton.style.display = "none";
downloadButton.onmouseover = function () {
downloadButton.style.backgroundColor = "lightpurple";
};
downloadButton.onclick = function () {
var time = parseInt(timeSelector.value, 10);
var unit = timeUnits.value;
startAutoDownload(isNaN(time) ? 20 : time, unit);
toggleAutoDownloadElements();
};
autoDownloadContainer.appendChild(downloadButton);
autoDownloadToggle.addEventListener("click", function () {
isAutoDownloadActive = !isAutoDownloadActive;
autoDownloadToggle.style.background = isAutoDownloadActive ? "green" : "red";
autoDownloadIndicator.style.left = isAutoDownloadActive ? "20px" : "0";
if (isAutoDownloadActive) {
var time = parseInt(timeSelector.value, 10) || 20;
var unit = timeUnits.value;
startAutoDownload(time, unit);
} else {
if (autoDownloadIntervalId) {
clearInterval(autoDownloadIntervalId);
}
alert("ההורדה האוטומטית הופסקה!");
}
toggleAutoDownloadElements();
});
function toggleAutoDownloadElements() {
var displayStyle = isAutoDownloadActive ? "flex" : "none";
settingsContainer.style.display = displayStyle;
downloadButton.style.display = displayStyle;
}
parentElement.appendChild(autoDownloadContainer);
}
function startAutoDownload(time, unit) {
var message = isAutoDownloadActive
? "הסינריו יירד כל " + time + " " + unit + "."
: "ההורדה האוטומטית הופסקה!";
clearInterval(autoDownloadIntervalId);
autoDownloadIntervalId = startInterval(clickDownloadButton, time, unit);
alert(message);
}
function clickDownloadButton() {
var downloadButton = document.querySelector(
".i-inspector-general-export[data-imt-btn-export-blueprint]",
);
if (downloadButton && isAutoDownloadActive) {
downloadButton.click();
}
}
function createAutoRunControl(parentElement) {
var autoRunContainer = createContainer();
var autoRunTitle = createTitle("הרצה אוטומטית");
autoRunContainer.appendChild(autoRunTitle);
var autoRunToggle = createToggle(isActiveAutoRun);
var autoRunIndicator = createIndicator(isActiveAutoRun);
autoRunToggle.appendChild(autoRunIndicator);
autoRunContainer.appendChild(autoRunToggle);
var settingsContainer = createSettingsContainer();
var timeSelector = createTimeSelector();
var timeUnits = createTimeUnits();
settingsContainer.appendChild(timeUnits);
settingsContainer.appendChild(timeSelector);
autoRunContainer.appendChild(settingsContainer);
var runButton = createButton("הרצה");
runButton.style.display = "none";
runButton.onmouseover = function () {
runButton.style.backgroundColor = "lightpurple";
};
runButton.onclick = function () {
var time = parseInt(timeSelector.value, 10);
var unit = timeUnits.value;
startAutoRun(isNaN(time) ? 20 : time, unit);
toggleAutoRunElements();
};
autoRunContainer.appendChild(runButton);
autoRunToggle.addEventListener("click", function () {
isActiveAutoRun = !isActiveAutoRun;
autoRunToggle.style.background = isActiveAutoRun ? "green" : "red";
autoRunIndicator.style.left = isActiveAutoRun ? "20px" : "0";
if (isActiveAutoRun) {
var time = parseInt(timeSelector.value, 10) || 20;
var unit = timeUnits.value;
startAutoRun(time, unit);
} else {
if (autoRunIntervalId) {
clearInterval(autoRunIntervalId);
}
clickStopButton();
alert("ההרצה האוטומטית הופסקה!");
}
toggleAutoRunElements();
});
function toggleAutoRunElements() {
var displayStyle = isActiveAutoRun ? "flex" : "none";
settingsContainer.style.display = displayStyle;
runButton.style.display = displayStyle;
}
parentElement.appendChild(autoRunContainer);
}
function startAutoRun(time, unit) {
var message = isActiveAutoRun
? "ההרצה תתבצע כל " + time + " " + unit + "."
: "ההרצה האוטומטית הופסקה!";
clearInterval(autoRunIntervalId);
autoRunIntervalId = startInterval(clickRunButton, time, unit);
alert(message);
}
function clickRunButton() {
if (document.body.classList.contains("inspector-edit")) {
var runButton = document.querySelector(".btn.i-inspector-menu-start-test");
if (runButton) {
runButton.click();
}
} else {
console.log("לא ניתן להריץ - המערכת אינה במצב עריכה");
}
}
function clickStopButton() {
if (document.body.classList.contains("inspector-test")) {
var stopButton = document.querySelector(".btn.i-inspector-menu-stop-test");
if (stopButton) {
stopButton.click();
}
} else {
console.log("לא ניתן לעצור - המערכת אינה במצב בדיקה");
}
}
function createRightAlignControl(parentElement) {
var rightAlignContainer = createContainer();
var rightAlignTitle = createTitle("יישור לימין");
rightAlignContainer.appendChild(rightAlignTitle);
var rightAlignToggle = createToggle(isActiveRightAlign);
var rightAlignIndicator = createIndicator(isActiveRightAlign);
rightAlignToggle.appendChild(rightAlignIndicator);
rightAlignContainer.appendChild(rightAlignToggle);
rightAlignToggle.addEventListener("click", function () {
isActiveRightAlign = !isActiveRightAlign;
rightAlignToggle.style.background = isActiveRightAlign ? "green" : "red";
rightAlignIndicator.style.left = isActiveRightAlign ? "20px" : "0";
var existingElements = document.querySelectorAll("imt-coder, imt-pill, span");
existingElements.forEach(adjustElement);
});
parentElement.appendChild(rightAlignContainer);
}
function adjustElement(el) {
if (isActiveRightAlign) {
el.style.direction = "rtl";
el.style.textAlign = "right";
} else {
el.style.direction = "";
el.style.textAlign = "";
}
}
function createAutoSaveControl(parentElement) {
var autoSaveContainer = createContainer();
var autoSaveTitle = createTitle("שמירה אוטומטית");
autoSaveContainer.appendChild(autoSaveTitle);
var autoSaveToggle = createToggle(isActiveAutoSave);
var autoSaveIndicator = createIndicator(isActiveAutoSave);
autoSaveToggle.appendChild(autoSaveIndicator);
autoSaveContainer.appendChild(autoSaveToggle);
var settingsContainer = createSettingsContainer();
var timeSelector = createTimeSelector();
var timeUnits = createTimeUnits();
settingsContainer.appendChild(timeUnits);
settingsContainer.appendChild(timeSelector);
autoSaveContainer.appendChild(settingsContainer);
var saveButton = createButton("שמירה");
saveButton.style.display = "none";
saveButton.onmouseover = function () {
saveButton.style.backgroundColor = "lightpurple";
};
saveButton.onclick = function () {
var time = parseInt(timeSelector.value, 10);
var unit = timeUnits.value;
startAutoSave(isNaN(time) ? 20 : time, unit);
toggleAutoSaveElements();
};
autoSaveContainer.appendChild(saveButton);
autoSaveToggle.addEventListener("click", function () {
isActiveAutoSave = !isActiveAutoSave;
autoSaveToggle.style.background = isActiveAutoSave ? "green" : "red";
autoSaveIndicator.style.left = isActiveAutoSave ? "20px" : "0";
if (isActiveAutoSave) {
var time = parseInt(timeSelector.value, 10) || 20;
var unit = timeUnits.value;
startAutoSave(time, unit);
} else {
if (autoSaveIntervalId) {
clearInterval(autoSaveIntervalId);
}
alert("השמירה האוטומטית הופסקה!");
}
toggleAutoSaveElements();
});
function toggleAutoSaveElements() {
var displayStyle = isActiveAutoSave ? "flex" : "none";
settingsContainer.style.display = displayStyle;
saveButton.style.display = displayStyle;
}
parentElement.appendChild(autoSaveContainer);
}
function startAutoSave(time, unit) {
var message = isActiveAutoSave
? "הסינריו יישמר כל " + time + " " + unit + "."
: "השמירה האוטומטית הופסקה!";
clearInterval(autoSaveIntervalId);
autoSaveIntervalId = startInterval(clickButton, time, unit);
alert(message);
}
function clickButton() {
var button = document.getElementById("scenariosave");
if (button && isActiveAutoSave) {
button.click();
}
}
function clearScript() {
var settingsPanel = document.getElementById("settingsPanel");
var settingsIcon = document.getElementById("settingsIcon");
if (settingsPanel) settingsPanel.remove();
if (settingsIcon) settingsIcon.remove();
if (autoSaveIntervalId) {
clearInterval(autoSaveIntervalId);
}
if (autoRunIntervalId) {
clearInterval(autoRunIntervalId);
}
if (autoDownloadIntervalId) {
clearInterval(autoDownloadIntervalId);
}
scriptLoaded = false;
}
function loadScript() {
if (!scriptLoaded) {
createSettingsIcon();
createSettingsPanel();
scriptLoaded = true;
}
}
function disableAllToggles() {
isActiveAutoSave = false;
isActiveAutoRun = false;
isActiveRightAlign = false;
isAutoDownloadActive = false;
updateTogglesUI();
}
function updateTogglesUI() {
var autoSaveToggle = document.getElementById("autoSaveToggle");
var autoRunToggle = document.getElementById("autoRunToggle");
var rightAlignToggle = document.getElementById("rightAlignToggle");
var autoDownloadToggle = document.getElementById("autoDownloadToggle");
if (autoSaveToggle) autoSaveToggle.style.background = "red";
if (autoRunToggle) autoRunToggle.style.background = "red";
if (rightAlignToggle) rightAlignToggle.style.background = "red";
if (autoDownloadToggle) autoDownloadToggle.style.background = "red";
}
function checkEditMode() {
if (
(document.body.classList.contains("inspector-edit") ||
document.body.classList.contains("inspector-test")) &&
!scriptLoaded
) {
loadScript();
} else if (
!document.body.classList.contains("inspector-edit") &&
!document.body.classList.contains("inspector-test") &&
scriptLoaded
) {
disableAllToggles();
clearScript();
}
}
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === "attributes" && mutation.attributeName === "class") {
checkEditMode();
}
mutation.addedNodes.forEach(function (node) {
if (node.nodeType === 1 && node instanceof Element) {
if (node.matches("imt-coder, imt-pill, span")) {
adjustElement(node);
}
var innerElements = node.querySelectorAll("imt-coder, imt-pill, span");
innerElements.forEach(adjustElement);
}
});
});
});
observer.observe(document.body, {
attributes: true,
childList: true,
subtree: true,
});
checkEditMode();
})();

Reactions: צנוברית1 //