diff options
Diffstat (limited to 'mod/embed/views/default/embed/js.php')
-rw-r--r-- | mod/embed/views/default/embed/js.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mod/embed/views/default/embed/js.php b/mod/embed/views/default/embed/js.php index fc34c2442..f80d7367d 100644 --- a/mod/embed/views/default/embed/js.php +++ b/mod/embed/views/default/embed/js.php @@ -6,6 +6,26 @@ */ ?> +$(function() { + $('a[rel*=facebox]').facebox(); + + // fire off the ajax upload + $('#file_embed_upload').submit(function() { + var options = { + success: function(data) { + var info = jQuery.parseJSON(data); + + if (info.status == 'success') { + $('.popup .content').load(elgg.get_site_url() + 'embed/embed?active_section=file'); + } else { + $('.popup .content').find('form').prepend('<p>' + info.message + '</p>'); + } + } + }; + $(this).ajaxSubmit(options); + return false; + }); +}); function elggEmbedInsertContent(content, textAreaName) { content = ' ' + content + ' '; @@ -33,7 +53,6 @@ function elggEmbedInsertContent(content, textAreaName) { $.facebox.close(); } - /* * Facebox (for jQuery) * version: 1.2 (05/05/2008) |