summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js31
1 files changed, 14 insertions, 17 deletions
diff --git a/js/util.js b/js/util.js
index 4b6c39a1d..3efda0d7b 100644
--- a/js/util.js
+++ b/js/util.js
@@ -53,7 +53,7 @@ var SN = { // StatusNet
NoticeLocationNs: 'notice_data-location_ns',
NoticeGeoName: 'notice_data-geo_name',
NoticeDataGeo: 'notice_data-geo',
- NoticeDataGeoCookie: 'notice_data-geo_cookie',
+ NoticeDataGeoCookie: 'NoticeDataGeo',
NoticeDataGeoSelected: 'notice_data-geo_selected',
StatusNetInstance:'StatusNetInstance'
}
@@ -320,18 +320,12 @@ var SN = { // StatusNet
}
},
- NoticeReplyTo: function(notice_item) {
- var notice = notice_item[0];
- var notice_reply = $('.notice_reply', notice)[0];
-
- if (jQuery.data(notice_reply, "ElementData") === undefined) {
- jQuery.data(notice_reply, "ElementData", {Bind:'submit'});
- $(notice_reply).bind('click', function() {
- var nickname = ($('.author .nickname', notice).length > 0) ? $($('.author .nickname', notice)[0]) : $('.author .nickname.uid');
- SN.U.NoticeReplySet(nickname.text(), $($('.notice_id', notice)[0]).text());
- return false;
- });
- }
+ NoticeReplyTo: function(notice) {
+ notice.find('.notice_reply').live('click', function() {
+ var nickname = ($('.author .nickname', notice).length > 0) ? $($('.author .nickname', notice)[0]) : $('.author .nickname.uid');
+ SN.U.NoticeReplySet(nickname.text(), $($('.notice_id', notice)[0]).text());
+ return false;
+ });
},
NoticeReplySet: function(nick,id) {
@@ -429,8 +423,11 @@ var SN = { // StatusNet
};
notice.find('a.attachment').click(function() {
- $().jOverlay({url: $('address .url')[0].href+'attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'});
- return false;
+ var attachId = ($(this).attr('id').substring('attachment'.length + 1));
+ if (attachId) {
+ $().jOverlay({url: $('address .url')[0].href+'attachment/' + attachId + '/ajax'});
+ return false;
+ }
});
if ($('#shownotice').length == 0) {
@@ -500,7 +497,7 @@ var SN = { // StatusNet
$('#'+SN.C.S.NoticeLocationId).val('');
$('#'+SN.C.S.NoticeDataGeo).attr('checked', false);
- $.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled', { path: '/', expires: SN.U.GetFullYear(2029, 0, 1) });
+ $.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled', { path: '/' });
}
function getJSONgeocodeURL(geocodeURL, data) {
@@ -543,7 +540,7 @@ var SN = { // StatusNet
NDG: true
};
- $.cookie(SN.C.S.NoticeDataGeoCookie, JSON.stringify(cookieValue), { path: '/', expires: SN.U.GetFullYear(2029, 0, 1) });
+ $.cookie(SN.C.S.NoticeDataGeoCookie, JSON.stringify(cookieValue), { path: '/' });
});
}