Browse Source

Initial modification of Footnotes module to show citaitons in footnotes choooser.

config_filter
Alexander O'Neill 6 years ago
parent
commit
758b2944d6
  1. 7
      bibcite_footnotes.info.yml
  2. 35
      bibcite_footnotes.module
  3. 59
      js/plugins/reference_footnotes/dialogs/footnotes.js
  4. 11
      js/plugins/reference_footnotes/fakeobjects/lang/af.js
  5. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ar.js
  6. 11
      js/plugins/reference_footnotes/fakeobjects/lang/bg.js
  7. 11
      js/plugins/reference_footnotes/fakeobjects/lang/bn.js
  8. 11
      js/plugins/reference_footnotes/fakeobjects/lang/bs.js
  9. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ca.js
  10. 11
      js/plugins/reference_footnotes/fakeobjects/lang/cs.js
  11. 11
      js/plugins/reference_footnotes/fakeobjects/lang/cy.js
  12. 11
      js/plugins/reference_footnotes/fakeobjects/lang/da.js
  13. 11
      js/plugins/reference_footnotes/fakeobjects/lang/de.js
  14. 11
      js/plugins/reference_footnotes/fakeobjects/lang/el.js
  15. 11
      js/plugins/reference_footnotes/fakeobjects/lang/en-au.js
  16. 11
      js/plugins/reference_footnotes/fakeobjects/lang/en-ca.js
  17. 11
      js/plugins/reference_footnotes/fakeobjects/lang/en-gb.js
  18. 11
      js/plugins/reference_footnotes/fakeobjects/lang/en.js
  19. 11
      js/plugins/reference_footnotes/fakeobjects/lang/eo.js
  20. 11
      js/plugins/reference_footnotes/fakeobjects/lang/es.js
  21. 11
      js/plugins/reference_footnotes/fakeobjects/lang/et.js
  22. 11
      js/plugins/reference_footnotes/fakeobjects/lang/eu.js
  23. 11
      js/plugins/reference_footnotes/fakeobjects/lang/fa.js
  24. 11
      js/plugins/reference_footnotes/fakeobjects/lang/fi.js
  25. 11
      js/plugins/reference_footnotes/fakeobjects/lang/fo.js
  26. 11
      js/plugins/reference_footnotes/fakeobjects/lang/fr-ca.js
  27. 11
      js/plugins/reference_footnotes/fakeobjects/lang/fr.js
  28. 11
      js/plugins/reference_footnotes/fakeobjects/lang/gl.js
  29. 11
      js/plugins/reference_footnotes/fakeobjects/lang/gu.js
  30. 11
      js/plugins/reference_footnotes/fakeobjects/lang/he.js
  31. 11
      js/plugins/reference_footnotes/fakeobjects/lang/hi.js
  32. 11
      js/plugins/reference_footnotes/fakeobjects/lang/hr.js
  33. 11
      js/plugins/reference_footnotes/fakeobjects/lang/hu.js
  34. 11
      js/plugins/reference_footnotes/fakeobjects/lang/id.js
  35. 11
      js/plugins/reference_footnotes/fakeobjects/lang/is.js
  36. 11
      js/plugins/reference_footnotes/fakeobjects/lang/it.js
  37. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ja.js
  38. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ka.js
  39. 11
      js/plugins/reference_footnotes/fakeobjects/lang/km.js
  40. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ko.js
  41. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ku.js
  42. 11
      js/plugins/reference_footnotes/fakeobjects/lang/lt.js
  43. 11
      js/plugins/reference_footnotes/fakeobjects/lang/lv.js
  44. 11
      js/plugins/reference_footnotes/fakeobjects/lang/mk.js
  45. 11
      js/plugins/reference_footnotes/fakeobjects/lang/mn.js
  46. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ms.js
  47. 11
      js/plugins/reference_footnotes/fakeobjects/lang/nb.js
  48. 11
      js/plugins/reference_footnotes/fakeobjects/lang/nl.js
  49. 11
      js/plugins/reference_footnotes/fakeobjects/lang/no.js
  50. 11
      js/plugins/reference_footnotes/fakeobjects/lang/pl.js
  51. 11
      js/plugins/reference_footnotes/fakeobjects/lang/pt-br.js
  52. 11
      js/plugins/reference_footnotes/fakeobjects/lang/pt.js
  53. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ro.js
  54. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ru.js
  55. 11
      js/plugins/reference_footnotes/fakeobjects/lang/si.js
  56. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sk.js
  57. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sl.js
  58. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sq.js
  59. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sr-latn.js
  60. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sr.js
  61. 11
      js/plugins/reference_footnotes/fakeobjects/lang/sv.js
  62. 11
      js/plugins/reference_footnotes/fakeobjects/lang/th.js
  63. 11
      js/plugins/reference_footnotes/fakeobjects/lang/tr.js
  64. 11
      js/plugins/reference_footnotes/fakeobjects/lang/tt.js
  65. 11
      js/plugins/reference_footnotes/fakeobjects/lang/ug.js
  66. 11
      js/plugins/reference_footnotes/fakeobjects/lang/uk.js
  67. 11
      js/plugins/reference_footnotes/fakeobjects/lang/vi.js
  68. 11
      js/plugins/reference_footnotes/fakeobjects/lang/zh-cn.js
  69. 11
      js/plugins/reference_footnotes/fakeobjects/lang/zh.js
  70. 183
      js/plugins/reference_footnotes/fakeobjects/plugin.js
  71. BIN
      js/plugins/reference_footnotes/icons/reference_footnotes.png
  72. BIN
      js/plugins/reference_footnotes/images/bgcolor.png
  73. BIN
      js/plugins/reference_footnotes/images/fn.png
  74. BIN
      js/plugins/reference_footnotes/images/fn_icon.png
  75. BIN
      js/plugins/reference_footnotes/images/fn_icon2.png
  76. BIN
      js/plugins/reference_footnotes/images/footnotes.png
  77. BIN
      js/plugins/reference_footnotes/images/hidpi/bgcolor.png
  78. BIN
      js/plugins/reference_footnotes/images/hidpi/textcolor.png
  79. BIN
      js/plugins/reference_footnotes/images/icon.png
  80. BIN
      js/plugins/reference_footnotes/images/note_add.png
  81. BIN
      js/plugins/reference_footnotes/images/textcolor.png
  82. 109
      js/plugins/reference_footnotes/plugin.js
  83. 65
      src/Plugin/CKEditorPlugin/FakeObjects.php
  84. 97
      src/Plugin/CKEditorPlugin/ReferenceFootnotes.php

7
bibcite_footnotes.info.yml

@ -0,0 +1,7 @@
name: 'BibCite Footnotes'
type: module
description: 'Inline footnote links for BibCite References'
core: 8.x
package: 'Bibcite'
dependencies:
- bibcite

35
bibcite_footnotes.module

@ -0,0 +1,35 @@
<?php
/**
* @file
* Contains bibcite_footnotes.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function bibcite_footnotes_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the bibcite_footnotes module.
case 'help.page.bibcite_footnotes':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Inline footnote links for BibCite References') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function bibcite_footnotes_theme() {
return [
'bibcite_footnotes' => [
'render element' => 'children',
],
];
}

59
js/plugins/reference_footnotes/dialogs/footnotes.js

@ -0,0 +1,59 @@
(function() {
function referenceFootnotesDialog( editor, isEdit ) {
return {
title : Drupal.t('Reference Footnotes Dialog'),
minWidth : 500,
minHeight : 50,
contents : [
{
id: 'info',
label: Drupal.t('Add a reference footnote'),
title: Drupal.t('Add a reference footnote'),
elements:
[
{
id: 'reference_footnote',
type: 'select',
items: editor.config.referenceFootnotes_list,
label: Drupal.t('Reference Footnote item:'),
setup: function (element) {
if (isEdit)
this.setValue(element.getText());
}
},
{
id: 'value',
type: 'text',
label: Drupal.t('Value :'),
labelLayout: 'horizontal',
style: 'float:left;width:100px;',
setup: function (element) {
if (isEdit)
this.setValue(element.getAttribute('value'));
}
}
],
}
],
onShow : function() {
if (isEdit) {
this.fakeObj = CKEDITOR.plugins.reference_footnotes.getSelectedFootnote( editor );
this.realObj = editor.restoreRealElement( this.fakeObj );
}
this.setupContent( this.realObj );
},
onOk : function() {
CKEDITOR.plugins.reference_footnotes.createFootnote( editor, this.realObj, this.getValueOf('info', 'reference_footnote'), this.getValueOf('info', 'value'));
delete this.fakeObj;
delete this.realObj;
}
}
}
CKEDITOR.dialog.add( 'createfootnotes', function( editor ) {
return referenceFootnotesDialog( editor );
});
CKEDITOR.dialog.add( 'editfootnotes', function( editor ) {
return referenceFootnotesDialog( editor, 1 );
});
})();

11
js/plugins/reference_footnotes/fakeobjects/lang/af.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'af', {
anchor: 'Anker',
flash: 'Flash animasie',
hiddenfield: 'Verborge veld',
iframe: 'IFrame',
unknown: 'Onbekende objek'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ar.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ar', {
anchor: 'إرساء',
flash: 'رسم متحرك بالفلاش',
hiddenfield: 'إدراج حقل خفي',
iframe: 'iframe',
unknown: 'عنصر غير معروف'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/bg.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'bg', {
anchor: 'Кука',
flash: 'Флаш анимация',
hiddenfield: 'Скрито поле',
iframe: 'IFrame',
unknown: 'Неизвестен обект'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/bn.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'bn', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/bs.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'bs', {
anchor: 'Anchor',
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ca.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ca', {
anchor: 'Àncora',
flash: 'Animació Flash',
hiddenfield: 'Camp ocult',
iframe: 'IFrame',
unknown: 'Objecte desconegut'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/cs.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'cs', {
anchor: 'Záložka',
flash: 'Flash animace',
hiddenfield: 'Skryté pole',
iframe: 'IFrame',
unknown: 'Neznámý objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/cy.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'cy', {
anchor: 'Angor',
flash: 'Animeiddiant Flash',
hiddenfield: 'Maes Cudd',
iframe: 'IFrame',
unknown: 'Gwrthrych Anhysbys'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/da.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'da', {
anchor: 'Anker',
flash: 'Flashanimation',
hiddenfield: 'Skjult felt',
iframe: 'Iframe',
unknown: 'Ukendt objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/de.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'de', {
anchor: 'Anker',
flash: 'Flash-Animation',
hiddenfield: 'Verstecktes Feld',
iframe: 'IFrame',
unknown: 'Unbekanntes Objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/el.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'el', {
anchor: 'Άγκυρα',
flash: 'Ταινία Flash',
hiddenfield: 'Κρυφό Πεδίο',
iframe: 'IFrame',
unknown: 'Άγνωστο Αντικείμενο'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/en-au.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'en-au', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/en-ca.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'en-ca', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/en-gb.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'en-gb', {
anchor: 'Anchor',
flash: 'Flash Animation',
hiddenfield: 'Hidden Field',
iframe: 'IFrame',
unknown: 'Unknown Object'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/en.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'en', {
anchor: 'Anchor',
flash: 'Flash Animation',
hiddenfield: 'Hidden Field',
iframe: 'IFrame',
unknown: 'Unknown Object'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/eo.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'eo', {
anchor: 'Ankro',
flash: 'FlaŝAnimacio',
hiddenfield: 'Kaŝita kampo',
iframe: 'Enlinia Kadro (IFrame)',
unknown: 'Nekonata objekto'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/es.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'es', {
anchor: 'Ancla',
flash: 'Animación flash',
hiddenfield: 'Campo oculto',
iframe: 'IFrame',
unknown: 'Objeto desconocido'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/et.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'et', {
anchor: 'Ankur',
flash: 'Flashi animatsioon',
hiddenfield: 'Varjatud väli',
iframe: 'IFrame',
unknown: 'Tundmatu objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/eu.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'eu', {
anchor: 'Aingura',
flash: 'Flash animazioa',
hiddenfield: 'Ezkutuko eremua',
iframe: 'IFrame-a',
unknown: 'Objektu ezezaguna'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/fa.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fa', {
anchor: 'لنگر',
flash: 'انیمشن فلش',
hiddenfield: 'فیلد پنهان',
iframe: 'IFrame',
unknown: 'شیء ناشناخته'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/fi.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fi', {
anchor: 'Ankkuri',
flash: 'Flash animaatio',
hiddenfield: 'Piilokenttä',
iframe: 'IFrame-kehys',
unknown: 'Tuntematon objekti'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/fo.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fo', {
anchor: 'Anchor',
flash: 'Flash Animation',
hiddenfield: 'Fjaldur teigur',
iframe: 'IFrame',
unknown: 'Ókent Object'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/fr-ca.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fr-ca', {
anchor: 'Ancre',
flash: 'Animation Flash',
hiddenfield: 'Champ caché',
iframe: 'IFrame',
unknown: 'Objet inconnu'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/fr.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'fr', {
anchor: 'Ancre',
flash: 'Animation Flash',
hiddenfield: 'Champ caché',
iframe: 'IFrame',
unknown: 'Objet inconnu'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/gl.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'gl', {
anchor: 'Ancoraxe',
flash: 'Animación «Flash»',
hiddenfield: 'Campo agochado',
iframe: 'IFrame',
unknown: 'Obxecto descoñecido'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/gu.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'gu', {
anchor: 'અનકર',
flash: 'ફશ ',
hiddenfield: 'હિડન ',
iframe: 'IFrame',
unknown: 'અનનન ઓબટ'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/he.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'he', {
anchor: 'עוגן',
flash: 'סרטון פלאש',
hiddenfield: 'שדה חבוי',
iframe: 'חלון פנימי (iframe)',
unknown: 'אובייקט לא ידוע'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/hi.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'hi', {
anchor: 'ऐकर इनसरट/सदन',
flash: 'Flash Animation', // MISSING
hiddenfield: 'गत फ़ड',
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/hr.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'hr', {
anchor: 'Sidro',
flash: 'Flash animacija',
hiddenfield: 'Sakriveno polje',
iframe: 'IFrame',
unknown: 'Nepoznati objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/hu.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'hu', {
anchor: 'Horgony',
flash: 'Flash animáció',
hiddenfield: 'Rejtett mezõ',
iframe: 'IFrame',
unknown: 'Ismeretlen objektum'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/id.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'id', {
anchor: 'Anchor', // MISSING
flash: 'Animasi Flash',
hiddenfield: 'Kolom Tersembunyi',
iframe: 'IFrame',
unknown: 'Obyek Tak Dikenal'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/is.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'is', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/it.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'it', {
anchor: 'Ancora',
flash: 'Animazione Flash',
hiddenfield: 'Campo Nascosto',
iframe: 'IFrame',
unknown: 'Oggetto sconosciuto'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ja.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ja', {
anchor: 'アンカー',
flash: 'Flash Animation',
hiddenfield: '不可視フィールド',
iframe: 'IFrame',
unknown: 'Unknown Object'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ka.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ka', {
anchor: 'ღუზა',
flash: 'Flash ანიმაცია',
hiddenfield: 'მალული ველი',
iframe: 'IFrame',
unknown: 'უცნობი ობიექტი'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/km.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'km', {
anchor: 'យ',
flash: 'Flash មចលន',
hiddenfield: 'វង',
iframe: 'IFrame',
unknown: 'វត'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ko.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ko', {
anchor: '책갈피',
flash: '플래시 애니메이션',
hiddenfield: '숨은 입력 칸',
iframe: '아이프레임',
unknown: '알 수 없는 객체'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ku.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ku', {
anchor: 'لەنگەر',
flash: 'فلاش',
hiddenfield: 'شاردنەوەی خانه',
iframe: 'لەچوارچێوە',
unknown: 'بەرکارێکی نەناسراو'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/lt.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'lt', {
anchor: 'Žymė',
flash: 'Flash animacija',
hiddenfield: 'Paslėptas laukas',
iframe: 'IFrame',
unknown: 'Nežinomas objektas'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/lv.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'lv', {
anchor: 'Iezīme',
flash: 'Flash animācija',
hiddenfield: 'Slēpts lauks',
iframe: 'Iframe',
unknown: 'Nezināms objekts'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/mk.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'mk', {
anchor: 'Anchor',
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/mn.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'mn', {
anchor: 'Зангуу',
flash: 'Flash Animation', // MISSING
hiddenfield: 'Нууц талбар',
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ms.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ms', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/nb.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'nb', {
anchor: 'Anker',
flash: 'Flash-animasjon',
hiddenfield: 'Skjult felt',
iframe: 'IFrame',
unknown: 'Ukjent objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/nl.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'nl', {
anchor: 'Interne link',
flash: 'Flash animatie',
hiddenfield: 'Verborgen veld',
iframe: 'IFrame',
unknown: 'Onbekend object'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/no.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'no', {
anchor: 'Anker',
flash: 'Flash-animasjon',
hiddenfield: 'Skjult felt',
iframe: 'IFrame',
unknown: 'Ukjent objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/pl.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'pl', {
anchor: 'Kotwica',
flash: 'Animacja Flash',
hiddenfield: 'Pole ukryte',
iframe: 'IFrame',
unknown: 'Nieznany obiekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/pt-br.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'pt-br', {
anchor: 'Âncora',
flash: 'Animação em Flash',
hiddenfield: 'Campo Oculto',
iframe: 'IFrame',
unknown: 'Objeto desconhecido'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/pt.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'pt', {
anchor: ' Inserir/Editar Âncora',
flash: 'Animação Flash',
hiddenfield: 'Campo oculto',
iframe: 'IFrame',
unknown: 'Objeto Desconhecido'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ro.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ro', {
anchor: 'Inserează/Editează ancoră',
flash: 'Flash Animation', // MISSING
hiddenfield: 'Câmp ascuns (HiddenField)',
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ru.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ru', {
anchor: 'Якорь',
flash: 'Flash анимация',
hiddenfield: 'Скрытое поле',
iframe: 'iFrame',
unknown: 'Неизвестный объект'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/si.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'si', {
anchor: 'ආධරය',
flash: 'Flash Animation', // MISSING
hiddenfield: 'සඟවරදශය',
iframe: 'IFrame',
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sk.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sk', {
anchor: 'Kotva',
flash: 'Flash animácia',
hiddenfield: 'Skryté pole',
iframe: 'IFrame',
unknown: 'Neznámy objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sl.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sl', {
anchor: 'Sidro',
flash: 'Flash animacija',
hiddenfield: 'Skrito polje',
iframe: 'IFrame',
unknown: 'Neznan objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sq.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sq', {
anchor: 'Spirancë',
flash: 'Objekt flash',
hiddenfield: 'Fushë e fshehur',
iframe: 'IFrame',
unknown: 'Objekt i Panjohur'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sr-latn.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sr-latn', {
anchor: 'Unesi/izmeni sidro',
flash: 'Flash Animation', // MISSING
hiddenfield: 'Skriveno polje',
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sr.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sr', {
anchor: 'Anchor', // MISSING
flash: 'Flash Animation', // MISSING
hiddenfield: 'Hidden Field', // MISSING
iframe: 'IFrame', // MISSING
unknown: 'Unknown Object' // MISSING
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/sv.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'sv', {
anchor: 'Ankare',
flash: 'Flashanimation',
hiddenfield: 'Gömt fält',
iframe: 'iFrame',
unknown: 'Okänt objekt'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/th.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'th', {
anchor: 'แทรก/แกไข Anchor',
flash: 'ภาพอนเมชนแฟลช',
hiddenfield: 'ฮดเดนฟลด',
iframe: 'IFrame',
unknown: 'วตถไมทราบชนด'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/tr.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'tr', {
anchor: 'Bağlantı',
flash: 'Flash Animasyonu',
hiddenfield: 'Gizli Alan',
iframe: 'IFrame',
unknown: 'Bilinmeyen Nesne'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/tt.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'tt', {
anchor: 'Якорь',
flash: 'Флеш анимациясы',
hiddenfield: 'Яшерен кыр',
iframe: 'IFrame',
unknown: 'Танылмаган объект'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/ug.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'ug', {
anchor: 'لەڭگەرلىك نۇقتا',
flash: 'Flash جانلاندۇرۇم',
hiddenfield: 'يوشۇرۇن دائىرە',
iframe: 'IFrame',
unknown: 'يوچۇن نەڭ'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/uk.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'uk', {
anchor: 'Якір',
flash: 'Flash-анімація',
hiddenfield: 'Приховані Поля',
iframe: 'IFrame',
unknown: 'Невідомий об\'єкт'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/vi.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'vi', {
anchor: 'Điểm neo',
flash: 'Flash',
hiddenfield: 'Trường ẩn',
iframe: 'IFrame',
unknown: 'Đối tượng không rõ ràng'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/zh-cn.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'zh-cn', {
anchor: '锚点',
flash: 'Flash 动画',
hiddenfield: '隐藏域',
iframe: 'IFrame',
unknown: '未知对象'
} );

11
js/plugins/reference_footnotes/fakeobjects/lang/zh.js

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'fakeobjects', 'zh', {
anchor: '錨點',
flash: 'Flash 動畫',
hiddenfield: '隱藏欄位',
iframe: 'IFrame',
unknown: '無法辨識的物件'
} );

183
js/plugins/reference_footnotes/fakeobjects/plugin.js

@ -0,0 +1,183 @@
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
( function() {
var cssStyle = CKEDITOR.htmlParser.cssStyle,
cssLength = CKEDITOR.tools.cssLength;
var cssLengthRegex = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i;
// Replacing the former CSS length value with the later one, with
// adjustment to the length unit.
function replaceCssLength( length1, length2 ) {
var parts1 = cssLengthRegex.exec( length1 ),
parts2 = cssLengthRegex.exec( length2 );
// Omit pixel length unit when necessary,
// e.g. replaceCssLength( 10, '20px' ) -> 20
if ( parts1 ) {
if ( !parts1[ 2 ] && parts2[ 2 ] == 'px' )
return parts2[ 1 ];
if ( parts1[ 2 ] == 'px' && !parts2[ 2 ] )
return parts2[ 1 ] + 'px';
}
return length2;
}
var htmlFilterRules = {
elements: {
$: function( element ) {
var attributes = element.attributes,
realHtml = attributes && attributes[ 'data-cke-realelement' ],
realFragment = realHtml && new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( realHtml ) ),
realElement = realFragment && realFragment.children[ 0 ];
// Width/height in the fake object are subjected to clone into the real element.
if ( realElement && element.attributes[ 'data-cke-resizable' ] ) {
var styles = new cssStyle( element ).rules,
realAttrs = realElement.attributes,
width = styles.width,
height = styles.height;
width && ( realAttrs.width = replaceCssLength( realAttrs.width, width ) );
height && ( realAttrs.height = replaceCssLength( realAttrs.height, height ) );
}
return realElement;
}
}
};
CKEDITOR.plugins.add( 'fakeobjects', {
// jscs:disable maximumLineLength
lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,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,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
init: function( editor ) {
// Allow image with all styles and classes plus src, alt and title attributes.
// We need them when fakeobject is pasted.
editor.filter.allow( 'img[!data-cke-realelement,src,alt,title](*){*}', 'fakeobjects' );
},
afterInit: function( editor ) {
var dataProcessor = editor.dataProcessor,
htmlFilter = dataProcessor && dataProcessor.htmlFilter;
if ( htmlFilter ) {
htmlFilter.addRules( htmlFilterRules, {
applyToAll: true
} );
}
}
} );
/**
* @member CKEDITOR.editor
* @todo
*/
CKEDITOR.editor.prototype.createFakeElement = function( realElement, className, realElementType, isResizable ) {
var lang = this.lang.fakeobjects,
label = lang[ realElementType ] || lang.unknown;
var attributes = {
'class': className,
'data-cke-realelement': encodeURIComponent( realElement.getOuterHtml() ),
'data-cke-real-node-type': realElement.type,
alt: label,
title: label,
align: realElement.getAttribute( 'align' ) || ''
};
// Do not set "src" on high-contrast so the alt text is displayed. (#8945)
if ( !CKEDITOR.env.hc )
attributes.src = CKEDITOR.tools.transparentImageData;
if ( realElementType )
attributes[ 'data-cke-real-element-type' ] = realElementType;
if ( isResizable ) {
attributes[ 'data-cke-resizable' ] = isResizable;
var fakeStyle = new cssStyle();
var width = realElement.getAttribute( 'width' ),
height = realElement.getAttribute( 'height' );
width && ( fakeStyle.rules.width = cssLength( width ) );
height && ( fakeStyle.rules.height = cssLength( height ) );
fakeStyle.populate( attributes );
}
return this.document.createElement( 'img', { attributes: attributes } );
};
/**
* @member CKEDITOR.editor
* @todo
*/
CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable ) {
var lang = this.lang.fakeobjects,
label = lang[ realElementType ] || lang.unknown,
html;
var writer = new CKEDITOR.htmlParser.basicWriter();
realElement.writeHtml( writer );
html = writer.getHtml();
var attributes = {
'class': className,
'data-cke-realelement': encodeURIComponent( html ),
'data-cke-real-node-type': realElement.type,
alt: label,
title: label,
align: realElement.attributes.align || ''
};
// Do not set "src" on high-contrast so the alt text is displayed. (#8945)
if ( !CKEDITOR.env.hc )
attributes.src = CKEDITOR.tools.transparentImageData;
if ( realElementType )
attributes[ 'data-cke-real-element-type' ] = realElementType;
if ( isResizable ) {
attributes[ 'data-cke-resizable' ] = isResizable;
var realAttrs = realElement.attributes,
fakeStyle = new cssStyle();
var width = realAttrs.width,
height = realAttrs.height;
width !== undefined && ( fakeStyle.rules.width = cssLength( width ) );
height !== undefined && ( fakeStyle.rules.height = cssLength( height ) );
fakeStyle.populate( attributes );
}
return new CKEDITOR.htmlParser.element( 'img', attributes );
};
/**
* @member CKEDITOR.editor
* @todo
*/
CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement ) {
if ( fakeElement.data( 'cke-real-node-type' ) != CKEDITOR.NODE_ELEMENT )
return null;
var element = CKEDITOR.dom.element.createFromHtml( decodeURIComponent( fakeElement.data( 'cke-realelement' ) ), this.document );
if ( fakeElement.data( 'cke-resizable' ) ) {
var width = fakeElement.getStyle( 'width' ),
height = fakeElement.getStyle( 'height' );
width && element.setAttribute( 'width', replaceCssLength( element.getAttribute( 'width' ), width ) );
height && element.setAttribute( 'height', replaceCssLength( element.getAttribute( 'height' ), height ) );
}
return element;
};
} )();

BIN
js/plugins/reference_footnotes/icons/reference_footnotes.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
js/plugins/reference_footnotes/images/bgcolor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

BIN
js/plugins/reference_footnotes/images/fn.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

BIN
js/plugins/reference_footnotes/images/fn_icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

BIN
js/plugins/reference_footnotes/images/fn_icon2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

BIN
js/plugins/reference_footnotes/images/footnotes.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
js/plugins/reference_footnotes/images/hidpi/bgcolor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
js/plugins/reference_footnotes/images/hidpi/textcolor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
js/plugins/reference_footnotes/images/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
js/plugins/reference_footnotes/images/note_add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
js/plugins/reference_footnotes/images/textcolor.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

109
js/plugins/reference_footnotes/plugin.js

@ -0,0 +1,109 @@
(function() {
CKEDITOR.plugins.add( 'reference_footnotes',
{
requires : [ 'fakeobjects','dialog' ],
icons: 'reference_footnotes',
onLoad: function() {
var icon_path = window.location.origin + this.path + 'images/fn_icon2.png';
CKEDITOR.addCss(
'.cke_footnote' +
'{' +
'background-image: url(' + CKEDITOR.getUrl( icon_path ) + ');' +
'background-position: center center;' +
'background-repeat: no-repeat;' +
'width: 16px;' +
'height: 16px;' +
'}'
);
},
init: function( editor )
{
editor.addCommand('createfootnotes', new CKEDITOR.dialogCommand('createfootnotes', {
allowedContent: 'fn[value]'
}));
editor.addCommand('editfootnotes', new CKEDITOR.dialogCommand('editfootnotes', {
allowedContent: 'fn[value]'
}));
// Drupal Wysiwyg requirement: The first argument to editor.ui.addButton()
// must be equal to the key used in $plugins[<pluginName>]['buttons'][<key>]
// in hook_wysiwyg_plugin().
editor.ui.addButton && editor.ui.addButton( 'reference_footnotes', {
label: Drupal.t('Add a reference footnote'),
command: 'createfootnotes',
icon: 'reference_footnotes'
});
if (editor.addMenuItems) {
editor.addMenuGroup('reference_footnotes', 100);
editor.addMenuItems({
footnotes: {
label: Drupal.t('Edit footnote'),
command: 'editfootnotes',
icon: 'reference_footnotes',
group: 'reference_footnotes'
}
});
}
if (editor.contextMenu) {
editor.contextMenu.addListener( function( element, selection ) {
if ( !element || element.data('cke-real-element-type') != 'fn' )
return null;
return { footnotes: CKEDITOR.TRISTATE_ON };
});
}
editor.on( 'doubleclick', function( evt ) {
if ( CKEDITOR.plugins.footnotes.getSelectedFootnote( editor ) )
evt.data.dialog = 'editfootnotes';
});
CKEDITOR.dialog.add( 'createfootnotes', this.path + 'dialogs/footnotes.js' );
CKEDITOR.dialog.add( 'editfootnotes', this.path + 'dialogs/footnotes.js' );
},
afterInit : function( editor ) {
var dataProcessor = editor.dataProcessor,
dataFilter = dataProcessor && dataProcessor.dataFilter;
if (dataFilter) {
dataFilter.addRules({
elements: {
fn: function(element ) {
return editor.createFakeParserElement( element, 'cke_footnote', 'hiddenfield', false );
}
}
});
}
}
});
})();
CKEDITOR.plugins.reference_footnotes = {
createFootnote: function( editor, origElement, text, value) {
if (!origElement) {
var realElement = CKEDITOR.dom.element.createFromHtml('<fn></fn>');
}
else {
realElement = origElement;
}
if (text && text.length > 0 )
realElement.setText(text);
if (value && value.length > 0 )
realElement.setAttribute('value',value);
var fakeElement = editor.createFakeElement( realElement , 'cke_footnote', 'hiddenfield', false );
editor.insertElement(fakeElement);
},
getSelectedFootnote: function( editor ) {
var selection = editor.getSelection();
var element = selection.getSelectedElement();
var seltype = selection.getType();
if ( seltype == CKEDITOR.SELECTION_ELEMENT && element.data('cke-real-element-type') == 'hiddenfield') {
return element;
}
}
};

65
src/Plugin/CKEditorPlugin/FakeObjects.php

@ -0,0 +1,65 @@
<?php
namespace Drupal\bibcite_footnotes\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginInterface;
use Drupal\ckeditor\CKEditorPluginButtonsInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\editor\Entity\Editor;
/**
* Defines the "FakeObjects" plugin.
*
* This is a dependency to footnotes, the source comes from
* http://ckeditor.com/addon/fakeobjects.
*
* @CKEditorPlugin(
* id = "fakeobjects",
* label = @Translation("FakeObjects")
* )
*/
class FakeObjects extends PluginBase implements CKEditorPluginInterface, CKEditorPluginButtonsInterface {
/**
* Implements CKEditorPluginInterface::getDependencies().
*/
public function getDependencies(Editor $editor) {
return [];
}
/**
* Implements CKEditorPluginInterface::getLibraries().
*/
public function getLibraries(Editor $editor) {
return [];
}
/**
* Implements CKEditorPluginInterface::isInternal().
*/
public function isInternal() {
return FALSE;
}
/**
* Implements CKEditorPluginInterface::getFile().
*/
public function getFile() {
return drupal_get_path('module', 'bibcite_footnotes') . '/js/plugins/reference_footnotes/fakeobjects/plugin.js';
}
/**
* Implements CKEditorPluginButtonsInterface::getButtons().
*/
public function getButtons() {
return [];
}
/**
* Implements \CKEditorPluginInterface::getConfig().
*/
public function getConfig(Editor $editor) {
return [];
}
}

97
src/Plugin/CKEditorPlugin/ReferenceFootnotes.php

@ -0,0 +1,97 @@
<?php
namespace Drupal\bibcite_footnotes\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
/**
* Defines the "reference_footnotes" plugin.
*
* NOTE: The plugin ID ('id' key) corresponds to the CKEditor plugin name.
* It is the first argument of the CKEDITOR.plugins.add() function in the
* plugin.js file.
*
* @CKEditorPlugin(
* id = "reference_footnotes",
* label = @Translation("Reference Footnotes")
* )
*/
class ReferenceFootnotes extends CKEditorPluginBase {
/**
* {@inheritdoc}
*
* NOTE: The keys of the returned array corresponds to the CKEditor button
* names. They are the first argument of the editor.ui.addButton() or
* editor.ui.addRichCombo() functions in the plugin.js file.
*/
public function getButtons() {
// Make sure that the path to the image matches the file structure of
// the CKEditor plugin you are implementing.
return [
'reference_footnotes' => [
'label' => t('Reference Footnotes'),
'image' => drupal_get_path('module', 'bibcite_footnotes') . '/js/plugins/reference_footnotes/images/icon.png',
],
];
}
/**
* {@inheritdoc}
*/
public function getFile() {
// Make sure that the path to the plugin.js matches the file structure of
// the CKEditor plugin you are implementing.
return drupal_get_path('module', 'bibcite_footnotes') . '/js/plugins/reference_footnotes/plugin.js';
}
/**
* {@inheritdoc}
*/
public function isInternal() {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getDependencies(Editor $editor) {
return ['fakeobjects'];
}
/**
* {@inheritdoc}
*/
public function getLibraries(Editor $editor) {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfig(Editor $editor) {
$uid = \Drupal::currentUser()->id();
$query = \Drupal::service('entity.query');
$ref_ids = $query
->get('bibcite_reference')
->condition('uid', $uid)
->execute();
$reference_storage = \Drupal::entityTypeManager()->getStorage('bibcite_reference')->loadMultiple($ref_ids);
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('bibcite_reference');
$options = [];
foreach($reference_storage as $ref_id => $ref_item) {
print_r($ref_id);
$build = $view_builder->view($ref_item, 'citation');
$output = trim(strip_tags(render($build)));
$options[] = [$output, $ref_id];
}
return ['referenceFootnotes_list' => $options];
}
}
Loading…
Cancel
Save