For more information about this repository, visit the project page at https://www.drupal.org/project/bibcite_footnotes
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.5 KiB
59 lines
2.5 KiB
7 years ago
|
(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 );
|
||
|
});
|
||
|
})();
|