37 list($name, $id) = $this->resolveNameID();
42 $this->htmlOptions[
'id'] = $id;
44 $this->htmlOptions[
'class'] = (isset($this->htmlOptions[
'class']))
45 ? $this->htmlOptions[
'class'] .
' wmd-input'
48 if (!array_key_exists(
'style', $this->htmlOptions)) {
49 $this->htmlOptions[
'style'] =
"width:{$this->width};height:{$this->height};";
52 if ($this->hasModel()) {
53 echo CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
55 echo CHtml::textArea($name, $this->
value, $this->htmlOptions);
67 $booster->registerAssetCss(
'markdown.editor.css');
68 $booster->registerAssetJs(
'markdown.converter.js', CClientScript::POS_HEAD);
69 $booster->registerAssetJs(
'markdown.sanitizer.js', CClientScript::POS_HEAD);
70 $booster->registerAssetJs(
'markdown.editor.js', CClientScript::POS_HEAD);
71 Yii::app()->clientScript->registerScript(
73 "var converter = Markdown.getSanitizingConverter();
74 var editor = new Markdown.Editor(converter, '" . $id .
"');
76 CClientScript::POS_END