padding: 1ex 0px;
border-bottom: solid 1px #ccc;
clear: both;
+ position: relative;
}
#sone .post.new {
border-bottom: none;
}
+#sone .post .sone-menu {
+ position: absolute;
+ top: 0;
+ left: -1ex;
+ padding: 1ex 1ex;
+ margin: -1px -1px;
+ display: none;
+ background-color: rgb(255, 255, 224);
+ border: solid 1px rgb(0, 0, 0);
+ z-index: 1;
+}
+
+#sone .post .sone-menu .avatar {
+ position: absolute;
+ margin-right: 1ex;
+}
+
+#sone .post .sone-menu .inner-menu {
+ margin-left: 64px;
+ padding-left: 1ex;
+ min-height: 64px;
+}
+
+#sone .sone-menu .follow, #sone .sone-menu .unfollow {
+ cursor: pointer;
+}
+
#sone .post > .avatar {
position: absolute;
}
font-weight: bold;
}
+#sone .post .author-wot-link {
+ font-size: 90%;
+}
+
#sone .post .text, #sone .post .raw-text, #sone .post .short-text {
display: inline;
white-space: pre-wrap;
}
#sone .post .reply {
+ position: relative;
clear: both;
background-color: #f0f0ff;
- font-size: 85%;
margin: 1ex 0px;
padding: 1ex;
}
+#sone .post .reply .inner-part {
+ font-size: 85%;
+}
+
#sone .post .reply.new {
background-color: #ffffa0;
}
}
/**
+ * Returns the ID of the sone of the context menu that contains the given
+ * element.
+ *
+ * @param element
+ * The element within a context menu to get the Sone ID for
+ * @return The Sone ID
+ */
+function getMenuSone(element) {
+ return $(element).closest(".sone-menu").find(".sone-id").text();
+}
+
+/**
* Generates a list of Sones by concatening the names of the given sones with a
* new line character (“\n”).
*
/* hide reply input field. */
$(postElement).find(".create-reply").addClass("hidden");
+
+ /* show Sone menu when hovering over the avatar. */
+ $(postElement).find(".post-avatar").mouseover(function() {
+ $(".sone-post-menu", postElement).mouseleave(function() {
+ $(this).fadeOut();
+ }).fadeIn();
+ return false;
+ });
+ (function(postElement) {
+ var soneId = $(".sone-id", postElement).text();
+ $(".sone-post-menu .follow", postElement).click(function() {
+ var followElement = this;
+ ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
+ $(followElement).addClass("hidden");
+ $(followElement).parent().find(".unfollow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", true);
+ $(".unfollow", this).toggleClass("hidden", false);
+ }
+ });
+ });
+ return false;
+ });
+ $(".sone-post-menu .unfollow", postElement).click(function() {
+ var unfollowElement = this;
+ ajaxGet("unfollowSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
+ $(unfollowElement).addClass("hidden");
+ $(unfollowElement).parent().find(".follow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", false);
+ $(".unfollow", this).toggleClass("hidden", true);
+ }
+ });
+ });
+ return false;
+ });
+ })(postElement);
}
/**
untrustSone(getReplyAuthor(this));
return false;
});
+
+ /* show Sone menu when hovering over the avatar. */
+ $(replyElement).find(".reply-avatar").mouseover(function() {
+ $(".sone-reply-menu", replyElement).mouseleave(function() {
+ $(this).fadeOut();
+ }).fadeIn();
+ return false;
+ });
+ (function(replyElement) {
+ var soneId = $(".sone-id", replyElement).text();
+ $(".sone-menu .follow", replyElement).click(function() {
+ var followElement = this;
+ ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
+ $(followElement).addClass("hidden");
+ $(followElement).parent().find(".unfollow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", true);
+ $(".unfollow", this).toggleClass("hidden", false);
+ }
+ });
+ });
+ return false;
+ });
+ $(".sone-menu .unfollow", replyElement).click(function() {
+ var unfollowElement = this;
+ ajaxGet("unfollowSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
+ $(unfollowElement).addClass("hidden");
+ $(unfollowElement).parent().find(".follow").removeClass("hidden");
+ $("#sone .sone-menu").each(function() {
+ if (getMenuSone(this) == soneId) {
+ $(".follow", this).toggleClass("hidden", false);
+ $(".unfollow", this).toggleClass("hidden", true);
+ }
+ });
+ });
+ return false;
+ });
+ })(replyElement);
}
/**