Skip to content

Commit

Permalink
New: Can add more js during CKEditor creation
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 21, 2012
1 parent dbc4571 commit bf9b7e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions htdocs/core/class/doleditor.class.php
Expand Up @@ -139,7 +139,7 @@ function DolEditor($htmlname,$content,$width='',$height=200,$toolbarname='Basic'
* Output depends on this->tool (fckeditor, ckeditor, texatrea, ...)
*
* @param int $noprint 1=Return HTML string instead of printing it to output
* @param string $morejs Add more js. For example: "editor.on( \'saveSnapshot\', function(e) { alert(\'ee\'); });"
* @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });"
* @return void
*/
function Create($noprint=0,$morejs='')
Expand Down Expand Up @@ -173,7 +173,8 @@ function Create($noprint=0,$morejs='')
$out.= '<script type="text/javascript">
$(document).ready(function () {
/* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */
editor=CKEDITOR.replace(\''.$this->htmlname.'\',
/* should be editor=CKEDITOR.replace but what if serveral editors ? */
CKEDITOR.replace(\''.$this->htmlname.'\',
{
customConfig : \''.dol_buildpath('/theme/'.$conf->theme.'/ckeditor/config.js',1).'\',
toolbar: \''.$this->toolbarname.'\',
Expand Down Expand Up @@ -218,9 +219,7 @@ function Create($noprint=0,$morejs='')
filebrowserImageWindowWidth : \'900\',
filebrowserImageWindowHeight : \'500\'';
}
$out.= '
});';
$out.= $morejs;
$out.= ' })'.$morejs;
$out.= '});
</script>';
}
Expand Down

0 comments on commit bf9b7e9

Please sign in to comment.