diff options
Diffstat (limited to 'mod/tinymce/views/default/js')
| -rw-r--r-- | mod/tinymce/views/default/js/tinymce.php | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/mod/tinymce/views/default/js/tinymce.php b/mod/tinymce/views/default/js/tinymce.php index 55e0c7ae1..344d71b14 100644 --- a/mod/tinymce/views/default/js/tinymce.php +++ b/mod/tinymce/views/default/js/tinymce.php @@ -38,7 +38,8 @@ elgg.tinymce.init = function() { mode : "specific_textareas", editor_selector : "elgg-input-longtext", theme : "advanced", - plugins : "spellchecker,autosave,fullscreen,paste", + language : "<?php echo tinymce_get_site_language(); ?>", + plugins : "lists,spellchecker,autosave,fullscreen,paste,inlinepopups", relative_urls : false, remove_script_host : false, document_base_url : elgg.config.wwwroot, @@ -59,16 +60,43 @@ 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(/(<([^>]+)>)/ig,""); var text = elgg.echo('tinymce:word_count') + strip.split(' ').length + ' '; tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text); }); + + ed.onInit.add(function(ed) { + // prevent Firefox from dragging/dropping files into editor + if (tinymce.isGecko) { + tinymce.dom.Event.add(ed.getBody().parentNode, "drop", function(e) { + if (e.dataTransfer.files.length > 0) { + e.preventDefault(); + } + }); + } + }); + }, 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 +elgg.register_hook_handler('init', 'system', elgg.tinymce.init); |
