Further modules included.
[yaffs-website] / web / modules / contrib / ckeditor_widgets / js / plugins / widgetbootstrap / dialogs / widgetbootstrapAlert.js
1 CKEDITOR.dialog.add( 'widgetfoundationAlert', function( editor ) {
2     var clientHeight = document.documentElement.clientHeight,
3         alertTypes = CKEDITOR.config.widgetfoundationAlert_alertTypes,
4         alertTypesSelect = [],
5         alertName;
6
7     for ( alertName in alertTypes ) {
8         alertTypesSelect.push( [ alertTypes[ alertName ], alertName ] );
9     }
10
11
12     // Size adjustments.
13     /*var size = CKEDITOR.document.getWindow().getViewPaneSize(),
14         // Make it maximum 800px wide, but still fully visible in the viewport.
15         width = Math.min( size.width - 70, 800 ),
16         // Make it use 2/3 of the viewport height.
17         height = size.height / 1.5;
18         // Low resolution settings.
19         if ( clientHeight < 650 )
20             height = clientHeight - 220;*/
21
22     return {
23         title: 'Edit Alert Type',
24         minWidth: 200,
25         minHeight: 100,
26         contents: [
27             {
28                 id: 'info',
29                 elements: [
30                     {
31                         id: 'type',
32                         type: 'select',
33                         label: 'Alert Type',
34                         items: alertTypesSelect,
35                         required: true,
36                         validate: CKEDITOR.dialog.validate.notEmpty('Alert type required'),
37                         setup: function( widget ) {
38                             this.setValue( widget.data.type != undefined ? widget.data.type : 'alert');
39                         },
40                         commit: function( widget ) {
41                             widget.setData( 'type', this.getValue() );
42                         }
43                     }/*,
44                     {
45                         id: 'alertText',
46                         type: 'textarea',
47                         label: 'Alert Content',
48                         setup: function( widget ) {
49                             this.setValue( widget.data.alertText );
50                         },
51                         commit: function( widget ) {
52                             widget.setData( 'alertText', this.getValue() );
53                         },
54                         required: true,
55                         validate: CKEDITOR.dialog.validate.notEmpty('Content required'),
56                         inputStyle: 'cursor:auto;' +
57                             'width:' + width + 'px;' +
58                             'height:' + height + 'px;' +
59                             'tab-size:4;' +
60                             'text-align:left;',
61                             'class': 'cke_source'
62                     }*/
63                 ]
64             }
65         ]
66     };
67 } );