import * as UiEmpty from "./Ui/Empty";
import * as UiObjectAction from "./Ui/Object/Action";
import * as UiObjectActionDelete from "./Ui/Object/Action/Delete";
-import * as UiObjectActionToggle from "./Ui/Object/Action/Toogle";
+import * as UiObjectActionToggle from "./Ui/Object/Action/Toggle";
// perfectScrollbar does not need to be bound anywhere, it just has to be loaded for WCF.js
import "perfect-scrollbar";
--- /dev/null
+/**
+ * Reacts to objects being toggled.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module WoltLabSuite/Core/Ui/Object/Action/Toggle
+ */
+
+import * as Language from "../../../Language";
+import UiObjectActionHandler from "./Handler";
+import { ObjectActionData } from "../Data";
+
+function toggleObject(data: ObjectActionData): void {
+ const actionElement = data.objectElement.querySelector('.jsObjectAction[data-object-action="toggle"]') as HTMLElement;
+ if (!actionElement || actionElement.dataset.objectActionHandler) {
+ return;
+ }
+
+ if (actionElement.classList.contains("fa-square-o")) {
+ actionElement.classList.replace("fa-square-o", "fa-check-square-o");
+
+ const newTitle = actionElement.dataset.disableTitle || Language.get("wcf.global.button.disable");
+ actionElement.title = newTitle;
+ } else {
+ actionElement.classList.replace("fa-check-square-o", "fa-square-o");
+
+ const newTitle = actionElement.dataset.enableTitle || Language.get("wcf.global.button.enable");
+ actionElement.title = newTitle;
+ }
+}
+
+export function setup(): void {
+ new UiObjectActionHandler("toggle", ["enable", "disable"], toggleObject);
+}
/**
- * Reacts to objects being toggled.
- *
- * @author Matthias Schmidt
+ * @author Joshua Ruesweg
* @copyright 2001-2021 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLabSuite/Core/Ui/Object/Action/Toggle
+ * @module WoltLabSuite/Core/Ui/Object/Action/Toogle
+ * @deprecated Use the Module WoltLabSuite/Core/Ui/Object/Action/Toggle instead.
*/
-import * as Language from "../../../Language";
-import UiObjectActionHandler from "./Handler";
-import { ObjectActionData } from "../Data";
-
-function toggleObject(data: ObjectActionData): void {
- const actionElement = data.objectElement.querySelector('.jsObjectAction[data-object-action="toggle"]') as HTMLElement;
- if (!actionElement || actionElement.dataset.objectActionHandler) {
- return;
- }
-
- if (actionElement.classList.contains("fa-square-o")) {
- actionElement.classList.replace("fa-square-o", "fa-check-square-o");
-
- const newTitle = actionElement.dataset.disableTitle || Language.get("wcf.global.button.disable");
- actionElement.title = newTitle;
- } else {
- actionElement.classList.replace("fa-check-square-o", "fa-square-o");
-
- const newTitle = actionElement.dataset.enableTitle || Language.get("wcf.global.button.enable");
- actionElement.title = newTitle;
- }
-}
-
-export function setup(): void {
- new UiObjectActionHandler("toggle", ["enable", "disable"], toggleObject);
-}
+export { setup } from "./Toggle";
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Bootstrap
*/
-define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/Relative", "./Devtools", "./Dom/Change/Listener", "./Environment", "./Event/Handler", "./Language", "./StringUtil", "./Ui/Dialog", "./Ui/Dropdown/Simple", "./Ui/Mobile", "./Ui/Page/Action", "./Ui/TabMenu", "./Ui/Tooltip", "./Ui/Page/JumpTo", "./Ui/Password", "./Ui/Empty", "./Ui/Object/Action", "./Ui/Object/Action/Delete", "./Ui/Object/Action/Toogle", "perfect-scrollbar"], function (require, exports, tslib_1, Core, Picker_1, DateTimeRelative, Devtools_1, Listener_1, Environment, EventHandler, Language, StringUtil, Dialog_1, Simple_1, UiMobile, UiPageAction, UiTabMenu, UiTooltip, UiPageJumpTo, UiPassword, UiEmpty, UiObjectAction, UiObjectActionDelete, UiObjectActionToggle) {
+define(["require", "exports", "tslib", "./Core", "./Date/Picker", "./Date/Time/Relative", "./Devtools", "./Dom/Change/Listener", "./Environment", "./Event/Handler", "./Language", "./StringUtil", "./Ui/Dialog", "./Ui/Dropdown/Simple", "./Ui/Mobile", "./Ui/Page/Action", "./Ui/TabMenu", "./Ui/Tooltip", "./Ui/Page/JumpTo", "./Ui/Password", "./Ui/Empty", "./Ui/Object/Action", "./Ui/Object/Action/Delete", "./Ui/Object/Action/Toggle", "perfect-scrollbar"], function (require, exports, tslib_1, Core, Picker_1, DateTimeRelative, Devtools_1, Listener_1, Environment, EventHandler, Language, StringUtil, Dialog_1, Simple_1, UiMobile, UiPageAction, UiTabMenu, UiTooltip, UiPageJumpTo, UiPassword, UiEmpty, UiObjectAction, UiObjectActionDelete, UiObjectActionToggle) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setup = void 0;
--- /dev/null
+/**
+ * Reacts to objects being toggled.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module WoltLabSuite/Core/Ui/Object/Action/Toggle
+ */
+define(["require", "exports", "tslib", "../../../Language", "./Handler"], function (require, exports, tslib_1, Language, Handler_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.setup = void 0;
+ Language = tslib_1.__importStar(Language);
+ Handler_1 = tslib_1.__importDefault(Handler_1);
+ function toggleObject(data) {
+ const actionElement = data.objectElement.querySelector('.jsObjectAction[data-object-action="toggle"]');
+ if (!actionElement || actionElement.dataset.objectActionHandler) {
+ return;
+ }
+ if (actionElement.classList.contains("fa-square-o")) {
+ actionElement.classList.replace("fa-square-o", "fa-check-square-o");
+ const newTitle = actionElement.dataset.disableTitle || Language.get("wcf.global.button.disable");
+ actionElement.title = newTitle;
+ }
+ else {
+ actionElement.classList.replace("fa-check-square-o", "fa-square-o");
+ const newTitle = actionElement.dataset.enableTitle || Language.get("wcf.global.button.enable");
+ actionElement.title = newTitle;
+ }
+ }
+ function setup() {
+ new Handler_1.default("toggle", ["enable", "disable"], toggleObject);
+ }
+ exports.setup = setup;
+});
/**
- * Reacts to objects being toggled.
- *
- * @author Matthias Schmidt
+ * @author Joshua Ruesweg
* @copyright 2001-2021 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLabSuite/Core/Ui/Object/Action/Toggle
+ * @module WoltLabSuite/Core/Ui/Object/Action/Toogle
+ * @deprecated Use the Module WoltLabSuite/Core/Ui/Object/Action/Toggle instead.
*/
-define(["require", "exports", "tslib", "../../../Language", "./Handler"], function (require, exports, tslib_1, Language, Handler_1) {
+define(["require", "exports", "./Toggle"], function (require, exports, Toggle_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setup = void 0;
- Language = tslib_1.__importStar(Language);
- Handler_1 = tslib_1.__importDefault(Handler_1);
- function toggleObject(data) {
- const actionElement = data.objectElement.querySelector('.jsObjectAction[data-object-action="toggle"]');
- if (!actionElement || actionElement.dataset.objectActionHandler) {
- return;
- }
- if (actionElement.classList.contains("fa-square-o")) {
- actionElement.classList.replace("fa-square-o", "fa-check-square-o");
- const newTitle = actionElement.dataset.disableTitle || Language.get("wcf.global.button.disable");
- actionElement.title = newTitle;
- }
- else {
- actionElement.classList.replace("fa-check-square-o", "fa-square-o");
- const newTitle = actionElement.dataset.enableTitle || Language.get("wcf.global.button.enable");
- actionElement.title = newTitle;
- }
- }
- function setup() {
- new Handler_1.default("toggle", ["enable", "disable"], toggleObject);
- }
- exports.setup = setup;
+ Object.defineProperty(exports, "setup", { enumerable: true, get: function () { return Toggle_1.setup; } });
});