// 评论 begin
KindEditor.plugin('nsycomment', function(K) {
			var self = this, name = 'nsycomment',lang = self.lang(name + '.');
			self.plugin.nsycomment = {
	            edit : function() {
		            var html = [
			            '<div style="padding:20px;">',
			            //width
			            '<div class="ke-dialog-row">',
			            '<label for="keWidth" style="width:60px;">'+lang.width+'</label>',
			            '<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="500" maxlength="4" /> &nbsp; ',
			            '<input type="checkbox" class="ke-inline-block" id="ckbAuto" name="isAuto" title="图文翻动、图文滚动、滚动公告、滚动图片链接、文字链接组、列表链接、今日导读、留言本、自定义表单栏目必须设置宽度">&nbsp;自适应</input>',			            			            			            			            
			            '</div>',
			            //height
			            '<div class="ke-dialog-row">',
			            '<label for="keHeight" style="width:60px;">'+lang.height + '</label>',
			            '<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="200" maxlength="4" /> ',
			            '</div>',
			            '</div>'
		            ].join('');
		            var dialog = self.createDialog({
			            name : name,
			            width : 300,
			            title : self.lang(name),
			            body : html,
			            yesBtn : {
				            name : self.lang('yes'),
				            click : function(e) {
        						var width = widthBox.val(),height = heightBox.val();
					            if (!/^\d*$/.test(width)) {
						            alert(self.lang('invalidWidth'));
						            widthBox[0].focus();
						            return;
					            }
					            if (!/^\d*$/.test(height)) {
						            alert(self.lang('invalidHeight'));
						            heightBox[0].focus();
						            return;
					            }
					            if(isAutoBox[0].checked)
					            {
					                var html = "<button id=\"QXNSY2005\" name=\"106?width=auto@height="+height+"\" style=\"WIDTH:auto; HEIGHT: "+height+"px\" >"+lang.show+" "+lang.width+"=auto "+lang.height+"="+height+"</button>";					            
					            }
					            else
					            {
					                var html = "<button id=\"QXNSY2005\" name=\"106?width="+width+"@height="+height+"\" style=\"WIDTH: "+width+"px; HEIGHT: "+height+"px\" >"+lang.show+" "+lang.width+"="+width+" "+lang.height+"="+height+"</button>";
					            }
					            self.insertHtml(html).hideDialog().focus();
				            }
			            }
		            }),
		            div = dialog.div,
		            widthBox = K('[name="width"]', div),
		            heightBox = K('[name="height"]', div);
		            isAutoBox=K('[name="isAuto"]',div);//自适应宽度参数
		            //加载右键菜单
		            var img = self.plugin.getSelectedNsycomment();
			        if (img) {
				        widthBox.val(K.removeUnit(img.css('width')) ||  0);
				        heightBox.val(K.removeUnit(img.css('height')) || 0);
			        }
			         if(img.css('width')=="auto")
				       {
				       isAutoBox[0].checked=true;
				       }
			        widthBox[0].focus();
			        widthBox[0].select();
	            }
	            
            };
	    //加载控件
	    self.clickToolbar(name, self.plugin.nsycomment.edit);
		});

// 评论 end