summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/autolink/plugin.js
blob: ce9614bcc2347167638c0c1d16577017b3dfb46f (plain)
1
2
3
4
5
/*
 Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){var d=/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/ig,e=/"/g;CKEDITOR.plugins.add("autolink",{requires:"clipboard",init:function(c){c.on("paste",function(b){var a=b.data.dataValue;b.data.dataTransfer.getTransferType(c)==CKEDITOR.DATA_TRANSFER_INTERNAL||-1<a.indexOf("\x3c")||(a=a.replace(d,'\x3ca href\x3d"'+a.replace(e,"%22")+'"\x3e$\x26\x3c/a\x3e'),a!=b.data.dataValue&&(b.data.type="html"),b.data.dataValue=a)})}})})();