Changeset - d5c834766ce9
[Not reviewed]
default
2 1 2
Drew Perttula - 9 years ago 2016-05-30 22:03:23
drewp@bigasterisk.com
rdfdb xhtml -> html
Ignore-this: a82386c15ae7789b56b56ac4e8208d28
3 files changed with 11 insertions and 19 deletions:
0 comments (0 inline, 0 general)
bin/rdfdb
Show inline comments
 
@@ -390,28 +390,28 @@ class Live(cyclone.websocket.WebSocketHa
 
        liveClients.add(self)
 
        self.settings.db.sendClientsToAllLivePages()
 

	
 
    def connectionLost(self, reason):
 
        log.info("websocket closed")
 
        liveClients.remove(self)
 

	
 
    def messageReceived(self, message):
 
        log.info("got message %s" % message)
 
        self.sendMessage(message)
 

	
 
class NoExts(cyclone.web.StaticFileHandler):
 
    # .xhtml pages can be get() without .xhtml on them
 
    # .html pages can be get() without .html on them
 
    def get(self, path, *args, **kw):
 
        if path and '.' not in path:
 
            path = path + ".xhtml"
 
            path = path + ".html"
 
        cyclone.web.StaticFileHandler.get(self, path, *args, **kw)
 

	
 
if __name__ == "__main__":
 
    logging.basicConfig()
 
    log = logging.getLogger()
 

	
 
    parser = optparse.OptionParser()
 
    parser.add_option("-v", "--verbose", action="store_true",
 
                      help="logging.DEBUG")
 
    (options, args) = parser.parse_args()
 

	
 
    log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
 
@@ -421,17 +421,17 @@ if __name__ == "__main__":
 

	
 
    from twisted.python import log as twlog
 
    twlog.startLogging(sys.stdout)
 

	
 
    reactor.listenTCP(networking.rdfdb.port, cyclone.web.Application(handlers=[
 
        (r'/live', Live),
 
        (r'/graph', GraphResource),
 
        (r'/patches', Patches),
 
        (r'/graphClients', GraphClients),
 

	
 
        (r'/(.*)', NoExts,
 
         {"path" : "light9/rdfdb/web",
 
          "default_filename" : "index.xhtml"}),
 
          "default_filename" : "index.html"}),
 

	
 
        ], debug=True, db=db))
 
    log.info("serving on %s" % networking.rdfdb.port)
 
    prof.run(reactor.run, profile=None)
light9/rdfdb/web/graphView.html
Show inline comments
 
file renamed from light9/rdfdb/web/graphView.xhtml to light9/rdfdb/web/graphView.html
 
<?xml version="1.0" encoding="utf-8"?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<!DOCTYPE html>
 
<html>
 
  <head>
 
    <title>graphview</title>
 
    <link rel="stylesheet" type="text/css" href="/style.css"/>
 
    <link rel="stylesheet" type="text/css" href="/style.css">
 

	
 
  </head>
 
  <body>
 
    <!--
 
        this page is another graph client who maintains the whole
 
        graph all the time
 
    -->
 

	
 
    <div id="status">starting...</div>
 
    
 
    <fieldset>
 
      <legend>Messages</legend>
 
      <div id="out"></div>
 
    </fieldset>
 

	
 
    <p>URI substring: <input type="text" id="uriSubstring"/></p>
 
    <p>URI substring: <input type="text" id="uriSubstring"></p>
 

	
 
    <table>
 
      <thead>
 
        <tr>
 
          <th>subject</th> <th>predicate</th> <th>object</th> <th>context</th>
 
        </tr>
 
      </thead>
 
      <tbody>
 
      </tbody>
 
    </table>
 

	
 
    <script type="text/javascript" src="/lib/jquery/dist/jquery.min.js"></script>
 
    <script type="text/javascript" src="/websocket.js"></script>
 
    <script type="text/javascript" src="syncedgraph.js"></script>
 
    <script type="text/javascript">
 
      // <![CDATA[
 
      $(function(){
 

	
 
      });
 
      // ]]>
 
    </script>
 
  </body>
 
</html>
light9/rdfdb/web/index.html
Show inline comments
 
file renamed from light9/rdfdb/web/index.xhtml to light9/rdfdb/web/index.html
 
<?xml version="1.0" encoding="utf8"?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<!DOCTYPE html>
 
<html>
 
  <head>
 
    <title>rdfdb</title>
 
    <link rel="stylesheet" type="text/css" href="/style.css"/>
 
    <link rel="stylesheet" type="text/css" href="/style.css">
 
  </head>
 
  <body>
 
    <h1>rdfdb</h1>
 
    <div id="status">starting...</div>
 
    
 
    <section>
 
      <h2>Edits</h2>
 
      <div id="patches"></div>
 
    </section>
 

	
 
    <p>Clients: <span id="clients"/></p>
 
    <p>Clients: <span id="clients"></span></p>
 

	
 
    <fieldset>
 
      <legend>Messages</legend>
 
      <div id="out"></div>
 
    </fieldset>
 

	
 
    <script type="text/javascript" src="/lib/jquery/dist/jquery.min.js"></script>
 
    <script type="text/javascript" src="/websocket.js"></script>
 
    <script type="text/javascript">
 
      // <![CDATA[
 
      $(function(){
 

	
 
          function collapseCuries(s) {
 
            // this is temporary. The correct thing is to parse the quad (or receive it as a tree) and then make links to the full URIs and display curies of them
 

	
 
              return s
 
                  .replace(/<http:\/\/www.w3.org\/2001\/XMLSchema#(.*?)>/g, function (match, short) { return "xsd:"+short; })
 
                  .replace(/<http:\/\/light9.bigasterisk.com\/(.*?)>/g, function (match, short) { return "light9:"+short; })
 
                  .replace(/<http:\/\/light9.bigasterisk.com\/show\/dance2012\/sessions\/(.*?)>/g, function (match, short) { return "kcsession:"+short });
 
          }
 

	
 
          function onMessage(d) {
 
@@ -45,17 +42,16 @@
 
                  $("#patches").prepend(
 
                      $("<fieldset>").addClass("patch")
 
                          .append($("<legend>").text("Patch"))
 
                          .append($("<div>").addClass("deletes").text(collapseCuries(d.patch.deletes)))
 
                          .append($("<div>").addClass("adds").text(collapseCuries(d.patch.adds)))
 
                  );
 
              }
 

	
 
              $('#out').append($('<div>').text(JSON.stringify(d)));
 
          }
 
          reconnectingWebSocket("live", onMessage);
 
      });
 
      // ]]>
 
    </script>
 

	
 
  </body>
 
</html>
0 comments (0 inline, 0 general)