Source

dr-evil / src / index.html

Miki Tebeka 09df5b6 

































Miki Tebeka 58e09a8 
















Miki Tebeka 09df5b6 
Miki Tebeka 58e09a8 

Miki Tebeka 09df5b6 

Miki Tebeka 58e09a8 








Miki Tebeka 09df5b6 














<html>
    <head>
        <title>Dr. Evil Web Debugger</title>
        <style>
            body {
                margin: 50px;
                font-family: Monospace;
            }
            #log {
                border: 3px solid black;
                width: 100%;
                height: 500px;
                overflow: auto;
            }
            #entry {
                width: 80em;
            }
            div.error {
                color: red;
            }
        </style>
    </head>
    <body>
        <h1>Dr. Evil Web Debugger</h1>
        <div id="log"></div>
        <input id="entry" /> <button id="submit">Run</button>
    </body>
    <script
        src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">
    </script>
    <script
        src="http://flesler-plugins.googlecode.com/files/jquery.scrollTo-1.4.2-min.js">
    </script>
    <script>
        function append_log(div) {
            $('#log').append(div);
            $('#log').scrollTo(div);
        }

        function on_result(data) {
            var div = $('<div/>');
            if (data.error) {
                div.attr('class', 'error');
                if (data.result.length == 0) {
                    data.result = "Unknown Error!";
                }
            }
            div.text(data.result);
            append_log(div);
        }

        function on_run() {
            var expr = $.trim($('#entry').val());
            if (expr.length == 0) {
                return;
            }
            var div = $('<div/>').text('=> ' + expr);
            append_log(div);
            $.ajax({
                type: 'POST',
                url: '/',
                data: { "expr" : expr },
                success: on_result,
                dataType: 'json'
            });
        }

        function hook_enter_key(elem, handler) {
            elem.keyup(function(e) {
                if (e.keyCode == 13) {
                    handler();
                }
            });
        }

        $(document).ready(function() {
            $('#submit').click(on_run);
            hook_enter_key($('#entry'), on_run);
        });
    </script>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.