diff --git a/.gitignore b/.gitignore index e267105..b4eb3e1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ .DS_Store anleitung.txt node_modules/ -files/js/* *.cache diff --git a/files/js/Hanashi/TeamSpeak/ServerAdd.js b/files/js/Hanashi/TeamSpeak/ServerAdd.js new file mode 100644 index 0000000..b63a9a5 --- /dev/null +++ b/files/js/Hanashi/TeamSpeak/ServerAdd.js @@ -0,0 +1,92 @@ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +define(["require", "exports", "WoltLabSuite/Core/Language"], function (require, exports, Language) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ServerAdd = void 0; + Language = __importStar(Language); + class ServerAdd { + constructor() { + var _a; + (_a = document + .getElementById("queryType")) === null || _a === void 0 ? void 0 : _a.addEventListener("change", (ev) => this.changeQueryType(ev)); + } + changeQueryType(e) { + const target = e.target; + if (target == null) { + return; + } + let serverPortText = "wcf.page.teamspeakAdd.virtualServerPort"; + let serverPortDescriptionText = "wcf.page.teamspeakAdd.virtualServerPort.description"; + let passwordText = "wcf.page.teamspeakAdd.password"; + let serverPort = "9987"; + if (target.value == "http" || target.value == "https") { + serverPortText = "wcf.page.teamspeakAdd.virtualServerID"; + serverPortDescriptionText = + "wcf.page.teamspeakAdd.virtualServerID.description"; + passwordText = "wcf.page.teamspeakAdd.apiKey"; + serverPort = "1"; + } + const virtualServerPortContainer = document.getElementById("virtualServerPortContainer"); + if (virtualServerPortContainer != null) { + const virtualServerPortLabel = virtualServerPortContainer.querySelector('label[for="virtualServerPort"]'); + if (virtualServerPortLabel != null) { + virtualServerPortLabel.innerHTML = Language.get(serverPortText); + } + const virtualServerPorDescriptionSmall = virtualServerPortContainer.querySelector("small:not(.innerError)"); + if (virtualServerPorDescriptionSmall != null) { + virtualServerPorDescriptionSmall.innerHTML = Language.get(serverPortDescriptionText); + } + } + const passwordContainer = document.getElementById("passwordContainer"); + if (passwordContainer != null) { + const passwordLabel = passwordContainer.querySelector('label[for="password"]'); + if (passwordLabel != null) { + passwordLabel.innerHTML = Language.get(passwordText); + } + } + const virtualServerPort = document.getElementById("virtualServerPort"); + if (virtualServerPort != null) { + virtualServerPort.value = serverPort; + } + const queryPortField = document.getElementById("queryPort"); + if (queryPortField != null) { + if (target.value == "raw") { + queryPortField.value = "10011"; + } + else if (target.value == "ssh") { + queryPortField.value = "10022"; + } + else if (target.value == "http") { + queryPortField.value = "10080"; + } + else if (target.value == "https") { + queryPortField.value = "10443"; + } + } + } + } + exports.ServerAdd = ServerAdd; + exports.default = ServerAdd; +}); diff --git a/make.sh b/make.sh deleted file mode 100755 index 7ca7aa2..0000000 --- a/make.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -PACKAGE_NAME=eu.hanashi.wsc.teamspeak-api -PACKAGE_TYPES=(acptemplates files) - -rm -rf files/js/* -tsc --build - -for i in "${PACKAGE_TYPES[@]}" -do - rm -rf ${i}.tar - 7z a -ttar -mx=9 ${i}.tar ./${i}/* -done - -rm -rf ${PACKAGE_NAME}.tar ${PACKAGE_NAME}.tar.gz -7z a -ttar -mx=9 ${PACKAGE_NAME}.tar ./* -x!acptemplates -x!files -x!templates -x!${PACKAGE_NAME}.tar -x!${PACKAGE_NAME}.tar.gz -x!make.* -x!ts -x!node_modules -x!package-lock.json -x!package.json -x!tsconfig.json -x!.* -7z a ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}.tar -rm -rf ${PACKAGE_NAME}.tar - -for i in "${PACKAGE_TYPES[@]}" -do - rm -rf ${i}.tar -done -