From 259aa84a924242fddccc20667d4a07a9713d208c Mon Sep 17 00:00:00 2001 From: Lucian Mogosanu Date: Mon, 29 Jan 2018 15:46:39 +0200 Subject: [PATCH] templates: Select only content from posts --- templates/default.lisp | 6 +++--- templates/post.lisp | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/templates/default.lisp b/templates/default.lisp index 16a9e01..66b8c31 100644 --- a/templates/default.lisp +++ b/templates/default.lisp @@ -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]; diff --git a/templates/post.lisp b/templates/post.lisp index 184f711..9252a97 100644 --- a/templates/post.lisp +++ b/templates/post.lisp @@ -42,15 +42,17 @@ (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)) -- 1.7.10.4