Skip to content

Commit

Permalink
Merge branch 't/932-2961' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Feb 7, 2018
2 parents bfef43d + 53fc7bf commit edc6a93
Show file tree
Hide file tree
Showing 141 changed files with 8,414 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dev/langtool/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ fi
cd ../..


plugins=( about autoembed basicstyles bidi blockquote button clipboard codesnippet colorbutton colordialog contextmenu copyformatting devtools div docprops elementspath embedbase fakeobjects filetools find flash font format forms horizontalrule iframe image image2 indent justify language link list liststyle magicline maximize mathjax newpage notification pagebreak pastefromword pastetext placeholder preview print removeformat save selectall showblocks smiley sourcearea sourcedialog specialchar stylescombo table templates toolbar uicolor undo uploadwidget widget )
plugins=( about autoembed basicstyles bidi blockquote button clipboard codesnippet colorbutton colordialog contextmenu copyformatting devtools div docprops easyimage elementspath embedbase fakeobjects filetools find flash font format forms horizontalrule iframe image image2 imagebase indent justify language link list liststyle magicline maximize mathjax newpage notification pagebreak pastefromword pastetext placeholder preview print removeformat save selectall showblocks smiley sourcearea sourcedialog specialchar stylescombo table templates toolbar uicolor undo uploadwidget widget )
plugins_dialogs=( a11yhelp specialchar )
10 changes: 10 additions & 0 deletions dev/langtool/meta/ckeditor.plugin-easyimage/meta.txt
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.
4 changes: 4 additions & 0 deletions dev/langtool/meta/ckeditor.plugin-imagebase/meta.txt
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.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "4.9.0",
"description": "The development version of CKEditor - JavaScript WYSIWYG web text editor.",
"devDependencies": {
"@ckeditor/ckeditor-cloudservices-core": "^0.1.0",
"benderjs": "^0.4.2",
"benderjs-coverage": "^0.2.1",
"benderjs-jquery": "^0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/balloontoolbar/plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

( function() {
Expand Down
2 changes: 1 addition & 1 deletion plugins/balloontoolbar/skins/default.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/license
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.cke_balloon.cke_balloontoolbar
Expand Down
2 changes: 1 addition & 1 deletion plugins/balloontoolbar/skins/kama/balloontoolbar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.cke_balloon.cke_balloontoolbar
Expand Down
2 changes: 1 addition & 1 deletion plugins/balloontoolbar/skins/moono-lisa/balloontoolbar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.cke_balloon.cke_balloontoolbar span:last-child a:last-child::after,
Expand Down
2 changes: 1 addition & 1 deletion plugins/balloontoolbar/skins/moono/balloontoolbar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.cke_balloon.cke_balloontoolbar
Expand Down
9 changes: 5 additions & 4 deletions plugins/button/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,15 @@
}

var name = this.name || this.command,
iconPath = null;
iconPath = null,
overridePath = this.icon;

iconName = name;

// Check if we're pointing to an icon defined by another command. (https://dev.ckeditor.com/ticket/9555)
if ( this.icon && !( /\./ ).test( this.icon ) ) {
iconName = this.icon;
this.icon = null;
overridePath = null;

} else {
// Register and use custom icon for button (#1530).
Expand All @@ -281,7 +282,7 @@

if ( iconPath ) {
CKEDITOR.skin.addIcon( iconPath, iconPath );
this.icon = null;
overridePath = null;
} else {
iconPath = iconName;
}
Expand All @@ -301,7 +302,7 @@
keydownFn: keydownFn,
focusFn: focusFn,
clickFn: clickFn,
style: CKEDITOR.skin.getIconStyle( iconPath, ( editor.lang.dir == 'rtl' ), this.icon, this.iconOffset ),
style: CKEDITOR.skin.getIconStyle( iconPath, ( editor.lang.dir == 'rtl' ), overridePath, this.iconOffset ),
arrowHtml: this.hasArrow ? btnArrowTpl.output() : ''
};

Expand Down
137 changes: 137 additions & 0 deletions plugins/cloudservices/plugin.js
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
*/
} )();
40 changes: 40 additions & 0 deletions plugins/easyimage/dialogs/easyimagealt.js
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
} ]
} ]
};
} );
Binary file added plugins/easyimage/icons/easyimagealigncenter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/easyimagealignleft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/easyimagealignright.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/easyimagealt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/easyimagefull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/easyimageside.png
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.
Binary file added plugins/easyimage/icons/hidpi/easyimagealignleft.png
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.
Binary file added plugins/easyimage/icons/hidpi/easyimagealt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/hidpi/easyimagefull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plugins/easyimage/icons/hidpi/easyimageside.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions plugins/easyimage/lang/en.js
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.'
} );
Loading

0 comments on commit edc6a93

Please sign in to comment.