Newpage Code
<html>
<head>
    <title>Wikidot Extended NewPage Module</title>
    <style type="text/css">
        @import url("http://www.wikidot.com/common--theme/base/css/style.css");
    </style>
    <script type="text/javascript">
        str_raw = unescape(window.location.hash);
        eval("bln_window = " + str_raw.substr(1,1));
        bln_userinput = 0;
        str_syntax = "/" + /\?\/(.+)\/\?/.exec(str_raw)[1] + "/";
        str_url = /\/\?(.+)/.exec(str_raw)[1];
 
        function textbox_focus() {
            document.newpage.textbox.style.color = "#000";
            document.newpage.textbox.style.fontStyle = "normal";
            if (!bln_userinput) {
                document.newpage.textbox.value = "";
                bln_userinput = true;
            }
        }
 
        function validation() {
            str_userinput = document.newpage.textbox.value;
            str_redirect = str_url.replace(/#/g, str_userinput);
            if (eval(str_syntax + ".test(str_userinput)")) {
                if (bln_window) {
                    window.open(str_redirect);
                } else {
                    window.parent.location = str_redirect;
                }
            } else {
                alert("Please note:\nYour input is not correct: please fix it and try again");
            }
            return false;
        }
    </script>
</head>
<body>
    <form name="newpage" onsubmit="return validation();" style="padding: 2px;">
        <input name="textbox" type="text" class="text" style="width: 100%; margin: 0; background-color: transparent; color: #666; font-style: italic;" onfocus="textbox_focus();">
    </form>
    <script type="text/javascript">
        document.newpage.textbox.value = /#\d(.+)\?\//.exec(unescape(window.location.hash))[1];
    </script>
</body>
</html>

Discussion

Add a new comment

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License