PluginProbe
Easy Bootstrap Shortcode / 4.5
Easy Bootstrap Shortcode v4.5
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 / rule / rule_plugin.js

rule_plugin.js in Easy Bootstrap Shortcode 4.5, at shortcode/rule/rule_plugin.js

88 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var rule={
2 title:"Horizontal1 Rule Shortcode",
3 id :'oscitas-form-rule',
4 pluginName: 'rule'
5 };
6 (function() {
7 _create_tinyMCE_options(rule);
8 })();
9
10 function ebs_return_html_rule(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-rule-style">'+ebsjstrans.style+':</label></th>\
14 <td><select name="type" id="oscitas-rule-style">\
15 <option value="rule-dotted">'+ebsjstrans.dotted+'</option>\
16 <option value="rule-dashed">'+ebsjstrans.dashed+'</option>\
17 <option value="rule-double">'+ebsjstrans.double+'</option>\
18 <option value="rule-diagonal">'+ebsjstrans.diagonal+'</option>\
19 <option value="rule-double-thick-thin">'+ebsjstrans.doublethickthin+'</option>\
20 <option value="rule-double-fadecorder">'+ebsjstrans.doublefadecorner+'</option>\
21 <option value="rule-fadecorder">'+ebsjstrans.fadecorner+'</option>\
22 <option value="rule-shadow">'+ebsjstrans.shadow+'</option>\
23 <option value="rule-wave">'+ebsjstrans.wave+'</option>\
24 <option value="rule-thick">'+ebsjstrans.thick+'</option>\
25 <option value="rule-thin">'+ebsjstrans.thin+'</option>\
26 </select><br />\
27 </td>\
28 </tr>\
29 <tr>\
30 <th><label for="oscitas-rule-margin">'+ebsjstrans.margin+':</label></th>\
31 <td><input type="text" name="line" id="oscitas-rule-margin" value=""/><br />\
32 <small>'+ebsjstrans.enternumvaleg20+'</small>\
33 </td>\
34 </tr>\
35 <tr>\
36 <th><label for="oscitas-rule-class">'+ebsjstrans.customclass+':</label></th>\
37 <td><input type="text" name="line" id="oscitas-rule-class" value=""/><br />\
38 </td>\
39 </tr>\
40 </table>\
41 <p class="submit ebs-default-options">\
42 <input type="button" id="oscitas-rule-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.horizontal+' '+ebsjstrans.rule+'" name="submit" />\
43 </p>\
44 <div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/rule/screenshot.jpg"/></div>\
45 </div>');
46
47 return form;
48 }
49
50
51 function create_oscitas_rule(pluginObj){
52
53 var form = jQuery(pluginObj.hashId);
54 var table = form.find('table');
55 //form.appendTo('body').hide();
56
57 // handles the click event of the submit button
58 form.find('#oscitas-rule-submit').click(function() {
59 // defines the options and their default values
60 // again, this is not the most elegant way to do this
61 // but well, this gets the job done nonetheless
62 var cusclass='',margin='';
63 if(table.find('#oscitas-rule-class').val()!=''){
64 cusclass= ' class="'+table.find('#oscitas-rule-class').val()+'"';
65 }
66 if(table.find('#oscitas-rule-margin').val()!=''){
67 margin= ' margin="'+table.find('#oscitas-rule-margin').val()+'"';
68 }
69 var shortcode = '[rule'+cusclass+margin;
70
71 shortcode += ' style="' + table.find('#oscitas-rule-style').val();
72
73 shortcode += '" ';
74 //shortcode += ' btntag="'+table.find('#oscitas-button-type').val()+'" ';
75
76
77
78 shortcode += ']';
79
80 // inserts the shortcode into the active editor
81 tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode);
82
83 // closes Dialoguebox
84 close_dialogue(pluginObj.hashId);
85 });
86 }
87
88