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 / oscpopover / oscpopover_plugin.js

oscpopover_plugin.js in Easy Bootstrap Shortcode trunk, at shortcode/oscpopover/oscpopover_plugin.js

139 lines 6.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var oscpopover={
2 title:"Popover Shortcode",
3 id :'oscitas-form-popover',
4 pluginName: 'oscpopover'
5 };
6 (function() {
7 _create_tinyMCE_options(oscpopover);
8 })();
9
10 function ebs_return_html_oscpopover(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-popover-style">'+ebsjstrans.popover+' '+ebsjstrans.style+':</label></th>\
14 <td><select name="oscitas-popover-style" id="oscitas-popover-style">\
15 <option value="top">'+ebsjstrans.top+'</option>\
16 <option value="bottom">'+ebsjstrans.bottom+'</option>\
17 <option value="left">'+ebsjstrans.left+'</option>\
18 <option value="right">'+ebsjstrans.right+'</option>\
19 <option value="auto">'+ebsjstrans.auto+'</option>\
20 </select><br />\
21 </td>\
22 </tr>\
23 <tr>\
24 <th><label for="oscitas-popover-title">'+ebsjstrans.popover+' '+ebsjstrans.title+' '+ebsjstrans.text+'Popover Title Text:</label></th>\
25 <td><input type="text" name="popover-title" id="oscitas-popover-title" value="'+ebsjstrans.title+'"/><br />\
26 </td>\
27 </tr>\
28 </tr>\
29 <tr>\
30 <th><label for="oscitas-popover-content">'+ebsjstrans.popover+' '+ebsjstrans.content+':</label></th>\
31 <td><textarea " name="popover-content" id="oscitas-popover-content">'+ebsjstrans.your+' '+ebsjstrans.content+'</textarea><br />\
32 </td>\
33 </tr>\
34 <tr>\
35 <th><label for="oscitas-pbutton-trigger">'+ebsjstrans.trigger+' '+ebsjstrans.popover+' '+ebsjstrans.on+':</label></th>\
36 <td><select name="tigger" id="oscitas-pbutton-trigger">\
37 <option value="click">'+ebsjstrans.click+'</option>\
38 <option value="hover">'+ebsjstrans.hover+'</option>\
39 </select><br />\
40 </td>\
41 </tr >\
42 <tr>\
43 <th><label for="oscitas-pbutton-size">'+ebsjstrans.button+' '+ebsjstrans.size+':</label></th>\
44 <td><select name="size" id="oscitas-pbutton-size">\
45 <option value="">'+ebsjstrans.default+'</option>\
46 <option value="btn-lg">'+ebsjstrans.large+'</option>\
47 <option value="btn-sm">'+ebsjstrans.small+'</option>\
48 <option value="btn-xs">'+ebsjstrans.exsmall+'</option>\
49 </select><br />\
50 </td>\
51 </tr >\
52 <tr>\
53 <th><label for="oscitas-pbutton-type">'+ebsjstrans.button+' '+ebsjstrans.type+':</label></th>\
54 <td><select name="type" id="oscitas-pbutton-type">\
55 <option value="btn-default">'+ebsjstrans.simple+'</option>\
56 <option value="btn-primary">'+ebsjstrans.primary+'</option>\
57 <option value="btn-success">'+ebsjstrans.success+'</option>\
58 <option value="btn-info">'+ebsjstrans.information+'</option>\
59 <option value="btn-warning">'+ebsjstrans.warning+'</option>\
60 <option value="btn-danger">'+ebsjstrans.danger+'</option>\
61 <option value="btn-link">'+ebsjstrans.link+'</option>\
62 </select><br />\
63 </td>\
64 </tr >\
65 <tr>\
66 <th><label for="oscitas-popover-button-text">'+ebsjstrans.button+' '+ebsjstrans.text+':</label></th>\
67 <td><input type="text" name="link-text" id="oscitas-popover-button-text" value="'+ebsjstrans.popover+'"/><br />\
68 </td>\
69 </tr>\
70 <tr>\
71 <th><label for="oscitas-popover-class">'+ebsjstrans.customclass+':</label></th>\
72 <td><input type="text" name="line" id="oscitas-popover-class" value=""/><br />\
73 </td>\
74 </tr>\
75 </table>\
76 <p class="submit ebs-default-options">\
77 <input type="button" id="oscitas-popover-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.popover+'" name="submit" />\
78 </p>\
79 <div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/oscpopover/screenshot.jpg"/></div>\
80 </div>');
81 return form;
82 }
83 function create_oscitas_oscpopover(pluginObj){
84 var form=jQuery(pluginObj.hashId);
85
86
87 var table = form.find('table');
88
89 var colors = ['color', 'bgcolor'];
90 jQuery('#oscitas-table tr:visible:even').css('background', '#ffffff');
91 jQuery('#oscitas-table tr:visible:odd').css('background', '#efefef');
92
93
94 // handles the click event of the submit button
95 form.find('#oscitas-popover-submit').click(function() {
96 // defines the options and their default values
97 // again, this is not the most elegant way to do this
98 // but well, this gets the job done nonetheless
99 var cusclass='';
100 if(table.find('#oscitas-popover-class').val()!=''){
101 cusclass= ' class="'+table.find('#oscitas-popover-class').val()+'"';
102 }
103 var shortcode = '['+$ebs_prefix+'popovernew'+cusclass;
104 shortcode += ' title="' + table.find('#oscitas-popover-title').val();
105
106 shortcode += '" ';
107
108 shortcode += ' button_text="' + table.find('#oscitas-popover-button-text').val();
109
110 shortcode += '" ';
111 shortcode += ' trigger="' + table.find('#oscitas-pbutton-trigger').val();
112
113 shortcode += '" ';
114 shortcode += ' style="' + table.find('#oscitas-popover-style').val();
115
116 shortcode += '" ';
117 shortcode += ' size="' + table.find('#oscitas-pbutton-size').val();
118
119 shortcode += '" ';
120 shortcode += ' type="' + table.find('#oscitas-pbutton-type').val();
121
122 shortcode += '" ';
123 //shortcode += ' btntag="'+table.find('#oscitas-button-type').val()+'" ';
124
125
126
127 shortcode += ']';
128 shortcode+= table.find('#oscitas-popover-content').val();
129 shortcode+='[/'+$ebs_prefix+'popovernew]';
130
131 // inserts the shortcode into the active editor
132 ebsInsertShortcode(shortcode);
133
134 // closes fancybox
135 close_dialogue(pluginObj.hashId);
136 });
137 }
138
139