首页 > 其他 > 详细

修改 CKEditor 超链接的默认协议

时间:2017-07-02 20:50:33      阅读:281      评论:0      收藏:0      [点我收藏+]

在 config.js 中添加如下代码

CKEDITOR.on( ‘dialogDefinition‘, function( ev )
{
		// Take the dialog name and its definition from the event data.
		var dialogName = ev.data.name;
		var dialogDefinition = ev.data.definition;
 
		// Check if the definition is from the dialog window you are interested in (the "Link" dialog window).
		if ( dialogName == ‘link‘ )
		{
			// Get a reference to the "Link Info" tab.
			var infoTab = dialogDefinition.getContents( ‘info‘ );
 
			// Set the default value for the URL field.
			// var urlField = infoTab.get( ‘url‘ );
			// urlField[‘default‘] = ‘www.example.xxxcom‘;
			
			var protocolField = infoTab.get( ‘protocol‘ );
			protocolField[‘default‘] = "";
		}
});

参考:

How Do I Set a Default Value for a CKEditor Dialog Window Field?

 

 

修改 CKEditor 超链接的默认协议

原文:http://www.cnblogs.com/forestk/p/7107066.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!