thirdparty/google_appengine/google/appengine/ext/admin/templates/interactive.html
changeset 149 f2e327a7c5de
parent 109 620f9b141567
equal deleted inserted replaced
148:37505d64e57b 149:f2e327a7c5de
     8 
     8 
     9 {% block head %}
     9 {% block head %}
    10   <style type="text/css">
    10   <style type="text/css">
    11 
    11 
    12   #console {
    12   #console {
       
    13     width: 100%;
    13     border-collapse: collapse;
    14     border-collapse: collapse;
    14   }
    15   }
    15 
    16 
    16   #console td {
    17   #console td {
    17     width: 50%;
    18     width: 50%;
    19     border: 0;
    20     border: 0;
    20     vertical-align: top;
    21     vertical-align: top;
    21     padding-right: 25px;
    22     padding-right: 25px;
    22   }
    23   }
    23 
    24 
       
    25   #code {
       
    26     overflow: auto;
       
    27     white-space: pre-wrap;
       
    28     word-wrap: break-word;
       
    29   }
       
    30 
    24   #output {
    31   #output {
    25     height: 350px;
    32     border: 1px solid silver;
    26     width: 100%;
    33     background-color: #f5f5f5;
    27     border: 0px;
    34     overflow: auto;
    28   }
    35   }
    29 
    36 
    30   #code, #output {
    37   #code, #output {
    31     font-family: "bogus font here", monospace;
    38     font-family: monospace;
    32     font-size: 10pt;
    39     font-size: 10pt;
       
    40     height: 25em;
       
    41     width: 100%;
       
    42     padding: 0;
       
    43     margin: 0;
    33   }
    44   }
    34 
    45 
    35   #code {
    46   #submitbutton {
    36     width: 100%;
    47     text-align: center;
    37     border: 1px solid silver;
    48     margin-top: 1em;
    38     background-color: #f5f5f5;
       
    39     padding: 0.5em;
       
    40   }
    49   }
    41 
       
    42   </style>
    50   </style>
    43 {% endblock %}
    51 {% endblock %}
    44 
    52 
    45 {% block body %}
    53 {% block body %}
    46 <h3>Interactive Console</h3>
    54 <h3>Interactive Console</h3>
    47 <table id="console">
    55 <form action="{{ interactive_execute_path }}" target="output" method="post">
    48   <tr>
    56   <table id="console">
    49     <td>
    57     <tr>
    50       <form action="{{ interactive_execute_path }}" target="output" method="post">
    58       <td>
    51         <div><textarea id="code" name="code" rows="20" cols="80"># Say hello to the current user
    59         <textarea id="code" name="code" wrap="off" rows="20" cols="80">from google.appengine.api import users
       
    60 
       
    61 # Say hello to the current user
    52 user = users.get_current_user()
    62 user = users.get_current_user()
    53 if user:
    63 if user:
    54   nickname = user.nickname()
    64   nickname = user.nickname()
    55 else:
    65 else:
    56   nickname = "guest"
    66   nickname = "guest"
    57 print "Hello, " + nickname
    67 print "Hello, " + nickname
    58 
    68 
    59 </textarea></div>
    69 </textarea>
    60         <div style="margin-top: 1em"><input type="submit" value="Run Program"/></div>
    70       </td>
    61       </form>
    71       <td>
    62     </td>
    72 	<iframe name="output" id="output"></iframe>
    63     <td>
    73       </td>
    64       <iframe name="output" id="output"></iframe>
    74     </tr>
    65     </td>
    75     <tr>
    66   </tr>
    76       <td>
    67 </table>
    77         <div id="submitbutton"><input type="submit" value="Run Program"/></div>
       
    78       </td>
       
    79     </tr>
       
    80   </table>
       
    81 </form>
       
    82 {% endblock %}
       
    83 
       
    84 {% block final %}
    68 <script type="text/javascript">
    85 <script type="text/javascript">
       
    86 //<![CDATA[
       
    87 var iframe = document.getElementById('output');
       
    88 var idoc = null;
       
    89 if (iframe.contentDocument) {
       
    90   // DOM
       
    91   idoc = iframe.contentDocument;
       
    92 } else if (iframe.contentWindow) {
       
    93   // IE
       
    94   idoc = iframe.contentWindow.document;
       
    95 }
       
    96 if (idoc) {
       
    97   idoc.open();
       
    98   idoc.write('<html><body style="background-color:#f5f5f5;margin:0;padding:0"><pre style="margin:0;padding:0;color:#888">Press "Run Program" to see the<br/>output of your code in this frame!</pre></body></html>');
       
    99   idoc.close();
       
   100 }
    69 document.getElementById('code').focus();
   101 document.getElementById('code').focus();
       
   102 //]]>
    70 </script>
   103 </script>
    71 {% endblock %}
   104 {% endblock %}