-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 't/932-2961' into major
- Loading branch information
Showing
141 changed files
with
8,414 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
# For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
|
||
commands.fullImage = Label for button converting image to a full width. | ||
commands.sideImage = Label for button converting image to be a side image. | ||
commands.altText = Label for button converting image to assign an alternative text. | ||
commands.alignLeft = Label for button adding align left styles to the image. | ||
commands.alignCenter = Label for button adding align center styles to the image. | ||
commands.alignRight = Label for button adding align right styles to the image. | ||
uploadFailed = Contents of alert displayed when Easy Image widget could not be uploaded due to network error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
# For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
|
||
captionPlaceholder = Contents of placeholder shown inside empty caption of an image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
CKEDITOR.plugins.add( 'cloudservices', { | ||
requires: 'filetools', | ||
onLoad: function() { | ||
var FileLoader = CKEDITOR.fileTools.fileLoader; | ||
|
||
/** | ||
* Dedicated uploader type for [Cloud Services](https://ckeditor.com/ckeditor-cloud-services/). | ||
* | ||
* Note that this type is defined in {@link CKEDITOR.pluginDefinition#onLoad plugin.onLoad} method, thus is | ||
* guaranteed to be available in dependent plugin's {@link CKEDITOR.pluginDefinition#beforeInit beforeInit}, | ||
* {@link CKEDITOR.pluginDefinition#init init} and {@link CKEDITOR.pluginDefinition#afterInit} methods. | ||
* | ||
* @since 4.8.0 | ||
* @class CKEDITOR.plugins.cloudservices.cloudServicesLoader | ||
* @extends CKEDITOR.fileTools.fileLoader | ||
* @constructor | ||
* @inheritdoc | ||
* @param {CKEDITOR.editor} editor The editor instance. Used only to get language data. | ||
* @param {Blob/String} fileOrData A [blob object](https://developer.mozilla.org/en/docs/Web/API/Blob) or a data | ||
* string encoded with Base64. | ||
* @param {String} [fileName] The file name. If not set and the second parameter is a file, then its name will be used. | ||
* If not set and the second parameter is a Base64 data string, then the file name will be created based on | ||
* the {@link CKEDITOR.config#fileTools_defaultFileName} option. | ||
* @param {String} [token] A token used for [Cloud Service](https://ckeditor.com/ckeditor-cloud-services/) request. If | ||
* skipped {@link CKEDITOR.config#cloudServices_token} will be used. | ||
*/ | ||
function CloudServicesLoader( editor, fileOrData, fileName, token ) { | ||
FileLoader.call( this, editor, fileOrData, fileName ); | ||
|
||
/** | ||
* Custom [Cloud Service](https://ckeditor.com/ckeditor-cloud-services/) token. | ||
* | ||
* @property {String} customToken | ||
* @member CKEDITOR.plugins.cloudservices.cloudServicesLoader | ||
*/ | ||
this.customToken = token; | ||
} | ||
|
||
CloudServicesLoader.prototype = CKEDITOR.tools.extend( {}, FileLoader.prototype ); | ||
|
||
/** | ||
* @inheritdoc | ||
* @param {String} [url] The upload URL. If not provided {@link CKEDITOR.config#cloudServices_url} will be used. | ||
* @param {Object} [additionalRequestParameters] Additional data that would be passed to the | ||
* {@link CKEDITOR.editor#fileUploadRequest} event. | ||
*/ | ||
CloudServicesLoader.prototype.upload = function( url, additionalRequestParameters ) { | ||
url = url || this.editor.config.cloudServices_url; | ||
|
||
if ( !url ) { | ||
CKEDITOR.error( 'cloudservices-no-url' ); | ||
return; | ||
} | ||
|
||
FileLoader.prototype.upload.call( this, url, additionalRequestParameters ); | ||
}; | ||
|
||
/** | ||
* @method loadAndUpload | ||
* @inheritdoc | ||
* @param {String} [url] The upload URL. If not provided {@link CKEDITOR.config#cloudServices_url} will be used. | ||
* @param {Object} [additionalRequestParameters] Additional parameters that would be passed to | ||
* the {@link CKEDITOR.editor#fileUploadRequest} event. | ||
*/ | ||
|
||
CKEDITOR.plugins.cloudservices.cloudServicesLoader = CloudServicesLoader; | ||
}, | ||
|
||
beforeInit: function( editor ) { | ||
editor.on( 'fileUploadRequest', function( evt ) { | ||
var fileLoader = evt.data.fileLoader, | ||
reqData = evt.data.requestData; | ||
|
||
if ( fileLoader instanceof CKEDITOR.plugins.cloudservices.cloudServicesLoader ) { | ||
// Cloud Services expect file to be put as a "file" property. | ||
reqData.file = reqData.upload; | ||
delete reqData.upload; | ||
|
||
if ( !( fileLoader.customToken || editor.config.cloudServices_token ) ) { | ||
CKEDITOR.error( 'cloudservices-no-token' ); | ||
evt.cancel(); | ||
return; | ||
} | ||
// Add authorization token. | ||
evt.data.fileLoader.xhr.setRequestHeader( 'Authorization', fileLoader.customToken || editor.config.cloudServices_token ); | ||
} | ||
}, null, null, 6 ); | ||
|
||
editor.on( 'fileUploadResponse', function( evt ) { | ||
var fileLoader = evt.data.fileLoader, | ||
xhr = fileLoader.xhr, | ||
response; | ||
|
||
if ( fileLoader instanceof CKEDITOR.plugins.cloudservices.cloudServicesLoader ) { | ||
evt.stop(); | ||
|
||
try { | ||
response = JSON.parse( xhr.responseText ); | ||
|
||
evt.data.response = response; | ||
} catch ( e ) { | ||
CKEDITOR.warn( 'filetools-response-error', { responseText: xhr.responseText } ); | ||
} | ||
} | ||
} ); | ||
} | ||
} ); | ||
|
||
CKEDITOR.plugins.cloudservices = { | ||
// Note this type is loaded on runtime. | ||
cloudServicesLoader: null | ||
}; | ||
|
||
/** | ||
* Endpoint URL for [Cloud Services](https://ckeditor.com/ckeditor-cloud-services) uploads. | ||
* | ||
* @since 4.8.0 | ||
* @cfg {String} [cloudServices_url=''] | ||
* @member CKEDITOR.config | ||
*/ | ||
|
||
/** | ||
* Token used for [Cloud Services](https://ckeditor.com/ckeditor-cloud-services) authentication. | ||
* | ||
* @since 4.8.0 | ||
* @cfg {String} [cloudServices_token=''] | ||
* @member CKEDITOR.config | ||
*/ | ||
} )(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
CKEDITOR.dialog.add( 'easyimageAlt', function( editor ) { | ||
return { | ||
title: editor.lang.easyimage.commands.altText, | ||
minWidth: 200, | ||
minHeight: 30, | ||
onOk: function() { | ||
var newAlt = CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtAlt' ) ); | ||
|
||
this._.selectedImage.setAttribute( 'alt', newAlt ); | ||
}, | ||
|
||
onHide: function() { | ||
delete this._.selectedImage; | ||
}, | ||
|
||
onShow: function() { | ||
var altField = this.getContentElement( 'info', 'txtAlt' ); | ||
|
||
this._.selectedImage = editor.widgets.focused.parts.image; | ||
|
||
altField.setValue( this._.selectedImage.getAttribute( 'alt' ) ); | ||
altField.focus(); | ||
}, | ||
contents: [ { | ||
id: 'info', | ||
label: editor.lang.easyimage.commands.altText, | ||
accessKey: 'I', | ||
elements: [ { | ||
type: 'text', | ||
id: 'txtAlt', | ||
label: editor.lang.easyimage.commands.altText | ||
} ] | ||
} ] | ||
}; | ||
} ); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
CKEDITOR.plugins.setLang( 'easyimage', 'en', { | ||
commands: { | ||
fullImage: 'Full Size Image', | ||
sideImage: 'Side Image', | ||
alignLeft: 'Align Left', | ||
alignCenter: 'Align Center', | ||
alignRight: 'Align Right', | ||
altText: 'Change image alternative text' | ||
}, | ||
uploadFailed: 'Your image could not be uploaded due to a network error.' | ||
} ); |
Oops, something went wrong.