Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Automatic Links for yourworldoftext.com.
- Copyright (C) 2017 Your World of Text user Ancientcraft.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- var linkmode = true;
- /* The "Create link to URL" button in the menu. */
- var urlprompt =
- document.getElementById("nav").
- getElementsByTagName("ul")[0].
- getElementsByTagName("li")[4].
- getElementsByTagName("div")[0];
- /* The button to enable link creation. */
- var linksubmitbtn =
- document.getElementById("url_input_submit").
- getElementsByTagName("input")[0];
- /* The URL of the link you want to create. */
- var url = document.getElementById("url_input_form_input").value;
- var init = prompt("Enter the URL you want and then press [OK]. This URL must be an HTTP or HTTPS one.\n\nAlternatively, press [CANCEL] to cancel and terminate the script.\n\nTo stop the script after starting it, you can enter into the console:\n\nlinkmode = false;");
- function auto() {
- if(linkmode) {
- url = init;
- urlprompt.click();
- linksubmitbtn.click();
- setTimeout(auto, 500);
- }
- }
- if (init) {
- auto();
- } else {
- linkmode = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement