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 / progressbar / progressbar_plugin.js

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

116 lines 4.9 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 ebs-default-options">\
13 <tr>\
14 <th><label for="oscitas-progressbar-style">'+ebsjstrans.progress+' '+ebsjstrans.bar+' '+ebsjstrans.type+':</label></th>\
15 <td><select name="type" id="oscitas-progressbar-style">\
16 <option value="">'+ebsjstrans.default+'</option>\
17 <option value="progress-bar-success">'+ebsjstrans.success+'</option>\
18 <option value="progress-bar-info">'+ebsjstrans.information+'</option>\
19 <option value="progress-bar-warning">'+ebsjstrans.warning+'</option>\
20 <option value="progress-bar-danger">'+ebsjstrans.danger+'</option>\
21 </select><br />\
22 </td>\
23 </tr>\
24 <tr>\
25 <th><label for="oscitas-progressbar-label">'+ebsjstrans.progress+' '+ebsjstrans.bar+' '+ebsjstrans.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">'+ebsjstrans.progress+' '+ebsjstrans.bar+' '+ebsjstrans.value+':</label></th>\
31 <td><input type="text" name="title" id="oscitas-progressbar-progress" value="50"/><br />\
32 <small>'+ebsjstrans.enterval0to100+'</small>\
33 </td>\
34 </tr>\
35 <tr>\
36 <th><label for="oscitas-progressbar-stripped">'+ebsjstrans.stripped+' '+ebsjstrans.progress+' '+ebsjstrans.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">'+ebsjstrans.animated+' '+ebsjstrans.progress+' '+ebsjstrans.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">'+ebsjstrans.customclass+':</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 ebs-default-options">\
54 <input type="button" id="oscitas-progressbar-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.button+'" name="submit" />\
55 </p>\
56 <div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/progressbar/screenshot.jpg"/></div>\
57 </div>');
58 return form;
59 }
60 function create_oscitas_progressbar(pluginObj){
61 var form=jQuery(pluginObj.hashId);
62
63 var table = form.find('table');
64
65 jQuery('#oscitas-form-progressbar table tr:visible:even').css('background', '#ffffff');
66 jQuery('#oscitas-form-progressbar table tr:visible:odd').css('background', '#efefef');
67 table.find('#oscitas-progressbar-stripped').click(function(){
68 if(jQuery(this).prop('checked')){
69 jQuery('#osc_progress_animate').show();
70 } else{
71 jQuery('#osc_progress_animate').hide();
72 }
73 jQuery('#oscitas-form-progressbar table tr:visible:even').css('background', '#ffffff');
74 jQuery('#oscitas-form-progressbar table tr:visible:odd').css('background', '#efefef');
75 })
76
77
78
79
80
81 // handles the click event of the submit button
82 form.find('#oscitas-progressbar-submit').click(function(){
83
84 var cusclass='',type='',value='',stripped='',label='';
85 if(jQuery('#oscitas-progressbar-stripped').prop('checked')){
86 stripped=' barstyle="progress-striped';
87 if(jQuery('#oscitas-progressbar-animated').prop('checked')){
88 stripped +=' active';
89 }
90 stripped +='"';
91 }
92 if(table.find('#oscitas-progressbar-class').val()!=''){
93 cusclass= ' class="'+table.find('#oscitas-progressbar-class').val()+'"';
94 }
95 if(table.find('#oscitas-progressbar-style').val()!=''){
96 type= ' bartype="'+table.find('#oscitas-progressbar-style').val()+'"';
97 }
98 if(table.find('#oscitas-progressbar-progress').val()!=''){
99 value= ' value="'+table.find('#oscitas-progressbar-progress').val()+'"';
100 }
101 if(table.find('#oscitas-progressbar-label').val()!=''){
102 label= ' label="'+table.find('#oscitas-progressbar-label').val()+'"';
103 }
104 var shortcode = '['+$ebs_prefix+'progressbar'+value+cusclass+type+stripped+label;
105
106 shortcode += ']';
107
108 // inserts the shortcode into the active editor
109 ebsInsertShortcode(shortcode);
110
111 // closes fancybox
112 close_dialogue(pluginObj.hashId);
113 });
114 }
115
116