diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/clipboard.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/clipboard.html new file mode 100644 index 0000000..aa2598b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/clipboard.html @@ -0,0 +1,190 @@ + + + + + + Clipboard playground – CKEditor Sample + + + + + +

+ CKEditor Sample — clipboard plugin playground +

+
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+

Editor 6

+

Content content content.

+

Styled by .someClass.

+
+
+
+
+ + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/console.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/console.js new file mode 100644 index 0000000..6889bb0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/console.js @@ -0,0 +1,49 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/* global CKCONSOLE */ + +'use strict'; + +( function() { + var pasteType, pasteValue; + + CKCONSOLE.add( 'paste', { + panels: [ + { + type: 'box', + content: + '', + + refresh: function() { + return { + header: 'Paste', + type: pasteType, + value: pasteValue + }; + }, + + refreshOn: function( editor, refresh ) { + editor.on( 'paste', function( evt ) { + pasteType = evt.data.type; + pasteValue = CKEDITOR.tools.htmlEncode( evt.data.dataValue ); + refresh(); + } ); + } + }, + { + type: 'log', + on: function( editor, log, logFn ) { + editor.on( 'paste', function( evt ) { + logFn( 'paste; type:' + evt.data.type )(); + } ); + } + } + ] + } ); +} )(); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/dnd.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/dnd.html new file mode 100644 index 0000000..281c032 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/dev/dnd.html @@ -0,0 +1,185 @@ + + + + + + Manual test for http://dev.ckeditor.com/ticket/11460 + + + + + + + +

+ Manual test for #11460 +

+

Description (hide/show)

+
+

Test internal D&D in the editor, dropping content from an external source (helpers, MS Word) and D&D between editors. Keep in mind that internal D&D is the most complex operation because editor have to handle two ranges at the same time.

+

Expected behavior:

+ +

Drag scenarios:

+ +

Drop scenarios:

+ +

Known issues (not part of this ticket):

+ +
+
+

Helpers (hide/show)

+
+ +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. In commodo vulputate tempor. Sed <b>at elit</b> vel ligula mollis aliquet a ac odio. +
+Aenean cursus egestas ipsum.
+				
+
+
+
+
+
+

Classic editor (hide/show)

+
+ +
+
+
+

Inline editor (hide/show)

+
+

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

+
+
+ + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy-rtl.png new file mode 100644 index 0000000..ce94fc0 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy.png new file mode 100644 index 0000000..ce94fc0 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/copy.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut-rtl.png new file mode 100644 index 0000000..8ae48d9 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut.png new file mode 100644 index 0000000..8ae48d9 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/cut.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy-rtl.png new file mode 100644 index 0000000..74c6765 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy.png new file mode 100644 index 0000000..74c6765 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/copy.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut-rtl.png new file mode 100644 index 0000000..f5a9b0d Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut.png new file mode 100644 index 0000000..f5a9b0d Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/cut.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste-rtl.png new file mode 100644 index 0000000..12cac92 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste.png new file mode 100644 index 0000000..12cac92 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/hidpi/paste.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste-rtl.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste-rtl.png new file mode 100644 index 0000000..7039251 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste-rtl.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste.png new file mode 100644 index 0000000..7039251 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/icons/paste.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/af.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/af.js new file mode 100644 index 0000000..f163930 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/af.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'af', { + copy: 'Kopiëer', + copyError: 'U blaaier se sekuriteitsinstelling belet die kopiëringsaksie. Gebruik die sleutelbordkombinasie (Ctrl/Cmd+C).', + cut: 'Knip', + cutError: 'U blaaier se sekuriteitsinstelling belet die outomatiese knip-aksie. Gebruik die sleutelbordkombinasie (Ctrl/Cmd+X).', + paste: 'Plak', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ar.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ar.js new file mode 100644 index 0000000..711e3da --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ar.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ar', { + copy: 'نسخ', + copyError: 'الإعدادات الأمنية للمتصفح الذي تستخدمه تمنع عمليات النسخ التلقائي. فضلاً إستخدم لوحة المفاتيح لفعل ذلك (Ctrl/Cmd+C).', + cut: 'قص', + cutError: 'الإعدادات الأمنية للمتصفح الذي تستخدمه تمنع القص التلقائي. فضلاً إستخدم لوحة المفاتيح لفعل ذلك (Ctrl/Cmd+X).', + paste: 'لصق', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/az.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/az.js new file mode 100644 index 0000000..42c713f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/az.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'az', { + copy: 'Köçür', + copyError: 'Avtomatik köçürülməsi mümkün deyil. Ctrl+C basın.', + cut: 'Kəs', + cutError: 'Avtomatik kəsmə mümkün deyil. Ctrl+X basın.', + paste: 'Əlavə et', + pasteNotification: 'Sizin İnternet bələdçisi bu cür mətnin köçürməsi dəstəklənmir. Əlavə etmək üçün %1 basın.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bg.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bg.js new file mode 100644 index 0000000..cbf1cbf --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bg.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'bg', { + copy: 'Копирай', + copyError: 'Настройките за сигурност на вашия бразуър не разрешават на редактора да изпълни запаметяването. За целта използвайте клавиатурата (Ctrl/Cmd+C).', + cut: 'Отрежи', + cutError: 'Настройките за сигурност на Вашия браузър не позволяват на редактора автоматично да изъплни действията за отрязване. Моля ползвайте клавиатурните команди за целта (ctrl+x).', + paste: 'Вмъкни', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bn.js new file mode 100644 index 0000000..746bfb0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bn.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'bn', { + copy: 'কপি', + copyError: 'আপনার ব্রাউজারের নিরাপত্তা সেটিংসমূহ এডিটরকে স্বয়ংক্রিয়ভাবে কপি করার প্রক্রিয়া চালনা করার অনুমতি দেয় না। অনুগ্রহপূর্বক এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl/Cmd+C)।', + cut: 'কাট', + cutError: 'আপনার ব্রাউজারের সুরক্ষা সেটিংস এডিটরকে অটোমেটিক কাট করার অনুমতি দেয়নি। দয়া করে এই কাজের জন্য কিবোর্ড ব্যবহার করুন (Ctrl/Cmd+X)।', + paste: 'পেস্ট', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bs.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bs.js new file mode 100644 index 0000000..020ea2b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/bs.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'bs', { + copy: 'Kopiraj', + copyError: 'Sigurnosne postavke Vašeg pretraživaèa ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tastaturi (Ctrl/Cmd+C).', + cut: 'Izreži', + cutError: 'Sigurnosne postavke vašeg pretraživaèa ne dozvoljavaju operacije automatskog rezanja. Molimo koristite kraticu na tastaturi (Ctrl/Cmd+X).', + paste: 'Zalijepi', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ca.js new file mode 100644 index 0000000..37c4b41 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ca.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ca', { + copy: 'Copiar', + copyError: 'La configuració de seguretat del vostre navegador no permet executar automàticament les operacions de copiar. Si us plau, utilitzeu el teclat (Ctrl/Cmd+C).', + cut: 'Retallar', + cutError: 'La configuració de seguretat del vostre navegador no permet executar automàticament les operacions de retallar. Si us plau, utilitzeu el teclat (Ctrl/Cmd+X).', + paste: 'Enganxar', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cs.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cs.js new file mode 100644 index 0000000..c44976c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cs.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'cs', { + copy: 'Kopírovat', + copyError: 'Bezpečnostní nastavení vašeho prohlížeče nedovolují editoru spustit funkci pro kopírování zvoleného textu do schránky. Prosím zkopírujte zvolený text do schránky pomocí klávesnice (Ctrl/Cmd+C).', + cut: 'Vyjmout', + cutError: 'Bezpečnostní nastavení vašeho prohlížeče nedovolují editoru spustit funkci pro vyjmutí zvoleného textu do schránky. Prosím vyjměte zvolený text do schránky pomocí klávesnice (Ctrl/Cmd+X).', + paste: 'Vložit', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cy.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cy.js new file mode 100644 index 0000000..2d5cb66 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/cy.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'cy', { + copy: 'Copïo', + copyError: '\'Dyw gosodiadau diogelwch eich porwr ddim yn caniatàu\'r golygydd i gynnal \'gweithredoedd copïo\' yn awtomatig. Defnyddiwch y bysellfwrdd (Ctrl/Cmd+C).', + cut: 'Torri', + cutError: 'Nid yw gosodiadau diogelwch eich porwr yn caniatàu\'r golygydd i gynnal \'gweithredoedd torri\' yn awtomatig. Defnyddiwch y bysellfwrdd (Ctrl/Cmd+X).', + paste: 'Gludo', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/da.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/da.js new file mode 100644 index 0000000..9d91557 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/da.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'da', { + copy: 'Kopiér', + copyError: 'Din browsers sikkerhedsindstillinger tillader ikke editoren at få automatisk adgang til udklipsholderen.

Brug i stedet tastaturet til at kopiere teksten (Ctrl/Cmd+C).', + cut: 'Klip', + cutError: 'Din browsers sikkerhedsindstillinger tillader ikke editoren at få automatisk adgang til udklipsholderen.

Brug i stedet tastaturet til at klippe teksten (Ctrl/Cmd+X).', + paste: 'Indsæt', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de-ch.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de-ch.js new file mode 100644 index 0000000..67d51e0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de-ch.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'de-ch', { + copy: 'Kopieren', + copyError: 'Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch kopieren. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren).', + cut: 'Ausschneiden', + cutError: 'Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch auszuschneiden. Bitte benutzen Sie die System-Zwischenablage über STRG-X (ausschneiden) und STRG-V (einfügen).', + paste: 'Einfügen', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de.js new file mode 100644 index 0000000..9bdd147 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/de.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'de', { + copy: 'Kopieren', + copyError: 'Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch kopieren. Bitte benutzen Sie die System-Zwischenablage über STRG-C (kopieren).', + cut: 'Ausschneiden', + cutError: 'Die Sicherheitseinstellungen Ihres Browsers lassen es nicht zu, den Text automatisch auszuschneiden. Bitte benutzen Sie die System-Zwischenablage über STRG-X (ausschneiden) und STRG-V (einfügen).', + paste: 'Einfügen', + pasteNotification: 'Ihr Browser verhindert das Einfügen über diesen Weg. Zum einfügen drücken Sie %1.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/el.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/el.js new file mode 100644 index 0000000..f49ee89 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/el.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'el', { + copy: 'Αντιγραφή', + copyError: 'Οι ρυθμίσεις ασφαλείας του περιηγητή σας δεν επιτρέπουν την επιλεγμένη εργασία αντιγραφής. Παρακαλώ χρησιμοποιείστε το πληκτρολόγιο (Ctrl/Cmd+C).', + cut: 'Αποκοπή', + cutError: 'Οι ρυθμίσεις ασφαλείας του περιηγητή σας δεν επιτρέπουν την επιλεγμένη εργασία αποκοπής. Παρακαλώ χρησιμοποιείστε το πληκτρολόγιο (Ctrl/Cmd+X).', + paste: 'Επικόλληση', + pasteNotification: 'Ο περιηγητής σας δεν σας επιτρέπει να επικολλήσετε με αυτόν τον τρόπο. Πατήστε %1 για επικόλληση.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-au.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-au.js new file mode 100644 index 0000000..4212ec9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-au.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'en-au', { + copy: 'Copy', + copyError: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).', + cut: 'Cut', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', + paste: 'Paste', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-ca.js new file mode 100644 index 0000000..f47aae3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-ca.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'en-ca', { + copy: 'Copy', + copyError: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).', + cut: 'Cut', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', + paste: 'Paste', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-gb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-gb.js new file mode 100644 index 0000000..958a070 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en-gb.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'en-gb', { + copy: 'Copy', + copyError: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).', + cut: 'Cut', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', + paste: 'Paste', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en.js new file mode 100644 index 0000000..9ea48a4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/en.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'en', { + copy: 'Copy', + copyError: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).', + cut: 'Cut', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', + paste: 'Paste', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eo.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eo.js new file mode 100644 index 0000000..27c5108 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eo.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'eo', { + copy: 'Kopii', + copyError: 'La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras kopiajn operaciojn. Bonvolu uzi la klavaron por tio (Ctrl/Cmd-C).', + cut: 'Eltondi', + cutError: 'La sekurecagordo de via TTT-legilo ne permesas, ke la redaktilo faras eltondajn operaciojn. Bonvolu uzi la klavaron por tio (Ctrl/Cmd-X).', + paste: 'Interglui', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es-mx.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es-mx.js new file mode 100644 index 0000000..c8f6033 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es-mx.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'es-mx', { + copy: 'Copiar', + copyError: 'La configuración de seguridad de su navegador no permite al editor ejecutar automáticamente operaciones de copiado. Por favor, utilice el teclado para (Ctrl/Cmd+C).', + cut: 'Cortar', + cutError: 'La configuración de seguridad de su navegador no permite al editor ejecutar automáticamente operaciones de corte. Por favor, utilice el teclado para (Ctrl/Cmd+X).', + paste: 'Pegar', + pasteNotification: 'Tu navegador no permite pegar de esta manera. Presiona %1 para pegar.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es.js new file mode 100644 index 0000000..e2dbf4e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/es.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'es', { + copy: 'Copiar', + copyError: 'La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de copiado.\r\nPor favor use el teclado (Ctrl/Cmd+C).', + cut: 'Cortar', + cutError: 'La configuración de seguridad de este navegador no permite la ejecución automática de operaciones de cortado.\r\nPor favor use el teclado (Ctrl/Cmd+X).', + paste: 'Pegar', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/et.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/et.js new file mode 100644 index 0000000..242a7cd --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/et.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'et', { + copy: 'Kopeeri', + copyError: 'Sinu veebisirvija turvaseaded ei luba redaktoril automaatselt kopeerida. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl/Cmd+C).', + cut: 'Lõika', + cutError: 'Sinu veebisirvija turvaseaded ei luba redaktoril automaatselt lõigata. Palun kasutage selleks klaviatuuri klahvikombinatsiooni (Ctrl/Cmd+X).', + paste: 'Aseta', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eu.js new file mode 100644 index 0000000..1e233af --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/eu.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'eu', { + copy: 'Kopiatu', + copyError: 'Zure web nabigatzailearen segurtasun ezarpenek ez dute baimentzen testuak automatikoki kopiatzea. Mesedez teklatua erabil ezazu (Ctrl/Cmd+C).', + cut: 'Ebaki', + cutError: 'Zure web nabigatzailearen segurtasun ezarpenek ez dute baimentzen testuak automatikoki moztea. Mesedez teklatua erabil ezazu (Ctrl/Cmd+X).', + paste: 'Itsatsi', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fa.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fa.js new file mode 100644 index 0000000..e0e01c3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fa.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'fa', { + copy: 'رونوشت', + copyError: 'تنظیمات امنیتی مرورگر شما اجازه نمیدهد که ویرایشگر به طور خودکار عملکردهای کپی کردن را انجام دهد. لطفا با دکمههای صفحه کلید این کار را انجام دهید (Ctrl/Cmd+C).', + cut: 'برش', + cutError: 'تنظیمات امنیتی مرورگر شما اجازه نمیدهد که ویرایشگر به طور خودکار عملکردهای برش را انجام دهد. لطفا با دکمههای صفحه کلید این کار را انجام دهید (Ctrl/Cmd+X).', + paste: 'چسباندن', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fi.js new file mode 100644 index 0000000..ba0fed2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fi.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'fi', { + copy: 'Kopioi', + copyError: 'Selaimesi turva-asetukset eivät salli editorin toteuttaa kopioimista. Käytä näppäimistöä kopioimiseen (Ctrl+C).', + cut: 'Leikkaa', + cutError: 'Selaimesi turva-asetukset eivät salli editorin toteuttaa leikkaamista. Käytä näppäimistöä leikkaamiseen (Ctrl+X).', + paste: 'Liitä', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fo.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fo.js new file mode 100644 index 0000000..9c4408e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fo.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'fo', { + copy: 'Avrita', + copyError: 'Trygdaruppseting alnótskagans forðar tekstviðgeranum í at avrita tekstin. Vinarliga nýt knappaborðið til at avrita tekstin (Ctrl/Cmd+C).', + cut: 'Kvett', + cutError: 'Trygdaruppseting alnótskagans forðar tekstviðgeranum í at kvetta tekstin. Vinarliga nýt knappaborðið til at kvetta tekstin (Ctrl/Cmd+X).', + paste: 'Innrita', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr-ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr-ca.js new file mode 100644 index 0000000..0f77bdb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr-ca.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'fr-ca', { + copy: 'Copier', + copyError: 'Les paramètres de sécurité de votre navigateur empêchent l\'éditeur de copier automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl/Cmd+C).', + cut: 'Couper', + cutError: 'Les paramètres de sécurité de votre navigateur empêchent l\'éditeur de couper automatiquement vos données. Veuillez utiliser les équivalents claviers (Ctrl/Cmd+X).', + paste: 'Coller', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr.js new file mode 100644 index 0000000..49d58dc --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/fr.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'fr', { + copy: 'Copier', + copyError: 'Les paramètres de sécurité de votre navigateur n\'autorisent pas l\'éditeur à exécuter automatiquement l\'opération « Copier ». Veuillez utiliser le raccourci clavier à cet effet (Ctrl/Cmd+C).', + cut: 'Couper', + cutError: 'Les paramètres de sécurité de votre navigateur n\'autorisent pas l\'éditeur à exécuter automatiquement l\'opération « Couper ». Veuillez utiliser le raccourci clavier à cet effet (Ctrl/Cmd+X).', + paste: 'Coller', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gl.js new file mode 100644 index 0000000..9b9b5a4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gl.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'gl', { + copy: 'Copiar', + copyError: 'Os axustes de seguranza do seu navegador non permiten que o editor realice automaticamente as tarefas de copia. Use o teclado para iso (Ctrl/Cmd+C).', + cut: 'Cortar', + cutError: 'Os axustes de seguranza do seu navegador non permiten que o editor realice automaticamente as tarefas de corte. Use o teclado para iso (Ctrl/Cmd+X).', + paste: 'Pegar', + pasteNotification: 'O seu navegador non permite pegar deste xeito. Prema %1 para pegar.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gu.js new file mode 100644 index 0000000..9f05c7b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/gu.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'gu', { + copy: 'નકલ', + copyError: 'તમારા બ્રાઉઝર ની સુરક્ષિત સેટિંગસ કોપી કરવાની પરવાનગી નથી આપતી. (Ctrl/Cmd+C) का प्रयोग करें।', + cut: 'કાપવું', + cutError: 'તમારા બ્રાઉઝર ની સુરક્ષિત સેટિંગસ કટ કરવાની પરવાનગી નથી આપતી. (Ctrl/Cmd+X) નો ઉપયોગ કરો.', + paste: 'પેસ્ટ', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/he.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/he.js new file mode 100644 index 0000000..35b45d0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/he.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'he', { + copy: 'העתקה', + copyError: 'הגדרות האבטחה בדפדפן שלך לא מאפשרות לעורך לבצע פעולות העתקה אוטומטיות. יש להשתמש במקלדת לשם כך (Ctrl/Cmd+C).', + cut: 'גזירה', + cutError: 'הגדרות האבטחה בדפדפן שלך לא מאפשרות לעורך לבצע פעולות גזירה אוטומטיות. יש להשתמש במקלדת לשם כך (Ctrl/Cmd+X).', + paste: 'הדבקה', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hi.js new file mode 100644 index 0000000..95ff3cf --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hi.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'hi', { + copy: 'कॉपी', + copyError: 'आपके ब्राआउज़र की सुरक्षा सॅटिन्ग्स ने कॉपी करने की अनुमति नहीं प्रदान की है। (Ctrl/Cmd+C) का प्रयोग करें।', + cut: 'कट', + cutError: 'आपके ब्राउज़र की सुरक्षा सॅटिन्ग्स ने कट करने की अनुमति नहीं प्रदान की है। (Ctrl/Cmd+X) का प्रयोग करें।', + paste: 'पेस्ट', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hr.js new file mode 100644 index 0000000..9f45289 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hr.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'hr', { + copy: 'Kopiraj', + copyError: 'Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja. Molimo koristite kraticu na tipkovnici (Ctrl/Cmd+C).', + cut: 'Izreži', + cutError: 'Sigurnosne postavke Vašeg pretraživača ne dozvoljavaju operacije automatskog izrezivanja. Molimo koristite kraticu na tipkovnici (Ctrl/Cmd+X).', + paste: 'Zalijepi', + pasteNotification: 'Vaš preglednik Vam ne dozvoljava lijepljenje na ovaj način. Za lijepljenje, pritisnite %1.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hu.js new file mode 100644 index 0000000..a5fa627 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/hu.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'hu', { + copy: 'Másolás', + copyError: 'A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a másolás műveletet. Használja az alábbi billentyűkombinációt (Ctrl/Cmd+X).', + cut: 'Kivágás', + cutError: 'A böngésző biztonsági beállításai nem engedélyezik a szerkesztőnek, hogy végrehajtsa a kivágás műveletet. Használja az alábbi billentyűkombinációt (Ctrl/Cmd+X).', + paste: 'Beillesztés', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/id.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/id.js new file mode 100644 index 0000000..226e0ef --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/id.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'id', { + copy: 'Salin', + copyError: 'Pengaturan keamanan peramban anda tidak mengizinkan editor untuk mengeksekusi operasi menyalin secara otomatis. Mohon gunakan papan tuts (Ctrl/Cmd+C)', + cut: 'Potong', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', // MISSING + paste: 'Tempel', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/is.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/is.js new file mode 100644 index 0000000..7daa195 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/is.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'is', { + copy: 'Afrita', + copyError: 'Öryggisstillingar vafrans þíns leyfa ekki afritun texta með músaraðgerð. Notaðu lyklaborðið í afrita (Ctrl/Cmd+C).', + cut: 'Klippa', + cutError: 'Öryggisstillingar vafrans þíns leyfa ekki klippingu texta með músaraðgerð. Notaðu lyklaborðið í klippa (Ctrl/Cmd+X).', + paste: 'Líma', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/it.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/it.js new file mode 100644 index 0000000..f8fde39 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/it.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'it', { + copy: 'Copia', + copyError: 'Le impostazioni di sicurezza del browser non permettono di copiare automaticamente il testo. Usa la tastiera (Ctrl/Cmd+C).', + cut: 'Taglia', + cutError: 'Le impostazioni di sicurezza del browser non permettono di tagliare automaticamente il testo. Usa la tastiera (Ctrl/Cmd+X).', + paste: 'Incolla', + pasteNotification: 'Il browser non permette di incollare in questo modo. Premere %1 per incollare.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ja.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ja.js new file mode 100644 index 0000000..a2a0845 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ja.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ja', { + copy: 'コピー', + copyError: 'ブラウザーのセキュリティ設定によりエディタのコピー操作を自動で実行することができません。実行するには手動でキーボードの(Ctrl/Cmd+C)を使用してください。', + cut: '切り取り', + cutError: 'ブラウザーのセキュリティ設定によりエディタの切り取り操作を自動で実行することができません。実行するには手動でキーボードの(Ctrl/Cmd+X)を使用してください。', + paste: '貼り付け', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ka.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ka.js new file mode 100644 index 0000000..d96557c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ka.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ka', { + copy: 'ასლი', + copyError: 'თქვენი ბროუზერის უსაფრთხოების პარამეტრები არ იძლევა ასლის ოპერაციის ავტომატურად განხორციელების საშუალებას. გამოიყენეთ კლავიატურა ამისთვის (Ctrl/Cmd+C).', + cut: 'ამოჭრა', + cutError: 'თქვენი ბროუზერის უსაფრთხოების პარამეტრები არ იძლევა ამოჭრის ოპერაციის ავტომატურად განხორციელების საშუალებას. გამოიყენეთ კლავიატურა ამისთვის (Ctrl/Cmd+X).', + paste: 'ჩასმა', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/km.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/km.js new file mode 100644 index 0000000..5ce57f9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/km.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'km', { + copy: 'ចម្លង', + copyError: 'ការកំណត់សុវត្ថភាពរបស់កម្មវិធីរុករករបស់លោកអ្នក នេះ​មិនអាចធ្វើកម្មវិធីតាក់តែងអត្ថបទ ចំលងអត្ថបទយកដោយស្វ័យប្រវត្តបានឡើយ ។ សូមប្រើប្រាស់បន្សំ ឃីដូចនេះ (Ctrl/Cmd+C)។', + cut: 'កាត់យក', + cutError: 'ការកំណត់សុវត្ថភាពរបស់កម្មវិធីរុករករបស់លោកអ្នក នេះ​មិនអាចធ្វើកម្មវិធីតាក់តែងអត្ថបទ កាត់អត្ថបទយកដោយស្វ័យប្រវត្តបានឡើយ ។ សូមប្រើប្រាស់បន្សំ ឃីដូចនេះ (Ctrl/Cmd+X) ។', + paste: 'បិទ​ភ្ជាប់', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ko.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ko.js new file mode 100644 index 0000000..fff7d11 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ko.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ko', { + copy: '복사', + copyError: '브라우저의 보안설정 때문에 복사할 수 없습니다. 키보드(Ctrl/Cmd+C)를 이용해서 복사하십시오.', + cut: '잘라내기', + cutError: '브라우저의 보안설정 때문에 잘라내기 기능을 실행할 수 없습니다. 키보드(Ctrl/Cmd+X)를 이용해서 잘라내기 하십시오', + paste: '붙여넣기', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ku.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ku.js new file mode 100644 index 0000000..76942d5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ku.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ku', { + copy: 'لەبەرگرتنەوە', + copyError: 'پارێزی وێبگەڕەکەت ڕێگەنادات بەسەرنووسەکە لە لکاندنی دەقی خۆکارارنە. تکایە لەبری ئەمە ئەم فەرمانە بەکاربهێنە بەداگرتنی کلیلی (Ctrl/Cmd+C).', + cut: 'بڕین', + cutError: 'پارێزی وێبگەڕەکەت ڕێگەنادات بە سەرنووسەکە لەبڕینی خۆکارانە. تکایە لەبری ئەمە ئەم فەرمانە بەکاربهێنە بەداگرتنی کلیلی (Ctrl/Cmd+X).', + paste: 'لکاندن', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lt.js new file mode 100644 index 0000000..37069ef --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lt.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'lt', { + copy: 'Kopijuoti', + copyError: 'Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti kopijavimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl/Cmd+C).', + cut: 'Iškirpti', + cutError: 'Jūsų naršyklės saugumo nustatymai neleidžia redaktoriui automatiškai įvykdyti iškirpimo operacijų. Tam prašome naudoti klaviatūrą (Ctrl/Cmd+X).', + paste: 'Įdėti', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lv.js new file mode 100644 index 0000000..bc21dd6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/lv.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'lv', { + copy: 'Kopēt', + copyError: 'Jūsu pārlūkprogrammas drošības iestatījumi nepieļauj redaktoram automātiski veikt kopēšanas darbību. Lūdzu, izmantojiet (Ctrl/Cmd+C), lai veiktu šo darbību.', + cut: 'Izgriezt', + cutError: 'Jūsu pārlūkprogrammas drošības iestatījumi nepieļauj redaktoram automātiski veikt izgriezšanas darbību. Lūdzu, izmantojiet (Ctrl/Cmd+X), lai veiktu šo darbību.', + paste: 'Ielīmēt', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mk.js new file mode 100644 index 0000000..626d6be --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mk.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'mk', { + copy: 'Копирај (Copy)', + copyError: 'Опциите за безбедност на вашиот прелистувач не дозволуваат уредувачот автоматски да изврши копирање. Ве молиме употребете ја тастатурата. (Ctrl/Cmd+C)', + cut: 'Исечи (Cut)', + cutError: 'Опциите за безбедност на вашиот прелистувач не дозволуваат уредувачот автоматски да изврши сечење. Ве молиме употребете ја тастатурата. (Ctrl/Cmd+C)', + paste: 'Залепи (Paste)', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mn.js new file mode 100644 index 0000000..cc7fe92 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/mn.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'mn', { + copy: 'Хуулах', + copyError: 'Таны browser-ын хамгаалалтын тохиргоо editor-д автоматаар хуулах үйлдэлийг зөвшөөрөхгүй байна. (Ctrl/Cmd+C) товчны хослолыг ашиглана уу.', + cut: 'Хайчлах', + cutError: 'Таны browser-ын хамгаалалтын тохиргоо editor-д автоматаар хайчлах үйлдэлийг зөвшөөрөхгүй байна. (Ctrl/Cmd+X) товчны хослолыг ашиглана уу.', + paste: 'Буулгах', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ms.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ms.js new file mode 100644 index 0000000..94faeb8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ms.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ms', { + copy: 'Salin', + copyError: 'Keselamatan perisian browser anda tidak membenarkan operasi salinan text/imej. Sila gunakan papan kekunci (Ctrl/Cmd+C).', + cut: 'Potong', + cutError: 'Keselamatan perisian browser anda tidak membenarkan operasi suntingan text/imej. Sila gunakan papan kekunci (Ctrl/Cmd+X).', + paste: 'Tampal', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nb.js new file mode 100644 index 0000000..88d6e29 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nb.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'nb', { + copy: 'Kopier', + copyError: 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst bruk tastatursnarveien (Ctrl/Cmd+C).', + cut: 'Klipp ut', + cutError: 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk utklipping av tekst. Vennligst bruk tastatursnarveien (Ctrl/Cmd+X).', + paste: 'Lim inn', + pasteNotification: 'Nettleseren din lar deg ikke lime inn på denne måten. Trykk %1 for å lime inn.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nl.js new file mode 100644 index 0000000..c365e0d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/nl.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'nl', { + copy: 'Kopiëren', + copyError: 'De beveiligingsinstelling van de browser verhinderen het automatisch kopiëren. Gebruik de sneltoets Ctrl/Cmd+C van het toetsenbord.', + cut: 'Knippen', + cutError: 'De beveiligingsinstelling van de browser verhinderen het automatisch knippen. Gebruik de sneltoets Ctrl/Cmd+X van het toetsenbord.', + paste: 'Plakken', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/no.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/no.js new file mode 100644 index 0000000..bd5bb36 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/no.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'no', { + copy: 'Kopier', + copyError: 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk kopiering av tekst. Vennligst bruk snarveien (Ctrl/Cmd+C).', + cut: 'Klipp ut', + cutError: 'Din nettlesers sikkerhetsinstillinger tillater ikke automatisk utklipping av tekst. Vennligst bruk snarveien (Ctrl/Cmd+X).', + paste: 'Lim inn', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/oc.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/oc.js new file mode 100644 index 0000000..1eb36f9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/oc.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'oc', { + copy: 'Copiar', + copyError: 'Los paramètres de seguretat de vòstre navigador autorizan pas l\'editor a executar automaticament l\'operacion « Copiar ». Utilizatz l\'acorchi de clavièr a aqueste efièit (Ctrl/Cmd+C).', + cut: 'Talhar', + cutError: 'Los paramètres de seguretat de vòstre navigador autorizan pas l\'editor a executar automaticament l\'operacion « Talhar ». Utilizatz l\'acorchi de clavièr a aqueste efièit (Ctrl/Cmd+X).', + paste: 'Pegar', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pl.js new file mode 100644 index 0000000..27b24d6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pl.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'pl', { + copy: 'Kopiuj', + copyError: 'Ustawienia bezpieczeństwa Twojej przeglądarki nie pozwalają na automatyczne kopiowanie tekstu. Użyj skrótu klawiszowego Ctrl/Cmd+C.', + cut: 'Wytnij', + cutError: 'Ustawienia bezpieczeństwa Twojej przeglądarki nie pozwalają na automatyczne wycinanie tekstu. Użyj skrótu klawiszowego Ctrl/Cmd+X.', + paste: 'Wklej', + pasteNotification: 'Twoja przeglądarka nie pozwala na wklejanie treści w ten sposób. Naciśnij %1 by wkleić tekst.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt-br.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt-br.js new file mode 100644 index 0000000..66d9021 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt-br.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'pt-br', { + copy: 'Copiar', + copyError: 'As configurações de segurança do seu navegador não permitem que o editor execute operações de copiar automaticamente. Por favor, utilize o teclado para copiar (Ctrl/Cmd+C).', + cut: 'Recortar', + cutError: 'As configurações de segurança do seu navegador não permitem que o editor execute operações de recortar automaticamente. Por favor, utilize o teclado para recortar (Ctrl/Cmd+X).', + paste: 'Colar', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt.js new file mode 100644 index 0000000..ac419df --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/pt.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'pt', { + copy: 'Copiar', + copyError: 'A configuração de segurança do navegador não permite a execução automática de operações de copiar. Por favor use o teclado (Ctrl/Cmd+C).', + cut: 'Cortar', + cutError: 'A configuração de segurança do navegador não permite a execução automática de operações de cortar. Por favor use o teclado (Ctrl/Cmd+X).', + paste: 'Colar', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ro.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ro.js new file mode 100644 index 0000000..0f7f745 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ro.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ro', { + copy: 'Copiază', + copyError: 'Setările de securitate ale navigatorului (browser) pe care îl folosiţi nu permit editorului să execute automat operaţiunea de copiere. Vă rugăm folosiţi tastatura (Ctrl/Cmd+C).', + cut: 'Taie', + cutError: 'Setările de securitate ale navigatorului (browser) pe care îl folosiţi nu permit editorului să execute automat operaţiunea de tăiere. Vă rugăm folosiţi tastatura (Ctrl/Cmd+X).', + paste: 'Adaugă', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ru.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ru.js new file mode 100644 index 0000000..0c3ddb5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ru.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ru', { + copy: 'Копировать', + copyError: 'Настройки безопасности вашего браузера не разрешают редактору выполнять операции по копированию текста. Пожалуйста, используйте для этого клавиатуру (Ctrl/Cmd+C).', + cut: 'Вырезать', + cutError: 'Настройки безопасности вашего браузера не разрешают редактору выполнять операции по вырезке текста. Пожалуйста, используйте для этого клавиатуру (Ctrl/Cmd+X).', + paste: 'Вставить', + pasteNotification: 'Ваш браузер не поддерживает данный метод вставки. Для вставки нажмите %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/si.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/si.js new file mode 100644 index 0000000..e20f484 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/si.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'si', { + copy: 'පිටපත් කරන්න', + copyError: 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).', // MISSING + cut: 'කපාගන්න', + cutError: 'Your browser security settings don\'t permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).', // MISSING + paste: 'අලවන්න', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sk.js new file mode 100644 index 0000000..f9d165e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sk.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sk', { + copy: 'Kopírovať', + copyError: 'Bezpečnostné nastavenia vášho prehliadača nedovoľujú editoru automaticky spustiť operáciu kopírovania. Použite na to klávesnicu (Ctrl/Cmd+C).', + cut: 'Vystrihnúť', + cutError: 'Bezpečnostné nastavenia vášho prehliadača nedovoľujú editoru automaticky spustiť operáciu vystrihnutia. Použite na to klávesnicu (Ctrl/Cmd+X).', + paste: 'Vložiť', + pasteNotification: 'Váš prehliadač nepovoľuje prilepiť text takýmto spôsobom. Pre prilepenie stlačte %1.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sl.js new file mode 100644 index 0000000..20c820b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sl.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sl', { + copy: 'Kopiraj', + copyError: 'Varnostne nastavitve brskalnika ne dopuščajo samodejnega kopiranja. Uporabite kombinacijo tipk na tipkovnici (Ctrl/Cmd+C).', + cut: 'Izreži', + cutError: 'Varnostne nastavitve brskalnika ne dopuščajo samodejnega izrezovanja. Uporabite kombinacijo tipk na tipkovnici (Ctrl/Cmd+X).', + paste: 'Prilepi', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sq.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sq.js new file mode 100644 index 0000000..c5ca1f7 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sq.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sq', { + copy: 'Kopjo', + copyError: 'Të dhënat e sigurisë së shfletuesit tuaj nuk lejojnë që redaktuesi automatikisht të kryej veprimin e kopjimit. Ju lutemi shfrytëzoni tastierën për këtë veprim (Ctrl/Cmd+C).', + cut: 'Preje', + cutError: 'Të dhënat e sigurisë së shfletuesit tuaj nuk lejojnë që redaktuesi automatikisht të kryej veprimin e prerjes. Ju lutemi shfrytëzoni tastierën për këtë veprim (Ctrl/Cmd+X).', + paste: 'Hidhe', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr-latn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr-latn.js new file mode 100644 index 0000000..e205c76 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr-latn.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sr-latn', { + copy: 'Kopiraj', + copyError: 'Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl/Cmd+C).', + cut: 'Iseci', + cutError: 'Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog isecanja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl/Cmd+X).', + paste: 'Zalepi', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr.js new file mode 100644 index 0000000..7544455 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sr.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sr', { + copy: 'Копирај', + copyError: 'Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског копирања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl/Cmd+C).', + cut: 'Исеци', + cutError: 'Сигурносна подешавања Вашег претраживача не дозвољавају операције аутоматског исецања текста. Молимо Вас да користите пречицу са тастатуре (Ctrl/Cmd+X).', + paste: 'Залепи', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sv.js new file mode 100644 index 0000000..cbcbe4f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/sv.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'sv', { + copy: 'Kopiera', + copyError: 'Säkerhetsinställningar i din webbläsare tillåter inte åtgärden kopiera. Använd (Ctrl/Cmd+C) istället.', + cut: 'Klipp ut', + cutError: 'Säkerhetsinställningar i din webbläsare tillåter inte åtgärden klipp ut. Använd (Ctrl/Cmd+X) istället.', + paste: 'Klistra in', + pasteNotification: 'Din webbläsare tillåter dig inte att klistra in på detta vis. Tryck på %1 för att klistra in.' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/th.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/th.js new file mode 100644 index 0000000..639fc19 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/th.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'th', { + copy: 'สำเนา', + copyError: 'ไม่สามารถสำเนาข้อความที่เลือกไว้ได้เนื่องจากการกำหนดค่าระดับความปลอดภัย. กรุณาใช้ปุ่มลัดเพื่อวางข้อความแทน (กดปุ่ม Ctrl/Cmd และตัว C พร้อมกัน).', + cut: 'ตัด', + cutError: 'ไม่สามารถตัดข้อความที่เลือกไว้ได้เนื่องจากการกำหนดค่าระดับความปลอดภัย. กรุณาใช้ปุ่มลัดเพื่อวางข้อความแทน (กดปุ่ม Ctrl/Cmd และตัว X พร้อมกัน).', + paste: 'วาง', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tr.js new file mode 100644 index 0000000..c0f91c6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tr.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'tr', { + copy: 'Kopyala', + copyError: 'Gezgin yazılımınızın güvenlik ayarları düzenleyicinin otomatik kopyalama işlemine izin vermiyor. İşlem için (Ctrl/Cmd+C) tuşlarını kullanın.', + cut: 'Kes', + cutError: 'Gezgin yazılımınızın güvenlik ayarları düzenleyicinin otomatik kesme işlemine izin vermiyor. İşlem için (Ctrl/Cmd+X) tuşlarını kullanın.', + paste: 'Yapıştır', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tt.js new file mode 100644 index 0000000..111bf7a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/tt.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'tt', { + copy: 'Күчермәләү', + copyError: 'Браузерыгызның иминлек үзлекләре автоматик рәвештә күчермәләү үтәүне тыя. Тиз төймәләрне (Ctrl/Cmd+C) кулланыгыз.', + cut: 'Кисеп алу', + cutError: 'Браузерыгызның иминлек үзлекләре автоматик рәвештә күчермәләү үтәүне тыя. Тиз төймәләрне (Ctrl/Cmd+C) кулланыгыз.', + paste: 'Өстәү', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ug.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ug.js new file mode 100644 index 0000000..7b77ded --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/ug.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'ug', { + copy: 'كۆچۈر', + copyError: 'تور كۆرگۈڭىزنىڭ بىخەتەرلىك تەڭشىكى تەھرىرلىگۈچنىڭ كۆچۈر مەشغۇلاتىنى ئۆزلۈكىدىن ئىجرا قىلىشىغا يول قويمايدۇ، ھەرپتاختا تېز كۇنۇپكا (Ctrl/Cmd+C) ئارقىلىق تاماملاڭ', + cut: 'كەس', + cutError: 'تور كۆرگۈڭىزنىڭ بىخەتەرلىك تەڭشىكى تەھرىرلىگۈچنىڭ كەس مەشغۇلاتىنى ئۆزلۈكىدىن ئىجرا قىلىشىغا يول قويمايدۇ، ھەرپتاختا تېز كۇنۇپكا (Ctrl/Cmd+X) ئارقىلىق تاماملاڭ', + paste: 'چاپلا', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/uk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/uk.js new file mode 100644 index 0000000..a2737b4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/uk.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'uk', { + copy: 'Копіювати', + copyError: 'Налаштування безпеки Вашого браузера не дозволяють редактору автоматично виконувати операції копіювання. Будь ласка, використовуйте клавіатуру для цього (Ctrl/Cmd+C).', + cut: 'Вирізати', + cutError: 'Налаштування безпеки Вашого браузера не дозволяють редактору автоматично виконувати операції вирізування. Будь ласка, використовуйте клавіатуру для цього (Ctrl/Cmd+X)', + paste: 'Вставити', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/vi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/vi.js new file mode 100644 index 0000000..a1902eb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/vi.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'vi', { + copy: 'Sao chép', + copyError: 'Các thiết lập bảo mật của trình duyệt không cho phép trình biên tập tự động thực thi lệnh sao chép. Hãy sử dụng bàn phím cho lệnh này (Ctrl/Cmd+C).', + cut: 'Cắt', + cutError: 'Các thiết lập bảo mật của trình duyệt không cho phép trình biên tập tự động thực thi lệnh cắt. Hãy sử dụng bàn phím cho lệnh này (Ctrl/Cmd+X).', + paste: 'Dán', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh-cn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh-cn.js new file mode 100644 index 0000000..432ad45 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh-cn.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'zh-cn', { + copy: '复制', + copyError: '您的浏览器安全设置不允许编辑器自动执行复制操作,请使用键盘快捷键(Ctrl/Cmd+C)来完成。', + cut: '剪切', + cutError: '您的浏览器安全设置不允许编辑器自动执行剪切操作,请使用键盘快捷键(Ctrl/Cmd+X)来完成。', + paste: '粘贴', + pasteNotification: '您的浏览器不允许用此方式粘贴,要粘贴请按 %1。' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh.js new file mode 100644 index 0000000..150c15e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/lang/zh.js @@ -0,0 +1,12 @@ +/* +Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'clipboard', 'zh', { + copy: '複製', + copyError: '瀏覽器的安全性設定不允許編輯器自動執行複製動作。請使用鍵盤快捷鍵 (Ctrl/Cmd+C) 複製。', + cut: '剪下', + cutError: '瀏覽器的安全性設定不允許編輯器自動執行剪下動作。請使用鏐盤快捷鍵 (Ctrl/Cmd+X) 剪下。', + paste: '貼上', + pasteNotification: 'Your browser doesn\'t allow you to paste this way. Press %1 to paste.' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/plugin.js new file mode 100644 index 0000000..42191cf --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/clipboard/plugin.js @@ -0,0 +1,2780 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @ignore + * File overview: Clipboard support. + */ + +// +// COPY & PASTE EXECUTION FLOWS: +// -- CTRL+C +// * if ( isCustomCopyCutSupported ) +// * dataTransfer.setData( 'text/html', getSelectedHtml ) +// * else +// * browser's default behavior +// -- CTRL+X +// * listen onKey (onkeydown) +// * fire 'saveSnapshot' on editor +// * if ( isCustomCopyCutSupported ) +// * dataTransfer.setData( 'text/html', getSelectedHtml ) +// * extractSelectedHtml // remove selected contents +// * else +// * browser's default behavior +// * deferred second 'saveSnapshot' event +// -- CTRL+V +// * listen onKey (onkeydown) +// * simulate 'beforepaste' for non-IEs on editable +// * listen 'onpaste' on editable ('onbeforepaste' for IE) +// * fire 'beforePaste' on editor +// * if ( !canceled && ( htmlInDataTransfer || !external paste) && dataTransfer is not empty ) getClipboardDataByPastebin +// * fire 'paste' on editor +// * !canceled && fire 'afterPaste' on editor +// -- Copy command +// * tryToCutCopy +// * execCommand +// * !success && notification +// -- Cut command +// * fixCut +// * tryToCutCopy +// * execCommand +// * !success && notification +// -- Paste command +// * fire 'paste' on editable ('beforepaste' for IE) +// * !canceled && execCommand 'paste' +// -- Paste from native context menu & menubar +// (Fx & Webkits are handled in 'paste' default listener. +// Opera cannot be handled at all because it doesn't fire any events +// Special treatment is needed for IE, for which is this part of doc) +// * listen 'onpaste' +// * cancel native event +// * fire 'beforePaste' on editor +// * if ( !canceled && ( htmlInDataTransfer || !external paste) && dataTransfer is not empty ) getClipboardDataByPastebin +// * execIECommand( 'paste' ) -> this fires another 'paste' event, so cancel it +// * fire 'paste' on editor +// * !canceled && fire 'afterPaste' on editor +// +// +// PASTE EVENT - PREPROCESSING: +// -- Possible dataValue types: auto, text, html. +// -- Possible dataValue contents: +// * text (possible \n\r) +// * htmlified text (text + br,div,p - no presentational markup & attrs - depends on browser) +// * html +// -- Possible flags: +// * htmlified - if true then content is a HTML even if no markup inside. This flag is set +// for content from editable pastebins, because they 'htmlify' pasted content. +// +// -- Type: auto: +// * content: htmlified text -> filter, unify text markup (brs, ps, divs), set type: text +// * content: html -> filter, set type: html +// -- Type: text: +// * content: htmlified text -> filter, unify text markup +// * content: html -> filter, strip presentational markup, unify text markup +// -- Type: html: +// * content: htmlified text -> filter, unify text markup +// * content: html -> filter +// +// -- Phases: +// * if dataValue is empty copy data from dataTransfer to dataValue (priority 1) +// * filtering (priorities 3-5) - e.g. pastefromword filters +// * content type sniffing (priority 6) +// * markup transformations for text (priority 6) +// +// DRAG & DROP EXECUTION FLOWS: +// -- Drag +// * save to the global object: +// * drag timestamp (with 'cke-' prefix), +// * selected html, +// * drag range, +// * editor instance. +// * put drag timestamp into event.dataTransfer.text +// -- Drop +// * if events text == saved timestamp && editor == saved editor +// internal drag & drop occurred +// * getRangeAtDropPosition +// * create bookmarks for drag and drop ranges starting from the end of the document +// * dragRange.deleteContents() +// * fire 'paste' with saved html and drop range +// * if events text == saved timestamp && editor != saved editor +// cross editor drag & drop occurred +// * getRangeAtDropPosition +// * fire 'paste' with saved html +// * dragRange.deleteContents() +// * FF: refreshCursor on afterPaste +// * if events text != saved timestamp +// drop form external source occurred +// * getRangeAtDropPosition +// * if event contains html data then fire 'paste' with html +// * else if event contains text data then fire 'paste' with encoded text +// * FF: refreshCursor on afterPaste + +'use strict'; + +( function() { + // Register the plugin. + CKEDITOR.plugins.add( 'clipboard', { + requires: 'notification,toolbar', + // jscs:disable maximumLineLength + lang: 'af,ar,az,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,es-mx,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + // jscs:enable maximumLineLength + icons: 'copy,copy-rtl,cut,cut-rtl,paste,paste-rtl', // %REMOVE_LINE_CORE% + hidpi: true, // %REMOVE_LINE_CORE% + init: function( editor ) { + var filterType, + filtersFactory = filtersFactoryFactory(); + + if ( editor.config.forcePasteAsPlainText ) { + filterType = 'plain-text'; + } else if ( editor.config.pasteFilter ) { + filterType = editor.config.pasteFilter; + } + // On Webkit the pasteFilter defaults 'semantic-content' because pasted data is so terrible + // that it must be always filtered. + else if ( CKEDITOR.env.webkit && !( 'pasteFilter' in editor.config ) ) { + filterType = 'semantic-content'; + } + + editor.pasteFilter = filtersFactory.get( filterType ); + + initPasteClipboard( editor ); + initDragDrop( editor ); + + // Convert image file (if present) to base64 string for Firefox. Do it as the first + // step as the conversion is asynchronous and should hold all further paste processing. + if ( CKEDITOR.env.gecko ) { + var supportedImageTypes = [ 'image/png', 'image/jpeg', 'image/gif' ], + latestId; + + editor.on( 'paste', function( evt ) { + var dataObj = evt.data, + data = dataObj.dataValue, + dataTransfer = dataObj.dataTransfer; + + // If data empty check for image content inside data transfer. http://dev.ckeditor.com/ticket/16705 + if ( !data && dataObj.method == 'paste' && dataTransfer && dataTransfer.getFilesCount() == 1 && latestId != dataTransfer.id ) { + var file = dataTransfer.getFile( 0 ); + + if ( CKEDITOR.tools.indexOf( supportedImageTypes, file.type ) != -1 ) { + var fileReader = new FileReader(); + + // Convert image file to img tag with base64 image. + fileReader.addEventListener( 'load', function() { + evt.data.dataValue = ''; + editor.fire( 'paste', evt.data ); + }, false ); + + // Proceed with normal flow if reading file was aborted. + fileReader.addEventListener( 'abort', function() { + editor.fire( 'paste', evt.data ); + }, false ); + + // Proceed with normal flow if reading file failed. + fileReader.addEventListener( 'error', function() { + editor.fire( 'paste', evt.data ); + }, false ); + + fileReader.readAsDataURL( file ); + + latestId = dataObj.dataTransfer.id; + + evt.stop(); + } + } + }, null, null, 1 ); + } + + editor.on( 'paste', function( evt ) { + // Init `dataTransfer` if `paste` event was fired without it, so it will be always available. + if ( !evt.data.dataTransfer ) { + evt.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer(); + } + + // If dataValue is already set (manually or by paste bin), so do not override it. + if ( evt.data.dataValue ) { + return; + } + + var dataTransfer = evt.data.dataTransfer, + // IE support only text data and throws exception if we try to get html data. + // This html data object may also be empty if we drag content of the textarea. + value = dataTransfer.getData( 'text/html' ); + + if ( value ) { + evt.data.dataValue = value; + evt.data.type = 'html'; + } else { + // Try to get text data otherwise. + value = dataTransfer.getData( 'text/plain' ); + + if ( value ) { + evt.data.dataValue = editor.editable().transformPlainTextToHtml( value ); + evt.data.type = 'text'; + } + } + }, null, null, 1 ); + + editor.on( 'paste', function( evt ) { + var data = evt.data.dataValue, + blockElements = CKEDITOR.dtd.$block; + + // Filter webkit garbage. + if ( data.indexOf( 'Apple-' ) > -1 ) { + // Replace special webkit's   with simple space, because webkit + // produces them even for normal spaces. + data = data.replace( / <\/span>/gi, ' ' ); + + // Strip around white-spaces when not in forced 'html' content type. + // This spans are created only when pasting plain text into Webkit, + // but for safety reasons remove them always. + if ( evt.data.type != 'html' ) { + data = data.replace( /]*>([^<]*)<\/span>/gi, function( all, spaces ) { + // Replace tabs with 4 spaces like Fx does. + return spaces.replace( /\t/g, '    ' ); + } ); + } + + // This br is produced only when copying & pasting HTML content. + if ( data.indexOf( '
' ) > -1 ) { + evt.data.startsWithEOL = 1; + evt.data.preSniffing = 'html'; // Mark as not text. + data = data.replace( /
/, '' ); + } + + // Remove all other classes. + data = data.replace( /(<[^>]+) class="Apple-[^"]*"/gi, '$1' ); + } + + // Strip editable that was copied from inside. (http://dev.ckeditor.com/ticket/9534) + if ( data.match( /^<[^<]+cke_(editable|contents)/i ) ) { + var tmp, + editable_wrapper, + wrapper = new CKEDITOR.dom.element( 'div' ); + + wrapper.setHtml( data ); + // Verify for sure and check for nested editor UI parts. (http://dev.ckeditor.com/ticket/9675) + while ( wrapper.getChildCount() == 1 && + ( tmp = wrapper.getFirst() ) && + tmp.type == CKEDITOR.NODE_ELEMENT && // Make sure first-child is element. + ( tmp.hasClass( 'cke_editable' ) || tmp.hasClass( 'cke_contents' ) ) ) { + wrapper = editable_wrapper = tmp; + } + + // If editable wrapper was found strip it and bogus
(added on FF). + if ( editable_wrapper ) + data = editable_wrapper.getHtml().replace( /
$/i, '' ); + } + + if ( CKEDITOR.env.ie ) { + //  

->

(br.cke-pasted-remove will be removed later) + data = data.replace( /^ (?: |\r\n)?<(\w+)/g, function( match, elementName ) { + if ( elementName.toLowerCase() in blockElements ) { + evt.data.preSniffing = 'html'; // Mark as not a text. + return '<' + elementName; + } + return match; + } ); + } else if ( CKEDITOR.env.webkit ) { + //


->


+ // We don't mark br, because this situation can happen for htmlified text too. + data = data.replace( /<\/(\w+)>

<\/div>$/, function( match, elementName ) { + if ( elementName in blockElements ) { + evt.data.endsWithEOL = 1; + return ''; + } + return match; + } ); + } else if ( CKEDITOR.env.gecko ) { + // Firefox adds bogus
when user pasted text followed by space(s). + data = data.replace( /(\s)
$/, '$1' ); + } + + evt.data.dataValue = data; + }, null, null, 3 ); + + editor.on( 'paste', function( evt ) { + var dataObj = evt.data, + type = editor._.nextPasteType || dataObj.type, + data = dataObj.dataValue, + trueType, + // Default is 'html'. + defaultType = editor.config.clipboard_defaultContentType || 'html', + transferType = dataObj.dataTransfer.getTransferType( editor ); + + // If forced type is 'html' we don't need to know true data type. + if ( type == 'html' || dataObj.preSniffing == 'html' ) { + trueType = 'html'; + } else { + trueType = recogniseContentType( data ); + } + + delete editor._.nextPasteType; + + // Unify text markup. + if ( trueType == 'htmlifiedtext' ) { + data = htmlifiedTextHtmlification( editor.config, data ); + } + + // Strip presentational markup & unify text markup. + // Forced plain text. + // Note: we do not check dontFilter option in this case, because forcePAPT was implemented + // before pasteFilter and pasteFilter is automatically used on Webkit&Blink since 4.5, so + // forcePAPT should have priority as it had before 4.5. + if ( type == 'text' && trueType == 'html' ) { + data = filterContent( editor, data, filtersFactory.get( 'plain-text' ) ); + } + // External paste and pasteFilter exists and filtering isn't disabled. + else if ( transferType == CKEDITOR.DATA_TRANSFER_EXTERNAL && editor.pasteFilter && !dataObj.dontFilter ) { + data = filterContent( editor, data, editor.pasteFilter ); + } + + if ( dataObj.startsWithEOL ) { + data = '
' + data; + } + if ( dataObj.endsWithEOL ) { + data += '
'; + } + + if ( type == 'auto' ) { + type = ( trueType == 'html' || defaultType == 'html' ) ? 'html' : 'text'; + } + + dataObj.type = type; + dataObj.dataValue = data; + delete dataObj.preSniffing; + delete dataObj.startsWithEOL; + delete dataObj.endsWithEOL; + }, null, null, 6 ); + + // Inserts processed data into the editor at the end of the + // events chain. + editor.on( 'paste', function( evt ) { + var data = evt.data; + + if ( data.dataValue ) { + editor.insertHtml( data.dataValue, data.type, data.range ); + + // Defer 'afterPaste' so all other listeners for 'paste' will be fired first. + // Fire afterPaste only if paste inserted some HTML. + setTimeout( function() { + editor.fire( 'afterPaste' ); + }, 0 ); + } + }, null, null, 1000 ); + } + } ); + + function firePasteEvents( editor, data, withBeforePaste ) { + if ( !data.type ) { + data.type = 'auto'; + } + + if ( withBeforePaste ) { + // Fire 'beforePaste' event so clipboard flavor get customized + // by other plugins. + if ( editor.fire( 'beforePaste', data ) === false ) + return false; // Event canceled + } + + // Do not fire paste if there is no data (dataValue and dataTranfser are empty). + // This check should be done after firing 'beforePaste' because for native paste + // 'beforePaste' is by default fired even for empty clipboard. + if ( !data.dataValue && data.dataTransfer.isEmpty() ) { + return false; + } + + if ( !data.dataValue ) { + data.dataValue = ''; + } + + // Because of FF bug we need to use this hack, otherwise cursor is hidden + // or it is not possible to move it (http://dev.ckeditor.com/ticket/12420). + // Also, check that editor.toolbox exists, because the toolbar plugin might not be loaded (http://dev.ckeditor.com/ticket/13305). + if ( CKEDITOR.env.gecko && data.method == 'drop' && editor.toolbox ) { + editor.once( 'afterPaste', function() { + editor.toolbox.focus(); + } ); + } + + return editor.fire( 'paste', data ); + } + + function initPasteClipboard( editor ) { + var clipboard = CKEDITOR.plugins.clipboard, + preventBeforePasteEvent = 0, + preventPasteEvent = 0, + inReadOnly = 0; + + addListeners(); + addButtonsCommands(); + + /** + * Gets clipboard data by directly accessing the clipboard (IE only). + * + * editor.getClipboardData( function( data ) { + * if ( data ) + * alert( data.type + ' ' + data.dataValue ); + * } ); + * + * @member CKEDITOR.editor + * @param {Function/Object} callbackOrOptions For function, see the `callback` parameter documentation. The object was used before 4.7.0 with the `title` property, to set the paste dialog's title. + * @param {Function} callback A function that will be executed with the `data` property of the + * {@link CKEDITOR.editor#event-paste paste event} or `null` if none of the capturing methods succeeded. + * Since 4.7.0 the `callback` should be provided as a first argument, just like in the example above. This parameter will be removed in + * an upcoming major release. + */ + editor.getClipboardData = function( callbackOrOptions, callback ) { + // Options are optional - args shift. + if ( !callback ) { + callback = callbackOrOptions; + callbackOrOptions = null; + } + + // Listen with maximum priority to handle content before everyone else. + // This callback will handle paste event that will be fired if direct + // access to the clipboard succeed in IE. + editor.on( 'paste', onPaste, null, null, 0 ); + + // If command didn't succeed (only IE allows to access clipboard and only if + // user agrees) invoke callback with null, meaning that paste is not blocked. + if ( getClipboardDataDirectly() === false ) { + // Direct access to the clipboard wasn't successful so remove listener. + editor.removeListener( 'paste', onPaste ); + + callback( null ); + } + + function onPaste( evt ) { + evt.removeListener(); + evt.cancel(); + callback( evt.data ); + } + }; + + function addButtonsCommands() { + addButtonCommand( 'Cut', 'cut', createCutCopyCmd( 'cut' ), 10, 1 ); + addButtonCommand( 'Copy', 'copy', createCutCopyCmd( 'copy' ), 20, 4 ); + addButtonCommand( 'Paste', 'paste', createPasteCmd(), 30, 8 ); + + function addButtonCommand( buttonName, commandName, command, toolbarOrder, ctxMenuOrder ) { + var lang = editor.lang.clipboard[ commandName ]; + + editor.addCommand( commandName, command ); + editor.ui.addButton && editor.ui.addButton( buttonName, { + label: lang, + command: commandName, + toolbar: 'clipboard,' + toolbarOrder + } ); + + // If the "menu" plugin is loaded, register the menu item. + if ( editor.addMenuItems ) { + editor.addMenuItem( commandName, { + label: lang, + command: commandName, + group: 'clipboard', + order: ctxMenuOrder + } ); + } + } + } + + function addListeners() { + editor.on( 'key', onKey ); + editor.on( 'contentDom', addPasteListenersToEditable ); + + // For improved performance, we're checking the readOnly state on selectionChange instead of hooking a key event for that. + editor.on( 'selectionChange', function( evt ) { + inReadOnly = evt.data.selection.getRanges()[ 0 ].checkReadOnly(); + setToolbarStates(); + } ); + + // If the "contextmenu" plugin is loaded, register the listeners. + if ( editor.contextMenu ) { + editor.contextMenu.addListener( function( element, selection ) { + inReadOnly = selection.getRanges()[ 0 ].checkReadOnly(); + return { + cut: stateFromNamedCommand( 'cut' ), + copy: stateFromNamedCommand( 'copy' ), + paste: stateFromNamedCommand( 'paste' ) + }; + } ); + } + } + + // Add events listeners to editable. + function addPasteListenersToEditable() { + var editable = editor.editable(); + + if ( CKEDITOR.plugins.clipboard.isCustomCopyCutSupported ) { + var initOnCopyCut = function( evt ) { + // If user tries to cut in read-only editor, we must prevent default action. (http://dev.ckeditor.com/ticket/13872) + if ( !editor.readOnly || evt.name != 'cut' ) { + clipboard.initPasteDataTransfer( evt, editor ); + } + evt.data.preventDefault(); + }; + + editable.on( 'copy', initOnCopyCut ); + editable.on( 'cut', initOnCopyCut ); + + // Delete content with the low priority so one can overwrite cut data. + editable.on( 'cut', function() { + // If user tries to cut in read-only editor, we must prevent default action. (http://dev.ckeditor.com/ticket/13872) + if ( !editor.readOnly ) { + editor.extractSelectedHtml(); + } + }, null, null, 999 ); + } + + // We'll be catching all pasted content in one line, regardless of whether + // it's introduced by a document command execution (e.g. toolbar buttons) or + // user paste behaviors (e.g. CTRL+V). + editable.on( clipboard.mainPasteEvent, function( evt ) { + if ( clipboard.mainPasteEvent == 'beforepaste' && preventBeforePasteEvent ) { + return; + } + + // If you've just asked yourself why preventPasteEventNow() is not here, but + // in listener for CTRL+V and exec method of 'paste' command + // you've asked the same question we did. + // + // THE ANSWER: + // + // First thing to notice - this answer makes sense only for IE, + // because other browsers don't listen for 'paste' event. + // + // What would happen if we move preventPasteEventNow() here? + // For: + // * CTRL+V - IE fires 'beforepaste', so we prevent 'paste' and pasteDataFromClipboard(). OK. + // * editor.execCommand( 'paste' ) - we fire 'beforepaste', so we prevent + // 'paste' and pasteDataFromClipboard() and doc.execCommand( 'Paste' ). OK. + // * native context menu - IE fires 'beforepaste', so we prevent 'paste', but unfortunately + // on IE we fail with pasteDataFromClipboard() here, because of... we don't know why, but + // we just fail, so... we paste nothing. FAIL. + // * native menu bar - the same as for native context menu. + // + // But don't you know any way to distinguish first two cases from last two? + // Only one - special flag set in CTRL+V handler and exec method of 'paste' + // command. And that's what we did using preventPasteEventNow(). + + pasteDataFromClipboard( evt ); + } ); + + // It's not possible to clearly handle all four paste methods (ctrl+v, native menu bar + // native context menu, editor's command) in one 'paste/beforepaste' event in IE. + // + // For ctrl+v & editor's command it's easy to handle pasting in 'beforepaste' listener, + // so we do this. For another two methods it's better to use 'paste' event. + // + // 'paste' is always being fired after 'beforepaste' (except of weird one on opening native + // context menu), so for two methods handled in 'beforepaste' we're canceling 'paste' + // using preventPasteEvent state. + // + // 'paste' event in IE is being fired before getClipboardDataByPastebin executes its callback. + // + // QUESTION: Why didn't you handle all 4 paste methods in handler for 'paste'? + // Wouldn't this just be simpler? + // ANSWER: Then we would have to evt.data.preventDefault() only for native + // context menu and menu bar pastes. The same with execIECommand(). + // That would force us to mark CTRL+V and editor's paste command with + // special flag, other than preventPasteEvent. But we still would have to + // have preventPasteEvent for the second event fired by execIECommand. + // Code would be longer and not cleaner. + if ( clipboard.mainPasteEvent == 'beforepaste' ) { + editable.on( 'paste', function( evt ) { + if ( preventPasteEvent ) { + return; + } + + // Cancel next 'paste' event fired by execIECommand( 'paste' ) + // at the end of this callback. + preventPasteEventNow(); + + // Prevent native paste. + evt.data.preventDefault(); + + pasteDataFromClipboard( evt ); + + // Force IE to paste content into pastebin so pasteDataFromClipboard will work. + execIECommand( 'paste' ); + } ); + + // If mainPasteEvent is 'beforePaste' (IE before Edge), + // dismiss the (wrong) 'beforepaste' event fired on context/toolbar menu open. (http://dev.ckeditor.com/ticket/7953) + editable.on( 'contextmenu', preventBeforePasteEventNow, null, null, 0 ); + + editable.on( 'beforepaste', function( evt ) { + // Do not prevent event on CTRL+V and SHIFT+INS because it blocks paste (http://dev.ckeditor.com/ticket/11970). + if ( evt.data && !evt.data.$.ctrlKey && !evt.data.$.shiftKey ) + preventBeforePasteEventNow(); + }, null, null, 0 ); + } + + editable.on( 'beforecut', function() { + !preventBeforePasteEvent && fixCut( editor ); + } ); + + var mouseupTimeout; + + // Use editor.document instead of editable in non-IEs for observing mouseup + // since editable won't fire the event if selection process started within + // iframe and ended out of the editor (http://dev.ckeditor.com/ticket/9851). + editable.attachListener( CKEDITOR.env.ie ? editable : editor.document.getDocumentElement(), 'mouseup', function() { + mouseupTimeout = setTimeout( function() { + setToolbarStates(); + }, 0 ); + } ); + + // Make sure that deferred mouseup callback isn't executed after editor instance + // had been destroyed. This may happen when editor.destroy() is called in parallel + // with mouseup event (i.e. a button with onclick callback) (http://dev.ckeditor.com/ticket/10219). + editor.on( 'destroy', function() { + clearTimeout( mouseupTimeout ); + } ); + + editable.on( 'keyup', setToolbarStates ); + } + + // Create object representing Cut or Copy commands. + function createCutCopyCmd( type ) { + return { + type: type, + canUndo: type == 'cut', // We can't undo copy to clipboard. + startDisabled: true, + fakeKeystroke: type == 'cut' ? CKEDITOR.CTRL + 88 /*X*/ : CKEDITOR.CTRL + 67 /*C*/, + exec: function() { + // Attempts to execute the Cut and Copy operations. + function tryToCutCopy( type ) { + if ( CKEDITOR.env.ie ) + return execIECommand( type ); + + // non-IEs part + try { + // Other browsers throw an error if the command is disabled. + return editor.document.$.execCommand( type, false, null ); + } catch ( e ) { + return false; + } + } + + this.type == 'cut' && fixCut(); + + var success = tryToCutCopy( this.type ); + + if ( !success ) { + // Show cutError or copyError. + editor.showNotification( editor.lang.clipboard[ this.type + 'Error' ] ); // jshint ignore:line + } + + return success; + } + }; + } + + function createPasteCmd() { + return { + // Snapshots are done manually by editable.insertXXX methods. + canUndo: false, + async: true, + fakeKeystroke: CKEDITOR.CTRL + 86 /*V*/, + + /** + * The default implementation of the paste command. + * + * @private + * @param {CKEDITOR.editor} editor An instance of the editor where the command is being executed. + * @param {Object/String} data If `data` is a string, then it is considered content that is being pasted. + * Otherwise it is treated as an object with options. + * @param {Boolean/String} [data.notification=true] Content for a notification shown after an unsuccessful + * paste attempt. If `false`, the notification will not be displayed. This parameter was added in 4.7.0. + * @param {String} [data.type='html'] The type of pasted content. There are two allowed values: + * * 'html' + * * 'text' + * @param {String/Object} data.dataValue Content being pasted. If this parameter is an object, it + * is supposed to be a `data` property of the {@link CKEDITOR.editor#paste} event. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} data.dataTransfer Data transfer instance connected + * with the current paste action. + * @member CKEDITOR.editor.commands.paste + */ + exec: function( editor, data ) { + data = typeof data !== 'undefined' && data !== null ? data : {}; + + var cmd = this, + notification = typeof data.notification !== 'undefined' ? data.notification : true, + forcedType = data.type, + keystroke = CKEDITOR.tools.keystrokeToString( editor.lang.common.keyboard, + editor.getCommandKeystroke( this ) ), + msg = typeof notification === 'string' ? notification : editor.lang.clipboard.pasteNotification + .replace( /%1/, '' + keystroke.display + '' ), + pastedContent = typeof data === 'string' ? data : data.dataValue; + + function callback( data, withBeforePaste ) { + withBeforePaste = typeof withBeforePaste !== 'undefined' ? withBeforePaste : true; + + if ( data ) { + data.method = 'paste'; + + if ( !data.dataTransfer ) { + data.dataTransfer = clipboard.initPasteDataTransfer(); + } + + firePasteEvents( editor, data, withBeforePaste ); + } else if ( notification ) { + editor.showNotification( msg, 'info', editor.config.clipboard_notificationDuration ); + } + + editor.fire( 'afterCommandExec', { + name: 'paste', + command: cmd, + returnValue: !!data + } ); + } + + // Force type for the next paste. + if ( forcedType ) { + editor._.nextPasteType = forcedType; + } else { + delete editor._.nextPasteType; + } + + if ( typeof pastedContent === 'string' ) { + callback( { + dataValue: pastedContent + } ); + } else { + editor.getClipboardData( callback ); + } + } + }; + } + + function preventPasteEventNow() { + preventPasteEvent = 1; + // For safety reason we should wait longer than 0/1ms. + // We don't know how long execution of quite complex getClipboardData will take + // and in for example 'paste' listener execCommand() (which fires 'paste') is called + // after getClipboardData finishes. + // Luckily, it's impossible to immediately fire another 'paste' event we want to handle, + // because we only handle there native context menu and menu bar. + setTimeout( function() { + preventPasteEvent = 0; + }, 100 ); + } + + function preventBeforePasteEventNow() { + preventBeforePasteEvent = 1; + setTimeout( function() { + preventBeforePasteEvent = 0; + }, 10 ); + } + + // Tries to execute any of the paste, cut or copy commands in IE. Returns a + // boolean indicating that the operation succeeded. + // @param {String} command *LOWER CASED* name of command ('paste', 'cut', 'copy'). + function execIECommand( command ) { + var doc = editor.document, + body = doc.getBody(), + enabled = false, + onExec = function() { + enabled = true; + }; + + // The following seems to be the only reliable way to detect that + // clipboard commands are enabled in IE. It will fire the + // onpaste/oncut/oncopy events only if the security settings allowed + // the command to execute. + body.on( command, onExec ); + + // IE7: document.execCommand has problem to paste into positioned element. + if ( CKEDITOR.env.version > 7 ) { + doc.$.execCommand( command ); + } else { + doc.$.selection.createRange().execCommand( command ); + } + + body.removeListener( command, onExec ); + + return enabled; + } + + // Cutting off control type element in IE standards breaks the selection entirely. (http://dev.ckeditor.com/ticket/4881) + function fixCut() { + if ( !CKEDITOR.env.ie || CKEDITOR.env.quirks ) + return; + + var sel = editor.getSelection(), + control, range, dummy; + + if ( ( sel.getType() == CKEDITOR.SELECTION_ELEMENT ) && ( control = sel.getSelectedElement() ) ) { + range = sel.getRanges()[ 0 ]; + dummy = editor.document.createText( '' ); + dummy.insertBefore( control ); + range.setStartBefore( dummy ); + range.setEndAfter( control ); + sel.selectRanges( [ range ] ); + + // Clear up the fix if the paste wasn't succeeded. + setTimeout( function() { + // Element still online? + if ( control.getParent() ) { + dummy.remove(); + sel.selectElement( control ); + } + }, 0 ); + } + } + + // Allow to peek clipboard content by redirecting the + // pasting content into a temporary bin and grab the content of it. + function getClipboardDataByPastebin( evt, callback ) { + var doc = editor.document, + editable = editor.editable(), + cancel = function( evt ) { + evt.cancel(); + }, + blurListener; + + // Avoid recursions on 'paste' event or consequent paste too fast. (http://dev.ckeditor.com/ticket/5730) + if ( doc.getById( 'cke_pastebin' ) ) + return; + + var sel = editor.getSelection(); + var bms = sel.createBookmarks(); + + // http://dev.ckeditor.com/ticket/11384. On IE9+ we use native selectionchange (i.e. editor#selectionCheck) to cache the most + // recent selection which we then lock on editable blur. See selection.js for more info. + // selectionchange fired before getClipboardDataByPastebin() cached selection + // before creating bookmark (cached selection will be invalid, because bookmarks modified the DOM), + // so we need to fire selectionchange one more time, to store current seleciton. + // Selection will be locked when we focus pastebin. + if ( CKEDITOR.env.ie ) + sel.root.fire( 'selectionchange' ); + + // Create container to paste into. + // For rich content we prefer to use "body" since it holds + // the least possibility to be splitted by pasted content, while this may + // breaks the text selection on a frame-less editable, "div" would be + // the best one in that case. + // In another case on old IEs moving the selection into a "body" paste bin causes error panic. + // Body can't be also used for Opera which fills it with
+ // what is indistinguishable from pasted
(copying
in Opera isn't possible, + // but it can be copied from other browser). + var pastebin = new CKEDITOR.dom.element( + ( CKEDITOR.env.webkit || editable.is( 'body' ) ) && !CKEDITOR.env.ie ? 'body' : 'div', doc ); + + pastebin.setAttributes( { + id: 'cke_pastebin', + 'data-cke-temp': '1' + } ); + + var containerOffset = 0, + offsetParent, + win = doc.getWindow(); + + if ( CKEDITOR.env.webkit ) { + // It's better to paste close to the real paste destination, so inherited styles + // (which Webkits will try to compensate by styling span) differs less from the destination's one. + editable.append( pastebin ); + // Style pastebin like .cke_editable, to minimize differences between origin and destination. (http://dev.ckeditor.com/ticket/9754) + pastebin.addClass( 'cke_editable' ); + + // Compensate position of offsetParent. + if ( !editable.is( 'body' ) ) { + // We're not able to get offsetParent from pastebin (body element), so check whether + // its parent (editable) is positioned. + if ( editable.getComputedStyle( 'position' ) != 'static' ) + offsetParent = editable; + // And if not - safely get offsetParent from editable. + else + offsetParent = CKEDITOR.dom.element.get( editable.$.offsetParent ); + + containerOffset = offsetParent.getDocumentPosition().y; + } + } else { + // Opera and IE doesn't allow to append to html element. + editable.getAscendant( CKEDITOR.env.ie ? 'body' : 'html', 1 ).append( pastebin ); + } + + pastebin.setStyles( { + position: 'absolute', + // Position the bin at the top (+10 for safety) of viewport to avoid any subsequent document scroll. + top: ( win.getScrollPosition().y - containerOffset + 10 ) + 'px', + width: '1px', + // Caret has to fit in that height, otherwise browsers like Chrome & Opera will scroll window to show it. + // Set height equal to viewport's height - 20px (safety gaps), minimum 1px. + height: Math.max( 1, win.getViewPaneSize().height - 20 ) + 'px', + overflow: 'hidden', + // Reset styles that can mess up pastebin position. + margin: 0, + padding: 0 + } ); + + // Paste fails in Safari when the body tag has 'user-select: none'. (http://dev.ckeditor.com/ticket/12506) + if ( CKEDITOR.env.safari ) + pastebin.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'text' ) ); + + // Check if the paste bin now establishes new editing host. + var isEditingHost = pastebin.getParent().isReadOnly(); + + if ( isEditingHost ) { + // Hide the paste bin. + pastebin.setOpacity( 0 ); + // And make it editable. + pastebin.setAttribute( 'contenteditable', true ); + } + // Transparency is not enough since positioned non-editing host always shows + // resize handler, pull it off the screen instead. + else { + pastebin.setStyle( editor.config.contentsLangDirection == 'ltr' ? 'left' : 'right', '-10000px' ); + } + + editor.on( 'selectionChange', cancel, null, null, 0 ); + + // Webkit fill fire blur on editable when moving selection to + // pastebin (if body is used). Cancel it because it causes incorrect + // selection lock in case of inline editor (http://dev.ckeditor.com/ticket/10644). + // The same seems to apply to Firefox (http://dev.ckeditor.com/ticket/10787). + if ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) + blurListener = editable.once( 'blur', cancel, null, null, -100 ); + + // Temporarily move selection to the pastebin. + isEditingHost && pastebin.focus(); + var range = new CKEDITOR.dom.range( pastebin ); + range.selectNodeContents( pastebin ); + var selPastebin = range.select(); + + // If non-native paste is executed, IE will open security alert and blur editable. + // Editable will then lock selection inside itself and after accepting security alert + // this selection will be restored. We overwrite stored selection, so it's restored + // in pastebin. (http://dev.ckeditor.com/ticket/9552) + if ( CKEDITOR.env.ie ) { + blurListener = editable.once( 'blur', function() { + editor.lockSelection( selPastebin ); + } ); + } + + var scrollTop = CKEDITOR.document.getWindow().getScrollPosition().y; + + // Wait a while and grab the pasted contents. + setTimeout( function() { + // Restore main window's scroll position which could have been changed + // by browser in cases described in http://dev.ckeditor.com/ticket/9771. + if ( CKEDITOR.env.webkit ) + CKEDITOR.document.getBody().$.scrollTop = scrollTop; + + // Blur will be fired only on non-native paste. In other case manually remove listener. + blurListener && blurListener.removeListener(); + + // Restore properly the document focus. (http://dev.ckeditor.com/ticket/8849) + if ( CKEDITOR.env.ie ) + editable.focus(); + + // IE7: selection must go before removing pastebin. (http://dev.ckeditor.com/ticket/8691) + sel.selectBookmarks( bms ); + pastebin.remove(); + + // Grab the HTML contents. + // We need to look for a apple style wrapper on webkit it also adds + // a div wrapper if you copy/paste the body of the editor. + // Remove hidden div and restore selection. + var bogusSpan; + if ( CKEDITOR.env.webkit && ( bogusSpan = pastebin.getFirst() ) && ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ) + pastebin = bogusSpan; + + editor.removeListener( 'selectionChange', cancel ); + callback( pastebin.getHtml() ); + }, 0 ); + } + + // Try to get content directly on IE from clipboard, without native event + // being fired before. In other words - synthetically get clipboard data, if it's possible. + // mainPasteEvent will be fired, so if forced native paste: + // * worked, getClipboardDataByPastebin will grab it, + // * didn't work, dataValue and dataTransfer will be empty and editor#paste won't be fired. + // Clipboard data can be accessed directly only on IEs older than Edge. + // On other browsers we should fire beforePaste event and return false. + function getClipboardDataDirectly() { + if ( clipboard.mainPasteEvent == 'paste' ) { + editor.fire( 'beforePaste', { type: 'auto', method: 'paste' } ); + return false; + } + + // Prevent IE from pasting at the begining of the document. + editor.focus(); + + // Command will be handled by 'beforepaste', but as + // execIECommand( 'paste' ) will fire also 'paste' event + // we're canceling it. + preventPasteEventNow(); + + // http://dev.ckeditor.com/ticket/9247: Lock focus to prevent IE from hiding toolbar for inline editor. + var focusManager = editor.focusManager; + focusManager.lock(); + + if ( editor.editable().fire( clipboard.mainPasteEvent ) && !execIECommand( 'paste' ) ) { + focusManager.unlock(); + return false; + } + focusManager.unlock(); + + return true; + } + + // Listens for some clipboard related keystrokes, so they get customized. + // Needs to be bind to keydown event. + function onKey( event ) { + if ( editor.mode != 'wysiwyg' ) + return; + + switch ( event.data.keyCode ) { + // Paste + case CKEDITOR.CTRL + 86: // CTRL+V + case CKEDITOR.SHIFT + 45: // SHIFT+INS + var editable = editor.editable(); + + // Cancel 'paste' event because ctrl+v is for IE handled + // by 'beforepaste'. + preventPasteEventNow(); + + // Simulate 'beforepaste' event for all browsers using 'paste' as main event. + if ( clipboard.mainPasteEvent == 'paste' ) { + editable.fire( 'beforepaste' ); + } + + return; + + // Cut + case CKEDITOR.CTRL + 88: // CTRL+X + case CKEDITOR.SHIFT + 46: // SHIFT+DEL + // Save Undo snapshot. + editor.fire( 'saveSnapshot' ); // Save before cut + setTimeout( function() { + editor.fire( 'saveSnapshot' ); // Save after cut + }, 50 ); // OSX is slow (http://dev.ckeditor.com/ticket/11416). + } + } + + function pasteDataFromClipboard( evt ) { + // Default type is 'auto', but can be changed by beforePaste listeners. + var eventData = { + type: 'auto', + method: 'paste', + dataTransfer: clipboard.initPasteDataTransfer( evt ) + }; + + eventData.dataTransfer.cacheData(); + + // Fire 'beforePaste' event so clipboard flavor get customized by other plugins. + // If 'beforePaste' is canceled continue executing getClipboardDataByPastebin and then do nothing + // (do not fire 'paste', 'afterPaste' events). This way we can grab all - synthetically + // and natively pasted content and prevent its insertion into editor + // after canceling 'beforePaste' event. + var beforePasteNotCanceled = editor.fire( 'beforePaste', eventData ) !== false; + + // Do not use paste bin if the browser let us get HTML or files from dataTranfer. + if ( beforePasteNotCanceled && clipboard.canClipboardApiBeTrusted( eventData.dataTransfer, editor ) ) { + evt.data.preventDefault(); + setTimeout( function() { + firePasteEvents( editor, eventData ); + }, 0 ); + } else { + getClipboardDataByPastebin( evt, function( data ) { + // Clean up. + eventData.dataValue = data.replace( /]+data-cke-bookmark[^<]*?<\/span>/ig, '' ); + + // Fire remaining events (without beforePaste) + beforePasteNotCanceled && firePasteEvents( editor, eventData ); + } ); + } + } + + function setToolbarStates() { + if ( editor.mode != 'wysiwyg' ) + return; + + var pasteState = stateFromNamedCommand( 'paste' ); + + editor.getCommand( 'cut' ).setState( stateFromNamedCommand( 'cut' ) ); + editor.getCommand( 'copy' ).setState( stateFromNamedCommand( 'copy' ) ); + editor.getCommand( 'paste' ).setState( pasteState ); + editor.fire( 'pasteState', pasteState ); + } + + function stateFromNamedCommand( command ) { + if ( inReadOnly && command in { paste: 1, cut: 1 } ) + return CKEDITOR.TRISTATE_DISABLED; + + if ( command == 'paste' ) + return CKEDITOR.TRISTATE_OFF; + + // Cut, copy - check if the selection is not empty. + var sel = editor.getSelection(), + ranges = sel.getRanges(), + selectionIsEmpty = sel.getType() == CKEDITOR.SELECTION_NONE || ( ranges.length == 1 && ranges[ 0 ].collapsed ); + + return selectionIsEmpty ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF; + } + } + + // Returns: + // * 'htmlifiedtext' if content looks like transformed by browser from plain text. + // See clipboard/paste.html TCs for more info. + // * 'html' if it is not 'htmlifiedtext'. + function recogniseContentType( data ) { + if ( CKEDITOR.env.webkit ) { + // Plain text or (

and text inside
). + if ( !data.match( /^[^<]*$/g ) && !data.match( /^(
<\/div>|
[^<]*<\/div>)*$/gi ) ) + return 'html'; + } else if ( CKEDITOR.env.ie ) { + // Text and
or ( text and
in

- paragraphs can be separated by new \r\n ). + if ( !data.match( /^([^<]|)*$/gi ) && !data.match( /^(

([^<]|)*<\/p>|(\r\n))*$/gi ) ) + return 'html'; + } else if ( CKEDITOR.env.gecko ) { + // Text or
. + if ( !data.match( /^([^<]|)*$/gi ) ) + return 'html'; + } else { + return 'html'; + } + + return 'htmlifiedtext'; + } + + // This function transforms what browsers produce when + // pasting plain text into editable element (see clipboard/paste.html TCs + // for more info) into correct HTML (similar to that produced by text2Html). + function htmlifiedTextHtmlification( config, data ) { + function repeatParagraphs( repeats ) { + // Repeat blocks floor((n+1)/2) times. + // Even number of repeats - add
at the beginning of last

. + return CKEDITOR.tools.repeat( '

', ~~( repeats / 2 ) ) + ( repeats % 2 == 1 ? '
' : '' ); + } + + // Replace adjacent white-spaces (EOLs too - Fx sometimes keeps them) with one space. + data = data.replace( /\s+/g, ' ' ) + // Remove spaces from between tags. + .replace( /> +<' ) + // Normalize XHTML syntax and upper cased
tags. + .replace( /
/gi, '
' ); + + // IE - lower cased tags. + data = data.replace( /<\/?[A-Z]+>/g, function( match ) { + return match.toLowerCase(); + } ); + + // Don't touch single lines (no ) - nothing to do here. + if ( data.match( /^[^<]$/ ) ) + return data; + + // Webkit. + if ( CKEDITOR.env.webkit && data.indexOf( '

' ) > -1 ) { + // One line break at the beginning - insert
+ data = data.replace( /^(
(
|)<\/div>)(?!$|(
(
|)<\/div>))/g, '
' ) + // Two or more - reduce number of new lines by one. + .replace( /^(
(
|)<\/div>){2}(?!$)/g, '
' ); + + // Two line breaks create one paragraph in Webkit. + if ( data.match( /
(
|)<\/div>/ ) ) { + data = '

' + data.replace( /(

(
|)<\/div>)+/g, function( match ) { + return repeatParagraphs( match.split( '
' ).length + 1 ); + } ) + '

'; + } + + // One line break create br. + data = data.replace( /<\/div>
/g, '
' ); + + // Remove remaining divs. + data = data.replace( /<\/?div>/g, '' ); + } + + // Opera and Firefox and enterMode != BR. + if ( CKEDITOR.env.gecko && config.enterMode != CKEDITOR.ENTER_BR ) { + // Remove bogus
- Fx generates two for one line break. + // For two line breaks it still produces two , but it's better to ignore this case than the first one. + if ( CKEDITOR.env.gecko ) + data = data.replace( /^

$/, '
' ); + + // This line satisfy edge case when for Opera we have two line breaks + //data = data.replace( /) + + if ( data.indexOf( '

' ) > -1 ) { + // Two line breaks create one paragraph, three - 2, four - 3, etc. + data = '

' + data.replace( /(
){2,}/g, function( match ) { + return repeatParagraphs( match.length / 4 ); + } ) + '

'; + } + } + + return switchEnterMode( config, data ); + } + + function filtersFactoryFactory() { + var filters = {}; + + function setUpTags() { + var tags = {}; + + for ( var tag in CKEDITOR.dtd ) { + if ( tag.charAt( 0 ) != '$' && tag != 'div' && tag != 'span' ) { + tags[ tag ] = 1; + } + } + + return tags; + } + + function createSemanticContentFilter() { + var filter = new CKEDITOR.filter(); + + filter.allow( { + $1: { + elements: setUpTags(), + attributes: true, + styles: false, + classes: false + } + } ); + + return filter; + } + + return { + get: function( type ) { + if ( type == 'plain-text' ) { + // Does this look confusing to you? Did we forget about enter mode? + // It is a trick that let's us creating one filter for edidtor, regardless of its + // activeEnterMode (which as the name indicates can change during runtime). + // + // How does it work? + // The active enter mode is passed to the filter.applyTo method. + // The filter first marks all elements except
as disallowed and then tries to remove + // them. However, it cannot remove e.g. a

element completely, because it's a basic structural element, + // so it tries to replace it with an element created based on the active enter mode, eventually doing nothing. + // + // Now you can sleep well. + return filters.plainText || ( filters.plainText = new CKEDITOR.filter( 'br' ) ); + } else if ( type == 'semantic-content' ) { + return filters.semanticContent || ( filters.semanticContent = createSemanticContentFilter() ); + } else if ( type ) { + // Create filter based on rules (string or object). + return new CKEDITOR.filter( type ); + } + + return null; + } + }; + } + + function filterContent( editor, data, filter ) { + var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data ), + writer = new CKEDITOR.htmlParser.basicWriter(); + + filter.applyTo( fragment, true, false, editor.activeEnterMode ); + fragment.writeHtml( writer ); + + return writer.getHtml(); + } + + function switchEnterMode( config, data ) { + if ( config.enterMode == CKEDITOR.ENTER_BR ) { + data = data.replace( /(<\/p>

)+/g, function( match ) { + return CKEDITOR.tools.repeat( '
', match.length / 7 * 2 ); + } ).replace( /<\/?p>/g, '' ); + } else if ( config.enterMode == CKEDITOR.ENTER_DIV ) { + data = data.replace( /<(\/)?p>/g, '<$1div>' ); + } + + return data; + } + + function preventDefaultSetDropEffectToNone( evt ) { + evt.data.preventDefault(); + evt.data.$.dataTransfer.dropEffect = 'none'; + } + + function initDragDrop( editor ) { + var clipboard = CKEDITOR.plugins.clipboard; + + editor.on( 'contentDom', function() { + var editable = editor.editable(), + dropTarget = CKEDITOR.plugins.clipboard.getDropTarget( editor ), + top = editor.ui.space( 'top' ), + bottom = editor.ui.space( 'bottom' ); + + // -------------- DRAGOVER TOP & BOTTOM -------------- + + // Not allowing dragging on toolbar and bottom (http://dev.ckeditor.com/ticket/12613). + clipboard.preventDefaultDropOnElement( top ); + clipboard.preventDefaultDropOnElement( bottom ); + + // -------------- DRAGSTART -------------- + // Listed on dragstart to mark internal and cross-editor drag & drop + // and save range and selected HTML. + + editable.attachListener( dropTarget, 'dragstart', fireDragEvent ); + + // Make sure to reset data transfer (in case dragend was not called or was canceled). + editable.attachListener( editor, 'dragstart', clipboard.resetDragDataTransfer, clipboard, null, 1 ); + + // Create a dataTransfer object and save it globally. + editable.attachListener( editor, 'dragstart', function( evt ) { + clipboard.initDragDataTransfer( evt, editor ); + }, null, null, 2 ); + + editable.attachListener( editor, 'dragstart', function() { + // Save drag range globally for cross editor D&D. + var dragRange = clipboard.dragRange = editor.getSelection().getRanges()[ 0 ]; + + // Store number of children, so we can later tell if any text node was split on drop. (http://dev.ckeditor.com/ticket/13011, http://dev.ckeditor.com/ticket/13447) + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 10 ) { + clipboard.dragStartContainerChildCount = dragRange ? getContainerChildCount( dragRange.startContainer ) : null; + clipboard.dragEndContainerChildCount = dragRange ? getContainerChildCount( dragRange.endContainer ) : null; + } + }, null, null, 100 ); + + // -------------- DRAGEND -------------- + // Clean up on dragend. + + editable.attachListener( dropTarget, 'dragend', fireDragEvent ); + + // Init data transfer if someone wants to use it in dragend. + editable.attachListener( editor, 'dragend', clipboard.initDragDataTransfer, clipboard, null, 1 ); + + // When drag & drop is done we need to reset dataTransfer so the future + // external drop will be not recognize as internal. + editable.attachListener( editor, 'dragend', clipboard.resetDragDataTransfer, clipboard, null, 100 ); + + // -------------- DRAGOVER -------------- + // We need to call preventDefault on dragover because otherwise if + // we drop image it will overwrite document. + + editable.attachListener( dropTarget, 'dragover', function( evt ) { + // Edge requires this handler to have `preventDefault()` regardless of the situation. + if ( CKEDITOR.env.edge ) { + evt.data.preventDefault(); + return; + } + + var target = evt.data.getTarget(); + + // Prevent reloading page when dragging image on empty document (http://dev.ckeditor.com/ticket/12619). + if ( target && target.is && target.is( 'html' ) ) { + evt.data.preventDefault(); + return; + } + + // If we do not prevent default dragover on IE the file path + // will be loaded and we will lose content. On the other hand + // if we prevent it the cursor will not we shown, so we prevent + // dragover only on IE, on versions which support file API and only + // if the event contains files. + if ( CKEDITOR.env.ie && + CKEDITOR.plugins.clipboard.isFileApiSupported && + evt.data.$.dataTransfer.types.contains( 'Files' ) ) { + evt.data.preventDefault(); + } + } ); + + // -------------- DROP -------------- + + editable.attachListener( dropTarget, 'drop', function( evt ) { + // Do nothing if event was already prevented. (http://dev.ckeditor.com/ticket/13879) + if ( evt.data.$.defaultPrevented ) { + return; + } + + // Cancel native drop. + evt.data.preventDefault(); + + var target = evt.data.getTarget(), + readOnly = target.isReadOnly(); + + // Do nothing if drop on non editable element (http://dev.ckeditor.com/ticket/13015). + // The tag isn't editable (body is), but we want to allow drop on it + // (so it is possible to drop below editor contents). + if ( readOnly && !( target.type == CKEDITOR.NODE_ELEMENT && target.is( 'html' ) ) ) { + return; + } + + // Getting drop position is one of the most complex parts. + var dropRange = clipboard.getRangeAtDropPosition( evt, editor ), + dragRange = clipboard.dragRange; + + // Do nothing if it was not possible to get drop range. + if ( !dropRange ) { + return; + } + + // Fire drop. + fireDragEvent( evt, dragRange, dropRange ); + }, null, null, 9999 ); + + // Create dataTransfer or get it, if it was created before. + editable.attachListener( editor, 'drop', clipboard.initDragDataTransfer, clipboard, null, 1 ); + + // Execute drop action, fire paste. + editable.attachListener( editor, 'drop', function( evt ) { + var data = evt.data; + + if ( !data ) { + return; + } + + // Let user modify drag and drop range. + var dropRange = data.dropRange, + dragRange = data.dragRange, + dataTransfer = data.dataTransfer; + + if ( dataTransfer.getTransferType( editor ) == CKEDITOR.DATA_TRANSFER_INTERNAL ) { + // Execute drop with a timeout because otherwise selection, after drop, + // on IE is in the drag position, instead of drop position. + setTimeout( function() { + clipboard.internalDrop( dragRange, dropRange, dataTransfer, editor ); + }, 0 ); + } else if ( dataTransfer.getTransferType( editor ) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ) { + crossEditorDrop( dragRange, dropRange, dataTransfer ); + } else { + externalDrop( dropRange, dataTransfer ); + } + }, null, null, 9999 ); + + // Cross editor drag and drop (drag in one Editor and drop in the other). + function crossEditorDrop( dragRange, dropRange, dataTransfer ) { + // Paste event should be fired before delete contents because otherwise + // Chrome have a problem with drop range (Chrome split the drop + // range container so the offset is bigger then container length). + dropRange.select(); + firePasteEvents( editor, { dataTransfer: dataTransfer, method: 'drop' }, 1 ); + + // Remove dragged content and make a snapshot. + dataTransfer.sourceEditor.fire( 'saveSnapshot' ); + + dataTransfer.sourceEditor.editable().extractHtmlFromRange( dragRange ); + + // Make some selection before saving snapshot, otherwise error will be thrown, because + // there will be no valid selection after content is removed. + dataTransfer.sourceEditor.getSelection().selectRanges( [ dragRange ] ); + dataTransfer.sourceEditor.fire( 'saveSnapshot' ); + } + + // Drop from external source. + function externalDrop( dropRange, dataTransfer ) { + // Paste content into the drop position. + dropRange.select(); + + firePasteEvents( editor, { dataTransfer: dataTransfer, method: 'drop' }, 1 ); + + // Usually we reset DataTranfer on dragend, + // but dragend is called on the same element as dragstart + // so it will not be called on on external drop. + clipboard.resetDragDataTransfer(); + } + + // Fire drag/drop events (dragstart, dragend, drop). + function fireDragEvent( evt, dragRange, dropRange ) { + var eventData = { + $: evt.data.$, + target: evt.data.getTarget() + }; + + if ( dragRange ) { + eventData.dragRange = dragRange; + } + if ( dropRange ) { + eventData.dropRange = dropRange; + } + + if ( editor.fire( evt.name, eventData ) === false ) { + evt.data.preventDefault(); + } + } + + function getContainerChildCount( container ) { + if ( container.type != CKEDITOR.NODE_ELEMENT ) { + container = container.getParent(); + } + + return container.getChildCount(); + } + } ); + } + + /** + * @singleton + * @class CKEDITOR.plugins.clipboard + */ + CKEDITOR.plugins.clipboard = { + /** + * True if the environment allows to set data on copy or cut manually. This value is false in IE, because this browser + * shows the security dialog window when the script tries to set clipboard data and on iOS, because custom data is + * not saved to clipboard there. + * + * @since 4.5 + * @readonly + * @property {Boolean} + */ + isCustomCopyCutSupported: !CKEDITOR.env.ie && !CKEDITOR.env.iOS, + + /** + * True if the environment supports MIME types and custom data types in dataTransfer/cliboardData getData/setData methods. + * + * @since 4.5 + * @readonly + * @property {Boolean} + */ + isCustomDataTypesSupported: !CKEDITOR.env.ie, + + /** + * True if the environment supports File API. + * + * @since 4.5 + * @readonly + * @property {Boolean} + */ + isFileApiSupported: !CKEDITOR.env.ie || CKEDITOR.env.version > 9, + + /** + * Main native paste event editable should listen to. + * + * **Note:** Safari does not like the {@link CKEDITOR.editor#beforePaste} event — it sometimes does not + * handle Ctrl+C properly. This is probably caused by some race condition between events. + * Chrome, Firefox and Edge work well with both events, so it is better to use {@link CKEDITOR.editor#paste} + * which will handle pasting from e.g. browsers' menu bars. + * IE7/8 does not like the {@link CKEDITOR.editor#paste} event for which it is throwing random errors. + * + * @since 4.5 + * @readonly + * @property {String} + */ + mainPasteEvent: ( CKEDITOR.env.ie && !CKEDITOR.env.edge ) ? 'beforepaste' : 'paste', + + /** + * Returns `true` if it is expected that a browser provides HTML data through the Clipboard API. + * If not, this method returns `false` and as a result CKEditor will use the paste bin. Read more in + * the [Clipboard Integration](http://docs.ckeditor.com/#!/guide/dev_clipboard-section-clipboard-api) guide. + * + * @since 4.5.2 + * @returns {Boolean} + */ + canClipboardApiBeTrusted: function( dataTransfer, editor ) { + // If it's an internal or cross-editor data transfer, then it means that custom cut/copy/paste support works + // and that the data were put manually on the data transfer so we can be sure that it's available. + if ( dataTransfer.getTransferType( editor ) != CKEDITOR.DATA_TRANSFER_EXTERNAL ) { + return true; + } + + // In Chrome we can trust Clipboard API, with the exception of Chrome on Android (in both - mobile and desktop modes), where + // clipboard API is not available so we need to check it (http://dev.ckeditor.com/ticket/13187). + if ( CKEDITOR.env.chrome && !dataTransfer.isEmpty() ) { + return true; + } + + // Because of a Firefox bug HTML data are not available in some cases (e.g. paste from Word), in such cases we + // need to use the pastebin (http://dev.ckeditor.com/ticket/13528, https://bugzilla.mozilla.org/show_bug.cgi?id=1183686). + if ( CKEDITOR.env.gecko && ( dataTransfer.getData( 'text/html' ) || dataTransfer.getFilesCount() ) ) { + return true; + } + + // Safari fixed clipboard in 10.1 (https://bugs.webkit.org/show_bug.cgi?id=19893) (http://dev.ckeditor.com/ticket/16982). + // However iOS version still doesn't work well enough (https://bugs.webkit.org/show_bug.cgi?id=19893#c34). + if ( CKEDITOR.env.safari && CKEDITOR.env.version >= 603 && !CKEDITOR.env.iOS ) { + return true; + } + + // In older Safari and IE HTML data is not available though the Clipboard API. + // In Edge things are a bit messy at the moment - + // https://connect.microsoft.com/IE/feedback/details/1572456/edge-clipboard-api-text-html-content-messed-up-in-event-clipboarddata + // It is safer to use the paste bin in unknown cases. + return false; + }, + + /** + * Returns the element that should be used as the target for the drop event. + * + * @since 4.5 + * @param {CKEDITOR.editor} editor The editor instance. + * @returns {CKEDITOR.dom.domObject} the element that should be used as the target for the drop event. + */ + getDropTarget: function( editor ) { + var editable = editor.editable(); + + // http://dev.ckeditor.com/ticket/11123 Firefox needs to listen on document, because otherwise event won't be fired. + // http://dev.ckeditor.com/ticket/11086 IE8 cannot listen on document. + if ( ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) || editable.isInline() ) { + return editable; + } else { + return editor.document; + } + }, + + /** + * IE 8 & 9 split text node on drop so the first node contains the + * text before the drop position and the second contains the rest. If you + * drag the content from the same node you will be not be able to get + * it (the range becomes invalid), so you need to join them back. + * + * Note that the first node in IE 8 & 9 is the original node object + * but with shortened content. + * + * Before: + * --- Text Node A ---------------------------------- + * /\ + * Drag position + * + * After (IE 8 & 9): + * --- Text Node A ----- --- Text Node B ----------- + * /\ /\ + * Drop position Drag position + * (invalid) + * + * After (other browsers): + * --- Text Node A ---------------------------------- + * /\ /\ + * Drop position Drag position + * + * **Note:** This function is in the public scope for tests usage only. + * + * @since 4.5 + * @private + * @param {CKEDITOR.dom.range} dragRange The drag range. + * @param {CKEDITOR.dom.range} dropRange The drop range. + * @param {Number} preDragStartContainerChildCount The number of children of the drag range start container before the drop. + * @param {Number} preDragEndContainerChildCount The number of children of the drag range end container before the drop. + */ + fixSplitNodesAfterDrop: function( dragRange, dropRange, preDragStartContainerChildCount, preDragEndContainerChildCount ) { + var dropContainer = dropRange.startContainer; + + if ( + typeof preDragEndContainerChildCount != 'number' || + typeof preDragStartContainerChildCount != 'number' + ) { + return; + } + + // We are only concerned about ranges anchored in elements. + if ( dropContainer.type != CKEDITOR.NODE_ELEMENT ) { + return; + } + + if ( handleContainer( dragRange.startContainer, dropContainer, preDragStartContainerChildCount ) ) { + return; + } + + if ( handleContainer( dragRange.endContainer, dropContainer, preDragEndContainerChildCount ) ) { + return; + } + + function handleContainer( dragContainer, dropContainer, preChildCount ) { + var dragElement = dragContainer; + if ( dragElement.type == CKEDITOR.NODE_TEXT ) { + dragElement = dragContainer.getParent(); + } + + if ( dragElement.equals( dropContainer ) && preChildCount != dropContainer.getChildCount() ) { + applyFix( dropRange ); + return true; + } + } + + function applyFix( dropRange ) { + var nodeBefore = dropRange.startContainer.getChild( dropRange.startOffset - 1 ), + nodeAfter = dropRange.startContainer.getChild( dropRange.startOffset ); + + if ( + nodeBefore && nodeBefore.type == CKEDITOR.NODE_TEXT && + nodeAfter && nodeAfter.type == CKEDITOR.NODE_TEXT + ) { + var offset = nodeBefore.getLength(); + + nodeBefore.setText( nodeBefore.getText() + nodeAfter.getText() ); + nodeAfter.remove(); + + dropRange.setStart( nodeBefore, offset ); + dropRange.collapse( true ); + } + } + }, + + /** + * Checks whether turning the drag range into bookmarks will invalidate the drop range. + * This usually happens when the drop range shares the container with the drag range and is + * located after the drag range, but there are countless edge cases. + * + * This function is stricly related to {@link #internalDrop} which toggles + * order in which it creates bookmarks for both ranges based on a value returned + * by this method. In some cases this method returns a value which is not necessarily + * true in terms of what it was meant to check, but it is convenient, because + * we know how it is interpreted in {@link #internalDrop}, so the correct + * behavior of the entire algorithm is assured. + * + * **Note:** This function is in the public scope for tests usage only. + * + * @since 4.5 + * @private + * @param {CKEDITOR.dom.range} dragRange The first range to compare. + * @param {CKEDITOR.dom.range} dropRange The second range to compare. + * @returns {Boolean} `true` if the first range is before the second range. + */ + isDropRangeAffectedByDragRange: function( dragRange, dropRange ) { + var dropContainer = dropRange.startContainer, + dropOffset = dropRange.endOffset; + + // Both containers are the same and drop offset is at the same position or later. + // " A L] A " " M A " + // ^ ^ + if ( dragRange.endContainer.equals( dropContainer ) && dragRange.endOffset <= dropOffset ) { + return true; + } + + // Bookmark for drag start container will mess up with offsets. + // " O [L A " " M A " + // ^ ^ + if ( + dragRange.startContainer.getParent().equals( dropContainer ) && + dragRange.startContainer.getIndex() < dropOffset + ) { + return true; + } + + // Bookmark for drag end container will mess up with offsets. + // " O] L A " " M A " + // ^ ^ + if ( + dragRange.endContainer.getParent().equals( dropContainer ) && + dragRange.endContainer.getIndex() < dropOffset + ) { + return true; + } + + return false; + }, + + /** + * Internal drag and drop (drag and drop in the same editor instance). + * + * **Note:** This function is in the public scope for tests usage only. + * + * @since 4.5 + * @private + * @param {CKEDITOR.dom.range} dragRange The first range to compare. + * @param {CKEDITOR.dom.range} dropRange The second range to compare. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} dataTransfer + * @param {CKEDITOR.editor} editor + */ + internalDrop: function( dragRange, dropRange, dataTransfer, editor ) { + var clipboard = CKEDITOR.plugins.clipboard, + editable = editor.editable(), + dragBookmark, dropBookmark, isDropRangeAffected; + + // Save and lock snapshot so there will be only + // one snapshot for both remove and insert content. + editor.fire( 'saveSnapshot' ); + editor.fire( 'lockSnapshot', { dontUpdate: 1 } ); + + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 10 ) { + this.fixSplitNodesAfterDrop( + dragRange, + dropRange, + clipboard.dragStartContainerChildCount, + clipboard.dragEndContainerChildCount + ); + } + + // Because we manipulate multiple ranges we need to do it carefully, + // changing one range (event creating a bookmark) may make other invalid. + // We need to change ranges into bookmarks so we can manipulate them easily in the future. + // We can change the range which is later in the text before we change the preceding range. + // We call isDropRangeAffectedByDragRange to test the order of ranges. + isDropRangeAffected = this.isDropRangeAffectedByDragRange( dragRange, dropRange ); + if ( !isDropRangeAffected ) { + dragBookmark = dragRange.createBookmark( false ); + } + dropBookmark = dropRange.clone().createBookmark( false ); + if ( isDropRangeAffected ) { + dragBookmark = dragRange.createBookmark( false ); + } + + // Check if drop range is inside range. + // This is an edge case when we drop something on editable's margin/padding. + // That space is not treated as a part of the range we drag, so it is possible to drop there. + // When we drop, browser tries to find closest drop position and it finds it inside drag range. (http://dev.ckeditor.com/ticket/13453) + var startNode = dragBookmark.startNode, + endNode = dragBookmark.endNode, + dropNode = dropBookmark.startNode, + dropInsideDragRange = + // Must check endNode because dragRange could be collapsed in some edge cases (simulated DnD). + endNode && + ( startNode.getPosition( dropNode ) & CKEDITOR.POSITION_PRECEDING ) && + ( endNode.getPosition( dropNode ) & CKEDITOR.POSITION_FOLLOWING ); + + // If the drop range happens to be inside drag range change it's position to the beginning of the drag range. + if ( dropInsideDragRange ) { + // We only change position of bookmark span that is connected with dropBookmark. + // dropRange will be overwritten and set to the dropBookmark later. + dropNode.insertBefore( startNode ); + } + + // No we can safely delete content for the drag range... + dragRange = editor.createRange(); + dragRange.moveToBookmark( dragBookmark ); + editable.extractHtmlFromRange( dragRange, 1 ); + + // ...and paste content into the drop position. + dropRange = editor.createRange(); + dropRange.moveToBookmark( dropBookmark ); + + // We do not select drop range, because of may be in the place we can not set the selection + // (e.g. between blocks, in case of block widget D&D). We put range to the paste event instead. + firePasteEvents( editor, { dataTransfer: dataTransfer, method: 'drop', range: dropRange }, 1 ); + + editor.fire( 'unlockSnapshot' ); + }, + + /** + * Gets the range from the `drop` event. + * + * @since 4.5 + * @param {Object} domEvent A native DOM drop event object. + * @param {CKEDITOR.editor} editor The source editor instance. + * @returns {CKEDITOR.dom.range} range at drop position. + */ + getRangeAtDropPosition: function( dropEvt, editor ) { + var $evt = dropEvt.data.$, + x = $evt.clientX, + y = $evt.clientY, + $range, + defaultRange = editor.getSelection( true ).getRanges()[ 0 ], + range = editor.createRange(); + + // Make testing possible. + if ( dropEvt.data.testRange ) + return dropEvt.data.testRange; + + // Webkits. + if ( document.caretRangeFromPoint && editor.document.$.caretRangeFromPoint( x, y ) ) { + $range = editor.document.$.caretRangeFromPoint( x, y ); + range.setStart( CKEDITOR.dom.node( $range.startContainer ), $range.startOffset ); + range.collapse( true ); + } + // FF. + else if ( $evt.rangeParent ) { + range.setStart( CKEDITOR.dom.node( $evt.rangeParent ), $evt.rangeOffset ); + range.collapse( true ); + } + // IEs 9+. + // We check if editable is focused to make sure that it's an internal DnD. External DnD must use the second + // mechanism because of http://dev.ckeditor.com/ticket/13472#comment:6. + else if ( CKEDITOR.env.ie && CKEDITOR.env.version > 8 && defaultRange && editor.editable().hasFocus ) { + // On IE 9+ range by default is where we expected it. + // defaultRange may be undefined if dragover was canceled (file drop). + return defaultRange; + } + // IE 8 and all IEs if !defaultRange or external DnD. + else if ( document.body.createTextRange ) { + // To use this method we need a focus (which may be somewhere else in case of external drop). + editor.focus(); + + $range = editor.document.getBody().$.createTextRange(); + try { + var sucess = false; + + // If user drop between text line IEs moveToPoint throws exception: + // + // Lorem ipsum pulvinar purus et euismod + // + // dolor sit amet,| consectetur adipiscing + // * + // vestibulum tincidunt augue eget tempus. + // + // * - drop position + // | - expected cursor position + // + // So we try to call moveToPoint with +-1px up to +-20px above or + // below original drop position to find nearest good drop position. + for ( var i = 0; i < 20 && !sucess; i++ ) { + if ( !sucess ) { + try { + $range.moveToPoint( x, y - i ); + sucess = true; + } catch ( err ) { + } + } + if ( !sucess ) { + try { + $range.moveToPoint( x, y + i ); + sucess = true; + } catch ( err ) { + } + } + } + + if ( sucess ) { + var id = 'cke-temp-' + ( new Date() ).getTime(); + $range.pasteHTML( '\u200b' ); + + var span = editor.document.getById( id ); + range.moveToPosition( span, CKEDITOR.POSITION_BEFORE_START ); + span.remove(); + } else { + // If the fist method does not succeed we might be next to + // the short element (like header): + // + // Lorem ipsum pulvinar purus et euismod. + // + // + // SOME HEADER| * + // + // + // vestibulum tincidunt augue eget tempus. + // + // * - drop position + // | - expected cursor position + // + // In such situation elementFromPoint returns proper element. Using getClientRect + // it is possible to check if the cursor should be at the beginning or at the end + // of paragraph. + var $element = editor.document.$.elementFromPoint( x, y ), + element = new CKEDITOR.dom.element( $element ), + rect; + + if ( !element.equals( editor.editable() ) && element.getName() != 'html' ) { + rect = element.getClientRect(); + + if ( x < rect.left ) { + range.setStartAt( element, CKEDITOR.POSITION_AFTER_START ); + range.collapse( true ); + } else { + range.setStartAt( element, CKEDITOR.POSITION_BEFORE_END ); + range.collapse( true ); + } + } + // If drop happens on no element elementFromPoint returns html or body. + // + // * |Lorem ipsum pulvinar purus et euismod. + // + // vestibulum tincidunt augue eget tempus. + // + // * - drop position + // | - expected cursor position + // + // In such case we can try to use default selection. If startContainer is not + // 'editable' element it is probably proper selection. + else if ( defaultRange && defaultRange.startContainer && + !defaultRange.startContainer.equals( editor.editable() ) ) { + return defaultRange; + + // Otherwise we can not find any drop position and we have to return null + // and cancel drop event. + } else { + return null; + } + + } + } catch ( err ) { + return null; + } + } else { + return null; + } + + return range; + }, + + /** + * This function tries to link the `evt.data.dataTransfer` property of the {@link CKEDITOR.editor#dragstart}, + * {@link CKEDITOR.editor#dragend} and {@link CKEDITOR.editor#drop} events to a single + * {@link CKEDITOR.plugins.clipboard.dataTransfer} object. + * + * This method is automatically used by the core of the drag and drop functionality and + * usually does not have to be called manually when using the drag and drop events. + * + * This method behaves differently depending on whether the drag and drop events were fired + * artificially (to represent a non-native drag and drop) or whether they were caused by the native drag and drop. + * + * If the native event is not available, then it will create a new {@link CKEDITOR.plugins.clipboard.dataTransfer} + * instance (if it does not exist already) and will link it to this and all following event objects until + * the {@link #resetDragDataTransfer} method is called. It means that all three drag and drop events must be fired + * in order to ensure that the data transfer is bound correctly. + * + * If the native event is available, then the {@link CKEDITOR.plugins.clipboard.dataTransfer} is identified + * by its ID and a new instance is assigned to the `evt.data.dataTransfer` only if the ID changed or + * the {@link #resetDragDataTransfer} method was called. + * + * @since 4.5 + * @param {CKEDITOR.dom.event} [evt] A drop event object. + * @param {CKEDITOR.editor} [sourceEditor] The source editor instance. + */ + initDragDataTransfer: function( evt, sourceEditor ) { + // Create a new dataTransfer object based on the drop event. + // If this event was used on dragstart to create dataTransfer + // both dataTransfer objects will have the same id. + var nativeDataTransfer = evt.data.$ ? evt.data.$.dataTransfer : null, + dataTransfer = new this.dataTransfer( nativeDataTransfer, sourceEditor ); + + if ( !nativeDataTransfer ) { + // No native event. + if ( this.dragData ) { + dataTransfer = this.dragData; + } else { + this.dragData = dataTransfer; + } + } else { + // Native event. If there is the same id we will replace dataTransfer with the one + // created on drag, because it contains drag editor, drag content and so on. + // Otherwise (in case of drag from external source) we save new object to + // the global clipboard.dragData. + if ( this.dragData && dataTransfer.id == this.dragData.id ) { + dataTransfer = this.dragData; + } else { + this.dragData = dataTransfer; + } + } + + evt.data.dataTransfer = dataTransfer; + }, + + /** + * Removes the global {@link #dragData} so the next call to {@link #initDragDataTransfer} + * always creates a new instance of {@link CKEDITOR.plugins.clipboard.dataTransfer}. + * + * @since 4.5 + */ + resetDragDataTransfer: function() { + this.dragData = null; + }, + + /** + * Global object storing the data transfer of the current drag and drop operation. + * Do not use it directly, use {@link #initDragDataTransfer} and {@link #resetDragDataTransfer}. + * + * Note: This object is global (meaning that it is not related to a single editor instance) + * in order to handle drag and drop from one editor into another. + * + * @since 4.5 + * @private + * @property {CKEDITOR.plugins.clipboard.dataTransfer} dragData + */ + + /** + * Range object to save the drag range and remove its content after the drop. + * + * @since 4.5 + * @private + * @property {CKEDITOR.dom.range} dragRange + */ + + /** + * Initializes and links data transfer objects based on the paste event. If the data + * transfer object was already initialized on this event, the function will + * return that object. In IE it is not possible to link copy/cut and paste events + * so the method always returns a new object. The same happens if there is no paste event + * passed to the method. + * + * @since 4.5 + * @param {CKEDITOR.dom.event} [evt] A paste event object. + * @param {CKEDITOR.editor} [sourceEditor] The source editor instance. + * @returns {CKEDITOR.plugins.clipboard.dataTransfer} The data transfer object. + */ + initPasteDataTransfer: function( evt, sourceEditor ) { + if ( !this.isCustomCopyCutSupported ) { + // Edge does not support custom copy/cut, but it have some useful data in the clipboardData (http://dev.ckeditor.com/ticket/13755). + return new this.dataTransfer( ( CKEDITOR.env.edge && evt && evt.data.$ && evt.data.$.clipboardData ) || null, sourceEditor ); + } else if ( evt && evt.data && evt.data.$ ) { + var dataTransfer = new this.dataTransfer( evt.data.$.clipboardData, sourceEditor ); + + if ( this.copyCutData && dataTransfer.id == this.copyCutData.id ) { + dataTransfer = this.copyCutData; + dataTransfer.$ = evt.data.$.clipboardData; + } else { + this.copyCutData = dataTransfer; + } + + return dataTransfer; + } else { + return new this.dataTransfer( null, sourceEditor ); + } + }, + + /** + * Prevents dropping on the specified element. + * + * @since 4.5 + * @param {CKEDITOR.dom.element} element The element on which dropping should be disabled. + */ + preventDefaultDropOnElement: function( element ) { + element && element.on( 'dragover', preventDefaultSetDropEffectToNone ); + } + }; + + // Data type used to link drag and drop events. + // + // In IE URL data type is buggie and there is no way to mark drag & drop without + // modifying text data (which would be displayed if user drop content to the textarea) + // so we just read dragged text. + // + // In Chrome and Firefox we can use custom data types. + var clipboardIdDataType = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? 'cke/id' : 'Text'; + /** + * Facade for the native `dataTransfer`/`clipboadData` object to hide all differences + * between browsers. + * + * @since 4.5 + * @class CKEDITOR.plugins.clipboard.dataTransfer + * @constructor Creates a class instance. + * @param {Object} [nativeDataTransfer] A native data transfer object. + * @param {CKEDITOR.editor} [editor] The source editor instance. If the editor is defined, dataValue will + * be created based on the editor content and the type will be 'html'. + */ + CKEDITOR.plugins.clipboard.dataTransfer = function( nativeDataTransfer, editor ) { + if ( nativeDataTransfer ) { + this.$ = nativeDataTransfer; + } + + this._ = { + metaRegExp: /^/i, + bodyRegExp: /([\s\S]*)<\/body>/i, + fragmentRegExp: //g, + + data: {}, + files: [], + + normalizeType: function( type ) { + type = type.toLowerCase(); + + if ( type == 'text' || type == 'text/plain' ) { + return 'Text'; // IE support only Text and URL; + } else if ( type == 'url' ) { + return 'URL'; // IE support only Text and URL; + } else { + return type; + } + } + }; + + // Check if ID is already created. + this.id = this.getData( clipboardIdDataType ); + + // If there is no ID we need to create it. Different browsers needs different ID. + if ( !this.id ) { + if ( clipboardIdDataType == 'Text' ) { + // For IE10+ only Text data type is supported and we have to compare dragged + // and dropped text. If the ID is not set it means that empty string was dragged + // (ex. image with no alt). We change null to empty string. + this.id = ''; + } else { + // String for custom data type. + this.id = 'cke-' + CKEDITOR.tools.getUniqueId(); + } + } + + // In IE10+ we can not use any data type besides text, so we do not call setData. + if ( clipboardIdDataType != 'Text' ) { + // Try to set ID so it will be passed from the drag to the drop event. + // On some browsers with some event it is not possible to setData so we + // need to catch exceptions. + try { + this.$.setData( clipboardIdDataType, this.id ); + } catch ( err ) {} + } + + if ( editor ) { + this.sourceEditor = editor; + + this.setData( 'text/html', editor.getSelectedHtml( 1 ) ); + + // Without setData( 'text', ... ) on dragstart there is no drop event in Safari. + // Also 'text' data is empty as drop to the textarea does not work if we do not put there text. + if ( clipboardIdDataType != 'Text' && !this.getData( 'text/plain' ) ) { + this.setData( 'text/plain', editor.getSelection().getSelectedText() ); + } + } + + /** + * Data transfer ID used to bind all dataTransfer + * objects based on the same event (e.g. in drag and drop events). + * + * @readonly + * @property {String} id + */ + + /** + * A native DOM event object. + * + * @readonly + * @property {Object} $ + */ + + /** + * Source editor — the editor where the drag starts. + * Might be undefined if the drag starts outside the editor (e.g. when dropping files to the editor). + * + * @readonly + * @property {CKEDITOR.editor} sourceEditor + */ + + /** + * Private properties and methods. + * + * @private + * @property {Object} _ + */ + }; + + /** + * Data transfer operation (drag and drop or copy and paste) started and ended in the same + * editor instance. + * + * @since 4.5 + * @readonly + * @property {Number} [=1] + * @member CKEDITOR + */ + CKEDITOR.DATA_TRANSFER_INTERNAL = 1; + + /** + * Data transfer operation (drag and drop or copy and paste) started in one editor + * instance and ended in another. + * + * @since 4.5 + * @readonly + * @property {Number} [=2] + * @member CKEDITOR + */ + CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2; + + /** + * Data transfer operation (drag and drop or copy and paste) started outside of the editor. + * The source of the data may be a textarea, HTML, another application, etc. + * + * @since 4.5 + * @readonly + * @property {Number} [=3] + * @member CKEDITOR + */ + CKEDITOR.DATA_TRANSFER_EXTERNAL = 3; + + CKEDITOR.plugins.clipboard.dataTransfer.prototype = { + /** + * Facade for the native `getData` method. + * + * @param {String} type The type of data to retrieve. + * @param {Boolean} [getNative=false] Indicates if the whole, original content of the dataTransfer should be returned. + * Introduced in CKEditor 4.7.0. + * @returns {String} type Stored data for the given type or an empty string if the data for that type does not exist. + */ + getData: function( type, getNative ) { + function isEmpty( data ) { + return data === undefined || data === null || data === ''; + } + + function filterUnwantedCharacters( data ) { + if ( typeof data !== 'string' ) { + return data; + } + + var htmlEnd = data.indexOf( '' ); + + if ( htmlEnd !== -1 ) { + // Just cut everything after ``, so everything after htmlEnd index + length of ``. + // Required to workaround bug: https://bugs.chromium.org/p/chromium/issues/detail?id=696978 + return data.substring( 0, htmlEnd + 7 ); + } + + return data; + } + + type = this._.normalizeType( type ); + + var data = this._.data[ type ], + result; + + if ( isEmpty( data ) ) { + try { + data = this.$.getData( type ); + } catch ( e ) {} + } + + if ( isEmpty( data ) ) { + data = ''; + } + + // Some browsers add at the begging of the HTML data + // or surround it with ...(some content) and (some content) + // This code removes meta tags and returns only the contents of the element if found. Note that + // some significant content may be placed outside Start/EndFragment comments so it's kept. + // + // See http://dev.ckeditor.com/ticket/13583 for more details. + // Additionally http://dev.ckeditor.com/ticket/16847 adds a flag allowing to get the whole, original content. + if ( type == 'text/html' && !getNative ) { + data = data.replace( this._.metaRegExp, '' ); + + // Keep only contents of the element + result = this._.bodyRegExp.exec( data ); + if ( result && result.length ) { + data = result[ 1 ]; + + // Remove also comments. + data = data.replace( this._.fragmentRegExp, '' ); + } + } + // Firefox on Linux put files paths as a text/plain data if there are files + // in the dataTransfer object. We need to hide it, because files should be + // handled on paste only if dataValue is empty. + else if ( type == 'Text' && CKEDITOR.env.gecko && this.getFilesCount() && + data.substring( 0, 7 ) == 'file://' ) { + data = ''; + } + + return filterUnwantedCharacters( data ); + }, + + /** + * Facade for the native `setData` method. + * + * @param {String} type The type of data to retrieve. + * @param {String} value The data to add. + */ + setData: function( type, value ) { + type = this._.normalizeType( type ); + + this._.data[ type ] = value; + + // There is "Unexpected call to method or property access." error if you try + // to set data of unsupported type on IE. + if ( !CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && type != 'URL' && type != 'Text' ) { + return; + } + + // If we use the text type to bind the ID, then if someone tries to set the text, we must also + // update ID accordingly. http://dev.ckeditor.com/ticket/13468. + if ( clipboardIdDataType == 'Text' && type == 'Text' ) { + this.id = value; + } + + try { + this.$.setData( type, value ); + } catch ( e ) {} + }, + + /** + * Gets the data transfer type. + * + * @param {CKEDITOR.editor} targetEditor The drop/paste target editor instance. + * @returns {Number} Possible values: {@link CKEDITOR#DATA_TRANSFER_INTERNAL}, + * {@link CKEDITOR#DATA_TRANSFER_CROSS_EDITORS}, {@link CKEDITOR#DATA_TRANSFER_EXTERNAL}. + */ + getTransferType: function( targetEditor ) { + if ( !this.sourceEditor ) { + return CKEDITOR.DATA_TRANSFER_EXTERNAL; + } else if ( this.sourceEditor == targetEditor ) { + return CKEDITOR.DATA_TRANSFER_INTERNAL; + } else { + return CKEDITOR.DATA_TRANSFER_CROSS_EDITORS; + } + }, + + /** + * Copies the data from the native data transfer to a private cache. + * This function is needed because the data from the native data transfer + * is available only synchronously to the event listener. It is not possible + * to get the data asynchronously, after a timeout, and the {@link CKEDITOR.editor#paste} + * event is fired asynchronously — hence the need for caching the data. + */ + cacheData: function() { + if ( !this.$ ) { + return; + } + + var that = this, + i, file; + + function getAndSetData( type ) { + type = that._.normalizeType( type ); + + var data = that.getData( type, true ); + if ( data ) { + that._.data[ type ] = data; + } + } + + // Copy data. + if ( CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ) { + if ( this.$.types ) { + for ( i = 0; i < this.$.types.length; i++ ) { + getAndSetData( this.$.types[ i ] ); + } + } + } else { + getAndSetData( 'Text' ); + getAndSetData( 'URL' ); + } + + // Copy files references. + file = this._getImageFromClipboard(); + if ( ( this.$ && this.$.files ) || file ) { + this._.files = []; + + // Edge have empty files property with no length (http://dev.ckeditor.com/ticket/13755). + if ( this.$.files && this.$.files.length ) { + for ( i = 0; i < this.$.files.length; i++ ) { + this._.files.push( this.$.files[ i ] ); + } + } + + // Don't include $.items if both $.files and $.items contains files, because, + // according to spec and browsers behavior, they contain the same files. + if ( this._.files.length === 0 && file ) { + this._.files.push( file ); + } + } + }, + + /** + * Gets the number of files in the dataTransfer object. + * + * @returns {Number} The number of files. + */ + getFilesCount: function() { + if ( this._.files.length ) { + return this._.files.length; + } + + if ( this.$ && this.$.files && this.$.files.length ) { + return this.$.files.length; + } + + return this._getImageFromClipboard() ? 1 : 0; + }, + + /** + * Gets the file at the index given. + * + * @param {Number} i Index. + * @returns {File} File instance. + */ + getFile: function( i ) { + if ( this._.files.length ) { + return this._.files[ i ]; + } + + if ( this.$ && this.$.files && this.$.files.length ) { + return this.$.files[ i ]; + } + + // File or null if the file was not found. + return i === 0 ? this._getImageFromClipboard() : undefined; + }, + + /** + * Checks if the data transfer contains any data. + * + * @returns {Boolean} `true` if the object contains no data. + */ + isEmpty: function() { + var typesToCheck = {}, + type; + + // If dataTransfer contains files it is not empty. + if ( this.getFilesCount() ) { + return false; + } + + // Add custom types. + for ( type in this._.data ) { + typesToCheck[ type ] = 1; + } + + // Add native types. + if ( this.$ ) { + if ( CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ) { + if ( this.$.types ) { + for ( var i = 0; i < this.$.types.length; i++ ) { + typesToCheck[ this.$.types[ i ] ] = 1; + } + } + } else { + typesToCheck.Text = 1; + typesToCheck.URL = 1; + } + } + + // Remove ID. + if ( clipboardIdDataType != 'Text' ) { + typesToCheck[ clipboardIdDataType ] = 0; + } + + for ( type in typesToCheck ) { + if ( typesToCheck[ type ] && this.getData( type ) !== '' ) { + return false; + } + } + + return true; + }, + + /** + * When the content of the clipboard is pasted in Chrome, the clipboard data object has an empty `files` property, + * but it is possible to get the file as `items[0].getAsFile();` (http://dev.ckeditor.com/ticket/12961). + * + * @private + * @returns {File} File instance or `null` if not found. + */ + _getImageFromClipboard: function() { + var file; + + if ( this.$ && this.$.items && this.$.items[ 0 ] ) { + try { + file = this.$.items[ 0 ].getAsFile(); + // Duck typing + if ( file && file.type ) { + return file; + } + } catch ( err ) { + // noop + } + } + + return undefined; + } + }; +} )(); + +/** + * The default content type that is used when pasted data cannot be clearly recognized as HTML or text. + * + * For example: `'foo'` may come from a plain text editor or a website. It is not possible to recognize the content + * type in this case, so the default type will be used. At the same time it is clear that `'example text'` is + * HTML and its origin is a web page, email or another rich text editor. + * + * **Note:** If content type is text, then styles of the paste context are preserved. + * + * CKEDITOR.config.clipboard_defaultContentType = 'text'; + * + * See also the {@link CKEDITOR.editor#paste} event and read more about the integration with clipboard + * in the [Clipboard Deep Dive guide](#!/guide/dev_clipboard). + * + * @since 4.0 + * @cfg {'html'/'text'} [clipboard_defaultContentType='html'] + * @member CKEDITOR.config + */ + +/** + * Fired after the user initiated a paste action, but before the data is inserted into the editor. + * The listeners to this event are able to process the content before its insertion into the document. + * + * Read more about the integration with clipboard in the [Clipboard Deep Dive guide](#!/guide/dev_clipboard). + * + * See also: + * + * * the {@link CKEDITOR.config#pasteFilter} option, + * * the {@link CKEDITOR.editor#drop} event, + * * the {@link CKEDITOR.plugins.clipboard.dataTransfer} class. + * + * @since 3.1 + * @event paste + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param data + * @param {String} data.type The type of data in `data.dataValue`. Usually `'html'` or `'text'`, but for listeners + * with a priority smaller than `6` it may also be `'auto'` which means that the content type has not been recognised yet + * (this will be done by the content type sniffer that listens with priority `6`). + * @param {String} data.dataValue HTML to be pasted. + * @param {String} data.method Indicates the data transfer method. It could be drag and drop or copy and paste. + * Possible values: `'drop'`, `'paste'`. Introduced in CKEditor 4.5. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} data.dataTransfer Facade for the native dataTransfer object + * which provides access to various data types and files, and passes some data between linked events + * (like drag and drop). Introduced in CKEditor 4.5. + * @param {Boolean} [data.dontFilter=false] Whether the {@link CKEDITOR.editor#pasteFilter paste filter} should not + * be applied to data. This option has no effect when `data.type` equals `'text'` which means that for instance + * {@link CKEDITOR.config#forcePasteAsPlainText} has a higher priority. Introduced in CKEditor 4.5. + */ + +/** + * Fired before the {@link #paste} event. Allows to preset data type. + * + * **Note:** This event is deprecated. Add a `0` priority listener for the + * {@link #paste} event instead. + * + * @deprecated + * @event beforePaste + * @member CKEDITOR.editor + */ + +/** + * Fired after the {@link #paste} event if content was modified. Note that if the paste + * event does not insert any data, the `afterPaste` event will not be fired. + * + * @event afterPaste + * @member CKEDITOR.editor + */ + +/** + * Facade for the native `drop` event. Fired when the native `drop` event occurs. + * + * **Note:** To manipulate dropped data, use the {@link CKEDITOR.editor#paste} event. + * Use the `drop` event only to control drag and drop operations (e.g. to prevent the ability to drop some content). + * + * Read more about integration with drag and drop in the [Clipboard Deep Dive guide](#!/guide/dev_clipboard). + * + * See also: + * + * * The {@link CKEDITOR.editor#paste} event, + * * The {@link CKEDITOR.editor#dragstart} and {@link CKEDITOR.editor#dragend} events, + * * The {@link CKEDITOR.plugins.clipboard.dataTransfer} class. + * + * @since 4.5 + * @event drop + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param data + * @param {Object} data.$ Native drop event. + * @param {CKEDITOR.dom.node} data.target Drop target. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} data.dataTransfer DataTransfer facade. + * @param {CKEDITOR.dom.range} data.dragRange Drag range, lets you manipulate the drag range. + * Note that dragged HTML is saved as `text/html` data on `dragstart` so if you change the drag range + * on drop, dropped HTML will not change. You need to change it manually using + * {@link CKEDITOR.plugins.clipboard.dataTransfer#setData dataTransfer.setData}. + * @param {CKEDITOR.dom.range} data.dropRange Drop range, lets you manipulate the drop range. + */ + +/** + * Facade for the native `dragstart` event. Fired when the native `dragstart` event occurs. + * + * This event can be canceled in order to block the drag start operation. It can also be fired to mimic the start of the drag and drop + * operation. For instance, the `widget` plugin uses this option to integrate its custom block widget drag and drop with + * the entire system. + * + * Read more about integration with drag and drop in the [Clipboard Deep Dive guide](#!/guide/dev_clipboard). + * + * See also: + * + * * The {@link CKEDITOR.editor#paste} event, + * * The {@link CKEDITOR.editor#drop} and {@link CKEDITOR.editor#dragend} events, + * * The {@link CKEDITOR.plugins.clipboard.dataTransfer} class. + * + * @since 4.5 + * @event dragstart + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param data + * @param {Object} data.$ Native dragstart event. + * @param {CKEDITOR.dom.node} data.target Drag target. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} data.dataTransfer DataTransfer facade. + */ + +/** + * Facade for the native `dragend` event. Fired when the native `dragend` event occurs. + * + * Read more about integration with drag and drop in the [Clipboard Deep Dive guide](#!/guide/dev_clipboard). + * + * See also: + * + * * The {@link CKEDITOR.editor#paste} event, + * * The {@link CKEDITOR.editor#drop} and {@link CKEDITOR.editor#dragend} events, + * * The {@link CKEDITOR.plugins.clipboard.dataTransfer} class. + * + * @since 4.5 + * @event dragend + * @member CKEDITOR.editor + * @param {CKEDITOR.editor} editor This editor instance. + * @param data + * @param {Object} data.$ Native dragend event. + * @param {CKEDITOR.dom.node} data.target Drag target. + * @param {CKEDITOR.plugins.clipboard.dataTransfer} data.dataTransfer DataTransfer facade. + */ + +/** + * Defines a filter which is applied to external data pasted or dropped into the editor. Possible values are: + * + * * `'plain-text'` – Content will be pasted as a plain text. + * * `'semantic-content'` – Known tags (except `div`, `span`) with all attributes (except + * `style` and `class`) will be kept. + * * `'h1 h2 p div'` – Custom rules compatible with {@link CKEDITOR.filter}. + * * `null` – Content will not be filtered by the paste filter (but it still may be filtered + * by [Advanced Content Filter](#!/guide/dev_advanced_content_filter)). This value can be used to + * disable the paste filter in Chrome and Safari, where this option defaults to `'semantic-content'`. + * + * Example: + * + * config.pasteFilter = 'plain-text'; + * + * Custom setting: + * + * config.pasteFilter = 'h1 h2 p ul ol li; img[!src, alt]; a[!href]'; + * + * Based on this configuration option, a proper {@link CKEDITOR.filter} instance will be defined and assigned to the editor + * as a {@link CKEDITOR.editor#pasteFilter}. You can tweak the paste filter settings on the fly on this object + * as well as delete or replace it. + * + * var editor = CKEDITOR.replace( 'editor', { + * pasteFilter: 'semantic-content' + * } ); + * + * editor.on( 'instanceReady', function() { + * // The result of this will be that all semantic content will be preserved + * // except tables. + * editor.pasteFilter.disallow( 'table' ); + * } ); + * + * Note that the paste filter is applied only to **external** data. There are three data sources: + * + * * copied and pasted in the same editor (internal), + * * copied from one editor and pasted into another (cross-editor), + * * coming from all other sources like websites, MS Word, etc. (external). + * + * If {@link CKEDITOR.config#allowedContent Advanced Content Filter} is not disabled, then + * it will also be applied to pasted and dropped data. The paste filter job is to "normalize" + * external data which often needs to be handled differently than content produced by the editor. + * + * This setting defaults to `'semantic-content'` in Chrome, Opera and Safari (all Blink and Webkit based browsers) + * due to messy HTML which these browsers keep in the clipboard. In other browsers it defaults to `null`. + * + * @since 4.5 + * @cfg {String} [pasteFilter='semantic-content' in Chrome and Safari and `null` in other browsers] + * @member CKEDITOR.config + */ + +/** + * {@link CKEDITOR.filter Content filter} which is used when external data is pasted or dropped into the editor + * or a forced paste as plain text occurs. + * + * This object might be used on the fly to define rules for pasted external content. + * This object is available and used if the {@link CKEDITOR.plugins.clipboard clipboard} plugin is enabled and + * {@link CKEDITOR.config#pasteFilter} or {@link CKEDITOR.config#forcePasteAsPlainText} was defined. + * + * To enable the filter: + * + * var editor = CKEDITOR.replace( 'editor', { + * pasteFilter: 'plain-text' + * } ); + * + * You can also modify the filter on the fly later on: + * + * editor.pasteFilter = new CKEDITOR.filter( 'p h1 h2; a[!href]' ); + * + * Note that the paste filter is only applied to **external** data. There are three data sources: + * + * * copied and pasted in the same editor (internal), + * * copied from one editor and pasted into another (cross-editor), + * * coming from all other sources like websites, MS Word, etc. (external). + * + * If {@link CKEDITOR.config#allowedContent Advanced Content Filter} is not disabled, then + * it will also be applied to pasted and dropped data. The paste filter job is to "normalize" + * external data which often needs to be handled differently than content produced by the editor. + * + * @since 4.5 + * @readonly + * @property {CKEDITOR.filter} [pasteFilter] + * @member CKEDITOR.editor + */ + +/** + * Duration of the notification displayed after pasting was blocked by the browser. + * + * @since 4.7.0 + * @cfg {Number} [clipboard_notificationDuration=10000] + * @member CKEDITOR.config + */ +CKEDITOR.config.clipboard_notificationDuration = 10000; diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/dialogs/codesnippet.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/dialogs/codesnippet.js new file mode 100644 index 0000000..a080cfb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/dialogs/codesnippet.js @@ -0,0 +1,83 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +'use strict'; + +( function() { + CKEDITOR.dialog.add( 'codeSnippet', function( editor ) { + var snippetLangs = editor._.codesnippet.langs, + lang = editor.lang.codesnippet, + clientHeight = document.documentElement.clientHeight, + langSelectItems = [], + snippetLangId; + + langSelectItems.push( [ editor.lang.common.notSet, '' ] ); + + for ( snippetLangId in snippetLangs ) + langSelectItems.push( [ snippetLangs[ snippetLangId ], snippetLangId ] ); + + // Size adjustments. + var size = CKEDITOR.document.getWindow().getViewPaneSize(), + // Make it maximum 800px wide, but still fully visible in the viewport. + width = Math.min( size.width - 70, 800 ), + // Make it use 2/3 of the viewport height. + height = size.height / 1.5; + + // Low resolution settings. + if ( clientHeight < 650 ) { + height = clientHeight - 220; + } + + return { + title: lang.title, + minHeight: 200, + resizable: CKEDITOR.DIALOG_RESIZE_NONE, + contents: [ + { + id: 'info', + elements: [ + { + id: 'lang', + type: 'select', + label: lang.language, + items: langSelectItems, + setup: function( widget ) { + if ( widget.ready && widget.data.lang ) + this.setValue( widget.data.lang ); + + // The only way to have an empty select value in Firefox is + // to set a negative selectedIndex. + if ( CKEDITOR.env.gecko && ( !widget.data.lang || !widget.ready ) ) + this.getInputElement().$.selectedIndex = -1; + }, + commit: function( widget ) { + widget.setData( 'lang', this.getValue() ); + } + }, + { + id: 'code', + type: 'textarea', + label: lang.codeContents, + setup: function( widget ) { + this.setValue( widget.data.code ); + }, + commit: function( widget ) { + widget.setData( 'code', this.getValue() ); + }, + required: true, + validate: CKEDITOR.dialog.validate.notEmpty( lang.emptySnippetError ), + inputStyle: 'cursor:auto;' + + 'width:' + width + 'px;' + + 'height:' + height + 'px;' + + 'tab-size:4;' + + 'text-align:left;', + 'class': 'cke_source' + } + ] + } + ] + }; + } ); +}() ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/codesnippet.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/codesnippet.png new file mode 100644 index 0000000..c718510 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/codesnippet.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/hidpi/codesnippet.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/hidpi/codesnippet.png new file mode 100644 index 0000000..2de477f Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/icons/hidpi/codesnippet.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ar.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ar.js new file mode 100644 index 0000000..179f8e8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ar.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ar', { + button: 'أدمج قصاصة الشيفرة', + codeContents: 'محتوى الشيفرة', + emptySnippetError: 'قصاصة الشيفرة لايمكن أن تكون فارغة.', + language: 'لغة', + title: 'قصاصة الشيفرة', + pathName: 'قصاصة الشيفرة' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/az.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/az.js new file mode 100644 index 0000000..32b783b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/az.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'az', { + button: 'Kodun parçasını əlavə et', + codeContents: 'Kod', + emptySnippetError: 'Kodun parçasını boş ola bilməz', + language: 'Programlaşdırma dili', + title: 'Kodun parçasını', + pathName: 'kodun parçasını' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/bg.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/bg.js new file mode 100644 index 0000000..60ad415 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/bg.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'bg', { + button: 'Въвеждане на блок с код', + codeContents: 'Съдържание на кода', + emptySnippetError: 'Блока с код не може да бъде празен.', + language: 'Език', + title: 'Блок с код', + pathName: 'блок с код' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ca.js new file mode 100644 index 0000000..4df13d2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ca.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ca', { + button: 'Insereix el fragment de codi', + codeContents: 'Contingut del codi', + emptySnippetError: 'El fragment de codi no pot estar buit.', + language: 'Idioma', + title: 'Fragment de codi', + pathName: 'fragment de codi' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/cs.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/cs.js new file mode 100644 index 0000000..d1339a6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/cs.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'cs', { + button: 'Vložit úryvek kódu', + codeContents: 'Obsah kódu', + emptySnippetError: 'Úryvek kódu nemůže být prázdný.', + language: 'Jazyk', + title: 'Úryvek kódu', + pathName: 'úryvek kódu' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/da.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/da.js new file mode 100644 index 0000000..4bd8e1d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/da.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'da', { + button: 'Indsæt kodestykket her', + codeContents: 'Koden', + emptySnippetError: 'Kodestykket kan ikke være tomt.', + language: 'Sprog', + title: 'Kodestykke', + pathName: 'kodestykke' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de-ch.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de-ch.js new file mode 100644 index 0000000..ba21cbb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de-ch.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'de-ch', { + button: 'Codeschnipsel einfügen', + codeContents: 'Codeinhalt', + emptySnippetError: 'Ein Codeschnipsel darf nicht leer sein.', + language: 'Sprache', + title: 'Codeschnipsel', + pathName: 'Codeschnipsel' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de.js new file mode 100644 index 0000000..1debe80 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/de.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'de', { + button: 'Codeschnipsel einfügen', + codeContents: 'Codeinhalt', + emptySnippetError: 'Ein Codeschnipsel darf nicht leer sein.', + language: 'Sprache', + title: 'Codeschnipsel', + pathName: 'Codeschnipsel' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/el.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/el.js new file mode 100644 index 0000000..1398ae9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/el.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'el', { + button: 'Εισαγωγή Αποσπάσματος Κώδικα', + codeContents: 'Περιεχόμενο κώδικα', + emptySnippetError: 'Δεν γίνεται να είναι κενά τα αποσπάσματα κώδικα.', + language: 'Γλώσσα', + title: 'Απόσπασμα κώδικα', + pathName: 'απόσπασμα κώδικα' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en-gb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en-gb.js new file mode 100644 index 0000000..53518b2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en-gb.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'en-gb', { + button: 'Insert Code Snippet', + codeContents: 'Code content', + emptySnippetError: 'A code snippet cannot be empty.', + language: 'Language', + title: 'Code snippet', + pathName: 'code snippet' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en.js new file mode 100644 index 0000000..46085a5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/en.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'en', { + button: 'Insert Code Snippet', + codeContents: 'Code content', + emptySnippetError: 'A code snippet cannot be empty.', + language: 'Language', + title: 'Code snippet', + pathName: 'code snippet' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eo.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eo.js new file mode 100644 index 0000000..6df1350 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eo.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'eo', { + button: 'Enmeti kodaĵeron', + codeContents: 'Kodenhavo', + emptySnippetError: 'Kodaĵero ne povas esti malplena.', + language: 'Lingvo', + title: 'Kodaĵero', + pathName: 'kodaĵero' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es-mx.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es-mx.js new file mode 100644 index 0000000..9971f1a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es-mx.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'es-mx', { + button: 'Insertar fragmento de código', + codeContents: 'Contenido del código', + emptySnippetError: 'Un fragmento de código no puede estar vacio.', + language: 'Idioma', + title: 'Fragmento de código', + pathName: 'fragmento de código' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es.js new file mode 100644 index 0000000..0508b15 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/es.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'es', { + button: 'Insertar fragmento de código', + codeContents: 'Contenido del código', + emptySnippetError: 'Un fragmento de código no puede estar vacío.', + language: 'Lenguaje', + title: 'Fragmento de código', + pathName: 'fragmento de código' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/et.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/et.js new file mode 100644 index 0000000..6acc460 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/et.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'et', { + button: 'Koodilõigu sisestamine', + codeContents: 'Code content', // MISSING + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Language', // MISSING + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eu.js new file mode 100644 index 0000000..e91cfdf --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/eu.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'eu', { + button: 'Txertatu kode zatia', + codeContents: 'Kode edukia', + emptySnippetError: 'Kode zatiak ezin du hutsik egon.', + language: 'Lengoaia', + title: 'Kode zatia', + pathName: 'kode zatia' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fa.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fa.js new file mode 100644 index 0000000..3189c36 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fa.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'fa', { + button: 'قرار دادن کد قطعه', + codeContents: 'محتوای کد', + emptySnippetError: 'کد نمی تواند خالی باشد.', + language: 'زبان', + title: 'کد قطعه', + pathName: 'کد قطعه' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fi.js new file mode 100644 index 0000000..cd34753 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fi.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'fi', { + button: 'Lisää koodileike', + codeContents: 'Koodisisältö', + emptySnippetError: 'Koodileike ei voi olla tyhjä.', + language: 'Kieli', + title: 'Koodileike', + pathName: 'koodileike' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr-ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr-ca.js new file mode 100644 index 0000000..08983f3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr-ca.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'fr-ca', { + button: 'Insérer du code', + codeContents: 'Code content', // MISSING + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Language', // MISSING + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr.js new file mode 100644 index 0000000..cf8d792 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/fr.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'fr', { + button: 'Insérer un extrait de code', + codeContents: 'Code', + emptySnippetError: 'Un extrait de code ne peut pas être vide.', + language: 'Langue', + title: 'Extrait de code', + pathName: 'extrait de code' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/gl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/gl.js new file mode 100644 index 0000000..893a18d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/gl.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'gl', { + button: 'Inserir fragmento de código', + codeContents: 'Contido do código', + emptySnippetError: 'Un fragmento de código non pode estar baleiro.', + language: 'Linguaxe', + title: 'Fragmento de código', + pathName: 'fragmento de código' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/he.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/he.js new file mode 100644 index 0000000..002bb33 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/he.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'he', { + button: 'הכנס קטע קוד', + codeContents: 'תוכן קוד', + emptySnippetError: 'קטע קוד לא יכול להיות ריק.', + language: 'שפה', + title: 'קטע קוד', + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hr.js new file mode 100644 index 0000000..d168364 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hr.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'hr', { + button: 'Ubaci isječak kôda', + codeContents: 'Sadržaj kôda', + emptySnippetError: 'Isječak kôda ne može biti prazan.', + language: 'Jezik', + title: 'Isječak kôda', + pathName: 'isječak kôda' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hu.js new file mode 100644 index 0000000..9472bb0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/hu.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'hu', { + button: 'Illeszd be a kódtöredéket', + codeContents: 'Kód tartalom', + emptySnippetError: 'A kódtöredék nem lehet üres.', + language: 'Nyelv', + title: 'Kódtöredék', + pathName: 'kódtöredék' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/id.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/id.js new file mode 100644 index 0000000..e9a7e48 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/id.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'id', { + button: 'Masukkan potongan kode', + codeContents: 'Konten kode', + emptySnippetError: 'Potongan kode tidak boleh kosong', + language: 'Bahasa', + title: 'Potongan kode', + pathName: 'potongan kode' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/it.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/it.js new file mode 100644 index 0000000..6658a09 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/it.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'it', { + button: 'Inserisci frammento di codice', + codeContents: 'Contenuto del codice', + emptySnippetError: 'Un frammento di codice non può essere vuoto.', + language: 'Lingua', + title: 'Frammento di codice', + pathName: 'frammento di codice' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ja.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ja.js new file mode 100644 index 0000000..aac181d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ja.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ja', { + button: 'コードスニペットを挿入', + codeContents: 'コード内容', + emptySnippetError: 'コードスニペットを入力してください。', + language: '言語', + title: 'コードスニペット', + pathName: 'コードスニペット' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/km.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/km.js new file mode 100644 index 0000000..42abe5f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/km.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'km', { + button: 'Insert Code Snippet', // MISSING + codeContents: 'មាតិកាកូដ', + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'ភាសា', + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ko.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ko.js new file mode 100644 index 0000000..0ca4575 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ko.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ko', { + button: '코드 스니펫 삽입', + codeContents: '코드 본문', + emptySnippetError: '코드 스니펫은 빈칸일 수 없습니다.', + language: '언어', + title: '코드 스니펫', + pathName: '코드 스니펫' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ku.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ku.js new file mode 100644 index 0000000..ce95048 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ku.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ku', { + button: 'تێخستنی تیتکی کۆد', + codeContents: 'ناوەڕۆکی کۆد', + emptySnippetError: 'تیتکی کۆد نابێت بەتاڵ بێت.', + language: 'زمان', + title: 'تیتکی کۆد', + pathName: 'تیتکی کۆد' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lt.js new file mode 100644 index 0000000..49534bb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lt.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'lt', { + button: 'Įterpkite kodo gabaliuką', + codeContents: 'Kodo turinys', + emptySnippetError: 'Kodo fragmentas negali būti tusčias.', + language: 'Kalba', + title: 'Kodo fragmentas', + pathName: 'kodo fragmentas' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lv.js new file mode 100644 index 0000000..0ada3ec --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/lv.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'lv', { + button: 'Ievietot koda fragmentu', + codeContents: 'Code content', // MISSING + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Language', // MISSING + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nb.js new file mode 100644 index 0000000..f6205c4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nb.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'nb', { + button: 'Sett inn kodesnutt', + codeContents: 'Kodeinnhold', + emptySnippetError: 'En kodesnutt kan ikke være tom.', + language: 'Språk', + title: 'Kodesnutt', + pathName: 'kodesnutt' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nl.js new file mode 100644 index 0000000..f9b451f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/nl.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'nl', { + button: 'Stuk code invoegen', + codeContents: 'Code', + emptySnippetError: 'Een stuk code kan niet leeg zijn.', + language: 'Taal', + title: 'Stuk code', + pathName: 'stuk code' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/no.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/no.js new file mode 100644 index 0000000..4cb02cb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/no.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'no', { + button: 'Sett inn kodesnutt', + codeContents: 'Code content', // MISSING + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Language', // MISSING + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/oc.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/oc.js new file mode 100644 index 0000000..2a9324d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/oc.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'oc', { + button: 'Inserir un extrait de còdi', + codeContents: 'Còdi', + emptySnippetError: 'Un extrait de còdi pòt pas èsser void.', + language: 'Lenga', + title: 'Extrait de còdi', + pathName: 'extrait de còdi' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pl.js new file mode 100644 index 0000000..0f45881 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pl.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'pl', { + button: 'Wstaw fragment kodu', + codeContents: 'Treść kodu', + emptySnippetError: 'Kod nie może być pusty.', + language: 'Język', + title: 'Fragment kodu', + pathName: 'fragment kodu' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt-br.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt-br.js new file mode 100644 index 0000000..2429441 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt-br.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'pt-br', { + button: 'Inserir fragmento de código', + codeContents: 'Conteúdo do código', + emptySnippetError: 'Um fragmento de código não pode ser vazio', + language: 'Idioma', + title: 'Fragmento de código', + pathName: 'fragmento de código' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt.js new file mode 100644 index 0000000..b7fb06f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/pt.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'pt', { + button: 'Inserir fragmento de código', + codeContents: 'Conteúdo do código', + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Idioma', + title: 'Segmento de código', + pathName: 'Fragmento de código' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ro.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ro.js new file mode 100644 index 0000000..bfb152e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ro.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ro', { + button: 'Adaugă segment de cod', + codeContents: 'Conținutul codului', + emptySnippetError: 'Un segment de cod nu poate fi gol.', + language: 'Limba', + title: 'Segment de cod', + pathName: 'segment de cod' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ru.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ru.js new file mode 100644 index 0000000..43ece7f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ru.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ru', { + button: 'Вставить сниппет', + codeContents: 'Содержимое кода', + emptySnippetError: 'Сниппет не может быть пустым', + language: 'Язык', + title: 'Сниппет', + pathName: 'сниппет' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sk.js new file mode 100644 index 0000000..aeba103 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sk.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'sk', { + button: 'Vložte ukážku programového kódu', + codeContents: 'Obsah kódu', + emptySnippetError: 'Ukážka kódu nesmie byť prázdna.', + language: 'Jazyk', + title: 'Ukážka programového kódu', + pathName: 'ukážka programového kódu' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sl.js new file mode 100644 index 0000000..672c92f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sl.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'sl', { + button: 'Vstavi odsek kode', + codeContents: 'Vsebina kode', + emptySnippetError: 'Odsek kode ne more biti prazen.', + language: 'Jezik', + title: 'Odsek kode', + pathName: 'odsek kode' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sq.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sq.js new file mode 100644 index 0000000..53d5f8e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sq.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'sq', { + button: 'Shto kod copëze', + codeContents: 'Përmbajtja e kodit', + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Gjuha', + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sv.js new file mode 100644 index 0000000..600275a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/sv.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'sv', { + button: 'Infoga kodsnutt', + codeContents: 'Kodinnehålll', + emptySnippetError: 'Innehåll krävs för kodsnutt', + language: 'Språk', + title: 'Kodsnutt', + pathName: 'kodsnutt' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/th.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/th.js new file mode 100644 index 0000000..06dbab1 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/th.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'th', { + button: 'แทรกชิ้นส่วนของรหัสหรือโค้ด', + codeContents: 'Code content', // MISSING + emptySnippetError: 'A code snippet cannot be empty.', // MISSING + language: 'Language', // MISSING + title: 'Code snippet', // MISSING + pathName: 'code snippet' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tr.js new file mode 100644 index 0000000..2a4082b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tr.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'tr', { + button: 'Kod parçacığı ekle', + codeContents: 'Kod', + emptySnippetError: 'Kod parçacığı boş bırakılamaz', + language: 'Dil', + title: 'Kod parçacığı', + pathName: 'kod parçacığı' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tt.js new file mode 100644 index 0000000..8fcdae2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/tt.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'tt', { + button: 'Код өзеген өстәү', + codeContents: 'Код эчтәлеге', + emptySnippetError: 'Код өзеге буш булмаска тиеш.', + language: 'Тел', + title: 'Код өзеге', + pathName: 'код өзеге' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ug.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ug.js new file mode 100644 index 0000000..989454b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/ug.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'ug', { + button: 'كود پارچىسى قىستۇرۇش', + codeContents: 'كود مەزمۇنى', + emptySnippetError: 'كود پارچىسى بوش قالمايدۇ', + language: 'تىل', + title: 'كود پارچىسى', + pathName: 'كود پارچىسى' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/uk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/uk.js new file mode 100644 index 0000000..da8c257 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/uk.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'uk', { + button: 'Вставити фрагмент коду', + codeContents: 'Код', + emptySnippetError: 'Фрагмент коду не можи бути порожнім.', + language: 'Мова', + title: 'Фрагмент коду', + pathName: 'фрагмент коду' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/vi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/vi.js new file mode 100644 index 0000000..eaac047 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/vi.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'vi', { + button: 'Chèn đoạn mã', + codeContents: 'Nội dung mã', + emptySnippetError: 'Một đoạn mã không thể để trống.', + language: 'Ngôn ngữ', + title: 'Đoạn mã', + pathName: 'mã dính' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh-cn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh-cn.js new file mode 100644 index 0000000..f608b39 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh-cn.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'zh-cn', { + button: '插入代码段', + codeContents: '代码内容', + emptySnippetError: '插入的代码不能为空。', + language: '代码语言', + title: '代码段', + pathName: '代码段' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh.js new file mode 100644 index 0000000..3f73388 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lang/zh.js @@ -0,0 +1,13 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +CKEDITOR.plugins.setLang( 'codesnippet', 'zh', { + button: '插入程式碼片段', + codeContents: '程式碼內容', + emptySnippetError: '程式碼片段不可為空白。', + language: '語言', + title: '程式碼片段', + pathName: '程式碼片段' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/CHANGES.md b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/CHANGES.md new file mode 100644 index 0000000..f878062 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/CHANGES.md @@ -0,0 +1,827 @@ +## Version 8.0 beta + +This new major release is quite a big overhaul bringing both new features and +some backwards incompatible changes. However, chances are that the majority of +users won't be affected by the latter: the basic scenario described in the +README is left intact. + +Here's what did change in an incompatible way: + +- We're now prefixing all classes located in [CSS classes reference][cr] with + `hljs-`, by default, because some class names would collide with other + people's stylesheets. If you were using an older version, you might still want + the previous behavior, but still want to upgrade. To suppress this new + behavior, you would initialize like so: + + ```html + + ``` + +- `tabReplace` and `useBR` that were used in different places are also unified + into the global options object and are to be set using `configure(options)`. + This function is documented in our [API docs][]. Also note that these + parameters are gone from `highlightBlock` and `fixMarkup` which are now also + rely on `configure`. + +- We removed public-facing (though undocumented) object `hljs.LANGUAGES` which + was used to register languages with the library in favor of two new methods: + `registerLanguage` and `getLanguage`. Both are documented in our [API docs][]. + +- Result returned from `highlight` and `highlightAuto` no longer contains two + separate attributes contributing to relevance score, `relevance` and + `keyword_count`. They are now unified in `relevance`. + +Another technically compatible change that nonetheless might need attention: + +- The structure of the NPM package was refactored, so if you had installed it + locally, you'll have to update your paths. The usual `require('highlight.js')` + works as before. This is contributed by [Dmitry Smolin][]. + +New features: + +- Languages now can be recognized by multiple names like "js" for JavaScript or + "html" for, well, HTML (which earlier insisted on calling it "xml"). These + aliases can be specified in the class attribute of the code container in your + HTML as well as in various API calls. For now there are only a few very common + aliases but we'll expand it in the future. All of them are listed in the + [class reference][]. + +- Language detection can now be restricted to a subset of languages relevant in + a given context — a web page or even a single highlighting call. This is + especially useful for node.js build that includes all the known languages. + Another example is a StackOverflow-style site where users specify languages + as tags rather than in the markdown-formatted code snippets. This is + documented in the [API reference][] (see methods `highlightAuto` and + `configure`). + +- Language definition syntax streamlined with [variants][] and + [beginKeywords][]. + +New languages and styles: + +- *Oxygene* by [Carlo Kok][] +- *Mathematica* by [Daniel Kvasnička][] +- *Autohotkey* by [Seongwon Lee][] +- *Atelier* family of styles in 10 variants by [Bram de Haan][] +- *Paraíso* styles by [Jan T. Sott][] + +Miscelleanous improvements: + +- Highlighting `=>` prompts in Clojure. +- [Jeremy Hull][] fixed a lot of styles for consistency. +- Finally, highlighting PHP and HTML [mixed in peculiar ways][php-html]. +- Objective C and C# now properly highlight titles in method definition. +- Big overhaul of relevance counting for a number of languages. Please do report + bugs about mis-detection of non-trivial code snippets! + +[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html +[api docs]: http://highlightjs.readthedocs.org/en/latest/api.html +[variants]: https://groups.google.com/d/topic/highlightjs/VoGC9-1p5vk/discussion +[beginKeywords]: https://github.com/isagalaev/highlight.js/commit/6c7fdea002eb3949577a85b3f7930137c7c3038d +[php-html]: https://twitter.com/highlightjs/status/408890903017689088 + +[Carlo Kok]: https://github.com/carlokok +[Bram de Haan]: https://github.com/atelierbram +[Daniel Kvasnička]: https://github.com/dkvasnicka +[Dmitry Smolin]: https://github.com/dimsmol +[Jeremy Hull]: https://github.com/sourrust +[Seongwon Lee]: https://github.com/dlimpid +[Jan T. Sott]: https://github.com/idleberg + + +## Version 7.5 + +A catch-up release dealing with some of the accumulated contributions. This one +is probably will be the last before the 8.0 which will be slightly backwards +incompatible regarding some advanced use-cases. + +One outstanding change in this version is the addition of 6 languages to the +[hosted script][d]: Markdown, ObjectiveC, CoffeeScript, Apache, Nginx and +Makefile. It now weighs about 6K more but we're going to keep it under 30K. + +New languages: + +- OCaml by [Mehdi Dogguy][mehdid] and [Nicolas Braud-Santoni][nbraud] +- [LiveCode Server][lcs] by [Ralf Bitter][revig] +- Scilab by [Sylvestre Ledru][sylvestre] +- basic support for Makefile by [Ivan Sagalaev][isagalaev] + +Improvements: + +- Ruby's got support for characters like `?A`, `?1`, `?\012` etc. and `%r{..}` + regexps. +- Clojure now allows a function call in the beginning of s-expressions + `(($filter "myCount") (arr 1 2 3 4 5))`. +- Haskell's got new keywords and now recognizes more things like pragmas, + preprocessors, modules, containers, FFIs etc. Thanks to [Zena Treep][treep] + for the implementation and to [Jeremy Hull][sourrust] for guiding it. +- Miscelleanous fixes in PHP, Brainfuck, SCSS, Asciidoc, CMake, Python and F#. + +[mehdid]: https://github.com/mehdid +[nbraud]: https://github.com/nbraud +[revig]: https://github.com/revig +[lcs]: http://livecode.com/developers/guides/server/ +[sylvestre]: https://github.com/sylvestre +[isagalaev]: https://github.com/isagalaev +[treep]: https://github.com/treep +[sourrust]: https://github.com/sourrust +[d]: http://highlightjs.org/download/ + + +## New core developers + +The latest long period of almost complete inactivity in the project coincided +with growing interest to it led to a decision that now seems completely obvious: +we need more core developers. + +So without further ado let me welcome to the core team two long-time +contributors: [Jeremy Hull][] and [Oleg +Efimov][]. + +Hope now we'll be able to work through stuff faster! + +P.S. The historical commit is [here][1] for the record. + +[Jeremy Hull]: https://github.com/sourrust +[Oleg Efimov]: https://github.com/sannis +[1]: https://github.com/isagalaev/highlight.js/commit/f3056941bda56d2b72276b97bc0dd5f230f2473f + + +## Version 7.4 + +This long overdue version is a snapshot of the current source tree with all the +changes that happened during the past year. Sorry for taking so long! + +Along with the changes in code highlight.js has finally got its new home at +, moving from its craddle on Software Maniacs which it +outgrew a long time ago. Be sure to report any bugs about the site to +. + +On to what's new… + +New languages: + +- Handlebars templates by [Robin Ward][] +- Oracle Rules Language by [Jason Jacobson][] +- F# by [Joans Follesø][] +- AsciiDoc and Haml by [Dan Allen][] +- Lasso by [Eric Knibbe][] +- SCSS by [Kurt Emch][] +- VB.NET by [Poren Chiang][] +- Mizar by [Kelley van Evert][] + +[Robin Ward]: https://github.com/eviltrout +[Jason Jacobson]: https://github.com/jayce7 +[Joans Follesø]: https://github.com/follesoe +[Dan Allen]: https://github.com/mojavelinux +[Eric Knibbe]: https://github.com/EricFromCanada +[Kurt Emch]: https://github.com/kemch +[Poren Chiang]: https://github.com/rschiang +[Kelley van Evert]: https://github.com/kelleyvanevert + +New style themes: + +- Monokai Sublime by [noformnocontent][] +- Railscasts by [Damien White][] +- Obsidian by [Alexander Marenin][] +- Docco by [Simon Madine][] +- Mono Blue by [Ivan Sagalaev][] (uses a single color hue for everything) +- Foundation by [Dan Allen][] + +[noformnocontent]: http://nn.mit-license.org/ +[Damien White]: https://github.com/visoft +[Alexander Marenin]: https://github.com/ioncreature +[Simon Madine]: https://github.com/thingsinjars +[Ivan Sagalaev]: https://github.com/isagalaev + +Other notable changes: + +- Corrected many corner cases in CSS. +- Dropped Python 2 version of the build tool. +- Implemented building for the AMD format. +- Updated Rust keywords (thanks to [Dmitry Medvinsky][]). +- Literal regexes can now be used in language definitions. +- CoffeeScript highlighting is now significantly more robust and rich due to + input from [Cédric Néhémie][]. + +[Dmitry Medvinsky]: https://github.com/dmedvinsky +[Cédric Néhémie]: https://github.com/abe33 + + +## Version 7.3 + +- Since this version highlight.js no longer works in IE version 8 and older. + It's made it possible to reduce the library size and dramatically improve code + readability and made it easier to maintain. Time to go forward! + +- New languages: AppleScript (by [Nathan Grigg][ng] and [Dr. Drang][dd]) and + Brainfuck (by [Evgeny Stepanischev][bolk]). + +- Improvements to existing languages: + + - interpreter prompt in Python (`>>>` and `...`) + - @-properties and classes in CoffeeScript + - E4X in JavaScript (by [Oleg Efimov][oe]) + - new keywords in Perl (by [Kirk Kimmel][kk]) + - big Ruby syntax update (by [Vasily Polovnyov][vast]) + - small fixes in Bash + +- Also Oleg Efimov did a great job of moving all the docs for language and style + developers and contributors from the old wiki under the source code in the + "docs" directory. Now these docs are nicely presented at + . + +[ng]: https://github.com/nathan11g +[dd]: https://github.com/drdrang +[bolk]: https://github.com/bolknote +[oe]: https://github.com/Sannis +[kk]: https://github.com/kimmel +[vast]: https://github.com/vast + + +## Version 7.2 + +A regular bug-fix release without any significant new features. Enjoy! + + +## Version 7.1 + +A Summer crop: + +- [Marc Fornos][mf] made the definition for Clojure along with the matching + style Rainbow (which, of course, works for other languages too). +- CoffeeScript support continues to improve getting support for regular + expressions. +- Yoshihide Jimbo ported to highlight.js [five Tomorrow styles][tm] from the + [project by Chris Kempson][tm0]. +- Thanks to [Casey Duncun][cd] the library can now be built in the popular + [AMD format][amd]. +- And last but not least, we've got a fair number of correctness and consistency + fixes, including a pretty significant refactoring of Ruby. + +[mf]: https://github.com/mfornos +[tm]: http://jmblog.github.com/color-themes-for-highlightjs/ +[tm0]: https://github.com/ChrisKempson/Tomorrow-Theme +[cd]: https://github.com/caseman +[amd]: http://requirejs.org/docs/whyamd.html + + +## Version 7.0 + +The reason for the new major version update is a global change of keyword syntax +which resulted in the library getting smaller once again. For example, the +hosted build is 2K less than at the previous version while supporting two new +languages. + +Notable changes: + +- The library now works not only in a browser but also with [node.js][]. It is + installable with `npm install highlight.js`. [API][] docs are available on our + wiki. + +- The new unique feature (apparently) among syntax highlighters is highlighting + *HTTP* headers and an arbitrary language in the request body. The most useful + languages here are *XML* and *JSON* both of which highlight.js does support. + Here's [the detailed post][p] about the feature. + +- Two new style themes: a dark "south" *[Pojoaque][]* by Jason Tate and an + emulation of*XCode* IDE by [Angel Olloqui][ao]. + +- Three new languages: *D* by [Aleksandar Ružičić][ar], *R* by [Joe Cheng][jc] + and *GLSL* by [Sergey Tikhomirov][st]. + +- *Nginx* syntax has become a million times smaller and more universal thanks to + remaking it in a more generic manner that doesn't require listing all the + directives in the known universe. + +- Function titles are now highlighted in *PHP*. + +- *Haskell* and *VHDL* were significantly reworked to be more rich and correct + by their respective maintainers [Jeremy Hull][sr] and [Igor Kalnitsky][ik]. + +And last but not least, many bugs have been fixed around correctness and +language detection. + +Overall highlight.js currently supports 51 languages and 20 style themes. + +[node.js]: http://nodejs.org/ +[api]: http://softwaremaniacs.org/wiki/doku.php/highlight.js:api +[p]: http://softwaremaniacs.org/blog/2012/05/10/http-and-json-in-highlight-js/en/ +[pojoaque]: http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html +[ao]: https://github.com/angelolloqui +[ar]: https://github.com/raleksandar +[jc]: https://github.com/jcheng5 +[st]: https://github.com/tikhomirov +[sr]: https://github.com/sourrust +[ik]: https://github.com/ikalnitsky + + +## Version 6.2 + +A lot of things happened in highlight.js since the last version! We've got nine +new contributors, the discussion group came alive, and the main branch on GitHub +now counts more than 350 followers. Here are most significant results coming +from all this activity: + +- 5 (five!) new languages: Rust, ActionScript, CoffeeScript, MatLab and + experimental support for markdown. Thanks go to [Andrey Vlasovskikh][av], + [Alexander Myadzel][am], [Dmytrii Nagirniak][dn], [Oleg Efimov][oe], [Denis + Bardadym][db] and [John Crepezzi][jc]. + +- 2 new style themes: Monokai by [Luigi Maselli][lm] and stylistic imitation of + another well-known highlighter Google Code Prettify by [Aahan Krish][ak]. + +- A vast number of [correctness fixes and code refactorings][log], mostly made + by [Oleg Efimov][oe] and [Evgeny Stepanischev][es]. + +[av]: https://github.com/vlasovskikh +[am]: https://github.com/myadzel +[dn]: https://github.com/dnagir +[oe]: https://github.com/Sannis +[db]: https://github.com/btd +[jc]: https://github.com/seejohnrun +[lm]: http://grigio.org/ +[ak]: https://github.com/geekpanth3r +[es]: https://github.com/bolknote +[log]: https://github.com/isagalaev/highlight.js/commits/ + + +## Version 6.1 — Solarized + +[Jeremy Hull][jh] has implemented my dream feature — a port of [Solarized][] +style theme famous for being based on the intricate color theory to achieve +correct contrast and color perception. It is now available for highlight.js in +both variants — light and dark. + +This version also adds a new original style Arta. Its author pumbur maintains a +[heavily modified fork of highlight.js][pb] on GitHub. + +[jh]: https://github.com/sourrust +[solarized]: http://ethanschoonover.com/solarized +[pb]: https://github.com/pumbur/highlight.js + + +## Version 6.0 + +New major version of the highlighter has been built on a significantly +refactored syntax. Due to this it's even smaller than the previous one while +supporting more languages! + +New languages are: + +- Haskell by [Jeremy Hull][sourrust] +- Erlang in two varieties — module and REPL — made collectively by [Nikolay + Zakharov][desh], [Dmitry Kovega][arhibot] and [Sergey Ignatov][ignatov] +- Objective C by [Valerii Hiora][vhbit] +- Vala by [Antono Vasiljev][antono] +- Go by [Stephan Kountso][steplg] + +[sourrust]: https://github.com/sourrust +[desh]: http://desh.su/ +[arhibot]: https://github.com/arhibot +[ignatov]: https://github.com/ignatov +[vhbit]: https://github.com/vhbit +[antono]: https://github.com/antono +[steplg]: https://github.com/steplg + +Also this version is marginally faster and fixes a number of small long-standing +bugs. + +Developer overview of the new language syntax is available in a [blog post about +recent beta release][beta]. + +[beta]: http://softwaremaniacs.org/blog/2011/04/25/highlight-js-60-beta/en/ + +P.S. New version is not yet available on a Yandex' CDN, so for now you have to +download [your own copy][d]. + +[d]: /soft/highlight/en/download/ + + +## Version 5.14 + +Fixed bugs in HTML/XML detection and relevance introduced in previous +refactoring. + +Also test.html now shows the second best result of language detection by +relevance. + + +## Version 5.13 + +Past weekend began with a couple of simple additions for existing languages but +ended up in a big code refactoring bringing along nice improvements for language +developers. + +### For users + +- Description of C++ has got new keywords from the upcoming [C++ 0x][] standard. +- Description of HTML has got new tags from [HTML 5][]. +- CSS-styles have been unified to use consistent padding and also have lost + pop-outs with names of detected languages. +- [Igor Kalnitsky][ik] has sent two new language descriptions: CMake и VHDL. + +This makes total number of languages supported by highlight.js to reach 35. + +Bug fixes: + +- Custom classes on `

` tags are not being overridden anymore
+- More correct highlighting of code blocks inside non-`
` containers:
+  highlighter now doesn't insist on replacing them with its own container and
+  just replaces the contents.
+- Small fixes in browser compatibility and heuristics.
+
+[c++ 0x]: http://ru.wikipedia.org/wiki/C%2B%2B0x
+[html 5]: http://en.wikipedia.org/wiki/HTML5
+[ik]: http://kalnitsky.org.ua/
+
+### For developers
+
+The most significant change is the ability to include language submodes right
+under `contains` instead of defining explicit named submodes in the main array:
+
+    contains: [
+      'string',
+      'number',
+      {begin: '\\n', end: hljs.IMMEDIATE_RE}
+    ]
+
+This is useful for auxiliary modes needed only in one place to define parsing.
+Note that such modes often don't have `className` and hence won't generate a
+separate `` in the resulting markup. This is similar in effect to
+`noMarkup: true`. All existing languages have been refactored accordingly.
+
+Test file test.html has at last become a real test. Now it not only puts the
+detected language name under the code snippet but also tests if it matches the
+expected one. Test summary is displayed right above all language snippets.
+
+
+## CDN
+
+Fine people at [Yandex][] agreed to host highlight.js on their big fast servers.
+[Link up][l]!
+
+[yandex]: http://yandex.com/
+[l]: http://softwaremaniacs.org/soft/highlight/en/download/
+
+
+## Version 5.10 — "Paris".
+
+Though I'm on a vacation in Paris, I decided to release a new version with a
+couple of small fixes:
+
+- Tomas Vitvar discovered that TAB replacement doesn't always work when used
+  with custom markup in code
+- SQL parsing is even more rigid now and doesn't step over SmallTalk in tests
+
+
+## Version 5.9
+
+A long-awaited version is finally released.
+
+New languages:
+
+- Andrew Fedorov made a definition for Lua
+- a long-time highlight.js contributor [Peter Leonov][pl] made a definition for
+  Nginx config
+- [Vladimir Moskva][vm] made a definition for TeX
+
+[pl]: http://kung-fu-tzu.ru/
+[vm]: http://fulc.ru/
+
+Fixes for existing languages:
+
+- [Loren Segal][ls] reworked the Ruby definition and added highlighting for
+  [YARD][] inline documentation
+- the definition of SQL has become more solid and now it shouldn't be overly
+  greedy when it comes to language detection
+
+[ls]: http://gnuu.org/
+[yard]: http://yardoc.org/
+
+The highlighter has become more usable as a library allowing to do highlighting
+from initialization code of JS frameworks and in ajax methods (see.
+readme.eng.txt).
+
+Also this version drops support for the [WordPress][wp] plugin. Everyone is
+welcome to [pick up its maintenance][p] if needed.
+
+[wp]: http://wordpress.org/
+[p]: http://bazaar.launchpad.net/~isagalaev/+junk/highlight/annotate/342/src/wp_highlight.js.php
+
+
+## Version 5.8
+
+- Jan Berkel has contributed a definition for Scala. +1 to hotness!
+- All CSS-styles are rewritten to work only inside `
` tags to avoid
+  conflicts with host site styles.
+
+
+## Version 5.7.
+
+Fixed escaping of quotes in VBScript strings.
+
+
+## Version 5.5
+
+This version brings a small change: now .ini-files allow digits, underscores and
+square brackets in key names.
+
+
+## Version 5.4
+
+Fixed small but upsetting bug in the packer which caused incorrect highlighting
+of explicitly specified languages. Thanks to Andrew Fedorov for precise
+diagnostics!
+
+
+## Version 5.3
+
+The version to fulfil old promises.
+
+The most significant change is that highlight.js now preserves custom user
+markup in code along with its own highlighting markup. This means that now it's
+possible to use, say, links in code. Thanks to [Vladimir Dolzhenko][vd] for the
+[initial proposal][1] and for making a proof-of-concept patch.
+
+Also in this version:
+
+- [Vasily Polovnyov][vp] has sent a GitHub-like style and has implemented
+  support for CSS @-rules and Ruby symbols.
+- Yura Zaripov has sent two styles: Brown Paper and School Book.
+- Oleg Volchkov has sent a definition for [Parser 3][p3].
+
+[1]: http://softwaremaniacs.org/forum/highlightjs/6612/
+[p3]: http://www.parser.ru/
+[vp]: http://vasily.polovnyov.ru/
+[vd]: http://dolzhenko.blogspot.com/
+
+
+## Version 5.2
+
+- at last it's possible to replace indentation TABs with something sensible (e.g. 2 or 4 spaces)
+- new keywords and built-ins for 1C by Sergey Baranov
+- a couple of small fixes to Apache highlighting
+
+
+## Version 5.1
+
+This is one of those nice version consisting entirely of new and shiny
+contributions!
+
+- [Vladimir Ermakov][vooon] created highlighting for AVR Assembler
+- [Ruslan Keba][rukeba] created highlighting for Apache config file. Also his
+  original visual style for it is now available for all highlight.js languages
+  under the name "Magula".
+- [Shuen-Huei Guan][drake] (aka Drake) sent new keywords for RenderMan
+  languages. Also thanks go to [Konstantin Evdokimenko][ke] for his advice on
+  the matter.
+
+[vooon]: http://vehq.ru/about/
+[rukeba]: http://rukeba.com/
+[drake]: http://drakeguan.org/
+[ke]: http://k-evdokimenko.moikrug.ru/
+
+
+## Version 5.0
+
+The main change in the new major version of highlight.js is a mechanism for
+packing several languages along with the library itself into a single compressed
+file. Now sites using several languages will load considerably faster because
+the library won't dynamically include additional files while loading.
+
+Also this version fixes a long-standing bug with Javascript highlighting that
+couldn't distinguish between regular expressions and division operations.
+
+And as usually there were a couple of minor correctness fixes.
+
+Great thanks to all contributors! Keep using highlight.js.
+
+
+## Version 4.3
+
+This version comes with two contributions from [Jason Diamond][jd]:
+
+- language definition for C# (yes! it was a long-missed thing!)
+- Visual Studio-like highlighting style
+
+Plus there are a couple of minor bug fixes for parsing HTML and XML attributes.
+
+[jd]: http://jason.diamond.name/weblog/
+
+
+## Version 4.2
+
+The biggest news is highlighting for Lisp, courtesy of Vasily Polovnyov. It's
+somewhat experimental meaning that for highlighting "keywords" it doesn't use
+any pre-defined set of a Lisp dialect. Instead it tries to highlight first word
+in parentheses wherever it makes sense. I'd like to ask people programming in
+Lisp to confirm if it's a good idea and send feedback to [the forum][f].
+
+Other changes:
+
+- Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
+- [Vladimir Epifanov][voldmar] has implemented javascript style switcher for
+  test.html
+- comments now allowed inside Ruby function definition
+- [MEL][] language from [Shuen-Huei Guan][drake]
+- whitespace now allowed between `
` and ``
+- better auto-detection of C++ and PHP
+- HTML allows embedded VBScript (`<% .. %>`)
+
+[f]: http://softwaremaniacs.org/forum/highlightjs/
+[voldmar]: http://voldmar.ya.ru/
+[mel]: http://en.wikipedia.org/wiki/Maya_Embedded_Language
+[drake]: http://drakeguan.org/
+
+
+## Version 4.1
+
+Languages:
+
+- Bash from Vah
+- DOS bat-files from Alexander Makarov (Sam)
+- Diff files from Vasily Polovnyov
+- Ini files from myself though initial idea was from Sam
+
+Styles:
+
+- Zenburn from Vladimir Epifanov, this is an imitation of a
+  [well-known theme for Vim][zenburn].
+- Ascetic from myself, as a realization of ideals of non-flashy highlighting:
+  just one color in only three gradations :-)
+
+In other news. [One small bug][bug] was fixed, built-in keywords were added for
+Python and C++ which improved auto-detection for the latter (it was shame that
+[my wife's blog][alenacpp] had issues with it from time to time). And lastly
+thanks go to Sam for getting rid of my stylistic comments in code that were
+getting in the way of [JSMin][].
+
+[zenburn]: http://en.wikipedia.org/wiki/Zenburn
+[alenacpp]: http://alenacpp.blogspot.com/
+[bug]: http://softwaremaniacs.org/forum/viewtopic.php?id=1823
+[jsmin]: http://code.google.com/p/jsmin-php/
+
+
+## Version 4.0
+
+New major version is a result of vast refactoring and of many contributions.
+
+Visible new features:
+
+- Highlighting of embedded languages. Currently is implemented highlighting of
+  Javascript and CSS inside HTML.
+- Bundled 5 ready-made style themes!
+
+Invisible new features:
+
+- Highlight.js no longer pollutes global namespace. Only one object and one
+  function for backward compatibility.
+- Performance is further increased by about 15%.
+
+Changing of a major version number caused by a new format of language definition
+files. If you use some third-party language files they should be updated.
+
+
+## Version 3.5
+
+A very nice version in my opinion fixing a number of small bugs and slightly
+increased speed in a couple of corner cases. Thanks to everybody who reports
+bugs in he [forum][f] and by email!
+
+There is also a new language — XML. A custom XML formerly was detected as HTML
+and didn't highlight custom tags. In this version I tried to make custom XML to
+be detected and highlighted by its own rules. Which by the way include such
+things as CDATA sections and processing instructions (``).
+
+[f]: http://softwaremaniacs.org/forum/viewforum.php?id=6
+
+
+## Version 3.3
+
+[Vladimir Gubarkov][xonix] has provided an interesting and useful addition.
+File export.html contains a little program that shows and allows to copy and
+paste an HTML code generated by the highlighter for any code snippet. This can
+be useful in situations when one can't use the script itself on a site.
+
+
+[xonix]: http://xonixx.blogspot.com/
+
+
+## Version 3.2 consists completely of contributions:
+
+- Vladimir Gubarkov has described SmallTalk
+- Yuri Ivanov has described 1C
+- Peter Leonov has packaged the highlighter as a Firefox extension
+- Vladimir Ermakov has compiled a mod for phpBB
+
+Many thanks to you all!
+
+
+## Version 3.1
+
+Three new languages are available: Django templates, SQL and Axapta. The latter
+two are sent by [Dmitri Roudakov][1]. However I've almost entirely rewrote an
+SQL definition but I'd never started it be it from the ground up :-)
+
+The engine itself has got a long awaited feature of grouping keywords
+("keyword", "built-in function", "literal"). No more hacks!
+
+[1]: http://roudakov.ru/
+
+
+## Version 3.0
+
+It is major mainly because now highlight.js has grown large and has become
+modular. Now when you pass it a list of languages to highlight it will
+dynamically load into a browser only those languages.
+
+Also:
+
+- Konstantin Evdokimenko of [RibKit][] project has created a highlighting for
+  RenderMan Shading Language and RenderMan Interface Bytestream. Yay for more
+  languages!
+- Heuristics for C++ and HTML got better.
+- I've implemented (at last) a correct handling of backslash escapes in C-like
+  languages.
+
+There is also a small backwards incompatible change in the new version. The
+function initHighlighting that was used to initialize highlighting instead of
+initHighlightingOnLoad a long time ago no longer works. If you by chance still
+use it — replace it with the new one.
+
+[RibKit]: http://ribkit.sourceforge.net/
+
+
+## Version 2.9
+
+Highlight.js is a parser, not just a couple of regular expressions. That said
+I'm glad to announce that in the new version 2.9 has support for:
+
+- in-string substitutions for Ruby -- `#{...}`
+- strings from from numeric symbol codes (like #XX) for Delphi
+
+
+## Version 2.8
+
+A maintenance release with more tuned heuristics. Fully backwards compatible.
+
+
+## Version 2.7
+
+- Nikita Ledyaev presents highlighting for VBScript, yay!
+- A couple of bugs with escaping in strings were fixed thanks to Mickle
+- Ongoing tuning of heuristics
+
+Fixed bugs were rather unpleasant so I encourage everyone to upgrade!
+
+
+## Version 2.4
+
+- Peter Leonov provides another improved highlighting for Perl
+- Javascript gets a new kind of keywords — "literals". These are the words
+  "true", "false" and "null"
+
+Also highlight.js homepage now lists sites that use the library. Feel free to
+add your site by [dropping me a message][mail] until I find the time to build a
+submit form.
+
+[mail]: mailto:Maniac@SoftwareManiacs.Org
+
+
+## Version 2.3
+
+This version fixes IE breakage in previous version. My apologies to all who have
+already downloaded that one!
+
+
+## Version 2.2
+
+- added highlighting for Javascript
+- at last fixed parsing of Delphi's escaped apostrophes in strings
+- in Ruby fixed highlighting of keywords 'def' and 'class', same for 'sub' in
+  Perl
+
+
+## Version 2.0
+
+- Ruby support by [Anton Kovalyov][ak]
+- speed increased by orders of magnitude due to new way of parsing
+- this same way allows now correct highlighting of keywords in some tricky
+  places (like keyword "End" at the end of Delphi classes)
+
+[ak]: http://anton.kovalyov.net/
+
+
+## Version 1.0
+
+Version 1.0 of javascript syntax highlighter is released!
+
+It's the first version available with English description. Feel free to post
+your comments and question to [highlight.js forum][forum]. And don't be afraid
+if you find there some fancy Cyrillic letters -- it's for Russian users too :-)
+
+[forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6
diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/LICENSE b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/LICENSE
new file mode 100644
index 0000000..422deb7
--- /dev/null
+++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2006, Ivan Sagalaev
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of highlight.js nor the names of its contributors 
+      may be used to endorse or promote products derived from this software 
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.md b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.md
new file mode 100644
index 0000000..0ee9637
--- /dev/null
+++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.md
@@ -0,0 +1,167 @@
+# Highlight.js
+
+Highlight.js highlights syntax in code examples on blogs, forums and,
+in fact, on any web page. It's very easy to use because it works
+automatically: finds blocks of code, detects a language, highlights it.
+
+Autodetection can be fine tuned when it fails by itself (see "Heuristics").
+
+
+## Basic usage
+
+Link the library and a stylesheet from your page and hook highlighting to
+the page load event:
+
+```html
+
+
+
+```
+
+This will highlight all code on the page marked up as `
 .. 
`. +If you use different markup or need to apply highlighting dynamically, read +"Custom initialization" below. + +- You can download your own customized version of "highlight.pack.js" or + use the hosted one as described on the download page: + + +- Style themes are available in the download package or as hosted files. + To create a custom style for your site see the class reference in the file + [CSS classes reference][cr] from the downloaded package. + +[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html + + +## node.js + +Highlight.js can be used under node.js. The package with all supported languages is +installable from NPM: + + npm install highlight.js + +Alternatively, you can build it from the source with only languages you need: + + python3 tools/build.py -tnode lang1 lang2 .. + +Using the library: + +```javascript +var hljs = require('highlight.js'); + +// If you know the language +hljs.highlight(lang, code).value; + +// Automatic language detection +hljs.highlightAuto(code).value; +``` + + +## AMD + +Highlight.js can be used with an AMD loader. You will need to build it from +source in order to do so: + +```bash +$ python3 tools/build.py -tamd lang1 lang2 .. +``` + +Which will generate a `build/highlight.pack.js` which will load as an AMD +module with support for the built languages and can be used like so: + +```javascript +require(["highlight.js/build/highlight.pack"], function(hljs){ + + // If you know the language + hljs.highlight(lang, code).value; + + // Automatic language detection + hljs.highlightAuto(code).value; +}); +``` + + +## Tab replacement + +You can replace TAB ('\x09') characters used for indentation in your code +with some fixed number of spaces or with a `` to give them special +styling: + +```html + +``` + +## Custom initialization + +If you use different markup for code blocks you can initialize them manually +with `highlightBlock(code)` function. It takes a DOM element containing the +code to highlight and optionally a string with which to replace TAB +characters. + +Initialization using, for example, jQuery might look like this: + +```javascript +$(document).ready(function() { + $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); +}); +``` + +You can use `highlightBlock` to highlight blocks dynamically inserted into +the page. Just make sure you don't do it twice for already highlighted +blocks. + +If your code container relies on `
` tags instead of line breaks (i.e. if +it's not `
`) set the `useBR` option to `true`:
+
+```javascript
+hljs.configure({useBR: true});
+$('div.code').each(function(i, e) {hljs.highlightBlock(e)});
+```
+
+
+## Heuristics
+
+Autodetection of a code's language is done using a simple heuristic:
+the program tries to highlight a fragment with all available languages and
+counts all syntactic structures that it finds along the way. The language
+with greatest count wins.
+
+This means that in short fragments the probability of an error is high
+(and it really happens sometimes). In this cases you can set the fragment's
+language explicitly by assigning a class to the `` element:
+
+```html
+
...
+``` + +You can use class names recommended in HTML5: "language-html", +"language-php". Classes also can be assigned to the `
` element.
+
+To disable highlighting of a fragment altogether use "no-highlight" class:
+
+```html
+
...
+``` + + +## Export + +File export.html contains a little program that allows you to paste in a code +snippet and then copy and paste the resulting HTML code generated by the +highlighter. This is useful in situations when you can't use the script itself +on a site. + + +## Meta + +- Version: 8.0 +- URL: http://highlightjs.org/ + +For the license terms see LICENSE files. +For authors and contributors see AUTHORS.en.txt file. diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.ru.md b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.ru.md new file mode 100644 index 0000000..0d0e0fe --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/README.ru.md @@ -0,0 +1,171 @@ +# Highlight.js + +Highlight.js нужен для подсветки синтаксиса в примерах кода в блогах, +форумах и вообще на любых веб-страницах. Пользоваться им очень просто, +потому что работает он автоматически: сам находит блоки кода, сам +определяет язык, сам подсвечивает. + +Автоопределением языка можно управлять, когда оно не справляется само (см. +дальше "Эвристика"). + + +## Простое использование + +Подключите библиотеку и стиль на страницу и повесть вызов подсветки на +загрузку страницы: + +```html + + + +``` + +Весь код на странице, обрамлённый в теги `
 .. 
` +будет автоматически подсвечен. Если вы используете другие теги или хотите +подсвечивать блоки кода динамически, читайте "Инициализацию вручную" ниже. + +- Вы можете скачать собственную версию "highlight.pack.js" или сослаться + на захостенный файл, как описано на странице загрузки: + + +- Стилевые темы можно найти в загруженном архиве или также использовать + захостенные. Чтобы сделать собственный стиль для своего сайта, вам + будет полезен [CSS classes reference][cr], который тоже есть в архиве. + +[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html + + +## node.js + +Highlight.js можно использовать в node.js. Библиотеку со всеми возможными языками можно +установить с NPM: + + npm install highlight.js + +Также её можно собрать из исходников с только теми языками, которые нужны: + + python3 tools/build.py -tnode lang1 lang2 .. + +Использование библиотеки: + +```javascript +var hljs = require('highlight.js'); + +// Если вы знаете язык +hljs.highlight(lang, code).value; + +// Автоопределение языка +hljs.highlightAuto(code).value; +``` + + +## AMD + +Highlight.js можно использовать с загрузчиком AMD-модулей. Для этого его +нужно собрать из исходников следующей командой: + +```bash +$ python3 tools/build.py -tamd lang1 lang2 .. +``` + +Она создаст файл `build/highlight.pack.js`, который является загружаемым +AMD-модулем и содержит все выбранные при сборке языки. Используется он так: + +```javascript +require(["highlight.js/build/highlight.pack"], function(hljs){ + + // Если вы знаете язык + hljs.highlight(lang, code).value; + + // Автоопределение языка + hljs.highlightAuto(code).value; +}); +``` + + +## Замена TABов + +Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на +фиксированное количество пробелов или на отдельный ``, чтобы задать ему +какой-нибудь специальный стиль: + +```html + +``` + + +## Инициализация вручную + +Если вы используете другие теги для блоков кода, вы можете инициализировать их +явно с помощью функции `highlightBlock(code)`. Она принимает DOM-элемент с +текстом расцвечиваемого кода и опционально - строчку для замены символов TAB. + +Например с использованием jQuery код инициализации может выглядеть так: + +```javascript +$(document).ready(function() { + $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); +}); +``` + +`highlightBlock` можно также использовать, чтобы подсветить блоки кода, +добавленные на страницу динамически. Только убедитесь, что вы не делаете этого +повторно для уже раскрашенных блоков. + +Если ваш блок кода использует `
` вместо переводов строки (т.е. если это не +`
`), включите опцию `useBR`:
+
+```javascript
+hljs.configure({useBR: true});
+$('div.code').each(function(i, e) {hljs.highlightBlock(e)});
+```
+
+
+## Эвристика
+
+Определение языка, на котором написан фрагмент, делается с помощью
+довольно простой эвристики: программа пытается расцветить фрагмент всеми
+языками подряд, и для каждого языка считает количество подошедших
+синтаксически конструкций и ключевых слов. Для какого языка нашлось больше,
+тот и выбирается.
+
+Это означает, что в коротких фрагментах высока вероятность ошибки, что
+периодически и случается. Чтобы указать язык фрагмента явно, надо написать
+его название в виде класса к элементу ``:
+
+```html
+
...
+``` + +Можно использовать рекомендованные в HTML5 названия классов: +"language-html", "language-php". Также можно назначать классы на элемент +`
`.
+
+Чтобы запретить расцветку фрагмента вообще, используется класс "no-highlight":
+
+```html
+
...
+``` + + +## Экспорт + +В файле export.html находится небольшая программка, которая показывает и дает +скопировать непосредственно HTML-код подсветки для любого заданного фрагмента кода. +Это может понадобится например на сайте, на котором нельзя подключить сам скрипт +highlight.js. + + +## Координаты + +- Версия: 8.0 +- URL: http://highlightjs.org/ + +Лицензионное соглашение читайте в файле LICENSE. +Список авторов и соавторов читайте в файле AUTHORS.ru.txt diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/highlight.pack.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/highlight.pack.js new file mode 100644 index 0000000..2f0a664 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/highlight.pack.js @@ -0,0 +1,2 @@ +// %LEAVE_UNMINIFIED% %REMOVE_LINE% +var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(//gm,">")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset"}function E(G){F+=""}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+=""}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+=""}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"
")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("bash",function(b){var a={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]};var d={cN:"string",b:/"/,e:/"/,c:[b.BE,a,{cN:"variable",b:/\$\(/,e:/\)/,c:[b.BE]}]};var c={cN:"string",b:/'/,e:/'/};return{l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[b.inherit(b.TM,{b:/\w[\w\d_]*/})],r:0},b.HCM,b.NM,d,c,a]}});hljs.registerLanguage("cs",function(b){var a="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{k:a,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|"},{cN:"xmlDocTag",b:""}]},b.CLCM,b.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},b.ASM,b.QSM,b.CNM,{bK:"protected public private internal",e:/[{;=]/,k:a,c:[{bK:"class namespace interface",starts:{c:[b.TM]}},{b:b.IR+"\\s*\\(",rB:true,c:[b.TM]}]}]}});hljs.registerLanguage("ruby",function(e){var h="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var a={cN:"yardoctag",b:"@[A-Za-z]+"};var i={cN:"comment",v:[{b:"#",e:"$",c:[a]},{b:"^\\=begin",e:"^\\=end",c:[a],r:10},{b:"^__END__",e:"\\n$"}]};var c={cN:"subst",b:"#\\{",e:"}",k:g};var d={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">",r:10},{b:"%[qw]?/",e:"/",r:10},{b:"%[qw]?%",e:"%",r:10},{b:"%[qw]?-",e:"-",r:10},{b:"%[qw]?\\|",e:"\\|",r:10},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]};var b={cN:"params",b:"\\(",e:"\\)",k:g};var f=[d,i,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},i]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:h}),b,i]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[d,{b:h}],r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[i,{cN:"regexp",c:[e.BE,c],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];c.c=f;b.c=f;return{k:g,c:f}});hljs.registerLanguage("diff",function(a){return{c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("javascript",function(a){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,a.REGEXP_MODE,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("xml",function(a){var c="[A-Za-z0-9\\._:-]+";var d={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"};var b={eW:true,i:/]+/}]}]}]};return{aliases:["html"],cI:true,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},d,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:"[^ /><]+",r:0},b]}]}});hljs.registerLanguage("markdown",function(a){return{c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:true,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:true,rE:true,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:true,eE:true},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:true,eE:true,}],r:10},{b:"^\\[.+\\]:",e:"$",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:true,eE:true},{cN:"link_url",b:"\\s",e:"$"}]}]}});hljs.registerLanguage("css",function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("http",function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}});hljs.registerLanguage("java",function(b){var a="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws";return{k:a,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},b.CLCM,b.CBLCLM,b.ASM,b.QSM,{bK:"protected public private",e:/[{;=]/,k:a,c:[{cN:"class",bK:"class interface",eW:true,i:/[:"<>]/,c:[{bK:"extends implements",r:10},b.UTM]},{b:b.UIR+"\\s*\\(",rB:true,c:[b.UTM]}]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("php",function(b){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var a={cN:"preprocessor",b:/<\?(php)?|\?>/};var c={cN:"string",c:[b.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},b.inherit(b.ASM,{i:null}),b.inherit(b.QSM,{i:null})]};var d={v:[b.BNM,b.CNM]};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[b.CLCM,b.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},a]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:b.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[b.BE]},a,e,{cN:"function",bK:"function",e:/[;{]/,i:"\\$|\\[|%",c:[b.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e,b.CBLCLM,c,d]}]},{cN:"class",bK:"class interface",e:"{",i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/,},{b:/(b|br)"/,e:/"/,},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("sql",function(a){return{cI:true,i:/[<>]/,c:[{cN:"operator",b:"\\b(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant|merge)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number trigger if before after each row merge matched database",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}});hljs.registerLanguage("ini",function(a){return{cI:true,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}});hljs.registerLanguage("perl",function(c){var d="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var f={cN:"subst",b:"[$@]\\{",e:"\\}",k:d};var g={b:"->{",e:"}"};var a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@\*](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@\*][^\s\w{]/,r:0}]};var e={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var h=[c.BE,f,a];var b=[a,c.HCM,e,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},g,{cN:"string",c:h,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[c.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[c.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+c.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[c.HCM,e,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[c.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];f.c=b;g.c=b;return{k:d,c:b}});hljs.registerLanguage("objectivec",function(a){var d={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign self synchronized id nonatomic super unichar IBOutlet IBAction strong weak @private @protected @public @try @property @end @throw @catch @finally @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};var c=/[a-zA-Z@][a-zA-Z0-9_]*/;var b="@interface @class @protocol @implementation";return{k:d,l:c,i:""}]},{cN:"preprocessor",b:"#",e:"$"},{cN:"class",b:"("+b.split(" ").join("|")+")\\b",e:"({|$)",k:b,l:c,c:[a.UTM]},{cN:"variable",b:"\\."+a.UIR,r:0}]}});hljs.registerLanguage("coffeescript",function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module exports global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f=c.inherit(c.TM,{b:a});var e={cN:"subst",b:/#\{/,e:/}/,k:b};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[c.BE]},{b:/'/,e:/'/,c:[c.BE]},{b:/"""/,e:/"""/,c:[c.BE,e]},{b:/"/,e:/"/,c:[c.BE,e]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[e,c.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:true,i:/[:="\[\]]/,c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true,r:0}])}});hljs.registerLanguage("nginx",function(c){var b={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+c.UIR}]};var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[c.HCM,{cN:"string",c:[c.BE,b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",c:[c.BE,b],v:[{b:"\\s\\^",e:"\\s|{|;",rE:true},{b:"~\\*?\\s+",e:"\\s|{|;",rE:true},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},b]};return{c:[c.HCM,{b:c.UIR+"\\s",e:";|{",rB:true,c:[c.inherit(c.UTM,{starts:a})],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("json",function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}});hljs.registerLanguage("apache",function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{cI:true,c:[a.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}});hljs.registerLanguage("cpp",function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c"],k:b,i:"",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}});hljs.registerLanguage("makefile",function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[a.BE]};return{c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b],}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}}); \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/arta.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/arta.css new file mode 100644 index 0000000..02db86a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/arta.css @@ -0,0 +1,160 @@ +/* +Date: 17.V.2011 +Author: pumbur +*/ + +.hljs +{ + display: block; padding: 0.5em; + background: #222; +} + +.profile .hljs-header *, +.ini .hljs-title, +.nginx .hljs-title +{ + color: #fff; +} + +.hljs-comment, +.hljs-javadoc, +.hljs-preprocessor, +.hljs-preprocessor .hljs-title, +.hljs-pragma, +.hljs-shebang, +.profile .hljs-summary, +.diff, +.hljs-pi, +.hljs-doctype, +.hljs-tag, +.hljs-template_comment, +.css .hljs-rules, +.tex .hljs-special +{ + color: #444; +} + +.hljs-string, +.hljs-symbol, +.diff .hljs-change, +.hljs-regexp, +.xml .hljs-attribute, +.smalltalk .hljs-char, +.xml .hljs-value, +.ini .hljs-value, +.clojure .hljs-attribute, +.coffeescript .hljs-attribute +{ + color: #ffcc33; +} + +.hljs-number, +.hljs-addition +{ + color: #00cc66; +} + +.hljs-built_in, +.hljs-literal, +.vhdl .hljs-typename, +.go .hljs-constant, +.go .hljs-typename, +.ini .hljs-keyword, +.lua .hljs-title, +.perl .hljs-variable, +.php .hljs-variable, +.mel .hljs-variable, +.django .hljs-variable, +.css .funtion, +.smalltalk .method, +.hljs-hexcolor, +.hljs-important, +.hljs-flow, +.hljs-inheritance, +.parser3 .hljs-variable +{ + color: #32AAEE; +} + +.hljs-keyword, +.hljs-tag .hljs-title, +.css .hljs-tag, +.css .hljs-class, +.css .hljs-id, +.css .hljs-pseudo, +.css .hljs-attr_selector, +.lisp .hljs-title, +.clojure .hljs-built_in, +.hljs-winutils, +.tex .hljs-command, +.hljs-request, +.hljs-status +{ + color: #6644aa; +} + +.hljs-title, +.ruby .hljs-constant, +.vala .hljs-constant, +.hljs-parent, +.hljs-deletion, +.hljs-template_tag, +.css .hljs-keyword, +.objectivec .hljs-class .hljs-id, +.smalltalk .hljs-class, +.lisp .hljs-keyword, +.apache .hljs-tag, +.nginx .hljs-variable, +.hljs-envvar, +.bash .hljs-variable, +.go .hljs-built_in, +.vbscript .hljs-built_in, +.lua .hljs-built_in, +.rsl .hljs-built_in, +.tail, +.avrasm .hljs-label, +.tex .hljs-formula, +.tex .hljs-formula * +{ + color: #bb1166; +} + +.hljs-yardoctag, +.hljs-phpdoc, +.profile .hljs-header, +.ini .hljs-title, +.apache .hljs-tag, +.parser3 .hljs-title +{ + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata +{ + opacity: 0.6; +} + +.hljs, +.javascript, +.css, +.xml, +.hljs-subst, +.diff .hljs-chunk, +.css .hljs-value, +.css .hljs-attribute, +.lisp .hljs-string, +.lisp .hljs-number, +.tail .hljs-params, +.hljs-container, +.haskell *, +.erlang *, +.erlang_repl * +{ + color: #aaa; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ascetic.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ascetic.css new file mode 100644 index 0000000..031c88a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ascetic.css @@ -0,0 +1,50 @@ +/* + +Original style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ + +.hljs { + display: block; padding: 0.5em; + background: white; color: black; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-filter .hljs-argument, +.hljs-addition, +.hljs-change, +.apache .hljs-tag, +.apache .hljs-cbracket, +.nginx .hljs-built_in, +.tex .hljs-formula { + color: #888; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-shebang, +.hljs-doctype, +.hljs-pi, +.hljs-javadoc, +.hljs-deletion, +.apache .hljs-sqbracket { + color: #CCC; +} + +.hljs-keyword, +.hljs-tag .hljs-title, +.ini .hljs-title, +.lisp .hljs-title, +.clojure .hljs-title, +.http .hljs-title, +.nginx .hljs-title, +.css .hljs-tag, +.hljs-winutils, +.hljs-flow, +.apache .hljs-tag, +.tex .hljs-command, +.hljs-request, +.hljs-status { + font-weight: bold; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.dark.css new file mode 100644 index 0000000..2779601 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.dark.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Dune Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Dune Dark Comment */ +.hljs-comment, +.hljs-title { + color: #999580; +} + +/* Atelier Dune Dark Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #d73737; +} + +/* Atelier Dune Dark Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #b65611; +} + +/* Atelier Dune Dark Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #cfb017; +} + +/* Atelier Dune Dark Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #60ac39; +} + +/* Atelier Dune Dark Aqua */ +.css .hljs-hexcolor { + color: #1fad83; +} + +/* Atelier Dune Dark Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #6684e1; +} + +/* Atelier Dune Dark Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #b854d4; +} + +.hljs { + display: block; + background: #292824; + color: #a6a28c; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.light.css new file mode 100644 index 0000000..11c7423 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-dune.light.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Dune Light - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Dune Light Comment */ +.hljs-comment, +.hljs-title { + color: #7d7a68; +} + +/* Atelier Dune Light Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #d73737; +} + +/* Atelier Dune Light Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #b65611; +} + +/* Atelier Dune Light Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #cfb017; +} + +/* Atelier Dune Light Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #60ac39; +} + +/* Atelier Dune Light Aqua */ +.css .hljs-hexcolor { + color: #1fad83; +} + +/* Atelier Dune Light Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #6684e1; +} + +/* Atelier Dune Light Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #b854d4; +} + +.hljs { + display: block; + background: #fefbec; + color: #6e6b5e; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.dark.css new file mode 100644 index 0000000..c1f7211 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.dark.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Forest Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Forest Dark Comment */ +.hljs-comment, +.hljs-title { + color: #9c9491; +} + +/* Atelier Forest Dark Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #f22c40; +} + +/* Atelier Forest Dark Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #df5320; +} + +/* Atelier Forest Dark Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #d5911a; +} + +/* Atelier Forest Dark Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #5ab738; +} + +/* Atelier Forest Dark Aqua */ +.css .hljs-hexcolor { + color: #00ad9c; +} + +/* Atelier Forest Dark Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #407ee7; +} + +/* Atelier Forest Dark Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #6666ea; +} + +.hljs { + display: block; + background: #2c2421; + color: #a8a19f; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.light.css new file mode 100644 index 0000000..806ba73 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-forest.light.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Forest Light - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Forest Light Comment */ +.hljs-comment, +.hljs-title { + color: #766e6b; +} + +/* Atelier Forest Light Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #f22c40; +} + +/* Atelier Forest Light Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #df5320; +} + +/* Atelier Forest Light Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #d5911a; +} + +/* Atelier Forest Light Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #5ab738; +} + +/* Atelier Forest Light Aqua */ +.css .hljs-hexcolor { + color: #00ad9c; +} + +/* Atelier Forest Light Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #407ee7; +} + +/* Atelier Forest Light Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #6666ea; +} + +.hljs { + display: block; + background: #f1efee; + color: #68615e; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.dark.css new file mode 100644 index 0000000..3670669 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.dark.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Heath Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Heath Dark Comment */ +.hljs-comment, +.hljs-title { + color: #9e8f9e; +} + +/* Atelier Heath Dark Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #ca402b; +} + +/* Atelier Heath Dark Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #a65926; +} + +/* Atelier Heath Dark Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #bb8a35; +} + +/* Atelier Heath Dark Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #379a37; +} + +/* Atelier Heath Dark Aqua */ +.css .hljs-hexcolor { + color: #159393; +} + +/* Atelier Heath Dark Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #516aec; +} + +/* Atelier Heath Dark Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #7b59c0; +} + +.hljs { + display: block; + background: #292329; + color: #ab9bab; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.light.css new file mode 100644 index 0000000..e73a0b8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-heath.light.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Heath Light - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Heath Light Comment */ +.hljs-comment, +.hljs-title { + color: #776977; +} + +/* Atelier Heath Light Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #ca402b; +} + +/* Atelier Heath Light Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #a65926; +} + +/* Atelier Heath Light Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #bb8a35; +} + +/* Atelier Heath Light Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #379a37; +} + +/* Atelier Heath Light Aqua */ +.css .hljs-hexcolor { + color: #159393; +} + +/* Atelier Heath Light Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #516aec; +} + +/* Atelier Heath Light Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #7b59c0; +} + +.hljs { + display: block; + background: #f7f3f7; + color: #695d69; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.dark.css new file mode 100644 index 0000000..8506246 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.dark.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Lakeside Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Lakeside Dark Comment */ +.hljs-comment, +.hljs-title { + color: #7195a8; +} + +/* Atelier Lakeside Dark Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #d22d72; +} + +/* Atelier Lakeside Dark Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #935c25; +} + +/* Atelier Lakeside Dark Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #8a8a0f; +} + +/* Atelier Lakeside Dark Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #568c3b; +} + +/* Atelier Lakeside Dark Aqua */ +.css .hljs-hexcolor { + color: #2d8f6f; +} + +/* Atelier Lakeside Dark Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #257fad; +} + +/* Atelier Lakeside Dark Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #5d5db1; +} + +.hljs { + display: block; + background: #1f292e; + color: #7ea2b4; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.light.css new file mode 100644 index 0000000..006ae6d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-lakeside.light.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Lakeside Light - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Lakeside Light Comment */ +.hljs-comment, +.hljs-title { + color: #5a7b8c; +} + +/* Atelier Lakeside Light Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #d22d72; +} + +/* Atelier Lakeside Light Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #935c25; +} + +/* Atelier Lakeside Light Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #8a8a0f; +} + +/* Atelier Lakeside Light Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #568c3b; +} + +/* Atelier Lakeside Light Aqua */ +.css .hljs-hexcolor { + color: #2d8f6f; +} + +/* Atelier Lakeside Light Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #257fad; +} + +/* Atelier Lakeside Light Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #5d5db1; +} + +.hljs { + display: block; + background: #ebf8ff; + color: #516d7b; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.dark.css new file mode 100644 index 0000000..cbea6ed --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.dark.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Seaside Dark - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Seaside Dark Comment */ +.hljs-comment, +.hljs-title { + color: #809980; +} + +/* Atelier Seaside Dark Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #e6193c; +} + +/* Atelier Seaside Dark Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #87711d; +} + +/* Atelier Seaside Dark Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #c3c322; +} + +/* Atelier Seaside Dark Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #29a329; +} + +/* Atelier Seaside Dark Aqua */ +.css .hljs-hexcolor { + color: #1999b3; +} + +/* Atelier Seaside Dark Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #3d62f5; +} + +/* Atelier Seaside Dark Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #ad2bee; +} + +.hljs { + display: block; + background: #242924; + color: #8ca68c; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.light.css new file mode 100644 index 0000000..159121e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/atelier-seaside.light.css @@ -0,0 +1,93 @@ +/* Base16 Atelier Seaside Light - Theme */ +/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/) */ +/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ +/* https://github.com/jmblog/color-themes-for-highlightjs */ + +/* Atelier Seaside Light Comment */ +.hljs-comment, +.hljs-title { + color: #687d68; +} + +/* Atelier Seaside Light Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #e6193c; +} + +/* Atelier Seaside Light Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #87711d; +} + +/* Atelier Seaside Light Yellow */ +.hljs-ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #c3c322; +} + +/* Atelier Seaside Light Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #29a329; +} + +/* Atelier Seaside Light Aqua */ +.css .hljs-hexcolor { + color: #1999b3; +} + +/* Atelier Seaside Light Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #3d62f5; +} + +/* Atelier Seaside Light Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #ad2bee; +} + +.hljs { + display: block; + background: #f0fff0; + color: #5e6e5e; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_paper.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_paper.css new file mode 100644 index 0000000..f9541c3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_paper.css @@ -0,0 +1,105 @@ +/* + +Brown Paper style from goldblog.com.ua (c) Zaripov Yura + +*/ + +.hljs { + display: block; padding: 0.5em; + background:#b7a68e url(./brown_papersq.png); +} + +.hljs-keyword, +.hljs-literal, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.tex .hljs-special, +.hljs-request, +.hljs-status { + color:#005599; + font-weight:bold; +} + +.hljs, +.hljs-subst, +.hljs-tag .hljs-keyword { + color: #363C69; +} + +.hljs-string, +.hljs-title, +.haskell .hljs-type, +.hljs-tag .hljs-value, +.css .hljs-rules .hljs-value, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-javadoc, +.ruby .hljs-string, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-number { + color: #2C009F; +} + +.hljs-comment, +.java .hljs-annotation, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket, +.nginx .hljs-built_in, +.tex .hljs-formula { + color: #802022; +} + +.hljs-keyword, +.hljs-literal, +.css .hljs-id, +.hljs-phpdoc, +.hljs-title, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.diff .hljs-header, +.hljs-chunk, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.tex .hljs-command { + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.8; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_papersq.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_papersq.png new file mode 100644 index 0000000..3813903 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/brown_papersq.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/dark.css new file mode 100644 index 0000000..e479d0a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/dark.css @@ -0,0 +1,105 @@ +/* + +Dark style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #444; +} + +.hljs-keyword, +.hljs-literal, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.tex .hljs-special { + color: white; +} + +.hljs, +.hljs-subst { + color: #DDD; +} + +.hljs-string, +.hljs-title, +.haskell .hljs-type, +.ini .hljs-title, +.hljs-tag .hljs-value, +.css .hljs-rules .hljs-value, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-javadoc, +.ruby .hljs-string, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.hljs-prompt, +.coffeescript .hljs-attribute { + color: #D88; +} + +.hljs-comment, +.java .hljs-annotation, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket, +.tex .hljs-formula { + color: #777; +} + +.hljs-keyword, +.hljs-literal, +.hljs-title, +.css .hljs-id, +.hljs-phpdoc, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.diff .hljs-header, +.hljs-chunk, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.tex .hljs-special, +.hljs-request, +.hljs-status { + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/default.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/default.css new file mode 100644 index 0000000..3d8485b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/default.css @@ -0,0 +1,153 @@ +/* + +Original style from softwaremaniacs.org (c) Ivan Sagalaev + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #F0F0F0; +} + +.hljs, +.hljs-subst, +.hljs-tag .hljs-title, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title { + color: black; +} + +.hljs-string, +.hljs-title, +.hljs-constant, +.hljs-parent, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.hljs-rules .hljs-value .hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.haml .hljs-symbol, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-aggregate, +.hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-addition, +.hljs-flow, +.hljs-stream, +.bash .hljs-variable, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.tex .hljs-special, +.erlang_repl .hljs-function_or_atom, +.asciidoc .hljs-header, +.markdown .hljs-header, +.coffeescript .hljs-attribute { + color: #800; +} + +.smartquote, +.hljs-comment, +.hljs-annotation, +.hljs-template_comment, +.diff .hljs-header, +.hljs-chunk, +.asciidoc .hljs-blockquote, +.markdown .hljs-blockquote { + color: #888; +} + +.hljs-number, +.hljs-date, +.hljs-regexp, +.hljs-literal, +.hljs-hexcolor, +.smalltalk .hljs-symbol, +.smalltalk .hljs-char, +.go .hljs-constant, +.hljs-change, +.lasso .hljs-variable, +.makefile .hljs-variable, +.asciidoc .hljs-bullet, +.markdown .hljs-bullet, +.asciidoc .hljs-link_url, +.markdown .hljs-link_url { + color: #080; +} + +.hljs-label, +.hljs-javadoc, +.ruby .hljs-string, +.hljs-decorator, +.hljs-filter .hljs-argument, +.hljs-localvars, +.hljs-array, +.hljs-attr_selector, +.hljs-important, +.hljs-pseudo, +.hljs-pi, +.haml .hljs-bullet, +.hljs-doctype, +.hljs-deletion, +.hljs-envvar, +.hljs-shebang, +.apache .hljs-sqbracket, +.nginx .hljs-built_in, +.tex .hljs-formula, +.erlang_repl .hljs-reserved, +.hljs-prompt, +.asciidoc .hljs-link_label, +.markdown .hljs-link_label, +.vhdl .hljs-attribute, +.clojure .hljs-attribute, +.asciidoc .hljs-attribute, +.lasso .hljs-attribute, +.coffeescript .hljs-property, +.hljs-phony { + color: #88F +} + +.hljs-keyword, +.hljs-id, +.hljs-title, +.hljs-built_in, +.hljs-aggregate, +.css .hljs-tag, +.hljs-javadoctag, +.hljs-phpdoc, +.hljs-yardoctag, +.smalltalk .hljs-class, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.go .hljs-typename, +.tex .hljs-command, +.asciidoc .hljs-strong, +.markdown .hljs-strong, +.hljs-request, +.hljs-status { + font-weight: bold; +} + +.asciidoc .hljs-emphasis, +.markdown .hljs-emphasis { + font-style: italic; +} + +.nginx .hljs-built_in { + font-weight: normal; +} + +.coffeescript .javascript, +.javascript .xml, +.lasso .markup, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/docco.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/docco.css new file mode 100644 index 0000000..993fd26 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/docco.css @@ -0,0 +1,132 @@ +/* +Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars) +*/ + +.hljs { + display: block; padding: 0.5em; + color: #000; + background: #f8f8ff +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-javadoc { + color: #408080; + font-style: italic +} + +.hljs-keyword, +.assignment, +.hljs-literal, +.css .rule .hljs-keyword, +.hljs-winutils, +.javascript .hljs-title, +.lisp .hljs-title, +.hljs-subst { + color: #954121; +} + +.hljs-number, +.hljs-hexcolor { + color: #40a070 +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula { + color: #219161; +} + +.hljs-title, +.hljs-id { + color: #19469D; +} +.hljs-params { + color: #00F; +} + +.javascript .hljs-title, +.lisp .hljs-title, +.hljs-subst { + font-weight: normal +} + +.hljs-class .hljs-title, +.haskell .hljs-label, +.tex .hljs-command { + color: #458; + font-weight: bold +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal +} + +.hljs-attribute, +.hljs-variable, +.instancevar, +.lisp .hljs-body { + color: #008080 +} + +.hljs-regexp { + color: #B68 +} + +.hljs-class { + color: #458; + font-weight: bold +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-symbol .hljs-keyword, +.ruby .hljs-symbol .keymethods, +.lisp .hljs-keyword, +.tex .hljs-special, +.input_number { + color: #990073 +} + +.builtin, +.constructor, +.hljs-built_in, +.lisp .hljs-title { + color: #0086b3 +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold +} + +.hljs-deletion { + background: #fdd +} + +.hljs-addition { + background: #dfd +} + +.diff .hljs-change { + background: #0086b3 +} + +.hljs-chunk { + color: #aaa +} + +.tex .hljs-formula { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/far.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/far.css new file mode 100644 index 0000000..ecac3c9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/far.css @@ -0,0 +1,113 @@ +/* + +FAR Style (c) MajestiC + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #000080; +} + +.hljs, +.hljs-subst { + color: #0FF; +} + +.hljs-string, +.ruby .hljs-string, +.haskell .hljs-type, +.hljs-tag .hljs-value, +.css .hljs-rules .hljs-value, +.css .hljs-rules .hljs-value .hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-addition, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.clojure .hljs-title, +.coffeescript .hljs-attribute { + color: #FF0; +} + +.hljs-keyword, +.css .hljs-id, +.hljs-title, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.xml .hljs-tag .hljs-title, +.hljs-winutils, +.hljs-flow, +.hljs-change, +.hljs-envvar, +.bash .hljs-variable, +.tex .hljs-special, +.clojure .hljs-built_in { + color: #FFF; +} + +.hljs-comment, +.hljs-phpdoc, +.hljs-javadoc, +.java .hljs-annotation, +.hljs-template_comment, +.hljs-deletion, +.apache .hljs-sqbracket, +.tex .hljs-formula { + color: #888; +} + +.hljs-number, +.hljs-date, +.hljs-regexp, +.hljs-literal, +.smalltalk .hljs-symbol, +.smalltalk .hljs-char, +.clojure .hljs-attribute { + color: #0F0; +} + +.python .hljs-decorator, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.xml .hljs-pi, +.diff .hljs-header, +.hljs-chunk, +.hljs-shebang, +.nginx .hljs-built_in, +.hljs-prompt { + color: #008080; +} + +.hljs-keyword, +.css .hljs-id, +.hljs-title, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.hljs-winutils, +.hljs-flow, +.apache .hljs-tag, +.nginx .hljs-built_in, +.tex .hljs-command, +.tex .hljs-special, +.hljs-request, +.hljs-status { + font-weight: bold; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/foundation.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/foundation.css new file mode 100644 index 0000000..bc8d4df --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/foundation.css @@ -0,0 +1,133 @@ +/* +Description: Foundation 4 docs style for highlight.js +Author: Dan Allen +Website: http://foundation.zurb.com/docs/ +Version: 1.0 +Date: 2013-04-02 +*/ + +.hljs { + display: block; padding: 0.5em; + background: #eee; +} + +.hljs-header, +.hljs-decorator, +.hljs-annotation { + color: #000077; +} + +.hljs-horizontal_rule, +.hljs-link_url, +.hljs-emphasis, +.hljs-attribute { + color: #070; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-link_label, +.hljs-strong, +.hljs-value, +.hljs-string, +.scss .hljs-value .hljs-string { + color: #d14; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-blockquote, +.hljs-comment { + color: #998; + font-style: italic; +} + +.asciidoc .hljs-title, +.hljs-function .hljs-title { + color: #900; +} + +.hljs-class { + color: #458; +} + +.hljs-id, +.hljs-pseudo, +.hljs-constant, +.hljs-hexcolor { + color: teal; +} + +.hljs-variable { + color: #336699; +} + +.hljs-bullet, +.hljs-javadoc { + color: #997700; +} + +.hljs-pi, +.hljs-doctype { + color: #3344bb; +} + +.hljs-code, +.hljs-number { + color: #099; +} + +.hljs-important { + color: #f00; +} + +.smartquote, +.hljs-label { + color: #970; +} + +.hljs-preprocessor, +.hljs-pragma { + color: #579; +} + +.hljs-reserved, +.hljs-keyword, +.scss .hljs-value { + color: #000; +} + +.hljs-regexp { + background-color: #fff0ff; + color: #880088; +} + +.hljs-symbol { + color: #990073; +} + +.hljs-symbol .hljs-string { + color: #a60; +} + +.hljs-tag { + color: #007700; +} + +.hljs-at_rule, +.hljs-at_rule .hljs-keyword { + color: #088; +} + +.hljs-at_rule .hljs-preprocessor { + color: #808; +} + +.scss .hljs-tag, +.scss .hljs-attribute { + color: #339; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/github.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/github.css new file mode 100644 index 0000000..71967a3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/github.css @@ -0,0 +1,125 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; padding: 0.5em; + color: #333; + background: #f8f8f8 +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-javadoc { + color: #998; + font-style: italic +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.javascript .hljs-title, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #333; + font-weight: bold +} + +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #099; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula { + color: #d14 +} + +.hljs-title, +.hljs-id, +.coffeescript .hljs-params, +.scss .hljs-preprocessor { + color: #900; + font-weight: bold +} + +.javascript .hljs-title, +.lisp .hljs-title, +.clojure .hljs-title, +.hljs-subst { + font-weight: normal +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #458; + font-weight: bold +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body { + color: #008080 +} + +.hljs-regexp { + color: #009926 +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073 +} + +.hljs-built_in, +.lisp .hljs-title, +.clojure .hljs-built_in { + color: #0086b3 +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold +} + +.hljs-deletion { + background: #fdd +} + +.hljs-addition { + background: #dfd +} + +.diff .hljs-change { + background: #0086b3 +} + +.hljs-chunk { + color: #aaa +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/googlecode.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/googlecode.css new file mode 100644 index 0000000..45b8b3b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/googlecode.css @@ -0,0 +1,147 @@ +/* + +Google Code style (c) Aahan Krish + +*/ + +.hljs { + display: block; padding: 0.5em; + background: white; color: black; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc, +.hljs-comment * { + color: #800; +} + +.hljs-keyword, +.method, +.hljs-list .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.hljs-tag .hljs-title, +.setting .hljs-value, +.hljs-winutils, +.tex .hljs-command, +.http .hljs-title, +.hljs-request, +.hljs-status { + color: #008; +} + +.hljs-envvar, +.tex .hljs-special { + color: #660; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.hljs-regexp, +.coffeescript .hljs-attribute { + color: #080; +} + +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-decorator, +.ini .hljs-title, +.hljs-shebang, +.hljs-prompt, +.hljs-hexcolor, +.hljs-rules .hljs-value, +.css .hljs-value .hljs-number, +.hljs-literal, +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-number, +.css .hljs-function, +.clojure .hljs-attribute { + color: #066; +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc, +.hljs-typename, +.hljs-tag .hljs-attribute, +.hljs-doctype, +.hljs-class .hljs-id, +.hljs-built_in, +.setting, +.hljs-params, +.hljs-variable, +.clojure .hljs-title { + color: #606; +} + +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.hljs-subst { + color: #000; +} + +.css .hljs-class, +.css .hljs-id { + color: #9B703F; +} + +.hljs-value .hljs-important { + color: #ff7700; + font-weight: bold; +} + +.hljs-rules .hljs-keyword { + color: #C5AF75; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9B859D; +} + +.hljs-preprocessor, +.hljs-preprocessor *, +.hljs-pragma { + color: #444; +} + +.tex .hljs-formula { + background-color: #EEE; + font-style: italic; +} + +.diff .hljs-header, +.hljs-chunk { + color: #808080; + font-weight: bold; +} + +.diff .hljs-change { + background-color: #BCCFF9; +} + +.hljs-addition { + background-color: #BAEEBA; +} + +.hljs-deletion { + background-color: #FFC8BD; +} + +.hljs-comment .hljs-yardoctag { + font-weight: bold; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/idea.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/idea.css new file mode 100644 index 0000000..77352f4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/idea.css @@ -0,0 +1,122 @@ +/* + +Intellij Idea-like styling (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; padding: 0.5em; + color: #000; + background: #fff; +} + +.hljs-subst, +.hljs-title { + font-weight: normal; + color: #000; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc, +.diff .hljs-header { + color: #808080; + font-style: italic; +} + +.hljs-annotation, +.hljs-decorator, +.hljs-preprocessor, +.hljs-pragma, +.hljs-doctype, +.hljs-pi, +.hljs-chunk, +.hljs-shebang, +.apache .hljs-cbracket, +.hljs-prompt, +.http .hljs-title { + color: #808000; +} + +.hljs-tag, +.hljs-pi { + background: #efefef; +} + +.hljs-tag .hljs-title, +.hljs-id, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-literal, +.hljs-keyword, +.hljs-hexcolor, +.css .hljs-function, +.ini .hljs-title, +.css .hljs-class, +.hljs-list .hljs-title, +.clojure .hljs-title, +.nginx .hljs-title, +.tex .hljs-command, +.hljs-request, +.hljs-status { + font-weight: bold; + color: #000080; +} + +.hljs-attribute, +.hljs-rules .hljs-keyword, +.hljs-number, +.hljs-date, +.hljs-regexp, +.tex .hljs-special { + font-weight: bold; + color: #0000ff; +} + +.hljs-number, +.hljs-regexp { + font-weight: normal; +} + +.hljs-string, +.hljs-value, +.hljs-filter .hljs-argument, +.css .hljs-function .hljs-params, +.apache .hljs-tag { + color: #008000; + font-weight: bold; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-char, +.tex .hljs-formula { + color: #000; + background: #d0eded; + font-style: italic; +} + +.hljs-phpdoc, +.hljs-yardoctag, +.hljs-javadoctag { + text-decoration: underline; +} + +.hljs-variable, +.hljs-envvar, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #660e7a; +} + +.hljs-addition { + background: #baeeba; +} + +.hljs-deletion { + background: #ffc8bd; +} + +.diff .hljs-change { + background: #bccff9; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ir_black.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ir_black.css new file mode 100644 index 0000000..cc64ef5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/ir_black.css @@ -0,0 +1,105 @@ +/* + IR_Black style (c) Vasily Mikhailitchenko +*/ + +.hljs { + display: block; padding: 0.5em; + background: #000; color: #f8f8f8; +} + +.hljs-shebang, +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc { + color: #7c7c7c; +} + +.hljs-keyword, +.hljs-tag, +.tex .hljs-command, +.hljs-request, +.hljs-status, +.clojure .hljs-attribute { + color: #96CBFE; +} + +.hljs-sub .hljs-keyword, +.method, +.hljs-list .hljs-title, +.nginx .hljs-title { + color: #FFFFB6; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.coffeescript .hljs-attribute { + color: #A8FF60; +} + +.hljs-subst { + color: #DAEFA3; +} + +.hljs-regexp { + color: #E9C062; +} + +.hljs-title, +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-decorator, +.tex .hljs-special, +.haskell .hljs-type, +.hljs-constant, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc, +.nginx .hljs-built_in { + color: #FFFFB6; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-number, +.hljs-variable, +.vbscript, +.hljs-literal { + color: #C6C5FE; +} + +.css .hljs-tag { + color: #96CBFE; +} + +.css .hljs-rules .hljs-property, +.css .hljs-id { + color: #FFFFB6; +} + +.css .hljs-class { + color: #FFF; +} + +.hljs-hexcolor { + color: #C6C5FE; +} + +.hljs-number { + color:#FF73FD; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.7; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/magula.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/magula.css new file mode 100644 index 0000000..cafe3d3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/magula.css @@ -0,0 +1,123 @@ +/* +Description: Magula style for highligh.js +Author: Ruslan Keba +Website: http://rukeba.com/ +Version: 1.0 +Date: 2009-01-03 +Music: Aphex Twin / Xtal +*/ + +.hljs { + display: block; padding: 0.5em; + background-color: #f4f4f4; +} + +.hljs, +.hljs-subst, +.lisp .hljs-title, +.clojure .hljs-built_in { + color: black; +} + +.hljs-string, +.hljs-title, +.hljs-parent, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.hljs-rules .hljs-value .hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-aggregate, +.hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-addition, +.hljs-flow, +.hljs-stream, +.bash .hljs-variable, +.apache .hljs-cbracket, +.coffeescript .hljs-attribute { + color: #050; +} + +.hljs-comment, +.hljs-annotation, +.hljs-template_comment, +.diff .hljs-header, +.hljs-chunk { + color: #777; +} + +.hljs-number, +.hljs-date, +.hljs-regexp, +.hljs-literal, +.smalltalk .hljs-symbol, +.smalltalk .hljs-char, +.hljs-change, +.tex .hljs-special { + color: #800; +} + +.hljs-label, +.hljs-javadoc, +.ruby .hljs-string, +.hljs-decorator, +.hljs-filter .hljs-argument, +.hljs-localvars, +.hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-envvar, +.hljs-shebang, +.apache .hljs-sqbracket, +.nginx .hljs-built_in, +.tex .hljs-formula, +.hljs-prompt, +.clojure .hljs-attribute { + color: #00e; +} + +.hljs-keyword, +.hljs-id, +.hljs-phpdoc, +.hljs-title, +.hljs-built_in, +.hljs-aggregate, +.smalltalk .hljs-class, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.xml .hljs-tag, +.tex .hljs-command, +.hljs-request, +.hljs-status { + font-weight: bold; + color: navy; +} + +.nginx .hljs-built_in { + font-weight: normal; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} + +/* --- */ +.apache .hljs-tag { + font-weight: bold; + color: blue; +} + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/mono-blue.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/mono-blue.css new file mode 100644 index 0000000..4152d82 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/mono-blue.css @@ -0,0 +1,62 @@ +/* + Five-color theme from a single blue hue. +*/ +.hljs { + display: block; padding: 0.5em; + background: #EAEEF3; color: #00193A; +} + +.hljs-keyword, +.hljs-title, +.hljs-important, +.hljs-request, +.hljs-header, +.hljs-javadoctag { + font-weight: bold; +} + +.hljs-comment, +.hljs-chunk, +.hljs-template_comment { + color: #738191; +} + +.hljs-string, +.hljs-title, +.hljs-parent, +.hljs-built_in, +.hljs-literal, +.hljs-filename, +.hljs-value, +.hljs-addition, +.hljs-tag, +.hljs-argument, +.hljs-link_label, +.hljs-blockquote, +.hljs-header { + color: #0048AB; +} + +.hljs-decorator, +.hljs-prompt, +.hljs-yardoctag, +.hljs-subst, +.hljs-symbol, +.hljs-doctype, +.hljs-regexp, +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-attribute, +.hljs-attr_selector, +.hljs-javadoc, +.hljs-xmlDocTag, +.hljs-deletion, +.hljs-shebang, +.hljs-string .hljs-variable, +.hljs-link_url, +.hljs-bullet, +.hljs-sqbracket, +.hljs-phony { + color: #4C81C9; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai.css new file mode 100644 index 0000000..4e49bef --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai.css @@ -0,0 +1,127 @@ +/* +Monokai style - ported by Luigi Maselli - http://grigio.org +*/ + +.hljs { + display: block; padding: 0.5em; + background: #272822; +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-keyword, +.hljs-literal, +.hljs-strong, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.tex .hljs-special { + color: #F92672; +} + +.hljs { + color: #DDD; +} + +.hljs .hljs-constant, +.asciidoc .hljs-code { + color: #66D9EF; +} + +.hljs-code, +.hljs-class .hljs-title, +.hljs-header { + color: white; +} + +.hljs-link_label, +.hljs-attribute, +.hljs-symbol, +.hljs-symbol .hljs-string, +.hljs-value, +.hljs-regexp { + color: #BF79DB; +} + +.hljs-link_url, +.hljs-tag .hljs-value, +.hljs-string, +.hljs-bullet, +.hljs-subst, +.hljs-title, +.hljs-emphasis, +.haskell .hljs-type, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-javadoc, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.hljs-prompt { + color: #A6E22E; +} + +.hljs-comment, +.java .hljs-annotation, +.smartquote, +.hljs-blockquote, +.hljs-horizontal_rule, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket, +.tex .hljs-formula { + color: #75715E; +} + +.hljs-keyword, +.hljs-literal, +.css .hljs-id, +.hljs-phpdoc, +.hljs-title, +.hljs-header, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.diff .hljs-header, +.hljs-chunk, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.tex .hljs-special, +.hljs-request, +.hljs-status { + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai_sublime.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai_sublime.css new file mode 100644 index 0000000..7b0eb2e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/monokai_sublime.css @@ -0,0 +1,149 @@ +/* + +Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ + +*/ + +.hljs { + display: block; + padding: 0.5em; + background: #23241f; +} + +.hljs, +.hljs-tag, +.css .hljs-rules, +.css .hljs-value, +.css .hljs-function +.hljs-preprocessor, +.hljs-pragma { + color: #f8f8f2; +} + +.hljs-strongemphasis, +.hljs-strong, +.hljs-emphasis { + color: #a8a8a2; +} + +.hljs-bullet, +.hljs-blockquote, +.hljs-horizontal_rule, +.hljs-number, +.hljs-regexp, +.alias .hljs-keyword, +.hljs-literal, +.hljs-hexcolor { + color: #ae81ff; +} + +.hljs-tag .hljs-value, +.hljs-code, +.hljs-title, +.css .hljs-class, +.hljs-class .hljs-title:last-child { + color: #a6e22e; +} + +.hljs-link_url { + font-size: 80%; +} + +.hljs-strong, +.hljs-strongemphasis { + font-weight: bold; +} + +.hljs-emphasis, +.hljs-strongemphasis, +.hljs-class .hljs-title:last-child { + font-style: italic; +} + +.hljs-keyword, +.hljs-function, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.tex .hljs-special, +.hljs-header, +.hljs-attribute, +.hljs-symbol, +.hljs-symbol .hljs-string, +.hljs-tag .hljs-title, +.hljs-value, +.alias .hljs-keyword:first-child, +.css .hljs-tag, +.css .unit, +.css .hljs-important { + color: #F92672; +} + +.hljs-function .hljs-keyword, +.hljs-class .hljs-keyword:first-child, +.hljs-constant, +.css .hljs-attribute { + color: #66d9ef; +} + +.hljs-variable, +.hljs-params, +.hljs-class .hljs-title { + color: #f8f8f2; +} + +.hljs-string, +.css .hljs-id, +.hljs-subst, +.haskell .hljs-type, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.hljs-prompt, +.hljs-link_label, +.hljs-link_url { + color: #e6db74; +} + +.hljs-comment, +.hljs-javadoc, +.java .hljs-annotation, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket, +.tex .hljs-formula { + color: #75715e; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata, +.xml .php, +.php .xml { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/obsidian.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/obsidian.css new file mode 100644 index 0000000..1174e4c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/obsidian.css @@ -0,0 +1,154 @@ +/** + * Obsidian style + * ported by Alexander Marenin (http://github.com/ioncreature) + */ + +.hljs { + display: block; padding: 0.5em; + background: #282B2E; +} + +.hljs-keyword, +.hljs-literal, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.css .hljs-id, +.tex .hljs-special { + color: #93C763; +} + +.hljs-number { + color: #FFCD22; +} + +.hljs { + color: #E0E2E4; +} + +.css .hljs-tag, +.css .hljs-pseudo { + color: #D0D2B5; +} + +.hljs-attribute, +.hljs .hljs-constant { + color: #668BB0; +} + +.xml .hljs-attribute { + color: #B3B689; +} + +.xml .hljs-tag .hljs-value { + color: #E8E2B7; +} + +.hljs-code, +.hljs-class .hljs-title, +.hljs-header { + color: white; +} + +.hljs-class, +.hljs-hexcolor { + color: #93C763; +} + +.hljs-regexp { + color: #D39745; +} + +.hljs-at_rule, +.hljs-at_rule .hljs-keyword { + color: #A082BD; +} + +.hljs-doctype { + color: #557182; +} + +.hljs-link_url, +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-bullet, +.hljs-subst, +.hljs-emphasis, +.haskell .hljs-type, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-javadoc, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.tex .hljs-command, +.hljs-prompt { + color: #8CBBAD; +} + +.hljs-string { + color: #EC7600; +} + +.hljs-comment, +.java .hljs-annotation, +.hljs-blockquote, +.hljs-horizontal_rule, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket, +.tex .hljs-formula { + color: #818E96; +} + +.hljs-keyword, +.hljs-literal, +.css .hljs-id, +.hljs-phpdoc, +.hljs-title, +.hljs-header, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.diff .hljs-header, +.hljs-chunk, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.tex .hljs-special, +.hljs-request, +.hljs-at_rule .hljs-keyword, +.hljs-status { + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.dark.css new file mode 100644 index 0000000..bbbccdd --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.dark.css @@ -0,0 +1,93 @@ +/* + Paraíso (dark) + Created by Jan T. Sott (http://github.com/idleberg) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) +*/ + +/* Paraíso Comment */ +.hljs-comment, +.hljs-title { + color: #8d8687; +} + +/* Paraíso Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #ef6155; +} + +/* Paraíso Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #f99b15; +} + +/* Paraíso Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #fec418; +} + +/* Paraíso Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #48b685; +} + +/* Paraíso Aqua */ +.css .hljs-hexcolor { + color: #5bc4bf; +} + +/* Paraíso Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #06b6ef; +} + +/* Paraíso Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #815ba4; +} + +.hljs { + display: block; + background: #2f1e2e; + color: #a39e9b; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.light.css new file mode 100644 index 0000000..494fcb4 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/paraiso.light.css @@ -0,0 +1,93 @@ +/* + Paraíso (light) + Created by Jan T. Sott (http://github.com/idleberg) + Inspired by the art of Rubens LP (http://www.rubenslp.com.br) +*/ + +/* Paraíso Comment */ +.hljs-comment, +.hljs-title { + color: #776e71; +} + +/* Paraíso Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #ef6155; +} + +/* Paraíso Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #f99b15; +} + +/* Paraíso Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #fec418; +} + +/* Paraíso Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #48b685; +} + +/* Paraíso Aqua */ +.css .hljs-hexcolor { + color: #5bc4bf; +} + +/* Paraíso Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #06b6ef; +} + +/* Paraíso Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #815ba4; +} + +.hljs { + display: block; + background: #e7e9db; + color: #4f424c; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.css new file mode 100644 index 0000000..6ee925d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.css @@ -0,0 +1,106 @@ +/* + +Pojoaque Style by Jason Tate +http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html +Based on Solarized Style from http://ethanschoonover.com/solarized + +*/ + +.hljs { + display: block; padding: 0.5em; + color: #DCCF8F; + background: url(./pojoaque.jpg) repeat scroll left top #181914; +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-doctype, +.lisp .hljs-string, +.hljs-javadoc { + color: #586e75; + font-style: italic; +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.javascript .hljs-title, +.method, +.hljs-addition, +.css .hljs-tag, +.clojure .hljs-title, +.nginx .hljs-title { + color: #B64926; +} + +.hljs-number, +.hljs-command, +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula, +.hljs-regexp, +.hljs-hexcolor { + color: #468966; +} + +.hljs-title, +.hljs-localvars, +.hljs-function .hljs-title, +.hljs-chunk, +.hljs-decorator, +.hljs-built_in, +.lisp .hljs-title, +.clojure .hljs-built_in, +.hljs-identifier, +.hljs-id { + color: #FFB03B; +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body, +.smalltalk .hljs-number, +.hljs-constant, +.hljs-class .hljs-title, +.hljs-parent, +.haskell .hljs-type { + color: #b58900; +} + +.css .hljs-attribute { + color: #b89859; +} + +.css .hljs-number, +.css .hljs-hexcolor { + color: #DCCF8F; +} + +.css .hljs-class { + color: #d3a60c; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-shebang, +.hljs-symbol, +.hljs-symbol .hljs-string, +.diff .hljs-change, +.hljs-special, +.hljs-attr_selector, +.hljs-important, +.hljs-subst, +.hljs-cdata { + color: #cb4b16; +} + +.hljs-deletion { + color: #dc322f; +} + +.tex .hljs-formula { + background: #073642; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.jpg b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.jpg new file mode 100644 index 0000000..9c07d4a Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/pojoaque.jpg differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/railscasts.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/railscasts.css new file mode 100644 index 0000000..6a38064 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/railscasts.css @@ -0,0 +1,182 @@ +/* + +Railscasts-like style (c) Visoft, Inc. (Damien White) + +*/ + +.hljs { + display: block; + padding: 0.5em; + background: #232323; + color: #E6E1DC; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc, +.hljs-shebang { + color: #BC9458; + font-style: italic; +} + +.hljs-keyword, +.ruby .hljs-function .hljs-keyword, +.hljs-request, +.hljs-status, +.nginx .hljs-title, +.method, +.hljs-list .hljs-title { + color: #C26230; +} + +.hljs-string, +.hljs-number, +.hljs-regexp, +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.tex .hljs-command, +.markdown .hljs-link_label { + color: #A5C261; +} + +.hljs-subst { + color: #519F50; +} + +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-tag .hljs-title, +.hljs-doctype, +.hljs-sub .hljs-identifier, +.hljs-pi, +.input_number { + color: #E8BF6A; +} + +.hljs-identifier { + color: #D0D0FF; +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc { + text-decoration: none; +} + +.hljs-constant { + color: #DA4939; +} + + +.hljs-symbol, +.hljs-built_in, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-symbol .hljs-identifier, +.markdown .hljs-link_url, +.hljs-attribute { + color: #6D9CBE; +} + +.markdown .hljs-link_url { + text-decoration: underline; +} + + + +.hljs-params, +.hljs-variable, +.clojure .hljs-attribute { + color: #D0D0FF; +} + +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.tex .hljs-special { + color: #CDA869; +} + +.css .hljs-class { + color: #9B703F; +} + +.hljs-rules .hljs-keyword { + color: #C5AF75; +} + +.hljs-rules .hljs-value { + color: #CF6A4C; +} + +.css .hljs-id { + color: #8B98AB; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9B859D; +} + +.hljs-preprocessor, +.hljs-preprocessor *, +.hljs-pragma { + color: #8996A8 !important; +} + +.hljs-hexcolor, +.css .hljs-value .hljs-number { + color: #A5C261; +} + +.hljs-title, +.hljs-decorator, +.css .hljs-function { + color: #FFC66D; +} + +.diff .hljs-header, +.hljs-chunk { + background-color: #2F33AB; + color: #E6E1DC; + display: inline-block; + width: 100%; +} + +.diff .hljs-change { + background-color: #4A410D; + color: #F8F8F8; + display: inline-block; + width: 100%; +} + +.hljs-addition { + background-color: #144212; + color: #E6E1DC; + display: inline-block; + width: 100%; +} + +.hljs-deletion { + background-color: #600; + color: #E6E1DC; + display: inline-block; + width: 100%; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.7; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/rainbow.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/rainbow.css new file mode 100644 index 0000000..d9ffef6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/rainbow.css @@ -0,0 +1,112 @@ +/* + +Style with support for rainbow parens + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #474949; color: #D1D9E1; +} + + +.hljs-body, +.hljs-collection { + color: #D1D9E1; +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-doctype, +.lisp .hljs-string, +.hljs-javadoc { + color: #969896; + font-style: italic; +} + +.hljs-keyword, +.clojure .hljs-attribute, +.hljs-winutils, +.javascript .hljs-title, +.hljs-addition, +.css .hljs-tag { + color: #cc99cc; +} + +.hljs-number { color: #f99157; } + +.hljs-command, +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula, +.hljs-regexp, +.hljs-hexcolor { + color: #8abeb7; +} + +.hljs-title, +.hljs-localvars, +.hljs-function .hljs-title, +.hljs-chunk, +.hljs-decorator, +.hljs-built_in, +.lisp .hljs-title, +.hljs-identifier +{ + color: #b5bd68; +} + +.hljs-class .hljs-keyword +{ + color: #f2777a; +} + +.hljs-variable, +.lisp .hljs-body, +.smalltalk .hljs-number, +.hljs-constant, +.hljs-class .hljs-title, +.hljs-parent, +.haskell .hljs-label, +.hljs-id, +.lisp .hljs-title, +.clojure .hljs-title .hljs-built_in { + color: #ffcc66; +} + +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword, +.clojure .hljs-title .hljs-built_in { + font-weight: bold; +} + +.hljs-attribute, +.clojure .hljs-title { + color: #81a2be; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-shebang, +.hljs-symbol, +.hljs-symbol .hljs-string, +.diff .hljs-change, +.hljs-special, +.hljs-attr_selector, +.hljs-important, +.hljs-subst, +.hljs-cdata { + color: #f99157; +} + +.hljs-deletion { + color: #dc322f; +} + +.tex .hljs-formula { + background: #eee8d5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.css new file mode 100644 index 0000000..98a3bd2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.css @@ -0,0 +1,113 @@ +/* + +School Book style from goldblog.com.ua (c) Zaripov Yura + +*/ + +.hljs { + display: block; padding: 15px 0.5em 0.5em 30px; + font-size: 11px !important; + line-height:16px !important; +} + +pre{ + background:#f6f6ae url(./school_book.png); + border-top: solid 2px #d2e8b9; + border-bottom: solid 1px #d2e8b9; +} + +.hljs-keyword, +.hljs-literal, +.hljs-change, +.hljs-winutils, +.hljs-flow, +.lisp .hljs-title, +.clojure .hljs-built_in, +.nginx .hljs-title, +.tex .hljs-special { + color:#005599; + font-weight:bold; +} + +.hljs, +.hljs-subst, +.hljs-tag .hljs-keyword { + color: #3E5915; +} + +.hljs-string, +.hljs-title, +.haskell .hljs-type, +.hljs-tag .hljs-value, +.css .hljs-rules .hljs-value, +.hljs-preprocessor, +.hljs-pragma, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-class .hljs-parent, +.hljs-built_in, +.sql .hljs-aggregate, +.django .hljs-template_tag, +.django .hljs-variable, +.smalltalk .hljs-class, +.hljs-javadoc, +.ruby .hljs-string, +.django .hljs-filter .hljs-argument, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-addition, +.hljs-stream, +.hljs-envvar, +.apache .hljs-tag, +.apache .hljs-cbracket, +.nginx .hljs-built_in, +.tex .hljs-command, +.coffeescript .hljs-attribute { + color: #2C009F; +} + +.hljs-comment, +.java .hljs-annotation, +.python .hljs-decorator, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-shebang, +.apache .hljs-sqbracket { + color: #E60415; +} + +.hljs-keyword, +.hljs-literal, +.css .hljs-id, +.hljs-phpdoc, +.hljs-title, +.haskell .hljs-type, +.vbscript .hljs-built_in, +.sql .hljs-aggregate, +.rsl .hljs-built_in, +.smalltalk .hljs-class, +.xml .hljs-tag .hljs-title, +.diff .hljs-header, +.hljs-chunk, +.hljs-winutils, +.bash .hljs-variable, +.apache .hljs-tag, +.tex .hljs-command, +.hljs-request, +.hljs-status { + font-weight: bold; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.png new file mode 100644 index 0000000..956e979 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/school_book.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_dark.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_dark.css new file mode 100644 index 0000000..f520533 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_dark.css @@ -0,0 +1,107 @@ +/* + +Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull + +*/ + +.hljs { + display: block; + padding: 0.5em; + background: #002b36; + color: #839496; +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-doctype, +.hljs-pi, +.lisp .hljs-string, +.hljs-javadoc { + color: #586e75; +} + +/* Solarized Green */ +.hljs-keyword, +.hljs-winutils, +.method, +.hljs-addition, +.css .hljs-tag, +.hljs-request, +.hljs-status, +.nginx .hljs-title { + color: #859900; +} + +/* Solarized Cyan */ +.hljs-number, +.hljs-command, +.hljs-string, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula, +.hljs-regexp, +.hljs-hexcolor, +.hljs-link_url { + color: #2aa198; +} + +/* Solarized Blue */ +.hljs-title, +.hljs-localvars, +.hljs-chunk, +.hljs-decorator, +.hljs-built_in, +.hljs-identifier, +.vhdl .hljs-literal, +.hljs-id, +.css .hljs-function { + color: #268bd2; +} + +/* Solarized Yellow */ +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body, +.smalltalk .hljs-number, +.hljs-constant, +.hljs-class .hljs-title, +.hljs-parent, +.haskell .hljs-type, +.hljs-link_reference { + color: #b58900; +} + +/* Solarized Orange */ +.hljs-preprocessor, +.hljs-preprocessor .hljs-keyword, +.hljs-pragma, +.hljs-shebang, +.hljs-symbol, +.hljs-symbol .hljs-string, +.diff .hljs-change, +.hljs-special, +.hljs-attr_selector, +.hljs-subst, +.hljs-cdata, +.clojure .hljs-title, +.css .hljs-pseudo, +.hljs-header { + color: #cb4b16; +} + +/* Solarized Red */ +.hljs-deletion, +.hljs-important { + color: #dc322f; +} + +/* Solarized Violet */ +.hljs-link_label { + color: #6c71c4; +} + +.tex .hljs-formula { + background: #073642; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_light.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_light.css new file mode 100644 index 0000000..ad70474 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/solarized_light.css @@ -0,0 +1,107 @@ +/* + +Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull + +*/ + +.hljs { + display: block; + padding: 0.5em; + background: #fdf6e3; + color: #657b83; +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-doctype, +.hljs-pi, +.lisp .hljs-string, +.hljs-javadoc { + color: #93a1a1; +} + +/* Solarized Green */ +.hljs-keyword, +.hljs-winutils, +.method, +.hljs-addition, +.css .hljs-tag, +.hljs-request, +.hljs-status, +.nginx .hljs-title { + color: #859900; +} + +/* Solarized Cyan */ +.hljs-number, +.hljs-command, +.hljs-string, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula, +.hljs-regexp, +.hljs-hexcolor, +.hljs-link_url { + color: #2aa198; +} + +/* Solarized Blue */ +.hljs-title, +.hljs-localvars, +.hljs-chunk, +.hljs-decorator, +.hljs-built_in, +.hljs-identifier, +.vhdl .hljs-literal, +.hljs-id, +.css .hljs-function { + color: #268bd2; +} + +/* Solarized Yellow */ +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body, +.smalltalk .hljs-number, +.hljs-constant, +.hljs-class .hljs-title, +.hljs-parent, +.haskell .hljs-type, +.hljs-link_reference { + color: #b58900; +} + +/* Solarized Orange */ +.hljs-preprocessor, +.hljs-preprocessor .hljs-keyword, +.hljs-pragma, +.hljs-shebang, +.hljs-symbol, +.hljs-symbol .hljs-string, +.diff .hljs-change, +.hljs-special, +.hljs-attr_selector, +.hljs-subst, +.hljs-cdata, +.clojure .hljs-title, +.css .hljs-pseudo, +.hljs-header { + color: #cb4b16; +} + +/* Solarized Red */ +.hljs-deletion, +.hljs-important { + color: #dc322f; +} + +/* Solarized Violet */ +.hljs-link_label { + color: #6c71c4; +} + +.tex .hljs-formula { + background: #eee8d5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/sunburst.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/sunburst.css new file mode 100644 index 0000000..07b30c2 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/sunburst.css @@ -0,0 +1,160 @@ +/* + +Sunburst-like style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #000; color: #f8f8f8; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc { + color: #aeaeae; + font-style: italic; +} + +.hljs-keyword, +.ruby .hljs-function .hljs-keyword, +.hljs-request, +.hljs-status, +.nginx .hljs-title { + color: #E28964; +} + +.hljs-function .hljs-keyword, +.hljs-sub .hljs-keyword, +.method, +.hljs-list .hljs-title { + color: #99CF50; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.tex .hljs-command, +.coffeescript .hljs-attribute { + color: #65B042; +} + +.hljs-subst { + color: #DAEFA3; +} + +.hljs-regexp { + color: #E9C062; +} + +.hljs-title, +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-decorator, +.hljs-shebang, +.hljs-prompt { + color: #89BDFF; +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc { + text-decoration: underline; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-number { + color: #3387CC; +} + +.hljs-params, +.hljs-variable, +.clojure .hljs-attribute { + color: #3E87E3; +} + +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.tex .hljs-special { + color: #CDA869; +} + +.css .hljs-class { + color: #9B703F; +} + +.hljs-rules .hljs-keyword { + color: #C5AF75; +} + +.hljs-rules .hljs-value { + color: #CF6A4C; +} + +.css .hljs-id { + color: #8B98AB; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9B859D; +} + +.hljs-preprocessor, +.hljs-pragma { + color: #8996A8; +} + +.hljs-hexcolor, +.css .hljs-value .hljs-number { + color: #DD7B3B; +} + +.css .hljs-function { + color: #DAD085; +} + +.diff .hljs-header, +.hljs-chunk, +.tex .hljs-formula { + background-color: #0E2231; + color: #F8F8F8; + font-style: italic; +} + +.diff .hljs-change { + background-color: #4A410D; + color: #F8F8F8; +} + +.hljs-addition { + background-color: #253B22; + color: #F8F8F8; +} + +.hljs-deletion { + background-color: #420E09; + color: #F8F8F8; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-blue.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-blue.css new file mode 100644 index 0000000..dfe2675 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-blue.css @@ -0,0 +1,93 @@ +/* Tomorrow Night Blue Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-title { + color: #7285b7; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #ff9da4; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #ffc58f; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #ffeead; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #d1f1a9; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #99ffff; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #bbdaff; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #ebbbff; +} + +.hljs { + display: block; + background: #002451; + color: white; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-bright.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-bright.css new file mode 100644 index 0000000..4ad5d25 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-bright.css @@ -0,0 +1,92 @@ +/* Tomorrow Night Bright Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-title { + color: #969896; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #d54e53; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #e78c45; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #e7c547; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #b9ca4a; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #70c0b1; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #7aa6da; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #c397d8; +} + +.hljs { + display: block; + background: black; + color: #eaeaea; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-eighties.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-eighties.css new file mode 100644 index 0000000..08b49c6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night-eighties.css @@ -0,0 +1,92 @@ +/* Tomorrow Night Eighties Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-title { + color: #999999; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #f2777a; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #f99157; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #ffcc66; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #99cc99; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #66cccc; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #6699cc; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #cc99cc; +} + +.hljs { + display: block; + background: #2d2d2d; + color: #cccccc; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night.css new file mode 100644 index 0000000..c269b17 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow-night.css @@ -0,0 +1,93 @@ +/* Tomorrow Night Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-title { + color: #969896; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #cc6666; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #de935f; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #f0c674; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #b5bd68; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #8abeb7; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #81a2be; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #b294bb; +} + +.hljs { + display: block; + background: #1d1f21; + color: #c5c8c6; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow.css new file mode 100644 index 0000000..3bdead6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/tomorrow.css @@ -0,0 +1,90 @@ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment, +.hljs-title { + color: #8e908c; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #c82829; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #f5871f; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rules .hljs-attribute { + color: #eab700; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #718c00; +} + +/* Tomorrow Aqua */ +.css .hljs-hexcolor { + color: #3e999f; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #4271ae; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #8959a8; +} + +.hljs { + display: block; + background: white; + color: #4d4d4c; + padding: 0.5em; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/vs.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/vs.css new file mode 100644 index 0000000..bf33f0f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/vs.css @@ -0,0 +1,89 @@ +/* + +Visual Studio-like style based on original C# coloring by Jason Diamond + +*/ +.hljs { + display: block; padding: 0.5em; + background: white; color: black; +} + +.hljs-comment, +.hljs-annotation, +.hljs-template_comment, +.diff .hljs-header, +.hljs-chunk, +.apache .hljs-cbracket { + color: #008000; +} + +.hljs-keyword, +.hljs-id, +.hljs-built_in, +.smalltalk .hljs-class, +.hljs-winutils, +.bash .hljs-variable, +.tex .hljs-command, +.hljs-request, +.hljs-status, +.nginx .hljs-title, +.xml .hljs-tag, +.xml .hljs-tag .hljs-value { + color: #00f; +} + +.hljs-string, +.hljs-title, +.hljs-parent, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.hljs-rules .hljs-value .hljs-number, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-aggregate, +.hljs-template_tag, +.django .hljs-variable, +.hljs-addition, +.hljs-flow, +.hljs-stream, +.apache .hljs-tag, +.hljs-date, +.tex .hljs-formula, +.coffeescript .hljs-attribute { + color: #a31515; +} + +.ruby .hljs-string, +.hljs-decorator, +.hljs-filter .hljs-argument, +.hljs-localvars, +.hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-envvar, +.hljs-shebang, +.hljs-preprocessor, +.hljs-pragma, +.userType, +.apache .hljs-sqbracket, +.nginx .hljs-built_in, +.tex .hljs-special, +.hljs-prompt { + color: #2b91af; +} + +.hljs-phpdoc, +.hljs-javadoc, +.hljs-xmlDocTag { + color: #808080; +} + +.vhdl .hljs-typename { font-weight: bold; } +.vhdl .hljs-string { color: #666666; } +.vhdl .hljs-literal { color: #a31515; } +.vhdl .hljs-attribute { color: #00B0E8; } + +.xml .hljs-attribute { color: #f00; } diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/xcode.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/xcode.css new file mode 100644 index 0000000..57bd748 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/xcode.css @@ -0,0 +1,158 @@ +/* + +XCode style (c) Angel Garcia + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #fff; color: black; +} + +.hljs-comment, +.hljs-template_comment, +.hljs-javadoc, +.hljs-comment * { + color: #006a00; +} + +.hljs-keyword, +.hljs-literal, +.nginx .hljs-title { + color: #aa0d91; +} +.method, +.hljs-list .hljs-title, +.hljs-tag .hljs-title, +.setting .hljs-value, +.hljs-winutils, +.tex .hljs-command, +.http .hljs-title, +.hljs-request, +.hljs-status { + color: #008; +} + +.hljs-envvar, +.tex .hljs-special { + color: #660; +} + +.hljs-string { + color: #c41a16; +} +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.hljs-regexp { + color: #080; +} + +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-decorator, +.ini .hljs-title, +.hljs-shebang, +.hljs-prompt, +.hljs-hexcolor, +.hljs-rules .hljs-value, +.css .hljs-value .hljs-number, +.hljs-symbol, +.hljs-symbol .hljs-string, +.hljs-number, +.css .hljs-function, +.clojure .hljs-title, +.clojure .hljs-built_in, +.hljs-function .hljs-title, +.coffeescript .hljs-attribute { + color: #1c00cf; +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc, +.hljs-typename, +.hljs-tag .hljs-attribute, +.hljs-doctype, +.hljs-class .hljs-id, +.hljs-built_in, +.setting, +.hljs-params, +.clojure .hljs-attribute { + color: #5c2699; +} + +.hljs-variable { + color: #3f6e74; +} +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.hljs-subst { + color: #000; +} + +.css .hljs-class, +.css .hljs-id { + color: #9B703F; +} + +.hljs-value .hljs-important { + color: #ff7700; + font-weight: bold; +} + +.hljs-rules .hljs-keyword { + color: #C5AF75; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9B859D; +} + +.hljs-preprocessor, +.hljs-preprocessor *, +.hljs-pragma { + color: #643820; +} + +.tex .hljs-formula { + background-color: #EEE; + font-style: italic; +} + +.diff .hljs-header, +.hljs-chunk { + color: #808080; + font-weight: bold; +} + +.diff .hljs-change { + background-color: #BCCFF9; +} + +.hljs-addition { + background-color: #BAEEBA; +} + +.hljs-deletion { + background-color: #FFC8BD; +} + +.hljs-comment .hljs-yardoctag { + font-weight: bold; +} + +.method .hljs-id { + color: #000; +} diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/zenburn.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/zenburn.css new file mode 100644 index 0000000..f6cb098 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/zenburn.css @@ -0,0 +1,117 @@ +/* + +Zenburn style from voldmar.ru (c) Vladimir Epifanov +based on dark.css by Ivan Sagalaev + +*/ + +.hljs { + display: block; padding: 0.5em; + background: #3F3F3F; + color: #DCDCDC; +} + +.hljs-keyword, +.hljs-tag, +.css .hljs-class, +.css .hljs-id, +.lisp .hljs-title, +.nginx .hljs-title, +.hljs-request, +.hljs-status, +.clojure .hljs-attribute { + color: #E3CEAB; +} + +.django .hljs-template_tag, +.django .hljs-variable, +.django .hljs-filter .hljs-argument { + color: #DCDCDC; +} + +.hljs-number, +.hljs-date { + color: #8CD0D3; +} + +.dos .hljs-envvar, +.dos .hljs-stream, +.hljs-variable, +.apache .hljs-sqbracket { + color: #EFDCBC; +} + +.dos .hljs-flow, +.diff .hljs-change, +.python .exception, +.python .hljs-built_in, +.hljs-literal, +.tex .hljs-special { + color: #EFEFAF; +} + +.diff .hljs-chunk, +.hljs-subst { + color: #8F8F8F; +} + +.dos .hljs-keyword, +.python .hljs-decorator, +.hljs-title, +.haskell .hljs-type, +.diff .hljs-header, +.ruby .hljs-class .hljs-parent, +.apache .hljs-tag, +.nginx .hljs-built_in, +.tex .hljs-command, +.hljs-prompt { + color: #efef8f; +} + +.dos .hljs-winutils, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-string { + color: #DCA3A3; +} + +.diff .hljs-deletion, +.hljs-string, +.hljs-tag .hljs-value, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.sql .hljs-aggregate, +.hljs-javadoc, +.smalltalk .hljs-class, +.smalltalk .hljs-localvars, +.smalltalk .hljs-array, +.css .hljs-rules .hljs-value, +.hljs-attr_selector, +.hljs-pseudo, +.apache .hljs-cbracket, +.tex .hljs-formula, +.coffeescript .hljs-attribute { + color: #CC9393; +} + +.hljs-shebang, +.diff .hljs-addition, +.hljs-comment, +.java .hljs-annotation, +.hljs-template_comment, +.hljs-pi, +.hljs-doctype { + color: #7F9F7F; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/plugin.js new file mode 100644 index 0000000..e42309e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/plugin.js @@ -0,0 +1,479 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + + /** + * @fileOverview Rich code snippets for CKEditor. + */ + +'use strict'; + +( function() { + var isBrowserSupported = !CKEDITOR.env.ie || CKEDITOR.env.version > 8; + + CKEDITOR.plugins.add( 'codesnippet', { + requires: 'widget,dialog', + lang: 'ar,az,bg,ca,cs,da,de,de-ch,el,en,en-gb,eo,es,es-mx,et,eu,fa,fi,fr,fr-ca,gl,he,hr,hu,id,it,ja,km,ko,ku,lt,lv,nb,nl,no,oc,pl,pt,pt-br,ro,ru,sk,sl,sq,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + icons: 'codesnippet', // %REMOVE_LINE_CORE% + hidpi: true, // %REMOVE_LINE_CORE% + + beforeInit: function( editor ) { + editor._.codesnippet = {}; + + /** + * Sets the custom syntax highlighter. See {@link CKEDITOR.plugins.codesnippet.highlighter} + * to learn how to register a custom highlighter. + * + * **Note**: + * + * * This method can only be called while initialising plugins (in one of + * the three callbacks). + * * This method is accessible through the `editor.plugins.codesnippet` namespace only. + * + * @since 4.4 + * @member CKEDITOR.plugins.codesnippet + * @param {CKEDITOR.plugins.codesnippet.highlighter} highlighter + */ + this.setHighlighter = function( highlighter ) { + editor._.codesnippet.highlighter = highlighter; + + var langs = editor._.codesnippet.langs = + editor.config.codeSnippet_languages || highlighter.languages; + + // We might escape special regex chars below, but we expect that there + // should be no crazy values used as lang keys. + editor._.codesnippet.langsRegex = new RegExp( '(?:^|\\s)language-(' + + CKEDITOR.tools.objectKeys( langs ).join( '|' ) + ')(?:\\s|$)' ); + }; + }, + + onLoad: function() { + CKEDITOR.dialog.add( 'codeSnippet', this.path + 'dialogs/codesnippet.js' ); + }, + + init: function( editor ) { + editor.ui.addButton && editor.ui.addButton( 'CodeSnippet', { + label: editor.lang.codesnippet.button, + command: 'codeSnippet', + toolbar: 'insert,10' + } ); + }, + + afterInit: function( editor ) { + var path = this.path; + + registerWidget( editor ); + + // At the very end, if no custom highlighter was set so far (by plugin#setHighlighter) + // we will set default one. + if ( !editor._.codesnippet.highlighter ) { + var hljsHighlighter = new CKEDITOR.plugins.codesnippet.highlighter( { + languages: { + apache: 'Apache', + bash: 'Bash', + coffeescript: 'CoffeeScript', + cpp: 'C++', + cs: 'C#', + css: 'CSS', + diff: 'Diff', + html: 'HTML', + http: 'HTTP', + ini: 'INI', + java: 'Java', + javascript: 'JavaScript', + json: 'JSON', + makefile: 'Makefile', + markdown: 'Markdown', + nginx: 'Nginx', + objectivec: 'Objective-C', + perl: 'Perl', + php: 'PHP', + python: 'Python', + ruby: 'Ruby', + sql: 'SQL', + vbscript: 'VBScript', + xhtml: 'XHTML', + xml: 'XML' + }, + + init: function( callback ) { + var that = this; + + if ( isBrowserSupported ) { + CKEDITOR.scriptLoader.load( path + 'lib/highlight/highlight.pack.js', function() { + that.hljs = window.hljs; + callback(); + } ); + } + + // Method is available only if wysiwygarea exists. + if ( editor.addContentsCss ) { + editor.addContentsCss( path + 'lib/highlight/styles/' + editor.config.codeSnippet_theme + '.css' ); + } + }, + + highlighter: function( code, language, callback ) { + var highlighted = this.hljs.highlightAuto( code, + this.hljs.getLanguage( language ) ? [ language ] : undefined ); + + if ( highlighted ) + callback( highlighted.value ); + } + } ); + + this.setHighlighter( hljsHighlighter ); + } + } + } ); + + /** + * Global helpers and classes of the Code Snippet plugin. + * + * For more information see the [Code Snippet Guide](#!/guide/dev_codesnippet). + * + * @class + * @singleton + */ + CKEDITOR.plugins.codesnippet = { + highlighter: Highlighter + }; + + /** + * A Code Snippet highlighter. It can be set as a default highlighter + * using {@link CKEDITOR.plugins.codesnippet#setHighlighter}, for example: + * + * // Create a new plugin which registers a custom code highlighter + * // based on customEngine in order to replace the one that comes + * // with the Code Snippet plugin. + * CKEDITOR.plugins.add( 'myCustomHighlighter', { + * afterInit: function( editor ) { + * // Create a new instance of the highlighter. + * var myHighlighter = new CKEDITOR.plugins.codesnippet.highlighter( { + * init: function( ready ) { + * // Asynchronous code to load resources and libraries for customEngine. + * customEngine.loadResources( function() { + * // Let the editor know that everything is ready. + * ready(); + * } ); + * }, + * highlighter: function( code, language, callback ) { + * // Let the customEngine highlight the code. + * customEngine.highlight( code, language, function() { + * callback( highlightedCode ); + * } ); + * } + * } ); + * + * // Check how it performs. + * myHighlighter.highlight( 'foo()', 'javascript', function( highlightedCode ) { + * console.log( highlightedCode ); // -> foo() + * } ); + * + * // From now on, myHighlighter will be used as a Code Snippet + * // highlighter, overwriting the default engine. + * editor.plugins.codesnippet.setHighlighter( myHighlighter ); + * } + * } ); + * + * @since 4.4 + * @class CKEDITOR.plugins.codesnippet.highlighter + * @extends CKEDITOR.plugins.codesnippet + * @param {Object} def Highlighter definition. See {@link #highlighter}, {@link #init} and {@link #languages}. + */ + function Highlighter( def ) { + CKEDITOR.tools.extend( this, def ); + + /** + * A queue of {@link #highlight} jobs to be + * done once the highlighter is {@link #ready}. + * + * @readonly + * @property {Array} [=[]] + */ + this.queue = []; + + // Async init – execute jobs when ready. + if ( this.init ) { + this.init( CKEDITOR.tools.bind( function() { + // Execute pending jobs. + var job; + + while ( ( job = this.queue.pop() ) ) + job.call( this ); + + this.ready = true; + }, this ) ); + } else { + this.ready = true; + } + + /** + * If specified, this function should asynchronously load highlighter-specific + * resources and execute `ready` when the highlighter is ready. + * + * @property {Function} [init] + * @param {Function} ready The function to be called once + * the highlighter is {@link #ready}. + */ + + /** + * A function which highlights given plain text `code` in a given `language` and, once done, + * calls the `callback` function with highlighted markup as an argument. + * + * @property {Function} [highlighter] + * @param {String} code Code to be formatted. + * @param {String} lang Language to be used ({@link CKEDITOR.config#codeSnippet_languages}). + * @param {Function} callback Function which accepts highlighted String as an argument. + */ + + /** + * Defines languages supported by the highlighter. + * They can be restricted with the {@link CKEDITOR.config#codeSnippet_languages} configuration option. + * + * **Note**: If {@link CKEDITOR.config#codeSnippet_languages} is set, **it will + * overwrite** the languages listed in `languages`. + * + * languages: { + * coffeescript: 'CoffeeScript', + * cpp: 'C++', + * cs: 'C#', + * css: 'CSS' + * } + * + * More information on how to change the list of languages is available + * in the [Code Snippet documentation](#!/guide/dev_codesnippet-section-changing-languages-list). + * + * @property {Object} languages + */ + + /** + * A flag which indicates whether the highlighter is ready to do jobs + * from the {@link #queue}. + * + * @readonly + * @property {Boolean} ready + */ + } + + /** + * Executes the {@link #highlighter}. If the highlighter is not ready, it defers the job ({@link #queue}) + * and executes it when the highlighter is {@link #ready}. + * + * @param {String} code Code to be formatted. + * @param {String} lang Language to be used ({@link CKEDITOR.config#codeSnippet_languages}). + * @param {Function} callback Function which accepts highlighted String as an argument. + */ + Highlighter.prototype.highlight = function() { + var arg = arguments; + + // Highlighter is ready – do it now. + if ( this.ready ) + this.highlighter.apply( this, arg ); + // Queue the job. It will be done once ready. + else { + this.queue.push( function() { + this.highlighter.apply( this, arg ); + } ); + } + }; + + // Encapsulates snippet widget registration code. + // @param {CKEDITOR.editor} editor + function registerWidget( editor ) { + var codeClass = editor.config.codeSnippet_codeClass, + newLineRegex = /\r?\n/g, + textarea = new CKEDITOR.dom.element( 'textarea' ), + lang = editor.lang.codesnippet; + + editor.widgets.add( 'codeSnippet', { + allowedContent: 'pre; code(language-*)', + // Actually we need both - pre and code, but ACF does not make it possible + // to defire required content with "and" operator. + requiredContent: 'pre', + styleableElements: 'pre', + template: '
', + dialog: 'codeSnippet', + pathName: lang.pathName, + mask: true, + + parts: { + pre: 'pre', + code: 'code' + }, + + highlight: function() { + var that = this, + widgetData = this.data, + callback = function( formatted ) { + // IE8 (not supported browser) have issue with new line chars, when using innerHTML. + // It will simply strip it. + that.parts.code.setHtml( isBrowserSupported ? + formatted : formatted.replace( newLineRegex, '
' ) ); + }; + + // Set plain code first, so even if custom handler will not call it the code will be there. + callback( CKEDITOR.tools.htmlEncode( widgetData.code ) ); + + // Call higlighter to apply its custom highlighting. + editor._.codesnippet.highlighter.highlight( widgetData.code, widgetData.lang, function( formatted ) { + editor.fire( 'lockSnapshot' ); + callback( formatted ); + editor.fire( 'unlockSnapshot' ); + } ); + }, + + data: function() { + var newData = this.data, + oldData = this.oldData; + + if ( newData.code ) + this.parts.code.setHtml( CKEDITOR.tools.htmlEncode( newData.code ) ); + + // Remove old .language-* class. + if ( oldData && newData.lang != oldData.lang ) + this.parts.code.removeClass( 'language-' + oldData.lang ); + + // Lang needs to be specified in order to apply formatting. + if ( newData.lang ) { + // Apply new .language-* class. + this.parts.code.addClass( 'language-' + newData.lang ); + + this.highlight(); + } + + // Save oldData. + this.oldData = CKEDITOR.tools.copy( newData ); + }, + + // Upcasts
...
+ upcast: function( el, data ) { + if ( el.name != 'pre' ) + return; + + var childrenArray = getNonEmptyChildren( el ), + code; + + if ( childrenArray.length != 1 || ( code = childrenArray[ 0 ] ).name != 'code' ) + return; + + // Upcast with text only: http://dev.ckeditor.com/ticket/11926#comment:4 + if ( code.children.length != 1 || code.children[ 0 ].type != CKEDITOR.NODE_TEXT ) + return; + + // Read language-* from class attribute. + var matchResult = editor._.codesnippet.langsRegex.exec( code.attributes[ 'class' ] ); + + if ( matchResult ) + data.lang = matchResult[ 1 ]; + + // Use textarea to decode HTML entities (http://dev.ckeditor.com/ticket/11926). + textarea.setHtml( code.getHtml() ); + data.code = textarea.getValue(); + + code.addClass( codeClass ); + + return el; + }, + + // Downcasts to
...
+ downcast: function( el ) { + var code = el.getFirst( 'code' ); + + // Remove pretty formatting from .... + code.children.length = 0; + + // Remove config#codeSnippet_codeClass. + code.removeClass( codeClass ); + + // Set raw text inside .... + code.add( new CKEDITOR.htmlParser.text( CKEDITOR.tools.htmlEncode( this.data.code ) ) ); + + return el; + } + } ); + + // Returns an **array** of child elements, with whitespace-only text nodes + // filtered out. + // @param {CKEDITOR.htmlParser.element} parentElement + // @return Array - array of CKEDITOR.htmlParser.node + var whitespaceOnlyRegex = /^[\s\n\r]*$/; + + function getNonEmptyChildren( parentElement ) { + var ret = [], + preChildrenList = parentElement.children, + curNode; + + // Filter out empty text nodes. + for ( var i = preChildrenList.length - 1; i >= 0; i-- ) { + curNode = preChildrenList[ i ]; + + if ( curNode.type != CKEDITOR.NODE_TEXT || !curNode.value.match( whitespaceOnlyRegex ) ) + ret.push( curNode ); + } + + return ret; + } + } +} )(); + +/** + * A CSS class of the `` element used internally for styling + * (by default [highlight.js](http://highlightjs.org) themes, see + * {@link CKEDITOR.config#codeSnippet_theme config.codeSnippet_theme}), + * which means that it is **not present** in the editor output data. + * + * // Changes the class to "myCustomClass". + * config.codeSnippet_codeClass = 'myCustomClass'; + * + * **Note**: The class might need to be changed when you are using a custom + * highlighter (the default is [highlight.js](http://highlightjs.org)). + * See {@link CKEDITOR.plugins.codesnippet.highlighter} to read more. + * + * Read more in the [documentation](#!/guide/dev_codesnippet) + * and see the [SDK sample](http://sdk.ckeditor.com/samples/codesnippet.html). + * + * @since 4.4 + * @cfg {String} [codeSnippet_codeClass='hljs'] + * @member CKEDITOR.config + */ +CKEDITOR.config.codeSnippet_codeClass = 'hljs'; + +/** + * Restricts languages available in the "Code Snippet" dialog window. + * An empty value is always added to the list. + * + * **Note**: If using a custom highlighter library (the default is [highlight.js](http://highlightjs.org)), + * you may need to refer to external documentation to set `config.codeSnippet_languages` properly. + * + * Read more in the [documentation](#!/guide/dev_codesnippet-section-changing-supported-languages) + * and see the [SDK sample](http://sdk.ckeditor.com/samples/codesnippet.html). + * + * // Restricts languages to JavaScript and PHP. + * config.codeSnippet_languages = { + * javascript: 'JavaScript', + * php: 'PHP' + * }; + * + * @since 4.4 + * @cfg {Object} [codeSnippet_languages=null] + * @member CKEDITOR.config + */ + +/** + * A theme used to render code snippets. See [available themes](http://highlightjs.org/static/test.html). + * + * **Note**: This will only work with the default highlighter + * ([highlight.js](http://highlightjs.org/static/test.html)). + * + * Read more in the [documentation](#!/guide/dev_codesnippet-section-changing-highlighter-theme) + * and see the [SDK sample](http://sdk.ckeditor.com/samples/codesnippet.html). + * + * // Changes the theme to "pojoaque". + * config.codeSnippet_theme = 'pojoaque'; + * + * @since 4.4 + * @cfg {String} [codeSnippet_theme='default'] + * @member CKEDITOR.config + */ +CKEDITOR.config.codeSnippet_theme = 'default'; diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/samples/codesnippet.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/samples/codesnippet.html new file mode 100644 index 0000000..18cd07c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/codesnippet/samples/codesnippet.html @@ -0,0 +1,239 @@ + + + + + + Code Snippet — CKEditor Sample + + + + + + + + + + + +

+ CKEditor Samples » Code Snippet Plugin +

+
+ This sample is not maintained anymore. Check out its brand new version in CKEditor SDK. +
+ +
+

+ This editor is using the Code Snippet plugin which introduces beautiful code snippets. + By default the codesnippet plugin depends on the built-in client-side syntax highlighting + library highlight.js. +

+

+ You can adjust the appearance of code snippets using the codeSnippet_theme configuration variable + (see available themes). +

+

+ Select theme: +

+

+ The CKEditor instance below was created by using the following configuration settings: +

+ +
+CKEDITOR.replace( 'editor1', {
+	extraPlugins: 'codesnippet',
+	codeSnippet_theme: 'monokai_sublime'
+} );
+
+ +

+ Please note that this plugin is not compatible with Internet Explorer 8. +

+
+ + + +

Inline editor

+ +
+

+ The following sample shows the Code Snippet plugin running inside + an inline CKEditor instance. The CKEditor instance below was created by using the following configuration settings: +

+ +
+CKEDITOR.inline( 'editable', {
+	extraPlugins: 'codesnippet'
+} );
+
+ +

+ Note: The highlight.js themes + must be loaded manually to be applied inside an inline editor instance, as the + codeSnippet_theme setting will not work in that case. + You need to include the stylesheet in the <head> section of the page, for example: +

+ +
+<head>
+	...
+	<link href="path/to/highlight.js/styles/monokai_sublime.css" rel="stylesheet">
+</head>
+
+ +
+ +
+ +

JavaScript code:

+ +
function isEmpty( object ) {
+	for ( var i in object ) {
+		if ( object.hasOwnProperty( i ) )
+			return false;
+	}
+	return true;
+}
+ +

SQL query:

+ +
SELECT cust.id, cust.name, loc.city FROM cust LEFT JOIN loc ON ( cust.loc_id = loc.id ) WHERE cust.type IN ( 1, 2 );
+ +

Unknown markup:

+ +
 ________________
+/                \
+| How about moo? |  ^__^
+\________________/  (oo)\_______
+                  \ (__)\       )\/\
+                        ||----w |
+                        ||     ||
+
+
+ +

Server-side Highlighting and Custom Highlighting Engines

+ +

+ The Code Snippet GeSHi plugin is an + extension of the Code Snippet plugin which uses a server-side highligter. +

+ +

+ It also is possible to replace the default highlighter with any library using + the Highlighter API + and the editor.plugins.codesnippet.setHighlighter() method. +

+ + + + + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/dnd.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/dnd.html new file mode 100644 index 0000000..971d9cd --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/dnd.html @@ -0,0 +1,172 @@ + + + + + + Widget Drag & Drop with Lineutils — CKEditor Sample + + + + + + +

+ CKEditor Samples » Widget Drag & Drop with Lineutils +

+ +

Classic (iframe-based) Editor

+ + + +

Inline Editor

+ +
+ + + + + + + + + + + + + + + +
This tableis thevery firstelement of the document.
We are stillable to accesthe space before it. + + + + + + + + + +
This table is inside of a cell of another table.
We can type either before or after it though.
+
+ +
+
+
    +
  1. This numbered list...
  2. +
  3. ...is a neighbour of a horizontal line...
  4. +
  5. +
      +
    1. Nested list!
    2. +
    +
  6. +
+ +
Saturn V +
Roll out of Saturn V on launch pad
+
+ +
    +
  • We can type between the lists...
  • +
  • ...thanks to Magicline.
  • +
+ +

Lorem ipsum dolor sit amet dui. Morbi vel turpis. Nullam et leo. Etiam rutrum, urna tellus dui vel tincidunt mattis egestas, justo fringilla vel, massa. Phasellus.

+ +

Quisque iaculis, dui lectus varius vitae, tortor. Proin lacus. Pellentesque ac lacus. Aenean nonummy commodo nec, pede. Etiam blandit risus elit.

+ +

Ut pretium. Vestibulum rutrum in, adipiscing elit. Sed in quam in purus sem vitae pede. Pellentesque bibendum, urna sem vel risus. Vivamus posuere metus. Aliquam gravida iaculis nisl. Nam enim. Aliquam erat ac lacus tellus ac felis.

+ +
+

This text is wrapped in a DIV element. We can type after this element though.

+
+
+ + + + + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/magicfinger.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/magicfinger.html new file mode 100644 index 0000000..7f2b632 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/dev/magicfinger.html @@ -0,0 +1,285 @@ + + + + + + Lineutils — CKEditor Sample + + + + +

+ CKEditor Samples » Lineutils +

+ +

Classic (iframe-based) Editor

+ + + +

Inline Editor

+ +
+ + + + + + + + + + + + + + + +
This tableis thevery firstelement of the document.
We are stillable to accesthe space before it. + + + + + + + + + +
This table is inside of a cell of another table.
We can type either before or after it though.
+
+ +

Two succesive horizontal lines (HR tags). We can access the space in between:

+ +
+
+
    +
  1. This numbered list...
  2. +
  3. ...is a neighbour of a horizontal line...
  4. +
  5. +
      +
    1. Nested list!
    2. +
    +
  6. +
+ +
    +
  • We can type between the lists...
  • +
  • ...thanks to Magicline.
  • +
+ +

Lorem ipsum dolor sit amet dui. Morbi vel turpis. Nullam et leo. Etiam rutrum, urna tellus dui vel tincidunt mattis egestas, justo fringilla vel, massa. Phasellus.

+ +

Quisque iaculis, dui lectus varius vitae, tortor. Proin lacus. Pellentesque ac lacus. Aenean nonummy commodo nec, pede. Etiam blandit risus elit.

+ +

Ut pretium. Vestibulum rutrum in, adipiscing elit. Sed in quam in purus sem vitae pede. Pellentesque bibendum, urna sem vel risus. Vivamus posuere metus. Aliquam gravida iaculis nisl. Nam enim. Aliquam erat ac lacus tellus ac felis.

+ +
+

This text is wrapped in a DIV element. We can type after this element though.

+
+
+ +

Extreme inline

+ +
+
Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies. Curabitur et ligula. Ut molestie a, ultricies porta urna. Vestibulum commodo volutpat a, convallis ac, laoreet enim.
+
+ Position static +
foo
+
+
+
Key
Value
+
+
Whatever
+
+

Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies

+
+
+

Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies

+
foo
+
+ +

Classic (iframe-based) Editor, H-scroll

+ + + + + + + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/plugin.js new file mode 100644 index 0000000..75d0da8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/lineutils/plugin.js @@ -0,0 +1,1018 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + + /** + * @fileOverview A set of utilities to find and create horizontal spaces in edited content. + */ + +'use strict'; + +( function() { + + CKEDITOR.plugins.add( 'lineutils' ); + + /** + * Determines a position relative to an element in DOM (before). + * + * @readonly + * @property {Number} [=0] + * @member CKEDITOR + */ + CKEDITOR.LINEUTILS_BEFORE = 1; + + /** + * Determines a position relative to an element in DOM (after). + * + * @readonly + * @property {Number} [=2] + * @member CKEDITOR + */ + CKEDITOR.LINEUTILS_AFTER = 2; + + /** + * Determines a position relative to an element in DOM (inside). + * + * @readonly + * @property {Number} [=4] + * @member CKEDITOR + */ + CKEDITOR.LINEUTILS_INSIDE = 4; + + /** + * A utility that traverses the DOM tree and discovers elements + * (relations) matching user-defined lookups. + * + * @private + * @class CKEDITOR.plugins.lineutils.finder + * @constructor Creates a Finder class instance. + * @param {CKEDITOR.editor} editor Editor instance that the Finder belongs to. + * @param {Object} def Finder's definition. + * @since 4.3 + */ + function Finder( editor, def ) { + CKEDITOR.tools.extend( this, { + editor: editor, + editable: editor.editable(), + doc: editor.document, + win: editor.window + }, def, true ); + + this.inline = this.editable.isInline(); + + if ( !this.inline ) { + this.frame = this.win.getFrame(); + } + + this.target = this[ this.inline ? 'editable' : 'doc' ]; + } + + Finder.prototype = { + /** + * Initializes searching for elements with every mousemove event fired. + * To stop searching use {@link #stop}. + * + * @param {Function} [callback] Function executed on every iteration. + */ + start: function( callback ) { + var that = this, + editor = this.editor, + doc = this.doc, + el, elfp, x, y; + + var moveBuffer = CKEDITOR.tools.eventsBuffer( 50, function() { + if ( editor.readOnly || editor.mode != 'wysiwyg' ) + return; + + that.relations = {}; + + // Sometimes it happens that elementFromPoint returns null (especially on IE). + // Any further traversal makes no sense if there's no start point. Abort. + // Note: In IE8 elementFromPoint may return zombie nodes of undefined nodeType, + // so rejecting those as well. + if ( !( elfp = doc.$.elementFromPoint( x, y ) ) || !elfp.nodeType ) { + return; + } + + el = new CKEDITOR.dom.element( elfp ); + + that.traverseSearch( el ); + + if ( !isNaN( x + y ) ) { + that.pixelSearch( el, x, y ); + } + + callback && callback( that.relations, x, y ); + } ); + + // Searching starting from element from point on mousemove. + this.listener = this.editable.attachListener( this.target, 'mousemove', function( evt ) { + x = evt.data.$.clientX; + y = evt.data.$.clientY; + + moveBuffer.input(); + } ); + + this.editable.attachListener( this.inline ? this.editable : this.frame, 'mouseout', function() { + moveBuffer.reset(); + } ); + }, + + /** + * Stops observing mouse events attached by {@link #start}. + */ + stop: function() { + if ( this.listener ) { + this.listener.removeListener(); + } + }, + + /** + * Returns a range representing the relation, according to its element + * and type. + * + * @param {Object} location Location containing a unique identifier and type. + * @returns {CKEDITOR.dom.range} Range representing the relation. + */ + getRange: ( function() { + var where = {}; + + where[ CKEDITOR.LINEUTILS_BEFORE ] = CKEDITOR.POSITION_BEFORE_START; + where[ CKEDITOR.LINEUTILS_AFTER ] = CKEDITOR.POSITION_AFTER_END; + where[ CKEDITOR.LINEUTILS_INSIDE ] = CKEDITOR.POSITION_AFTER_START; + + return function( location ) { + var range = this.editor.createRange(); + + range.moveToPosition( this.relations[ location.uid ].element, where[ location.type ] ); + + return range; + }; + } )(), + + /** + * Stores given relation in a {@link #relations} object. Processes the relation + * to normalize and avoid duplicates. + * + * @param {CKEDITOR.dom.element} el Element of the relation. + * @param {Number} type Relation, one of `CKEDITOR.LINEUTILS_AFTER`, `CKEDITOR.LINEUTILS_BEFORE`, `CKEDITOR.LINEUTILS_INSIDE`. + */ + store: ( function() { + function merge( el, type, relations ) { + var uid = el.getUniqueId(); + + if ( uid in relations ) { + relations[ uid ].type |= type; + } else { + relations[ uid ] = { element: el, type: type }; + } + } + + return function( el, type ) { + var alt; + + // Normalization to avoid duplicates: + // CKEDITOR.LINEUTILS_AFTER becomes CKEDITOR.LINEUTILS_BEFORE of el.getNext(). + if ( is( type, CKEDITOR.LINEUTILS_AFTER ) && isStatic( alt = el.getNext() ) && alt.isVisible() ) { + merge( alt, CKEDITOR.LINEUTILS_BEFORE, this.relations ); + type ^= CKEDITOR.LINEUTILS_AFTER; + } + + // Normalization to avoid duplicates: + // CKEDITOR.LINEUTILS_INSIDE becomes CKEDITOR.LINEUTILS_BEFORE of el.getFirst(). + if ( is( type, CKEDITOR.LINEUTILS_INSIDE ) && isStatic( alt = el.getFirst() ) && alt.isVisible() ) { + merge( alt, CKEDITOR.LINEUTILS_BEFORE, this.relations ); + type ^= CKEDITOR.LINEUTILS_INSIDE; + } + + merge( el, type, this.relations ); + }; + } )(), + + /** + * Traverses the DOM tree towards root, checking all ancestors + * with lookup rules, avoiding duplicates. Stores positive relations + * in the {@link #relations} object. + * + * @param {CKEDITOR.dom.element} el Element which is the starting point. + */ + traverseSearch: function( el ) { + var l, type, uid; + + // Go down DOM towards root (or limit). + do { + uid = el.$[ 'data-cke-expando' ]; + + // This element was already visited and checked. + if ( uid && uid in this.relations ) { + continue; + } + + if ( el.equals( this.editable ) ) { + return; + } + + if ( isStatic( el ) ) { + // Collect all addresses yielded by lookups for that element. + for ( l in this.lookups ) { + + if ( ( type = this.lookups[ l ]( el ) ) ) { + this.store( el, type ); + } + } + } + } while ( !isLimit( el ) && ( el = el.getParent() ) ); + }, + + /** + * Iterates vertically pixel-by-pixel within a given element starting + * from given coordinates, searching for elements in the neighborhood. + * Once an element is found it is processed by {@link #traverseSearch}. + * + * @param {CKEDITOR.dom.element} el Element which is the starting point. + * @param {Number} [x] Horizontal mouse coordinate relative to the viewport. + * @param {Number} [y] Vertical mouse coordinate relative to the viewport. + */ + pixelSearch: ( function() { + var contains = CKEDITOR.env.ie || CKEDITOR.env.webkit ? + function( el, found ) { + return el.contains( found ); + } : function( el, found ) { + return !!( el.compareDocumentPosition( found ) & 16 ); + }; + + // Iterates pixel-by-pixel from starting coordinates, moving by defined + // step and getting elementFromPoint in every iteration. Iteration stops when: + // * A valid element is found. + // * Condition function returns `false` (i.e. reached boundaries of viewport). + // * No element is found (i.e. coordinates out of viewport). + // * Element found is ascendant of starting element. + // + // @param {Object} doc Native DOM document. + // @param {Object} el Native DOM element. + // @param {Number} xStart Horizontal starting coordinate to use. + // @param {Number} yStart Vertical starting coordinate to use. + // @param {Number} step Step of the algorithm. + // @param {Function} condition A condition relative to current vertical coordinate. + function iterate( el, xStart, yStart, step, condition ) { + var y = yStart, + tryouts = 0, + found; + + while ( condition( y ) ) { + y += step; + + // If we try and we try, and still nothing's found, let's end + // that party. + if ( ++tryouts == 25 ) { + return; + } + + found = this.doc.$.elementFromPoint( xStart, y ); + + // Nothing found. This is crazy... but... + // It might be that a line, which is in different document, + // covers that pixel (elementFromPoint is doc-sensitive). + // Better let's have another try. + if ( !found ) { + continue; + } + + // Still in the same element. + else if ( found == el ) { + tryouts = 0; + continue; + } + + // Reached the edge of an element and found an ancestor or... + // A line, that covers that pixel. Better let's have another try. + else if ( !contains( el, found ) ) { + continue; + } + + tryouts = 0; + + // Found a valid element. Stop iterating. + if ( isStatic( ( found = new CKEDITOR.dom.element( found ) ) ) ) { + return found; + } + } + } + + return function( el, x, y ) { + var paneHeight = this.win.getViewPaneSize().height, + + // Try to find an element iterating *up* from the starting point. + neg = iterate.call( this, el.$, x, y, -1, function( y ) { + return y > 0; + } ), + + // Try to find an element iterating *down* from the starting point. + pos = iterate.call( this, el.$, x, y, 1, function( y ) { + return y < paneHeight; + } ); + + if ( neg ) { + this.traverseSearch( neg ); + + // Iterate towards DOM root until neg is a direct child of el. + while ( !neg.getParent().equals( el ) ) { + neg = neg.getParent(); + } + } + + if ( pos ) { + this.traverseSearch( pos ); + + // Iterate towards DOM root until pos is a direct child of el. + while ( !pos.getParent().equals( el ) ) { + pos = pos.getParent(); + } + } + + // Iterate forwards starting from neg and backwards from + // pos to harvest all children of el between those elements. + // Stop when neg and pos meet each other or there's none of them. + // TODO (?) reduce number of hops forwards/backwards. + while ( neg || pos ) { + if ( neg ) { + neg = neg.getNext( isStatic ); + } + + if ( !neg || neg.equals( pos ) ) { + break; + } + + this.traverseSearch( neg ); + + if ( pos ) { + pos = pos.getPrevious( isStatic ); + } + + if ( !pos || pos.equals( neg ) ) { + break; + } + + this.traverseSearch( pos ); + } + }; + } )(), + + /** + * Unlike {@link #traverseSearch}, it collects **all** elements from editable's DOM tree + * and runs lookups for every one of them, collecting relations. + * + * @returns {Object} {@link #relations}. + */ + greedySearch: function() { + this.relations = {}; + + var all = this.editable.getElementsByTag( '*' ), + i = 0, + el, type, l; + + while ( ( el = all.getItem( i++ ) ) ) { + // Don't consider editable, as it might be inline, + // and i.e. checking it's siblings is pointless. + if ( el.equals( this.editable ) ) { + continue; + } + + // On IE8 element.getElementsByTagName returns comments... sic! (http://dev.ckeditor.com/ticket/13176) + if ( el.type != CKEDITOR.NODE_ELEMENT ) { + continue; + } + + // Don't visit non-editable internals, for example widget's + // guts (above wrapper, below nested). Still check editable limits, + // as they are siblings with editable contents. + if ( !el.hasAttribute( 'contenteditable' ) && el.isReadOnly() ) { + continue; + } + + if ( isStatic( el ) && el.isVisible() ) { + // Collect all addresses yielded by lookups for that element. + for ( l in this.lookups ) { + if ( ( type = this.lookups[ l ]( el ) ) ) { + this.store( el, type ); + } + } + } + } + + return this.relations; + } + + /** + * Relations express elements in DOM that match user-defined {@link #lookups}. + * Every relation has its own `type` that determines whether + * it refers to the space before, after or inside the `element`. + * This object stores relations found by {@link #traverseSearch} or {@link #greedySearch}, structured + * in the following way: + * + * relations: { + * // Unique identifier of the element. + * Number: { + * // Element of this relation. + * element: {@link CKEDITOR.dom.element} + * // Conjunction of CKEDITOR.LINEUTILS_BEFORE, CKEDITOR.LINEUTILS_AFTER and CKEDITOR.LINEUTILS_INSIDE. + * type: Number + * }, + * ... + * } + * + * @property {Object} relations + * @readonly + */ + + /** + * A set of user-defined functions used by Finder to check if an element + * is a valid relation, belonging to {@link #relations}. + * When the criterion is met, lookup returns a logical conjunction of `CKEDITOR.LINEUTILS_BEFORE`, + * `CKEDITOR.LINEUTILS_AFTER` or `CKEDITOR.LINEUTILS_INSIDE`. + * + * Lookups are passed along with Finder's definition. + * + * lookups: { + * 'some lookup': function( el ) { + * if ( someCondition ) + * return CKEDITOR.LINEUTILS_BEFORE; + * }, + * ... + * } + * + * @property {Object} lookups + */ + }; + + + /** + * A utility that analyses relations found by + * CKEDITOR.plugins.lineutils.finder and locates them + * in the viewport as horizontal lines of specific coordinates. + * + * @private + * @class CKEDITOR.plugins.lineutils.locator + * @constructor Creates a Locator class instance. + * @param {CKEDITOR.editor} editor Editor instance that Locator belongs to. + * @since 4.3 + */ + function Locator( editor, def ) { + CKEDITOR.tools.extend( this, def, { + editor: editor + }, true ); + } + + Locator.prototype = { + /** + * Locates the Y coordinate for all types of every single relation and stores + * them in an object. + * + * @param {Object} relations {@link CKEDITOR.plugins.lineutils.finder#relations}. + * @returns {Object} {@link #locations}. + */ + locate: ( function() { + function locateSibling( rel, type ) { + var sib = rel.element[ type === CKEDITOR.LINEUTILS_BEFORE ? 'getPrevious' : 'getNext' ](); + + // Return the middle point between siblings. + if ( sib && isStatic( sib ) ) { + rel.siblingRect = sib.getClientRect(); + + if ( type == CKEDITOR.LINEUTILS_BEFORE ) { + return ( rel.siblingRect.bottom + rel.elementRect.top ) / 2; + } else { + return ( rel.elementRect.bottom + rel.siblingRect.top ) / 2; + } + } + + // If there's no sibling, use the edge of an element. + else { + if ( type == CKEDITOR.LINEUTILS_BEFORE ) { + return rel.elementRect.top; + } else { + return rel.elementRect.bottom; + } + } + } + + return function( relations ) { + var rel; + + this.locations = {}; + + for ( var uid in relations ) { + rel = relations[ uid ]; + rel.elementRect = rel.element.getClientRect(); + + if ( is( rel.type, CKEDITOR.LINEUTILS_BEFORE ) ) { + this.store( uid, CKEDITOR.LINEUTILS_BEFORE, locateSibling( rel, CKEDITOR.LINEUTILS_BEFORE ) ); + } + + if ( is( rel.type, CKEDITOR.LINEUTILS_AFTER ) ) { + this.store( uid, CKEDITOR.LINEUTILS_AFTER, locateSibling( rel, CKEDITOR.LINEUTILS_AFTER ) ); + } + + // The middle point of the element. + if ( is( rel.type, CKEDITOR.LINEUTILS_INSIDE ) ) { + this.store( uid, CKEDITOR.LINEUTILS_INSIDE, ( rel.elementRect.top + rel.elementRect.bottom ) / 2 ); + } + } + + return this.locations; + }; + } )(), + + /** + * Calculates distances from every location to given vertical coordinate + * and sorts locations according to that distance. + * + * @param {Number} y The vertical coordinate used for sorting, used as a reference. + * @param {Number} [howMany] Determines the number of "closest locations" to be returned. + * @returns {Array} Sorted, array representation of {@link #locations}. + */ + sort: ( function() { + var locations, sorted, + dist, i; + + function distance( y, uid, type ) { + return Math.abs( y - locations[ uid ][ type ] ); + } + + return function( y, howMany ) { + locations = this.locations; + sorted = []; + + for ( var uid in locations ) { + for ( var type in locations[ uid ] ) { + dist = distance( y, uid, type ); + + // An array is empty. + if ( !sorted.length ) { + sorted.push( { uid: +uid, type: type, dist: dist } ); + } else { + // Sort the array on fly when it's populated. + for ( i = 0; i < sorted.length; i++ ) { + if ( dist < sorted[ i ].dist ) { + sorted.splice( i, 0, { uid: +uid, type: type, dist: dist } ); + break; + } + } + + // Nothing was inserted, so the distance is bigger than + // any of already calculated: push to the end. + if ( i == sorted.length ) { + sorted.push( { uid: +uid, type: type, dist: dist } ); + } + } + } + } + + if ( typeof howMany != 'undefined' ) { + return sorted.slice( 0, howMany ); + } else { + return sorted; + } + }; + } )(), + + /** + * Stores the location in a collection. + * + * @param {Number} uid Unique identifier of the relation. + * @param {Number} type One of `CKEDITOR.LINEUTILS_BEFORE`, `CKEDITOR.LINEUTILS_AFTER` and `CKEDITOR.LINEUTILS_INSIDE`. + * @param {Number} y Vertical position of the relation. + */ + store: function( uid, type, y ) { + if ( !this.locations[ uid ] ) { + this.locations[ uid ] = {}; + } + + this.locations[ uid ][ type ] = y; + } + + /** + * @readonly + * @property {Object} locations + */ + }; + + var tipCss = { + display: 'block', + width: '0px', + height: '0px', + 'border-color': 'transparent', + 'border-style': 'solid', + position: 'absolute', + top: '-6px' + }, + + lineStyle = { + height: '0px', + 'border-top': '1px dashed red', + position: 'absolute', + 'z-index': 9999 + }, + + lineTpl = + '
' + + ' ' + + ' ' + + '
'; + + /** + * A utility that draws horizontal lines in DOM according to locations + * returned by CKEDITOR.plugins.lineutils.locator. + * + * @private + * @class CKEDITOR.plugins.lineutils.liner + * @constructor Creates a Liner class instance. + * @param {CKEDITOR.editor} editor Editor instance that Liner belongs to. + * @param {Object} def Liner's definition. + * @since 4.3 + */ + function Liner( editor, def ) { + var editable = editor.editable(); + + CKEDITOR.tools.extend( this, { + editor: editor, + editable: editable, + inline: editable.isInline(), + doc: editor.document, + win: editor.window, + container: CKEDITOR.document.getBody(), + winTop: CKEDITOR.document.getWindow() + }, def, true ); + + this.hidden = {}; + this.visible = {}; + + if ( !this.inline ) { + this.frame = this.win.getFrame(); + } + + this.queryViewport(); + + // Callbacks must be wrapped. Otherwise they're not attached + // to global DOM objects (i.e. topmost window) for every editor + // because they're treated as duplicates. They belong to the + // same prototype shared among Liner instances. + var queryViewport = CKEDITOR.tools.bind( this.queryViewport, this ), + hideVisible = CKEDITOR.tools.bind( this.hideVisible, this ), + removeAll = CKEDITOR.tools.bind( this.removeAll, this ); + + editable.attachListener( this.winTop, 'resize', queryViewport ); + editable.attachListener( this.winTop, 'scroll', queryViewport ); + + editable.attachListener( this.winTop, 'resize', hideVisible ); + editable.attachListener( this.win, 'scroll', hideVisible ); + + editable.attachListener( this.inline ? editable : this.frame, 'mouseout', function( evt ) { + var x = evt.data.$.clientX, + y = evt.data.$.clientY; + + this.queryViewport(); + + // Check if mouse is out of the element (iframe/editable). + if ( x <= this.rect.left || x >= this.rect.right || y <= this.rect.top || y >= this.rect.bottom ) { + this.hideVisible(); + } + + // Check if mouse is out of the top-window vieport. + if ( x <= 0 || x >= this.winTopPane.width || y <= 0 || y >= this.winTopPane.height ) { + this.hideVisible(); + } + }, this ); + + editable.attachListener( editor, 'resize', queryViewport ); + editable.attachListener( editor, 'mode', removeAll ); + editor.on( 'destroy', removeAll ); + + this.lineTpl = new CKEDITOR.template( lineTpl ).output( { + lineStyle: CKEDITOR.tools.writeCssText( + CKEDITOR.tools.extend( {}, lineStyle, this.lineStyle, true ) + ), + tipLeftStyle: CKEDITOR.tools.writeCssText( + CKEDITOR.tools.extend( {}, tipCss, { + left: '0px', + 'border-left-color': 'red', + 'border-width': '6px 0 6px 6px' + }, this.tipCss, this.tipLeftStyle, true ) + ), + tipRightStyle: CKEDITOR.tools.writeCssText( + CKEDITOR.tools.extend( {}, tipCss, { + right: '0px', + 'border-right-color': 'red', + 'border-width': '6px 6px 6px 0' + }, this.tipCss, this.tipRightStyle, true ) + ) + } ); + } + + Liner.prototype = { + /** + * Permanently removes all lines (both hidden and visible) from DOM. + */ + removeAll: function() { + var l; + + for ( l in this.hidden ) { + this.hidden[ l ].remove(); + delete this.hidden[ l ]; + } + + for ( l in this.visible ) { + this.visible[ l ].remove(); + delete this.visible[ l ]; + } + }, + + /** + * Hides a given line. + * + * @param {CKEDITOR.dom.element} line The line to be hidden. + */ + hideLine: function( line ) { + var uid = line.getUniqueId(); + + line.hide(); + + this.hidden[ uid ] = line; + delete this.visible[ uid ]; + }, + + /** + * Shows a given line. + * + * @param {CKEDITOR.dom.element} line The line to be shown. + */ + showLine: function( line ) { + var uid = line.getUniqueId(); + + line.show(); + + this.visible[ uid ] = line; + delete this.hidden[ uid ]; + }, + + /** + * Hides all visible lines. + */ + hideVisible: function() { + for ( var l in this.visible ) { + this.hideLine( this.visible[ l ] ); + } + }, + + /** + * Shows a line at given location. + * + * @param {Object} location Location object containing the unique identifier of the relation + * and its type. Usually returned by {@link CKEDITOR.plugins.lineutils.locator#sort}. + * @param {Function} [callback] A callback to be called once the line is shown. + */ + placeLine: function( location, callback ) { + var styles, line, l; + + // No style means that line would be out of viewport. + if ( !( styles = this.getStyle( location.uid, location.type ) ) ) { + return; + } + + // Search for any visible line of a different hash first. + // It's faster to re-position visible line than to show it. + for ( l in this.visible ) { + if ( this.visible[ l ].getCustomData( 'hash' ) !== this.hash ) { + line = this.visible[ l ]; + break; + } + } + + // Search for any hidden line of a different hash. + if ( !line ) { + for ( l in this.hidden ) { + if ( this.hidden[ l ].getCustomData( 'hash' ) !== this.hash ) { + this.showLine( ( line = this.hidden[ l ] ) ); + break; + } + } + } + + // If no line available, add the new one. + if ( !line ) { + this.showLine( ( line = this.addLine() ) ); + } + + // Mark the line with current hash. + line.setCustomData( 'hash', this.hash ); + + // Mark the line as visible. + this.visible[ line.getUniqueId() ] = line; + + line.setStyles( styles ); + + callback && callback( line ); + }, + + /** + * Creates a style set to be used by the line, representing a particular + * relation (location). + * + * @param {Number} uid Unique identifier of the relation. + * @param {Number} type Type of the relation. + * @returns {Object} An object containing styles. + */ + getStyle: function( uid, type ) { + var rel = this.relations[ uid ], + loc = this.locations[ uid ][ type ], + styles = {}, + hdiff; + + // Line should be between two elements. + if ( rel.siblingRect ) { + styles.width = Math.max( rel.siblingRect.width, rel.elementRect.width ); + } + // Line is relative to a single element. + else { + styles.width = rel.elementRect.width; + } + + // Let's calculate the vertical position of the line. + if ( this.inline ) { + // (http://dev.ckeditor.com/ticket/13155) + styles.top = loc + this.winTopScroll.y - this.rect.relativeY; + } else { + styles.top = this.rect.top + this.winTopScroll.y + loc; + } + + // Check if line would be vertically out of the viewport. + if ( styles.top - this.winTopScroll.y < this.rect.top || styles.top - this.winTopScroll.y > this.rect.bottom ) { + return false; + } + + // Now let's calculate the horizontal alignment (left and width). + if ( this.inline ) { + // (http://dev.ckeditor.com/ticket/13155) + styles.left = rel.elementRect.left - this.rect.relativeX; + } else { + if ( rel.elementRect.left > 0 ) + styles.left = this.rect.left + rel.elementRect.left; + + // H-scroll case. Left edge of element may be out of viewport. + else { + styles.width += rel.elementRect.left; + styles.left = this.rect.left; + } + + // H-scroll case. Right edge of element may be out of viewport. + if ( ( hdiff = styles.left + styles.width - ( this.rect.left + this.winPane.width ) ) > 0 ) { + styles.width -= hdiff; + } + } + + // Finally include horizontal scroll of the global window. + styles.left += this.winTopScroll.x; + + // Append 'px' to style values. + for ( var style in styles ) { + styles[ style ] = CKEDITOR.tools.cssLength( styles[ style ] ); + } + + return styles; + }, + + /** + * Adds a new line to DOM. + * + * @returns {CKEDITOR.dom.element} A brand-new line. + */ + addLine: function() { + var line = CKEDITOR.dom.element.createFromHtml( this.lineTpl ); + + line.appendTo( this.container ); + + return line; + }, + + /** + * Assigns a unique hash to the instance that is later used + * to tell unwanted lines from new ones. This method **must** be called + * before a new set of relations is to be visualized so {@link #cleanup} + * eventually hides obsolete lines. This is because lines + * are re-used between {@link #placeLine} calls and the number of + * necessary ones may vary depending on the number of relations. + * + * @param {Object} relations {@link CKEDITOR.plugins.lineutils.finder#relations}. + * @param {Object} locations {@link CKEDITOR.plugins.lineutils.locator#locations}. + */ + prepare: function( relations, locations ) { + this.relations = relations; + this.locations = locations; + this.hash = Math.random(); + }, + + /** + * Hides all visible lines that do not belong to current hash + * and no longer represent relations (locations). + * + * See also: {@link #prepare}. + */ + cleanup: function() { + var line; + + for ( var l in this.visible ) { + line = this.visible[ l ]; + + if ( line.getCustomData( 'hash' ) !== this.hash ) { + this.hideLine( line ); + } + } + }, + + /** + * Queries dimensions of the viewport, editable, frame etc. + * that are used for correct positioning of the line. + */ + queryViewport: function() { + this.winPane = this.win.getViewPaneSize(); + this.winTopScroll = this.winTop.getScrollPosition(); + this.winTopPane = this.winTop.getViewPaneSize(); + + // (http://dev.ckeditor.com/ticket/13155) + this.rect = this.getClientRect( this.inline ? this.editable : this.frame ); + }, + + /** + * Returns `boundingClientRect` of an element, shifted by the position + * of `container` when the container is not `static` (http://dev.ckeditor.com/ticket/13155). + * + * See also: {@link CKEDITOR.dom.element#getClientRect}. + * + * @param {CKEDITOR.dom.element} el A DOM element. + * @returns {Object} A shifted rect, extended by `relativeY` and `relativeX` properties. + */ + getClientRect: function( el ) { + var rect = el.getClientRect(), + relativeContainerDocPosition = this.container.getDocumentPosition(), + relativeContainerComputedPosition = this.container.getComputedStyle( 'position' ); + + // Static or not, those values are used to offset the position of the line so they cannot be undefined. + rect.relativeX = rect.relativeY = 0; + + if ( relativeContainerComputedPosition != 'static' ) { + // Remember the offset used to shift the clientRect. + rect.relativeY = relativeContainerDocPosition.y; + rect.relativeX = relativeContainerDocPosition.x; + + rect.top -= rect.relativeY; + rect.bottom -= rect.relativeY; + rect.left -= rect.relativeX; + rect.right -= rect.relativeX; + } + + return rect; + } + }; + + function is( type, flag ) { + return type & flag; + } + + var floats = { left: 1, right: 1, center: 1 }, + positions = { absolute: 1, fixed: 1 }; + + function isElement( node ) { + return node && node.type == CKEDITOR.NODE_ELEMENT; + } + + function isFloated( el ) { + return !!( floats[ el.getComputedStyle( 'float' ) ] || floats[ el.getAttribute( 'align' ) ] ); + } + + function isPositioned( el ) { + return !!positions[ el.getComputedStyle( 'position' ) ]; + } + + function isLimit( node ) { + return isElement( node ) && node.getAttribute( 'contenteditable' ) == 'true'; + } + + function isStatic( node ) { + return isElement( node ) && !isFloated( node ) && !isPositioned( node ); + } + + /** + * Global namespace storing definitions and global helpers for the Line Utilities plugin. + * + * @private + * @class + * @singleton + * @since 4.3 + */ + CKEDITOR.plugins.lineutils = { + finder: Finder, + locator: Locator, + liner: Liner + }; +} )(); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/contents.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/contents.css new file mode 100644 index 0000000..c2b51d3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/contents.css @@ -0,0 +1,23 @@ +.mediumBorder { + border-width: 2px; +} +.thickBorder { + border-width: 5px; +} +img.thickBorder, img.mediumBorder { + border-style: solid; + border-color: #CCC; +} +.important.soMuch { + margin: 25px; + padding: 25px; + background: red; + border: none; +} + +span.redMarker { + background-color: red; +} +.invisible { + opacity: 0.1; +} \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/sample.jpg b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/sample.jpg new file mode 100644 index 0000000..a4a77fa Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/sample.jpg differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/contents.css b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/contents.css new file mode 100644 index 0000000..dba3015 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/contents.css @@ -0,0 +1,36 @@ +.simplebox { + padding: 8px; + margin: 10px; + background: #eee; + border-radius: 8px; + border: 1px solid #ddd; + box-shadow: 0 1px 1px #fff inset, 0 -1px 0px #ccc inset; +} +.simplebox-title, .simplebox-content { + box-shadow: 0 1px 1px #ddd inset; + border: 1px solid #cccccc; + border-radius: 5px; + background: #fff; +} +.simplebox-title { + margin: 0 0 8px; + padding: 5px 8px; +} +.simplebox-content { + padding: 0 8px; +} +.simplebox-content::after { + content: ''; + display: block; + clear: both; +} +.simplebox.align-right { + float: right; +} +.simplebox.align-left { + float: left; +} +.simplebox.align-center { + margin-left: auto; + margin-right: auto; +} \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js new file mode 100644 index 0000000..f0cdb4d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js @@ -0,0 +1,51 @@ +// Note: This automatic widget to dialog window binding (the fact that every field is set up from the widget +// and is committed to the widget) is only possible when the dialog is opened by the Widgets System +// (i.e. the widgetDef.dialog property is set). +// When you are opening the dialog window by yourself, you need to take care of this by yourself too. + +CKEDITOR.dialog.add( 'simplebox', function( editor ) { + return { + title: 'Edit Simple Box', + minWidth: 200, + minHeight: 100, + contents: [ + { + id: 'info', + elements: [ + { + id: 'align', + type: 'select', + label: 'Align', + items: [ + [ editor.lang.common.notSet, '' ], + [ editor.lang.common.alignLeft, 'left' ], + [ editor.lang.common.alignRight, 'right' ], + [ editor.lang.common.alignCenter, 'center' ] + ], + // When setting up this field, set its value to the "align" value from widget data. + // Note: Align values used in the widget need to be the same as those defined in the "items" array above. + setup: function( widget ) { + this.setValue( widget.data.align ); + }, + // When committing (saving) this field, set its value to the widget data. + commit: function( widget ) { + widget.setData( 'align', this.getValue() ); + } + }, + { + id: 'width', + type: 'text', + label: 'Width', + width: '50px', + setup: function( widget ) { + this.setValue( widget.data.width ); + }, + commit: function( widget ) { + widget.setData( 'width', this.getValue() ); + } + } + ] + } + ] + }; +} ); \ No newline at end of file diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/icons/simplebox.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/icons/simplebox.png new file mode 100644 index 0000000..6a5e313 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/icons/simplebox.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/plugin.js new file mode 100644 index 0000000..3e7c99c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/assets/simplebox/plugin.js @@ -0,0 +1,114 @@ +'use strict'; + +// Register the plugin within the editor. +CKEDITOR.plugins.add( 'simplebox', { + // This plugin requires the Widgets System defined in the 'widget' plugin. + requires: 'widget,dialog', + + // Register the icon used for the toolbar button. It must be the same + // as the name of the widget. + icons: 'simplebox', + + // The plugin initialization logic goes inside this method. + init: function( editor ) { + // Register the editing dialog. + CKEDITOR.dialog.add( 'simplebox', this.path + 'dialogs/simplebox.js' ); + + // Register the simplebox widget. + editor.widgets.add( 'simplebox', { + // Allow all HTML elements, classes, and styles that this widget requires. + // Read more about the Advanced Content Filter here: + // * http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter + // * http://docs.ckeditor.com/#!/guide/plugin_sdk_integration_with_acf + allowedContent: + 'div(!simplebox,align-left,align-right,align-center){width};' + + 'div(!simplebox-content); h2(!simplebox-title)', + + // Minimum HTML which is required by this widget to work. + requiredContent: 'div(simplebox)', + + // Define two nested editable areas. + editables: { + title: { + // Define CSS selector used for finding the element inside widget element. + selector: '.simplebox-title', + // Define content allowed in this nested editable. Its content will be + // filtered accordingly and the toolbar will be adjusted when this editable + // is focused. + allowedContent: 'br strong em' + }, + content: { + selector: '.simplebox-content' + } + }, + + // Define the template of a new Simple Box widget. + // The template will be used when creating new instances of the Simple Box widget. + template: + '
' + + '

Title

' + + '

Content...

' + + '
', + + // Define the label for a widget toolbar button which will be automatically + // created by the Widgets System. This button will insert a new widget instance + // created from the template defined above, or will edit selected widget + // (see second part of this tutorial to learn about editing widgets). + // + // Note: In order to be able to translate your widget you should use the + // editor.lang.simplebox.* property. A string was used directly here to simplify this tutorial. + button: 'Create a simple box', + + // Set the widget dialog window name. This enables the automatic widget-dialog binding. + // This dialog window will be opened when creating a new widget or editing an existing one. + dialog: 'simplebox', + + // Check the elements that need to be converted to widgets. + // + // Note: The "element" argument is an instance of http://docs.ckeditor.com/#!/api/CKEDITOR.htmlParser.element + // so it is not a real DOM element yet. This is caused by the fact that upcasting is performed + // during data processing which is done on DOM represented by JavaScript objects. + upcast: function( element ) { + // Return "true" (that element needs to converted to a Simple Box widget) + // for all
elements with a "simplebox" class. + return element.name == 'div' && element.hasClass( 'simplebox' ); + }, + + // When a widget is being initialized, we need to read the data ("align" and "width") + // from DOM and set it by using the widget.setData() method. + // More code which needs to be executed when DOM is available may go here. + init: function() { + var width = this.element.getStyle( 'width' ); + if ( width ) + this.setData( 'width', width ); + + if ( this.element.hasClass( 'align-left' ) ) + this.setData( 'align', 'left' ); + if ( this.element.hasClass( 'align-right' ) ) + this.setData( 'align', 'right' ); + if ( this.element.hasClass( 'align-center' ) ) + this.setData( 'align', 'center' ); + }, + + // Listen on the widget#data event which is fired every time the widget data changes + // and updates the widget's view. + // Data may be changed by using the widget.setData() method, which we use in the + // Simple Box dialog window. + data: function() { + // Check whether "width" widget data is set and remove or set "width" CSS style. + // The style is set on widget main element (div.simplebox). + if ( !this.data.width ) + this.element.removeStyle( 'width' ); + else + this.element.setStyle( 'width', this.data.width ); + + // Brutally remove all align classes and set a new one if "align" widget data is set. + this.element.removeClass( 'align-left' ); + this.element.removeClass( 'align-right' ); + this.element.removeClass( 'align-center' ); + if ( this.data.align ) + this.element.addClass( 'align-' + this.data.align ); + } + } ); + } +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/console.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/console.js new file mode 100644 index 0000000..1404a2c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/console.js @@ -0,0 +1,131 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/* global CKCONSOLE */ + +'use strict'; + +( function() { + + CKCONSOLE.add( 'widget', { + panels: [ + { + type: 'box', + content: '
    ', + + refresh: function( editor ) { + var instances = obj2Array( editor.widgets.instances ); + + return { + header: 'Instances (' + instances.length + ')', + instances: generateInstancesList( instances ) + }; + }, + + refreshOn: function( editor, refresh ) { + editor.widgets.on( 'instanceCreated', function( evt ) { + refresh(); + + evt.data.on( 'data', refresh ); + } ); + + editor.widgets.on( 'instanceDestroyed', refresh ); + } + }, + + { + type: 'box', + content: + '
      ' + + '
    • focused:
    • ' + + '
    • selected:
    • ' + + '
    ', + + refresh: function( editor ) { + var focused = editor.widgets.focused, + selected = editor.widgets.selected, + selectedIds = []; + + for ( var i = 0; i < selected.length; ++i ) + selectedIds.push( selected[ i ].id ); + + return { + header: 'Focus & selection', + focused: focused ? 'id: ' + focused.id : '-', + selected: selectedIds.length ? 'id: ' + selectedIds.join( ', id: ' ) : '-' + }; + }, + + refreshOn: function( editor, refresh ) { + editor.on( 'selectionCheck', refresh, null, null, 999 ); + } + }, + + { + type: 'log', + + on: function( editor, log, logFn ) { + // Add all listeners with high priorities to log + // messages in the correct order when one event depends on another. + // E.g. selectionChange triggers widget selection - if this listener + // for selectionChange will be executed later than that one, then order + // will be incorrect. + + editor.on( 'selectionChange', function( evt ) { + var msg = 'selection change', + sel = evt.data.selection, + el = sel.getSelectedElement(), + widget; + + if ( el && ( widget = editor.widgets.getByElement( el, true ) ) ) + msg += ' (id: ' + widget.id + ')'; + + log( msg ); + }, null, null, 1 ); + + editor.widgets.on( 'instanceDestroyed', function( evt ) { + log( 'instance destroyed (id: ' + evt.data.id + ')' ); + }, null, null, 1 ); + + editor.widgets.on( 'instanceCreated', function( evt ) { + log( 'instance created (id: ' + evt.data.id + ')' ); + }, null, null, 1 ); + + editor.widgets.on( 'widgetFocused', function( evt ) { + log( 'widget focused (id: ' + evt.data.widget.id + ')' ); + }, null, null, 1 ); + + editor.widgets.on( 'widgetBlurred', function( evt ) { + log( 'widget blurred (id: ' + evt.data.widget.id + ')' ); + }, null, null, 1 ); + + editor.widgets.on( 'checkWidgets', logFn( 'checking widgets' ), null, null, 1 ); + editor.widgets.on( 'checkSelection', logFn( 'checking selection' ), null, null, 1 ); + } + } + ] + } ); + + function generateInstancesList( instances ) { + var html = '', + instance; + + for ( var i = 0; i < instances.length; ++i ) { + instance = instances[ i ]; + html += itemTpl.output( { id: instance.id, name: instance.name, data: JSON.stringify( instance.data ) } ); + } + return html; + } + + function obj2Array( obj ) { + var arr = []; + for ( var id in obj ) + arr.push( obj[ id ] ); + + return arr; + } + + var itemTpl = new CKEDITOR.template( '
  • id: {id}, name: {name}, data: {data}
  • ' ); +} )(); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/nestedwidgets.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/nestedwidgets.html new file mode 100644 index 0000000..0bc998b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/nestedwidgets.html @@ -0,0 +1,134 @@ + + + + + + Nested widgets — CKEditor Sample + + + + + + + + + +

    Nested widgets

    + +

    Classic (iframe-based) Sample

    + + +

    Inline Sample

    +
    +

    Simple Box Sample

    + +
    +

    Title

    +
    +

    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]].

    + +
    + The Eagle +
    The Eagle in lunar orbit
    +
    + +
      +
    • Foo!
    • +
    • Bar!
    • +
    + +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.

    +
    +
    + +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.

    + +

    Pellentesque vitae eleifend nisl, non accumsan tellus. Maecenas nec libero non tellus tincidunt mollis porttitor sed arcu. Donec ultricies nulla vitae eros lacinia, vel congue sem auctor. Vivamus convallis, urna ac tincidunt malesuada, lectus erat convallis metus, a hendrerit massa augue accumsan magna. Nulla mattis tellus elit, nec congue magna scelerisque eget. Aliquam posuere nisi augue, posuere sodales nisi iaculis eu. Donec fermentum urna id nibh sagittis fermentum sit amet sed enim. Aliquam neque elit, pretium elementum nunc a, faucibus accumsan lorem. Etiam pulvinar odio et hendrerit tincidunt. Suspendisse tempus eros lacus, in convallis velit mollis ut. Aenean congue, justo eleifend ultricies malesuada, nunc nunc molestie mauris, eget placerat libero eros vel nisi. Quisque diam arcu, mollis ac laoreet vitae, varius et sem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis in vehicula sapien. Nunc feugiat porta elit nec volutpat.

    + +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci ut nisi adipiscing ultrices. Sed pellentesque iaculis malesuada. Pellentesque scelerisque, purus non porta dictum, neque urna bibendum dolor, eget tristique ipsum metus fringilla dolor. Nullam sed accumsan sapien. Vestibulum in placerat magna. Sed justo lacus, volutpat rhoncus odio luctus, ornare adipiscing mauris. Vivamus erat sem, egestas et lectus eget, varius cursus odio. Duis posuere lacus sit amet urna bibendum, id iaculis eros ultrices. Vestibulum a ultrices ante.

    + +
    +

    Title

    +
    +

    The EagleApollo 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]].

    + +
      +
    • Foo!
    • +
    • Bar!
    • +
    +
    +
    + +

    Ut eget ipsum a sapien porta ultrices. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus mi lacus, pharetra eu bibendum blandit, tristique sit amet leo. Integer eu nulla nec magna vulputate blandit. Praesent mattis quis ante eget adipiscing. Nulla vel tempus risus, in placerat velit. Mauris sed nibh at elit posuere laoreet. Morbi non sapien sed nunc fringilla imperdiet.

    +
    + + + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/widgetstyles.html b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/widgetstyles.html new file mode 100644 index 0000000..da58e44 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/dev/widgetstyles.html @@ -0,0 +1,144 @@ + + + + + + Applying styles to widgets — CKEditor Sample + + + + + + +

    Applying styles to widgets

    + +

    Classic (iframe-based) Sample

    + + +

    Inline Sample

    +
    +

    Apollo 11

    + +
    + Saturn V +
    Roll out of Saturn V on launch pad
    +
    + +

    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.

    +
    + +

    \( \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \)

    + +

    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.

    +
    + +
    + The Eagle +
    The Eagle in lunar orbit
    +
    + +

    Technical details

    + +

    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.

    +
    + + + + diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/images/handle.png b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/images/handle.png new file mode 100644 index 0000000..ba8cda5 Binary files /dev/null and b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/images/handle.png differ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/af.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/af.js new file mode 100644 index 0000000..c05e1b1 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/af.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'af', { + 'move': 'Klik en trek on te beweeg', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ar.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ar.js new file mode 100644 index 0000000..f53676a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ar.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ar', { + 'move': 'إضغط و إسحب للتحريك', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/az.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/az.js new file mode 100644 index 0000000..ed7d2e5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/az.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'az', { + 'move': 'Tıklayın və aparın', + 'label': '%1 vidjet' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/bg.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/bg.js new file mode 100644 index 0000000..8b1ad01 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/bg.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'bg', { + 'move': 'Кликни и влачи, за да преместиш', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ca.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ca.js new file mode 100644 index 0000000..7572f0e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ca.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ca', { + 'move': 'Clicar i arrossegar per moure', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cs.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cs.js new file mode 100644 index 0000000..ba16149 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cs.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'cs', { + 'move': 'Klepněte a táhněte pro přesunutí', + 'label': 'Ovládací prvek %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cy.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cy.js new file mode 100644 index 0000000..9bbc89a --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/cy.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'cy', { + 'move': 'Clcio a llusgo i symud', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/da.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/da.js new file mode 100644 index 0000000..a6a1bb7 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/da.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'da', { + 'move': 'Klik og træk for at flytte', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de-ch.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de-ch.js new file mode 100644 index 0000000..d409bb6 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de-ch.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'de-ch', { + 'move': 'Zum Verschieben anwählen und ziehen', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de.js new file mode 100644 index 0000000..eb05fb8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/de.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'de', { + 'move': 'Zum Verschieben anwählen und ziehen', + 'label': '%1 Steuerelement' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/el.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/el.js new file mode 100644 index 0000000..4ea9504 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/el.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'el', { + 'move': 'Κάνετε κλικ και σύρετε το ποντίκι για να μετακινήστε', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en-gb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en-gb.js new file mode 100644 index 0000000..ad1a209 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en-gb.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'en-gb', { + 'move': 'Click and drag to move', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en.js new file mode 100644 index 0000000..d2a43cb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/en.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'en', { + 'move': 'Click and drag to move', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eo.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eo.js new file mode 100644 index 0000000..5801514 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eo.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'eo', { + 'move': 'klaki kaj treni por movi', + 'label': '%1 fenestraĵo' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es-mx.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es-mx.js new file mode 100644 index 0000000..028901d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es-mx.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'es-mx', { + 'move': 'Presiona y arrastra para mover', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es.js new file mode 100644 index 0000000..89d1639 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/es.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'es', { + 'move': 'Dar clic y arrastrar para mover', + 'label': 'reproductor %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eu.js new file mode 100644 index 0000000..5a3d126 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/eu.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'eu', { + 'move': 'Klikatu eta arrastatu lekuz aldatzeko', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fa.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fa.js new file mode 100644 index 0000000..16c27bf --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fa.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'fa', { + 'move': 'کلیک و کشیدن برای جابجایی', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fi.js new file mode 100644 index 0000000..a4d6e2f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fi.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'fi', { + 'move': 'Siirrä klikkaamalla ja raahaamalla', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fr.js new file mode 100644 index 0000000..f7f87e8 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/fr.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'fr', { + 'move': 'Cliquer et glisser pour déplacer', + 'label': 'Élément %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/gl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/gl.js new file mode 100644 index 0000000..a480371 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/gl.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'gl', { + 'move': 'Prema e arrastre para mover', + 'label': 'Trebello %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/he.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/he.js new file mode 100644 index 0000000..08da4df --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/he.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'he', { + 'move': 'לחץ וגרור להזזה', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hr.js new file mode 100644 index 0000000..c0b8b31 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hr.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'hr', { + 'move': 'Klikni i povuci za pomicanje', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hu.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hu.js new file mode 100644 index 0000000..597e11d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/hu.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'hu', { + 'move': 'Kattints és húzd a mozgatáshoz', + 'label': '%1 modul' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/id.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/id.js new file mode 100644 index 0000000..b1cf39b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/id.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'id', { + 'move': 'Tekan dan geser untuk memindahkan', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/it.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/it.js new file mode 100644 index 0000000..707481f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/it.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'it', { + 'move': 'Fare clic e trascinare per spostare', + 'label': 'Widget %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ja.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ja.js new file mode 100644 index 0000000..7c329d0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ja.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ja', { + 'move': 'ドラッグして移動', + 'label': '%1 ウィジェット' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/km.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/km.js new file mode 100644 index 0000000..08ec7aa --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/km.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'km', { + 'move': 'ចុច​ហើយ​ទាញ​ដើម្បី​ផ្លាស់​ទី', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ko.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ko.js new file mode 100644 index 0000000..8c62287 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ko.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ko', { + 'move': '움직이려면 클릭 후 드래그 하세요', + 'label': '%1 위젯' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ku.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ku.js new file mode 100644 index 0000000..2ff829b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ku.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ku', { + 'move': 'کرتەبکە و ڕایبکێشە بۆ جوڵاندن', + 'label': '%1 ویجێت' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/lv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/lv.js new file mode 100644 index 0000000..de6167b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/lv.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'lv', { + 'move': 'Klikšķina un velc, lai pārvietotu', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nb.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nb.js new file mode 100644 index 0000000..dfba027 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nb.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'nb', { + 'move': 'Klikk og dra for å flytte', + 'label': 'Widget %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nl.js new file mode 100644 index 0000000..188f48c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/nl.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'nl', { + 'move': 'Klik en sleep om te verplaatsen', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/no.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/no.js new file mode 100644 index 0000000..62a93d9 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/no.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'no', { + 'move': 'Klikk og dra for å flytte', + 'label': 'Widget %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/oc.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/oc.js new file mode 100644 index 0000000..6a559e0 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/oc.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'oc', { + 'move': 'Clicar e lisar per desplaçar', + 'label': 'Element %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pl.js new file mode 100644 index 0000000..6486765 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pl.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'pl', { + 'move': 'Kliknij i przeciągnij, by przenieść.', + 'label': 'Widget %1' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt-br.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt-br.js new file mode 100644 index 0000000..7f44722 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt-br.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'pt-br', { + 'move': 'Click e arraste para mover', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt.js new file mode 100644 index 0000000..97ada9d --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/pt.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'pt', { + 'move': 'Clique e arraste para mover', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ru.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ru.js new file mode 100644 index 0000000..68d612b --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ru.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ru', { + 'move': 'Нажмите и перетащите, чтобы переместить', + 'label': '%1 виджет' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sk.js new file mode 100644 index 0000000..cd75ecb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sk.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'sk', { + 'move': 'Kliknite a potiahnite pre presunutie', + 'label': '%1 widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sl.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sl.js new file mode 100644 index 0000000..64b8ae5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sl.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'sl', { + 'move': 'Kliknite in povlecite, da premaknete', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sq.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sq.js new file mode 100644 index 0000000..4c725c3 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sq.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'sq', { + 'move': 'Kliko dhe tërhiqe për ta lëvizur', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sv.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sv.js new file mode 100644 index 0000000..a7e228f --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/sv.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'sv', { + 'move': 'Klicka och drag för att flytta', + 'label': '%1-widget' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tr.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tr.js new file mode 100644 index 0000000..f25b1ea --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tr.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'tr', { + 'move': 'Taşımak için, tıklayın ve sürükleyin', + 'label': '%1 Grafik Beleşeni' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tt.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tt.js new file mode 100644 index 0000000..1772db5 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/tt.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'tt', { + 'move': 'Күчереп куер өчен басып шудырыгыз', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ug.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ug.js new file mode 100644 index 0000000..9f39366 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/ug.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'ug', { + 'move': 'يۆتكەشتە چېكىپ سۆرەڭ', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/uk.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/uk.js new file mode 100644 index 0000000..4eb2d2e --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/uk.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'uk', { + 'move': 'Клікніть і потягніть для переміщення', + 'label': '%1 віджет' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/vi.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/vi.js new file mode 100644 index 0000000..76f5680 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/vi.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'vi', { + 'move': 'Nhấp chuột và kéo để di chuyển', + 'label': '%1 widget' // MISSING +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh-cn.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh-cn.js new file mode 100644 index 0000000..93f393c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh-cn.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'zh-cn', { + 'move': '点击并拖拽以移动', + 'label': '%1 小部件' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh.js new file mode 100644 index 0000000..a89a616 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/lang/zh.js @@ -0,0 +1,8 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ +CKEDITOR.plugins.setLang( 'widget', 'zh', { + 'move': '拖曳以移動', + 'label': '%1 小工具' +} ); diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/plugin.js new file mode 100644 index 0000000..3816dcb --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widget/plugin.js @@ -0,0 +1,4147 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @fileOverview [Widget](http://ckeditor.com/addon/widget) plugin. + */ + +'use strict'; + +( function() { + var DRAG_HANDLER_SIZE = 15; + + CKEDITOR.plugins.add( 'widget', { + // jscs:disable maximumLineLength + lang: 'af,ar,az,bg,ca,cs,cy,da,de,de-ch,el,en,en-gb,eo,es,es-mx,eu,fa,fi,fr,gl,he,hr,hu,id,it,ja,km,ko,ku,lv,nb,nl,no,oc,pl,pt,pt-br,ru,sk,sl,sq,sv,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% + // jscs:enable maximumLineLength + requires: 'lineutils,clipboard,widgetselection', + onLoad: function() { + CKEDITOR.addCss( + '.cke_widget_wrapper{' + + 'position:relative;' + + 'outline:none' + + '}' + + '.cke_widget_inline{' + + 'display:inline-block' + + '}' + + '.cke_widget_wrapper:hover>.cke_widget_element{' + + 'outline:2px solid yellow;' + + 'cursor:default' + + '}' + + '.cke_widget_wrapper:hover .cke_widget_editable{' + + 'outline:2px solid yellow' + + '}' + + '.cke_widget_wrapper.cke_widget_focused>.cke_widget_element,' + + // We need higher specificity than hover style. + '.cke_widget_wrapper .cke_widget_editable.cke_widget_editable_focused{' + + 'outline:2px solid #ace' + + '}' + + '.cke_widget_editable{' + + 'cursor:text' + + '}' + + '.cke_widget_drag_handler_container{' + + 'position:absolute;' + + 'width:' + DRAG_HANDLER_SIZE + 'px;' + + 'height:0;' + + // Initially drag handler should not be visible, until its position will be + // calculated (http://dev.ckeditor.com/ticket/11177). + // We need to hide unpositined handlers, so they don't extend + // widget's outline far to the left (http://dev.ckeditor.com/ticket/12024). + 'display:none;' + + 'opacity:0.75;' + + 'transition:height 0s 0.2s;' + // Delay hiding drag handler. + // Prevent drag handler from being misplaced (http://dev.ckeditor.com/ticket/11198). + 'line-height:0' + + '}' + + '.cke_widget_wrapper:hover>.cke_widget_drag_handler_container{' + + 'height:' + DRAG_HANDLER_SIZE + 'px;' + + 'transition:none' + + '}' + + '.cke_widget_drag_handler_container:hover{' + + 'opacity:1' + + '}' + + 'img.cke_widget_drag_handler{' + + 'cursor:move;' + + 'width:' + DRAG_HANDLER_SIZE + 'px;' + + 'height:' + DRAG_HANDLER_SIZE + 'px;' + + 'display:inline-block' + + '}' + + '.cke_widget_mask{' + + 'position:absolute;' + + 'top:0;' + + 'left:0;' + + 'width:100%;' + + 'height:100%;' + + 'display:block' + + '}' + + '.cke_editable.cke_widget_dragging, .cke_editable.cke_widget_dragging *{' + + 'cursor:move !important' + + '}' + ); + }, + + beforeInit: function( editor ) { + /** + * An instance of widget repository. It contains all + * {@link CKEDITOR.plugins.widget.repository#registered registered widget definitions} and + * {@link CKEDITOR.plugins.widget.repository#instances initialized instances}. + * + * editor.widgets.add( 'someName', { + * // Widget definition... + * } ); + * + * editor.widgets.registered.someName; // -> Widget definition + * + * @since 4.3 + * @readonly + * @property {CKEDITOR.plugins.widget.repository} widgets + * @member CKEDITOR.editor + */ + editor.widgets = new Repository( editor ); + }, + + afterInit: function( editor ) { + addWidgetButtons( editor ); + setupContextMenu( editor ); + } + } ); + + /** + * Widget repository. It keeps track of all {@link #registered registered widget definitions} and + * {@link #instances initialized instances}. An instance of the repository is available under + * the {@link CKEDITOR.editor#widgets} property. + * + * @class CKEDITOR.plugins.widget.repository + * @mixins CKEDITOR.event + * @constructor Creates a widget repository instance. Note that the widget plugin automatically + * creates a repository instance which is available under the {@link CKEDITOR.editor#widgets} property. + * @param {CKEDITOR.editor} editor The editor instance for which the repository will be created. + */ + function Repository( editor ) { + /** + * The editor instance for which this repository was created. + * + * @readonly + * @property {CKEDITOR.editor} editor + */ + this.editor = editor; + + /** + * A hash of registered widget definitions (definition name => {@link CKEDITOR.plugins.widget.definition}). + * + * To register a definition use the {@link #add} method. + * + * @readonly + */ + this.registered = {}; + + /** + * An object containing initialized widget instances (widget id => {@link CKEDITOR.plugins.widget}). + * + * @readonly + */ + this.instances = {}; + + /** + * An array of selected widget instances. + * + * @readonly + * @property {CKEDITOR.plugins.widget[]} selected + */ + this.selected = []; + + /** + * The focused widget instance. See also {@link CKEDITOR.plugins.widget#event-focus} + * and {@link CKEDITOR.plugins.widget#event-blur} events. + * + * editor.on( 'selectionChange', function() { + * if ( editor.widgets.focused ) { + * // Do something when a widget is focused... + * } + * } ); + * + * @readonly + * @property {CKEDITOR.plugins.widget} focused + */ + this.focused = null; + + /** + * The widget instance that contains the nested editable which is currently focused. + * + * @readonly + * @property {CKEDITOR.plugins.widget} widgetHoldingFocusedEditable + */ + this.widgetHoldingFocusedEditable = null; + + this._ = { + nextId: 0, + upcasts: [], + upcastCallbacks: [], + filters: {} + }; + + setupWidgetsLifecycle( this ); + setupSelectionObserver( this ); + setupMouseObserver( this ); + setupKeyboardObserver( this ); + setupDragAndDrop( this ); + setupNativeCutAndCopy( this ); + } + + Repository.prototype = { + /** + * Minimum interval between selection checks. + * + * @private + */ + MIN_SELECTION_CHECK_INTERVAL: 500, + + /** + * Adds a widget definition to the repository. Fires the {@link CKEDITOR.editor#widgetDefinition} event + * which allows to modify the widget definition which is going to be registered. + * + * @param {String} name The name of the widget definition. + * @param {CKEDITOR.plugins.widget.definition} widgetDef Widget definition. + * @returns {CKEDITOR.plugins.widget.definition} + */ + add: function( name, widgetDef ) { + // Create prototyped copy of original widget definition, so we won't modify it. + widgetDef = CKEDITOR.tools.prototypedCopy( widgetDef ); + widgetDef.name = name; + + widgetDef._ = widgetDef._ || {}; + + this.editor.fire( 'widgetDefinition', widgetDef ); + + if ( widgetDef.template ) + widgetDef.template = new CKEDITOR.template( widgetDef.template ); + + addWidgetCommand( this.editor, widgetDef ); + addWidgetProcessors( this, widgetDef ); + + this.registered[ name ] = widgetDef; + + return widgetDef; + }, + + /** + * Adds a callback for element upcasting. Each callback will be executed + * for every element which is later tested by upcast methods. If a callback + * returns `false`, the element will not be upcasted. + * + * // Images with the "banner" class will not be upcasted (e.g. to the image widget). + * editor.widgets.addUpcastCallback( function( element ) { + * if ( element.name == 'img' && element.hasClass( 'banner' ) ) + * return false; + * } ); + * + * @param {Function} callback + * @param {CKEDITOR.htmlParser.element} callback.element + */ + addUpcastCallback: function( callback ) { + this._.upcastCallbacks.push( callback ); + }, + + /** + * Checks the selection to update widget states (selection and focus). + * + * This method is triggered by the {@link #event-checkSelection} event. + */ + checkSelection: function() { + var sel = this.editor.getSelection(), + selectedElement = sel.getSelectedElement(), + updater = stateUpdater( this ), + widget; + + // Widget is focused so commit and finish checking. + if ( selectedElement && ( widget = this.getByElement( selectedElement, true ) ) ) + return updater.focus( widget ).select( widget ).commit(); + + var range = sel.getRanges()[ 0 ]; + + // No ranges or collapsed range mean that nothing is selected, so commit and finish checking. + if ( !range || range.collapsed ) + return updater.commit(); + + // Range is not empty, so create walker checking for wrappers. + var walker = new CKEDITOR.dom.walker( range ), + wrapper; + + walker.evaluator = Widget.isDomWidgetWrapper; + + while ( ( wrapper = walker.next() ) ) + updater.select( this.getByElement( wrapper ) ); + + updater.commit(); + }, + + /** + * Checks if all widget instances are still present in the DOM. + * Destroys those instances that are not present. + * Reinitializes widgets on widget wrappers for which widget instances + * cannot be found. Takes nested widgets into account, too. + * + * This method triggers the {@link #event-checkWidgets} event whose listeners + * can cancel the method's execution or modify its options. + * + * @param [options] The options object. + * @param {Boolean} [options.initOnlyNew] Initializes widgets only on newly wrapped + * widget elements (those which still have the `cke_widget_new` class). When this option is + * set to `true`, widgets which were invalidated (e.g. by replacing with a cloned DOM structure) + * will not be reinitialized. This makes the check faster. + * @param {Boolean} [options.focusInited] If only one widget is initialized by + * the method, it will be focused. + */ + checkWidgets: function( options ) { + this.fire( 'checkWidgets', CKEDITOR.tools.copy( options || {} ) ); + }, + + /** + * Removes the widget from the editor and moves the selection to the closest + * editable position if the widget was focused before. + * + * @param {CKEDITOR.plugins.widget} widget The widget instance to be deleted. + */ + del: function( widget ) { + if ( this.focused === widget ) { + var editor = widget.editor, + range = editor.createRange(), + found; + + // If haven't found place for caret on the default side, + // try to find it on the other side. + if ( !( found = range.moveToClosestEditablePosition( widget.wrapper, true ) ) ) + found = range.moveToClosestEditablePosition( widget.wrapper, false ); + + if ( found ) + editor.getSelection().selectRanges( [ range ] ); + } + + widget.wrapper.remove(); + this.destroy( widget, true ); + }, + + /** + * Destroys the widget instance and all its nested widgets (widgets inside its nested editables). + * + * @param {CKEDITOR.plugins.widget} widget The widget instance to be destroyed. + * @param {Boolean} [offline] Whether the widget is offline (detached from the DOM tree) — + * in this case the DOM (attributes, classes, etc.) will not be cleaned up. + */ + destroy: function( widget, offline ) { + if ( this.widgetHoldingFocusedEditable === widget ) + setFocusedEditable( this, widget, null, offline ); + + widget.destroy( offline ); + delete this.instances[ widget.id ]; + this.fire( 'instanceDestroyed', widget ); + }, + + /** + * Destroys all widget instances. + * + * @param {Boolean} [offline] Whether the widgets are offline (detached from the DOM tree) — + * in this case the DOM (attributes, classes, etc.) will not be cleaned up. + * @param {CKEDITOR.dom.element} [container] The container within widgets will be destroyed. + * This option will be ignored if the `offline` flag was set to `true`, because in such case + * it is not possible to find widgets within the passed block. + */ + destroyAll: function( offline, container ) { + var widget, + id, + instances = this.instances; + + if ( container && !offline ) { + var wrappers = container.find( '.cke_widget_wrapper' ), + l = wrappers.count(), + i = 0; + + // Length is constant, because this is not a live node list. + // Note: since querySelectorAll returns nodes in document order, + // outer widgets are always placed before their nested widgets and therefore + // are destroyed before them. + for ( ; i < l; ++i ) { + widget = this.getByElement( wrappers.getItem( i ), true ); + // Widget might not be found, because it could be a nested widget, + // which would be destroyed when destroying its parent. + if ( widget ) + this.destroy( widget ); + } + + return; + } + + for ( id in instances ) { + widget = instances[ id ]; + this.destroy( widget, offline ); + } + }, + + /** + * Finalizes a process of widget creation. This includes: + * + * * inserting widget element into editor, + * * marking widget instance as ready (see {@link CKEDITOR.plugins.widget#event-ready}), + * * focusing widget instance. + * + * This method is used by the default widget's command and is called + * after widget's dialog (if set) is closed. It may also be used in a + * customized process of widget creation and insertion. + * + * widget.once( 'edit', function() { + * // Finalize creation only of not ready widgets. + * if ( widget.isReady() ) + * return; + * + * // Cancel edit event to prevent automatic widget insertion. + * evt.cancel(); + * + * CustomDialog.open( widget.data, function saveCallback( savedData ) { + * // Cache the container, because widget may be destroyed while saving data, + * // if this process will require some deep transformations. + * var container = widget.wrapper.getParent(); + * + * widget.setData( savedData ); + * + * // Widget will be retrieved from container and inserted into editor. + * editor.widgets.finalizeCreation( container ); + * } ); + * } ); + * + * @param {CKEDITOR.dom.element/CKEDITOR.dom.documentFragment} container The element + * or document fragment which contains widget wrapper. The container is used, so before + * finalizing creation the widget can be freely transformed (even destroyed and reinitialized). + */ + finalizeCreation: function( container ) { + var wrapper = container.getFirst(); + if ( wrapper && Widget.isDomWidgetWrapper( wrapper ) ) { + this.editor.insertElement( wrapper ); + + var widget = this.getByElement( wrapper ); + // Fire postponed #ready event. + widget.ready = true; + widget.fire( 'ready' ); + widget.focus(); + } + }, + + /** + * Finds a widget instance which contains a given element. The element will be the {@link CKEDITOR.plugins.widget#wrapper wrapper} + * of the returned widget or a descendant of this {@link CKEDITOR.plugins.widget#wrapper wrapper}. + * + * editor.widgets.getByElement( someWidget.wrapper ); // -> someWidget + * editor.widgets.getByElement( someWidget.parts.caption ); // -> someWidget + * + * // Check wrapper only: + * editor.widgets.getByElement( someWidget.wrapper, true ); // -> someWidget + * editor.widgets.getByElement( someWidget.parts.caption, true ); // -> null + * + * @param {CKEDITOR.dom.element} element The element to be checked. + * @param {Boolean} [checkWrapperOnly] If set to `true`, the method will not check wrappers' descendants. + * @returns {CKEDITOR.plugins.widget} The widget instance or `null`. + */ + getByElement: ( function() { + var validWrapperElements = { div: 1, span: 1 }; + function getWidgetId( element ) { + return element.is( validWrapperElements ) && element.data( 'cke-widget-id' ); + } + + return function( element, checkWrapperOnly ) { + if ( !element ) + return null; + + var id = getWidgetId( element ); + + // There's no need to check element parents if element is a wrapper. + if ( !checkWrapperOnly && !id ) { + var limit = this.editor.editable(); + + // Try to find a closest ascendant which is a widget wrapper. + do { + element = element.getParent(); + } while ( element && !element.equals( limit ) && !( id = getWidgetId( element ) ) ); + } + + return this.instances[ id ] || null; + }; + } )(), + + /** + * Initializes a widget on a given element if the widget has not been initialized on it yet. + * + * @param {CKEDITOR.dom.element} element The future widget element. + * @param {String/CKEDITOR.plugins.widget.definition} [widgetDef] Name of a widget or a widget definition. + * The widget definition should be previously registered by using the + * {@link CKEDITOR.plugins.widget.repository#add} method. + * @param [startupData] Widget startup data (has precedence over default one). + * @returns {CKEDITOR.plugins.widget} The widget instance or `null` if a widget could not be initialized on + * a given element. + */ + initOn: function( element, widgetDef, startupData ) { + if ( !widgetDef ) + widgetDef = this.registered[ element.data( 'widget' ) ]; + else if ( typeof widgetDef == 'string' ) + widgetDef = this.registered[ widgetDef ]; + + if ( !widgetDef ) + return null; + + // Wrap element if still wasn't wrapped (was added during runtime by method that skips dataProcessor). + var wrapper = this.wrapElement( element, widgetDef.name ); + + if ( wrapper ) { + // Check if widget wrapper is new (widget hasn't been initialized on it yet). + // This class will be removed by widget constructor to avoid locking snapshot twice. + if ( wrapper.hasClass( 'cke_widget_new' ) ) { + var widget = new Widget( this, this._.nextId++, element, widgetDef, startupData ); + + // Widget could be destroyed when initializing it. + if ( widget.isInited() ) { + this.instances[ widget.id ] = widget; + + return widget; + } else { + return null; + } + } + + // Widget already has been initialized, so try to get widget by element. + // Note - it may happen that other instance will returned than the one created above, + // if for example widget was destroyed and reinitialized. + return this.getByElement( element ); + } + + // No wrapper means that there's no widget for this element. + return null; + }, + + /** + * Initializes widgets on all elements which were wrapped by {@link #wrapElement} and + * have not been initialized yet. + * + * @param {CKEDITOR.dom.element} [container=editor.editable()] The container which will be checked for not + * initialized widgets. Defaults to editor's {@link CKEDITOR.editor#editable editable} element. + * @returns {CKEDITOR.plugins.widget[]} Array of widget instances which have been initialized. + * Note: Only first-level widgets are returned — without nested widgets. + */ + initOnAll: function( container ) { + var newWidgets = ( container || this.editor.editable() ).find( '.cke_widget_new' ), + newInstances = [], + instance; + + for ( var i = newWidgets.count(); i--; ) { + instance = this.initOn( newWidgets.getItem( i ).getFirst( Widget.isDomWidgetElement ) ); + if ( instance ) + newInstances.push( instance ); + } + + return newInstances; + }, + + /** + * Allows to listen to events on specific types of widgets, even if they are not created yet. + * + * Please note that this method inherits parameters from the {@link CKEDITOR.event#method-on} method with one + * extra parameter at the beginning which is the widget name. + * + * editor.widgets.onWidget( 'image', 'action', function( evt ) { + * // Event `action` occurs on `image` widget. + * } ); + * + * @since 4.5 + * @param {String} widgetName + * @param {String} eventName + * @param {Function} listenerFunction + * @param {Object} [scopeObj] + * @param {Object} [listenerData] + * @param {Number} [priority=10] + */ + onWidget: function( widgetName ) { + var args = Array.prototype.slice.call( arguments ); + + args.shift(); + + for ( var i in this.instances ) { + var instance = this.instances[ i ]; + + if ( instance.name == widgetName ) { + instance.on.apply( instance, args ); + } + } + + this.on( 'instanceCreated', function( evt ) { + var widget = evt.data; + + if ( widget.name == widgetName ) { + widget.on.apply( widget, args ); + } + } ); + }, + + /** + * Parses element classes string and returns an object + * whose keys contain class names. Skips all `cke_*` classes. + * + * This method is used by the {@link CKEDITOR.plugins.widget#getClasses} method and + * may be used when overriding that method. + * + * @since 4.4 + * @param {String} classes String (value of `class` attribute). + * @returns {Object} Object containing classes or `null` if no classes found. + */ + parseElementClasses: function( classes ) { + if ( !classes ) + return null; + + classes = CKEDITOR.tools.trim( classes ).split( /\s+/ ); + + var cl, + obj = {}, + hasClasses = 0; + + while ( ( cl = classes.pop() ) ) { + if ( cl.indexOf( 'cke_' ) == -1 ) + obj[ cl ] = hasClasses = 1; + } + + return hasClasses ? obj : null; + }, + + /** + * Wraps an element with a widget's non-editable container. + * + * If this method is called on an {@link CKEDITOR.htmlParser.element}, then it will + * also take care of fixing the DOM after wrapping (the wrapper may not be allowed in element's parent). + * + * @param {CKEDITOR.dom.element/CKEDITOR.htmlParser.element} element The widget element to be wrapped. + * @param {String} [widgetName] The name of the widget definition. Defaults to element's `data-widget` + * attribute value. + * @returns {CKEDITOR.dom.element/CKEDITOR.htmlParser.element} The wrapper element or `null` if + * the widget definition of this name is not registered. + */ + wrapElement: function( element, widgetName ) { + var wrapper = null, + widgetDef, + isInline; + + if ( element instanceof CKEDITOR.dom.element ) { + widgetName = widgetName || element.data( 'widget' ); + widgetDef = this.registered[ widgetName ]; + + if ( !widgetDef ) + return null; + + // Do not wrap already wrapped element. + wrapper = element.getParent(); + if ( wrapper && wrapper.type == CKEDITOR.NODE_ELEMENT && wrapper.data( 'cke-widget-wrapper' ) ) + return wrapper; + + // If attribute isn't already set (e.g. for pasted widget), set it. + if ( !element.hasAttribute( 'data-cke-widget-keep-attr' ) ) + element.data( 'cke-widget-keep-attr', element.data( 'widget' ) ? 1 : 0 ); + + element.data( 'widget', widgetName ); + + isInline = isWidgetInline( widgetDef, element.getName() ); + + wrapper = new CKEDITOR.dom.element( isInline ? 'span' : 'div' ); + wrapper.setAttributes( getWrapperAttributes( isInline, widgetName ) ); + + wrapper.data( 'cke-display-name', widgetDef.pathName ? widgetDef.pathName : element.getName() ); + + // Replace element unless it is a detached one. + if ( element.getParent( true ) ) + wrapper.replace( element ); + element.appendTo( wrapper ); + } + else if ( element instanceof CKEDITOR.htmlParser.element ) { + widgetName = widgetName || element.attributes[ 'data-widget' ]; + widgetDef = this.registered[ widgetName ]; + + if ( !widgetDef ) + return null; + + wrapper = element.parent; + if ( wrapper && wrapper.type == CKEDITOR.NODE_ELEMENT && wrapper.attributes[ 'data-cke-widget-wrapper' ] ) + return wrapper; + + // If attribute isn't already set (e.g. for pasted widget), set it. + if ( !( 'data-cke-widget-keep-attr' in element.attributes ) ) + element.attributes[ 'data-cke-widget-keep-attr' ] = element.attributes[ 'data-widget' ] ? 1 : 0; + if ( widgetName ) + element.attributes[ 'data-widget' ] = widgetName; + + isInline = isWidgetInline( widgetDef, element.name ); + + wrapper = new CKEDITOR.htmlParser.element( isInline ? 'span' : 'div', getWrapperAttributes( isInline, widgetName ) ); + wrapper.attributes[ 'data-cke-display-name' ] = widgetDef.pathName ? widgetDef.pathName : element.name; + + var parent = element.parent, + index; + + // Don't detach already detached element. + if ( parent ) { + index = element.getIndex(); + element.remove(); + } + + wrapper.add( element ); + + // Insert wrapper fixing DOM (splitting parents if wrapper is not allowed inside them). + parent && insertElement( parent, index, wrapper ); + } + + return wrapper; + }, + + // Expose for tests. + _tests_createEditableFilter: createEditableFilter + }; + + CKEDITOR.event.implementOn( Repository.prototype ); + + /** + * An event fired when a widget instance is created, but before it is fully initialized. + * + * @event instanceCreated + * @param {CKEDITOR.plugins.widget} data The widget instance. + */ + + /** + * An event fired when a widget instance was destroyed. + * + * See also {@link CKEDITOR.plugins.widget#event-destroy}. + * + * @event instanceDestroyed + * @param {CKEDITOR.plugins.widget} data The widget instance. + */ + + /** + * An event fired to trigger the selection check. + * + * See the {@link #method-checkSelection} method. + * + * @event checkSelection + */ + + /** + * An event fired by the the {@link #method-checkWidgets} method. + * + * It can be canceled in order to stop the {@link #method-checkWidgets} + * method execution or the event listener can modify the method's options. + * + * @event checkWidgets + * @param [data] + * @param {Boolean} [data.initOnlyNew] Initialize widgets only on newly wrapped + * widget elements (those which still have the `cke_widget_new` class). When this option is + * set to `true`, widgets which were invalidated (e.g. by replacing with a cloned DOM structure) + * will not be reinitialized. This makes the check faster. + * @param {Boolean} [data.focusInited] If only one widget is initialized by + * the method, it will be focused. + */ + + + /** + * An instance of a widget. Together with {@link CKEDITOR.plugins.widget.repository} these + * two classes constitute the core of the Widget System. + * + * Note that neither the repository nor the widget instances can be created by using their constructors. + * A repository instance is automatically set up by the Widget plugin and is accessible under + * {@link CKEDITOR.editor#widgets}, while widget instances are created and destroyed by the repository. + * + * To create a widget, first you need to {@link CKEDITOR.plugins.widget.repository#add register} its + * {@link CKEDITOR.plugins.widget.definition definition}: + * + * editor.widgets.add( 'simplebox', { + * upcast: function( element ) { + * // Defines which elements will become widgets. + * if ( element.hasClass( 'simplebox' ) ) + * return true; + * }, + * init: function() { + * // ... + * } + * } ); + * + * Once the widget definition is registered, widgets will be automatically + * created when loading data: + * + * editor.setData( '
    foo
    ', function() { + * console.log( editor.widgets.instances ); // -> An object containing one instance. + * } ); + * + * It is also possible to create instances during runtime by using a command + * (if a {@link CKEDITOR.plugins.widget.definition#template} property was defined): + * + * // You can execute an automatically defined command to + * // insert a new simplebox widget or edit the one currently focused. + * editor.execCommand( 'simplebox' ); + * + * Note: Since CKEditor 4.5 widget's `startupData` can be passed as the command argument: + * + * editor.execCommand( 'simplebox', { + * startupData: { + * align: 'left' + * } + * } ); + * + * A widget can also be created in a completely custom way: + * + * var element = editor.document.createElement( 'div' ); + * editor.insertElement( element ); + * var widget = editor.widgets.initOn( element, 'simplebox' ); + * + * @since 4.3 + * @class CKEDITOR.plugins.widget + * @mixins CKEDITOR.event + * @extends CKEDITOR.plugins.widget.definition + * @constructor Creates an instance of the widget class. Do not use it directly, but instead initialize widgets + * by using the {@link CKEDITOR.plugins.widget.repository#initOn} method or by the upcasting system. + * @param {CKEDITOR.plugins.widget.repository} widgetsRepo + * @param {Number} id Unique ID of this widget instance. + * @param {CKEDITOR.dom.element} element The widget element. + * @param {CKEDITOR.plugins.widget.definition} widgetDef Widget's registered definition. + * @param [startupData] Initial widget data. This data object will overwrite the default data and + * the data loaded from the DOM. + */ + function Widget( widgetsRepo, id, element, widgetDef, startupData ) { + var editor = widgetsRepo.editor; + + // Extend this widget with widgetDef-specific methods and properties. + CKEDITOR.tools.extend( this, widgetDef, { + /** + * The editor instance. + * + * @readonly + * @property {CKEDITOR.editor} + */ + editor: editor, + + /** + * This widget's unique (per editor instance) ID. + * + * @readonly + * @property {Number} + */ + id: id, + + /** + * Whether this widget is an inline widget (based on an inline element unless + * forced otherwise by {@link CKEDITOR.plugins.widget.definition#inline}). + * + * **Note:** This option does not allow to turn a block element into an inline widget. + * However, it makes it possible to turn an inline element into a block widget or to + * force a correct type in case when automatic recognition fails. + * + * @readonly + * @property {Boolean} + */ + inline: element.getParent().getName() == 'span', + + /** + * The widget element — the element on which the widget was initialized. + * + * @readonly + * @property {CKEDITOR.dom.element} element + */ + element: element, + + /** + * Widget's data object. + * + * The data can only be set by using the {@link #setData} method. + * Changes made to the data fire the {@link #event-data} event. + * + * @readonly + */ + data: CKEDITOR.tools.extend( {}, typeof widgetDef.defaults == 'function' ? widgetDef.defaults() : widgetDef.defaults ), + + /** + * Indicates if a widget is data-ready. Set to `true` when data from all sources + * ({@link CKEDITOR.plugins.widget.definition#defaults}, set in the + * {@link #init} method, loaded from the widget's element and startup data coming from the constructor) + * are finally loaded. This is immediately followed by the first {@link #event-data}. + * + * @readonly + */ + dataReady: false, + + /** + * Whether a widget instance was initialized. This means that: + * + * * An instance was created, + * * Its properties were set, + * * The `init` method was executed. + * + * **Note**: The first {@link #event-data} event could not be fired yet which + * means that the widget's DOM has not been set up yet. Wait for the {@link #event-ready} + * event to be notified when a widget is fully initialized and ready. + * + * **Note**: Use the {@link #isInited} method to check whether a widget is initialized and + * has not been destroyed. + * + * @readonly + */ + inited: false, + + /** + * Whether a widget instance is ready. This means that the widget is {@link #inited} and + * that its DOM was finally set up. + * + * **Note:** Use the {@link #isReady} method to check whether a widget is ready and + * has not been destroyed. + * + * @readonly + */ + ready: false, + + // Revert what widgetDef could override (automatic #edit listener). + edit: Widget.prototype.edit, + + /** + * The nested editable element which is currently focused. + * + * @readonly + * @property {CKEDITOR.plugins.widget.nestedEditable} + */ + focusedEditable: null, + + /** + * The widget definition from which this instance was created. + * + * @readonly + * @property {CKEDITOR.plugins.widget.definition} definition + */ + definition: widgetDef, + + /** + * Link to the widget repository which created this instance. + * + * @readonly + * @property {CKEDITOR.plugins.widget.repository} repository + */ + repository: widgetsRepo, + + draggable: widgetDef.draggable !== false, + + // WAAARNING: Overwrite widgetDef's priv object, because otherwise violent unicorn's gonna visit you. + _: { + downcastFn: ( widgetDef.downcast && typeof widgetDef.downcast == 'string' ) ? + widgetDef.downcasts[ widgetDef.downcast ] : widgetDef.downcast + } + }, true ); + + /** + * An object of widget component elements. + * + * For every `partName => selector` pair in {@link CKEDITOR.plugins.widget.definition#parts}, + * one `partName => element` pair is added to this object during the widget initialization. + * + * @readonly + * @property {Object} parts + */ + + /** + * The template which will be used to create a new widget element (when the widget's command is executed). + * It will be populated with {@link #defaults default values}. + * + * @readonly + * @property {CKEDITOR.template} template + */ + + /** + * The widget wrapper — a non-editable `div` or `span` element (depending on {@link #inline}) + * which is a parent of the {@link #element} and widget compontents like the drag handler and the {@link #mask}. + * It is the outermost widget element. + * + * @readonly + * @property {CKEDITOR.dom.element} wrapper + */ + + widgetsRepo.fire( 'instanceCreated', this ); + + setupWidget( this, widgetDef ); + + this.init && this.init(); + + // Finally mark widget as inited. + this.inited = true; + + setupWidgetData( this, startupData ); + + // If at some point (e.g. in #data listener) widget hasn't been destroyed + // and widget is already attached to document then fire #ready. + if ( this.isInited() && editor.editable().contains( this.wrapper ) ) { + this.ready = true; + this.fire( 'ready' ); + } + } + + Widget.prototype = { + /** + * Adds a class to the widget element. This method is used by + * the {@link #applyStyle} method and should be overridden by widgets + * which should handle classes differently (e.g. add them to other elements). + * + * Since 4.6.0 this method also adds a corresponding class prefixed with {@link #WRAPPER_CLASS_PREFIX} + * to the widget wrapper element. + * + * **Note**: This method should not be used directly. Use the {@link #setData} method to + * set the `classes` property. Read more in the {@link #setData} documentation. + * + * See also: {@link #removeClass}, {@link #hasClass}, {@link #getClasses}. + * + * @since 4.4 + * @param {String} className The class name to be added. + */ + addClass: function( className ) { + this.element.addClass( className ); + this.wrapper.addClass( Widget.WRAPPER_CLASS_PREFIX + className ); + }, + + /** + * Applies the specified style to the widget. It is highly recommended to use the + * {@link CKEDITOR.editor#applyStyle} or {@link CKEDITOR.style#apply} methods instead of + * using this method directly, because unlike editor's and style's methods, this one + * does not perform any checks. + * + * By default this method handles only classes defined in the style. It clones existing + * classes which are stored in the {@link #property-data widget data}'s `classes` property, + * adds new classes, and calls the {@link #setData} method if at least one new class was added. + * Then, using the {@link #event-data} event listener widget applies modifications passing + * new classes to the {@link #addClass} method. + * + * If you need to handle classes differently than in the default way, you can override the + * {@link #addClass} and related methods. You can also handle other style properties than `classes` + * by overriding this method. + * + * See also: {@link #checkStyleActive}, {@link #removeStyle}. + * + * @since 4.4 + * @param {CKEDITOR.style} style The custom widget style to be applied. + */ + applyStyle: function( style ) { + applyRemoveStyle( this, style, 1 ); + }, + + /** + * Checks if the specified style is applied to this widget. It is highly recommended to use the + * {@link CKEDITOR.style#checkActive} method instead of using this method directly, + * because unlike style's method, this one does not perform any checks. + * + * By default this method handles only classes defined in the style and passes + * them to the {@link #hasClass} method. You can override these methods to handle classes + * differently or to handle more of the style properties. + * + * See also: {@link #applyStyle}, {@link #removeStyle}. + * + * @since 4.4 + * @param {CKEDITOR.style} style The custom widget style to be checked. + * @returns {Boolean} Whether the style is applied to this widget. + */ + checkStyleActive: function( style ) { + var classes = getStyleClasses( style ), + cl; + + if ( !classes ) + return false; + + while ( ( cl = classes.pop() ) ) { + if ( !this.hasClass( cl ) ) + return false; + } + return true; + }, + + /** + * Destroys this widget instance. + * + * Use {@link CKEDITOR.plugins.widget.repository#destroy} when possible instead of this method. + * + * This method fires the {#event-destroy} event. + * + * @param {Boolean} [offline] Whether a widget is offline (detached from the DOM tree) — + * in this case the DOM (attributes, classes, etc.) will not be cleaned up. + */ + destroy: function( offline ) { + this.fire( 'destroy' ); + + if ( this.editables ) { + for ( var name in this.editables ) + this.destroyEditable( name, offline ); + } + + if ( !offline ) { + if ( this.element.data( 'cke-widget-keep-attr' ) == '0' ) + this.element.removeAttribute( 'data-widget' ); + this.element.removeAttributes( [ 'data-cke-widget-data', 'data-cke-widget-keep-attr' ] ); + this.element.removeClass( 'cke_widget_element' ); + this.element.replace( this.wrapper ); + } + + this.wrapper = null; + }, + + /** + * Destroys a nested editable and all nested widgets. + * + * @param {String} editableName Nested editable name. + * @param {Boolean} [offline] See {@link #method-destroy} method. + */ + destroyEditable: function( editableName, offline ) { + var editable = this.editables[ editableName ]; + + editable.removeListener( 'focus', onEditableFocus ); + editable.removeListener( 'blur', onEditableBlur ); + this.editor.focusManager.remove( editable ); + + if ( !offline ) { + this.repository.destroyAll( false, editable ); + editable.removeClass( 'cke_widget_editable' ); + editable.removeClass( 'cke_widget_editable_focused' ); + editable.removeAttributes( [ 'contenteditable', 'data-cke-widget-editable', 'data-cke-enter-mode' ] ); + } + + delete this.editables[ editableName ]; + }, + + /** + * Starts widget editing. + * + * This method fires the {@link CKEDITOR.plugins.widget#event-edit} event + * which may be canceled in order to prevent it from opening a dialog window. + * + * The dialog window name is obtained from the event's data `dialog` property or + * from {@link CKEDITOR.plugins.widget.definition#dialog}. + * + * @returns {Boolean} Returns `true` if a dialog window was opened. + */ + edit: function() { + var evtData = { dialog: this.dialog }, + that = this; + + // Edit event was blocked or there's no dialog to be automatically opened. + if ( this.fire( 'edit', evtData ) === false || !evtData.dialog ) + return false; + + this.editor.openDialog( evtData.dialog, function( dialog ) { + var showListener, + okListener; + + // Allow to add a custom dialog handler. + if ( that.fire( 'dialog', dialog ) === false ) + return; + + showListener = dialog.on( 'show', function() { + dialog.setupContent( that ); + } ); + + okListener = dialog.on( 'ok', function() { + // Commit dialog's fields, but prevent from + // firing data event for every field. Fire only one, + // bulk event at the end. + var dataChanged, + dataListener = that.on( 'data', function( evt ) { + dataChanged = 1; + evt.cancel(); + }, null, null, 0 ); + + // Create snapshot preceeding snapshot with changed widget... + // TODO it should not be required, but it is and I found similar + // code in dialog#ok listener in dialog/plugin.js. + that.editor.fire( 'saveSnapshot' ); + dialog.commitContent( that ); + + dataListener.removeListener(); + if ( dataChanged ) { + that.fire( 'data', that.data ); + that.editor.fire( 'saveSnapshot' ); + } + } ); + + dialog.once( 'hide', function() { + showListener.removeListener(); + okListener.removeListener(); + } ); + } ); + + return true; + }, + + /** + * Returns widget element classes parsed to an object. This method + * is used to populate the `classes` property of widget's {@link #property-data}. + * + * This method reuses {@link CKEDITOR.plugins.widget.repository#parseElementClasses}. + * It should be overriden if a widget should handle classes differently (e.g. on other elements). + * + * See also: {@link #removeClass}, {@link #addClass}, {@link #hasClass}. + * + * @since 4.4 + * @returns {Object} + */ + getClasses: function() { + return this.repository.parseElementClasses( this.element.getAttribute( 'class' ) ); + }, + + /** + * Checks if the widget element has specified class. This method is used by + * the {@link #checkStyleActive} method and should be overriden by widgets + * which should handle classes differently (e.g. on other elements). + * + * See also: {@link #removeClass}, {@link #addClass}, {@link #getClasses}. + * + * @since 4.4 + * @param {String} className The class to be checked. + * @param {Boolean} Whether a widget has specified class. + */ + hasClass: function( className ) { + return this.element.hasClass( className ); + }, + + /** + * Initializes a nested editable. + * + * **Note**: Only elements from {@link CKEDITOR.dtd#$editable} may become editables. + * + * @param {String} editableName The nested editable name. + * @param {CKEDITOR.plugins.widget.nestedEditable.definition} definition The definition of the nested editable. + * @returns {Boolean} Whether an editable was successfully initialized. + */ + initEditable: function( editableName, definition ) { + // Don't fetch just first element which matched selector but look for a correct one. (http://dev.ckeditor.com/ticket/13334) + var editable = this._findOneNotNested( definition.selector ); + + if ( editable && editable.is( CKEDITOR.dtd.$editable ) ) { + editable = new NestedEditable( this.editor, editable, { + filter: createEditableFilter.call( this.repository, this.name, editableName, definition ) + } ); + this.editables[ editableName ] = editable; + + editable.setAttributes( { + contenteditable: 'true', + 'data-cke-widget-editable': editableName, + 'data-cke-enter-mode': editable.enterMode + } ); + + if ( editable.filter ) + editable.data( 'cke-filter', editable.filter.id ); + + editable.addClass( 'cke_widget_editable' ); + // This class may be left when d&ding widget which + // had focused editable. Clean this class here, not in + // cleanUpWidgetElement for performance and code size reasons. + editable.removeClass( 'cke_widget_editable_focused' ); + + if ( definition.pathName ) + editable.data( 'cke-display-name', definition.pathName ); + + this.editor.focusManager.add( editable ); + editable.on( 'focus', onEditableFocus, this ); + CKEDITOR.env.ie && editable.on( 'blur', onEditableBlur, this ); + + // Finally, process editable's data. This data wasn't processed when loading + // editor's data, becuase they need to be processed separately, with its own filters and settings. + editable._.initialSetData = true; + editable.setData( editable.getHtml() ); + + return true; + } + + return false; + }, + + /** + * Looks inside wrapper element to find a node that + * matches given selector and is not nested in other widget. (http://dev.ckeditor.com/ticket/13334) + * + * @since 4.5 + * @private + * @param {String} selector Selector to match. + * @returns {CKEDITOR.dom.element} Matched element or `null` if a node has not been found. + */ + _findOneNotNested: function( selector ) { + var matchedElements = this.wrapper.find( selector ), + match, + closestWrapper; + + for ( var i = 0; i < matchedElements.count(); i++ ) { + match = matchedElements.getItem( i ); + closestWrapper = match.getAscendant( Widget.isDomWidgetWrapper ); + + // The closest ascendant-wrapper of this match defines to which widget + // this match belongs. If the ascendant is this widget's wrapper + // it means that the match is not nested in other widget. + if ( this.wrapper.equals( closestWrapper ) ) { + return match; + } + } + + return null; + }, + + /** + * Checks if a widget has already been initialized and has not been destroyed yet. + * + * See {@link #inited} for more details. + * + * @returns {Boolean} + */ + isInited: function() { + return !!( this.wrapper && this.inited ); + }, + + /** + * Checks if a widget is ready and has not been destroyed yet. + * + * See {@link #property-ready} for more details. + * + * @returns {Boolean} + */ + isReady: function() { + return this.isInited() && this.ready; + }, + + /** + * Focuses a widget by selecting it. + */ + focus: function() { + var sel = this.editor.getSelection(); + + // Fake the selection before focusing editor, to avoid unpreventable viewports scrolling + // on Webkit/Blink/IE which is done because there's no selection or selection was somewhere else than widget. + if ( sel ) { + var isDirty = this.editor.checkDirty(); + + sel.fake( this.wrapper ); + + !isDirty && this.editor.resetDirty(); + } + + // Always focus editor (not only when focusManger.hasFocus is false) (because of http://dev.ckeditor.com/ticket/10483). + this.editor.focus(); + }, + + /** + * Removes a class from the widget element. This method is used by + * the {@link #removeStyle} method and should be overriden by widgets + * which should handle classes differently (e.g. on other elements). + * + * **Note**: This method should not be used directly. Use the {@link #setData} method to + * set the `classes` property. Read more in the {@link #setData} documentation. + * + * See also: {@link #hasClass}, {@link #addClass}. + * + * @since 4.4 + * @param {String} className The class to be removed. + */ + removeClass: function( className ) { + this.element.removeClass( className ); + this.wrapper.removeClass( Widget.WRAPPER_CLASS_PREFIX + className ); + }, + + /** + * Removes the specified style from the widget. It is highly recommended to use the + * {@link CKEDITOR.editor#removeStyle} or {@link CKEDITOR.style#remove} methods instead of + * using this method directly, because unlike editor's and style's methods, this one + * does not perform any checks. + * + * Read more about how applying/removing styles works in the {@link #applyStyle} method documentation. + * + * See also {@link #checkStyleActive}, {@link #applyStyle}, {@link #getClasses}. + * + * @since 4.4 + * @param {CKEDITOR.style} style The custom widget style to be removed. + */ + removeStyle: function( style ) { + applyRemoveStyle( this, style, 0 ); + }, + + /** + * Sets widget value(s) in the {@link #property-data} object. + * If the given value(s) modifies current ones, the {@link #event-data} event is fired. + * + * this.setData( 'align', 'left' ); + * this.data.align; // -> 'left' + * + * this.setData( { align: 'right', opened: false } ); + * this.data.align; // -> 'right' + * this.data.opened; // -> false + * + * Set values are stored in {@link #element}'s attribute (`data-cke-widget-data`), + * in a JSON string, therefore {@link #property-data} should contain + * only serializable data. + * + * **Note:** A special data property, `classes`, exists. It contains an object with + * classes which were returned by the {@link #getClasses} method during the widget initialization. + * This property is then used by the {@link #applyStyle} and {@link #removeStyle} methods. + * When it is changed (the reference to object must be changed!), the widget updates its classes by + * using the {@link #addClass} and {@link #removeClass} methods. + * + * // Adding a new class. + * var classes = CKEDITOR.tools.clone( widget.data.classes ); + * classes.newClass = 1; + * widget.setData( 'classes', classes ); + * + * // Removing a class. + * var classes = CKEDITOR.tools.clone( widget.data.classes ); + * delete classes.newClass; + * widget.setData( 'classes', classes ); + * + * @param {String/Object} keyOrData + * @param {Object} value + * @chainable + */ + setData: function( key, value ) { + var data = this.data, + modified = 0; + + if ( typeof key == 'string' ) { + if ( data[ key ] !== value ) { + data[ key ] = value; + modified = 1; + } + } + else { + var newData = key; + + for ( key in newData ) { + if ( data[ key ] !== newData[ key ] ) { + modified = 1; + data[ key ] = newData[ key ]; + } + } + } + + // Block firing data event and overwriting data element before setupWidgetData is executed. + if ( modified && this.dataReady ) { + writeDataToElement( this ); + this.fire( 'data', data ); + } + + return this; + }, + + /** + * Changes the widget's focus state. This method is executed automatically after + * a widget was focused by the {@link #method-focus} method or the selection was moved + * out of the widget. + * + * This is a low-level method which is not integrated with e.g. the undo manager. + * Use the {@link #method-focus} method instead. + * + * @param {Boolean} selected Whether to select or deselect this widget. + * @chainable + */ + setFocused: function( focused ) { + this.wrapper[ focused ? 'addClass' : 'removeClass' ]( 'cke_widget_focused' ); + this.fire( focused ? 'focus' : 'blur' ); + return this; + }, + + /** + * Changes the widget's select state. This method is executed automatically after + * a widget was selected by the {@link #method-focus} method or the selection + * was moved out of the widget. + * + * This is a low-level method which is not integrated with e.g. the undo manager. + * Use the {@link #method-focus} method instead or simply change the selection. + * + * @param {Boolean} selected Whether to select or deselect this widget. + * @chainable + */ + setSelected: function( selected ) { + this.wrapper[ selected ? 'addClass' : 'removeClass' ]( 'cke_widget_selected' ); + this.fire( selected ? 'select' : 'deselect' ); + return this; + }, + + /** + * Repositions drag handler according to the widget's element position. Should be called from events, like mouseover. + */ + updateDragHandlerPosition: function() { + var editor = this.editor, + domElement = this.element.$, + oldPos = this._.dragHandlerOffset, + newPos = { + x: domElement.offsetLeft, + y: domElement.offsetTop - DRAG_HANDLER_SIZE + }; + + if ( oldPos && newPos.x == oldPos.x && newPos.y == oldPos.y ) + return; + + // We need to make sure that dirty state is not changed (http://dev.ckeditor.com/ticket/11487). + var initialDirty = editor.checkDirty(); + + editor.fire( 'lockSnapshot' ); + this.dragHandlerContainer.setStyles( { + top: newPos.y + 'px', + left: newPos.x + 'px', + display: 'block' + } ); + editor.fire( 'unlockSnapshot' ); + !initialDirty && editor.resetDirty(); + + this._.dragHandlerOffset = newPos; + } + }; + + CKEDITOR.event.implementOn( Widget.prototype ); + + /** + * Gets the {@link #isDomNestedEditable nested editable} + * (returned as a {@link CKEDITOR.dom.element}, not as a {@link CKEDITOR.plugins.widget.nestedEditable}) + * closest to the `node` or the `node` if it is a nested editable itself. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.element} guard Stop ancestor search on this node (usually editor's editable). + * @param {CKEDITOR.dom.node} node Start the search from this node. + * @returns {CKEDITOR.dom.element/null} Element or `null` if not found. + */ + Widget.getNestedEditable = function( guard, node ) { + if ( !node || node.equals( guard ) ) + return null; + + if ( Widget.isDomNestedEditable( node ) ) + return node; + + return Widget.getNestedEditable( guard, node.getParent() ); + }; + + /** + * Checks whether the `node` is a widget's drag handle element. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.node} node + * @returns {Boolean} + */ + Widget.isDomDragHandler = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-drag-handler' ); + }; + + /** + * Checks whether the `node` is a container of the widget's drag handle element. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.node} node + * @returns {Boolean} + */ + Widget.isDomDragHandlerContainer = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && node.hasClass( 'cke_widget_drag_handler_container' ); + }; + + /** + * Checks whether the `node` is a {@link CKEDITOR.plugins.widget#editables nested editable}. + * Note that this function only checks whether it is the right element, not whether + * the passed `node` is an instance of {@link CKEDITOR.plugins.widget.nestedEditable}. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.node} node + * @returns {Boolean} + */ + Widget.isDomNestedEditable = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-editable' ); + }; + + /** + * Checks whether the `node` is a {@link CKEDITOR.plugins.widget#element widget element}. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.node} node + * @returns {Boolean} + */ + Widget.isDomWidgetElement = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-widget' ); + }; + + /** + * Checks whether the `node` is a {@link CKEDITOR.plugins.widget#wrapper widget wrapper}. + * + * @since 4.5 + * @static + * @param {CKEDITOR.dom.element} node + * @returns {Boolean} + */ + Widget.isDomWidgetWrapper = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-wrapper' ); + }; + + /** + * Checks whether the `node` is a {@link CKEDITOR.plugins.widget#element widget element}. + * + * @since 4.5 + * @static + * @param {CKEDITOR.htmlParser.node} node + * @returns {Boolean} + */ + Widget.isParserWidgetElement = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && !!node.attributes[ 'data-widget' ]; + }; + + /** + * Checks whether the `node` is a {@link CKEDITOR.plugins.widget#wrapper widget wrapper}. + * + * @since 4.5 + * @static + * @param {CKEDITOR.htmlParser.element} node + * @returns {Boolean} + */ + Widget.isParserWidgetWrapper = function( node ) { + return node.type == CKEDITOR.NODE_ELEMENT && !!node.attributes[ 'data-cke-widget-wrapper' ]; + }; + + /** + * Prefix added to wrapper classes. Each class added to the widget element by the {@link #addClass} + * method will also be added to the wrapper prefixed with it. + * + * @since 4.6.0 + * @static + * @readonly + * @property {String} [='cke_widget_wrapper_'] + */ + Widget.WRAPPER_CLASS_PREFIX = 'cke_widget_wrapper_'; + + /** + * An event fired when a widget is ready (fully initialized). This event is fired after: + * + * * {@link #init} is called, + * * The first {@link #event-data} event is fired, + * * A widget is attached to the document. + * + * Therefore, in case of widget creation with a command which opens a dialog window, this event + * will be delayed after the dialog window is closed and the widget is finally inserted into the document. + * + * **Note**: If your widget does not use automatic dialog window binding (i.e. you open the dialog window manually) + * or another situation in which the widget wrapper is not attached to document at the time when it is + * initialized occurs, you need to take care of firing {@link #event-ready} yourself. + * + * See also {@link #property-ready} and {@link #property-inited} properties, and + * {@link #isReady} and {@link #isInited} methods. + * + * @event ready + */ + + /** + * An event fired when a widget is about to be destroyed, but before it is + * fully torn down. + * + * @event destroy + */ + + /** + * An event fired when a widget is focused. + * + * Widget can be focused by executing {@link #method-focus}. + * + * @event focus + */ + + /** + * An event fired when a widget is blurred. + * + * @event blur + */ + + /** + * An event fired when a widget is selected. + * + * @event select + */ + + /** + * An event fired when a widget is deselected. + * + * @event deselect + */ + + /** + * An event fired by the {@link #method-edit} method. It can be canceled + * in order to stop the default action (opening a dialog window and/or + * {@link CKEDITOR.plugins.widget.repository#finalizeCreation finalizing widget creation}). + * + * @event edit + * @param data + * @param {String} data.dialog Defaults to {@link CKEDITOR.plugins.widget.definition#dialog} + * and can be changed or set by the listener. + */ + + /** + * An event fired when a dialog window for widget editing is opened. + * This event can be canceled in order to handle the editing dialog in a custom manner. + * + * @event dialog + * @param {CKEDITOR.dialog} data The opened dialog window instance. + */ + + /** + * An event fired when a key is pressed on a focused widget. + * This event is forwarded from the {@link CKEDITOR.editor#key} event and + * has the ability to block editor keystrokes if it is canceled. + * + * @event key + * @param data + * @param {Number} data.keyCode A number representing the key code (or combination). + */ + + /** + * An event fired when a widget is double clicked. + * + * **Note:** If a default editing action is executed on double click (i.e. a widget has a + * {@link CKEDITOR.plugins.widget.definition#dialog dialog} defined and the {@link #event-doubleclick} event was not + * canceled), this event will be automatically canceled, so a listener added with the default priority (10) + * will not be executed. Use a listener with low priority (e.g. 5) to be sure that it will be executed. + * + * widget.on( 'doubleclick', function( evt ) { + * console.log( 'widget#doubleclick' ); + * }, null, null, 5 ); + * + * If your widget handles double click in a special way (so the default editing action is not executed), + * make sure you cancel this event, because otherwise it will be propagated to {@link CKEDITOR.editor#doubleclick} + * and another feature may step in (e.g. a Link dialog window may be opened if your widget was inside a link). + * + * @event doubleclick + * @param data + * @param {CKEDITOR.dom.element} data.element The double-clicked element. + */ + + /** + * An event fired when the context menu is opened for a widget. + * + * @event contextMenu + * @param data The object containing context menu options to be added + * for this widget. See {@link CKEDITOR.plugins.contextMenu#addListener}. + */ + + /** + * An event fired when the widget data changed. See the {@link #setData} method and the {@link #property-data} property. + * + * @event data + */ + + + + /** + * The wrapper class for editable elements inside widgets. + * + * Do not use directly. Use {@link CKEDITOR.plugins.widget.definition#editables} or + * {@link CKEDITOR.plugins.widget#initEditable}. + * + * @class CKEDITOR.plugins.widget.nestedEditable + * @extends CKEDITOR.dom.element + * @constructor + * @param {CKEDITOR.editor} editor + * @param {CKEDITOR.dom.element} element + * @param config + * @param {CKEDITOR.filter} [config.filter] + */ + function NestedEditable( editor, element, config ) { + // Call the base constructor. + CKEDITOR.dom.element.call( this, element.$ ); + this.editor = editor; + this._ = {}; + var filter = this.filter = config.filter; + + // If blockless editable - always use BR mode. + if ( !CKEDITOR.dtd[ this.getName() ].p ) + this.enterMode = this.shiftEnterMode = CKEDITOR.ENTER_BR; + else { + this.enterMode = filter ? filter.getAllowedEnterMode( editor.enterMode ) : editor.enterMode; + this.shiftEnterMode = filter ? filter.getAllowedEnterMode( editor.shiftEnterMode, true ) : editor.shiftEnterMode; + } + } + + NestedEditable.prototype = CKEDITOR.tools.extend( CKEDITOR.tools.prototypedCopy( CKEDITOR.dom.element.prototype ), { + /** + * Sets the editable data. The data will be passed through the {@link CKEDITOR.editor#dataProcessor} + * and the {@link CKEDITOR.editor#filter}. This ensures that the data was filtered and prepared to be + * edited like the {@link CKEDITOR.editor#method-setData editor data}. + * + * Before content is changed, all nested widgets are destroyed. Afterwards, after new content is loaded, + * all nested widgets are initialized. + * + * @param {String} data + */ + setData: function( data ) { + // For performance reasons don't call destroyAll when initializing a nested editable, + // because there are no widgets inside. + if ( !this._.initialSetData ) { + // Destroy all nested widgets before setting data. + this.editor.widgets.destroyAll( false, this ); + } + this._.initialSetData = false; + + data = this.editor.dataProcessor.toHtml( data, { + context: this.getName(), + filter: this.filter, + enterMode: this.enterMode + } ); + this.setHtml( data ); + + this.editor.widgets.initOnAll( this ); + }, + + /** + * Gets the editable data. Like {@link #setData}, this method will process and filter the data. + * + * @returns {String} + */ + getData: function() { + return this.editor.dataProcessor.toDataFormat( this.getHtml(), { + context: this.getName(), + filter: this.filter, + enterMode: this.enterMode + } ); + } + } ); + + /** + * The editor instance. + * + * @readonly + * @property {CKEDITOR.editor} editor + */ + + /** + * The filter instance if allowed content rules were defined. + * + * @readonly + * @property {CKEDITOR.filter} filter + */ + + /** + * The enter mode active in this editable. + * It is determined from editable's name (whether it is a blockless editable), + * its allowed content rules (if defined) and the default editor's mode. + * + * @readonly + * @property {Number} enterMode + */ + + /** + * The shift enter move active in this editable. + * + * @readonly + * @property {Number} shiftEnterMode + */ + + + // + // REPOSITORY helpers ----------------------------------------------------- + // + + function addWidgetButtons( editor ) { + var widgets = editor.widgets.registered, + widget, + widgetName, + widgetButton; + + for ( widgetName in widgets ) { + widget = widgets[ widgetName ]; + + // Create button if defined. + widgetButton = widget.button; + if ( widgetButton && editor.ui.addButton ) { + editor.ui.addButton( CKEDITOR.tools.capitalize( widget.name, true ), { + label: widgetButton, + command: widget.name, + toolbar: 'insert,10' + } ); + } + } + } + + // Create a command creating and editing widget. + // + // @param editor + // @param {CKEDITOR.plugins.widget.definition} widgetDef + function addWidgetCommand( editor, widgetDef ) { + editor.addCommand( widgetDef.name, { + exec: function( editor, commandData ) { + var focused = editor.widgets.focused; + // If a widget of the same type is focused, start editing. + if ( focused && focused.name == widgetDef.name ) + focused.edit(); + // Otherwise... + // ... use insert method is was defined. + else if ( widgetDef.insert ) + widgetDef.insert(); + // ... or create a brand-new widget from template. + else if ( widgetDef.template ) { + var defaults = typeof widgetDef.defaults == 'function' ? widgetDef.defaults() : widgetDef.defaults, + element = CKEDITOR.dom.element.createFromHtml( widgetDef.template.output( defaults ) ), + instance, + wrapper = editor.widgets.wrapElement( element, widgetDef.name ), + temp = new CKEDITOR.dom.documentFragment( wrapper.getDocument() ); + + // Append wrapper to a temporary document. This will unify the environment + // in which #data listeners work when creating and editing widget. + temp.append( wrapper ); + instance = editor.widgets.initOn( element, widgetDef, commandData && commandData.startupData ); + + // Instance could be destroyed during initialization. + // In this case finalize creation if some new widget + // was left in temporary document fragment. + if ( !instance ) { + finalizeCreation(); + return; + } + + // Listen on edit to finalize widget insertion. + // + // * If dialog was set, then insert widget after dialog was successfully saved or destroy this + // temporary instance. + // * If dialog wasn't set and edit wasn't canceled, insert widget. + var editListener = instance.once( 'edit', function( evt ) { + if ( evt.data.dialog ) { + instance.once( 'dialog', function( evt ) { + var dialog = evt.data, + okListener, + cancelListener; + + // Finalize creation AFTER (20) new data was set. + okListener = dialog.once( 'ok', finalizeCreation, null, null, 20 ); + + cancelListener = dialog.once( 'cancel', function( evt ) { + if ( !( evt.data && evt.data.hide === false ) ) { + editor.widgets.destroy( instance, true ); + } + } ); + + dialog.once( 'hide', function() { + okListener.removeListener(); + cancelListener.removeListener(); + } ); + } ); + } else { + // Dialog hasn't been set, so insert widget now. + finalizeCreation(); + } + }, null, null, 999 ); + + instance.edit(); + + // Remove listener in case someone canceled it before this + // listener was executed. + editListener.removeListener(); + } + + function finalizeCreation() { + editor.widgets.finalizeCreation( temp ); + } + }, + + allowedContent: widgetDef.allowedContent, + requiredContent: widgetDef.requiredContent, + contentForms: widgetDef.contentForms, + contentTransformations: widgetDef.contentTransformations + } ); + } + + function addWidgetProcessors( widgetsRepo, widgetDef ) { + var upcast = widgetDef.upcast, + upcasts, + priority = widgetDef.upcastPriority || 10; + + if ( !upcast ) + return; + + // Multiple upcasts defined in string. + if ( typeof upcast == 'string' ) { + upcasts = upcast.split( ',' ); + while ( upcasts.length ) { + addUpcast( widgetDef.upcasts[ upcasts.pop() ], widgetDef.name, priority ); + } + } + // Single rule which is automatically activated. + else { + addUpcast( upcast, widgetDef.name, priority ); + } + + function addUpcast( upcast, name, priority ) { + // Find index of the first higher (in terms of value) priority upcast. + var index = CKEDITOR.tools.getIndex( widgetsRepo._.upcasts, function( element ) { + return element[ 2 ] > priority; + } ); + // Add at the end if it is the highest priority so far. + if ( index < 0 ) { + index = widgetsRepo._.upcasts.length; + } + + widgetsRepo._.upcasts.splice( index, 0, [ upcast, name, priority ] ); + } + } + + function blurWidget( widgetsRepo, widget ) { + widgetsRepo.focused = null; + + if ( widget.isInited() ) { + var isDirty = widget.editor.checkDirty(); + + // Widget could be destroyed in the meantime - e.g. data could be set. + widgetsRepo.fire( 'widgetBlurred', { widget: widget } ); + widget.setFocused( false ); + + !isDirty && widget.editor.resetDirty(); + } + } + + function checkWidgets( evt ) { + var options = evt.data; + + if ( this.editor.mode != 'wysiwyg' ) + return; + + var editable = this.editor.editable(), + instances = this.instances, + newInstances, i, count, wrapper, notYetInitialized; + + if ( !editable ) + return; + + // Remove widgets which have no corresponding elements in DOM. + for ( i in instances ) { + // http://dev.ckeditor.com/ticket/13410 Remove widgets that are ready. This prevents from destroying widgets that are during loading process. + if ( instances[ i ].isReady() && !editable.contains( instances[ i ].wrapper ) ) + this.destroy( instances[ i ], true ); + } + + // Init on all (new) if initOnlyNew option was passed. + if ( options && options.initOnlyNew ) + newInstances = this.initOnAll(); + else { + var wrappers = editable.find( '.cke_widget_wrapper' ); + newInstances = []; + + // Create widgets on existing wrappers if they do not exists. + for ( i = 0, count = wrappers.count(); i < count; i++ ) { + wrapper = wrappers.getItem( i ); + notYetInitialized = !this.getByElement( wrapper, true ); + + // Check if: + // * there's no instance for this widget + // * wrapper is not inside some temporary element like copybin (http://dev.ckeditor.com/ticket/11088) + // * it was a nested widget's wrapper which has been detached from DOM, + // when nested editable has been initialized (it overwrites its innerHTML + // and initializes nested widgets). + if ( notYetInitialized && !findParent( wrapper, isDomTemp ) && editable.contains( wrapper ) ) { + // Add cke_widget_new class because otherwise + // widget will not be created on such wrapper. + wrapper.addClass( 'cke_widget_new' ); + newInstances.push( this.initOn( wrapper.getFirst( Widget.isDomWidgetElement ) ) ); + } + } + } + + // If only single widget was initialized and focusInited was passed, focus it. + if ( options && options.focusInited && newInstances.length == 1 ) + newInstances[ 0 ].focus(); + } + + // Unwraps widget element and clean up element. + // + // This function is used to clean up pasted widgets. + // It should have similar result to widget#destroy plus + // some additional adjustments, specific for pasting. + // + // @param {CKEDITOR.htmlParser.element} el + function cleanUpWidgetElement( el ) { + var parent = el.parent; + if ( parent.type == CKEDITOR.NODE_ELEMENT && parent.attributes[ 'data-cke-widget-wrapper' ] ) + parent.replaceWith( el ); + } + + // Similar to cleanUpWidgetElement, but works on DOM and finds + // widget elements by its own. + // + // Unlike cleanUpWidgetElement it will wrap element back. + // + // @param {CKEDITOR.dom.element} container + function cleanUpAllWidgetElements( widgetsRepo, container ) { + var wrappers = container.find( '.cke_widget_wrapper' ), + wrapper, element, + i = 0, + l = wrappers.count(); + + for ( ; i < l; ++i ) { + wrapper = wrappers.getItem( i ); + element = wrapper.getFirst( Widget.isDomWidgetElement ); + // If wrapper contains widget element - unwrap it and wrap again. + if ( element.type == CKEDITOR.NODE_ELEMENT && element.data( 'widget' ) ) { + element.replace( wrapper ); + widgetsRepo.wrapElement( element ); + } else { + // Otherwise - something is wrong... clean this up. + wrapper.remove(); + } + } + } + + // Creates {@link CKEDITOR.filter} instance for given widget, editable and rules. + // + // Once filter for widget-editable pair is created it is cached, so the same instance + // will be returned when method is executed again. + // + // @param {String} widgetName + // @param {String} editableName + // @param {CKEDITOR.plugins.widget.nestedEditableDefinition} editableDefinition The nested editable definition. + // @returns {CKEDITOR.filter} Filter instance or `null` if rules are not defined. + // @context CKEDITOR.plugins.widget.repository + function createEditableFilter( widgetName, editableName, editableDefinition ) { + if ( !editableDefinition.allowedContent && !editableDefinition.disallowedContent ) + return null; + + var editables = this._.filters[ widgetName ]; + + if ( !editables ) + this._.filters[ widgetName ] = editables = {}; + + var filter = editables[ editableName ]; + + if ( !filter ) { + filter = editableDefinition.allowedContent ? new CKEDITOR.filter( editableDefinition.allowedContent ) : this.editor.filter.clone(); + + editables[ editableName ] = filter; + + if ( editableDefinition.disallowedContent ) { + filter.disallow( editableDefinition.disallowedContent ); + } + } + + return filter; + } + + // Creates an iterator function which when executed on all + // elements in DOM tree will gather elements that should be wrapped + // and initialized as widgets. + function createUpcastIterator( widgetsRepo ) { + var toBeWrapped = [], + upcasts = widgetsRepo._.upcasts, + upcastCallbacks = widgetsRepo._.upcastCallbacks; + + return { + toBeWrapped: toBeWrapped, + + iterator: function( element ) { + var upcast, upcasted, + data, + i, + upcastsLength, + upcastCallbacksLength; + + // Wrapper found - find widget element, add it to be + // cleaned up (unwrapped) and wrapped and stop iterating in this branch. + if ( 'data-cke-widget-wrapper' in element.attributes ) { + element = element.getFirst( Widget.isParserWidgetElement ); + + if ( element ) + toBeWrapped.push( [ element ] ); + + // Do not iterate over descendants. + return false; + } + // Widget element found - add it to be cleaned up (just in case) + // and wrapped and stop iterating in this branch. + else if ( 'data-widget' in element.attributes ) { + toBeWrapped.push( [ element ] ); + + // Do not iterate over descendants. + return false; + } + else if ( ( upcastsLength = upcasts.length ) ) { + // Ignore elements with data-cke-widget-upcasted to avoid multiple upcasts (http://dev.ckeditor.com/ticket/11533). + // Do not iterate over descendants. + if ( element.attributes[ 'data-cke-widget-upcasted' ] ) + return false; + + // Check element with upcast callbacks first. + // If any of them return false abort upcasting. + for ( i = 0, upcastCallbacksLength = upcastCallbacks.length; i < upcastCallbacksLength; ++i ) { + if ( upcastCallbacks[ i ]( element ) === false ) + return; + // Return nothing in order to continue iterating over ascendants. + // See http://dev.ckeditor.com/ticket/11186#comment:6 + } + + for ( i = 0; i < upcastsLength; ++i ) { + upcast = upcasts[ i ]; + data = {}; + + if ( ( upcasted = upcast[ 0 ]( element, data ) ) ) { + // If upcast function returned element, upcast this one. + // It can be e.g. a new element wrapping the original one. + if ( upcasted instanceof CKEDITOR.htmlParser.element ) + element = upcasted; + + // Set initial data attr with data from upcast method. + element.attributes[ 'data-cke-widget-data' ] = encodeURIComponent( JSON.stringify( data ) ); + element.attributes[ 'data-cke-widget-upcasted' ] = 1; + + toBeWrapped.push( [ element, upcast[ 1 ] ] ); + + // Do not iterate over descendants. + return false; + } + } + } + } + }; + } + + // Finds a first parent that matches query. + // + // @param {CKEDITOR.dom.element} element + // @param {Function} query + function findParent( element, query ) { + var parent = element; + + while ( ( parent = parent.getParent() ) ) { + if ( query( parent ) ) + return true; + } + return false; + } + + function getWrapperAttributes( inlineWidget, name ) { + return { + // tabindex="-1" means that it can receive focus by code. + tabindex: -1, + contenteditable: 'false', + 'data-cke-widget-wrapper': 1, + 'data-cke-filter': 'off', + // Class cke_widget_new marks widgets which haven't been initialized yet. + 'class': 'cke_widget_wrapper cke_widget_new cke_widget_' + + ( inlineWidget ? 'inline' : 'block' ) + + ( name ? ' cke_widget_' + name : '' ) + }; + } + + // Inserts element at given index. + // It will check DTD and split ancestor elements up to the first + // that can contain this element. + // + // @param {CKEDITOR.htmlParser.element} parent + // @param {Number} index + // @param {CKEDITOR.htmlParser.element} element + function insertElement( parent, index, element ) { + // Do not split doc fragment... + if ( parent.type == CKEDITOR.NODE_ELEMENT ) { + var parentAllows = CKEDITOR.dtd[ parent.name ]; + // Parent element is known (included in DTD) and cannot contain + // this element. + if ( parentAllows && !parentAllows[ element.name ] ) { + var parent2 = parent.split( index ), + parentParent = parent.parent; + + // Element will now be inserted at right parent's index. + index = parent2.getIndex(); + + // If left part of split is empty - remove it. + if ( !parent.children.length ) { + index -= 1; + parent.remove(); + } + + // If right part of split is empty - remove it. + if ( !parent2.children.length ) + parent2.remove(); + + // Try inserting as grandpas' children. + return insertElement( parentParent, index, element ); + } + } + + // Finally we can add this element. + parent.add( element, index ); + } + + // Checks whether for the given widget definition and element widget should be created in inline or block mode. + // + // See also: {@link CKEDITOR.plugins.widget.definition#inline} and {@link CKEDITOR.plugins.widget#element}. + // + // @param {CKEDITOR.plugins.widget.definition} widgetDef The widget definition. + // @param {String} elementName The name of the widget element. + // @returns {Boolean} + function isWidgetInline( widgetDef, elementName ) { + return typeof widgetDef.inline == 'boolean' ? widgetDef.inline : !!CKEDITOR.dtd.$inline[ elementName ]; + } + + // @param {CKEDITOR.dom.element} + // @returns {Boolean} + function isDomTemp( element ) { + return element.hasAttribute( 'data-cke-temp' ); + } + + function onEditableKey( widget, keyCode ) { + var focusedEditable = widget.focusedEditable, + range; + + // CTRL+A. + if ( keyCode == CKEDITOR.CTRL + 65 ) { + var bogus = focusedEditable.getBogus(); + + range = widget.editor.createRange(); + range.selectNodeContents( focusedEditable ); + // Exclude bogus if exists. + if ( bogus ) + range.setEndAt( bogus, CKEDITOR.POSITION_BEFORE_START ); + + range.select(); + // Cancel event - block default. + return false; + } + // DEL or BACKSPACE. + else if ( keyCode == 8 || keyCode == 46 ) { + var ranges = widget.editor.getSelection().getRanges(); + + range = ranges[ 0 ]; + + // Block del or backspace if at editable's boundary. + return !( ranges.length == 1 && range.collapsed && + range.checkBoundaryOfElement( focusedEditable, CKEDITOR[ keyCode == 8 ? 'START' : 'END' ] ) ); + } + } + + function setFocusedEditable( widgetsRepo, widget, editableElement, offline ) { + var editor = widgetsRepo.editor; + + editor.fire( 'lockSnapshot' ); + + if ( editableElement ) { + var editableName = editableElement.data( 'cke-widget-editable' ), + editableInstance = widget.editables[ editableName ]; + + widgetsRepo.widgetHoldingFocusedEditable = widget; + widget.focusedEditable = editableInstance; + editableElement.addClass( 'cke_widget_editable_focused' ); + + if ( editableInstance.filter ) + editor.setActiveFilter( editableInstance.filter ); + editor.setActiveEnterMode( editableInstance.enterMode, editableInstance.shiftEnterMode ); + } else { + if ( !offline ) + widget.focusedEditable.removeClass( 'cke_widget_editable_focused' ); + + widget.focusedEditable = null; + widgetsRepo.widgetHoldingFocusedEditable = null; + editor.setActiveFilter( null ); + editor.setActiveEnterMode( null, null ); + } + + editor.fire( 'unlockSnapshot' ); + } + + function setupContextMenu( editor ) { + if ( !editor.contextMenu ) + return; + + editor.contextMenu.addListener( function( element ) { + var widget = editor.widgets.getByElement( element, true ); + + if ( widget ) + return widget.fire( 'contextMenu', {} ); + } ); + } + + // And now we've got two problems - original problem and RegExp. + // Some softeners: + // * FF tends to copy all blocks up to the copybin container. + // * IE tends to copy only the copybin, without its container. + // * We use spans on IE and blockless editors, but divs in other cases. + var pasteReplaceRegex = new RegExp( + '^' + + '(?:<(?:div|span)(?: data-cke-temp="1")?(?: id="cke_copybin")?(?: data-cke-temp="1")?>)?' + + '(?:<(?:div|span)(?: style="[^"]+")?>)?' + + ']*data-cke-copybin-start="1"[^>]*>.?([\\s\\S]+)]*data-cke-copybin-end="1"[^>]*>.?' + + '(?:)?' + + '(?:)?' + + '$', + // IE8 prefers uppercase when browsers stick to lowercase HTML (http://dev.ckeditor.com/ticket/13460). + 'i' + ); + + function pasteReplaceFn( match, wrapperHtml ) { + // Avoid polluting pasted data with any whitspaces, + // what's going to break check whether only one widget was pasted. + return CKEDITOR.tools.trim( wrapperHtml ); + } + + function setupDragAndDrop( widgetsRepo ) { + var editor = widgetsRepo.editor, + lineutils = CKEDITOR.plugins.lineutils; + + // These listeners handle inline and block widgets drag and drop. + // The only thing we need to do to make block widgets custom drag and drop functionality + // is to fire those events with the right properties (like the target which must be the drag handle). + editor.on( 'dragstart', function( evt ) { + var target = evt.data.target; + + if ( Widget.isDomDragHandler( target ) ) { + var widget = widgetsRepo.getByElement( target ); + + evt.data.dataTransfer.setData( 'cke/widget-id', widget.id ); + + // IE needs focus. + editor.focus(); + + // and widget need to be focused on drag start (http://dev.ckeditor.com/ticket/12172#comment:10). + widget.focus(); + } + } ); + + editor.on( 'drop', function( evt ) { + var dataTransfer = evt.data.dataTransfer, + id = dataTransfer.getData( 'cke/widget-id' ), + transferType = dataTransfer.getTransferType( editor ), + dragRange = editor.createRange(), + sourceWidget; + + // Disable cross-editor drag & drop for widgets - http://dev.ckeditor.com/ticket/13599. + if ( id !== '' && transferType === CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ) { + evt.cancel(); + return; + } + + if ( id === '' || transferType != CKEDITOR.DATA_TRANSFER_INTERNAL ) { + return; + } + + sourceWidget = widgetsRepo.instances[ id ]; + if ( !sourceWidget ) { + return; + } + + dragRange.setStartBefore( sourceWidget.wrapper ); + dragRange.setEndAfter( sourceWidget.wrapper ); + evt.data.dragRange = dragRange; + + // [IE8-9] Reset state of the clipboard#fixSplitNodesAfterDrop fix because by setting evt.data.dragRange + // (see above) after drop happened we do not need it. That fix is needed only if dragRange was created + // before drop (before text node was split). + delete CKEDITOR.plugins.clipboard.dragStartContainerChildCount; + delete CKEDITOR.plugins.clipboard.dragEndContainerChildCount; + + evt.data.dataTransfer.setData( 'text/html', editor.editable().getHtmlFromRange( dragRange ).getHtml() ); + editor.widgets.destroy( sourceWidget, true ); + } ); + + editor.on( 'contentDom', function() { + var editable = editor.editable(); + + // Register Lineutils's utilities as properties of repo. + CKEDITOR.tools.extend( widgetsRepo, { + finder: new lineutils.finder( editor, { + lookups: { + // Element is block but not list item and not in nested editable. + 'default': function( el ) { + if ( el.is( CKEDITOR.dtd.$listItem ) ) + return; + + if ( !el.is( CKEDITOR.dtd.$block ) ) + return; + + // Allow drop line inside, but never before or after nested editable (http://dev.ckeditor.com/ticket/12006). + if ( Widget.isDomNestedEditable( el ) ) + return; + + // Do not allow droping inside the widget being dragged (http://dev.ckeditor.com/ticket/13397). + if ( widgetsRepo._.draggedWidget.wrapper.contains( el ) ) { + return; + } + + // If element is nested editable, make sure widget can be dropped there (http://dev.ckeditor.com/ticket/12006). + var nestedEditable = Widget.getNestedEditable( editable, el ); + if ( nestedEditable ) { + var draggedWidget = widgetsRepo._.draggedWidget; + + // Don't let the widget to be dropped into its own nested editable. + if ( widgetsRepo.getByElement( nestedEditable ) == draggedWidget ) + return; + + var filter = CKEDITOR.filter.instances[ nestedEditable.data( 'cke-filter' ) ], + draggedRequiredContent = draggedWidget.requiredContent; + + // There will be no relation if the filter of nested editable does not allow + // requiredContent of dragged widget. + if ( filter && draggedRequiredContent && !filter.check( draggedRequiredContent ) ) + return; + } + + return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER; + } + } + } ), + locator: new lineutils.locator( editor ), + liner: new lineutils.liner( editor, { + lineStyle: { + cursor: 'move !important', + 'border-top-color': '#666' + }, + tipLeftStyle: { + 'border-left-color': '#666' + }, + tipRightStyle: { + 'border-right-color': '#666' + } + } ) + }, true ); + } ); + } + + // Setup mouse observer which will trigger: + // * widget focus on widget click, + // * widget#doubleclick forwarded from editor#doubleclick. + function setupMouseObserver( widgetsRepo ) { + var editor = widgetsRepo.editor; + + editor.on( 'contentDom', function() { + var editable = editor.editable(), + evtRoot = editable.isInline() ? editable : editor.document, + widget, + mouseDownOnDragHandler; + + editable.attachListener( evtRoot, 'mousedown', function( evt ) { + var target = evt.data.getTarget(); + + // Clicking scrollbar in Chrome will invoke event with target object of document type (#663). + // In IE8 the target object will be empty (http://dev.ckeditor.com/ticket/10887). + // We need to check if target is a proper element. + widget = ( target instanceof CKEDITOR.dom.element ) ? widgetsRepo.getByElement( target ) : null; + + mouseDownOnDragHandler = 0; // Reset. + + // Widget was clicked, but not editable nested in it. + if ( widget ) { + // Ignore mousedown on drag and drop handler if the widget is inline. + // Block widgets are handled by Lineutils. + if ( widget.inline && target.type == CKEDITOR.NODE_ELEMENT && target.hasAttribute( 'data-cke-widget-drag-handler' ) ) { + mouseDownOnDragHandler = 1; + + // When drag handler is pressed we have to clear current selection if it wasn't already on this widget. + // Otherwise, the selection may be in a fillingChar, which prevents dragging a widget. (http://dev.ckeditor.com/ticket/13284, see comment 8 and 9.) + if ( widgetsRepo.focused != widget ) + editor.getSelection().removeAllRanges(); + + return; + } + + if ( !Widget.getNestedEditable( widget.wrapper, target ) ) { + evt.data.preventDefault(); + if ( !CKEDITOR.env.ie ) + widget.focus(); + } else { + // Reset widget so mouseup listener is not confused. + widget = null; + } + } + } ); + + // Focus widget on mouseup if mousedown was fired on drag handler. + // Note: mouseup won't be fired at all if widget was dragged and dropped, so + // this code will be executed only when drag handler was clicked. + editable.attachListener( evtRoot, 'mouseup', function() { + // Check if widget is not destroyed (if widget is destroyed the wrapper will be null). + if ( mouseDownOnDragHandler && widget && widget.wrapper ) { + mouseDownOnDragHandler = 0; + widget.focus(); + } + } ); + + // On IE it is not enough to block mousedown. If widget wrapper (element with + // contenteditable=false attribute) is clicked directly (it is a target), + // then after mouseup/click IE will select that element. + // It is not possible to prevent that default action, + // so we force fake selection after everything happened. + if ( CKEDITOR.env.ie ) { + editable.attachListener( evtRoot, 'mouseup', function() { + setTimeout( function() { + // Check if widget is not destroyed (if widget is destroyed the wrapper will be null) and + // in editable contains widget (it could be dragged and removed). + if ( widget && widget.wrapper && editable.contains( widget.wrapper ) ) { + widget.focus(); + widget = null; + } + } ); + } ); + } + } ); + + editor.on( 'doubleclick', function( evt ) { + var widget = widgetsRepo.getByElement( evt.data.element ); + + // Not in widget or in nested editable. + if ( !widget || Widget.getNestedEditable( widget.wrapper, evt.data.element ) ) + return; + + return widget.fire( 'doubleclick', { element: evt.data.element } ); + }, null, null, 1 ); + } + + // Setup editor#key observer which will forward it + // to focused widget. + function setupKeyboardObserver( widgetsRepo ) { + var editor = widgetsRepo.editor; + + editor.on( 'key', function( evt ) { + var focused = widgetsRepo.focused, + widgetHoldingFocusedEditable = widgetsRepo.widgetHoldingFocusedEditable, + ret; + + if ( focused ) + ret = focused.fire( 'key', { keyCode: evt.data.keyCode } ); + else if ( widgetHoldingFocusedEditable ) + ret = onEditableKey( widgetHoldingFocusedEditable, evt.data.keyCode ); + + return ret; + }, null, null, 1 ); + } + + // Setup copybin on native copy and cut events in order to handle copy and cut commands + // if user accepted security alert on IEs. + // Note: when copying or cutting using keystroke, copySingleWidget will be first executed + // by the keydown listener. Conflict between two calls will be resolved by copy_bin existence check. + function setupNativeCutAndCopy( widgetsRepo ) { + var editor = widgetsRepo.editor; + + editor.on( 'contentDom', function() { + var editable = editor.editable(); + + editable.attachListener( editable, 'copy', eventListener ); + editable.attachListener( editable, 'cut', eventListener ); + } ); + + function eventListener( evt ) { + if ( widgetsRepo.focused ) + copySingleWidget( widgetsRepo.focused, evt.name == 'cut' ); + } + } + + // Setup selection observer which will trigger: + // * widget select & focus on selection change, + // * nested editable focus (related properites and classes) on selection change, + // * deselecting and blurring all widgets on data, + // * blurring widget on editor blur. + function setupSelectionObserver( widgetsRepo ) { + var editor = widgetsRepo.editor; + + editor.on( 'selectionCheck', function() { + widgetsRepo.fire( 'checkSelection' ); + } ); + + widgetsRepo.on( 'checkSelection', widgetsRepo.checkSelection, widgetsRepo ); + + editor.on( 'selectionChange', function( evt ) { + var nestedEditable = Widget.getNestedEditable( editor.editable(), evt.data.selection.getStartElement() ), + newWidget = nestedEditable && widgetsRepo.getByElement( nestedEditable ), + oldWidget = widgetsRepo.widgetHoldingFocusedEditable; + + if ( oldWidget ) { + if ( oldWidget !== newWidget || !oldWidget.focusedEditable.equals( nestedEditable ) ) { + setFocusedEditable( widgetsRepo, oldWidget, null ); + + if ( newWidget && nestedEditable ) + setFocusedEditable( widgetsRepo, newWidget, nestedEditable ); + } + } + // It may happen that there's no widget even if editable was found - + // e.g. if selection was automatically set in editable although widget wasn't initialized yet. + else if ( newWidget && nestedEditable ) { + setFocusedEditable( widgetsRepo, newWidget, nestedEditable ); + } + } ); + + // Invalidate old widgets early - immediately on dataReady. + editor.on( 'dataReady', function() { + // Deselect and blur all widgets. + stateUpdater( widgetsRepo ).commit(); + } ); + + editor.on( 'blur', function() { + var widget; + + if ( ( widget = widgetsRepo.focused ) ) + blurWidget( widgetsRepo, widget ); + + if ( ( widget = widgetsRepo.widgetHoldingFocusedEditable ) ) + setFocusedEditable( widgetsRepo, widget, null ); + } ); + } + + // Set up actions like: + // * processing in toHtml/toDataFormat, + // * pasting handling, + // * insertion handling, + // * editable reload handling (setData, mode switch, undo/redo), + // * DOM invalidation handling, + // * widgets checks. + function setupWidgetsLifecycle( widgetsRepo ) { + setupWidgetsLifecycleStart( widgetsRepo ); + setupWidgetsLifecycleEnd( widgetsRepo ); + + widgetsRepo.on( 'checkWidgets', checkWidgets ); + widgetsRepo.editor.on( 'contentDomInvalidated', widgetsRepo.checkWidgets, widgetsRepo ); + } + + function setupWidgetsLifecycleEnd( widgetsRepo ) { + var editor = widgetsRepo.editor, + downcastingSessions = {}; + + // Listen before htmlDP#htmlFilter is applied to cache all widgets, because we'll + // loose data-cke-* attributes. + editor.on( 'toDataFormat', function( evt ) { + // To avoid conflicts between htmlDP#toDF calls done at the same time + // (e.g. nestedEditable#getData called during downcasting some widget) + // mark every toDataFormat event chain with the downcasting session id. + var id = CKEDITOR.tools.getNextNumber(), + toBeDowncasted = []; + evt.data.downcastingSessionId = id; + downcastingSessions[ id ] = toBeDowncasted; + + evt.data.dataValue.forEach( function( element ) { + var attrs = element.attributes, + widget, widgetElement; + + // Wrapper. + // Perform first part of downcasting (cleanup) and cache widgets, + // because after applying DP's filter all data-cke-* attributes will be gone. + if ( 'data-cke-widget-id' in attrs ) { + widget = widgetsRepo.instances[ attrs[ 'data-cke-widget-id' ] ]; + if ( widget ) { + widgetElement = element.getFirst( Widget.isParserWidgetElement ); + toBeDowncasted.push( { + wrapper: element, + element: widgetElement, + widget: widget, + editables: {} + } ); + + // If widget did not have data-cke-widget attribute before upcasting remove it. + if ( widgetElement.attributes[ 'data-cke-widget-keep-attr' ] != '1' ) + delete widgetElement.attributes[ 'data-widget' ]; + } + } + // Nested editable. + else if ( 'data-cke-widget-editable' in attrs ) { + // Save the reference to this nested editable in the closest widget to be downcasted. + // Nested editables are downcasted in the successive toDataFormat to create an opportunity + // for dataFilter's "excludeNestedEditable" option to do its job (that option relies on + // contenteditable="true" attribute) (http://dev.ckeditor.com/ticket/11372). + toBeDowncasted[ toBeDowncasted.length - 1 ].editables[ attrs[ 'data-cke-widget-editable' ] ] = element; + + // Don't check children - there won't be next wrapper or nested editable which we + // should process in this session. + return false; + } + }, CKEDITOR.NODE_ELEMENT, true ); + }, null, null, 8 ); + + // Listen after dataProcessor.htmlFilter and ACF were applied + // so wrappers securing widgets' contents are removed after all filtering was done. + editor.on( 'toDataFormat', function( evt ) { + // Ignore some unmarked sessions. + if ( !evt.data.downcastingSessionId ) + return; + + var toBeDowncasted = downcastingSessions[ evt.data.downcastingSessionId ], + toBe, widget, widgetElement, retElement, editableElement, e; + + while ( ( toBe = toBeDowncasted.shift() ) ) { + widget = toBe.widget; + widgetElement = toBe.element; + retElement = widget._.downcastFn && widget._.downcastFn.call( widget, widgetElement ); + + // Replace nested editables' content with their output data. + for ( e in toBe.editables ) { + editableElement = toBe.editables[ e ]; + + delete editableElement.attributes.contenteditable; + editableElement.setHtml( widget.editables[ e ].getData() ); + } + + // Returned element always defaults to widgetElement. + if ( !retElement ) + retElement = widgetElement; + + toBe.wrapper.replaceWith( retElement ); + } + }, null, null, 13 ); + + + editor.on( 'contentDomUnload', function() { + widgetsRepo.destroyAll( true ); + } ); + } + + function setupWidgetsLifecycleStart( widgetsRepo ) { + var editor = widgetsRepo.editor, + processedWidgetOnly, + snapshotLoaded; + + // Listen after ACF (so data are filtered), + // but before dataProcessor.dataFilter was applied (so we can secure widgets' internals). + editor.on( 'toHtml', function( evt ) { + var upcastIterator = createUpcastIterator( widgetsRepo ), + toBeWrapped; + + evt.data.dataValue.forEach( upcastIterator.iterator, CKEDITOR.NODE_ELEMENT, true ); + + // Clean up and wrap all queued elements. + while ( ( toBeWrapped = upcastIterator.toBeWrapped.pop() ) ) { + cleanUpWidgetElement( toBeWrapped[ 0 ] ); + widgetsRepo.wrapElement( toBeWrapped[ 0 ], toBeWrapped[ 1 ] ); + } + + // Used to determine whether only widget was pasted. + if ( evt.data.protectedWhitespaces ) { + // Whitespaces are protected by wrapping content with spans. Take the middle node only. + processedWidgetOnly = evt.data.dataValue.children.length == 3 && + Widget.isParserWidgetWrapper( evt.data.dataValue.children[ 1 ] ); + } else { + processedWidgetOnly = evt.data.dataValue.children.length == 1 && + Widget.isParserWidgetWrapper( evt.data.dataValue.children[ 0 ] ); + } + }, null, null, 8 ); + + editor.on( 'dataReady', function() { + // Clean up all widgets loaded from snapshot. + if ( snapshotLoaded ) + cleanUpAllWidgetElements( widgetsRepo, editor.editable() ); + snapshotLoaded = 0; + + // Some widgets were destroyed on contentDomUnload, + // some on loadSnapshot, but that does not include + // e.g. setHtml on inline editor or widgets removed just + // before setting data. + widgetsRepo.destroyAll( true ); + widgetsRepo.initOnAll(); + } ); + + // Set flag so dataReady will know that additional + // cleanup is needed, because snapshot containing widgets was loaded. + editor.on( 'loadSnapshot', function( evt ) { + // Primitive but sufficient check which will prevent from executing + // heavier cleanUpAllWidgetElements if not needed. + if ( ( /data-cke-widget/ ).test( evt.data ) ) + snapshotLoaded = 1; + + widgetsRepo.destroyAll( true ); + }, null, null, 9 ); + + // Handle pasted single widget. + editor.on( 'paste', function( evt ) { + var data = evt.data; + + data.dataValue = data.dataValue.replace( pasteReplaceRegex, pasteReplaceFn ); + + // If drag'n'drop kind of paste into nested editable (data.range), selection is set AFTER + // data is pasted, which means editor has no chance to change activeFilter's context. + // As a result, pasted data is filtered with default editor's filter instead of NE's and + // funny things get inserted. Changing the filter by analysis of the paste range below (http://dev.ckeditor.com/ticket/13186). + if ( data.range ) { + // Check if pasting into nested editable. + var nestedEditable = Widget.getNestedEditable( editor.editable(), data.range.startContainer ); + + if ( nestedEditable ) { + // Retrieve the filter from NE's data and set it active before editor.insertHtml is done + // in clipboard plugin. + var filter = CKEDITOR.filter.instances[ nestedEditable.data( 'cke-filter' ) ]; + + if ( filter ) { + editor.setActiveFilter( filter ); + } + } + } + } ); + + // Listen with high priority to check widgets after data was inserted. + editor.on( 'afterInsertHtml', function( evt ) { + if ( evt.data.intoRange ) { + widgetsRepo.checkWidgets( { initOnlyNew: true } ); + } else { + editor.fire( 'lockSnapshot' ); + // Init only new for performance reason. + // Focus inited if only widget was processed. + widgetsRepo.checkWidgets( { initOnlyNew: true, focusInited: processedWidgetOnly } ); + + editor.fire( 'unlockSnapshot' ); + } + } ); + } + + // Helper for coordinating which widgets should be + // selected/deselected and which one should be focused/blurred. + function stateUpdater( widgetsRepo ) { + var currentlySelected = widgetsRepo.selected, + toBeSelected = [], + toBeDeselected = currentlySelected.slice( 0 ), + focused = null; + + return { + select: function( widget ) { + if ( CKEDITOR.tools.indexOf( currentlySelected, widget ) < 0 ) + toBeSelected.push( widget ); + + var index = CKEDITOR.tools.indexOf( toBeDeselected, widget ); + if ( index >= 0 ) + toBeDeselected.splice( index, 1 ); + + return this; + }, + + focus: function( widget ) { + focused = widget; + return this; + }, + + commit: function() { + var focusedChanged = widgetsRepo.focused !== focused, + widget, isDirty; + + widgetsRepo.editor.fire( 'lockSnapshot' ); + + if ( focusedChanged && ( widget = widgetsRepo.focused ) ) + blurWidget( widgetsRepo, widget ); + + while ( ( widget = toBeDeselected.pop() ) ) { + currentlySelected.splice( CKEDITOR.tools.indexOf( currentlySelected, widget ), 1 ); + // Widget could be destroyed in the meantime - e.g. data could be set. + if ( widget.isInited() ) { + isDirty = widget.editor.checkDirty(); + + widget.setSelected( false ); + + !isDirty && widget.editor.resetDirty(); + } + } + + if ( focusedChanged && focused ) { + isDirty = widgetsRepo.editor.checkDirty(); + + widgetsRepo.focused = focused; + widgetsRepo.fire( 'widgetFocused', { widget: focused } ); + focused.setFocused( true ); + + !isDirty && widgetsRepo.editor.resetDirty(); + } + + while ( ( widget = toBeSelected.pop() ) ) { + currentlySelected.push( widget ); + widget.setSelected( true ); + } + + widgetsRepo.editor.fire( 'unlockSnapshot' ); + } + }; + } + + + // + // WIDGET helpers --------------------------------------------------------- + // + + // LEFT, RIGHT, UP, DOWN, DEL, BACKSPACE - unblock default fake sel handlers. + var keystrokesNotBlockedByWidget = { 37: 1, 38: 1, 39: 1, 40: 1, 8: 1, 46: 1 }; + + // Applies or removes style's classes from widget. + // @param {CKEDITOR.style} style Custom widget style. + // @param {Boolean} apply Whether to apply or remove style. + function applyRemoveStyle( widget, style, apply ) { + var changed = 0, + classes = getStyleClasses( style ), + updatedClasses = widget.data.classes || {}, + cl; + + // Ee... Something is wrong with this style. + if ( !classes ) + return; + + // Clone, because we need to break reference. + updatedClasses = CKEDITOR.tools.clone( updatedClasses ); + + while ( ( cl = classes.pop() ) ) { + if ( apply ) { + if ( !updatedClasses[ cl ] ) + changed = updatedClasses[ cl ] = 1; + } else { + if ( updatedClasses[ cl ] ) { + delete updatedClasses[ cl ]; + changed = 1; + } + } + } + if ( changed ) + widget.setData( 'classes', updatedClasses ); + } + + function cancel( evt ) { + evt.cancel(); + } + + function copySingleWidget( widget, isCut ) { + var editor = widget.editor, + doc = editor.document; + + // We're still handling previous copy/cut. + // When keystroke is used to copy/cut this will also prevent + // conflict with copySingleWidget called again for native copy/cut event. + if ( doc.getById( 'cke_copybin' ) ) + return; + + // [IE] Use span for copybin and its container to avoid bug with expanding editable height by + // absolutely positioned element. + var copybinName = ( editor.blockless || CKEDITOR.env.ie ) ? 'span' : 'div', + copybin = doc.createElement( copybinName ), + copybinContainer = doc.createElement( copybinName ), + // IE8 always jumps to the end of document. + needsScrollHack = CKEDITOR.env.ie && CKEDITOR.env.version < 9; + + copybinContainer.setAttributes( { + id: 'cke_copybin', + 'data-cke-temp': '1' + } ); + + // Position copybin element outside current viewport. + copybin.setStyles( { + position: 'absolute', + width: '1px', + height: '1px', + overflow: 'hidden' + } ); + + copybin.setStyle( editor.config.contentsLangDirection == 'ltr' ? 'left' : 'right', '-5000px' ); + + var range = editor.createRange(); + range.setStartBefore( widget.wrapper ); + range.setEndAfter( widget.wrapper ); + + copybin.setHtml( + '\u200b' + + editor.editable().getHtmlFromRange( range ).getHtml() + + '\u200b' ); + + // Save snapshot with the current state. + editor.fire( 'saveSnapshot' ); + + // Ignore copybin. + editor.fire( 'lockSnapshot' ); + + copybinContainer.append( copybin ); + editor.editable().append( copybinContainer ); + + var listener1 = editor.on( 'selectionChange', cancel, null, null, 0 ), + listener2 = widget.repository.on( 'checkSelection', cancel, null, null, 0 ); + + if ( needsScrollHack ) { + var docElement = doc.getDocumentElement().$, + scrollTop = docElement.scrollTop; + } + + // Once the clone of the widget is inside of copybin, select + // the entire contents. This selection will be copied by the + // native browser's clipboard system. + range = editor.createRange(); + range.selectNodeContents( copybin ); + range.select(); + + if ( needsScrollHack ) + docElement.scrollTop = scrollTop; + + setTimeout( function() { + // [IE] Focus widget before removing copybin to avoid scroll jump. + if ( !isCut ) + widget.focus(); + + copybinContainer.remove(); + + listener1.removeListener(); + listener2.removeListener(); + + editor.fire( 'unlockSnapshot' ); + + if ( isCut ) { + widget.repository.del( widget ); + editor.fire( 'saveSnapshot' ); + } + }, 100 ); // Use 100ms, so Chrome (@Mac) will be able to grab the content. + } + + // Extracts classes array from style instance. + function getStyleClasses( style ) { + var attrs = style.getDefinition().attributes, + classes = attrs && attrs[ 'class' ]; + + return classes ? classes.split( /\s+/ ) : null; + } + + // [IE] Force keeping focus because IE sometimes forgets to fire focus on main editable + // when blurring nested editable. + // @context widget + function onEditableBlur() { + var active = CKEDITOR.document.getActive(), + editor = this.editor, + editable = editor.editable(); + + // If focus stays within editor override blur and set currentActive because it should be + // automatically changed to editable on editable#focus but it is not fired. + if ( ( editable.isInline() ? editable : editor.document.getWindow().getFrame() ).equals( active ) ) + editor.focusManager.focus( editable ); + } + + // Force selectionChange when editable was focused. + // Similar to hack in selection.js#~620. + // @context widget + function onEditableFocus() { + // Gecko does not support 'DOMFocusIn' event on which we unlock selection + // in selection.js to prevent selection locking when entering nested editables. + if ( CKEDITOR.env.gecko ) + this.editor.unlockSelection(); + + // We don't need to force selectionCheck on Webkit, because on Webkit + // we do that on DOMFocusIn in selection.js. + if ( !CKEDITOR.env.webkit ) { + this.editor.forceNextSelectionCheck(); + this.editor.selectionChange( 1 ); + } + } + + // Setup listener on widget#data which will update (remove/add) classes + // by comparing newly set classes with the old ones. + function setupDataClassesListener( widget ) { + // Note: previousClasses and newClasses may be null! + // Tip: for ( cl in null ) is correct. + var previousClasses = null; + + widget.on( 'data', function() { + var newClasses = this.data.classes, + cl; + + // When setting new classes one need to remember + // that he must break reference. + if ( previousClasses == newClasses ) + return; + + for ( cl in previousClasses ) { + // Avoid removing and adding classes again. + if ( !( newClasses && newClasses[ cl ] ) ) + this.removeClass( cl ); + } + for ( cl in newClasses ) + this.addClass( cl ); + + previousClasses = newClasses; + } ); + } + + // Add a listener to data event that will set/change widget's label (http://dev.ckeditor.com/ticket/14539). + function setupA11yListener( widget ) { + // Note, the function gets executed in a context of widget instance. + function getLabelDefault() { + return this.editor.lang.widget.label.replace( /%1/, this.pathName || this.element.getName() ); + } + + // Setting a listener on data is enough, there's no need to perform it on widget initialization, as + // setupWidgetData fires this event anyway. + widget.on( 'data', function() { + // In some cases widget might get destroyed in an earlier data listener. For instance, image2 plugin, does + // so when changing its internal state. + if ( !widget.wrapper ) { + return; + } + + var label = this.getLabel ? this.getLabel() : getLabelDefault.call( this ); + + widget.wrapper.setAttribute( 'role', 'region' ); + widget.wrapper.setAttribute( 'aria-label', label ); + }, null, null, 9999 ); + } + + function setupDragHandler( widget ) { + if ( !widget.draggable ) + return; + + var editor = widget.editor, + // Use getLast to find wrapper's direct descendant (http://dev.ckeditor.com/ticket/12022). + container = widget.wrapper.getLast( Widget.isDomDragHandlerContainer ), + img; + + // Reuse drag handler if already exists (http://dev.ckeditor.com/ticket/11281). + if ( container ) + img = container.findOne( 'img' ); + else { + container = new CKEDITOR.dom.element( 'span', editor.document ); + container.setAttributes( { + 'class': 'cke_reset cke_widget_drag_handler_container', + // Split background and background-image for IE8 which will break on rgba(). + style: 'background:rgba(220,220,220,0.5);background-image:url(' + editor.plugins.widget.path + 'images/handle.png)' + } ); + + img = new CKEDITOR.dom.element( 'img', editor.document ); + img.setAttributes( { + 'class': 'cke_reset cke_widget_drag_handler', + 'data-cke-widget-drag-handler': '1', + src: CKEDITOR.tools.transparentImageData, + width: DRAG_HANDLER_SIZE, + title: editor.lang.widget.move, + height: DRAG_HANDLER_SIZE, + role: 'presentation' + } ); + widget.inline && img.setAttribute( 'draggable', 'true' ); + + container.append( img ); + widget.wrapper.append( container ); + } + + // Preventing page reload when dropped content on widget wrapper (http://dev.ckeditor.com/ticket/13015). + // Widget is not editable so by default drop on it isn't allowed what means that + // browser handles it (there's no editable#drop event). If there's no drop event we cannot block + // the drop, so page is reloaded. This listener enables drop on widget wrappers. + widget.wrapper.on( 'dragover', function( evt ) { + evt.data.preventDefault(); + } ); + + widget.wrapper.on( 'mouseenter', widget.updateDragHandlerPosition, widget ); + setTimeout( function() { + widget.on( 'data', widget.updateDragHandlerPosition, widget ); + }, 50 ); + + if ( !widget.inline ) { + img.on( 'mousedown', onBlockWidgetDrag, widget ); + + // On IE8 'dragstart' is propagated to editable, so editor#dragstart is fired twice on block widgets. + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { + img.on( 'dragstart', function( evt ) { + evt.data.preventDefault( true ); + } ); + } + } + + widget.dragHandlerContainer = container; + } + + function onBlockWidgetDrag( evt ) { + var finder = this.repository.finder, + locator = this.repository.locator, + liner = this.repository.liner, + editor = this.editor, + editable = editor.editable(), + listeners = [], + sorted = [], + locations, + y; + + // Mark dragged widget for repository#finder. + this.repository._.draggedWidget = this; + + // Harvest all possible relations and display some closest. + var relations = finder.greedySearch(), + + buffer = CKEDITOR.tools.eventsBuffer( 50, function() { + locations = locator.locate( relations ); + + // There's only a single line displayed for D&D. + sorted = locator.sort( y, 1 ); + + if ( sorted.length ) { + liner.prepare( relations, locations ); + liner.placeLine( sorted[ 0 ] ); + liner.cleanup(); + } + } ); + + // Let's have the "dragging cursor" over entire editable. + editable.addClass( 'cke_widget_dragging' ); + + // Cache mouse position so it is re-used in events buffer. + listeners.push( editable.on( 'mousemove', function( evt ) { + y = evt.data.$.clientY; + buffer.input(); + } ) ); + + // Fire drag start as it happens during the native D&D. + editor.fire( 'dragstart', { target: evt.sender } ); + + function onMouseUp() { + var l; + + buffer.reset(); + + // Stop observing events. + while ( ( l = listeners.pop() ) ) + l.removeListener(); + + onBlockWidgetDrop.call( this, sorted, evt.sender ); + } + + // Mouseup means "drop". This is when the widget is being detached + // from DOM and placed at range determined by the line (location). + listeners.push( editor.document.once( 'mouseup', onMouseUp, this ) ); + + // Prevent calling 'onBlockWidgetDrop' twice in the inline editor. + // `removeListener` does not work if it is called at the same time event is fired. + if ( !editable.isInline() ) { + // Mouseup may occur when user hovers the line, which belongs to + // the outer document. This is, of course, a valid listener too. + listeners.push( CKEDITOR.document.once( 'mouseup', onMouseUp, this ) ); + } + } + + function onBlockWidgetDrop( sorted, dragTarget ) { + var finder = this.repository.finder, + liner = this.repository.liner, + editor = this.editor, + editable = this.editor.editable(); + + if ( !CKEDITOR.tools.isEmpty( liner.visible ) ) { + // Retrieve range for the closest location. + var dropRange = finder.getRange( sorted[ 0 ] ); + + // Focus widget (it could lost focus after mousedown+mouseup) + // and save this state as the one where we want to be taken back when undoing. + this.focus(); + + // Drag range will be set in the drop listener. + editor.fire( 'drop', { + dropRange: dropRange, + target: dropRange.startContainer + } ); + } + + // Clean-up custom cursor for editable. + editable.removeClass( 'cke_widget_dragging' ); + + // Clean-up all remaining lines. + liner.hideVisible(); + + // Clean-up drag & drop. + editor.fire( 'dragend', { target: dragTarget } ); + } + + function setupEditables( widget ) { + var editableName, + editableDef, + definedEditables = widget.editables; + + widget.editables = {}; + + if ( !widget.editables ) + return; + + for ( editableName in definedEditables ) { + editableDef = definedEditables[ editableName ]; + widget.initEditable( editableName, typeof editableDef == 'string' ? { selector: editableDef } : editableDef ); + } + } + + function setupMask( widget ) { + if ( !widget.mask ) + return; + + // Reuse mask if already exists (http://dev.ckeditor.com/ticket/11281). + var img = widget.wrapper.findOne( '.cke_widget_mask' ); + + if ( !img ) { + img = new CKEDITOR.dom.element( 'img', widget.editor.document ); + img.setAttributes( { + src: CKEDITOR.tools.transparentImageData, + 'class': 'cke_reset cke_widget_mask' + } ); + widget.wrapper.append( img ); + } + + widget.mask = img; + } + + // Replace parts object containing: + // partName => selector pairs + // with: + // partName => element pairs + function setupParts( widget ) { + if ( widget.parts ) { + var parts = {}, + el, partName; + + for ( partName in widget.parts ) { + el = widget.wrapper.findOne( widget.parts[ partName ] ); + parts[ partName ] = el; + } + widget.parts = parts; + } + } + + function setupWidget( widget, widgetDef ) { + setupWrapper( widget ); + setupParts( widget ); + setupEditables( widget ); + setupMask( widget ); + setupDragHandler( widget ); + setupDataClassesListener( widget ); + setupA11yListener( widget ); + + // http://dev.ckeditor.com/ticket/11145: [IE8] Non-editable content of widget is draggable. + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { + widget.wrapper.on( 'dragstart', function( evt ) { + var target = evt.data.getTarget(); + + // Allow text dragging inside nested editables or dragging inline widget's drag handler. + if ( !Widget.getNestedEditable( widget, target ) && !( widget.inline && Widget.isDomDragHandler( target ) ) ) + evt.data.preventDefault(); + } ); + } + + widget.wrapper.removeClass( 'cke_widget_new' ); + widget.element.addClass( 'cke_widget_element' ); + + widget.on( 'key', function( evt ) { + var keyCode = evt.data.keyCode; + + // ENTER. + if ( keyCode == 13 ) { + widget.edit(); + // CTRL+C or CTRL+X. + } else if ( keyCode == CKEDITOR.CTRL + 67 || keyCode == CKEDITOR.CTRL + 88 ) { + copySingleWidget( widget, keyCode == CKEDITOR.CTRL + 88 ); + return; // Do not preventDefault. + } else if ( keyCode in keystrokesNotBlockedByWidget || ( CKEDITOR.CTRL & keyCode ) || ( CKEDITOR.ALT & keyCode ) ) { + // Pass chosen keystrokes to other plugins or default fake sel handlers. + // Pass all CTRL/ALT keystrokes. + return; + } + + return false; + }, null, null, 999 ); + // Listen with high priority so it's possible + // to overwrite this callback. + + widget.on( 'doubleclick', function( evt ) { + if ( widget.edit() ) { + // We have to cancel event if edit method opens a dialog, otherwise + // link plugin may open extra dialog (http://dev.ckeditor.com/ticket/12140). + evt.cancel(); + } + } ); + + if ( widgetDef.data ) + widget.on( 'data', widgetDef.data ); + + if ( widgetDef.edit ) + widget.on( 'edit', widgetDef.edit ); + } + + function setupWidgetData( widget, startupData ) { + var widgetDataAttr = widget.element.data( 'cke-widget-data' ); + + if ( widgetDataAttr ) + widget.setData( JSON.parse( decodeURIComponent( widgetDataAttr ) ) ); + if ( startupData ) + widget.setData( startupData ); + + // Populate classes if they are not preset. + if ( !widget.data.classes ) + widget.setData( 'classes', widget.getClasses() ); + + // Unblock data and... + widget.dataReady = true; + + // Write data to element because this was blocked when data wasn't ready. + writeDataToElement( widget ); + + // Fire data event first time, because this was blocked when data wasn't ready. + widget.fire( 'data', widget.data ); + } + + function setupWrapper( widget ) { + // Retrieve widget wrapper. Assign an id to it. + var wrapper = widget.wrapper = widget.element.getParent(); + wrapper.setAttribute( 'data-cke-widget-id', widget.id ); + } + + function writeDataToElement( widget ) { + widget.element.data( 'cke-widget-data', encodeURIComponent( JSON.stringify( widget.data ) ) ); + } + + // + // WIDGET STYLE HANDLER --------------------------------------------------- + // + + ( function() { + // Styles categorized by group. It is used to prevent applying styles for the same group being used together. + var styleGroups = {}; + + /** + * The class representing a widget style. It is an {@link CKEDITOR#STYLE_OBJECT object} like + * the styles handler for widgets. + * + * **Note:** This custom style handler does not support all methods of the {@link CKEDITOR.style} class. + * Not supported methods: {@link #applyToRange}, {@link #removeFromRange}, {@link #applyToObject}. + * + * @since 4.4 + * @class CKEDITOR.style.customHandlers.widget + * @extends CKEDITOR.style + */ + CKEDITOR.style.addCustomHandler( { + type: 'widget', + + setup: function( styleDefinition ) { + /** + * The name of widget to which this style can be applied. + * It is extracted from style definition's `widget` property. + * + * @property {String} widget + */ + this.widget = styleDefinition.widget; + + /** + * An array of groups that this style belongs to. + * Styles assigned to the same group cannot be combined. + * + * @since 4.6.2 + * @property {Array} group + */ + this.group = typeof styleDefinition.group == 'string' ? [ styleDefinition.group ] : styleDefinition.group; + + // Store style categorized by its group. + // It is used to prevent enabling two styles from same group. + if ( this.group ) { + saveStyleGroup( this ); + } + }, + + apply: function( editor ) { + var widget; + + // Before CKEditor 4.4 wasn't a required argument, so we need to + // handle a case when it wasn't provided. + if ( !( editor instanceof CKEDITOR.editor ) ) + return; + + // Theoretically we could bypass checkApplicable, get widget from + // widgets.focused and check its name, what would be faster, but then + // this custom style would work differently than the default style + // which checks if it's applicable before applying or removing itself. + if ( this.checkApplicable( editor.elementPath(), editor ) ) { + widget = editor.widgets.focused; + + // Remove other styles from the same group. + if ( this.group ) { + this.removeStylesFromSameGroup( editor ); + } + + widget.applyStyle( this ); + } + }, + + remove: function( editor ) { + // Before CKEditor 4.4 wasn't a required argument, so we need to + // handle a case when it wasn't provided. + if ( !( editor instanceof CKEDITOR.editor ) ) + return; + + if ( this.checkApplicable( editor.elementPath(), editor ) ) + editor.widgets.focused.removeStyle( this ); + }, + + /** + * Removes all styles that belong to the same group as this style. This method will neither add nor remove + * the current style. + * Returns `true` if any style was removed, otherwise returns `false`. + * + * @since 4.6.2 + * @param {CKEDITOR.editor} editor + * @returns {Boolean} + */ + removeStylesFromSameGroup: function( editor ) { + var stylesFromSameGroup, + path, + removed = false; + + // Before CKEditor 4.4 wasn't a required argument, so we need to + // handle a case when it wasn't provided. + if ( !( editor instanceof CKEDITOR.editor ) ) + return false; + + path = editor.elementPath(); + if ( this.checkApplicable( path, editor ) ) { + // Iterate over each group. + for ( var i = 0, l = this.group.length; i < l; i++ ) { + stylesFromSameGroup = styleGroups[ this.widget ][ this.group[ i ] ]; + // Iterate over each style from group. + for ( var j = 0; j < stylesFromSameGroup.length; j++ ) { + if ( stylesFromSameGroup[ j ] !== this && stylesFromSameGroup[ j ].checkActive( path, editor ) ) { + editor.widgets.focused.removeStyle( stylesFromSameGroup[ j ] ); + removed = true; + } + } + } + } + + return removed; + }, + + checkActive: function( elementPath, editor ) { + return this.checkElementMatch( elementPath.lastElement, 0, editor ); + }, + + checkApplicable: function( elementPath, editor ) { + // Before CKEditor 4.4 wasn't a required argument, so we need to + // handle a case when it wasn't provided. + if ( !( editor instanceof CKEDITOR.editor ) ) + return false; + + return this.checkElement( elementPath.lastElement ); + }, + + checkElementMatch: checkElementMatch, + + checkElementRemovable: checkElementMatch, + + /** + * Checks if an element is a {@link CKEDITOR.plugins.widget#wrapper wrapper} of a + * widget whose name matches the {@link #widget widget name} specified in the style definition. + * + * @param {CKEDITOR.dom.element} element + * @returns {Boolean} + */ + checkElement: function( element ) { + if ( !Widget.isDomWidgetWrapper( element ) ) + return false; + + var widgetElement = element.getFirst( Widget.isDomWidgetElement ); + return widgetElement && widgetElement.data( 'widget' ) == this.widget; + }, + + buildPreview: function( label ) { + return label || this._.definition.name; + }, + + /** + * Returns allowed content rules which should be registered for this style. + * Uses widget's {@link CKEDITOR.plugins.widget.definition#styleableElements} to make a rule + * allowing classes on specified elements or use widget's + * {@link CKEDITOR.plugins.widget.definition#styleToAllowedContentRules} method to transform a style + * into allowed content rules. + * + * @param {CKEDITOR.editor} The editor instance. + * @returns {CKEDITOR.filter.allowedContentRules} + */ + toAllowedContentRules: function( editor ) { + if ( !editor ) + return null; + + var widgetDef = editor.widgets.registered[ this.widget ], + classes, + rule = {}; + + if ( !widgetDef ) + return null; + + if ( widgetDef.styleableElements ) { + classes = this.getClassesArray(); + if ( !classes ) + return null; + + rule[ widgetDef.styleableElements ] = { + classes: classes, + propertiesOnly: true + }; + return rule; + } + if ( widgetDef.styleToAllowedContentRules ) + return widgetDef.styleToAllowedContentRules( this ); + return null; + }, + + /** + * Returns classes defined in the style in form of an array. + * + * @returns {String[]} + */ + getClassesArray: function() { + var classes = this._.definition.attributes && this._.definition.attributes[ 'class' ]; + + return classes ? CKEDITOR.tools.trim( classes ).split( /\s+/ ) : null; + }, + + /** + * Not implemented. + * + * @method applyToRange + */ + applyToRange: notImplemented, + + /** + * Not implemented. + * + * @method removeFromRange + */ + removeFromRange: notImplemented, + + /** + * Not implemented. + * + * @method applyToObject + */ + applyToObject: notImplemented + } ); + + function notImplemented() {} + + // @context style + function checkElementMatch( element, fullMatch, editor ) { + // Before CKEditor 4.4 wasn't a required argument, so we need to + // handle a case when it wasn't provided. + if ( !editor ) + return false; + + if ( !this.checkElement( element ) ) + return false; + + var widget = editor.widgets.getByElement( element, true ); + return widget && widget.checkStyleActive( this ); + } + + // Save and categorize style by its group. + function saveStyleGroup( style ) { + var widgetName = style.widget, + group; + + if ( !styleGroups[ widgetName ] ) { + styleGroups[ widgetName ] = {}; + } + + for ( var i = 0, l = style.group.length; i < l; i++ ) { + group = style.group[ i ]; + if ( !styleGroups[ widgetName ][ group ] ) { + styleGroups[ widgetName ][ group ] = []; + } + + styleGroups[ widgetName ][ group ].push( style ); + } + } + + } )(); + + // + // EXPOSE PUBLIC API ------------------------------------------------------ + // + + CKEDITOR.plugins.widget = Widget; + Widget.repository = Repository; + Widget.nestedEditable = NestedEditable; +} )(); + +/** + * An event fired when a widget definition is registered by the {@link CKEDITOR.plugins.widget.repository#add} method. + * It is possible to modify the definition being registered. + * + * @event widgetDefinition + * @member CKEDITOR.editor + * @param {CKEDITOR.plugins.widget.definition} data Widget definition. + */ + +/** + * This is an abstract class that describes the definition of a widget. + * It is a type of {@link CKEDITOR.plugins.widget.repository#add} method's second argument. + * + * Widget instances inherit from registered widget definitions, although not in a prototypal way. + * They are simply extended with corresponding widget definitions. Note that not all properties of + * the widget definition become properties of a widget. Some, like {@link #data} or {@link #edit}, become + * widget's events listeners. + * + * @class CKEDITOR.plugins.widget.definition + * @abstract + * @mixins CKEDITOR.feature + */ + +/** + * Widget definition name. It is automatically set when the definition is + * {@link CKEDITOR.plugins.widget.repository#add registered}. + * + * @property {String} name + */ + +/** + * The method executed while initializing a widget, after a widget instance + * is created, but before it is ready. It is executed before the first + * {@link CKEDITOR.plugins.widget#event-data} is fired so it is common to + * use the `init` method to populate widget data with information loaded from + * the DOM, like for exmaple: + * + * init: function() { + * this.setData( 'width', this.element.getStyle( 'width' ) ); + * + * if ( this.parts.caption.getStyle( 'display' ) != 'none' ) + * this.setData( 'showCaption', true ); + * } + * + * @property {Function} init + */ + +/** + * The function to be used to upcast an element to this widget or a + * comma-separated list of upcast methods from the {@link #upcasts} object. + * + * The upcast function **is not** executed in the widget context (because the widget + * does not exist yet) and two arguments are passed: + * + * * `element` ({@link CKEDITOR.htmlParser.element}) – The element to be checked. + * * `data` (`Object`) – The object which can be extended with data which will then be passed to the widget. + * + * An element will be upcasted if a function returned `true` or an instance of + * a {@link CKEDITOR.htmlParser.element} if upcasting meant DOM structure changes + * (in this case the widget will be initialized on the returned element). + * + * @property {String/Function} upcast + */ + +/** + * The object containing functions which can be used to upcast this widget. + * Only those pointed by the {@link #upcast} property will be used. + * + * In most cases it is appropriate to use {@link #upcast} directly, + * because majority of widgets need just one method. + * However, in some cases the widget author may want to expose more than one variant + * and then this property may be used. + * + * upcasts: { + * // This function may upcast only figure elements. + * figure: function() { + * // ... + * }, + * // This function may upcast only image elements. + * image: function() { + * // ... + * }, + * // More variants... + * } + * + * // Then, widget user may choose which upcast methods will be enabled. + * editor.on( 'widgetDefinition', function( evt ) { + * if ( evt.data.name == 'image' ) + * evt.data.upcast = 'figure,image'; // Use both methods. + * } ); + * + * @property {Object} upcasts + */ + +/** + * The {@link #upcast} method(s) priority. The upcast with a lower priority number will be called before + * the one with a higher number. The default priority is `10`. + * + * @since 4.5 + * @property {Number} [upcastPriority=10] + */ + +/** + * The function to be used to downcast this widget or + * a name of the downcast option from the {@link #downcasts} object. + * + * The downcast funciton will be executed in the {@link CKEDITOR.plugins.widget} context + * and with `widgetElement` ({@link CKEDITOR.htmlParser.element}) argument which is + * the widget's main element. + * + * The function may return an instance of the {@link CKEDITOR.htmlParser.node} class if the widget + * needs to be downcasted to a different node than the widget's main element. + * + * @property {String/Function} downcast + */ + +/** + * The object containing functions which can be used to downcast this widget. + * Only the one pointed by the {@link #downcast} property will be used. + * + * In most cases it is appropriate to use {@link #downcast} directly, + * because majority of widgets have just one variant of downcasting (or none at all). + * However, in some cases the widget author may want to expose more than one variant + * and then this property may be used. + * + * downcasts: { + * // This downcast may transform the widget into the figure element. + * figure: function() { + * // ... + * }, + * // This downcast may transform the widget into the image element with data-* attributes. + * image: function() { + * // ... + * } + * } + * + * // Then, the widget user may choose one of the downcast options when setting up his editor. + * editor.on( 'widgetDefinition', function( evt ) { + * if ( evt.data.name == 'image' ) + * evt.data.downcast = 'figure'; + * } ); + * + * @property downcasts + */ + +/** + * If set, it will be added as the {@link CKEDITOR.plugins.widget#event-edit} event listener. + * This means that it will be executed when a widget is being edited. + * See the {@link CKEDITOR.plugins.widget#method-edit} method. + * + * @property {Function} edit + */ + +/** + * If set, it will be added as the {@link CKEDITOR.plugins.widget#event-data} event listener. + * This means that it will be executed every time the {@link CKEDITOR.plugins.widget#property-data widget data} changes. + * + * @property {Function} data + */ + +/** + * The method to be executed when the widget's command is executed in order to insert a new widget + * (widget of this type is not focused). If not defined, then the default action will be + * performed which means that: + * + * * An instance of the widget will be created in a detached {@link CKEDITOR.dom.documentFragment document fragment}, + * * The {@link CKEDITOR.plugins.widget#method-edit} method will be called to trigger widget editing, + * * The widget element will be inserted into DOM. + * + * @property {Function} insert + */ + +/** + * The name of a dialog window which will be opened on {@link CKEDITOR.plugins.widget#method-edit}. + * If not defined, then the {@link CKEDITOR.plugins.widget#method-edit} method will not perform any action and + * widget's command will insert a new widget without opening a dialog window first. + * + * @property {String} dialog + */ + +/** + * The template which will be used to create a new widget element (when the widget's command is executed). + * This string is populated with {@link #defaults default values} by using the {@link CKEDITOR.template} format. + * Therefore it has to be a valid {@link CKEDITOR.template} argument. + * + * @property {String} template + */ + +/** + * The data object which will be used to populate the data of a newly created widget. + * See {@link CKEDITOR.plugins.widget#property-data}. + * + * defaults: { + * showCaption: true, + * align: 'none' + * } + * + * @property defaults + */ + +/** + * An object containing definitions of widget components (part name => CSS selector). + * + * parts: { + * image: 'img', + * caption: 'div.caption' + * } + * + * @property parts + */ + +/** + * An object containing definitions of nested editables (editable name => {@link CKEDITOR.plugins.widget.nestedEditable.definition}). + * Note that editables *have to* be defined in the same order as they are in DOM / {@link CKEDITOR.plugins.widget.definition#template template}. + * Otherwise errors will occur when nesting widgets inside each other. + * + * editables: { + * header: 'h1', + * content: { + * selector: 'div.content', + * allowedContent: 'p strong em; a[!href]' + * } + * } + * + * @property editables + */ + +/** + * The function used to obtain an accessibility label for the widget. It might be used to make + * the widget labels as precise as possible, since it has access to the widget instance. + * + * If not specified, the default implementation will use the {@link #pathName} or the main + * {@link CKEDITOR.plugins.widget#element element} tag name. + * + * @property {Function} getLabel + */ + +/** + * The widget name displayed in the elements path. + * + * @property {String} pathName + */ + +/** + * If set to `true`, the widget's element will be covered with a transparent mask. + * This will prevent its content from being clickable, which matters in case + * of special elements like embedded Flash or iframes that generate a separate "context". + * + * @property {Boolean} mask + */ + +/** + * If set to `true/false`, it will force the widget to be either an inline or a block widget. + * If not set, the widget type will be determined from the widget element. + * + * Widget type influences whether a block (`div`) or an inline (`span`) element is used + * for the wrapper. + * + * @property {Boolean} inline + */ + +/** + * The label for the widget toolbar button. + * + * editor.widgets.add( 'simplebox', { + * button: 'Create a simple box' + * } ); + * + * editor.widgets.add( 'simplebox', { + * button: editor.lang.simplebox.title + * } ); + * + * @property {String} button + */ + +/** + * Whether widget should be draggable. Defaults to `true`. + * If set to `false` drag handler will not be displayed when hovering widget. + * + * @property {Boolean} draggable + */ + +/** + * Names of element(s) (separated by spaces) for which the {@link CKEDITOR.filter} should allow classes + * defined in the widget styles. For example if your widget is upcasted from a simple `
    ` + * element, then in order to make it styleable you can set: + * + * editor.widgets.add( 'customWidget', { + * upcast: function( element ) { + * return element.name == 'div'; + * }, + * + * // ... + * + * styleableElements: 'div' + * } ); + * + * Then, when the following style is defined: + * + * { + * name: 'Thick border', type: 'widget', widget: 'customWidget', + * attributes: { 'class': 'thickBorder' } + * } + * + * a rule allowing the `thickBorder` class for `div` elements will be registered in the {@link CKEDITOR.filter}. + * + * If you need to have more freedom when transforming widget style to allowed content rules, + * you can use the {@link #styleToAllowedContentRules} callback. + * + * @since 4.4 + * @property {String} styleableElements + */ + +/** + * Function transforming custom widget's {@link CKEDITOR.style} instance into + * {@link CKEDITOR.filter.allowedContentRules}. It may be used when a static + * {@link #styleableElements} property is not enough to inform the {@link CKEDITOR.filter} + * what HTML features should be enabled when allowing the given style. + * + * In most cases, when style's classes just have to be added to element name(s) used by + * the widget element, it is recommended to use simpler {@link #styleableElements} property. + * + * In order to get parsed classes from the style definition you can use + * {@link CKEDITOR.style.customHandlers.widget#getClassesArray}. + * + * For example, if you want to use the [object format of allowed content rules](#!/guide/dev_allowed_content_rules-section-object-format), + * to specify `match` validator, your implementation could look like this: + * + * editor.widgets.add( 'customWidget', { + * // ... + * + * styleToAllowedContentRules: funciton( style ) { + * // Retrieve classes defined in the style. + * var classes = style.getClassesArray(); + * + * // Do something crazy - for example return allowed content rules in object format, + * // with custom match property and propertiesOnly flag. + * return { + * h1: { + * match: isWidgetElement, + * propertiesOnly: true, + * classes: classes + * } + * }; + * } + * } ); + * + * @since 4.4 + * @property {Function} styleToAllowedContentRules + * @param {CKEDITOR.style.customHandlers.widget} style The style to be transformed. + * @returns {CKEDITOR.filter.allowedContentRules} + */ + +/** + * This is an abstract class that describes the definition of a widget's nested editable. + * It is a type of values in the {@link CKEDITOR.plugins.widget.definition#editables} object. + * + * In the simplest case the definition is a string which is a CSS selector used to + * find an element that will become a nested editable inside the widget. Note that + * the widget element can be a nested editable, too. + * + * In the more advanced case a definition is an object with a required `selector` property. + * + * editables: { + * header: 'h1', + * content: { + * selector: 'div.content', + * allowedContent: 'p strong em; a[!href]' + * } + * } + * + * @class CKEDITOR.plugins.widget.nestedEditable.definition + * @abstract + */ + +/** + * The CSS selector used to find an element which will become a nested editable. + * + * @property {String} selector + */ + +/** + * The [Advanced Content Filter](#!/guide/dev_advanced_content_filter) rules + * which will be used to limit the content allowed in this nested editable. + * This option is similar to {@link CKEDITOR.config#allowedContent} and one can + * use it to limit the editor features available in the nested editable. + * + * If no `allowedContent` is specified, the editable will use the editor default + * {@link CKEDITOR.editor#filter}. + * + * @property {CKEDITOR.filter.allowedContentRules} allowedContent + */ + +/** + * The [Advanced Content Filter](#!/guide/dev_advanced_content_filter) rules + * which will be used to blacklist elements within this nested editable. + * This option is similar to {@link CKEDITOR.config#disallowedContent}. + * + * Note that `disallowedContent` work on top of the definition's {@link #allowedContent}. + * + * @since 4.7.3 + * @property {CKEDITOR.filter.disallowedContentRules} disallowedContent + */ + +/** + * Nested editable name displayed in the elements path. + * + * @property {String} pathName + */ diff --git a/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widgetselection/plugin.js b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widgetselection/plugin.js new file mode 100644 index 0000000..e21ea88 --- /dev/null +++ b/plugins/redmine_ckeditor/assets/ckeditor-contrib/plugins/widgetselection/plugin.js @@ -0,0 +1,366 @@ +/** + * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @fileOverview A plugin created to handle ticket http://dev.ckeditor.com/ticket/11064. While the issue is caused by native WebKit/Blink behaviour, + * this plugin can be easily detached or modified when the issue is fixed in the browsers without changing the core. + * When Ctrl/Cmd + A is pressed to select all content it does not work due to a bug in + * Webkit/Blink if a non-editable element is at the beginning or the end of the content. + */ + +( function() { + 'use strict'; + + CKEDITOR.plugins.add( 'widgetselection', { + + init: function( editor ) { + if ( CKEDITOR.env.webkit ) { + var widgetselection = CKEDITOR.plugins.widgetselection; + + editor.on( 'contentDom', function( evt ) { + + var editor = evt.editor, + doc = editor.document, + editable = editor.editable(); + + editable.attachListener( doc, 'keydown', function( evt ) { + var data = evt.data.$; + + // Ctrl/Cmd + A + if ( evt.data.getKey() == 65 && ( CKEDITOR.env.mac && data.metaKey || !CKEDITOR.env.mac && data.ctrlKey ) ) { + + // Defer the call so the selection is already changed by the pressed keys. + CKEDITOR.tools.setTimeout( function() { + + // Manage filler elements on keydown. If there is no need + // to add fillers, we need to check and clean previously used once. + if ( !widgetselection.addFillers( editable ) ) { + widgetselection.removeFillers( editable ); + } + }, 0 ); + } + }, null, null, -1 ); + + // Check and clean previously used fillers. + editor.on( 'selectionCheck', function( evt ) { + widgetselection.removeFillers( evt.editor.editable() ); + } ); + + // Remove fillers on paste before data gets inserted into editor. + editor.on( 'paste', function( evt ) { + evt.data.dataValue = widgetselection.cleanPasteData( evt.data.dataValue ); + } ); + + if ( 'selectall' in editor.plugins ) { + widgetselection.addSelectAllIntegration( editor ); + } + } ); + } + } + } ); + + /** + * A set of helper methods for the Widget Selection plugin. + * + * @property widgetselection + * @member CKEDITOR.plugins + * @since 4.6.1 + */ + CKEDITOR.plugins.widgetselection = { + + /** + * The start filler element reference. + * + * @property {CKEDITOR.dom.element} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + startFiller: null, + + /** + * The end filler element reference. + * + * @property {CKEDITOR.dom.element} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + endFiller: null, + + /** + * An attribute which identifies the filler element. + * + * @property {String} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + fillerAttribute: 'data-cke-filler-webkit', + + /** + * The default content of the filler element. Note: The filler needs to have `visible` content. + * Unprintable elements or empty content do not help as a workaround. + * + * @property {String} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + fillerContent: ' ', + + /** + * Tag name which is used to create fillers. + * + * @property {String} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + fillerTagName: 'div', + + /** + * Adds a filler before or after a non-editable element at the beginning or the end of the `editable`. + * + * @param {CKEDITOR.editable} editable + * @returns {Boolean} + * @member CKEDITOR.plugins.widgetselection + */ + addFillers: function( editable ) { + var editor = editable.editor; + + // Whole content should be selected, if not fix the selection manually. + if ( !this.isWholeContentSelected( editable ) && editable.getChildCount() > 0 ) { + + var firstChild = editable.getFirst( filterTempElements ), + lastChild = editable.getLast( filterTempElements ); + + // Check if first element is editable. If not prepend with filler. + if ( firstChild && firstChild.type == CKEDITOR.NODE_ELEMENT && !firstChild.isEditable() ) { + this.startFiller = this.createFiller(); + editable.append( this.startFiller, 1 ); + } + + // Check if last element is editable. If not append filler. + if ( lastChild && lastChild.type == CKEDITOR.NODE_ELEMENT && !lastChild.isEditable() ) { + this.endFiller = this.createFiller( true ); + editable.append( this.endFiller, 0 ); + } + + // Reselect whole content after any filler was added. + if ( this.hasFiller( editable ) ) { + var rangeAll = editor.createRange(); + rangeAll.selectNodeContents( editable ); + rangeAll.select(); + return true; + } + } + return false; + }, + + /** + * Removes filler elements or updates their references. + * + * It will **not remove** filler elements if the whole content is selected, as it would break the + * selection. + * + * @param {CKEDITOR.editable} editable + * @member CKEDITOR.plugins.widgetselection + */ + removeFillers: function( editable ) { + // If startFiller or endFiller exists and not entire content is selected it means the selection + // just changed from selected all. We need to remove fillers and set proper selection/content. + if ( this.hasFiller( editable ) && !this.isWholeContentSelected( editable ) ) { + + var startFillerContent = editable.findOne( this.fillerTagName + '[' + this.fillerAttribute + '=start]' ), + endFillerContent = editable.findOne( this.fillerTagName + '[' + this.fillerAttribute + '=end]' ); + + if ( this.startFiller && startFillerContent && this.startFiller.equals( startFillerContent ) ) { + this.removeFiller( this.startFiller, editable ); + } else { + // The start filler is still present but it is a different element than previous one. It means the + // undo recreating entirely selected content was performed. We need to update filler reference. + this.startFiller = startFillerContent; + } + + if ( this.endFiller && endFillerContent && this.endFiller.equals( endFillerContent ) ) { + this.removeFiller( this.endFiller, editable ); + } else { + // Same as with start filler. + this.endFiller = endFillerContent; + } + } + }, + + /** + * Removes fillers from the paste data. + * + * @param {String} data + * @returns {String} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + cleanPasteData: function( data ) { + if ( data && data.length ) { + data = data + .replace( this.createFillerRegex(), '' ) + .replace( this.createFillerRegex( true ), '' ); + } + return data; + }, + + /** + * Checks if the entire content of the given editable is selected. + * + * @param {CKEDITOR.editable} editable + * @returns {Boolean} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + isWholeContentSelected: function( editable ) { + + var range = editable.editor.getSelection().getRanges()[ 0 ]; + if ( range ) { + + if ( range && range.collapsed ) { + return false; + + } else { + var rangeClone = range.clone(); + rangeClone.enlarge( CKEDITOR.ENLARGE_ELEMENT ); + + return !!( rangeClone && editable && rangeClone.startContainer && rangeClone.endContainer && + rangeClone.startOffset === 0 && rangeClone.endOffset === editable.getChildCount() && + rangeClone.startContainer.equals( editable ) && rangeClone.endContainer.equals( editable ) ); + } + } + return false; + }, + + /** + * Checks if there is any filler element in the given editable. + * + * @param {CKEDITOR.editable} editable + * @returns {Boolean} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + hasFiller: function( editable ) { + return editable.find( this.fillerTagName + '[' + this.fillerAttribute + ']' ).count() > 0; + }, + + /** + * Creates a filler element. + * + * @param {Boolean} [onEnd] If filler will be placed on end or beginning of the content. + * @returns {CKEDITOR.dom.element} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + createFiller: function( onEnd ) { + var filler = new CKEDITOR.dom.element( this.fillerTagName ); + filler.setHtml( this.fillerContent ); + filler.setAttribute( this.fillerAttribute, onEnd ? 'end' : 'start' ); + filler.setAttribute( 'data-cke-temp', 1 ); + filler.setStyles( { + display: 'block', + width: 0, + height: 0, + padding: 0, + border: 0, + margin: 0, + position: 'absolute', + top: 0, + left: '-9999px', + opacity: 0, + overflow: 'hidden' + } ); + + return filler; + }, + + /** + * Removes the specific filler element from the given editable. If the filler contains any content (typed or pasted), + * it replaces the current editable content. If not, the caret is placed before the first or after the last editable + * element (depends if the filler was at the beginning or the end). + * + * @param {CKEDITOR.dom.element} filler + * @param {CKEDITOR.editable} editable + * @member CKEDITOR.plugins.widgetselection + * @private + */ + removeFiller: function( filler, editable ) { + if ( filler ) { + var editor = editable.editor, + currentRange = editable.editor.getSelection().getRanges()[ 0 ], + currentPath = currentRange.startPath(), + range = editor.createRange(), + insertedHtml, + fillerOnStart, + manuallyHandleCaret; + + if ( currentPath.contains( filler ) ) { + insertedHtml = filler.getHtml(); + manuallyHandleCaret = true; + } + + fillerOnStart = filler.getAttribute( this.fillerAttribute ) == 'start'; + filler.remove(); + filler = null; + + if ( insertedHtml && insertedHtml.length > 0 && insertedHtml != this.fillerContent ) { + editable.insertHtmlIntoRange( insertedHtml, editor.getSelection().getRanges()[ 0 ] ); + range.setStartAt( editable.getChild( editable.getChildCount() - 1 ), CKEDITOR.POSITION_BEFORE_END ); + editor.getSelection().selectRanges( [ range ] ); + + } else if ( manuallyHandleCaret ) { + if ( fillerOnStart ) { + range.setStartAt( editable.getFirst().getNext(), CKEDITOR.POSITION_AFTER_START ); + } else { + range.setEndAt( editable.getLast().getPrevious(), CKEDITOR.POSITION_BEFORE_END ); + } + editable.editor.getSelection().selectRanges( [ range ] ); + } + } + }, + + /** + * Creates a regular expression which will match the filler HTML in the text. + * + * @param {Boolean} [onEnd] Whether a regular expression should be created for the filler at the beginning or + * the end of the content. + * @returns {RegExp} + * @member CKEDITOR.plugins.widgetselection + * @private + */ + createFillerRegex: function( onEnd ) { + var matcher = this.createFiller( onEnd ).getOuterHtml() + .replace( /style="[^"]*"/gi, 'style="[^"]*"' ) + .replace( />[^<]*[^<]*<' ); + + return new RegExp( ( !onEnd ? '^' : '' ) + matcher + ( onEnd ? '$' : '' ) ); + }, + + /** + * Adds an integration for the [Select All](http://ckeditor.com/addon/selectall) plugin to the given `editor`. + * + * @private + * @param {CKEDITOR.editor} editor + * @member CKEDITOR.plugins.widgetselection + */ + addSelectAllIntegration: function( editor ) { + var widgetselection = this; + + editor.editable().attachListener( editor, 'beforeCommandExec', function( evt ) { + var editable = editor.editable(); + + if ( evt.data.name == 'selectAll' && editable ) { + widgetselection.addFillers( editable ); + } + }, null, null, 9999 ); + } + }; + + + function filterTempElements( el ) { + return el.getName && !el.hasAttribute( 'data-cke-temp' ); + } + +} )(); diff --git a/plugins/redmine_ckeditor/assets/javascripts/inithighlight.js b/plugins/redmine_ckeditor/assets/javascripts/inithighlight.js new file mode 100644 index 0000000..22cd89c --- /dev/null +++ b/plugins/redmine_ckeditor/assets/javascripts/inithighlight.js @@ -0,0 +1,2 @@ +hljs.initHighlightingOnLoad(); + diff --git a/plugins/redmine_ckeditor/lib/redmine_ckeditor.rb b/plugins/redmine_ckeditor/lib/redmine_ckeditor.rb index 1e7ac08..49b1f55 100644 --- a/plugins/redmine_ckeditor/lib/redmine_ckeditor.rb +++ b/plugins/redmine_ckeditor/lib/redmine_ckeditor.rb @@ -138,6 +138,7 @@ module RedmineCkeditor end end +require 'redmine_ckeditor/hooks/views_layouts_hook' require 'redmine_ckeditor/hooks/journal_listener' require 'redmine_ckeditor/pdf_patch' require 'redmine_ckeditor/tempfile_patch' diff --git a/plugins/redmine_ckeditor/lib/redmine_ckeditor/hooks/views_layouts_hook.rb b/plugins/redmine_ckeditor/lib/redmine_ckeditor/hooks/views_layouts_hook.rb new file mode 100644 index 0000000..eef5687 --- /dev/null +++ b/plugins/redmine_ckeditor/lib/redmine_ckeditor/hooks/views_layouts_hook.rb @@ -0,0 +1,11 @@ +module RedmineCkeditor + module Hooks + class ViewsLayoutsHook < Redmine::Hook::ViewListener + def view_layouts_base_html_head(context={}) + return stylesheet_link_tag('/plugin_assets/redmine_ckeditor/ckeditor-contrib/plugins/codesnippet/lib/highlight/styles/default.css', :media => 'all') + + javascript_include_tag('/plugin_assets/redmine_ckeditor/ckeditor-contrib/plugins/codesnippet/lib/highlight/highlight.pack.js') + + javascript_include_tag('inithighlight', :plugin => 'redmine_ckeditor') + end + end + end +end