_javascript

Conversation Window

<html>
<head>
    <title>Chatroom Conversation</title>
    <script type="text/javascript">
        var dom_params = /^(.*)\.wdfiles\.com$/;
        var domain = dom_params.exec(window.location.host)[1];
        function refreshConvo(){
            document.getElementById("newest").src = 'http://' + domain + '.wikidot.com/chat:_newest';
            setTimeout('refreshConvo()', 15000);
        }
    </script>
</head>
<body onload="setTimeout('refreshConvo()', 15000)">
    <script type="text/javascript">
        var dom_params = /^(.*)\.wdfiles\.com$/;
        var domain = dom_params.exec(window.location.host)[1];
        document.write('<iframe src="http://' + domain + '.wikidot.com/chat:_conversation" frameborder="0" scrolling="auto" style="width: 100%; height: 100%; min-width: 350px; margin: 0 auto;"></iframe>');
        document.write('<iframe id="newest" src="http://' + domain + '.wikidot.com/chat:_newest" style="display: none;"></iframe>');
    </script>
</body>
</html>

Update Check

<html>
<head>
    <title>Update Check</title>
</head>
<body>
    <script type="text/javascript">
        if (parent.parent.location.hash != window.location.hash) {
            parent.parent.location.href = 'http://' +parent.parent.location.hostname + parent.parent.location.pathname + window.location.hash;
            parent.parent.location.reload();
        }
    </script>
</body>
</html>

Post Comment Refresh

<html>
<head>
    <title>Chatroom New Comment Refresh</title>
</head>
<body>
    <script type="text/javascript">
        var dom_params = /^(.*)\.wdfiles\.com$/;
        var domain = dom_params.exec(window.location.host)[1];
        parent.parent.location.href = 'http://' + domain + '.wikidot.com/chatroom';
    </script>
</body>
</html>

Active Users

<html>
<head>
    <title>Chatroom Active Users</title>
</head>
<body>
    <script type="text/javascript">
        <!--
        /* Remove duplicate elements from array function taken from:
        http://www.martienus.com/code/javascript-remove-duplicates-from-array.html
        */
        function unique(a) {
            var r = new Array();
            o:for(var i = 0, n = a.length; i < n; i++) {
                for(var x = 0, y = r.length; x < y; x++) {
                    if(r[x]==a[i]) continue o;
                }
                r[r.length] = a[i];
            }
            return r;
        }
        //-->
        var dom_params = /^(.*)\.wdfiles\.com$/;
        var domain = dom_params.exec(window.location.host)[1];
        var newCSS = document.createElement('link');
        newCSS.rel = 'stylesheet';
        newCSS.href = 'data:text/css,' + escape('@import url("http://' + domain +'.wdfiles.com/local--code/chat:_css");');
        document.getElementsByTagName("head")[0].appendChild(newCSS);
 
        var string_users = unescape(window.location.hash);
        var users = new Array();
        var tmp_count = 0;
 
        while (0<=string_users.search(/#/)) {
            string_users = string_users.substring(string_users.search(/#/)+1);
            users[tmp_count] = string_users.substring(string_users.search(/#/)+1);
            if (0<=string_users.search(/#/))
                users[tmp_count] = string_users.substring(0,string_users.search(/#/));
            tmp_count = tmp_count+1;
        }
 
        users = unique(users);
        for (tmp_count=0;tmp_count<=users.length-1;tmp_count++) {
            document.write('<span class="active-users">' + users[tmp_count] + '</span><br />');
        }
    </script>
</body>
</html>
Sofern nicht anders angegeben, steht der Inhalt dieser Seite unter Lizenz Creative Commons Attribution-ShareAlike 3.0 License