diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-14 23:54:38 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-14 23:54:38 +0000 |
commit | 1e94b4e29b3d4989eff8d5344bf3415b3fb44b94 (patch) | |
tree | fe807ae882366a5f20a831c12ec88b6a8131a18b /mod/embed/views/default | |
parent | caf11e94744c49e1b1533b45f0a44d0aa97704df (diff) | |
download | elgg-1e94b4e29b3d4989eff8d5344bf3415b3fb44b94.tar.gz elgg-1e94b4e29b3d4989eff8d5344bf3415b3fb44b94.tar.bz2 |
Refs #3016: Removes inline javascript from embed, file, groups, messages, profile, thewire
git-svn-id: http://code.elgg.org/elgg/trunk@8711 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/embed/views/default')
-rw-r--r-- | mod/embed/views/default/embed/embed.php | 10 | ||||
-rw-r--r-- | mod/embed/views/default/embed/js.php | 21 | ||||
-rw-r--r-- | mod/embed/views/default/embed/lightbox_init.php | 4 | ||||
-rw-r--r-- | mod/embed/views/default/embed/upload/content.php | 16 |
4 files changed, 26 insertions, 25 deletions
diff --git a/mod/embed/views/default/embed/embed.php b/mod/embed/views/default/embed/embed.php index e64160852..84b005c8c 100644 --- a/mod/embed/views/default/embed/embed.php +++ b/mod/embed/views/default/embed/embed.php @@ -125,7 +125,7 @@ echo $content; <?php //@todo: JS 1.8: ugly ?> <script type="text/javascript"> -$(document).ready(function() { +$(function() { var internal_name = '<?php echo addslashes($internal_name); ?>'; // insert embed codes @@ -135,7 +135,7 @@ $(document).ready(function() { }); // tabs - $('.embed_section').click(function() { + $('.embed_section').live('click', function() { var section = $(this).attr('id'); var url = elgg.config.wwwroot + 'embed/embed?active_section=' + section + '&internal_name=' + internal_name; $('#facebox .body .content').load(url); @@ -149,9 +149,9 @@ $(document).ready(function() { return false; } - $('.pagination-number').click(elggPaginationClick); - $('.pagination-next').click(elggPaginationClick); - $('.pagination-previous').click(elggPaginationClick); + $('.pagination-number').live('click', elggPaginationClick); + $('.pagination-next').live('click', elggPaginationClick); + $('.pagination-previous').live('click', elggPaginationClick); }); </script> 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) diff --git a/mod/embed/views/default/embed/lightbox_init.php b/mod/embed/views/default/embed/lightbox_init.php deleted file mode 100644 index 2c385a578..000000000 --- a/mod/embed/views/default/embed/lightbox_init.php +++ /dev/null @@ -1,4 +0,0 @@ -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> - $(function() { $('a[rel*=facebox]').facebox() }); -</script> diff --git a/mod/embed/views/default/embed/upload/content.php b/mod/embed/views/default/embed/upload/content.php index 5eb9b31a2..b7bcc76a0 100644 --- a/mod/embed/views/default/embed/upload/content.php +++ b/mod/embed/views/default/embed/upload/content.php @@ -28,21 +28,7 @@ if ($upload_sections) { echo $upload_content . "</div>"; -?> - <?php //@todo: JS 1.8: ugly ?> - <script type="text/javascript"> - $(function() { - - // change for dropdown - $('#embed_upload').change(function() { - var upload_section = $(this).val(); - var url = elgg.get_site_url() + 'embed/embed?active_section=upload&active_upload_section=' + upload_section; - $('#facebox .body .content').load(url); - }); - - }); - </script> -<?php + elgg_load_js('elgg.embed'); } else { echo elgg_echo('embed:no_upload_sections'); |