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 / icon / icon_plugin.js

icon_plugin.js in Easy Bootstrap Shortcode trunk, at shortcode/icon/icon_plugin.js

99 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var icon={
2 title:"Icon Shortcode",
3 id :'oscitas-form-icon',
4 pluginName: 'icon'
5 };
6 (function() {
7 _create_tinyMCE_options(icon, 800);
8 })();
9
10 function ebs_return_html_icon(pluginObj){
11
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-heading-icon">'+ebsjstrans.select+' '+ebsjstrans.icon+':</label></th>\
15 <td><div id="click_icon_list_icon" class="oscitas-icon-div"><span id="osc_show_icon_icon"></span><span class="show-drop"></span></div><input type="hidden" id="osc_icon_class_val_icon" value="glyphicon-adjust">\
16 <div id="osc_show_iconlist_icon" class="oscitas-icon" style="display:none;width:100%">'+font_awesome_include('oscitas-heading-icon_icon')+'</div>\
17 </td>\
18 </tr>\
19 <tr>\
20 <th><label for="oscitas-icon-iconcolor">'+ebsjstrans.icon+' '+ebsjstrans.color+':</label></th>\
21 <td><input type="text" name="label" id="oscitas-icon-iconcolor" class="color" value="" /><br />\
22 </td>\
23 </tr>\
24 <tr>\
25 <th><label for="oscitas-icon-fontsize">'+ebsjstrans.icon+' '+ebsjstrans.font+' '+ebsjstrans.size+':</label></th>\
26 <td><input type="text" name="line" id="oscitas-icon-fontsize" value=""/>px\
27 </td>\
28 </tr>\
29 <tr>\
30 <th><label for="oscitas-icon-class">'+ebsjstrans.customclass+':</label></th>\
31 <td><input type="text" name="line" id="oscitas-icon-class" value=""/><br />\
32 </td>\
33 </tr>\
34 </table>\
35 <p class="submit ebs-default-options">\
36 <input type="button" id="oscitas-icon-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.icon+'" name="submit" />\
37 </p>\
38 <div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/icon/screenshot.jpg"/></div>\
39 </div>');
40
41 return form;
42
43 }
44 function create_oscitas_icon(pluginObj){
45 var form=jQuery(pluginObj.hashId);
46 var table = form.find('table');
47 jQuery('.glyphicon').css('display','inline');
48
49 form.find('.color').wpColorPicker();
50 var t= table.find('#osc_icon_class_val_icon').val();
51 table.find('#osc_show_icon_icon').removeClass().addClass('glyphicon').addClass(t);
52 table.find('#click_icon_list_icon').click(function(){
53 if(!jQuery(this).hasClass('osc_icon_showing_icon')){
54 jQuery(this).addClass('osc_icon_showing_icon')
55 table.find('#osc_show_iconlist_icon').show();
56 } else{
57 jQuery(this).removeClass('osc_icon_showing_icon')
58 table.find('#osc_show_iconlist_icon').hide();
59 }
60 });
61 table.find('.oscitas-heading-icon_icon li').click(function(){
62 var val=jQuery(this).attr('data-value');
63 var type=jQuery(this).attr('type');
64 table.find('.oscitas-heading-icon_icon li').removeClass('osc_icon_selected_button');
65 jQuery(this).addClass('osc_icon_selected_button');
66 table.find('#osc_show_iconlist_icon').hide();
67 table.find('#osc_show_icon_icon').removeClass().addClass(type).addClass(val);
68 table.find('#osc_icon_class_val_icon').val(type+' '+val);
69 })
70
71
72
73
74
75
76 // handles the click event of the submit button
77 form.find('#oscitas-icon-submit').click(function(){
78 var cusclass='';
79 if(table.find('#oscitas-icon-iconcolor').val()!=''){
80 cusclass+= ' color="'+table.find('#oscitas-icon-iconcolor').val()+'"';
81 }if(table.find('#oscitas-icon-fontsize').val()!=''){
82 cusclass+= ' fontsize="'+table.find('#oscitas-icon-fontsize').val()+'"';
83 }
84 if(table.find('#oscitas-icon-class').val()!=''){
85 cusclass+= ' class="'+table.find('#oscitas-icon-class').val()+'"';
86 }
87 var icon = table.find('#osc_icon_class_val_icon').val();
88 var shortcode='';
89 shortcode='['+$ebs_prefix+'icon type="'+icon+'"'+cusclass+']'
90
91 // inserts the shortcode into the active editor
92 ebsInsertShortcode(shortcode);
93
94 // closes fancybox
95 close_dialogue(pluginObj.hashId);
96 });
97 }
98
99