aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-01 17:38:47 -0400
committercash <cash.costello@gmail.com>2011-10-01 17:38:47 -0400
commitd7549a210074a29f004642d713ede6ce04703bcc (patch)
tree8efeba98e1f675a62cf70be2539807c73763db6c /mod/embed/views/default
parentbc292c96ac6b118bd7a99509fce1c11bb232aeb2 (diff)
downloadelgg-d7549a210074a29f004642d713ede6ce04703bcc.tar.gz
elgg-d7549a210074a29f004642d713ede6ce04703bcc.tar.bz2
Updated the instructions
Diffstat (limited to 'mod/embed/views/default')
-rw-r--r--mod/embed/views/default/js/embed/embed.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index 6d4e2e4ea..840d8f89c 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -14,9 +14,9 @@ elgg.embed.init = function() {
});
// special pagination helper for lightbox
- $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.loadContent);
+ $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.forward);
- $('.embed-section').live('click', elgg.embed.loadContent);
+ $('.embed-section').live('click', elgg.embed.forward);
$('.embed-upload .elgg-form').live('submit', elgg.embed.submit);
}
@@ -31,25 +31,20 @@ elgg.embed.init = function() {
*/
elgg.embed.insert = function(event) {
var textAreaId = elgg.embed.textAreaId;
+ var textArea = $('#' + textAreaId);
// generalize this based on a css class attached to what should be inserted
var content = ' ' + $(this).find(".elgg-image").html() + ' ';
+ textArea.val(textArea.val() + content);
+ textArea.focus();
+
<?php
-// If a wysiwyg editor has been registered, it handles the insertion by
-// overriding the embed/custom_insert_js view. See the TinyMCE plugin for an
-// example of this.
-$custom_insert_code = elgg_view('embed/custom_insert_js');
-if ($custom_insert_code) {
- echo $custom_insert_code;
-} else {
-?>
- $('#' + textAreaId).val($('#' + textAreaId).val() + content);
- $('#' + textAreaId).focus();
-<?php
-}
+// See the TinyMCE plugin for an example of this view
+ echo elgg_view('embed/custom_insert_js');
?>
+
$.fancybox.close();
event.preventDefault();
@@ -98,7 +93,7 @@ elgg.embed.submit = function(event) {
* @param {Object} event
* @return void
*/
-elgg.embed.loadContent = function(event) {
+elgg.embed.forward = function(event) {
$('.embed-wrapper').parent().load($(this).attr('href'));
event.preventDefault();
}