|
|
|
@ -12,16 +12,18 @@
|
|
|
|
|
|
|
|
|
|
Drupal.behaviors.bibciteFootnotesReplaceCitations = { |
|
|
|
|
attach: function attach(context, settings) { |
|
|
|
|
|
|
|
|
|
var formats = drupalSettings.editor.formats; |
|
|
|
|
if (formats) { |
|
|
|
|
for (var key in formats) { |
|
|
|
|
var format = drupalSettings.editor.formats[key]; |
|
|
|
|
if (format.editor == "ckeditor") { |
|
|
|
|
format.editorSettings.referenceFootnotes_list = drupalSettings.bibcite_footnotes.references; |
|
|
|
|
alert('got here'); |
|
|
|
|
if (CKEDITOR.instances) { |
|
|
|
|
for (var instance in CKEDITOR.instances) { |
|
|
|
|
var editor = CKEDITOR.instances[instance]; |
|
|
|
|
var config = editor.config; |
|
|
|
|
if (config.hasOwnProperty('referenceFootnotes_list')) { |
|
|
|
|
config.referenceFootnotes_list = drupalSettings.bibcite_footnotes.references; |
|
|
|
|
var name = editor.name; |
|
|
|
|
editor.destroy(); |
|
|
|
|
CKEDITOR.replace(name, config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|