Hi everybody
Lately i’m extending/modifying redactorJs (the one that comes with yiibooster) in order to fit my needs
For that i written a custom js file that operates under the premise that the redactor widget has already been initialized (obviosly) but here i have a problem… even if i register my script, at the end of my view file, with
Yii::app()->clientScript->registerScriptFile(
Yii::app()->theme->baseUrl.'/js/redactorImgHook.js', CClientScript::POS_END
);
the resulting html in my page is like that:
<script type="text/javascript" src="/medispo/themes/bootstrap/js/redactorImgHook.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('body').tooltip({'selector':'[rel=tooltip]'});
jQuery('body').popover({'selector':'[rel=popover]'});
jQuery('#Prodotti_schedaTecnica').redactor({'lang':'it','minHeight':200,'plugins':['templateGenerator','imageListing'],'buttons':['html','formatting','|','bold','italic','deleted','underline','alignleft','aligncenter','alignright','justify','|','unorderedlist','orderedlist','outdent','indent','|','image','video','file','table','link','|','fontcolor','backcolor','|','alignment','|','horizontalrule','|','tplGenerator'],'imageUpload':'/medispo/index.php?r=prodotti/imageUpload&prodottoId=','imageGetJson':'/medispo/index.php?r=prodotti/listImages&prodottoId='});
});
so i’m wondering, how to put my js file AFTER the redactor widget init??
FYI i call redactor this way:
<?php echo $form->redactorRow($model, 'schedaTecnica', array('options' => array('lang'=>'it', 'minHeight' => 200,
'plugins' => array('templateGenerator','imageListing'),
'buttons' => array(
'html', 'formatting', '|', 'bold', 'italic', 'deleted',
'underline', 'alignleft', 'aligncenter', 'alignright', 'justify', '|',
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule', '|', 'tplGenerator'
),
'imageUpload' => Yii::app()->createUrl('prodotti/imageUpload'),
'imageGetJson' => Yii::app()->createUrl('prodotti/listImages'),
))); ?>
Thanks in advance