Add permalinks for posts and authors.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Apr 2011 18:39:11 +0000 (20:39 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Apr 2011 18:39:11 +0000 (20:39 +0200)
This fixes #136.

src/main/resources/i18n/sone.en.properties
src/main/resources/static/css/sone.css
src/main/resources/static/javascript/sone.js
src/main/resources/templates/include/viewPost.html
src/main/resources/templates/include/viewReply.html

index e726ccb..06d036a 100644 (file)
@@ -224,6 +224,8 @@ View.Sone.Status.Downloading=This Sone is currently being downloaded.
 View.Sone.Status.Inserting=This Sone is currently being inserted.
 
 View.Post.UnknownAuthor=(unknown)
+View.Post.Permalink=link post
+View.Post.PermalinkAuthor=link author
 View.Post.Bookmarks.PostIsBookmarked=Post is bookmarked, click to remove from bookmarks
 View.Post.Bookmarks.PostIsNotBookmarked=Post is not bookmarked, click to bookmark
 View.Post.DeleteLink=Delete
index f6bb62d..2621b50 100644 (file)
@@ -266,6 +266,10 @@ textarea {
        display: inline;
 }
 
+#sone .permalink {
+       display: inline;
+}
+
 #sone .post .bookmarks {
        display: inline;
        color: rgb(28, 131, 191);
index 8065b73..eb8fc74 100644 (file)
@@ -1692,6 +1692,11 @@ $(document).ready(function() {
                ajaxifyNotification($(this));
        });
 
+       /* disable all permalinks. */
+       $(".permalink").click(function() {
+               return false;
+       });
+
        /* activate status polling. */
        setTimeout(getStatus, 5000);
 
index 4be1bcc..40fa891 100644 (file)
                                </form>
                        </div>
                        <span class='separator'>·</span>
+                       <div class="permalink"><a href="post://<%post.id|html>">[<%= View.Post.Permalink|l10n|html>]</a></div>
+                       <span class='separator'>·</span>
+                       <div class="permalink"><a href="sone://<%post.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
+                       <span class='separator'>·</span>
                        <div class="time"><a href="viewPost.html?post=<% post.id|html>"><% post.time|date format="MMM d, yyyy, HH:mm:ss"></a></div>
                        <%if ! originalText|match key=parsedText>
                                <span class='separator'>·</span>
index 5dc26fb..c5b087d 100644 (file)
@@ -14,6 +14,8 @@
                        <div class="reply-text text<%if raw> hidden<%/if>"><% parsedText></div>
                </div>
                <div class="reply-status-line status-line">
+                       <div class="permalink"><a href="sone://<%reply.sone.id|html>">[<%= View.Post.PermalinkAuthor|l10n|html>]</a></div>
+                       <span class='separator'>·</span>
                        <div class="time"><% reply.time|date format="MMM d, yyyy, HH:mm:ss"></div>
                        <%if ! originalText|match key=parsedText>
                                <span class='separator'>·</span>