aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/tinymce/views/default
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/tinymce/views/default')
-rw-r--r--mod/tinymce/views/default/js/tinymce.php17
-rw-r--r--mod/tinymce/views/default/tinymce/embed_custom_insert_js.php10
2 files changed, 24 insertions, 3 deletions
diff --git a/mod/tinymce/views/default/js/tinymce.php b/mod/tinymce/views/default/js/tinymce.php
index 55e0c7ae1..20236d657 100644
--- a/mod/tinymce/views/default/js/tinymce.php
+++ b/mod/tinymce/views/default/js/tinymce.php
@@ -59,7 +59,7 @@ elgg.tinymce.init = function() {
var text = elgg.echo('tinymce:word_count') + strip.split(' ').length + ' ';
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
});
-
+
ed.onKeyUp.add(function(ed, e) {
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,"");
var text = elgg.echo('tinymce:word_count') + strip.split(' ').length + ' ';
@@ -69,6 +69,21 @@ elgg.tinymce.init = function() {
content_css: elgg.config.wwwroot + 'mod/tinymce/css/elgg_tinymce.css'
});
+ // work around for IE/TinyMCE bug where TinyMCE loses insert carot
+ if ($.browser.msie) {
+ $(".embed-control").live('hover', function() {
+ var classes = $(this).attr('class');
+ var embedClass = classes.split(/[, ]+/).pop();
+ var textAreaId = embedClass.substr(embedClass.indexOf('embed-control-') + "embed-control-".length);
+
+ if (window.tinyMCE) {
+ var editor = window.tinyMCE.get(textAreaId);
+ if (elgg.tinymce.bookmark == null) {
+ elgg.tinymce.bookmark = editor.selection.getBookmark(2);
+ }
+ }
+ });
+ }
}
elgg.register_hook_handler('init', 'system', elgg.tinymce.init); \ No newline at end of file
diff --git a/mod/tinymce/views/default/tinymce/embed_custom_insert_js.php b/mod/tinymce/views/default/tinymce/embed_custom_insert_js.php
index d5513cef1..a861a4035 100644
--- a/mod/tinymce/views/default/tinymce/embed_custom_insert_js.php
+++ b/mod/tinymce/views/default/tinymce/embed_custom_insert_js.php
@@ -1,8 +1,14 @@
if (window.tinyMCE) {
var editor = window.tinyMCE.get(textAreaId);
-
+
if (editor) {
+
+ // work around for IE/TinyMCE bug where TinyMCE loses insert carot
+ if ($.browser.msie) {
+ editor.focus();
+ editor.selection.moveToBookmark(elgg.tinymce.bookmark);
+ }
+
editor.execCommand("mceInsertContent", true, content);
}
}
- \ No newline at end of file