aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/js
diff options
context:
space:
mode:
Diffstat (limited to 'mod/embed/views/default/js')
-rw-r--r--mod/embed/views/default/js/embed/embed.php5
-rw-r--r--mod/embed/views/default/js/embed/inline.php26
2 files changed, 3 insertions, 28 deletions
diff --git a/mod/embed/views/default/js/embed/embed.php b/mod/embed/views/default/js/embed/embed.php
index ea92ba1fd..5c15cd95a 100644
--- a/mod/embed/views/default/js/embed/embed.php
+++ b/mod/embed/views/default/js/embed/embed.php
@@ -1,9 +1,10 @@
+//<script>
elgg.provide('elgg.embed');
elgg.embed.init = function() {
// inserts the embed content into the textarea
- $(".embed-wrapper .elgg-item").live('click', elgg.embed.insert);
+ $(".embed_data").live('click', elgg.embed.insert);
// caches the current textarea id
$(".embed-control").live('click', function() {
@@ -30,7 +31,7 @@ elgg.embed.init = function() {
* @return void
*/
elgg.embed.insert = function(event) {
-
+console.log("omfg");
var textAreaId = elgg.embed.textAreaId;
var content = $(this).data('embed_code');
diff --git a/mod/embed/views/default/js/embed/inline.php b/mod/embed/views/default/js/embed/inline.php
deleted file mode 100644
index 0672a68f8..000000000
--- a/mod/embed/views/default/js/embed/inline.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Inline embed JavaScript for attaching the insert data to list items
- *
- * @uses $vars['items']
- */
-
-foreach ($vars['items'] as $item) {
-
- // different entity types have different title attribute names.
- $title = isset($item->name) ? $item->name : $item->title;
- // don't let it be too long
- $title = elgg_get_excerpt($title);
-
- $icon = "<img src=\"{$item->getIcon($icon_size)}\" />" . htmlspecialchars($title, ENT_QUOTES, 'UTF-8', false);
-
- $embed_code = elgg_view('output/url', array(
- 'href' => $item->getURL(),
- 'title' => $title,
- 'text' => $icon,
- 'encode_text' => false,
- ));
- $embed_code = json_encode($embed_code);
-
- echo "$('#elgg-object-{$item->getGUID()}').data('embed_code', $embed_code);";
-} \ No newline at end of file