summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js')
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js
new file mode 100644
index 00000000..69889c1b
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/bower_components/ckeditor/plugins/cloudservices/plugin.js
@@ -0,0 +1,7 @@
+/*
+ Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+*/
+(function(){CKEDITOR.plugins.add("cloudservices",{requires:"filetools,ajax",onLoad:function(){function a(a,b,f,d){c.call(this,a,b,f);this.customToken=d}var c=CKEDITOR.fileTools.fileLoader;a.prototype=CKEDITOR.tools.extend({},c.prototype);a.prototype.upload=function(a,b){(a=a||this.editor.config.cloudServices_uploadUrl)?c.prototype.upload.call(this,a,b):CKEDITOR.error("cloudservices-no-upload-url")};CKEDITOR.plugins.cloudservices.cloudServicesLoader=a},beforeInit:function(a){var c=a.config.cloudServices_tokenUrl,
+e={token:null,REFRESH_INTERVAL:a.CLOUD_SERVICES_TOKEN_INTERVAL||36E5,refreshToken:function(){CKEDITOR.ajax.load(c,function(b){b&&(e.token=b)})},init:function(){this.refreshToken();var b=window.setInterval(this.refreshToken,this.REFRESH_INTERVAL);a.once("destroy",function(){window.clearInterval(b)})}};c?e.init():CKEDITOR.error("cloudservices-no-token-url");a.on("fileUploadRequest",function(b){var a=b.data.fileLoader,d=b.data.requestData,c=a.customToken||e.token;a instanceof CKEDITOR.plugins.cloudservices.cloudServicesLoader&&
+(d.file=d.upload,delete d.upload,c?b.data.fileLoader.xhr.setRequestHeader("Authorization",c):(CKEDITOR.error("cloudservices-no-token"),b.cancel()))},null,null,6);a.on("fileUploadResponse",function(a){var c=a.data.fileLoader,d=c.xhr,e;if(c instanceof CKEDITOR.plugins.cloudservices.cloudServicesLoader){a.stop();try{e=JSON.parse(d.responseText),a.data.response=e}catch(g){CKEDITOR.warn("filetools-response-error",{responseText:d.responseText})}}})}});CKEDITOR.plugins.cloudservices={cloudServicesLoader:null}})(); \ No newline at end of file