Index: lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java =================================================================== diff -u -rdf6e66a4321a9fa64d6903fe642266ec65cd9c4b -rc612e32f2eb43e457a3ed528a5e9fb0febddae06 --- lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java (.../LAMSUploadServlet.java) (revision df6e66a4321a9fa64d6903fe642266ec65cd9c4b) +++ lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java (.../LAMSUploadServlet.java) (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -36,6 +36,9 @@ import org.springframework.util.FileCopyUtils; import org.springframework.web.context.support.SpringBeanAutowiringSupport; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + /** * Servlet to upload files.
* @@ -222,6 +225,21 @@ out.println(""); out.flush(); out.close(); + } else if ("json".equalsIgnoreCase(request.getParameter("responseType"))) { + // UploadImage CKEditor plugin requires this format of response + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + if (returnMessage == null) { + responseJSON.put("uploaded", 1); + responseJSON.put("fileName", newName); + responseJSON.put("url", fileUrl); + } else { + responseJSON.put("uploaded", 0); + ObjectNode errorJSON = JsonNodeFactory.instance.objectNode(); + errorJSON.put("message", returnMessage); + responseJSON.set("error", errorJSON); + } + response.setContentType("application/json;charset=UTF-8"); + response.getWriter().write(responseJSON.toString()); } } Index: lams_central/web/ckeditor/README.md =================================================================== diff -u -rb9d1ec3fae172f7c9cf591469e6ba84ba901d079 -rc612e32f2eb43e457a3ed528a5e9fb0febddae06 --- lams_central/web/ckeditor/README.md (.../README.md) (revision b9d1ec3fae172f7c9cf591469e6ba84ba901d079) +++ lams_central/web/ckeditor/README.md (.../README.md) (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -22,6 +22,8 @@ You should have already completed this step, but be sure you have the very latest version. + Include the following plugins with latest version: uploadwidget, uploadimage + 2. **Extract** (decompress) the downloaded file into the root of your website. 3. Copy plugins developed by LAMS from the old instance of CKEditor @@ -31,6 +33,7 @@ /ckeditor/plugins/bootpanel /ckeditor/plugins/confighelper /ckeditor/plugins/wavepanel + 4. Apply all customizations listed below in LAMS Customizations **Note:** CKEditor is by default installed in the `ckeditor` folder. You can Index: lams_central/web/ckeditor/plugins/uploadimage/plugin.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadimage/plugin.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadimage/plugin.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,154 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +( function() { + var uniqueNameCounter = 0, + // Black rectangle which is shown before the image is loaded. + loadingImage = 'data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs='; + + // Returns number as a string. If a number has 1 digit only it returns it prefixed with an extra 0. + function padNumber( input ) { + if ( input <= 9 ) { + input = '0' + input; + } + + return String( input ); + } + + // Returns a unique image file name. + function getUniqueImageFileName( type ) { + var date = new Date(), + dateParts = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ]; + + uniqueNameCounter += 1; + + return 'image-' + CKEDITOR.tools.array.map( dateParts, padNumber ).join( '' ) + '-' + uniqueNameCounter + '.' + type; + } + + CKEDITOR.plugins.add( 'uploadimage', { + requires: 'uploadwidget', + + onLoad: function() { + CKEDITOR.addCss( + '.cke_upload_uploading img{' + + 'opacity: 0.3' + + '}' + ); + }, + + isSupportedEnvironment: function() { + return CKEDITOR.plugins.clipboard.isFileApiSupported; + }, + + init: function( editor ) { + // Do not execute this paste listener if it will not be possible to upload file. + if ( !this.isSupportedEnvironment() ) { + return; + } + + var fileTools = CKEDITOR.fileTools, + uploadUrl = fileTools.getUploadUrl( editor.config, 'image' ); + + if ( !uploadUrl ) { + return; + } + + // Handle images which are available in the dataTransfer. + fileTools.addUploadWidget( editor, 'uploadimage', { + supportedTypes: /image\/(jpeg|png|gif|bmp)/, + + uploadUrl: uploadUrl, + + fileToElement: function() { + var img = new CKEDITOR.dom.element( 'img' ); + img.setAttribute( 'src', loadingImage ); + return img; + }, + + parts: { + img: 'img' + }, + + onUploading: function( upload ) { + // Show the image during the upload. + this.parts.img.setAttribute( 'src', upload.data ); + }, + + onUploaded: function( upload ) { + // Width and height could be returned by server (https://dev.ckeditor.com/ticket/13519). + var $img = this.parts.img.$, + width = upload.responseData.width || $img.naturalWidth, + height = upload.responseData.height || $img.naturalHeight; + + // Set width and height to prevent blinking. + this.replaceWith( '' ); + } + } ); + + // Handle images which are not available in the dataTransfer. + // This means that we need to read them from the elements. + editor.on( 'paste', function( evt ) { + // For performance reason do not parse data if it does not contain img tag and data attribute. + if ( !evt.data.dataValue.match( / + + + + + CORS sample + + + + + + +

CORS sample

+ + + + Index: lams_central/web/ckeditor/plugins/uploadwidget/dev/filereaderplugin.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/dev/filereaderplugin.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/dev/filereaderplugin.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,55 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ +'use strict'; + +( function() { + CKEDITOR.plugins.add( 'filereader', { + requires: 'uploadwidget', + init: function( editor ) { + var fileTools = CKEDITOR.fileTools; + + fileTools.addUploadWidget( editor, 'filereader', { + onLoaded: function( upload ) { + var data = upload.data; + if ( data && data.indexOf( ',' ) >= 0 && data.indexOf( ',' ) < data.length - 1 ) { + this.replaceWith( atob( upload.data.split( ',' )[ 1 ] ) ); + } else { + editor.widgets.del( this ); + } + } + } ); + + editor.on( 'paste', function( evt ) { + var data = evt.data, + dataTransfer = data.dataTransfer, + filesCount = dataTransfer.getFilesCount(), + file, i; + + if ( data.dataValue || !filesCount ) { + return; + } + + for ( i = 0; i < filesCount; i++ ) { + file = dataTransfer.getFile( i ); + + if ( fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) { + var el = new CKEDITOR.dom.element( 'span' ), + loader = editor.uploadRepository.create( file ); + + el.setText( '...' ); + + loader.load(); + + fileTools.markElement( el, 'filereader', loader.id ); + + fileTools.bindNotifications( editor, loader ); + + data.dataValue += el.getOuterHtml(); + } + } + } ); + } + } ); +} )(); Index: lams_central/web/ckeditor/plugins/uploadwidget/dev/upload.html =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/dev/upload.html (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/dev/upload.html (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,97 @@ + + + + + + Upload image dev sample + + + + + + +

Upload image dev sample

+ + +
+

Saturn V carrying Apollo 11 Apollo 11

+ +

Apollo 11 was the spaceflight that landed the first humans, Americans Neil Armstrong and Buzz Aldrin, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.

+ +

Armstrong spent about three and a half two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.

+ +

Broadcasting and quotes

+ +

Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:

+ +
+

One small step for [a] man, one giant leap for mankind.

+
+ +

Apollo 11 effectively ended the Space Race and fulfilled a national goal proposed in 1961 by the late U.S. President John F. Kennedy in a speech before the United States Congress:

+ +
+

[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.

+
+ +

Technical details

+ + + + + + + + + + + + + + + + + + + + + + + +
Mission crew
PositionAstronaut
CommanderNeil A. Armstrong
Command Module PilotMichael Collins
Lunar Module PilotEdwin "Buzz" E. Aldrin, Jr.
+ +

Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of NASA's Apollo program. The Apollo spacecraft had three parts:

+ +
    +
  1. Command Module with a cabin for the three astronauts which was the only part which landed back on Earth
  2. +
  3. Service Module which supported the Command Module with propulsion, electrical power, oxygen and water
  4. +
  5. Lunar Module for landing on the Moon.
  6. +
+ +

After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean on July 24.

+ +
+

Source: Wikipedia.org

+
+ + + + Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/az.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/az.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/az.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'az', { + abort: 'Serverə yükləmə istifadəçi tərəfindən dayandırılıb', + doneOne: 'Fayl müvəffəqiyyətlə yüklənib', + doneMany: '%1 fayllar müvəffəqiyyətlə yüklənib', + uploadOne: 'Faylın yüklənməsi ({percentage}%)', + uploadMany: 'Faylların yüklənməsi, {max}-dan {current} hazır ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/bg.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/bg.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/bg.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'bg', { + abort: 'Качването е прекратено от потребителя.', + doneOne: 'Файлът е качен успешно.', + doneMany: 'Успешно са качени %1 файла.', + uploadOne: 'Качване на файл ({percentage}%)...', + uploadMany: 'Качване на файлове, {current} от {max} качени ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ca.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ca.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ca.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ca', { + abort: 'Pujada cancel·lada per l\'usuari.', + doneOne: 'Fitxer pujat correctament.', + doneMany: '%1 fitxers pujats correctament.', + uploadOne: 'Pujant fitxer ({percentage}%)...', + uploadMany: 'Pujant fitxers, {current} de {max} finalitzats ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/cs.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/cs.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/cs.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'cs', { + abort: 'Nahrávání zrušeno uživatelem.', + doneOne: 'Soubor úspěšně nahrán.', + doneMany: 'Úspěšně nahráno %1 souborů.', + uploadOne: 'Nahrávání souboru ({percentage}%)...', + uploadMany: 'Nahrávání souborů, {current} z {max} hotovo ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/da.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/da.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/da.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'da', { + abort: 'Upload er afbrudt af bruger.', + doneOne: 'Filen er uploadet.', + doneMany: 'Du har uploadet %1 filer.', + uploadOne: 'Uploader fil ({percentage}%)...', + uploadMany: 'Uploader filer, {current} af {max} er uploadet ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/de-ch.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/de-ch.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/de-ch.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'de-ch', { + abort: 'Hochladen durch den Benutzer abgebrochen.', + doneOne: 'Datei erfolgreich hochgeladen.', + doneMany: '%1 Dateien erfolgreich hochgeladen.', + uploadOne: 'Datei wird hochgeladen ({percentage}%)...', + uploadMany: 'Dateien werden hochgeladen, {current} von {max} fertig ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/de.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/de.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/de.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'de', { + abort: 'Hochladen durch den Benutzer abgebrochen.', + doneOne: 'Datei erfolgreich hochgeladen.', + doneMany: '%1 Dateien erfolgreich hochgeladen.', + uploadOne: 'Datei wird hochgeladen ({percentage}%)...', + uploadMany: 'Dateien werden hochgeladen, {current} von {max} fertig ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/el.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/el.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/el.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'el', { + abort: 'Αποστολή ακυρώθηκε απο χρήστη.', + doneOne: 'Αρχείο εστάλη επιτυχώς.', + doneMany: 'Επιτυχής αποστολή %1 αρχείων.', + uploadOne: 'Αποστολή αρχείου ({percentage}%)…', + uploadMany: 'Αποστολή αρχείων, {current} από {max} ολοκληρωμένα ({percentage}%)…' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/en-au.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/en-au.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/en-au.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'en-au', { + abort: 'Upload aborted by the user.', + doneOne: 'File successfully uploaded.', + doneMany: 'Successfully uploaded %1 files.', + uploadOne: 'Uploading file ({percentage}%)...', + uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/en.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/en.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/en.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'en', { + abort: 'Upload aborted by the user.', + doneOne: 'File successfully uploaded.', + doneMany: 'Successfully uploaded %1 files.', + uploadOne: 'Uploading file ({percentage}%)...', + uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/eo.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/eo.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/eo.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'eo', { + abort: 'Alŝuto ĉesigita de la uzanto', + doneOne: 'Dosiero sukcese alŝutita.', + doneMany: 'Sukcese alŝutitaj %1 dosieroj.', + uploadOne: 'alŝutata dosiero ({percentage}%)...', + uploadMany: 'Alŝutataj dosieroj, {current} el {max} faritaj ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/es-mx.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/es-mx.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/es-mx.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'es-mx', { + abort: 'La carga ha sido abortada por el usuario.', + doneOne: 'El archivo ha sido cargado completamente.', + doneMany: '%1 archivos cargados completamente.', + uploadOne: 'Cargando archivo ({percentage}%)...', + uploadMany: 'Cargando archivos, {current} de {max} listo ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/es.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/es.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/es.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'es', { + abort: 'Carga abortada por el usuario.', + doneOne: 'Archivo cargado exitósamente.', + doneMany: '%1 archivos exitósamente cargados.', + uploadOne: 'Cargando archivo ({percentage}%)...', + uploadMany: 'Cargando archivos, {current} de {max} hecho ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/et.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/et.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/et.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'et', { + abort: 'Kasutaja katkestas üleslaadimise.', + doneOne: 'Fail on üles laaditud.', + doneMany: '%1 faili laaditi edukalt üles.', + uploadOne: 'Faili üleslaadimine ({percentage}%)...', + uploadMany: 'Failide üleslaadimine, {current} fail {max}-st üles laaditud ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/eu.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/eu.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/eu.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'eu', { + abort: 'Karga erabiltzaileak bertan behera utzita.', + doneOne: 'Fitxategia behar bezala kargatu da.', + doneMany: 'Behar bezala kargatu dira %1 fitxategi.', + uploadOne: 'Fitxategia kargatzen ({percentage}%)...', + uploadMany: 'Fitxategiak kargatzen, {current} / {max} eginda ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/fa.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/fa.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/fa.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'fa', { + abort: 'بارگذاری توسط کاربر لغو شد.', + doneOne: 'فایل با موفقیت بارگذاری شد.', + doneMany: '%1 از فایل​ها با موفقیت بارگذاری شد.', + uploadOne: 'بارگذاری فایل ({percentage}%)...', + uploadMany: 'بارگذاری فایل​ها, {current} از {max} انجام شده ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/fr.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/fr.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/fr.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'fr', { + abort: 'Téléversement interrompu par l\'utilisateur.', + doneOne: 'Fichier téléversé avec succès.', + doneMany: '%1 fichiers téléversés avec succès.', + uploadOne: 'Téléversement du fichier en cours ({percentage} %)…', + uploadMany: 'Téléversement des fichiers en cours, {current} sur {max} effectués ({percentage} %)…' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/gl.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/gl.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/gl.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'gl', { + abort: 'Envío interrompido polo usuario.', + doneOne: 'Ficheiro enviado satisfactoriamente.', + doneMany: '%1 ficheiros enviados satisfactoriamente.', + uploadOne: 'Enviando o ficheiro ({percentage}%)...', + uploadMany: 'Enviando ficheiros, {current} de {max} feito o ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/hr.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/hr.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/hr.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'hr', { + abort: 'Slanje prekinuto od strane korisnika', + doneOne: 'Datoteka uspješno poslana.', + doneMany: 'Uspješno poslano %1 datoteka.', + uploadOne: 'Slanje datoteke ({percentage}%)...', + uploadMany: 'Slanje datoteka, {current} od {max} gotovo ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/hu.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/hu.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/hu.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'hu', { + abort: 'A feltöltést a felhasználó megszakította.', + doneOne: 'A fájl sikeresen feltöltve.', + doneMany: '%1 fájl sikeresen feltöltve.', + uploadOne: 'Fájl feltöltése ({percentage}%)...', + uploadMany: 'Fájlok feltöltése, {current}/{max} kész ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/id.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/id.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/id.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'id', { + abort: 'Pengunggahan dibatalkan oleh pengguna', + doneOne: 'Berkas telah berhasil diunggah', + doneMany: 'Pengunggahan berkas %1 berhasil', + uploadOne: 'Mengunggah berkas ({percentage}%)...', + uploadMany: 'Pengunggahan berkas {current} dari {max} berhasil ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/it.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/it.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/it.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'it', { + abort: 'Caricamento interrotto dall\'utente.', + doneOne: 'Il file è stato caricato correttamente.', + doneMany: '%1 file sono stati caricati correttamente.', + uploadOne: 'Caricamento del file ({percentage}%)...', + uploadMany: 'Caricamento dei file, {current} di {max} completati ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ja.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ja.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ja.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ja', { + abort: 'アップロードを中止しました。', + doneOne: 'ファイルのアップロードに成功しました。', + doneMany: '%1個のファイルのアップロードに成功しました。', + uploadOne: 'ファイルのアップロード中 ({percentage}%)...', + uploadMany: '{max} 個中 {current} 個のファイルをアップロードしました。 ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/km.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/km.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/km.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'km', { + abort: 'បាន​ផ្ដាច់​ការផ្ទុកឡើង​ដោយ​អ្នក​ប្រើប្រាស់។', + doneOne: 'បាន​ផ្ទុកឡើង​នូវ​ឯកសារ​ដោយ​ជោគជ័យ។', + doneMany: 'បាន​ផ្ទុក​ឡើង​នូវ​ឯកសារ %1 ដោយ​ជោគជ័យ។', + uploadOne: 'កំពុង​ផ្ទុកឡើង​ឯកសារ ({percentage}%)...', + uploadMany: 'កំពុង​ផ្ទុកឡើង​ឯកសារ, រួចរាល់ {current} នៃ {max} ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ko.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ko.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ko.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ko', { + abort: '사용자가 업로드를 중단했습니다.', + doneOne: '파일이 성공적으로 업로드되었습니다.', + doneMany: '파일 %1개를 성공적으로 업로드하였습니다.', + uploadOne: '파일 업로드중 ({percentage}%)...', + uploadMany: '파일 {max} 개 중 {current} 번째 파일 업로드 중 ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ku.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ku.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ku.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ku', { + abort: 'بارکردنەکە بڕدرا لەلایەن بەکارهێنەر.', + doneOne: 'پەڕگەکە بەسەرکەوتووانە بارکرا.', + doneMany: 'بەسەرکەوتووانە بارکرا %1 پەڕگە.', + uploadOne: 'پەڕگە باردەکرێت ({percentage}%)...', + uploadMany: 'پەڕگە باردەکرێت, {current} لە {max} ئەنجامدراوە ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/lv.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/lv.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/lv.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'lv', { + abort: 'Augšupielādi atcēla lietotājs.', + doneOne: 'Fails veiksmīgi ielādēts.', + doneMany: 'Veiksmīgi ielādēts %1 fails.', + uploadOne: 'Ielādāju failu ({percentage}%)...', + uploadMany: 'Ielādēju failus, {curent} no {max} izpildīts ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/nb.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/nb.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/nb.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'nb', { + abort: 'Opplasting ble avbrutt av brukeren.', + doneOne: 'Filen har blitt lastet opp.', + doneMany: 'Fullført opplasting av %1 filer.', + uploadOne: 'Laster opp fil ({percentage}%)...', + uploadMany: 'Laster opp filer, {current} av {max} fullført ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/nl.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/nl.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/nl.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'nl', { + abort: 'Upload gestopt door de gebruiker.', + doneOne: 'Bestand succesvol geüpload.', + doneMany: 'Succesvol %1 bestanden geüpload.', + uploadOne: 'Uploaden bestand ({percentage}%)…', + uploadMany: 'Bestanden aan het uploaden, {current} van {max} klaar ({percentage}%)…' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/no.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/no.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/no.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'no', { + abort: 'Opplasting ble avbrutt av brukeren.', + doneOne: 'Filen har blitt lastet opp.', + doneMany: 'Fullført opplasting av %1 filer.', + uploadOne: 'Laster opp fil ({percentage}%)...', + uploadMany: 'Laster opp filer, {current} av {max} fullført ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/oc.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/oc.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/oc.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'oc', { + abort: 'Mandadís interromput per l\'utilizaire', + doneOne: 'Fichièr mandat amb succès.', + doneMany: '%1 fichièrs mandats amb succès.', + uploadOne: 'Mandadís del fichièr en cors ({percentage} %)…', + uploadMany: 'Mandadís dels fichièrs en cors, {current} sus {max} efectuats ({percentage} %)…' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/pl.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/pl.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/pl.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'pl', { + abort: 'Wysyłanie przerwane przez użytkownika.', + doneOne: 'Plik został pomyślnie wysłany.', + doneMany: 'Pomyślnie wysłane pliki: %1.', + uploadOne: 'Wysyłanie pliku ({percentage}%)...', + uploadMany: 'Wysyłanie plików, gotowe {current} z {max} ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/pt-br.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/pt-br.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/pt-br.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'pt-br', { + abort: 'Envio cancelado pelo usuário.', + doneOne: 'Arquivo enviado com sucesso.', + doneMany: 'Enviados %1 arquivos com sucesso.', + uploadOne: 'Enviando arquivo({percentage}%)...', + uploadMany: 'Enviando arquivos, {current} de {max} completos ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/pt.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/pt.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/pt.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'pt', { + abort: 'Carregamento cancelado pelo utilizador.', + doneOne: 'Ficheiro carregado com sucesso.', + doneMany: 'Successfully uploaded %1 files.', // MISSING + uploadOne: 'Uploading file ({percentage}%)...', // MISSING + uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' // MISSING +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ro.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ro.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ro.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ro', { + abort: 'Încărcare întreruptă de utilizator.', + doneOne: 'Fișier încărcat cu succes.', + doneMany: '%1 fișiere încărcate cu succes.', + uploadOne: 'Încărcare fișier ({percentage}%)...', + uploadMany: 'Încărcare fișiere, {current} din {max} realizat ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ru.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ru.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ru.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ru', { + abort: 'Загрузка отменена пользователем', + doneOne: 'Файл успешно загружен', + doneMany: 'Успешно загружено файлов: %1', + uploadOne: 'Загрузка файла ({percentage}%)', + uploadMany: 'Загрузка файлов, {current} из {max} загружено ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/sk.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/sk.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/sk.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'sk', { + abort: 'Nahrávanie zrušené používateľom.', + doneOne: 'Súbor úspešne nahraný.', + doneMany: 'Úspešne nahraných %1 súborov.', + uploadOne: 'Nahrávanie súboru ({percentage}%)...', + uploadMany: 'Nahrávanie súborov, {current} z {max} hotovo ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/sq.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/sq.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/sq.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'sq', { + abort: 'Ngarkimi u ndërpre nga përdoruesi.', + doneOne: 'Skeda u ngarkua me sukses.', + doneMany: 'Me sukses u ngarkuan %1 skeda.', + uploadOne: 'Duke ngarkuar skedën ({percentage}%)...', + uploadMany: 'Duke ngarkuar skedat, {current} nga {max} , ngarkuar ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/sr-latn.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/sr-latn.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/sr-latn.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'sr-latn', { + abort: 'Postavljanje je prekinuto sa strane korisnika', + doneOne: 'Datoteka je uspešno postavljena', + doneMany: '%1 datoteka je uspešno postavljena', + uploadOne: 'Postavljanje datoteke ({percentage}%)...', + uploadMany: 'Postavljanje datoteka, {current} of {max} done ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/sr.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/sr.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/sr.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'sr', { + abort: 'Постављање је прекинуто са стране корисника', + doneOne: 'Датотека је успешно постављена', + doneMany: '%1 датотека је успешно постављена', + uploadOne: 'Постављање датотеке ({percentage}%)...', + uploadMany: 'Постављање датотека, {current} of {max} done ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/sv.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/sv.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/sv.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'sv', { + abort: 'Uppladdning avbruten av användaren.', + doneOne: 'Filuppladdning lyckades.', + doneMany: 'Uppladdning av %1 filer lyckades.', + uploadOne: 'Laddar upp fil ({percentage}%)...', + uploadMany: 'Laddar upp filer, {current} av {max} färdiga ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/tr.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/tr.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/tr.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'tr', { + abort: 'Gönderme işlemi kullanıcı tarafından durduruldu.', + doneOne: 'Gönderim işlemi başarılı şekilde tamamlandı.', + doneMany: '%1 dosya başarılı şekilde gönderildi.', + uploadOne: 'Dosyanın ({percentage}%) gönderildi...', + uploadMany: 'Toplam {current} / {max} dosyanın ({percentage}%) gönderildi...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/ug.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/ug.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/ug.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'ug', { + abort: 'يۈكلەشنى ئىشلەتكۈچى ئۈزۈۋەتتى.', + doneOne: 'ھۆججەت مۇۋەپپەقىيەتلىك يۈكلەندى.', + doneMany: 'مۇۋەپپەقىيەتلىك ھالدا %1 ھۆججەت يۈكلەندى.', + uploadOne: 'Uploading file ({percentage}%)...', // MISSING + uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' // MISSING +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/uk.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/uk.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/uk.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'uk', { + abort: 'Завантаження перервано користувачем.', + doneOne: 'Файл цілком завантажено.', + doneMany: 'Цілком завантажено %1 файлів.', + uploadOne: 'Завантаження файлу ({percentage}%)...', + uploadMany: 'Завантажено {current} із {max} файлів завершено на ({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/zh-cn.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/zh-cn.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/zh-cn.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'zh-cn', { + abort: '上传已被用户中止', + doneOne: '文件上传成功', + doneMany: '成功上传了 %1 个文件', + uploadOne: '正在上传文件({percentage}%)...', + uploadMany: '正在上传文件,{max} 中的 {current}({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/lang/zh.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/lang/zh.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/lang/zh.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +CKEDITOR.plugins.setLang( 'uploadwidget', 'zh', { + abort: '上傳由使用者放棄。', + doneOne: '檔案成功上傳。', + doneMany: '成功上傳 %1 檔案。', + uploadOne: '正在上傳檔案({percentage}%)...', + uploadMany: '正在上傳檔案,{max} 中的 {current} 已完成({percentage}%)...' +} ); Index: lams_central/web/ckeditor/plugins/uploadwidget/plugin.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/uploadwidget/plugin.js (revision 0) +++ lams_central/web/ckeditor/plugins/uploadwidget/plugin.js (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -0,0 +1,580 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +( function() { + CKEDITOR.plugins.add( 'uploadwidget', { + lang: 'az,bg,ca,cs,da,de,de-ch,el,en,en-au,eo,es,es-mx,et,eu,fa,fr,gl,hr,hu,id,it,ja,km,ko,ku,lv,nb,nl,no,oc,pl,pt,pt-br,ro,ru,sk,sq,sr,sr-latn,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE% + requires: 'widget,clipboard,filetools,notificationaggregator', + + init: function( editor ) { + // Images which should be changed into upload widget needs to be marked with `data-widget` on paste, + // because otherwise wrong widget may handle upload placeholder element (e.g. image2 plugin would handle image). + // `data-widget` attribute is allowed only in the elements which has also `data-cke-upload-id` attribute. + editor.filter.allow( '*[!data-widget,!data-cke-upload-id]' ); + }, + + isSupportedEnvironment: function() { + return CKEDITOR.plugins.clipboard.isFileApiSupported; + } + } ); + + /** + * This function creates an upload widget — a placeholder to show the progress of an upload. The upload widget + * is based on its {@link CKEDITOR.fileTools.uploadWidgetDefinition definition}. The `addUploadWidget` method also + * creates a `paste` event, if the {@link CKEDITOR.fileTools.uploadWidgetDefinition#fileToElement fileToElement} method + * is defined. This event helps in handling pasted files, as it will automatically check if the files were pasted and + * mark them to be uploaded. + * + * The upload widget helps to handle content that is uploaded asynchronously inside the editor. It solves issues such as: + * editing during upload, undo manager integration, getting data, removing or copying uploaded element. + * + * To create an upload widget you need to define two transformation methods: + * + * * The {@link CKEDITOR.fileTools.uploadWidgetDefinition#fileToElement fileToElement} method which will be called on + * `paste` and transform a file into a placeholder. + * * The {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploaded onUploaded} method with + * the {@link CKEDITOR.fileTools.uploadWidgetDefinition#replaceWith replaceWith} method which will be called to replace + * the upload placeholder with the final HTML when the upload is done. + * If you want to show more information about the progress you can also define + * the {@link CKEDITOR.fileTools.uploadWidgetDefinition#onLoading onLoading} and + * {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploading onUploading} methods. + * + * The simplest uploading widget which uploads a file and creates a link to it may look like this: + * + * CKEDITOR.fileTools.addUploadWidget( editor, 'uploadfile', { + * uploadUrl: CKEDITOR.fileTools.getUploadUrl( editor.config ), + * + * fileToElement: function( file ) { + * var a = new CKEDITOR.dom.element( 'a' ); + * a.setText( file.name ); + * a.setAttribute( 'href', '#' ); + * return a; + * }, + * + * onUploaded: function( upload ) { + * this.replaceWith( '' + upload.fileName + '' ); + * } + * } ); + * + * The upload widget uses {@link CKEDITOR.fileTools.fileLoader} as a helper to upload the file. A + * {@link CKEDITOR.fileTools.fileLoader} instance is created when the file is pasted and a proper method is + * called — by default it is the {@link CKEDITOR.fileTools.fileLoader#loadAndUpload} method. If you want + * to only use the `load` or `upload`, you can use the {@link CKEDITOR.fileTools.uploadWidgetDefinition#loadMethod loadMethod} + * property. + * + * Note that if you want to handle a big file, e.g. a video, you may need to use `upload` instead of + * `loadAndUpload` because the file may be too big to load it to memory at once. + * + * If you do not upload the file, you need to define {@link CKEDITOR.fileTools.uploadWidgetDefinition#onLoaded onLoaded} + * instead of {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploaded onUploaded}. + * For example, if you want to read the content of the file: + * + * CKEDITOR.fileTools.addUploadWidget( editor, 'fileReader', { + * loadMethod: 'load', + * supportedTypes: /text\/(plain|html)/, + * + * fileToElement: function( file ) { + * var el = new CKEDITOR.dom.element( 'span' ); + * el.setText( '...' ); + * return el; + * }, + * + * onLoaded: function( loader ) { + * this.replaceWith( atob( loader.data.split( ',' )[ 1 ] ) ); + * } + * } ); + * + * If you need to pass additional data to the request, you can do this using the + * {@link CKEDITOR.fileTools.uploadWidgetDefinition#additionalRequestParameters additionalRequestParameters} property. + * That data is then passed to the upload method defined by {@link CKEDITOR.fileTools.uploadWidgetDefinition#loadMethod}, + * and to the {@link CKEDITOR.editor#fileUploadRequest} event (as part of the `requestData` property). + * The syntax of that parameter is compatible with the {@link CKEDITOR.editor#fileUploadRequest} `requestData` property. + * + * CKEDITOR.fileTools.addUploadWidget( editor, 'uploadFile', { + * additionalRequestParameters: { + * foo: 'bar' + * }, + * + * fileToElement: function( file ) { + * var el = new CKEDITOR.dom.element( 'span' ); + * el.setText( '...' ); + * return el; + * }, + * + * onUploaded: function( upload ) { + * this.replaceWith( '' + upload.fileName + '' ); + * } + * } ); + * + * If you need custom `paste` handling, you need to mark the pasted element to be changed into an upload widget + * using {@link CKEDITOR.fileTools#markElement markElement}. For example, instead of the `fileToElement` helper from the + * example above, a `paste` listener can be created manually: + * + * editor.on( 'paste', function( evt ) { + * var file, i, el, loader; + * + * for ( i = 0; i < evt.data.dataTransfer.getFilesCount(); i++ ) { + * file = evt.data.dataTransfer.getFile( i ); + * + * if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) { + * el = new CKEDITOR.dom.element( 'span' ), + * loader = editor.uploadRepository.create( file ); + * + * el.setText( '...' ); + * + * loader.load(); + * + * CKEDITOR.fileTools.markElement( el, 'filereader', loader.id ); + * + * evt.data.dataValue += el.getOuterHtml(); + * } + * } + * } ); + * + * Note that you can bind notifications to the upload widget on paste using + * the {@link CKEDITOR.fileTools#bindNotifications} method, so notifications will automatically + * show the progress of the upload. Because this method shows notifications about upload, do not use it if you only + * {@link CKEDITOR.fileTools.fileLoader#load load} (and not upload) a file. + * + * editor.on( 'paste', function( evt ) { + * var file, i, el, loader; + * + * for ( i = 0; i < evt.data.dataTransfer.getFilesCount(); i++ ) { + * file = evt.data.dataTransfer.getFile( i ); + * + * if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/pdf/ ) ) { + * el = new CKEDITOR.dom.element( 'span' ), + * loader = editor.uploadRepository.create( file ); + * + * el.setText( '...' ); + * + * loader.upload(); + * + * CKEDITOR.fileTools.markElement( el, 'pdfuploader', loader.id ); + * + * CKEDITOR.fileTools.bindNotifications( editor, loader ); + * + * evt.data.dataValue += el.getOuterHtml(); + * } + * } + * } ); + * + * @member CKEDITOR.fileTools + * @param {CKEDITOR.editor} editor The editor instance. + * @param {String} name The name of the upload widget. + * @param {CKEDITOR.fileTools.uploadWidgetDefinition} def Upload widget definition. + */ + function addUploadWidget( editor, name, def ) { + var fileTools = CKEDITOR.fileTools, + uploads = editor.uploadRepository, + // Plugins which support all file type has lower priority than plugins which support specific types. + priority = def.supportedTypes ? 10 : 20; + + if ( def.fileToElement ) { + editor.on( 'paste', function( evt ) { + var data = evt.data, + // Fetch runtime widget definition as it might get changed in editor#widgetDefinition event. + def = editor.widgets.registered[ name ], + dataTransfer = data.dataTransfer, + filesCount = dataTransfer.getFilesCount(), + loadMethod = def.loadMethod || 'loadAndUpload', + file, i; + + if ( data.dataValue || !filesCount ) { + return; + } + + for ( i = 0; i < filesCount; i++ ) { + file = dataTransfer.getFile( i ); + + // No def.supportedTypes means all types are supported. + if ( !def.supportedTypes || fileTools.isTypeSupported( file, def.supportedTypes ) ) { + var el = def.fileToElement( file ), + loader = uploads.create( file, undefined, def.loaderType ); + + if ( el ) { + loader[ loadMethod ]( def.uploadUrl, def.additionalRequestParameters ); + + CKEDITOR.fileTools.markElement( el, name, loader.id ); + + if ( ( loadMethod == 'loadAndUpload' || loadMethod == 'upload' ) && !def.skipNotifications ) { + CKEDITOR.fileTools.bindNotifications( editor, loader ); + } + + data.dataValue += el.getOuterHtml(); + } + } + } + }, null, null, priority ); + } + + /** + * This is an abstract class that describes a definition of an upload widget. + * It is a type of {@link CKEDITOR.fileTools#addUploadWidget} method's second argument. + * + * Note that because the upload widget is a type of a widget, this definition extends + * {@link CKEDITOR.plugins.widget.definition}. + * It adds several new properties and callbacks and implements the {@link CKEDITOR.plugins.widget.definition#downcast} + * and {@link CKEDITOR.plugins.widget.definition#init} callbacks. These two properties + * should not be overwritten. + * + * Also, the upload widget definition defines a few properties ({@link #fileToElement}, {@link #supportedTypes}, + * {@link #loadMethod loadMethod}, {@link #uploadUrl} and {@link #additionalRequestParameters}) used in the + * {@link CKEDITOR.editor#paste} listener which is registered by {@link CKEDITOR.fileTools#addUploadWidget} + * if the upload widget definition contains the {@link #fileToElement} callback. + * + * @abstract + * @class CKEDITOR.fileTools.uploadWidgetDefinition + * @mixins CKEDITOR.plugins.widget.definition + */ + CKEDITOR.tools.extend( def, { + /** + * Upload widget definition overwrites the {@link CKEDITOR.plugins.widget.definition#downcast} property. + * This should not be changed. + * + * @property {String/Function} + */ + downcast: function() { + return new CKEDITOR.htmlParser.text( '' ); + }, + + /** + * Upload widget definition overwrites the {@link CKEDITOR.plugins.widget.definition#init} property. + * If you want to add some code in the `init` callback remember to call the base function. + * + * @property {Function} + */ + init: function() { + var widget = this, + id = this.wrapper.findOne( '[data-cke-upload-id]' ).data( 'cke-upload-id' ), + loader = uploads.loaders[ id ], + capitalize = CKEDITOR.tools.capitalize, + oldStyle, newStyle; + + loader.on( 'update', function( evt ) { + // (#1454) + if ( loader.status === 'abort' ) { + if ( typeof widget.onAbort === 'function' ) { + widget.onAbort( loader ); + } + } + + // Abort if widget was removed. + if ( !widget.wrapper || !widget.wrapper.getParent() ) { + // Uploading should be aborted if the editor is already destroyed (#966) or the upload widget was removed. + if ( !CKEDITOR.instances[ editor.name ] || !editor.editable().find( '[data-cke-upload-id="' + id + '"]' ).count() ) { + loader.abort(); + } + evt.removeListener(); + return; + } + + editor.fire( 'lockSnapshot' ); + + // Call users method, eg. if the status is `uploaded` then + // `onUploaded` method will be called, if exists. + var methodName = 'on' + capitalize( loader.status ); + + if ( loader.status !== 'abort' && typeof widget[ methodName ] === 'function' ) { + if ( widget[ methodName ]( loader ) === false ) { + editor.fire( 'unlockSnapshot' ); + return; + } + } + + // Set style to the wrapper if it still exists. + newStyle = 'cke_upload_' + loader.status; + if ( widget.wrapper && newStyle != oldStyle ) { + oldStyle && widget.wrapper.removeClass( oldStyle ); + widget.wrapper.addClass( newStyle ); + oldStyle = newStyle; + } + + // Remove widget on error or abort. + if ( loader.status == 'error' || loader.status == 'abort' ) { + editor.widgets.del( widget ); + } + + editor.fire( 'unlockSnapshot' ); + } ); + + loader.update(); + }, + + /** + * Replaces the upload widget with the final HTML. This method should be called when the upload is done, + * usually in the {@link #onUploaded} callback. + * + * @property {Function} + * @param {String} data HTML to replace the upload widget. + * @param {String} [mode='html'] See {@link CKEDITOR.editor#method-insertHtml}'s modes. + */ + replaceWith: function( data, mode ) { + if ( data.trim() === '' ) { + editor.widgets.del( this ); + return; + } + + var wasSelected = ( this == editor.widgets.focused ), + editable = editor.editable(), + range = editor.createRange(), + bookmark, bookmarks; + + if ( !wasSelected ) { + bookmarks = editor.getSelection().createBookmarks(); + } + + range.setStartBefore( this.wrapper ); + range.setEndAfter( this.wrapper ); + + if ( wasSelected ) { + bookmark = range.createBookmark(); + } + + editable.insertHtmlIntoRange( data, range, mode ); + + editor.widgets.checkWidgets( { initOnlyNew: true } ); + + // Ensure that old widgets instance will be removed. + // If replaceWith is called in init, because of paste then checkWidgets will not remove it. + editor.widgets.destroy( this, true ); + + if ( wasSelected ) { + range.moveToBookmark( bookmark ); + range.select(); + } else { + editor.getSelection().selectBookmarks( bookmarks ); + } + }, + + /** + * @private + * @returns {CKEDITOR.fileTools.fileLoader/null} The loader associated with this widget instance or `null` if not found. + */ + _getLoader: function() { + var marker = this.wrapper.findOne( '[data-cke-upload-id]' ); + return marker ? this.editor.uploadRepository.loaders[ marker.data( 'cke-upload-id' ) ] : null; + } + + /** + * If this property is defined, paste listener is created to transform the pasted file into an HTML element. + * It creates an HTML element which will be then transformed into an upload widget. + * It is only called for {@link #supportedTypes supported files}. + * If multiple files were pasted, this function will be called for each file of a supported type. + * + * @property {Function} fileToElement + * @param {Blob} file A pasted file to load or upload. + * @returns {CKEDITOR.dom.element} An element which will be transformed into the upload widget. + */ + + /** + * Regular expression to check if the file type is supported by this widget. + * If not defined, all files will be handled. + * + * @property {RegExp} [supportedTypes] + */ + + /** + * The URL to which the file will be uploaded. It should be taken from the configuration using + * {@link CKEDITOR.fileTools#getUploadUrl}. + * + * @property {String} [uploadUrl] + */ + + /** + * Loader type that should be used for creating file tools requests. + * + * @property {Function} [loaderType] + */ + + /** + * An object containing additional data that should be passed to the function defined by {@link #loadMethod}. + * + * @property {Object} [additionalRequestParameters] + */ + + /** + * The type of loading operation that should be executed as a result of pasting a file. Possible options are: + * + * * `'loadAndUpload'` – Default behavior. The {@link CKEDITOR.fileTools.fileLoader#loadAndUpload} method will be + * executed, the file will be loaded first and uploaded immediately after loading is done. + * * `'load'` – The {@link CKEDITOR.fileTools.fileLoader#load} method will be executed. This loading type should + * be used if you only want to load file data without uploading it. + * * `'upload'` – The {@link CKEDITOR.fileTools.fileLoader#upload} method will be executed, the file will be uploaded + * without loading it to memory. This loading type should be used if you want to upload a big file, + * otherwise you can get an "out of memory" error. + * + * @property {String} [loadMethod=loadAndUpload] + */ + + /** + * Indicates whether default notification handling should be skipped. + * + * By default upload widget will use [Notification](https://ckeditor.com/cke4/addon/notification) plugin to provide + * feedback for upload progress and eventual success / error message. + * + * @since 4.8.0 + * @property {Boolean} [skipNotifications=false] + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `loading`. + * + * @property {Function} [onLoading] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `loaded`. + * + * @property {Function} [onLoaded] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `uploading`. + * + * @property {Function} [onUploading] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `uploaded`. + * At that point the upload is done and the upload widget should be replaced with the final HTML using + * the {@link #replaceWith} method. + * + * @property {Function} [onUploaded] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `error`. + * The default behavior is to remove the widget and it can be canceled if this function returns `false`. + * + * @property {Function} [onError] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} If `false`, the default behavior (remove widget) will be canceled. + */ + + /** + * A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `abort`. + * The default behavior is to remove the widget and it can be canceled if this function returns `false`. + * + * @property {Function} [onAbort] + * @param {CKEDITOR.fileTools.fileLoader} loader Loader instance. + * @returns {Boolean} If `false`, the default behavior (remove widget) will be canceled. + */ + } ); + + editor.widgets.add( name, def ); + } + + /** + * Marks an element which should be transformed into an upload widget. + * + * @see CKEDITOR.fileTools.addUploadWidget + * + * @member CKEDITOR.fileTools + * @param {CKEDITOR.dom.element} element Element to be marked. + * @param {String} widgetName The name of the upload widget. + * @param {Number} loaderId The ID of a related {@link CKEDITOR.fileTools.fileLoader}. + */ + function markElement( element, widgetName, loaderId ) { + element.setAttributes( { + 'data-cke-upload-id': loaderId, + 'data-widget': widgetName + } ); + } + + /** + * Binds a notification to the {@link CKEDITOR.fileTools.fileLoader file loader} so the upload widget will use + * the notification to show the status and progress. + * This function uses {@link CKEDITOR.plugins.notificationAggregator}, so even if multiple files are uploading + * only one notification is shown. Warnings are an exception, because they are shown in separate notifications. + * This notification shows only the progress of the upload, so this method should not be used if + * the {@link CKEDITOR.fileTools.fileLoader#load loader.load} method was called. It works with + * {@link CKEDITOR.fileTools.fileLoader#upload upload} and {@link CKEDITOR.fileTools.fileLoader#loadAndUpload loadAndUpload}. + * + * @member CKEDITOR.fileTools + * @param {CKEDITOR.editor} editor The editor instance. + * @param {CKEDITOR.fileTools.fileLoader} loader The file loader instance. + */ + function bindNotifications( editor, loader ) { + var aggregator, + task = null; + + loader.on( 'update', function() { + // Value of uploadTotal is known after upload start. Task will be created when uploadTotal is present. + if ( !task && loader.uploadTotal ) { + createAggregator(); + task = aggregator.createTask( { weight: loader.uploadTotal } ); + } + + if ( task && loader.status == 'uploading' ) { + task.update( loader.uploaded ); + } + } ); + + loader.on( 'uploaded', function() { + task && task.done(); + } ); + + loader.on( 'error', function() { + task && task.cancel(); + editor.showNotification( loader.message, 'warning' ); + } ); + + loader.on( 'abort', function() { + task && task.cancel(); + // Editor could be already destroyed (#966). + if ( CKEDITOR.instances[ editor.name ] ) { + editor.showNotification( editor.lang.uploadwidget.abort, 'info' ); + } + } ); + + function createAggregator() { + aggregator = editor._.uploadWidgetNotificaionAggregator; + + // Create one notification aggregator for all types of upload widgets for the editor. + if ( !aggregator || aggregator.isFinished() ) { + aggregator = editor._.uploadWidgetNotificaionAggregator = new CKEDITOR.plugins.notificationAggregator( + editor, editor.lang.uploadwidget.uploadMany, editor.lang.uploadwidget.uploadOne ); + + aggregator.once( 'finished', function() { + var tasks = aggregator.getTaskCount(); + + if ( tasks === 0 ) { + aggregator.notification.hide(); + } else { + aggregator.notification.update( { + message: tasks == 1 ? + editor.lang.uploadwidget.doneOne : + editor.lang.uploadwidget.doneMany.replace( '%1', tasks ), + type: 'success', + important: 1 + } ); + } + } ); + } + } + } + + // Two plugins extend this object. + if ( !CKEDITOR.fileTools ) { + CKEDITOR.fileTools = {}; + } + + CKEDITOR.tools.extend( CKEDITOR.fileTools, { + addUploadWidget: addUploadWidget, + markElement: markElement, + bindNotifications: bindNotifications + } ); +} )(); Index: lams_central/web/includes/javascript/ckconfig_custom.js =================================================================== diff -u -r96825d04e0e37b6979d013bb45bd3a4b40097ddc -rc612e32f2eb43e457a3ed528a5e9fb0febddae06 --- lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 96825d04e0e37b6979d013bb45bd3a4b40097ddc) +++ lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision c612e32f2eb43e457a3ed528a5e9fb0febddae06) @@ -132,7 +132,7 @@ CKEDITOR.config.format_tags = 'div;h1;h2;h3;h4;h5;h6;pre;address;p' ; CKEDITOR.plugins.addExternal('wikilink', CKEDITOR.basePath + '../tool/lawiki10/wikilink/', 'plugin.js'); // html5audio is available but not used anymore; it probably needs fixes as in CKEditor README doc -CKEDITOR.config.extraPlugins = 'wikilink,jlatexmath,image2,confighelper,bootstrapTabs,bootpanel,bootsnippets,wavepanel,wordcount,notification,oembed'; +CKEDITOR.config.extraPlugins = 'wikilink,jlatexmath,image2,confighelper,bootstrapTabs,bootpanel,bootsnippets,wavepanel,wordcount,notification,oembed,uploadwidget,uploadimage'; CKEDITOR.config.enterMode = CKEDITOR.ENTER_DIV; CKEDITOR.config.removePlugins = 'elementspath,about,specialchar'; CKEDITOR.config.allowedContent = true;