本文介绍了使用NicEdit调整图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在测试并寻找一个wysiwyg编辑器,并且我找到了一个非常实用的nicEdit。问题是,使用Firefox所有功能都正常工作,但使用铬,放置图像时,调整选项框不起作用!如何解决它?如果没有,还有其他类似的吗? Tiny MCE的一些功能也不适用于chrome。
解决方案
使用nicEdit并在nicEdit.js中以这种方式更改代码:
var nicImageButton = nicEditorAdvancedButton.extend({addPane:function(){this.im = this.ne.selectedInstance.selElm()。parentTag(IMG); this .addForm({:{type:title,txt:Add / Edit Immagine},width:{type:text,txt:Width,style:{width:150px}}, src:{type:text,txt:URL,value:http://,style:{width:150px}},alt:{type:text,txt: ,风格:{宽度: 100像素}},对齐:{类型: 选择,TXT: 对齐 选项:{无: 默认,左起: 左,右: 右}}} ,this.im)},提交:function(B){var C = this.inputs.src.value; if(C ==|| C ==http://){alert(You must输入一个Image URL来插入); return false} this.removePane(); if(!this.im){var A =javascript:nicImTemp();; this.ne.nicCommand(insertImage,A) ; this.im = this.findElm( IMG, SRC,A)}如果(this.im){this.im.setAttributes({宽度:this.inputs.width.value,SRC:this.inputs。 src.value,ALT:this.inputs.alt.value,对齐:this.inputs.ali gn.value})}}}); nicEditors.registerPlugin(nicPlugin,nicImageOptions);
您只需添加
,width:{type:text,txt:Width,style:{width:150px}}
和
width:this.inputs.width.value,
添加插入宽度参数的选项。
I am testing and looking for a wysiwyg editor and I found a pretty functional one called nicEdit. Problem is that using firefox all functions are working properly but using chrome, when image is placed, resize option frame doesn't work! How to solve it? If not, any other similar one? Some functions of Tiny MCE are not working with chrome too. Thank you.
解决方案
Use nicEdit and alter code this way in nicEdit.js:
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Immagine"},width:{type:"text",txt:"Width",style:{width:"150px"}},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({width:this.inputs.width.value,src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
you have to add simply
,width:{type:"text",txt:"Width",style:{width:"150px"}}
and
width:this.inputs.width.value,
to add the option to insert width parameter.
这篇关于使用NicEdit调整图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!