PluginProbe
Easy Bootstrap Shortcode / trunk
Easy Bootstrap Shortcode vtrunk
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
easy-bootstrap-shortcodes / shortcode / panel / panel_plugin.js

panel_plugin.js in Easy Bootstrap Shortcode trunk, at shortcode/panel/panel_plugin.js

71 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var panel={
2 title:"Panel Shortcode",
3 id :'oscitas-form-panel',
4 pluginName: 'panel'
5 };
6 (function() {
7 _create_tinyMCE_options(panel);
8 })();
9
10 function ebs_return_html_panel(pluginObj){
11 var form = jQuery('<div id="'+pluginObj.id+'" class="oscitas-container" title="'+pluginObj.title+'"><table id="oscitas-table" class="form-table ebs-default-options">\
12 <tr>\
13 <th><label for="oscitas-type">'+ebsjstrans.style+':</label></th>\
14 <td><select name="type" id="oscitas-panel-type">\
15 <option value="panel-default">'+ebsjstrans.simple+'</option>\
16 <option value="panel-primary">'+ebsjstrans.primary+'</option>\
17 <option value="panel-success">'+ebsjstrans.success+'</option>\
18 <option value="panel-info">'+ebsjstrans.information+'</option>\
19 <option value="panel-warning">'+ebsjstrans.warning+'</option>\
20 <option value="panel-danger">'+ebsjstrans.danger+'</option>\
21 </select><br />\
22 </td>\
23 </tr>\
24 <tr>\
25 <th><label for="oscitas-line">'+ebsjstrans.show+' '+ebsjstrans.footer+':</label></th>\
26 <td><input type="checkbox" id="oscitas-panel-footer"/><br />\
27 </td>\
28 </tr>\
29 <tr>\
30 <th><label for="oscitas-panel-class">'+ebsjstrans.customclass+':</label></th>\
31 <td><input type="text" name="line" id="oscitas-panel-class" value=""/><br />\
32 </td>\
33 </tr>\
34 </table>\
35 <p class="submit ebs-default-options">\
36 <input type="button" id="oscitas-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.panel+'" name="submit" />\
37 </p>\
38 <div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/panel/screenshot.jpg"/></div>\
39 </div>');
40 return form;
41 }
42 function create_oscitas_panel(pluginObj){
43 var form=jQuery(pluginObj.hashId);
44
45 var table = form.find('table');
46
47
48 // handles the click event of the submit button
49 form.find('#oscitas-submit').click(function(){
50 // defines the options and their default values
51 // again, this is not the most elegant way to do this
52 // but well, this gets the job done nonetheless
53 var cusclass='';
54 if(table.find('#oscitas-panel-class').val()!=''){
55 cusclass= ' class="'+table.find('#oscitas-panel-class').val()+'"';
56 }
57 var shortcode = '['+$ebs_prefix+'panel style="'+table.find('#oscitas-panel-type').val()+ '"'+cusclass+']';
58 shortcode += '<br/>['+$ebs_prefix+'panel-header]<br/>'+ebsjstrans.heading+' '+ebsjstrans.goes+' '+ebsjstrans.here+'<br/>[/'+$ebs_prefix+'panel-header]';
59 //shortcode += (table.find('#oscitas-panel-header').prop('checked')? '[panel-header]<br/>Heading goes here<br/>[/panel-header]': '');
60 shortcode += '<br/>['+$ebs_prefix+'panel-content]<br/>'+ebsjstrans.content+' '+ebsjstrans.goes+' '+ebsjstrans.here+'<br/>[/'+$ebs_prefix+'panel-content]';
61 shortcode += (table.find('#oscitas-panel-footer').prop('checked')? '<br/>['+$ebs_prefix+'panel-footer]<br/>Footer goes here<br/>[/'+$ebs_prefix+'panel-footer]': '');
62 shortcode += '<br/>[/'+$ebs_prefix+'panel]';
63
64 // inserts the shortcode into the active editor
65 ebsInsertShortcode(shortcode);
66
67 close_dialogue(pluginObj.hashId);
68 });
69 }
70
71