summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-14 17:14:35 +0100
committerEvan Prodromou <evan@status.net>2009-11-14 17:14:35 +0100
commit959d278c347fdf90e0227adc57c0215f5d82404a (patch)
tree16eb3b0155b446ada520566e187b4c47b0b9e76b /js
parent093857c582a68b39e0d65523d27f25ede7b7fed6 (diff)
parent2147ac510f5489c860a4bebf3ab48a069b89ecfb (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'js')
-rw-r--r--js/util.js66
1 files changed, 47 insertions, 19 deletions
diff --git a/js/util.js b/js/util.js
index b90f33ec7..c59c63910 100644
--- a/js/util.js
+++ b/js/util.js
@@ -228,6 +228,7 @@ var SN = { // StatusNet
$('#'+notice.id).fadeIn(2500);
SN.U.NoticeAttachments();
SN.U.NoticeReply();
+ SN.U.NoticeFavor();
}
}
$('#'+form_id+' #'+SN.C.S.NoticeDataText).val('');
@@ -276,6 +277,11 @@ var SN = { // StatusNet
return true;
},
+ NoticeFavor: function() {
+ $('.form_favor').each(function() { SN.U.FormXHR($(this)); });
+ $('.form_disfavor').each(function() { SN.U.FormXHR($(this)); });
+ },
+
NoticeAttachments: function() {
$.fn.jOverlay.options = {
method : 'GET',
@@ -370,31 +376,53 @@ 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();
+ }
+ },
- $('.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)); });
+ Notices: function() {
+ if ($('body.user_in').length > 0) {
+ SN.U.NoticeFavor();
- 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();
+ }
});