12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- CKEDITOR.dialog.add( 'setingDialog', function( editor ) {
- return {
- title: 'Âñòàâêà Íàñòðîåê',
- minWidth: 400,
- minHeight: 200,
- contents: [
- {
- id: 'tab-basic',
- label: 'Áàçîâûå',
- elements: [
- {
- type: 'select',
- id: 'window',
- label: 'Ðàñòÿíóòü áëîê íà âñþ øèðèíó?',
- items: [
- [ 'íåò', '' ],
- [ 'Äà', '100' ],
- [ 'Íà âåñü ýêðàí', 'full' ]
- ],
- 'default': '',
- setup: function( element ) {
- console.log(element.getAttribute( "windows" ));
- this.setValue( element.getAttribute( "windows" ) );
- },
- commit: function( element ) {
- element.setAttribute( "windows", this.getValue() );
- }
- }
- ]
- },
- ],
- onShow: function() {
- var selection = editor.getSelection();
- // var element = selection.getStartElement();
- // console.log(selection);
- var element = selection.document.getById( 'widgetseting' );
- console.log(element);
- if ( !element || element.getAttribute('id') != 'widgetseting' ) {
- element = editor.document.createElement( 'div' );
- console.log('new');
- this.insertMode = true;
- }
- else
- this.insertMode = false;
- this.element = element;
- // console.log(element);
- // console.log(this);
- if ( !this.insertMode )
- this.setupContent( this.element );
- },
- onOk: function() {
- var dialog = this;
- var selection = editor.getSelection();
- var element = selection.document.getById( 'widgetseting' );
- if( !element ){
- var seting = editor.document.createElement( 'div' );
- }else{
- var seting = element;
- }
- seting.setAttribute('id', 'widgetseting');
- seting.setAttribute( 'windows', dialog.getValueOf('tab-basic', 'window') );
- // seting.data( 'setings' );
- editor.insertElement( seting );
- }
- };
- });
|