X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fckeditor_widgets%2Fjs%2Fplugins%2Fwidgetbootstrap%2Fdialogs%2FwidgetbootstrapAlert.js;fp=web%2Fmodules%2Fcontrib%2Fckeditor_widgets%2Fjs%2Fplugins%2Fwidgetbootstrap%2Fdialogs%2FwidgetbootstrapAlert.js;h=223d1c3fd38f5f77f030843151af978294b5be0f;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/ckeditor_widgets/js/plugins/widgetbootstrap/dialogs/widgetbootstrapAlert.js b/web/modules/contrib/ckeditor_widgets/js/plugins/widgetbootstrap/dialogs/widgetbootstrapAlert.js new file mode 100644 index 000000000..223d1c3fd --- /dev/null +++ b/web/modules/contrib/ckeditor_widgets/js/plugins/widgetbootstrap/dialogs/widgetbootstrapAlert.js @@ -0,0 +1,67 @@ +CKEDITOR.dialog.add( 'widgetfoundationAlert', function( editor ) { + var clientHeight = document.documentElement.clientHeight, + alertTypes = CKEDITOR.config.widgetfoundationAlert_alertTypes, + alertTypesSelect = [], + alertName; + + for ( alertName in alertTypes ) { + alertTypesSelect.push( [ alertTypes[ alertName ], alertName ] ); + } + + + // Size adjustments. + /*var size = CKEDITOR.document.getWindow().getViewPaneSize(), + // Make it maximum 800px wide, but still fully visible in the viewport. + width = Math.min( size.width - 70, 800 ), + // Make it use 2/3 of the viewport height. + height = size.height / 1.5; + // Low resolution settings. + if ( clientHeight < 650 ) + height = clientHeight - 220;*/ + + return { + title: 'Edit Alert Type', + minWidth: 200, + minHeight: 100, + contents: [ + { + id: 'info', + elements: [ + { + id: 'type', + type: 'select', + label: 'Alert Type', + items: alertTypesSelect, + required: true, + validate: CKEDITOR.dialog.validate.notEmpty('Alert type required'), + setup: function( widget ) { + this.setValue( widget.data.type != undefined ? widget.data.type : 'alert'); + }, + commit: function( widget ) { + widget.setData( 'type', this.getValue() ); + } + }/*, + { + id: 'alertText', + type: 'textarea', + label: 'Alert Content', + setup: function( widget ) { + this.setValue( widget.data.alertText ); + }, + commit: function( widget ) { + widget.setData( 'alertText', this.getValue() ); + }, + required: true, + validate: CKEDITOR.dialog.validate.notEmpty('Content required'), + inputStyle: 'cursor:auto;' + + 'width:' + width + 'px;' + + 'height:' + height + 'px;' + + 'tab-size:4;' + + 'text-align:left;', + 'class': 'cke_source' + }*/ + ] + } + ] + }; +} ); \ No newline at end of file