1. 程式人生 > >修改 CKEditor 超鏈接的默認協議

修改 CKEditor 超鏈接的默認協議

添加 pan 協議 div proto ref pro ocs 修改

在 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 超鏈接的默認協議