Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
180 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1>#{tMapTitle tm} | ||
$forall topic <- mtopic | ||
^{addHamlet $ renderContent (topicContentFormat topic) (topicContentContent topic)} | ||
^{addHamlet $ renderContent (fst topic) (topicContentFormat $ snd topic) (topicContentContent $ snd topic)} | ||
^{showTOC tocs} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
$(function(){ | ||
$.each($(".hascomments"), function(i, e){ | ||
var x = $(e); | ||
var y = x.attr("id").split("-"); | ||
$.getJSON("@{CommentCountR}", {topic:y[1], element:y[2]}, function(z){ | ||
var c = z.count == 1 ? "comment" : "comments"; | ||
x.append(" <a class='commentlink'> " + z.count + " " + c + "</a>"); // TRANS | ||
var notLoaded = true; | ||
var open = function(){ | ||
if (notLoaded) { | ||
notLoaded = false; | ||
x.after("<div class='comments'>Loading...</div>"); | ||
$.getJSON("@{CommentsR}", {topic:y[1], element:y[2]}, function(comments){ | ||
var html = ["<dl>"]; | ||
$.each(comments.comments, function(i, comment){ | ||
html.push("<dt>"); | ||
html.push(comment.name); | ||
html.push(" <i>"); | ||
html.push(comment.date); | ||
html.push("</i></dt><dd>"); | ||
html.push(comment.content); | ||
html.push("</dd></dt>"); | ||
}); | ||
html.push("</dl>"); | ||
if (comments.loggedin) { | ||
html.push("<form method='post' action='@{CommentsR}?topic=" + y[1] + "&element=" + y[2] + "'>"); | ||
html.push("<input type='hidden' name='source' value='" + document.location + "'>"); | ||
html.push("<textarea name='content' placeholder='Enter your comment here'></textarea>"); | ||
html.push("<input type='submit' value='Add comment'>"); | ||
html.push("</form>"); | ||
} else { | ||
html.push("<p>You must be <a href='@{AuthR LoginR}'>logged in</a> to comment.</p>"); | ||
} | ||
x.next().html(html.join("")); | ||
}); | ||
} else { | ||
x.next().toggleClass("hidden"); | ||
} | ||
} | ||
x.children("a.commentlink").click(open); | ||
if (document.location.hash == "#" + x.attr("id")) open(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
a.commentlink { | ||
font-size: 0.7em; | ||
color: #666; | ||
cursor: pointer; | ||
} | ||
|
||
div.comments { | ||
margin-left: 1em; | ||
border: 1px solid #666; | ||
padding: 0.5em; | ||
} | ||
|
||
div.comments.hidden { | ||
display: none; | ||
} | ||
|
||
div.comments input { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,3 +99,5 @@ executable yesodwiki | |
, random | ||
, old-locale | ||
, base64-bytestring | ||
, yesod-json | ||
, blaze-html |