xhEditor is a simple,small,fast WYSWYG(What You See What You Get) XHTML editor based by jQuery. that is webbased and compatible with Internet Explorer 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22 .
xhEditor是一个基于jQuery开发的简单迷你并且高效的可视化XHTML编辑器,基于网络访问并且兼容IE 6.0-8.0,Firefox 3.0,Opera 9.6,Chrome 1.0,Safari 3.22。
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
Usage ¶
See the following code example:
$this->widget('application.extensions.xheditor.JXHEditor', array(
'model' => $model,
'attribute' => 'content',
'htmlOptions'=>array('cols'=>80,'rows'=>20,'style'=>'width: 100%; height: 500px;'),
));
Change Log ¶
January 7, 2010 ¶
- Initial release.
Disble unload event!!
To disable the annoying unload event, just open the file "xheditor/xheditor-en.js" and comment the following line (197)
jpWin.unload(_this.getSource).bind('beforeunload', _this.getSource);
Dont forget to remove the already published assets files and enpty browser cache before testing
uplaod a file
I fixed the error "model attribute undefined !!," but now i want to upload a file using the upImgUrl attribute:
'upImgUrl' => 'create' // create is the action name in the controller
In my controller i have this:
$model=new Item; if(isset($_POST'Item')) { $model->attributes=$_POST'Item'; $model->image=CUploadedFile::getInstance($model,'image');
if($model->save()) { $model->image->saveAs('./myfiles'); } } $this->render('create', array('model'=>$model));
but i have this following error: create upload interface error
Do you have an idea how i can solve this or an example showing how to upload a file using the xheditor in Yii?
Thanks
JXHEditor must specify "model" and "attribute" or "name" property values.
I copy paste the sample and i get this error !!!
If you don't give a documentation, at list give an working exemple to permit to try this control.
model attribute undefined !!
Hi,
First error i get is model attribute undefined !!,
There's a good example which explain how to use JXHEditor? and saving the content in the database, etc.
Thanks
re Rosimildo
When I submit the form, it warns that we're leaving the page.... how to disable that.
i think it is jquery 1.4.1 take the message,
you can download xheditor1.0beta(for jquery1.4.1) to try
How to disable the dialog when saving ?
When I submit the form, it warns that we're leaving the page.... how to disable that.
extends
I had to edit the class file:
class JXHEditor extends widget
to
class JXHEditor extends CWidget
Anyway...nice work;) 5 stars.
Now we're talking
Now it's a 5 stars extension...
Great but undocumented
It works great...thanks for this! :D
Had to see the source file to get how to use it:
/** * JXHEditor class file. * * @author jerry2801 <jerry2801@gmail.com> * * A typical usage of JXHEditor is as follows: * <pre> * this->widget('application.extensions.xheditor.JXHEditor', array( * 'model' => $model, * 'attribute' => 'intro', * 'options' => array( * 'width' => '100%', * 'height' => 400, * ), * )); * </pre> */
Now using it...
Please give some basic documentation...
There is a bug when using this extension with theme
The path is wrong when using this extension with theme, result:
www.mysite.com/undefinedxheditor_skin/o2007blue/ui.css
www.mysite.com/undefinedxheditor_skin/o2007blue/iframe.css
result the 2 css file not found: ui.css and iframe.css
error
hi
i got error C.attr("class") is undefined
Error fix
Regarding C.attr("class") is undefined error -
Actually there's javascript error which stops script from working. Javascript does not find textarea (field to be edited) that has 'class' attribute 'xheditor'. So you should add 'class' attribute manually.
What you need to do is -
In file protected\extensions\xheditor\JXHEditor.php
Add line (in line 43):
$this->htmlOptions['class']='xheditor';
right before :
if($this->hasModel())
echo CHtml::activeTextArea($this->model,$this->attribute,$this->htmlOptions);
else
echo CHtml::textArea($name,$this->value,$this->htmlOptions);
Functional Testing
Because xhEditor creates an iframe out of the input field, there's a trick to accessing the field via Selenium: you need to switch the frame.
$this->selectFrame("//*[@id='xhEdt0_iframe']"); // switch to the iframe $this->type("//body","This text shows up in the xhEdit WYSIWYG!");
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.