diff options
author | ManeraKai <manerakai@protonmail.com> | 2022-04-12 02:27:39 +0300 |
---|---|---|
committer | ManeraKai <manerakai@protonmail.com> | 2022-04-12 02:27:39 +0300 |
commit | 5d4377c081d18d89e64184c60d3fa97504768c81 (patch) | |
tree | c6dd7c0c79fe68060e1366809443c3d096c11e18 /src/pages/options/tiktok | |
parent | auto fetch proxitok instances (#185) (diff) | |
download | libredirect-5d4377c081d18d89e64184c60d3fa97504768c81.zip |
Restructuring Settings Structure
Diffstat (limited to 'src/pages/options/tiktok')
-rw-r--r-- | src/pages/options/tiktok/tiktok.html | 82 | ||||
-rw-r--r-- | src/pages/options/tiktok/tiktok.js | 8 |
2 files changed, 47 insertions, 43 deletions
diff --git a/src/pages/options/tiktok/tiktok.html b/src/pages/options/tiktok/tiktok.html index 34c091a8..8136ccd0 100644 --- a/src/pages/options/tiktok/tiktok.html +++ b/src/pages/options/tiktok/tiktok.html @@ -144,49 +144,53 @@ <hr> - <div id="normal"> - <div class="some-block option-block"> - <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> - </div> - <div class="checklist" id="proxiTok-normal-checklist"></div> - <hr> - <div class="some-block option-block"> - <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> - </div> - <form id="custom-proxiTok-normal-instance-form"> + <div id="proxiTok"> + <div class="normal"> <div class="some-block option-block"> - <input id="proxiTok-normal-custom-instance" placeholder="https://proxiTok.com" type="url" /> - <button type="submit" class="add" id="proxiTok-normal-add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> - <path d="M0 0h24v24H0V0z" fill="none" /> - <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> - </svg> - </button> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> </div> - </form> - <div class="checklist" id="proxiTok-normal-custom-checklist"></div> - </div> - <div id="tor"> - <div class="some-block option-block"> - <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> - </div> - <div class="checklist" id="proxiTok-tor-checklist"></div> - <hr> - <div class="some-block option-block"> - <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + <div class="checklist checklist"></div> + <hr> + <div class="some-block option-block"> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> + </div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://proxiTok.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> </div> - <form id="custom-proxiTok-tor-instance-form"> + <div class="tor"> + <div class="some-block option-block"> + <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4> + </div> + <div class="checklist checklist"></div> + <hr> <div class="some-block option-block"> - <input id="proxiTok-tor-custom-instance" placeholder="https://proxiTok.com" type="url" /> - <button type="submit" class="add" id="proxiTok-tor-add-instance"> - <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor"> - <path d="M0 0h24v24H0V0z" fill="none" /> - <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> - </svg> - </button> + <h4 data-localise="__MSG_customInstances__">Custom Instances</h4> </div> - </form> - <div class="checklist" id="proxiTok-tor-custom-checklist"></div> + <form class="custom-instance-form"> + <div class="some-block option-block"> + <input class="custom-instance" placeholder="https://proxiTok.com" type="url" /> + <button type="submit" class="add add-instance"> + <svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" + fill="currentColor"> + <path d="M0 0h24v24H0V0z" fill="none" /> + <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /> + </svg> + </button> + </div> + </form> + <div class="checklist custom-checklist"></div> + </div> </div> </section> @@ -196,4 +200,4 @@ <script type="module" src="../../../assets/javascripts/localise.js"></script> </body> -</html> +</html> \ No newline at end of file diff --git a/src/pages/options/tiktok/tiktok.js b/src/pages/options/tiktok/tiktok.js index 13de04d8..1f5351aa 100644 --- a/src/pages/options/tiktok/tiktok.js +++ b/src/pages/options/tiktok/tiktok.js @@ -3,12 +3,12 @@ import commonHelper from "../../../assets/javascripts/helpers/common.js"; let disableTiktokElement = document.getElementById("disable-tiktok"); disableTiktokElement.addEventListener("change", - (event) => tiktokHelper.setDisable(!event.target.checked) + event => tiktokHelper.setDisable(!event.target.checked) ); let protocolElement = document.getElementById("protocol") protocolElement.addEventListener("change", - (event) => { + event => { let protocol = event.target.options[protocolElement.selectedIndex].value tiktokHelper.setProtocol(protocol); changeProtocolSettings(protocol); @@ -16,8 +16,8 @@ protocolElement.addEventListener("change", ); function changeProtocolSettings(protocol) { - let normalDiv = document.getElementById("normal"); - let torDiv = document.getElementById("tor"); + let normalDiv = document.getElementsByClassName("normal")[0]; + let torDiv = document.getElementsByClassName("tor")[0]; if (protocol == 'normal') { normalDiv.style.display = 'block'; torDiv.style.display = 'none'; |