|
(window["webpackJsonpGUI"] = window["webpackJsonpGUI"] || []).push([["addon-entry-clones"],{ |
|
|
|
"./node_modules/css-loader/index.js!./src/addons/addons/clones/style.css": |
|
|
|
|
|
|
|
|
|
(function(module, exports, __webpack_require__) { |
|
|
|
var escape = __webpack_require__( "./node_modules/css-loader/lib/url/escape.js"); |
|
exports = module.exports = __webpack_require__( "./node_modules/css-loader/lib/css-base.js")(false); |
|
|
|
|
|
|
|
|
|
exports.push([module.i, ".clone-container-container {\n display: none;\n align-items: center;\n padding: 0.25rem;\n user-select: none;\n color: #a065ff;\n}\n\n.clone-container {\n font-size: 0.625rem;\n font-weight: bold;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n white-space: nowrap;\n}\n\n.clone-icon {\n margin: 0.25rem;\n display: inline-block;\n background-image: url(" + escape(__webpack_require__( "./src/addons/addons/clones/cat.svg")) + ");\n height: 16px;\n width: 16px;\n}\n\n.clone-container-container[data-count=\"none\"] {\n display: none;\n}\n\n.clone-container-container[data-count=\"full\"] {\n color: #ff6680;\n}\n\n.clone-container-container[data-count=\"full\"] .clone-icon {\n background-image: url(" + escape(__webpack_require__( "./src/addons/addons/clones/300cats.svg")) + ");\n}\n\n.clone-count::after {\n content: attr(data-str);\n}\n\n.sa-clones-small .clone-container-container {\n display: none !important;\n}\n", ""]); |
|
|
|
|
|
|
|
|
|
}), |
|
|
|
"./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/300cats.svg": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS0xLTFoODAydjYwMkgtMXoiLz48ZyBmaWxsPSIjZmZkMWQ4Ij48Y2lyY2xlIGN5PSI4LjQ4NCIgY3g9IjcuNDE0IiByPSI0LjczMyIvPjxwYXRoIGQ9Im0zLjg0MyA2LjEuMjk2LTQuODMgMi4yMzYgNC4yNjVtMS40MTEtLjEwOEw5LjQuODY2bC45NzUgNC43MTYiIGZpbGwtb3BhY2l0eT0ibnVsbCIvPjwvZz48ZyBmaWxsPSIjZmY5MWEzIj48Y2lyY2xlIGN5PSI5LjEwNCIgY3g9IjcuOTg3IiByPSI0LjczMyIvPjxwYXRoIGQ9Im00LjQxNSA2LjcyLjI5Ni00LjgzIDIuMjM3IDQuMjY1bTEuNDEtLjEwOCAxLjYxNi00LjU2Ljk3NCA0LjcxNSIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjxnIGZpbGw9IiNmZjY2ODAiPjxjaXJjbGUgY3k9IjkuNDg2IiBjeD0iOC45NDEiIHI9IjQuNzMzIi8+PHBhdGggZD0ibTUuMzcgNy4xMDIuMjk1LTQuODMgMi4yMzcgNC4yNjVtMS40MS0uMTA3IDEuNjE2LTQuNTYyLjk3NCA0LjcxNiIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjwvc3ZnPg=="); |
|
|
|
}), |
|
|
|
"./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/cat.svg": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS0xLTFoODAydjYwMkgtMXoiLz48ZyBmaWxsPSIjZGNjOWZmIj48Y2lyY2xlIGN5PSI4LjQ4NCIgY3g9IjcuNDE0IiByPSI0LjczMyIvPjxwYXRoIGQ9Im0zLjg0MyA2LjEuMjk2LTQuODMgMi4yMzYgNC4yNjVtMS40MTEtLjEwOEw5LjQuODY2bC45NzUgNC43MTYiIGZpbGwtb3BhY2l0eT0ibnVsbCIvPjwvZz48ZyBmaWxsPSIjYmM5NmZmIj48Y2lyY2xlIGN5PSI5LjEwNCIgY3g9IjcuOTg3IiByPSI0LjczMyIvPjxwYXRoIGQ9Im00LjQxNSA2LjcyLjI5Ni00LjgzIDIuMjM3IDQuMjY1bTEuNDEtLjEwOCAxLjYxNi00LjU2Ljk3NCA0LjcxNSIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjxnIGZpbGw9IiNhMDY1ZmYiPjxjaXJjbGUgY3k9IjkuNDg2IiBjeD0iOC45NDEiIHI9IjQuNzMzIi8+PHBhdGggZD0ibTUuMzcgNy4xMDIuMjk1LTQuODMgMi4yMzcgNC4yNjVtMS40MS0uMTA3IDEuNjE2LTQuNTYyLjk3NCA0LjcxNiIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjwvc3ZnPg=="); |
|
|
|
}), |
|
|
|
"./src/addons/addons/clones/300cats.svg": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_require__.d(__webpack_exports__, "ReactComponent", function() { return Svg300Cats; }); |
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./node_modules/react/index.js"); |
|
var react__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
|
var _path, _g, _g2, _g3; |
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } |
|
|
|
function Svg300Cats(props) { |
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", _extends({ |
|
width: 16, |
|
height: 16, |
|
xmlns: "http://www.w3.org/2000/svg" |
|
}, props), _path || (_path = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
fill: "none", |
|
d: "M-1-1h802v602H-1z" |
|
})), _g || (_g = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#ffd1d8" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 8.484, |
|
cx: 7.414, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M3.843 6.1l.296-4.83 2.236 4.265m1.411-.108L9.4.866l.975 4.716", |
|
fillOpacity: "null" |
|
}))), _g2 || (_g2 = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#ff91a3" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 9.104, |
|
cx: 7.987, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M4.415 6.72l.296-4.83 2.237 4.265m1.41-.108l1.616-4.56.974 4.715", |
|
fillOpacity: "null" |
|
}))), _g3 || (_g3 = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#ff6680" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 9.486, |
|
cx: 8.941, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M5.37 7.102l.295-4.83 2.237 4.265m1.41-.107l1.616-4.562.974 4.716", |
|
fillOpacity: "null" |
|
})))); |
|
} |
|
__webpack_exports__["default"] = (__webpack_require__.p + "static/assets/60fb267c5ab0c6f4ed9ab4a891ca7dd5.svg"); |
|
|
|
|
|
}), |
|
|
|
"./src/addons/addons/clones/_runtime_entry.js": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_require__.d(__webpack_exports__, "resources", function() { return resources; }); |
|
var _userscript_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./src/addons/addons/clones/userscript.js"); |
|
var _css_loader_style_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( "./node_modules/css-loader/index.js!./src/addons/addons/clones/style.css"); |
|
var _css_loader_style_css__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_css_loader_style_css__WEBPACK_IMPORTED_MODULE_1__); |
|
var _url_loader_300cats_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( "./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/300cats.svg"); |
|
var _url_loader_cat_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( "./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/cat.svg"); |
|
|
|
|
|
|
|
|
|
|
|
const resources = { |
|
"userscript.js": _userscript_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
"style.css": _css_loader_style_css__WEBPACK_IMPORTED_MODULE_1___default.a, |
|
"300cats.svg": _url_loader_300cats_svg__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
"cat.svg": _url_loader_cat_svg__WEBPACK_IMPORTED_MODULE_3__["default"] |
|
}; |
|
|
|
}), |
|
|
|
"./src/addons/addons/clones/cat.svg": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_require__.d(__webpack_exports__, "ReactComponent", function() { return SvgCat; }); |
|
var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__( "./node_modules/react/index.js"); |
|
var react__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
|
var _path, _g, _g2, _g3; |
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } |
|
|
|
function SvgCat(props) { |
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", _extends({ |
|
width: 16, |
|
height: 16, |
|
xmlns: "http://www.w3.org/2000/svg" |
|
}, props), _path || (_path = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
fill: "none", |
|
d: "M-1-1h802v602H-1z" |
|
})), _g || (_g = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#dcc9ff" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 8.484, |
|
cx: 7.414, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M3.843 6.1l.296-4.83 2.236 4.265m1.411-.108L9.4.866l.975 4.716", |
|
fillOpacity: "null" |
|
}))), _g2 || (_g2 = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#bc96ff" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 9.104, |
|
cx: 7.987, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M4.415 6.72l.296-4.83 2.237 4.265m1.41-.108l1.616-4.56.974 4.715", |
|
fillOpacity: "null" |
|
}))), _g3 || (_g3 = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", { |
|
fill: "#a065ff" |
|
}, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", { |
|
cy: 9.486, |
|
cx: 8.941, |
|
r: 4.733 |
|
}), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", { |
|
d: "M5.37 7.102l.295-4.83 2.237 4.265m1.41-.107l1.616-4.562.974 4.716", |
|
fillOpacity: "null" |
|
})))); |
|
} |
|
__webpack_exports__["default"] = (__webpack_require__.p + "static/assets/8a30520407ffdf5b0e7e06e490db9c1d.svg"); |
|
|
|
|
|
}), |
|
|
|
"./src/addons/addons/clones/userscript.js": |
|
|
|
|
|
|
|
|
|
(function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
__webpack_exports__["default"] = (async function (_ref) { |
|
let { |
|
addon, |
|
console, |
|
msg |
|
} = _ref; |
|
const vm = addon.tab.traps.vm; |
|
let showIconOnly = addon.settings.get("showicononly"); |
|
if (addon.tab.redux.state && addon.tab.redux.state.scratchGui.stageSize.stageSize === "small") { |
|
document.body.classList.add("sa-clones-small"); |
|
} |
|
document.addEventListener("click", e => { |
|
if (e.target.closest("[class*='stage-header_stage-button-first']")) { |
|
document.body.classList.add("sa-clones-small"); |
|
} else if (e.target.closest("[class*='stage-header_stage-button-last']")) { |
|
document.body.classList.remove("sa-clones-small"); |
|
} |
|
}, { |
|
capture: true |
|
}); |
|
let countContainerContainer = document.createElement("div"); |
|
addon.tab.displayNoneWhileDisabled(countContainerContainer); |
|
let countContainer = document.createElement("div"); |
|
let count = document.createElement("span"); |
|
let icon = document.createElement("span"); |
|
countContainerContainer.className = "clone-container-container"; |
|
countContainer.className = "clone-container"; |
|
count.className = "clone-count"; |
|
icon.className = "clone-icon"; |
|
countContainerContainer.appendChild(icon); |
|
countContainerContainer.appendChild(countContainer); |
|
countContainer.appendChild(count); |
|
let lastChecked = 0; |
|
const cache = Array(301).fill().map((_, i) => msg("clones", { |
|
cloneCount: i |
|
})); |
|
function doCloneChecks(force) { |
|
const v = vm.runtime._cloneCounter; |
|
|
|
if (v === lastChecked && !force) return; |
|
lastChecked = v; |
|
if (v === 0) { |
|
countContainerContainer.dataset.count = "none"; |
|
} else if (v >= vm.runtime.runtimeOptions.maxClones) { |
|
countContainerContainer.dataset.count = "full"; |
|
} else { |
|
countContainerContainer.dataset.count = ""; |
|
} |
|
if (showIconOnly) { |
|
count.dataset.str = v; |
|
} else { |
|
count.dataset.str = cache[v] || msg("clones", { |
|
cloneCount: v |
|
}); |
|
} |
|
if (v === 0) countContainerContainer.style.display = "none";else countContainerContainer.style.display = "flex"; |
|
} |
|
addon.settings.addEventListener("change", () => { |
|
showIconOnly = addon.settings.get("showicononly"); |
|
doCloneChecks(true); |
|
}); |
|
const oldStep = vm.runtime._step; |
|
vm.runtime._step = function () { |
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
args[_key] = arguments[_key]; |
|
} |
|
const ret = oldStep.call(this, ...args); |
|
doCloneChecks(); |
|
return ret; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
await addon.tab.waitForElement('[class*="controls_controls-container"]', { |
|
markAsSeen: true, |
|
reduxEvents: ["scratch-gui/mode/SET_PLAYER", "fontsLoaded/SET_FONTS_LOADED", "scratch-gui/locales/SELECT_LOCALE"] |
|
}); |
|
if (addon.tab.editorMode === "editor" || addon.tab.redux.state.scratchGui.mode.isEmbedded) { |
|
addon.tab.appendToSharedSpace({ |
|
space: "afterStopButton", |
|
element: countContainerContainer, |
|
order: 2 |
|
}); |
|
} |
|
} |
|
}); |
|
|
|
}) |
|
|
|
}]); |
|
|