mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 04:30:08 +02:00
Added an "twig" lines mode, where the label lines are processed via a sandboxed twig.
This commit is contained in:
parent
c2db827c9d
commit
11225eb9cc
11 changed files with 548 additions and 7 deletions
52
public/ckeditor/plugins/showprotected/dialogs/protected.js
Normal file
52
public/ckeditor/plugins/showprotected/dialogs/protected.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
|
||||
CKEDITOR.dialog.add( 'showProtectedDialog', function( editor ) {
|
||||
|
||||
return {
|
||||
title: 'Edit Protected Source',
|
||||
minWidth: 300,
|
||||
minHeight: 60,
|
||||
onOk: function() {
|
||||
var newSourceValue = this.getContentElement( 'info', 'txtProtectedSource' ).getValue();
|
||||
|
||||
var encodedSourceValue = CKEDITOR.plugins.showprotected.encodeProtectedSource( newSourceValue );
|
||||
|
||||
this._.selectedElement.setAttribute('data-cke-realelement', encodedSourceValue);
|
||||
this._.selectedElement.setAttribute('title', newSourceValue);
|
||||
this._.selectedElement.setAttribute('alt', newSourceValue);
|
||||
},
|
||||
|
||||
onHide: function() {
|
||||
delete this._.selectedElement;
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
this._.selectedElement = editor.getSelection().getSelectedElement();
|
||||
|
||||
var decodedSourceValue = CKEDITOR.plugins.showprotected.decodeProtectedSource( this._.selectedElement.getAttribute('data-cke-realelement') );
|
||||
|
||||
this.setValueOf( 'info', 'txtProtectedSource', decodedSourceValue );
|
||||
},
|
||||
contents: [
|
||||
{
|
||||
id: 'info',
|
||||
label: 'Edit Protected Source',
|
||||
accessKey: 'I',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
id: 'txtProtectedSource',
|
||||
label: 'Value',
|
||||
required: true,
|
||||
validate: function() {
|
||||
if ( !this.getValue() ) {
|
||||
alert( 'The value cannot be empty' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
} );
|
Loading…
Add table
Add a link
Reference in a new issue