From: David ‘Bombe’ Roden Date: Tue, 27 Sep 2011 04:41:58 +0000 (+0200) Subject: Merge branch 'release-0.7.1' X-Git-Tag: 0.7.1^0 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=05f968bfa954585e942bbaff078d8932429f3175;hp=38cb6c5ec82298ee351d0eb15ddd8331db273af2 Merge branch 'release-0.7.1' --- diff --git a/pom.xml b/pom.xml index f494135..fa78bcb 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 net.pterodactylus sone - 0.7 + 0.7.1 net.pterodactylus diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index f21c1c2..8aa7487 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -83,7 +83,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr } /** The version. */ - public static final Version VERSION = new Version(0, 7); + public static final Version VERSION = new Version(0, 7, 1); /** The logger. */ private static final Logger logger = Logging.getLogger(SonePlugin.class); diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 283e156..7f53419 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -681,11 +681,11 @@ public class WebInterface implements CoreListener { pageToadlets.add(pageToadletFactory.createPageToadlet(new MoveProfileFieldAjaxPage(this))); ToadletContainer toadletContainer = sonePlugin.pluginRespirator().getToadletContainer(); - toadletContainer.getPageMaker().addNavigationCategory("/Sone/index.html", "Navigation.Menu.Name", "Navigation.Menu.Tooltip", sonePlugin); + toadletContainer.getPageMaker().addNavigationCategory("/Sone/index.html", "Navigation.Menu.Sone.Name", "Navigation.Menu.Sone.Tooltip", sonePlugin); for (PageToadlet toadlet : pageToadlets) { String menuName = toadlet.getMenuName(); if (menuName != null) { - toadletContainer.register(toadlet, "Navigation.Menu.Name", toadlet.path(), true, "Navigation.Menu.Item." + menuName + ".Name", "Navigation.Menu.Item." + menuName + ".Tooltip", false, toadlet); + toadletContainer.register(toadlet, "Navigation.Menu.Sone.Name", toadlet.path(), true, "Navigation.Menu.Sone.Item." + menuName + ".Name", "Navigation.Menu.Sone.Item." + menuName + ".Tooltip", false, toadlet); } else { toadletContainer.register(toadlet, null, toadlet.path(), true, false); } @@ -700,7 +700,7 @@ public class WebInterface implements CoreListener { for (PageToadlet pageToadlet : pageToadlets) { toadletContainer.unregister(pageToadlet); } - toadletContainer.getPageMaker().removeNavigationCategory("Navigation.Menu.Name"); + toadletContainer.getPageMaker().removeNavigationCategory("Navigation.Menu.Sone.Name"); } /** diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 75f9d41..4da0855 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -1,29 +1,29 @@ -Navigation.Menu.Name=Sone -Navigation.Menu.Tooltip=Freenet Social Network Plugin -Navigation.Menu.Item.Login.Name=Login -Navigation.Menu.Item.Login.Tooltip=Login to your Sone -Navigation.Menu.Item.Index.Name=Your Sone -Navigation.Menu.Item.Index.Tooltip=Show your Sone -Navigation.Menu.Item.CreateSone.Name=Create Sone -Navigation.Menu.Item.CreateSone.Tooltip=Create a new Sone -Navigation.Menu.Item.KnownSones.Name=Known Sones -Navigation.Menu.Item.KnownSones.Tooltip=Shows all known Sones -Navigation.Menu.Item.Bookmarks.Name=Bookmarks -Navigation.Menu.Item.Bookmarks.Tooltip=Show bookmarked posts -Navigation.Menu.Item.EditProfile.Name=Edit Profile -Navigation.Menu.Item.EditProfile.Tooltip=Edit the Profile of your Sone -Navigation.Menu.Item.ImageBrowser.Name=Images -Navigation.Menu.Item.ImageBrowser.Tooltip=Manages your Images -Navigation.Menu.Item.DeleteSone.Name=Delete Sone -Navigation.Menu.Item.DeleteSone.Tooltip=Deletes the current Sone -Navigation.Menu.Item.Logout.Name=Logout -Navigation.Menu.Item.Logout.Tooltip=Logs you out of the current Sone -Navigation.Menu.Item.Options.Name=Options -Navigation.Menu.Item.Options.Tooltip=Options for the Sone plugin -Navigation.Menu.Item.Rescue.Name=Rescue -Navigation.Menu.Item.Rescue.Tooltip=Rescue Sone -Navigation.Menu.Item.About.Name=About -Navigation.Menu.Item.About.Tooltip=Information about Sone +Navigation.Menu.Sone.Name=Sone +Navigation.Menu.Sone.Tooltip=Freenet Social Network Plugin +Navigation.Menu.Sone.Item.Login.Name=Login +Navigation.Menu.Sone.Item.Login.Tooltip=Login to your Sone +Navigation.Menu.Sone.Item.Index.Name=Your Sone +Navigation.Menu.Sone.Item.Index.Tooltip=Show your Sone +Navigation.Menu.Sone.Item.CreateSone.Name=Create Sone +Navigation.Menu.Sone.Item.CreateSone.Tooltip=Create a new Sone +Navigation.Menu.Sone.Item.KnownSones.Name=Known Sones +Navigation.Menu.Sone.Item.KnownSones.Tooltip=Shows all known Sones +Navigation.Menu.Sone.Item.Bookmarks.Name=Bookmarks +Navigation.Menu.Sone.Item.Bookmarks.Tooltip=Show bookmarked posts +Navigation.Menu.Sone.Item.EditProfile.Name=Edit Profile +Navigation.Menu.Sone.Item.EditProfile.Tooltip=Edit the Profile of your Sone +Navigation.Menu.Sone.Item.ImageBrowser.Name=Images +Navigation.Menu.Sone.Item.ImageBrowser.Tooltip=Manages your Images +Navigation.Menu.Sone.Item.DeleteSone.Name=Delete Sone +Navigation.Menu.Sone.Item.DeleteSone.Tooltip=Deletes the current Sone +Navigation.Menu.Sone.Item.Logout.Name=Logout +Navigation.Menu.Sone.Item.Logout.Tooltip=Logs you out of the current Sone +Navigation.Menu.Sone.Item.Options.Name=Options +Navigation.Menu.Sone.Item.Options.Tooltip=Options for the Sone plugin +Navigation.Menu.Sone.Item.Rescue.Name=Rescue +Navigation.Menu.Sone.Item.Rescue.Tooltip=Rescue Sone +Navigation.Menu.Sone.Item.About.Name=About +Navigation.Menu.Sone.Item.About.Tooltip=Information about Sone Page.About.Title=About - Sone Page.About.Page.Title=About diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index bfb925b..bbd039c 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -70,7 +70,7 @@ function addCommentLink(postId, author, element, insertAfterThisElement) { commentElement = (function(postId, author) { separator = $(" · ").addClass("separator"); var commentElement = $("
Comment
").addClass("show-reply-form").click(function() { - replyElement = $("#sone .post#" + postId + " .create-reply"); + replyElement = $("#sone .post#post-" + postId + " .create-reply"); replyElement.removeClass("hidden"); replyElement.removeClass("light"); (function(replyElement) { @@ -214,7 +214,7 @@ function enhanceDeletePostButton(button, postId, text) { return; } if (data.success) { - $("#sone .post#" + postId).slideUp(); + $("#sone .post#post-" + postId).slideUp(); } else if (data.error == "invalid-post-id") { /* pretend the post is already gone. */ getPost(postId).slideUp(); @@ -246,7 +246,7 @@ function enhanceDeleteReplyButton(button, replyId, text) { return; } if (data.success) { - $("#sone .reply#" + replyId).slideUp(); + $("#sone .reply#reply-" + replyId).slideUp(); } else if (data.error == "invalid-reply-id") { /* pretend the reply is already gone. */ getReply(replyId).slideUp(); @@ -332,7 +332,7 @@ function getSoneId(element) { * @returns The element of the post */ function getPost(postId) { - return $("#sone .post#" + postId); + return $("#sone .post#post-" + postId); } function getPostElement(element) { @@ -340,7 +340,7 @@ function getPostElement(element) { } function getPostId(element) { - return getPostElement(element).attr("id"); + return getPostElement(element).attr("id").substr(5); } function getPostTime(element) { @@ -366,7 +366,7 @@ function getPostAuthor(element) { * @returns The element of the reply */ function getReply(replyId) { - return $("#sone .reply#" + replyId); + return $("#sone .reply#reply-" + replyId); } function getReplyElement(element) { @@ -374,7 +374,7 @@ function getReplyElement(element) { } function getReplyId(element) { - return getReplyElement(element).attr("id"); + return getReplyElement(element).attr("id").substr(6); } function getReplyTime(element) { @@ -441,8 +441,8 @@ function likePost(postId) { if ((data == null) || !data.success) { return; } - $("#sone .post#" + postId + " > .inner-part > .status-line .like").addClass("hidden"); - $("#sone .post#" + postId + " > .inner-part > .status-line .unlike").removeClass("hidden"); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .like").addClass("hidden"); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .unlike").removeClass("hidden"); updatePostLikes(postId); }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -454,8 +454,8 @@ function unlikePost(postId) { if ((data == null) || !data.success) { return; } - $("#sone .post#" + postId + " > .inner-part > .status-line .unlike").addClass("hidden"); - $("#sone .post#" + postId + " > .inner-part > .status-line .like").removeClass("hidden"); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .unlike").addClass("hidden"); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .like").removeClass("hidden"); updatePostLikes(postId); }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -465,9 +465,9 @@ function unlikePost(postId) { function updatePostLikes(postId) { ajaxGet("getLikes.ajax", { "type": "post", "post": postId }, function(data, textStatus) { if ((data != null) && data.success) { - $("#sone .post#" + postId + " > .inner-part > .status-line .likes").toggleClass("hidden", data.likes == 0); - $("#sone .post#" + postId + " > .inner-part > .status-line .likes span.like-count").text(data.likes); - $("#sone .post#" + postId + " > .inner-part > .status-line .likes > span").attr("title", generateSoneList(data.sones)); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .likes").toggleClass("hidden", data.likes == 0); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .likes span.like-count").text(data.likes); + $("#sone .post#post-" + postId + " > .inner-part > .status-line .likes > span").attr("title", generateSoneList(data.sones)); } }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -479,8 +479,8 @@ function likeReply(replyId) { if ((data == null) || !data.success) { return; } - $("#sone .reply#" + replyId + " .status-line .like").addClass("hidden"); - $("#sone .reply#" + replyId + " .status-line .unlike").removeClass("hidden"); + $("#sone .reply#reply-" + replyId + " .status-line .like").addClass("hidden"); + $("#sone .reply#reply-" + replyId + " .status-line .unlike").removeClass("hidden"); updateReplyLikes(replyId); }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -492,8 +492,8 @@ function unlikeReply(replyId) { if ((data == null) || !data.success) { return; } - $("#sone .reply#" + replyId + " .status-line .unlike").addClass("hidden"); - $("#sone .reply#" + replyId + " .status-line .like").removeClass("hidden"); + $("#sone .reply#reply-" + replyId + " .status-line .unlike").addClass("hidden"); + $("#sone .reply#reply-" + replyId + " .status-line .like").removeClass("hidden"); updateReplyLikes(replyId); }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -603,9 +603,9 @@ function unbookmarkPost(postId) { function updateReplyLikes(replyId) { ajaxGet("getLikes.ajax", { "type": "reply", "reply": replyId }, function(data, textStatus) { if ((data != null) && data.success) { - $("#sone .reply#" + replyId + " .status-line .likes").toggleClass("hidden", data.likes == 0); - $("#sone .reply#" + replyId + " .status-line .likes span.like-count").text(data.likes); - $("#sone .reply#" + replyId + " .status-line .likes > span").attr("title", generateSoneList(data.sones)); + $("#sone .reply#reply-" + replyId + " .status-line .likes").toggleClass("hidden", data.likes == 0); + $("#sone .reply#reply-" + replyId + " .status-line .likes span.like-count").text(data.likes); + $("#sone .reply#reply-" + replyId + " .status-line .likes > span").attr("title", generateSoneList(data.sones)); } }, function(xmlHttpRequest, textStatus, error) { /* ignore error. */ @@ -713,10 +713,10 @@ function ajaxifyPost(postElement) { if (success) { $(inputField).val(""); loadNewReply(replyId, soneId, postId); - $("#sone .post#" + postId + " .create-reply").addClass("hidden"); - $("#sone .post#" + postId + " .create-reply .sender").hide(); - $("#sone .post#" + postId + " .create-reply .select-sender").show(); - $("#sone .post#" + postId + " .create-reply :input[name=sender]").val(getCurrentSoneId()); + $("#sone .post#post-" + postId + " .create-reply").addClass("hidden"); + $("#sone .post#post-" + postId + " .create-reply .sender").hide(); + $("#sone .post#post-" + postId + " .create-reply .select-sender").show(); + $("#sone .post#post-" + postId + " .create-reply :input[name=sender]").val(getCurrentSoneId()); } else { alert(error); } @@ -1389,7 +1389,7 @@ function isKnownSonesPage() { * exists on the page, false otherwise */ function hasPost(postId) { - return $(".post#" + postId).length > 0; + return $(".post#post-" + postId).length > 0; } /** @@ -1401,7 +1401,7 @@ function hasPost(postId) { * exists on the page, false otherwise */ function hasReply(replyId) { - return $("#sone .reply#" + replyId).length > 0; + return $("#sone .reply#reply-" + replyId).length > 0; } function loadNewPost(postId, soneId, recipientId, time) { @@ -1461,7 +1461,7 @@ function loadNewReply(replyId, soneId, postId, postSoneId) { if (hasReply(data.reply.id)) { return; } - $("#sone .post#" + data.reply.postId).each(function() { + $("#sone .post#post-" + data.reply.postId).each(function() { var firstNewerReply = null; $(this).find(".replies .reply").each(function() { if (getReplyTime(this) > data.reply.time) { diff --git a/src/main/resources/templates/include/soneMenu.html b/src/main/resources/templates/include/soneMenu.html index a1dd944..87114cc 100644 --- a/src/main/resources/templates/include/soneMenu.html +++ b/src/main/resources/templates/include/soneMenu.html @@ -15,7 +15,7 @@ <%if !sone.local>
-
<%/if> diff --git a/src/main/resources/templates/include/viewPost.html b/src/main/resources/templates/include/viewPost.html index 89a8ba5..931365d 100644 --- a/src/main/resources/templates/include/viewPost.html +++ b/src/main/resources/templates/include/viewPost.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/main/resources/templates/include/viewReply.html b/src/main/resources/templates/include/viewReply.html index ee7299e..ec62887 100644 --- a/src/main/resources/templates/include/viewReply.html +++ b/src/main/resources/templates/include/viewReply.html @@ -1,4 +1,4 @@ -
+