Ignore:
Timestamp:
Oct 20, 2007, 8:28:32 AM (17 years ago)
Author:
ecprice
Message:

A monster checkin, with a variety of changes to the web
infrastructure.

Adds some support for javascript and asynchronous updates.

Also added prototype.

The interface is *really* *slow*, though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/templates/skeleton.tmpl

    r187 r205  
     1#from functions import functions
     2#extends functions
     3
     4#def full_body
     5<!DOCTYPE html
     6PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     7"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    18<html>
    29<head><title>$title</title>
     
    411  <link rel="stylesheet" href="static/style.css" type="text/css" />
    512  <link rel="stylesheet" href="static/layout.css" type="text/css" media="screen" />
     13  <script type="text/javascript" src="static/prototype.js"></script>
    614  <script type="text/javascript">
    715var helpWin = null;
     
    2028   return false;
    2129}
     30
     31Ajax.Responders.register({
     32  onCreate: function(){
     33    if (Ajax.activeRequestCount > 0) {
     34       document.getElementById("loadingnotice").style.display = 'block';
     35    }
     36  },
     37  onComplete: function(){
     38    if (Ajax.activeRequestCount == 0) {
     39      document.getElementById("loadingnotice").style.display = 'none';
     40    }
     41  }
     42});
     43function replaceFunc(transport) {
     44  try {
     45    d = transport.responseText.evalJSON();
     46  } catch (e) {
     47    \$('body').innerHTML = '<pre>'+transport.responseText+'</pre>'
     48    return;
     49  }
     50  for(key in d) {
     51    \$(key).innerHTML = d[key];
     52  }
     53}
     54
     55function jsFormSubmit(location, elt){
     56  new Ajax.Request(location, {method: 'post',
     57  parameters: Form.serialize(elt)+'&js=true',
     58  onSuccess: replaceFunc,
     59  onComplete: function() {Form.enable(elt);}
     60  });
     61  Form.disable(elt);
     62  return false;
     63}
     64
     65function rowFormSubmit(elt, retpage){
     66  new Ajax.Request('command', {method: 'post',
     67  parameters: Form.serialize(elt)+'&js='+retpage,
     68  onSuccess: replaceFunc
     69  });
     70  return false;
     71}
     72
     73window.onload = {
     74  //Fix bug with disabled elements
     75  $$('form').each(Form.enable);
     76}
     77
    2278</script>
    2379</head>
    24 <body>
     80<body id="body">
     81
     82<div id="err">
     83#if $varExists('error_text')
     84<p>STDERR:</p><pre>$error_text</pre>
     85#end if
     86</div>
     87
    2588#if not $varExists('simple') or not $simple
    2689<p>[You are logged in as $user.username.]</p>
     90
     91<div class="navigation">
    2792<p><a href="list">List</a>
    2893#if $varExists('machine')
     
    3297<a href="help">Help</a></p>
    3398#end if
     99</div>
     100
     101<div id="loadingnotice" class="loadingnotice">LOADING</div>
     102<div id="result" class="result"></div>
     103
    34104$body
    35105#if not $varExists('simple') or not $simple
     
    39109</body>
    40110</html>
     111#end def
Note: See TracChangeset for help on using the changeset viewer.