1 <div id="sone" class="<%ifnull ! currentSone>online<%else>offline<%/if>">
3 <div id="formPassword"><% formPassword|html></div>
5 <script src="javascript/jquery-1.4.2.js" language="javascript"></script>
6 <script src="javascript/sone.js" language="javascript"></script>
8 <script language="javascript">
9 /* this initializes the status update input field. */
10 $(document).ready(function() {
11 getTranslation("WebInterface.DefaultText.StatusUpdate", function(text) {
12 registerInputTextareaSwap("#sone #update-status .status-input", text, "text", false, false);
17 <script language="javascript">
18 /* these functions are necessary for updating Sone statuses. */
19 $(document).ready(function() {
20 $("#sone .sone").each(function() {
21 watchSone($(this).find(".id").text(), $(this).hasClass("local"));
26 <script language="javascript">
27 /* this initializes all reply input fields. */
28 $(document).ready(function() {
29 getTranslation("WebInterface.DefaultText.Reply", function(text) {
30 registerInputTextareaSwap("#sone input.reply-input", text, "text", false, false);
36 <script language="javascript">
37 /* replaces all “post reply!” forms with AJAX. */
38 $(document).ready(function() {
39 $("#sone .create-reply button:submit").click(function() {
40 $(this.form).submit(function() {
43 inputField = $(this.form).find(":input:enabled").get(0);
44 postId = getPostId($(inputField));
45 text = $(inputField).val();
46 $(inputField).val("");
47 postReply(postId, text, function(success, error, replyId) {
49 getReply(replyId, function(soneId, soneName, replyTime, replyDisplayTime, text, html) {
50 newReply = $(html).insertBefore("#sone .post#" + postId + " .create-reply");
51 $("#sone .post#" + postId + " .create-reply").addClass("hidden");
52 getTranslation("WebInterface.Confirmation.DeleteReplyButton", function(deleteReplyText) {
53 enhanceDeleteReplyButton("#sone .post#" + postId + " .reply#" + replyId + " .delete button", replyId, deleteReplyText);
55 newReply.find(".status-line .like").submit(function() {
56 likeReply(getReplyId(this));
59 newReply.find(".status-line .unlike").submit(function() {
60 unlikeReply(getReplyId(this));
63 addCommentLink(postId, newReply);
74 <script language="javascript">
75 /* replace all “delete” buttons with javascript. */
76 $(document).ready(function() {
77 getTranslation("WebInterface.Confirmation.DeletePostButton", function(text) {
78 deletePostText = text;
79 getTranslation("WebInterface.Confirmation.DeleteReplyButton", function(text) {
80 deleteReplyText = text;
81 $("#sone .post").each(function() {
82 postId = $(this).attr("id");
83 enhanceDeletePostButton("#sone .post#" + postId + " > .inner-part > .status-line .delete button", postId, deletePostText);
85 $("#sone .post#" + postId + " .reply").each(function() {
86 replyId = $(this).attr("id");
87 (function(postId, reply, replyId) {
88 reply.find(".delete button").each(function() {
89 enhanceDeleteReplyButton("#sone .post#" + postId + " .reply#" + replyId + " .delete button", replyId, deleteReplyText);
91 })(postId, $(this), replyId);
100 <script language="javascript">
101 /* hides all replies but the latest two. */
102 $(document).ready(function() {
103 getTranslation("WebInterface.ClickToShow.Replies", function(text) {
104 $("#sone .post .replies").each(function() {
105 allReplies = $(this).find(".reply");
106 if (allReplies.length > 2) {
108 for (replyIndex = 0; replyIndex < (allReplies.length - 2); ++replyIndex) {
109 $(allReplies[replyIndex]).addClass("hidden");
110 newHidden |= $(allReplies[replyIndex]).hasClass("new");
112 clickToShowElement = $("<div></div>").addClass("click-to-show");
114 clickToShowElement.addClass("new");
116 (function(clickToShowElement, allReplies, text) {
117 clickToShowElement.text(text);
118 clickToShowElement.click(function() {
119 allReplies.removeClass("hidden");
120 clickToShowElement.addClass("hidden");
122 })(clickToShowElement, allReplies, text);
123 $(allReplies[0]).before(clickToShowElement);
130 <script language="javascript">
131 /* convert all “follow”, “unfollow”, “block”, and “unblock” links to something nicer. */
132 $(document).ready(function() {
133 $("#sone .follow").submit(function() {
134 var followElement = this;
135 $.getJSON("ajax/followSone.ajax", { "sone": getSoneId(this), "formPassword": getFormPassword() }, function() {
136 $(followElement).addClass("hidden");
137 $(followElement).parent().find(".unfollow").removeClass("hidden");
141 $("#sone .unfollow").submit(function() {
142 var unfollowElement = this;
143 $.getJSON("ajax/unfollowSone.ajax", { "sone": getSoneId(this), "formPassword": getFormPassword() }, function() {
144 $(unfollowElement).addClass("hidden");
145 $(unfollowElement).parent().find(".follow").removeClass("hidden");
152 <script language="javascript">
153 /* convert all “like” buttons to javascript functions. */
154 $(document).ready(function() {
155 $("#sone .post > .inner-part > .status-line .like").submit(function() {
156 likePost(getPostId(this));
159 $("#sone .post > .inner-part > .status-line .unlike").submit(function() {
160 unlikePost(getPostId(this));
163 $("#sone .post .reply .status-line .like").submit(function() {
164 likeReply(getReplyId(this));
167 $("#sone .post .reply .status-line .unlike").submit(function() {
168 unlikeReply(getReplyId(this));
174 <script language="javascript">
175 /* process all existing notifications, ajaxify dismiss buttons. */
176 $(document).ready(function() {
177 $("#sone #notification-area .notification").each(function() {
178 ajaxifyNotification($(this));
183 <script language="javascript">
184 /* activate notification polling. */
185 $(document).ready(function() {
186 setTimeout(getNotifications, 5000);
192 <div id="notification-area">
194 <form id="notification-dismiss-template" class="hidden dismiss" action="dismissNotification.html" method="post">
195 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
196 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
197 <input type="hidden" name="notification" value="" />
198 <button type="submit"><%= Notification.Button.Dismiss|l10n|html></button>
201 <%foreach webInterface.notifications.all notification>
202 <div class="notification" id="<% notification.id|html>">
203 <%if notification.dismissable>
204 <form class="dismiss" action="dismissNotification.html" method="post">
205 <input type="hidden" name="formPassword" value="<% formPassword|html>" />
206 <input type="hidden" name="returnPage" value="<% request.uri|html>" />
207 <input type="hidden" name="notification" value="<% notification.id|html>" />
208 <button type="submit"><%= Notification.Button.Dismiss|l10n|html></button>
216 <div id="profile" class="<%ifnull currentSone>offline<%else>online<%/if>">
217 <a class="picture" href="index.html">
218 <%ifnull !currentSone>
219 <img src="/WoT/GetIdenticon?identity=<% currentSone.id|html>&width=80&height=80" width="80" height="80" alt="Profile Avatar" />
221 <img src="images/sone.png" width="80" height="80" alt="Sone is offline" />
224 <%ifnull ! currentSone>
226 <% currentSone|store key=sone>
227 <%include include/viewSone.html>
228 <%include include/updateStatus.html>