Changeset 90411 in webkit


Ignore:
Timestamp:
Jul 5, 2011 3:54:50 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-07-05 Adam Barth <abarth@webkit.org>

Add basic ajax support to garden-o-matic
https://bugs.webkit.org/show_bug.cgi?id=63874

Reviewed by Eric Seidel.

This patch adds some basic infrastructure to garden-o-matic.
Currently, the infrastructure is just used to make the "quit" command
use Ajax, but in the future, this infrastructure will be used to do
more sophistocated remote proceedure calls.

  • Scripts/webkitpy/tool/servers/data/gardeningserver/index.html:
  • Scripts/webkitpy/tool/servers/data/gardeningserver/main.js: Added.
  • Scripts/webkitpy/tool/servers/gardeningserver.py:
  • Scripts/webkitpy/tool/servers/reflectionhandler.py:
Location:
trunk/Tools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90410 r90411  
     12011-07-05  Adam Barth  <abarth@webkit.org>
     2
     3        Add basic ajax support to garden-o-matic
     4        https://bugs.webkit.org/show_bug.cgi?id=63874
     5
     6        Reviewed by Eric Seidel.
     7
     8        This patch adds some basic infrastructure to garden-o-matic.
     9        Currently, the infrastructure is just used to make the "quit" command
     10        use Ajax, but in the future, this infrastructure will be used to do
     11        more sophistocated remote proceedure calls.
     12
     13        * Scripts/webkitpy/tool/servers/data/gardeningserver/index.html:
     14        * Scripts/webkitpy/tool/servers/data/gardeningserver/main.js: Added.
     15        * Scripts/webkitpy/tool/servers/gardeningserver.py:
     16        * Scripts/webkitpy/tool/servers/reflectionhandler.py:
     17
    1182011-07-05  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Tools/Scripts/webkitpy/tool/servers/data/gardeningserver/index.html

    r90410 r90411  
    1 <h1>Hello, world!</h1>
    2 <a href="/quitquitquit">Quit</a>
     1<!DOCTYPE html>
     2<html>
     3<head>
     4<title>Garden-O-Matic</title>
     5<style>
     6body {
     7  margin: 0;
     8  padding: 0px;
     9}
     10h1 {
     11  margin: 0px;
     12  padding: 3px;
     13  background-color: #EFF5FB;
     14}
     15.butterbar {
     16  width: 500px;
     17  margin-left: -250px;
     18  position: fixed;
     19  border-radius: 5px;
     20  top: 1px;
     21  left: 50%;
     22  padding: 3px;
     23  background-color: #F5F6CE;
     24}
     25.butterbar .hide {
     26  float: right;
     27}
     28</style>
     29</head>
     30<body>
     31<div class="butterbar"><span class="status">Loading...</span> <a class="hide" href="#">Dismiss</a></div>
     32<h1>Garden-O-Matic</h1>
     33<ul>
     34  <li><button class="quit">Quit</button></li>
     35</ul>
     36<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
     37<script src="main.js"></script>
     38</body>
     39</html>
  • trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py

    r90410 r90411  
    3838    STATIC_FILE_NAMES = frozenset([
    3939        "index.html",
     40        "main.js",
    4041    ])
    4142
  • trunk/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py

    r90337 r90411  
    8080
    8181    def quitquitquit(self):
     82        self._serve_text("Server quit.\n")
     83        # Shutdown has to happen on another thread from the server's thread,
     84        # otherwise there's a deadlock
     85        threading.Thread(target=lambda: self.server.shutdown()).start()
     86
     87    def _serve_text(self, html):
    8288        self.send_response(200)
    8389        self.send_header("Content-type", "text/plain")
    8490        self.end_headers()
    85         self.wfile.write("Quit.\n")
    86 
    87         # Shutdown has to happen on another thread from the server's thread,
    88         # otherwise there's a deadlock
    89         threading.Thread(target=lambda: self.server.shutdown()).start()
     91        self.wfile.write(html)
    9092
    9193    def _serve_json(self, json):
Note: See TracChangeset for help on using the changeset viewer.