PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / 1.65
reCaptcha by BestWebSoft v1.65
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 4 years ago bws_tooltip.js 4 years ago c_o_o_k_i_e.js 4 years ago codemirror.js 4 years ago general_script.js 4 years ago shortcode-button.js 4 years ago
general_script.js
185 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( function() {
12 /**
13 * add notice about changing on the settings page
14 */
15 $( '.bws_form input, .bws_form textarea, .bws_form select' ).on( "change paste select", function() {
16 if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) ) {
17 bws_show_settings_notice();
18 };
19 });
20 $( '.bws_save_anchor' ).on( "click", function( event ) {
21 event.preventDefault();
22 $( '.bws_form #bws-submit-button' ).click();
23 });
24
25 /* custom code */
26
27 if ( 'function' == typeof wp.CodeMirror || 'function' == typeof CodeMirror ) {
28 var CodeMirrorFunc = ( typeof wp.CodeMirror != 'undefined' ) ? wp.CodeMirror : CodeMirror;
29 if ( $( '#bws_newcontent_css' ).length > 0 ) {
30 var editor = CodeMirrorFunc.fromTextArea( document.getElementById( 'bws_newcontent_css' ), {
31 mode: "css",
32 theme: "default",
33 styleActiveLine: true,
34 matchBrackets: true,
35 lineNumbers: true,
36 addModeClass: 'bws_newcontent_css'
37 });
38 }
39
40 if ( $( '#bws_newcontent_php' ).length > 0 ) {
41 var editor = CodeMirrorFunc.fromTextArea( document.getElementById( "bws_newcontent_php" ), {
42 mode: 'text/x-php',
43 styleActiveLine: true,
44 matchBrackets: true,
45 lineNumbers: true,
46 });
47 /* disable lines */
48 editor.markText( {ch:0,line:0}, {ch:0,line:5}, { readOnly: true, className: 'bws-readonly' } );
49 }
50
51 if ( $( '#bws_newcontent_js' ).length > 0 ) {
52 var editor = CodeMirrorFunc.fromTextArea( document.getElementById( "bws_newcontent_js" ), {
53 mode: 'javascript',
54 styleActiveLine: true,
55 matchBrackets: true,
56 lineNumbers: true,
57 });
58 }
59 }
60
61 /* banner to settings */
62 $( '.bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' ).removeClass( 'hide-if-js' );
63 $( '.bws_banner_to_settings_joint .bws-more-links' ).on( "click", function( event ) {
64 event.preventDefault();
65 if ( $( '.bws_banner_to_settings_joint .bws-less' ).hasClass( 'hidden' ) ) {
66 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).removeClass( 'hidden' );
67 $( '.bws_banner_to_settings_joint .bws-more' ).addClass( 'hidden' );
68 } else {
69 $( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' );
70 $( '.bws_banner_to_settings_joint .bws-more' ).removeClass( 'hidden' );
71 }
72 });
73
74 /* help tooltips */
75 if ( $( '.bws_help_box' ).length > 0 ) {
76 if ( $( 'body' ).hasClass( 'rtl' ) ) {
77 var current_position = { my: "right top+15", at: "right bottom" };
78 } else {
79 var current_position = { my: "left top+15", at: "left bottom" };
80 }
81 $( document ).tooltip( {
82 items: $( '.bws_help_box' ),
83 content: function() {
84 return $( this ).find( '.bws_hidden_help_text' ).html()
85 },
86 show: null, /* show immediately */
87 tooltipClass: "bws-tooltip-content",
88 position: current_position,
89 open: function( event, ui ) {
90 if ( typeof( event.originalEvent ) === 'undefined' ) {
91 return false;
92 }
93 if ( $( event.originalEvent.target ).hasClass( 'bws-auto-width' ) ) {
94 ui.tooltip.css( "max-width", "inherit" );
95 }
96 var $id = $( ui.tooltip ).attr( 'id' );
97 /* close any lingering tooltips */
98 $( 'div.ui-tooltip' ).not( '#' + $id ).remove();
99 },
100 close: function( event, ui ) {
101 ui.tooltip.hover( function() {
102 $( this ).stop( true ).fadeTo( 200, 1 );
103 },
104 function() {
105 $( this ).fadeOut( '200', function() {
106 $( this ).remove();
107 });
108 });
109 }
110 });
111 }
112
113 /**
114 * Handle the styling of the "Settings" tab on the plugin settings page
115 */
116 var tabs = $( '#bws_settings_tabs_wrapper' );
117 if ( tabs.length ) {
118 var current_tab_field = $( 'input[name="bws_active_tab"]' ),
119 prevent_tabs_change = false,
120 active_tab = current_tab_field.val();
121 if ( '' == active_tab ) {
122 var active_tab_index = 0;
123 } else {
124 var active_tab_index = $( '#bws_settings_tabs li[data-slug=' + active_tab + ']' ).index();
125 }
126
127 $( '.bws_tab' ).css( 'min-height', $( '#bws_settings_tabs' ).css( 'height' ) );
128
129 /* jQuery tabs initialization */
130 tabs.tabs({
131 active: active_tab_index
132 }).on( "tabsactivate", function( event, ui ) {
133 if ( ! prevent_tabs_change ) {
134 active_tab = ui.newTab.data( 'slug' );
135 current_tab_field.val( active_tab );
136 }
137 prevent_tabs_change = false;
138 });
139 $( '.bws_trigger_tab_click' ).on( 'click', function () {
140 $( '#bws_settings_tabs a[href="' + $( this ).attr( 'href' ) + '"]' ).click();
141 });
142 }
143 /**
144 * Hide content for options on the plugin settings page
145 */
146 var options = $( '.bws_option_affect' );
147 if ( options.length ) {
148 options.each( function() {
149 var element = $( this );
150 if ( element.is( ':selected' ) || element.is( ':checked' ) ) {
151 $( element.data( 'affect-show' ) ).show();
152 $( element.data( 'affect-hide' ) ).hide();
153 } else {
154 $( element.data( 'affect-show' ) ).hide();
155 $( element.data( 'affect-hide' ) ).show();
156 }
157 if ( element.is( 'option' ) ) {
158 element.parent().on( 'change', function() {
159 var affect_hide = element.data( 'affect-hide' ),
160 affect_show = element.data( 'affect-show' );
161 if ( element.is( ':selected' ) ) {
162 $( affect_show ).show();
163 $( affect_hide ).hide();
164 } else {
165 $( affect_show ).hide();
166 $( affect_hide ).show();
167 }
168 });
169 } else {
170 element.on( 'change', function() {
171 var affect_hide = element.data( 'affect-hide' ),
172 affect_show = element.data( 'affect-show' );
173 if ( element.is( ':selected' ) || element.is( ':checked' ) ) {
174 $( affect_show ).show();
175 $( affect_hide ).hide();
176 } else {
177 $( affect_show ).hide();
178 $( affect_hide ).show();
179 }
180 });
181 }
182 });
183 }
184 });
185 })(jQuery);