Permalink
Browse files

clyde pass 1

  • Loading branch information...
1 parent 669e749 commit 35a8756f7beab4760f2586ee29bd0e62a744d2b3 @lakshmivyas lakshmivyas committed Jan 15, 2010
Showing with 1,371 additions and 1 deletion.
  1. +3 −0 .gitmodules
  2. +78 −0 clyde.py
  3. +39 −0 clydeweb/media/clyde.css
  4. +1 −0 clydeweb/media/jstree/jquery.tree.min.js
  5. BIN clydeweb/media/jstree/themes/apple/bg.jpg
  6. BIN clydeweb/media/jstree/themes/apple/dot_for_ie.gif
  7. BIN clydeweb/media/jstree/themes/apple/file.png
  8. BIN clydeweb/media/jstree/themes/apple/icons.png
  9. +34 −0 clydeweb/media/jstree/themes/apple/style.css
  10. BIN clydeweb/media/jstree/themes/apple/throbber.gif
  11. +560 −0 clydeweb/media/markitup/jquery.markitup.js
  12. +9 −0 clydeweb/media/markitup/jquery.markitup.pack.js
  13. +67 −0 clydeweb/media/markitup/readme.txt
  14. BIN clydeweb/media/markitup/sets/default/images/bold.png
  15. BIN clydeweb/media/markitup/sets/default/images/clean.png
  16. BIN clydeweb/media/markitup/sets/default/images/image.png
  17. BIN clydeweb/media/markitup/sets/default/images/italic.png
  18. BIN clydeweb/media/markitup/sets/default/images/link.png
  19. BIN clydeweb/media/markitup/sets/default/images/picture.png
  20. BIN clydeweb/media/markitup/sets/default/images/preview.png
  21. BIN clydeweb/media/markitup/sets/default/images/stroke.png
  22. +27 −0 clydeweb/media/markitup/sets/default/set.js
  23. +27 −0 clydeweb/media/markitup/sets/default/style.css
  24. BIN clydeweb/media/markitup/skins/macosx/images/bg-container-white.png
  25. BIN clydeweb/media/markitup/skins/macosx/images/bg-container.png
  26. BIN clydeweb/media/markitup/skins/macosx/images/bg-footer-white.png
  27. BIN clydeweb/media/markitup/skins/macosx/images/bg-footer.png
  28. BIN clydeweb/media/markitup/skins/macosx/images/bg-header-white.png
  29. BIN clydeweb/media/markitup/skins/macosx/images/bg-header.png
  30. BIN clydeweb/media/markitup/skins/macosx/images/handle.png
  31. BIN clydeweb/media/markitup/skins/macosx/images/menu.png
  32. BIN clydeweb/media/markitup/skins/macosx/images/spacer.gif
  33. BIN clydeweb/media/markitup/skins/macosx/images/submenu.png
  34. +7 −0 clydeweb/media/markitup/skins/macosx/readme.txt
  35. +139 −0 clydeweb/media/markitup/skins/macosx/style.css
  36. BIN clydeweb/media/markitup/skins/markitup/images/bg-container.png
  37. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-bbcode.png
  38. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-dotclear.png
  39. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-html.png
  40. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-json.png
  41. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-markdown.png
  42. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-textile.png
  43. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-wiki.png
  44. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor-xml.png
  45. BIN clydeweb/media/markitup/skins/markitup/images/bg-editor.png
  46. BIN clydeweb/media/markitup/skins/markitup/images/handle.png
  47. BIN clydeweb/media/markitup/skins/markitup/images/menu.png
  48. BIN clydeweb/media/markitup/skins/markitup/images/submenu.png
  49. +148 −0 clydeweb/media/markitup/skins/markitup/style.css
  50. BIN clydeweb/media/markitup/skins/simple/images/handle.png
  51. BIN clydeweb/media/markitup/skins/simple/images/menu.png
  52. BIN clydeweb/media/markitup/skins/simple/images/submenu.png
  53. +118 −0 clydeweb/media/markitup/skins/simple/style.css
  54. +5 −0 clydeweb/media/markitup/templates/preview.css
  55. +11 −0 clydeweb/media/markitup/templates/preview.html
  56. +78 −0 clydeweb/templates/base.html
  57. +1 −0 clydeweb/templates/site.html
  58. +18 −1 hydeengine/siteinfo.py
  59. +1 −0 lib/tornado
View
@@ -0,0 +1,3 @@
+[submodule "lib/tornado"]
+ path = lib/tornado
+ url = git://github.com/facebook/tornado.git
View
@@ -0,0 +1,78 @@
+import os
+import sys
+import tornado.auth
+import tornado.httpserver
+import tornado.ioloop
+import tornado.options
+import tornado.web
+import simplejson as json
+import unicodedata
+
+from tornado.options import define, options
+from django.conf import settings
+from hydeengine import setup_env
+from hydeengine.siteinfo import SiteInfo
+
+define("port", default=8888, help="run on the given port", type=int)
+
+class Application(tornado.web.Application):
+ def __init__(self):
+ handlers = [
+ (r"/site/([^/]+)", SiteHandler),
+ (r"/site/([^/]+/files)", FilesJSONHandler),
+
+ ]
+ opts = dict(
+ static_path = os.path.join(os.path.dirname(__file__), "clydeweb/media"),
+ sites = dict(
+ mysite = "/Users/lakshmivyas/mysite"
+ )
+ )
+ tornado.web.Application.__init__(self, handlers, **opts)
+
+class FilesJSONHandler(tornado.web.RequestHandler):
+ def get(self, site):
+ if not hasattr(settings, 'siteinfo'):
+ setup_env('/Users/lakshmivyas/mysite')
+ siteinfo = SiteInfo(settings, '/Users/lakshmivyas/mysite')
+ siteinfo.refresh()
+ setattr(settings, 'siteinfo', siteinfo)
+ else:
+ siteinfo = settings.siteinfo
+ d = siteinfo.content_node.simple_dict
+ def jsresource(resource):
+ return dict(
+ attributes = dict(tooltip=resource['path'], rel='file'),
+ data = resource['name']
+ )
+ def jsnode(node):
+ children = [jsresource(resource) for resource in
+ node['resources']]
+ children.append([jsnode(child_node)
+ for child_node in node['nodes']])
+ return dict(
+ attributes = dict(tooltip=node['path']),
+ data = node['name'],
+ children=children,
+ state='open'
+ )
+ jsdict = jsnode(d)
+ jsonobj = json.dumps(jsdict)
+ self.set_header("Content-Type", "application/json")
+ self.write(jsonobj)
+
+class SiteHandler(tornado.web.RequestHandler):
+ def get(self, site):
+ self.render("clydeweb/templates/site.html")
+
+
+def main():
+ tornado.options.parse_command_line()
+ http_server = tornado.httpserver.HTTPServer(Application())
+ http_server.listen(options.port)
+ tornado.ioloop.IOLoop.instance().start()
+
+
+if __name__ == "__main__":
+ main()
+
View
@@ -0,0 +1,39 @@
+body{
+ margin: 32px;
+ font-family: Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+header{
+ clear:both;
+ height: 96px;
+}
+
+header h1{
+ font-weight: bold;
+ font-size: 12px;
+ float: left;
+}
+
+nav{
+ float: right;
+ margin-right: 32px;
+}
+
+nav ul{
+ list-style-type:none;
+}
+
+nav li{
+ float:left;
+ margin:0 16px;
+}
+
+aside{
+ float:left;
+ margin-right: 16px;
+}
+
+section{
+ float:left;
+}

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,34 @@
+/* BACKGROUND */
+.tree-apple .ltr, .tree-apple .rtl { background:url("bg.jpg") left top repeat; min-width:100%; _width:100%; margin-left:0; margin-right:0; display:table; }
+.tree-apple .ltr > li.leaf, .tree-apple .rtl > li.leaf { background-image:none; }
+
+/* LOCKED */
+.tree-apple .locked li a { color:gray; }
+/* DOTS */
+.tree-apple ul { background-position:6px 1px; background-repeat:repeat-y; background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); _background-image:url("dot_for_ie.gif"); *background-image:url("dot_for_ie.gif"); }
+.tree-apple li { background-position:-64px -16px; background-repeat:no-repeat; background-image:url("icons.png"); }
+/* NO DOTS */
+.tree-apple .no_dots, .tree-apple .no_dots ul { background:transparent; }
+.tree-apple .no_dots li.leaf { background-image:none; background-color:transparent; }
+/* OPEN or CLOSED */
+.tree-apple li.open { background:url("icons.png") -32px -48px no-repeat; }
+.tree-apple li.closed, #jstree-dragged.tree-apple li li.open { background:url("icons.png") -48px -32px no-repeat; }
+#jstree-marker { background-image:url("icons.png"); }
+/* DEFAULT, HOVER, CLICKED, LOADING STATES */
+.tree-apple li a, .tree-apple li span { border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px; }
+.tree-apple li a:hover, .tree-apple li a.hover, .tree-apple li span { background: #e7f4f9; border:1px solid #d8f0fa; padding:0px 3px 0px 3px; }
+.tree-apple li a.clicked, .tree-apple li a.clicked:hover, .tree-apple li span.clicked { background: #beebff; border:1px solid #99defd; padding:0px 3px 0px 3px; }
+/* ICONS */
+.tree-apple ins { background-image:url("icons.png"); background-position:0 0; background-repeat:no-repeat; }
+.tree-apple ul li a.loading ins { background-image:url("throbber.gif") !important; background-position:0 0 !important; } /* UL is added to make selector stronger */
+.tree-apple li a ins.forbidden { background-position:-16px -16px; }
+.tree-apple .locked li a ins { background-position:0 -48px; }
+.tree-apple li span ins { background-position:-16px 0; }
+#jstree-dragged.tree-apple ins { background:url("icons.png") -16px -32px no-repeat; }
+#jstree-dragged.tree-apple ins.forbidden { background:url("icons.png") -16px -16px no-repeat; }
+
+/* CONTEXT MENU */
+.tree-apple-context a ins { background-image:url("icons.png"); background-repeat:no-repeat; background-position:-64px -64px; }
+.tree-apple-context a ins.create { background-position:0 -16px; }
+.tree-apple-context a ins.rename { background-position:-16px 0px; }
+.tree-apple-context a ins.remove { background-position:0 -32px; }
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 35a8756

Please sign in to comment.