integrate codepress, just a crude way for now
authorChristian Thaeter <ct@pipapo.org>
Wed, 30 Jan 2008 02:31:39 +0000 (03:31 +0100)
committerChristian Thaeter <ct@pipapo.org>
Wed, 30 Jan 2008 02:31:39 +0000 (03:31 +0100)
src/object_blob.c
src/webgit.c

index 30ba243..d726d1e 100644 (file)
@@ -51,7 +51,16 @@ webgit_object_blob_content_action (struct webgit_repo_info* repo, unsigned char*
 
   if (!memchr(buf, 0, size>8192 ? 8192 : size))
     {
-      return html (html_tag ("pre"), html_strndup (buf, size));
+      return html (
+                   html_tag ("textarea",
+                             html_attr ("id", "blob"),
+                             html_attr ("name", "blob"),
+                             html_attr ("class", "codepress generic readonly-on"),
+                             html_attr ("wrap", "off"),
+                             html_attr ("style", "width:100%;height:600px")
+                             ),
+                   html_strndup (buf, size)
+                   );
     }
   else
     {
index d3265e1..9b41f22 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "webgit.h"
 
+#define ENABLE_CODEPRESS 1
+
 #define WEBGIT_CONFIG "./webgit.conf"
 
 #ifndef WEBGIT_CONFIG
@@ -312,6 +314,15 @@ main (int argc, char**argv)
                                                   html_link_rel("icon", "image/png",
                                                                 webgit_webskinpath (&query, "icons/favicon.png")
                                                                 )
+#ifdef ENABLE_CODEPRESS
+                                                  , html (
+                                                          html_tag ("script",
+                                                                    html_attr ("src", "/codepress/codepress.js"),
+                                                                    html_attr ("type", "text/javascript")
+                                                                    )
+                                                          )
+#endif
+
                                                   ),
                                              /*body*/
                                              html (