Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Nov 16, 2015
1 parent e251cc1 commit 51123a2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions plugins/editors/tinymce/tinymce.php
Expand Up @@ -822,6 +822,14 @@ public function onInit()
break;
}

$script .= "
function jInsertEditorText( text, editor )
{
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
}
";


if (!empty($btnsNames))
{
JFactory::getDocument()->addScriptDeclaration(
Expand Down Expand Up @@ -859,7 +867,7 @@ function jModalClose() {
*/
public function onGetContent($editor)
{
return 'tinyMCE.getElementById("' . $editor . '").getContent();';
return 'tinyMCE.get("' . $editor . '").getContent();';
}

/**
Expand All @@ -872,7 +880,7 @@ public function onGetContent($editor)
*/
public function onSetContent($editor, $html)
{
return 'tinyMCE.getElementById("' . $editor . '").setContent(' . $html . ');';
return 'tinyMCE.get("' . $editor . '").setContent(' . $html . ');';
}

/**
Expand All @@ -898,15 +906,6 @@ public function onSave($editor)
*/
public function onGetInsertMethod($name)
{
JFactory::getDocument()->addScriptDeclaration(
"
function jInsertEditorText( text, editor )
{
tinyMCE.get('" . $name . "').execCommand('mceInsertContent', false, text);
}
"
);

return;
}

Expand Down

0 comments on commit 51123a2

Please sign in to comment.