summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-23 02:19:19 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-23 02:19:19 -0400
commitcf3d26f557abbafeb5716b8e2881ca6496942aae (patch)
tree7e86e3b8ecc4a6e6c6d85317d6bdb1b8e2ea204e
parentb58637d3179556330318d3f8c54db3f4572d105e (diff)
downloadaskbot-cf3d26f557abbafeb5716b8e2881ca6496942aae.tar.gz
askbot-cf3d26f557abbafeb5716b8e2881ca6496942aae.tar.bz2
askbot-cf3d26f557abbafeb5716b8e2881ca6496942aae.zip
hopefully fixess js erros for IE file upload
-rw-r--r--askbot/media/js/tinymce/plugins/askbot_attachment/editor_plugin.js13
-rw-r--r--askbot/media/js/tinymce/plugins/askbot_imageuploader/editor_plugin.js11
2 files changed, 17 insertions, 7 deletions
diff --git a/askbot/media/js/tinymce/plugins/askbot_attachment/editor_plugin.js b/askbot/media/js/tinymce/plugins/askbot_attachment/editor_plugin.js
index b1d9a918..bf49b33e 100644
--- a/askbot/media/js/tinymce/plugins/askbot_attachment/editor_plugin.js
+++ b/askbot/media/js/tinymce/plugins/askbot_attachment/editor_plugin.js
@@ -10,15 +10,20 @@
(function() {
var insertIntoDom = function(url, description) {
- var sel = tinyMCE.activeEditor.selection;
-
var content = '<a href="' + url;
if (description) {
content = content + '" title="' + description;
}
- content = content + '">see attachment</a>';
+ content = content + '"/>';
- sel.setContent(content);
+ tinyMCE.activeEditor.focus();
+ if (document.selection) {
+ var sel = document.selection.createRange();
+ sel.pasteHTML(content);
+ } else {
+ var sel = tinyMCE.activeEditor.selection;
+ sel.setContent(content);
+ }
};
var modalMenuHeadline = gettext('Insert a file');
diff --git a/askbot/media/js/tinymce/plugins/askbot_imageuploader/editor_plugin.js b/askbot/media/js/tinymce/plugins/askbot_imageuploader/editor_plugin.js
index f23d89db..ac6722f2 100644
--- a/askbot/media/js/tinymce/plugins/askbot_imageuploader/editor_plugin.js
+++ b/askbot/media/js/tinymce/plugins/askbot_imageuploader/editor_plugin.js
@@ -10,15 +10,20 @@
(function() {
var insertIntoDom = function(url, description) {
- var sel = tinyMCE.activeEditor.selection;
-
var content = '<img src="' + url;
if (description) {
content = content + '" alt="' + description;
}
content = content + '"/>';
- sel.setContent(content);
+ tinyMCE.activeEditor.focus();
+ if (document.selection) {
+ var sel = document.selection.createRange();
+ sel.pasteHTML(content);
+ } else {
+ var sel = tinyMCE.activeEditor.selection;
+ sel.setContent(content);
+ }
};
var modalMenuHeadline = gettext('Upload an image');