PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / 1.74
reCaptcha by BestWebSoft v1.74
1.79 1.80 1.82 1.83 1.84 1.85 1.86 1.87 trunk 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.70 1.71 1.72 1.73 1.74 1.75 1.78
google-captcha / bws_menu / js / general_script.js
google-captcha / bws_menu / js Last commit date
bws_menu.js 2 years ago bws_tooltip.js 2 years ago c_o_o_k_i_e.js 2 years ago general_script.js 2 years ago shortcode-button.js 2 years ago
general_script.js
232 lines
1 function bws_show_settings_notice() {
2 "use strict";
3 (function($) {
4 $( '.updated.fade:not(.bws_visible), .error:not(.bws_visible)' ).css( 'display', 'none' );
5 $( '#bws_save_settings_notice' ).css( 'display', 'block' );
6 })( jQuery );
7 }
8
9 (function($) {
10 "use strict";
11 $( document ).ready(
12 function() {
13 /**
14 * add notice about changing on the settings page
15 */
16 $( '.bws_form input, .bws_form textarea, .bws_form select' ).on(
17 "change paste select",
18 function( e ) {
19 if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) && typeof ( e.originalEvent ) != 'undefined' ) {
20 bws_show_settings_notice();
21 };
22 }
23 );
24 $( '.bws_save_anchor' ).on(
25 "click",
26 function( event ) {
27 event.preventDefault();
28 $( '.bws_form #bws-submit-button' ).click();
29 }
30 );
31
32 /* custom code */
33
34 if ( 'function' == typeof wp.CodeMirror || 'function' == typeof CodeMirror ) {
35 var CodeMirrorFunc = ( typeof wp.CodeMirror != 'undefined' ) ? wp.CodeMirror : CodeMirror;
36 if ( $( '#bws_newcontent_css' ).length > 0 ) {
37 var editor = CodeMirrorFunc.fromTextArea(
38 document.getElementById( 'bws_newcontent_css' ),
39 {
40 mode: "css",
41 theme: "default",
42 styleActiveLine: true,
43 matchBrackets: true,
44 lineNumbers: true,
45 addModeClass: 'bws_newcontent_css',
46 readOnly: 'nocursor'
47 }
48 );
49 }
50
51 if ( $( '#bws_newcontent_php' ).length > 0 ) {
52 var editor = CodeMirrorFunc.fromTextArea(
53 document.getElementById( "bws_newcontent_php" ),
54 {
55 mode: 'text/x-php',
56 styleActiveLine: true,
57 matchBrackets: true,
58 lineNumbers: true,
59 readOnly: 'nocursor'
60 }
61 );
62 /* disable lines */
63 editor.markText( {ch:0,line:0}, {ch:0,line:5}, { readOnly: true, className: 'bws-readonly' } );
64 }
65
66 if ( $( '#bws_newcontent_js' ).length > 0 ) {
67 var editor = CodeMirrorFunc.fromTextArea(
68 document.getElementById( "bws_newcontent_js" ),
69 {
70 mode: 'javascript',
71 styleActiveLine: true,
72 matchBrackets: true,
73 lineNumbers: true,
74 readOnly: 'nocursor'
75 }
76 );
77 }
78 }
79
80 /* banner to settings */
81 $( '.bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' ).removeClass( 'hide-if-js' );
82 $( '.bws_banner_to_settings_joint .bws-more-links' ).on(
83 "click",
84 function( event ) {
85 event.preventDefault();
86 if ( $( '.bws_banner_to_settings_joint .bws-less' ).hasClass( 'hidden' ) ) {
87 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).removeClass( 'hidden' );
88 $( '.bws_banner_to_settings_joint .bws-more' ).addClass( 'hidden' );
89 } else {
90 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' );
91 $( '.bws_banner_to_settings_joint .bws-more' ).removeClass( 'hidden' );
92 }
93 }
94 );
95
96 /* help tooltips */
97 if ( $( '.bws_help_box' ).length > 0 ) {
98 if ( $( 'body' ).hasClass( 'rtl' ) ) {
99 var current_position = { my: "right top+15", at: "right bottom" };
100 } else {
101 var current_position = { my: "left top+15", at: "left bottom" };
102 }
103 $( document ).tooltip(
104 {
105 items: $( '.bws_help_box' ),
106 content: function() {
107 return $( this ).find( '.bws_hidden_help_text' ).html()
108 },
109 show: null, /* show immediately */
110 tooltipClass: "bws-tooltip-content",
111 position: current_position,
112 open: function( event, ui ) {
113 if ( typeof( event.originalEvent ) === 'undefined' ) {
114 return false;
115 }
116 if ( $( event.originalEvent.target ).hasClass( 'bws-auto-width' ) ) {
117 ui.tooltip.css( "max-width", "inherit" );
118 }
119 var $id = $( ui.tooltip ).attr( 'id' );
120 /* close any lingering tooltips */
121 $( 'div.ui-tooltip' ).not( '#' + $id ).remove();
122 },
123 close: function( event, ui ) {
124 ui.tooltip.hover(
125 function() {
126 $( this ).stop( true ).fadeTo( 200, 1 );
127 },
128 function() {
129 $( this ).fadeOut(
130 '200',
131 function() {
132 $( this ).remove();
133 }
134 );
135 }
136 );
137 }
138 }
139 );
140 }
141
142 /**
143 * Handle the styling of the "Settings" tab on the plugin settings page
144 */
145 var tabs = $( '#bws_settings_tabs_wrapper' );
146 if ( tabs.length ) {
147 var current_tab_field = $( 'input[name="bws_active_tab"]' ),
148 prevent_tabs_change = false,
149 active_tab = current_tab_field.val();
150 if ( '' == active_tab ) {
151 var active_tab_index = 0;
152 } else {
153 var active_tab_index = $( '#bws_settings_tabs li[data-slug=' + active_tab + ']' ).index();
154 }
155
156 $( '.bws_tab' ).css( 'min-height', $( '#bws_settings_tabs' ).css( 'height' ) );
157
158 /* jQuery tabs initialization */
159 tabs.tabs(
160 {
161 active: active_tab_index
162 }
163 ).on(
164 "tabsactivate",
165 function( event, ui ) {
166 if ( ! prevent_tabs_change ) {
167 active_tab = ui.newTab.data( 'slug' );
168 current_tab_field.val( active_tab );
169 }
170 prevent_tabs_change = false;
171 }
172 );
173 $( '.bws_trigger_tab_click' ).on(
174 'click',
175 function () {
176 $( '#bws_settings_tabs a[href="' + $( this ).attr( 'href' ) + '"]' ).click();
177 }
178 );
179 }
180 /**
181 * Hide content for options on the plugin settings page
182 */
183 var options = $( '.bws_option_affect' );
184 if ( options.length ) {
185 options.each(
186 function() {
187 var element = $( this );
188 if ( element.is( ':selected' ) || element.is( ':checked' ) ) {
189 $( element.data( 'affect-show' ) ).show();
190 $( element.data( 'affect-hide' ) ).hide();
191 } else {
192 $( element.data( 'affect-show' ) ).hide();
193 $( element.data( 'affect-hide' ) ).show();
194 }
195 if ( element.is( 'option' ) ) {
196 element.parent().on(
197 'change',
198 function() {
199 var affect_hide = element.data( 'affect-hide' ),
200 affect_show = element.data( 'affect-show' );
201 if ( element.is( ':selected' ) ) {
202 $( affect_show ).show();
203 $( affect_hide ).hide();
204 } else {
205 $( affect_show ).hide();
206 $( affect_hide ).show();
207 }
208 }
209 );
210 } else {
211 element.on(
212 'change',
213 function() {
214 var affect_hide = element.data( 'affect-hide' ),
215 affect_show = element.data( 'affect-show' );
216 if ( element.is( ':selected' ) || element.is( ':checked' ) ) {
217 $( affect_show ).show();
218 $( affect_hide ).hide();
219 } else {
220 $( affect_show ).hide();
221 $( affect_hide ).show();
222 }
223 }
224 );
225 }
226 }
227 );
228 }
229 }
230 );
231 })( jQuery );
232