Browse files

Added a 'maximized' view. Closes #10.

  • Loading branch information...
1 parent 0f85fa3 commit 8edd464df1af097d3ce1cfb844eaaf48e1619a6d @Raynes Raynes committed Jan 6, 2012
Showing with 33 additions and 11 deletions.
  1. +8 −0 resources/public/css/refheap.css
  2. +13 −10 src/refheap/views/common.clj
  3. +12 −1 src/refheap/views/paste.clj
View
8 resources/public/css/refheap.css
@@ -14,6 +14,14 @@ body {
color: #DDD;
}
+body#fullscreen {
+ background-color: #202020;
+}
+
+#fullscreen div {
+ border: 0;
+}
+
a {
color: #A2B943;
text-decoration: none;
View
23 src/refheap/views/common.clj
@@ -19,18 +19,21 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();"))
+(defn header []
+ [:head
+ [:title "RefHeap"]
+ [:link {:rel "shortcut icon" :href "/img/favicon.ico"}]
+ (ph/include-css "http://fonts.googleapis.com/css?family=Open+Sans")
+ (ph/include-css "/css/refheap.css")
+ (ph/include-css "/css/native.css")
+ (ph/include-js "/js/jquery-1.7.1.min.js")
+ (ph/include-js "https://browserid.org/include.js")
+ (ph/include-js "/js/refheap.js")
+ (analytics)])
+
(defn layout [& content]
(ph/html5
- [:head
- [:title "RefHeap"]
- [:link {:rel "shortcut icon" :href "/img/favicon.ico"}]
- (ph/include-css "http://fonts.googleapis.com/css?family=Open+Sans")
- (ph/include-css "/css/refheap.css")
- (ph/include-css "/css/native.css")
- (ph/include-js "/js/jquery-1.7.1.min.js")
- (ph/include-js "https://browserid.org/include.js")
- (ph/include-js "/js/refheap.js")
- (analytics)]
+ (header)
[:body
[:div#site-container
[:div#header
View
13 src/refheap/views/paste.clj
@@ -1,6 +1,6 @@
(ns refheap.views.paste
(:use [noir.core :only [defpage defpartial]]
- [refheap.views.common :only [layout avatar page-buttons]]
+ [refheap.views.common :only [layout avatar page-buttons header]]
[noir.response :only [redirect content-type]]
[refheap.dates :only [date-string]])
(:require [refheap.models.paste :as paste]
@@ -59,6 +59,7 @@
(date-string date)
[:div#edit
(ph/link-to (str "/paste/" id "/raw") "raw")
+ (ph/link-to (str "/paste/" id "/fullscreen") "maximize")
(when (and user (= user (:id (session/get :user))))
(list
[:a {:href (str "/paste/" id "/edit")} "edit"]
@@ -67,6 +68,16 @@
contents]]
[:div.clear]))))
+(defn fullscreen-paste [id]
+ (when-let [contents (:contents (paste/get-paste id))]
+ (ph/html5
+ (header)
+ [:body#fullscreen
+ [:div.syntax contents]])))
+
+(defpage "/paste/:id/fullscreen" {:keys [id]}
+ (fullscreen-paste id))
+
(defn render-paste-preview [paste]
(let [{:keys [paste-id lines summary date user]} paste]
(list

0 comments on commit 8edd464

Please sign in to comment.