summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-02 16:30:09 -0800
committerBrion Vibber <brion@pobox.com>2010-03-02 16:36:08 -0800
commit79ffebb51b1141791d5ee7478e3a7beaa9fe8faa (patch)
tree70a0ab1453cbdb50bf9474fdff5e8743bc1c3eff /js/util.js
parent9f94d6defa0d2536cb1f20a4c1c44ff78fd3f039 (diff)
OStatus: save file records for enclosures
Also stripping id from foreign HTML messages (could interfere with UI) and disabled failing attachment popup for a.attachment links that don't have a proper id, so you can click through instead of getting an error. Issues: * any other links aren't marked and saved * inconsistent behavior between local and remote attachments (local displays in lightbox, remote doesn't) * if the enclosure'd object isn't referenced in the content, you won't be offered a link to it in our UI
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index d08c46fe6..3efda0d7b 100644
--- a/js/util.js
+++ b/js/util.js
@@ -423,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) {