Source: site.view [edit]
Function name: console
Arguments:
Description:
Page type: html
Render function:  
Module: siteutil

Page source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>WubHub</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  
  <link rel="stylesheet" type="text/css" href="/static/basic.css">

    <link rel="stylesheet" href="/static/ansi.css" type="text/css" media="all"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="/static/jqconsole.min.js"></script>
    <style>
      

        #console {
            height: 480px;
            width: 100%;
            position: relative;
            background-color: black;
            color: white;
            font-family: monospace;
            border: 2px solid #CCC;
            margin: 0 auto;
        }

        .jqconsole {
            padding: 10px;
            padding-bottom: 10px;
        }

        .jqconsole-cursor {
            background-color: #999;
        }

        .jqconsole-blurred .jqconsole-cursor {
            background-color: #666;
        }

        .jqconsole-prompt {
            color: #0d0;
        }

        .jqconsole-old-prompt {
            color: #0b0;
            font-weight: normal;
        }

        .jqconsole-input {
            color: #dd0;
        }

        .jqconsole-old-input {
            color: #bb0;
            font-weight: normal;
        }

        .brace {
            color: #00FFFF;
        }

        .paran {
            color: #FF00FF;
        }

        .bracket {
            color: #FFFF00;
        }

        .jqconsole-composition {
            background-color: red;
        }
    </style>
    <script>
        $(function () {

            var initConsole = function() {
                // Creating the console.
                var header = 'Welcome to the Collaborama WebScript Console\n';
                window.jqconsole = $('#console').jqconsole(header, '> ');
    
                // Abort prompt on Ctrl+Z.
                jqconsole.RegisterShortcut('Z', function () {
                    jqconsole.AbortPrompt();
                    handler();
                });
    
                // Move to line start Ctrl+A.
                jqconsole.RegisterShortcut('A', function () {
                    jqconsole.MoveToStart();
                    handler();
                });
    
                // Move to line end Ctrl+E.
                jqconsole.RegisterShortcut('E', function () {
                    jqconsole.MoveToEnd();
                    handler();
                });
    
                jqconsole.RegisterMatching('{', '}', 'brace');
                jqconsole.RegisterMatching('(', ')', 'paran');
                jqconsole.RegisterMatching('[', ']', 'bracket');
            }

            // Handle a command.
            var handler = function (command) {
                if (command) {
                    try {
                        // Assign handlers immediately after making the request,
                        // and remember the jqxhr object for this request
                                var jqxhr = $.ajax({dataType: "text",
                                               url: "/webl/WubHub_DoIt?cmdline=siteutil.consoleCmd(\"" 
                                                  + encodeURIComponent(command.replace(/["]/g,"|")) + "\")",
                                                    data: {},
                                                   success:
                               
                                function (data) {
                                  if (data == "clear;") {
                                    document.location.reload(false);
                                  }
                                  else {
                                    jqconsole.Write('==> ' + data + "\n");
                                  }
                                  // $.each(data, function(key, val) {
                                  //      console.log( key + ":" + val + "\n");
                                  //  });
                                }})
                                .error(function (error,msg) {
                                    alert("Error loading JSON: " + msg + "\n" + error.responseText);
                                })
                                .complete(function () {
                                    console.log("complete")
                                });
                    } catch (e) {
                        jqconsole.Write('ERROR: ' + e.message + '\n');
                    }
                }
                jqconsole.Prompt(true, handler, function (command) {
                    // Continue line if can't compile the command.
                    try {
                        Function(command);
                    } catch (e) {
                        return false;
                        if (/[\[\{\(]$/.test(command)) {
                            return 1;
                        } else {
                            return 0;
                        }
                    }
                    return false;
                });
            };

            // Initiate the first prompt.
            initConsole();
            handler();
        });


    </script>  
  
</head>
  
<body>
<div id="header">

<div id="logo">
  <a href="/webl/WubHub_DoIt?cmdline=home"><img src="/static/wubhub.png" alt="WubHub"></a>
<!-- 
  When uncommented, message will appear on every wubhub page




<font color=blue size=3>
&nbsp;&nbsp;&nbsp;&nbsp;

[SysMsg:]  WubHub will be shut down for upgrades in 0 minutes...
</font>


-->
</div>

<div id="cmdline">
<form name="wubhub" action="/webl/WubHub_DoIt" method="get">
  <input size="65" name="cmdline" title="Enter WubHub command">
  <input type="submit" value="Enter" title="Execute command">
</form>
</div>

<div id="navbar">
<ul>
  <li><a href="/webl/WubHub_DoIt?cmdline=site.about">About</a></li>
  <li><a href="/webl/WubHub_DoIt?cmdline=site.help">Help</a></li>
  <li><a href="/webl/WubHub_DoIt?cmdline=site.contact">Contact</a></li>
</ul>

<!-- User: <a href="/webl/WubHub_DoIt?cmdline=acheyer.profile">acheyer</a> [<a href="/webl/WubHub_DoIt?cmdline=site.logout">logout</a>] -->

</div>

</div>

<div id="content">
  <div id="main-text">
   <div id="console"></div>
  </div>
</div>

<div id="footer">
<!-- <p>Command: edit: edit &nbsp;&nbsp;&nbsp;<small>[<a href="/webl/WubHub_DoIt?cmdline=sandbox.addCmdToPortletCmd(acheyer.portletData,&quot;edit: edit&quot;,big)">Add to homepage</a>]</small></p>
-->
<p>Generated by WubHub (v. 0.6m)</p>
</div> 


</body>
</html>