summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-11 18:47:14 +0000
committerSarven Capadisli <csarven@status.net>2009-11-11 18:47:14 +0000
commit095cf8ebf1e95dfc2e625ca6a7f705dbf007a9fd (patch)
tree806a951b933feb25a60e810e15118995f6b95b20 /js/util.js
parentb8b4d3d2f2ab657105a914577c6335be5bb14ae2 (diff)
Separated Init functions to NoticeForm, Notices, EvenActions.
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js35
1 files changed, 25 insertions, 10 deletions
diff --git a/js/util.js b/js/util.js
index f03a1e67c..9bdc48507 100644
--- a/js/util.js
+++ b/js/util.js
@@ -373,36 +373,51 @@ var SN = { // StatusNet
},
Init: {
- Notices: function() {
+ NoticeForm: function() {
if ($('body.user_in').length > 0) {
$('.'+SN.C.S.FormNotice).each(function() {
SN.U.FormNoticeXHR($(this));
SN.U.FormNoticeEnhancements($(this));
});
- $('.form_user_subscribe').each(function() { SN.U.FormXHR($(this)); });
- $('.form_user_unsubscribe').each(function() { SN.U.FormXHR($(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_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.NoticeDataAttach();
+ SN.U.NoticeAttachments();
+ },
+
+ 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.NoticeAttachments();
}
}
};
$(document).ready(function(){
- if ($('#content .notices').length >0) {
+ 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();
+ }
});