</script>
<script language="javascript">
- /* convert all “follow”, “unfollow”, “block”, and “unblock” links to something nicer. */
+ /* convert all “follow”, “unfollow”, “lock”, and “unlock” links to something nicer. */
$(document).ready(function() {
$("#sone .follow").submit(function() {
var followElement = this;
});
return false;
});
+ $("#sone .lock").submit(function() {
+ var lockElement = this;
+ $.getJSON("ajax/lockSone.ajax", { "sone" : getSoneId(this), "formPassword" : getFormPassword() }, function() {
+ $(lockElement).addClass("hidden");
+ $(lockElement).parent().find(".unlock").removeClass("hidden");
+ });
+ return false;
+ });
+ $("#sone .unlock").submit(function() {
+ var unlockElement = this;
+ $.getJSON("ajax/unlockSone.ajax", { "sone" : getSoneId(this), "formPassword" : getFormPassword() }, function() {
+ $(unlockElement).addClass("hidden");
+ $(unlockElement).parent().find(".lock").removeClass("hidden");
+ });
+ return false;
+ });
});
</script>
/* process all existing notifications, ajaxify dismiss buttons. */
$(document).ready(function() {
$("#sone #notification-area .notification").each(function() {
- ajaxifyNotificationArea($(this));
+ ajaxifyNotification($(this));
});
});
</script>
- <div id="main">
+ <script language="javascript">
+ /* activate notification polling. */
+ $(document).ready(function() {
+ setTimeout(getNotifications, 5000);
+ });
+ </script>
- <%if !webInterface.core.identityManager.connected>
- <div id="plugin-warning">
- <%= Warning.PluginNotConnected.Text|l10n|html|replace needle="{link}" replacement="<a href=\"/plugins/\">"|replace needle="{/link}" replacement="</a>">
- </div>
- <%/if>
+ <div id="main">
<div id="notification-area">
+
+ <form id="notification-dismiss-template" class="hidden dismiss" action="dismissNotification.html" method="post">
+ <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+ <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+ <input type="hidden" name="notification" value="" />
+ <button type="submit"><%= Notification.Button.Dismiss|l10n|html></button>
+ </form>
+
<%foreach webInterface.notifications.all notification>
<div class="notification" id="<% notification.id|html>">
<%if notification.dismissable>