File size: 15,938 Bytes
9ab1a44 976374a 9ab1a44 976374a 9ab1a44 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
(window["webpackJsonpGUI"] = window["webpackJsonpGUI"] || []).push([["addon-entry-clones"],{
/***/ "./node_modules/css-loader/index.js!./src/addons/addons/clones/style.css":
/*!**********************************************************************!*\
!*** ./node_modules/css-loader!./src/addons/addons/clones/style.css ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var escape = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/url/escape.js */ "./node_modules/css-loader/lib/url/escape.js");
exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
// imports
// module
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__(/*! ./cat.svg */ "./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__(/*! ./300cats.svg */ "./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", ""]);
// exports
/***/ }),
/***/ "./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/300cats.svg":
/*!************************************************************************************!*\
!*** ./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/300cats.svg ***!
\************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __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":
/*!********************************************************************************!*\
!*** ./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/cat.svg ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS0xLTFoODAydjYwMkgtMXoiLz48ZyBmaWxsPSIjZGNjOWZmIj48Y2lyY2xlIGN5PSI4LjQ4NCIgY3g9IjcuNDE0IiByPSI0LjczMyIvPjxwYXRoIGQ9Im0zLjg0MyA2LjEuMjk2LTQuODMgMi4yMzYgNC4yNjVtMS40MTEtLjEwOEw5LjQuODY2bC45NzUgNC43MTYiIGZpbGwtb3BhY2l0eT0ibnVsbCIvPjwvZz48ZyBmaWxsPSIjYmM5NmZmIj48Y2lyY2xlIGN5PSI5LjEwNCIgY3g9IjcuOTg3IiByPSI0LjczMyIvPjxwYXRoIGQ9Im00LjQxNSA2LjcyLjI5Ni00LjgzIDIuMjM3IDQuMjY1bTEuNDEtLjEwOCAxLjYxNi00LjU2Ljk3NCA0LjcxNSIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjxnIGZpbGw9IiNhMDY1ZmYiPjxjaXJjbGUgY3k9IjkuNDg2IiBjeD0iOC45NDEiIHI9IjQuNzMzIi8+PHBhdGggZD0ibTUuMzcgNy4xMDIuMjk1LTQuODMgMi4yMzcgNC4yNjVtMS40MS0uMTA3IDEuNjE2LTQuNTYyLjk3NCA0LjcxNiIgZmlsbC1vcGFjaXR5PSJudWxsIi8+PC9nPjwvc3ZnPg==");
/***/ }),
/***/ "./src/addons/addons/clones/300cats.svg":
/*!**********************************************!*\
!*** ./src/addons/addons/clones/300cats.svg ***!
\**********************************************/
/*! exports provided: default, ReactComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReactComponent", function() { return Svg300Cats; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__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 /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", _extends({
width: 16,
height: 16,
xmlns: "http://www.w3.org/2000/svg"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", {
fill: "none",
d: "M-1-1h802v602H-1z"
})), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#ffd1d8"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 8.484,
cx: 7.414,
r: 4.733
}), /*#__PURE__*/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 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#ff91a3"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 9.104,
cx: 7.987,
r: 4.733
}), /*#__PURE__*/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 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#ff6680"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 9.486,
cx: 8.941,
r: 4.733
}), /*#__PURE__*/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"
}))));
}
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "static/assets/60fb267c5ab0c6f4ed9ab4a891ca7dd5.svg");
/***/ }),
/***/ "./src/addons/addons/clones/_runtime_entry.js":
/*!****************************************************!*\
!*** ./src/addons/addons/clones/_runtime_entry.js ***!
\****************************************************/
/*! exports provided: resources */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resources", function() { return resources; });
/* harmony import */ var _userscript_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./userscript.js */ "./src/addons/addons/clones/userscript.js");
/* harmony import */ var _css_loader_style_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! css-loader!./style.css */ "./node_modules/css-loader/index.js!./src/addons/addons/clones/style.css");
/* harmony import */ var _css_loader_style_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_style_css__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _url_loader_300cats_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! url-loader!./300cats.svg */ "./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/300cats.svg");
/* harmony import */ var _url_loader_cat_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! url-loader!./cat.svg */ "./node_modules/url-loader/dist/cjs.js!./src/addons/addons/clones/cat.svg");
/* generated by pull.js */
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":
/*!******************************************!*\
!*** ./src/addons/addons/clones/cat.svg ***!
\******************************************/
/*! exports provided: default, ReactComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReactComponent", function() { return SvgCat; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__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 /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", _extends({
width: 16,
height: 16,
xmlns: "http://www.w3.org/2000/svg"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("path", {
fill: "none",
d: "M-1-1h802v602H-1z"
})), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#dcc9ff"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 8.484,
cx: 7.414,
r: 4.733
}), /*#__PURE__*/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 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#bc96ff"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 9.104,
cx: 7.987,
r: 4.733
}), /*#__PURE__*/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 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("g", {
fill: "#a065ff"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("circle", {
cy: 9.486,
cx: 8.941,
r: 4.733
}), /*#__PURE__*/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"
}))));
}
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "static/assets/8a30520407ffdf5b0e7e06e490db9c1d.svg");
/***/ }),
/***/ "./src/addons/addons/clones/userscript.js":
/*!************************************************!*\
!*** ./src/addons/addons/clones/userscript.js ***!
\************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __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;
// performance
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;
};
/*
if (addon.self.enabledLate) {
// Clone count might be inaccurate if the user deleted sprites
// before enabling the addon
let count = 0;
for (let target of vm.runtime.targets) {
if (!target.isOriginal) ++count;
}
vm.runtime._cloneCounter = count;
}
*/
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
});
}
}
});
/***/ })
}]);
//# sourceMappingURL=addon-entry-clones.js.map |