Skip to content

Commit 83f365a

Browse files
committed
Merge branch 't/13398' into major
2 parents 5c2bd9c + 6e6da99 commit 83f365a

File tree

8 files changed

+60
-59
lines changed

8 files changed

+60
-59
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Other Changes:
4848
* [#13147](http://dev.ckeditor.com/ticket/13147): Add buttons to the sticky toolbar.
4949
* [#13207](http://dev.ckeditor.com/ticket/13207): Use modal window to display help in toolbar configurator.
5050
* [#13316](http://dev.ckeditor.com/ticket/13316): Made [`CKEDITOR.env.isCompatible`](http://docs.ckeditor.com/#!/api/CKEDITOR.env-property-isCompatible) a blacklist rather than a whitelist. More about the change in the [Browser Compatibility](http://docs.ckeditor.com/#!/guide/dev_browsers) guide.
51+
* [#13398](http://dev.ckeditor.com/ticket/13398): Renamed `CKEDITOR.fileTools.UploadsRepository` to [`CKEDITOR.fileTools.UploadRepository`](http://docs.ckeditor.com/#!/api/CKEDITOR.fileTools.uploadRepository) and changed all related properties.
5152

5253
## CKEditor 4.5 Beta
5354

plugins/filetools/plugin.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111

1212
beforeInit: function( editor ) {
1313
/**
14-
* An instance of {@link CKEDITOR.fileTools.uploadsRepository upload repository}.
14+
* An instance of {@link CKEDITOR.fileTools.uploadRepository upload repository}.
1515
* It allows you to create and get {@link CKEDITOR.fileTools.fileLoader file loaders}.
1616
*
17-
* var loader = editor.uploadsRepository.create( file );
17+
* var loader = editor.uploadRepository.create( file );
1818
* loader.loadAndUpload( 'http://foo/bar' );
1919
*
2020
* @since 4.5
2121
* @readonly
22-
* @property {CKEDITOR.fileTools.uploadsRepository} uploadsRepository
22+
* @property {CKEDITOR.fileTools.uploadRepository} uploadRepository
2323
* @member CKEDITOR.editor
2424
*/
25-
editor.uploadsRepository = new UploadsRepository( editor );
25+
editor.uploadRepository = new UploadRepository( editor );
2626

2727
/**
2828
* This event if fired when {@link CKEDITOR.fileTools.fileLoader FileLoader} should send XHR. If event will not be
@@ -190,31 +190,31 @@
190190
/**
191191
* File loaders repository. It allows you to create and get {@link CKEDITOR.fileTools.fileLoader file loaders}.
192192
*
193-
* An instance of the repository is available as a {@link CKEDITOR.editor#uploadsRepository}.
193+
* An instance of the repository is available as a {@link CKEDITOR.editor#uploadRepository}.
194194
*
195-
* var loader = editor.uploadsRepository.create( file );
195+
* var loader = editor.uploadRepository.create( file );
196196
* loader.loadAndUpload( 'http://foo/bar' );
197197
*
198198
* To find more information about handling files see the {@link CKEDITOR.fileTools.fileLoader} class.
199199
*
200200
* @since 4.5
201-
* @class CKEDITOR.fileTools.uploadsRepository
201+
* @class CKEDITOR.fileTools.uploadRepository
202202
* @mixins CKEDITOR.event
203203
* @constructor Creates an instance of the repository.
204204
* @param {CKEDITOR.editor} editor Editor instance. Used only to get the language data.
205205
*/
206-
function UploadsRepository( editor ) {
206+
function UploadRepository( editor ) {
207207
this.editor = editor;
208208

209209
this.loaders = [];
210210
}
211211

212-
UploadsRepository.prototype = {
212+
UploadRepository.prototype = {
213213
/**
214214
* Creates a {@link CKEDITOR.fileTools.fileLoader file loader} instance with a unique id.
215215
* The instance can be later retrieved from the repository using the {@link #loaders} array.
216216
*
217-
* Fires {@link CKEDITOR.fileTools.uploadsRepository#instanceCreated instanceCreated} event.
217+
* Fires {@link CKEDITOR.fileTools.uploadRepository#instanceCreated instanceCreated} event.
218218
*
219219
* @param {Blob/String} fileOrData See {@link CKEDITOR.fileTools.fileLoader}.
220220
* @param {String} fileName See {@link CKEDITOR.fileTools.fileLoader}.
@@ -293,7 +293,7 @@
293293
* or response handling you need to overwrite default behavior using the {@link CKEDITOR.editor#fileUploadRequest} and
294294
* {@link CKEDITOR.editor#fileUploadResponse} events. For more information see their documentation.
295295
*
296-
* To create a `FileLoader` instance use the {@link CKEDITOR.fileTools.uploadsRepository} class.
296+
* To create a `FileLoader` instance use the {@link CKEDITOR.fileTools.uploadRepository} class.
297297
*
298298
* Here is a simple usage of `FileLoader`:
299299
*
@@ -302,7 +302,7 @@
302302
* var file = evt.data.dataTransfer.getFile( i );
303303
*
304304
* if ( CKEDITOR.fileTools.isTypeSupported( file, /image\/png/ ) ) {
305-
* var loader = editor.uploadsRepository.create( file );
305+
* var loader = editor.uploadRepository.create( file );
306306
*
307307
* loader.on( 'update', function() {
308308
* document.getElementById( 'uploadProgress' ).innerHTML = loader.status;
@@ -463,7 +463,7 @@
463463
*/
464464

465465
/**
466-
* If `FileLoader` was created using {@link CKEDITOR.fileTools.uploadsRepository}
466+
* If `FileLoader` was created using {@link CKEDITOR.fileTools.uploadRepository}
467467
* it gets an identifier which is stored in this property.
468468
*
469469
* @readonly
@@ -731,7 +731,7 @@
731731
*/
732732
};
733733

734-
CKEDITOR.event.implementOn( UploadsRepository.prototype );
734+
CKEDITOR.event.implementOn( UploadRepository.prototype );
735735
CKEDITOR.event.implementOn( FileLoader.prototype );
736736

737737
var base64HeaderRegExp = /^data:(\S*?);base64,/;
@@ -782,7 +782,7 @@
782782
}
783783

784784
CKEDITOR.tools.extend( CKEDITOR.fileTools, {
785-
uploadsRepository: UploadsRepository,
785+
uploadRepository: UploadRepository,
786786
fileLoader: FileLoader,
787787

788788
/**

plugins/uploadimage/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
// We are not uploading images in non-editable blocs and fake objects (#13003).
8787
if ( isDataInSrc && isRealObject && !img.data( 'cke-upload-id' ) && !img.isReadOnly( 1 ) ) {
88-
var loader = editor.uploadsRepository.create( img.getAttribute( 'src' ) );
88+
var loader = editor.uploadRepository.create( img.getAttribute( 'src' ) );
8989
loader.upload( uploadUrl );
9090

9191
fileTools.markElement( img, 'uploadimage', loader.id );

plugins/uploadwidget/dev/filereaderplugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
if ( fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) {
3838
var el = new CKEDITOR.dom.element( 'span' ),
39-
loader = editor.uploadsRepository.create( file );
39+
loader = editor.uploadRepository.create( file );
4040

4141
el.setText( '...' );
4242

plugins/uploadwidget/plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
*
9696
* if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) {
9797
* el = new CKEDITOR.dom.element( 'span' ),
98-
* loader = editor.uploadsRepository.create( file );
98+
* loader = editor.uploadRepository.create( file );
9999
*
100100
* el.setText( '...' );
101101
*
@@ -121,7 +121,7 @@
121121
*
122122
* if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/pdf/ ) ) {
123123
* el = new CKEDITOR.dom.element( 'span' ),
124-
* loader = editor.uploadsRepository.create( file );
124+
* loader = editor.uploadRepository.create( file );
125125
*
126126
* el.setText( '...' );
127127
*
@@ -143,7 +143,7 @@
143143
*/
144144
function addUploadWidget( editor, name, def ) {
145145
var fileTools = CKEDITOR.fileTools,
146-
uploads = editor.uploadsRepository,
146+
uploads = editor.uploadRepository,
147147
// Plugins which support all file type has lower priority than plugins which support specific types.
148148
priority = def.supportedTypes ? 10 : 20;
149149

@@ -498,4 +498,4 @@
498498
markElement: markElement,
499499
bindNotifications: bindNotifications
500500
} );
501-
} )();
501+
} )();

tests/plugins/filetools/filetools.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
isTypeSupported = CKEDITOR.fileTools.isTypeSupported;
2323
getExtention = CKEDITOR.fileTools.getExtention;
2424

25-
// Reset uploadsRepository.
26-
this.editor.uploadsRepository.loaders = [];
25+
// Reset uploadRepository.
26+
this.editor.uploadRepository.loaders = [];
2727
},
2828

2929
'test getUploadUrl 1': function() {
@@ -110,8 +110,8 @@
110110
assert.isFalse( isTypeSupported( { type: 'image/jpeg' }, /image\/(png|gif)/ ) );
111111
},
112112

113-
'test UploadsRepository': function() {
114-
var repository = this.editor.uploadsRepository;
113+
'test UploadRepository': function() {
114+
var repository = this.editor.uploadRepository;
115115

116116
assert.areSame( 0, repository.loaders.length );
117117
assert.isUndefined( repository.loaders[ 0 ] );
@@ -137,8 +137,8 @@
137137
},
138138

139139

140-
'test UploadsRepository instanceCreated event': function() {
141-
var repository = this.editor.uploadsRepository,
140+
'test UploadRepository instanceCreated event': function() {
141+
var repository = this.editor.uploadRepository,
142142
listener = sinon.spy();
143143

144144
repository.on( 'instanceCreated', listener );
@@ -149,8 +149,8 @@
149149
assert.areSame( loader, listener.firstCall.args[ 0 ].data, 'Should be called with loader.' );
150150
},
151151

152-
'test UploadsRepository isFinished': function() {
153-
var repository = this.editor.uploadsRepository;
152+
'test UploadRepository isFinished': function() {
153+
var repository = this.editor.uploadRepository;
154154

155155

156156
repository.create( { name: 'foo1' } );

tests/plugins/uploadimage/uploadimage.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
loadAndUploadCount = 0;
7777

7878
for ( editorName in this.editors ) {
79-
// Clear uploads repository.
80-
this.editors[ editorName ].uploadsRepository.loaders = [];
79+
// Clear upload repository.
80+
this.editors[ editorName ].uploadRepository.loaders = [];
8181
}
8282

8383
if ( CKEDITOR.fileTools.bindNotifications.reset ) {
@@ -93,7 +93,7 @@
9393
assertUploadingWidgets( editor, LOADING_IMG );
9494
assert.areSame( '', editor.getData(), 'getData on loading.' );
9595

96-
var loader = editor.uploadsRepository.loaders[ 0 ];
96+
var loader = editor.uploadRepository.loaders[ 0 ];
9797

9898
loader.data = bender.tools.pngBase64;
9999
loader.changeStatus( 'uploading' );
@@ -120,7 +120,7 @@
120120

121121
pasteFiles( editor, [ bender.tools.getTestPngFile() ] );
122122

123-
var loader = editor.uploadsRepository.loaders[ 0 ];
123+
var loader = editor.uploadRepository.loaders[ 0 ];
124124

125125
loader.data = bender.tools.pngBase64;
126126
loader.changeStatus( 'uploading' );
@@ -150,7 +150,7 @@
150150
assertUploadingWidgets( editor, LOADING_IMG );
151151
assert.areSame( '', editor.getData(), 'getData on loading.' );
152152

153-
var loader = editor.uploadsRepository.loaders[ 0 ];
153+
var loader = editor.uploadRepository.loaders[ 0 ];
154154

155155
loader.data = bender.tools.pngBase64;
156156
loader.changeStatus( 'uploading' );
@@ -182,7 +182,7 @@
182182
assertUploadingWidgets( editor, LOADED_IMG );
183183
assert.areSame( '<p>xx</p>', editor.getData(), 'getData on loading.' );
184184

185-
var loader = editor.uploadsRepository.loaders[ 0 ];
185+
var loader = editor.uploadRepository.loaders[ 0 ];
186186

187187
loader.data = bender.tools.pngBase64;
188188
loader.changeStatus( 'uploading' );
@@ -341,7 +341,7 @@
341341

342342
'test paste image already marked': function() {
343343
var editor = this.editors.classic,
344-
uploads = editor.uploadsRepository;
344+
uploads = editor.uploadRepository;
345345

346346
resumeAfter( editor, 'paste', function( evt ) {
347347
var img = CKEDITOR.dom.element.createFromHtml( evt.data.dataValue );
@@ -475,7 +475,7 @@
475475

476476
'test prevent upload fake elements (#13003)': function() {
477477
var editor = this.editors.inline,
478-
createspy = sinon.spy( editor.uploadsRepository, 'create' );
478+
createspy = sinon.spy( editor.uploadRepository, 'create' );
479479

480480
editor.fire( 'paste', {
481481
dataValue: '<img src="data:image/gif;base64,aw==" alt="nothing" data-cke-realelement="some" />'

0 commit comments

Comments
 (0)