summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-11 19:58:43 +0100
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-11 19:58:43 +0100
commit086759f32ab6d2c5aadecb57941e7e14015b8bd6 (patch)
tree5b4e2875a7bf02717a8a987d5c1af91318a2fe29 /js/util.js
parent37c62c6356af22a7b1eb444b241083d9fa53166e (diff)
parent6a19bcc0e2e2e0d0743480921e3be787b5b27729 (diff)
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js61
1 files changed, 42 insertions, 19 deletions
diff --git a/js/util.js b/js/util.js
index b90f33ec7..9bdc48507 100644
--- a/js/util.js
+++ b/js/util.js
@@ -370,31 +370,54 @@ var SN = { // StatusNet
return false;
});
}
- }
-};
+ },
-$(document).ready(function(){
- if ($('body.user_in').length > 0) {
- $('.'+SN.C.S.FormNotice).each(function() {
- SN.U.FormNoticeXHR($(this));
- SN.U.FormNoticeEnhancements($(this));
- });
+ Init: {
+ NoticeForm: function() {
+ if ($('body.user_in').length > 0) {
+ $('.'+SN.C.S.FormNotice).each(function() {
+ SN.U.FormNoticeXHR($(this));
+ SN.U.FormNoticeEnhancements($(this));
+ });
+
+ SN.U.NoticeDataAttach();
+ }
+ },
+
+ Notices: function() {
+ if ($('body.user_in').length > 0) {
+ $('.form_favor').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_disfavor').each(function() { SN.U.FormXHR($(this)); });
- $('.form_user_subscribe').each(function() { SN.U.FormXHR($(this)); });
- $('.form_user_unsubscribe').each(function() { SN.U.FormXHR($(this)); });
- $('.form_favor').each(function() { SN.U.FormXHR($(this)); });
- $('.form_disfavor').each(function() { SN.U.FormXHR($(this)); });
- $('.form_group_join').each(function() { SN.U.FormXHR($(this)); });
- $('.form_group_leave').each(function() { SN.U.FormXHR($(this)); });
- $('.form_user_nudge').each(function() { SN.U.FormXHR($(this)); });
+ SN.U.NoticeReply();
+ }
- SN.U.NoticeReply();
+ SN.U.NoticeAttachments();
+ },
- SN.U.NoticeDataAttach();
+ EntityActions: function() {
+ if ($('body.user_in').length > 0) {
+ $('.form_user_subscribe').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_user_unsubscribe').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_group_join').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_group_leave').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_user_nudge').each(function() { SN.U.FormXHR($(this)); });
- SN.U.NewDirectMessage();
+ SN.U.NewDirectMessage();
+ }
+ }
}
+};
- SN.U.NoticeAttachments();
+$(document).ready(function(){
+ if ($('.'+SN.C.S.FormNotice).length > 0) {
+ SN.Init.NoticeForm();
+ }
+ if ($('#content .notices').length > 0) {
+ SN.Init.Notices();
+ }
+ if ($('#content .entity_actions').length > 0) {
+ SN.Init.EntityActions();
+ }
});