templates: Select only content from posts v0.10
authorLucian Mogosanu <lucian.mogosanu@gmail.com>
Mon, 29 Jan 2018 13:46:39 +0000 (15:46 +0200)
committerLucian Mogosanu <lucian.mogosanu@gmail.com>
Mon, 29 Jan 2018 13:46:39 +0000 (15:46 +0200)
templates/default.lisp
templates/post.lisp

index 16a9e01..66b8c31 100644 (file)
@@ -21,7 +21,7 @@ function scrollToHash() {
   if (document.location.hash.match(/#selection-[0-9.]+%/)) {
     var p = parseFloat(document.location.hash.substring(1));
     if (0 < p && p < 100 /*&& p%5 != 0*/) {
-      var content = document.getElementById(\"content\")
+      var content = document.getElementById(\"shash\")
       var y = findPos(content) + (content.offsetHeight)*p/100;
       window.scrollTo(0, y-16);
     }
@@ -45,7 +45,7 @@ function scrollToHash() {
       artificial.previousSibling.data += artificial.childNodes[0].data;
       artificial.parentNode.removeChild(artificial);
     }
-    var content = document.getElementById(\"content\");
+    var content = document.getElementById(\"shash\");
     recur(content);
     if (begin!=null && end!=null) {
       // scroll to selection
@@ -112,7 +112,7 @@ document.onmousedown = document.onmouseup = function(e) {
         }
       }
 
-      var content = document.getElementById(\"content\");
+      var content = document.getElementById(\"shash\");
       recur(content);
       if (begin[0]>0 && end[0]>0) {
         newhash = \"selection-\"+begin[0]+\".\"+begin[1]+\"-\"+end[0]+\".\"+end[1];
index 184f711..9252a97 100644 (file)
   (let ((new-body
          (with-output-to-string (out)
            (cl-who:with-html-output (out nil :indent nil)
-             (cl-who:htm (:div :class "info"
-                               (:sup (cl-who:str (gethash "postid" blist)))
-                               (cl-who:str (format nil "~%"))
-                               (cl-who:str (gethash "date" blist))
-                               (cl-who:str " -- ")
-                               (:span :class "tags"
-                                      (make-tag-list (gethash "tags" blist))))
-                         (cl-who:str (format nil "~%"))
-                         (cl-who:str (gethash "body" blist)))))))
+             (cl-who:htm (:span :id "shash"
+                                (:div :class "info"
+                                      (:sup (cl-who:str (gethash "postid" blist)))
+                                      (cl-who:str (format nil "~%"))
+                                      (cl-who:str (gethash "date" blist))
+                                      (cl-who:str " -- ")
+                                      (:span :class "tags"
+                                             (make-tag-list
+                                              (gethash "tags" blist))))
+                                (cl-who:str (format nil "~%"))
+                                (cl-who:str (gethash "body" blist))))))))
     (setf (gethash "body" blist) new-body)
     blist))