PluginProbe
Easy Bootstrap Shortcode / 4.4
Easy Bootstrap Shortcode v4.4
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 / progressbar / progressbar_plugin.js

progressbar_plugin.js in Easy Bootstrap Shortcode 4.4, at shortcode/progressbar/progressbar_plugin.js

115 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var progressbar={
2 title:"Progressbar Shortcode",
3 id :'oscitas-form-progressbar',
4 pluginName: 'progressbar',
5 setRowColors: true
6 };
7 (function() {
8 _create_tinyMCE_options(progressbar, 800);
9 })();
10
11 function ebs_return_html_progressbar(pluginObj){
12 var form = jQuery('<div id="'+pluginObj.id+'" class="oscitas-container" title="'+pluginObj.title+'"><table id="oscitas-table" class="form-table">\
13 <tr>\
14 <th><label for="oscitas-progressbar-style">Progress Bar Type:</label></th>\
15 <td><select name="type" id="oscitas-progressbar-style">\
16 <option value="">Default</option>\
17 <option value="progress-bar-success">Success</option>\
18 <option value="progress-bar-info">Information</option>\
19 <option value="progress-bar-warning">Warning</option>\
20 <option value="progress-bar-danger">Danger</option>\
21 </select><br />\
22 </td>\
23 </tr>\
24 <tr>\
25 <th><label for="oscitas-progressbar-label">Progressbar Label:</label></th>\
26 <td><input type="text" name="title" id="oscitas-progressbar-label" value=""/><br />\
27 </td>\
28 </tr>\
29 <tr>\
30 <th><label for="oscitas-progressbar-progress">Progress Value:</label></th>\
31 <td><input type="text" name="title" id="oscitas-progressbar-progress" value="50"/><br />\
32 <small>Enter a numeric value between 0 to 100, Default value is 50</small>\
33 </td>\
34 </tr>\
35 <tr>\
36 <th><label for="oscitas-progressbar-stripped">Stripped Progress Bar:</label></th>\
37 <td>\
38 <input type="checkbox" id="oscitas-progressbar-stripped">\
39 </td>\
40 </tr>\
41 <tr id="osc_progress_animate" style="display: none;">\
42 <th><label for="oscitas-progressbar-animated">Animated Progress Bar:</label></th>\
43 <td>\
44 <input type="checkbox" id="oscitas-progressbar-animated">\
45 </td>\
46 </tr>\
47 <tr>\
48 <th><label for="oscitas-progressbar-class">Custom Class:</label></th>\
49 <td><input type="text" name="line" id="oscitas-progressbar-class" value=""/><br />\
50 </td>\
51 </tr>\
52 </table>\
53 <p class="submit">\
54 <input type="button" id="oscitas-progressbar-submit" class="button-primary" value="Insert Button" name="submit" />\
55 </p>\
56 </div>');
57 return form;
58 }
59 function create_oscitas_progressbar(pluginObj){
60 var form=jQuery(pluginObj.hashId);
61
62 var table = form.find('table');
63
64 jQuery('#oscitas-form-progressbar table tr:visible:even').css('background', '#ffffff');
65 jQuery('#oscitas-form-progressbar table tr:visible:odd').css('background', '#efefef');
66 table.find('#oscitas-progressbar-stripped').click(function(){
67 if(jQuery(this).prop('checked')){
68 jQuery('#osc_progress_animate').show();
69 } else{
70 jQuery('#osc_progress_animate').hide();
71 }
72 jQuery('#oscitas-form-progressbar table tr:visible:even').css('background', '#ffffff');
73 jQuery('#oscitas-form-progressbar table tr:visible:odd').css('background', '#efefef');
74 })
75
76
77
78
79
80 // handles the click event of the submit button
81 form.find('#oscitas-progressbar-submit').click(function(){
82
83 var cusclass='',type='',value='',stripped='',label='';
84 if(jQuery('#oscitas-progressbar-stripped').prop('checked')){
85 stripped=' barstyle="progress-striped';
86 if(jQuery('#oscitas-progressbar-animated').prop('checked')){
87 stripped +=' active';
88 }
89 stripped +='"';
90 }
91 if(table.find('#oscitas-progressbar-class').val()!=''){
92 cusclass= ' class="'+table.find('#oscitas-progressbar-class').val()+'"';
93 }
94 if(table.find('#oscitas-progressbar-style').val()!=''){
95 type= ' bartype="'+table.find('#oscitas-progressbar-style').val()+'"';
96 }
97 if(table.find('#oscitas-progressbar-progress').val()!=''){
98 value= ' value="'+table.find('#oscitas-progressbar-progress').val()+'"';
99 }
100 if(table.find('#oscitas-progressbar-label').val()!=''){
101 label= ' label="'+table.find('#oscitas-progressbar-label').val()+'"';
102 }
103 var shortcode = '['+$ebs_prefix+'progressbar'+value+cusclass+type+stripped+label;
104
105 shortcode += ']';
106
107 // inserts the shortcode into the active editor
108 tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
109
110 // closes fancybox
111 close_dialogue(pluginObj.hashId);
112 });
113 }
114
115