Version Description
Admin bug fixed for delete data on uninstall. Age validatition and popup delay bug fixed.
Download this release
Release Info
Developer | ITRO |
Plugin | ITRO Popup Plugin |
Version | 4.5.2 |
Comparing to | |
See all releases |
Code changes from version 4.5 to 4.5.2
- admin/popup-admin.php +17 -4
- functions/js-function.php +1 -142
- mc-main.php +5 -5
- readme.txt +19 -3
- scripts/itro-admin-scripts.js +74 -0
- scripts/itro-scripts.js +67 -0
admin/popup-admin.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
Copyright 2013 I.T.RO.® (email : support.itro@live.com)
|
4 |
This file is part of ITRO Popup Plugin.
|
5 |
*/
|
|
|
6 |
|
7 |
if ( !current_user_can( 'manage_options' ) ) {
|
8 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
@@ -52,8 +53,6 @@ if( !isset($submitted_form ))
|
|
52 |
$submitted_form = 'mt_submit_hidden';
|
53 |
}
|
54 |
|
55 |
-
|
56 |
-
|
57 |
/* ordered options */
|
58 |
for($i=0;$i<count($opt_name); $i++)
|
59 |
{
|
@@ -61,6 +60,7 @@ for($i=0;$i<count($opt_name); $i++)
|
|
61 |
$opt_val[$i] = itro_get_option( $opt_name[$i] );
|
62 |
$px_opt_val[$i] = itro_get_option( 'px_' . $opt_name[$i] );
|
63 |
$perc_opt_val[$i] = itro_get_option( 'perc_' . $opt_name[$i] );
|
|
|
64 |
/* See if the user has posted us some information */
|
65 |
/* If they did, this hidden field will be set to 'Y' */
|
66 |
if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' )
|
@@ -121,6 +121,20 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y')
|
|
121 |
if( empty($_POST['background_source']) ) { $opt_val[22] = NULL; itro_update_option('background_source',NULL); }
|
122 |
else { itro_update_option('background_source',$_POST['background_source']); }
|
123 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
itro_admin_style();
|
125 |
/* Put an settings updated message on the screen */
|
126 |
if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' ) {
|
@@ -133,7 +147,7 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
|
|
133 |
|
134 |
<div style="display:table; width:100%;">
|
135 |
<h1 style="float:left;"><?php _e( 'I.T.RO. Popup Plugin - Settings', 'itro-plugin');?></h1>
|
136 |
-
<h4 style="float:right; margin-right:30px;">VER <?php echo
|
137 |
</div>
|
138 |
|
139 |
<form id="optionForm" method="post">
|
@@ -462,7 +476,6 @@ if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isse
|
|
462 |
</form>
|
463 |
</div>
|
464 |
|
465 |
-
<?php if( isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' ) { itro_update_option('delete_data',$_POST['delete_data']); } ?>
|
466 |
<form id="delete_data" method="post" style="clear:both;">
|
467 |
<br>
|
468 |
<hr>
|
3 |
Copyright 2013 I.T.RO.® (email : support.itro@live.com)
|
4 |
This file is part of ITRO Popup Plugin.
|
5 |
*/
|
6 |
+
global $ITRO_VER;
|
7 |
|
8 |
if ( !current_user_can( 'manage_options' ) ) {
|
9 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
53 |
$submitted_form = 'mt_submit_hidden';
|
54 |
}
|
55 |
|
|
|
|
|
56 |
/* ordered options */
|
57 |
for($i=0;$i<count($opt_name); $i++)
|
58 |
{
|
60 |
$opt_val[$i] = itro_get_option( $opt_name[$i] );
|
61 |
$px_opt_val[$i] = itro_get_option( 'px_' . $opt_name[$i] );
|
62 |
$perc_opt_val[$i] = itro_get_option( 'perc_' . $opt_name[$i] );
|
63 |
+
|
64 |
/* See if the user has posted us some information */
|
65 |
/* If they did, this hidden field will be set to 'Y' */
|
66 |
if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' )
|
121 |
if( empty($_POST['background_source']) ) { $opt_val[22] = NULL; itro_update_option('background_source',NULL); }
|
122 |
else { itro_update_option('background_source',$_POST['background_source']); }
|
123 |
}
|
124 |
+
|
125 |
+
/* delete tables on plugin uninstall option */
|
126 |
+
if( isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' )
|
127 |
+
{
|
128 |
+
if( isset($_POST['delete_data']) )
|
129 |
+
{
|
130 |
+
itro_update_option('delete_data', $_POST['delete_data']);
|
131 |
+
}
|
132 |
+
else
|
133 |
+
{
|
134 |
+
itro_update_option('delete_data', NULL);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
itro_admin_style();
|
139 |
/* Put an settings updated message on the screen */
|
140 |
if( isset($_POST[ $submitted_form ]) && $_POST[ $submitted_form ] == 'Y' || isset($_POST['delete_data_hidden']) && $_POST['delete_data_hidden'] == 'Y' ) {
|
147 |
|
148 |
<div style="display:table; width:100%;">
|
149 |
<h1 style="float:left;"><?php _e( 'I.T.RO. Popup Plugin - Settings', 'itro-plugin');?></h1>
|
150 |
+
<h4 style="float:right; margin-right:30px;">VER: <?php echo $ITRO_VER; ?></h4>
|
151 |
</div>
|
152 |
|
153 |
<form id="optionForm" method="post">
|
476 |
</form>
|
477 |
</div>
|
478 |
|
|
|
479 |
<form id="delete_data" method="post" style="clear:both;">
|
480 |
<br>
|
481 |
<hr>
|
functions/js-function.php
CHANGED
@@ -8,73 +8,7 @@ This file is part of ITRO Popup Plugin.
|
|
8 |
function itro_popup_js()
|
9 |
{ ?>
|
10 |
<script type="text/javascript">
|
11 |
-
/* manage fade in animation */
|
12 |
-
function itro_enter_anim()
|
13 |
-
{
|
14 |
-
itro_popup.style.visibility = '';
|
15 |
-
itro_opaco.style.visibility = '';
|
16 |
-
itro_popup.style.display = 'none';
|
17 |
-
itro_opaco.style.display = 'none';
|
18 |
-
jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
|
19 |
-
}
|
20 |
|
21 |
-
/* function for automatic top margin refresh, to center the popup vertically */
|
22 |
-
function marginRefresh()
|
23 |
-
{
|
24 |
-
if( typeof( window.innerWidth ) == 'number' )
|
25 |
-
{
|
26 |
-
/* Non-IE */
|
27 |
-
browserWidth = window.innerWidth;
|
28 |
-
browserHeight = window.innerHeight;
|
29 |
-
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
30 |
-
{
|
31 |
-
/* IE 6+ in 'standards compliant mode' */
|
32 |
-
browserWidth = document.documentElement.clientWidth;
|
33 |
-
browserHeight = document.documentElement.clientHeight;
|
34 |
-
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
35 |
-
{
|
36 |
-
/* IE 4 compatible */
|
37 |
-
browserWidth = document.body.clientWidth;
|
38 |
-
browserHeight = document.body.clientHeight;
|
39 |
-
}
|
40 |
-
popupHeight = document.getElementById('itro_popup').offsetHeight ; /* get the actual px size of popup div */
|
41 |
-
document.getElementById('itro_popup').style.top = (browserHeight - popupHeight)/2 + "px"; /* update the top margin of popup */
|
42 |
-
}
|
43 |
-
|
44 |
-
/* function for countdown to show popup when the delay is set */
|
45 |
-
function popup_delay()
|
46 |
-
{
|
47 |
-
delay--;
|
48 |
-
if(delay <= 0)
|
49 |
-
{
|
50 |
-
clearInterval(interval_id_delay);
|
51 |
-
itro_enter_anim();
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
/* countdown for automatic closing */
|
56 |
-
function popTimer()
|
57 |
-
{
|
58 |
-
if (popTime>0)
|
59 |
-
{
|
60 |
-
document.getElementById("timer").innerHTML=popTime;
|
61 |
-
popTime--;
|
62 |
-
}
|
63 |
-
else
|
64 |
-
{
|
65 |
-
clearInterval(interval_id);
|
66 |
-
jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
/* function use to set the cookie for next visualization time */
|
71 |
-
function itro_set_cookie(c_name,value,exhours)
|
72 |
-
{
|
73 |
-
var exdate=new Date();
|
74 |
-
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
75 |
-
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
76 |
-
document.cookie=c_name + "=" + c_value + "; path=/";
|
77 |
-
}
|
78 |
<?php
|
79 |
if (itro_get_option('age_restriction') == NULL) /* OFF age validation */
|
80 |
{
|
@@ -130,7 +64,7 @@ function itro_popup_js()
|
|
130 |
if( itro_get_option('popup_delay') != 0 )
|
131 |
{ ?>
|
132 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
133 |
-
|
134 |
<?php
|
135 |
}
|
136 |
else
|
@@ -258,81 +192,6 @@ function itro_slidebar($slider_target_id,$slider_value,$slider_min,$slider_max,$
|
|
258 |
} <?php
|
259 |
} ?>
|
260 |
</script><?php
|
261 |
-
}
|
262 |
-
|
263 |
-
/* -------------- LOAD SCRIPTS FOR ADMIN PANNEL */
|
264 |
-
function itro_admin_js()
|
265 |
-
{ ?>
|
266 |
-
<script type="text/javascript">
|
267 |
-
function itro_pos(e)
|
268 |
-
{
|
269 |
-
e = e || window.event;
|
270 |
-
x_pos = e.clientX;
|
271 |
-
}
|
272 |
-
|
273 |
-
function itro_mutual_check(checkbox_id_1,checkbox_id_2,box)
|
274 |
-
{
|
275 |
-
if (!box)
|
276 |
-
{
|
277 |
-
if( checkbox_id_2 == '' ) {document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked; return 1;}
|
278 |
-
if( checkbox_id_1 == '' ) {return 0;}
|
279 |
-
if(checkbox_id_1 == checkbox_id_2) { return 0; }
|
280 |
-
document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked;
|
281 |
-
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
282 |
-
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
283 |
-
}
|
284 |
-
else
|
285 |
-
{
|
286 |
-
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
287 |
-
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
288 |
-
}
|
289 |
-
}
|
290 |
-
jQuery(document).ready(function() {
|
291 |
-
|
292 |
-
var orig_send_to_editor = window.send_to_editor;
|
293 |
-
var uploadID = ''; /*setup the var in a global scope*/
|
294 |
-
|
295 |
-
jQuery('#upload_button').click(function() {
|
296 |
-
uploadID = jQuery(this).prev('input'); /*set the uploadID variable to the value of the input before the upload button*/
|
297 |
-
formfield = jQuery('.upload').attr('name');
|
298 |
-
tb_show('', 'media-upload.php?type=image&amp;amp;TB_iframe=true');
|
299 |
-
|
300 |
-
/* restore send_to_editor() when tb closed */
|
301 |
-
jQuery("#TB_window").bind('tb_unload', function () {
|
302 |
-
window.send_to_editor = orig_send_to_editor;
|
303 |
-
});
|
304 |
-
|
305 |
-
/* temporarily redefine send_to_editor() */
|
306 |
-
window.send_to_editor = function(html) {
|
307 |
-
imgurl = jQuery('img',html).attr('src');
|
308 |
-
uploadID.val(imgurl); /*assign the value of the image src to the input*/
|
309 |
-
document.getElementById('yes_bg').checked=true;
|
310 |
-
tb_remove();
|
311 |
-
};
|
312 |
-
return false;
|
313 |
-
});
|
314 |
-
});
|
315 |
-
|
316 |
-
var itro_option_state;
|
317 |
-
function itro_check_state(state_check_id)
|
318 |
-
{
|
319 |
-
itro_option_state = state_check_id.selected;
|
320 |
-
}
|
321 |
-
|
322 |
-
function itro_select(target_id)
|
323 |
-
{
|
324 |
-
target_id.selected = !itro_option_state;
|
325 |
-
itro_option_state = !itro_option_state;
|
326 |
-
}
|
327 |
-
|
328 |
-
function itro_set_cookie(c_name,value,exhours)
|
329 |
-
{
|
330 |
-
var exdate=new Date();
|
331 |
-
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
332 |
-
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
333 |
-
document.cookie=c_name + "=" + c_value + "; path=/";
|
334 |
-
}
|
335 |
-
</script><?php
|
336 |
}
|
337 |
|
338 |
/* show and hide parts of admin pannel such as top margin and basic settings */
|
8 |
function itro_popup_js()
|
9 |
{ ?>
|
10 |
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<?php
|
13 |
if (itro_get_option('age_restriction') == NULL) /* OFF age validation */
|
14 |
{
|
64 |
if( itro_get_option('popup_delay') != 0 )
|
65 |
{ ?>
|
66 |
var delay = <?php echo itro_get_option('popup_delay') . '+' . '1'; ?> ;
|
67 |
+
interval_id_delay = setInterval(function(){popup_delay();},1000);
|
68 |
<?php
|
69 |
}
|
70 |
else
|
192 |
} <?php
|
193 |
} ?>
|
194 |
</script><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
|
197 |
/* show and hide parts of admin pannel such as top margin and basic settings */
|
mc-main.php
CHANGED
@@ -8,12 +8,12 @@ Plugin URI: http://www.itro.eu/
|
|
8 |
Description: EN - Show a perfecly centered customizable popup and a popup-system for age-restricted site and allow to insert own HTML code. IT - Visualizza un popup perfettamente centrato e personalizzabile con possibile blocco per i siti con restrizioni di eta' e permette di inserire il proprio codice HTML.
|
9 |
Author: I.T.RO.(c) Sez. Informatica
|
10 |
E-mail: support.itro@live.com
|
11 |
-
Version: 4.5
|
12 |
Author URI: http://www.itro.eu/
|
13 |
*/
|
14 |
|
15 |
global $ITRO_VER;
|
16 |
-
$ITRO_VER = 4.
|
17 |
define('itroLocalPath', __DIR__);
|
18 |
define('itroPath', plugins_url() . '/itro-popup/');
|
19 |
define('itroImages', plugins_url() . '/itro-popup/images/');
|
@@ -35,6 +35,7 @@ function itro_admin_scripts()
|
|
35 |
wp_enqueue_script('thickbox');
|
36 |
wp_enqueue_script('jquery-effects-highlight');
|
37 |
wp_enqueue_script('jquery-effects-fade');
|
|
|
38 |
}
|
39 |
|
40 |
function itro_load_admin_styles()
|
@@ -44,7 +45,8 @@ function itro_load_admin_styles()
|
|
44 |
|
45 |
function itro_load_script()
|
46 |
{
|
47 |
-
wp_enqueue_script('jquery');
|
|
|
48 |
}
|
49 |
|
50 |
function itro_get_woo_shop_id()
|
@@ -58,8 +60,6 @@ add_action( 'wp_head','itro_send_header');
|
|
58 |
add_action( 'wp_footer','itro_display_popup');
|
59 |
add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
|
60 |
|
61 |
-
|
62 |
-
add_action('admin_head', 'itro_admin_js');
|
63 |
add_action('admin_print_scripts', 'itro_admin_scripts');
|
64 |
add_action('admin_print_styles', 'itro_load_admin_styles');
|
65 |
add_action('admin_menu', 'itro_plugin_menu');
|
8 |
Description: EN - Show a perfecly centered customizable popup and a popup-system for age-restricted site and allow to insert own HTML code. IT - Visualizza un popup perfettamente centrato e personalizzabile con possibile blocco per i siti con restrizioni di eta' e permette di inserire il proprio codice HTML.
|
9 |
Author: I.T.RO.(c) Sez. Informatica
|
10 |
E-mail: support.itro@live.com
|
11 |
+
Version: 4.5.2
|
12 |
Author URI: http://www.itro.eu/
|
13 |
*/
|
14 |
|
15 |
global $ITRO_VER;
|
16 |
+
$ITRO_VER = 4.52;
|
17 |
define('itroLocalPath', __DIR__);
|
18 |
define('itroPath', plugins_url() . '/itro-popup/');
|
19 |
define('itroImages', plugins_url() . '/itro-popup/images/');
|
35 |
wp_enqueue_script('thickbox');
|
36 |
wp_enqueue_script('jquery-effects-highlight');
|
37 |
wp_enqueue_script('jquery-effects-fade');
|
38 |
+
wp_enqueue_script( 'itro-admin-scripts', itroPath . '/scripts/itro-admin-scripts.js', array( 'jquery' ) );
|
39 |
}
|
40 |
|
41 |
function itro_load_admin_styles()
|
45 |
|
46 |
function itro_load_script()
|
47 |
{
|
48 |
+
wp_enqueue_script( 'jquery' );
|
49 |
+
wp_enqueue_script( 'itro-scripts', itroPath . '/scripts/itro-scripts.js', array( 'jquery' ) );
|
50 |
}
|
51 |
|
52 |
function itro_get_woo_shop_id()
|
60 |
add_action( 'wp_footer','itro_display_popup');
|
61 |
add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
|
62 |
|
|
|
|
|
63 |
add_action('admin_print_scripts', 'itro_admin_scripts');
|
64 |
add_action('admin_print_styles', 'itro_load_admin_styles');
|
65 |
add_action('admin_menu', 'itro_plugin_menu');
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== ITRO Popup Plugin ===
|
2 |
Contributors: ITRO
|
3 |
Donate link: http://www.itro.eu/index.php/donate/
|
4 |
-
Tags: popup, popup message, popup box, popup ads, popup advertising, age restriction, popup block, violence, age validation, adult, adult content, content warning, content warning popup,
|
5 |
Requires at least: 3.0.1
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 4.5
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -17,6 +17,10 @@ ITRO Popup display a popup to your WP site:
|
|
17 |
|
18 |
ITRO Popup Plugin - The BEST WP Popup Plugin
|
19 |
|
|
|
|
|
|
|
|
|
20 |
★ Pretty fade-in and fade-out animation.
|
21 |
★ Need to remove plugin and save data? It is possible!
|
22 |
★ Selcted pages where you want to display the popup, by a scrollable list. NO SHORTCODES NEEDED!
|
@@ -75,6 +79,12 @@ DONATE NOW! - HELP US TO DEVELOP FOR YOU! [DONATE NOW](http://www.itro.eu/?page_
|
|
75 |
no screenshot avaliable
|
76 |
|
77 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
= 4.5 =
|
79 |
Automatically retrieve debug info for quick support. Code manteniance.
|
80 |
|
@@ -221,6 +231,12 @@ bug fixed: color table now works in admin pannel.
|
|
221 |
First released version.
|
222 |
|
223 |
== Upgrade Notice ==
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
= 4.5 =
|
225 |
Automatically retrieve debug info for quick support. Code manteniance.
|
226 |
|
1 |
=== ITRO Popup Plugin ===
|
2 |
Contributors: ITRO
|
3 |
Donate link: http://www.itro.eu/index.php/donate/
|
4 |
+
Tags: popup, popup message, popup box, popup ads, popup advertising, age restriction, popup block, popup violence, age validation popup, adult, adult content, content warning, content warning popup, fancy box, fancy popup, custom popup, advertising popup, pop-up, lightbox, lightbox popup,
|
5 |
Requires at least: 3.0.1
|
6 |
+
Tested up to: 3.6
|
7 |
+
Stable tag: 4.5.2
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
17 |
|
18 |
ITRO Popup Plugin - The BEST WP Popup Plugin
|
19 |
|
20 |
+
WANT MORE FEATURES? Try ITRO Popup Premium for free and purchase it at only:
|
21 |
+
--->>> €6.99 <<<---
|
22 |
+
[TRY IT FOR FREE!](http://www.itro.eu/ccount12/click.php?id=4)
|
23 |
+
|
24 |
★ Pretty fade-in and fade-out animation.
|
25 |
★ Need to remove plugin and save data? It is possible!
|
26 |
★ Selcted pages where you want to display the popup, by a scrollable list. NO SHORTCODES NEEDED!
|
79 |
no screenshot avaliable
|
80 |
|
81 |
== Changelog ==
|
82 |
+
= 4.5.2 =
|
83 |
+
Admin bug fixed for delete data on uninstall. Age validatition and popup delay bug fixed.
|
84 |
+
|
85 |
+
= 4.5.1 =
|
86 |
+
jQuery conflict resolved. Main js function now are rightly loaded by wp_enqueue_scripts.
|
87 |
+
|
88 |
= 4.5 =
|
89 |
Automatically retrieve debug info for quick support. Code manteniance.
|
90 |
|
231 |
First released version.
|
232 |
|
233 |
== Upgrade Notice ==
|
234 |
+
= 4.5.2 =
|
235 |
+
Admin bug fixed for delete data on uninstall. Age validatition and popup delay bug fixed.
|
236 |
+
|
237 |
+
= 4.5.1 =
|
238 |
+
jQuery conflict resolved. Main js function now are rightly loaded by wp_enqueue_scripts func.
|
239 |
+
|
240 |
= 4.5 =
|
241 |
Automatically retrieve debug info for quick support. Code manteniance.
|
242 |
|
scripts/itro-admin-scripts.js
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* -------------- SCRIPTS FOR ADMIN PANNEL */
|
2 |
+
|
3 |
+
function itro_pos(e)
|
4 |
+
{
|
5 |
+
e = e || window.event;
|
6 |
+
x_pos = e.clientX;
|
7 |
+
}
|
8 |
+
|
9 |
+
function itro_mutual_check(checkbox_id_1,checkbox_id_2,box)
|
10 |
+
{
|
11 |
+
if (!box)
|
12 |
+
{
|
13 |
+
if( checkbox_id_2 == '' ) {document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked; return 1;}
|
14 |
+
if( checkbox_id_1 == '' ) {return 0;}
|
15 |
+
if(checkbox_id_1 == checkbox_id_2) { return 0; }
|
16 |
+
document.getElementById(checkbox_id_1).checked = !document.getElementById(checkbox_id_1).checked;
|
17 |
+
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
18 |
+
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
19 |
+
}
|
20 |
+
else
|
21 |
+
{
|
22 |
+
if( document.getElementById(checkbox_id_1).checked || document.getElementById(checkbox_id_2).checked )
|
23 |
+
{ document.getElementById(checkbox_id_2).checked = !document.getElementById(checkbox_id_1).checked; }
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
jQuery(document).ready(function()
|
28 |
+
{
|
29 |
+
var orig_send_to_editor = window.send_to_editor;
|
30 |
+
var uploadID = ''; /*setup the var in a global scope*/
|
31 |
+
|
32 |
+
jQuery('#upload_button').click(function()
|
33 |
+
{
|
34 |
+
uploadID = jQuery(this).prev('input'); /*set the uploadID variable to the value of the input before the upload button*/
|
35 |
+
formfield = jQuery('.upload').attr('name');
|
36 |
+
tb_show('', 'media-upload.php?type=image&amp;amp;TB_iframe=true');
|
37 |
+
|
38 |
+
/* restore send_to_editor() when tb closed */
|
39 |
+
jQuery("#TB_window").bind('tb_unload', function ()
|
40 |
+
{
|
41 |
+
window.send_to_editor = orig_send_to_editor;
|
42 |
+
});
|
43 |
+
|
44 |
+
/* temporarily redefine send_to_editor() */
|
45 |
+
window.send_to_editor = function(html)
|
46 |
+
{
|
47 |
+
imgurl = jQuery('img',html).attr('src');
|
48 |
+
uploadID.val(imgurl); /*assign the value of the image src to the input*/
|
49 |
+
document.getElementById('yes_bg').checked=true;
|
50 |
+
tb_remove();
|
51 |
+
};
|
52 |
+
return false;
|
53 |
+
});
|
54 |
+
});
|
55 |
+
|
56 |
+
var itro_option_state;
|
57 |
+
function itro_check_state(state_check_id)
|
58 |
+
{
|
59 |
+
itro_option_state = state_check_id.selected;
|
60 |
+
}
|
61 |
+
|
62 |
+
function itro_select(target_id)
|
63 |
+
{
|
64 |
+
target_id.selected = !itro_option_state;
|
65 |
+
itro_option_state = !itro_option_state;
|
66 |
+
}
|
67 |
+
|
68 |
+
function itro_set_cookie(c_name,value,exhours)
|
69 |
+
{
|
70 |
+
var exdate=new Date();
|
71 |
+
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
72 |
+
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
73 |
+
document.cookie=c_name + "=" + c_value + "; path=/";
|
74 |
+
}
|
scripts/itro-scripts.js
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* manage fade in animation */
|
2 |
+
function itro_enter_anim()
|
3 |
+
{
|
4 |
+
itro_popup.style.visibility = '';
|
5 |
+
itro_opaco.style.visibility = '';
|
6 |
+
itro_popup.style.display = 'none';
|
7 |
+
itro_opaco.style.display = 'none';
|
8 |
+
jQuery("#itro_opaco").fadeIn(function() {jQuery("#itro_popup").fadeIn();});
|
9 |
+
}
|
10 |
+
|
11 |
+
/* function for automatic top margin refresh, to center the popup vertically */
|
12 |
+
function marginRefresh()
|
13 |
+
{
|
14 |
+
if( typeof( window.innerWidth ) == 'number' )
|
15 |
+
{
|
16 |
+
/* Non-IE */
|
17 |
+
browserWidth = window.innerWidth;
|
18 |
+
browserHeight = window.innerHeight;
|
19 |
+
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
20 |
+
{
|
21 |
+
/* IE 6+ in 'standards compliant mode' */
|
22 |
+
browserWidth = document.documentElement.clientWidth;
|
23 |
+
browserHeight = document.documentElement.clientHeight;
|
24 |
+
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
25 |
+
{
|
26 |
+
/* IE 4 compatible */
|
27 |
+
browserWidth = document.body.clientWidth;
|
28 |
+
browserHeight = document.body.clientHeight;
|
29 |
+
}
|
30 |
+
popupHeight = document.getElementById('itro_popup').offsetHeight ; /* get the actual px size of popup div */
|
31 |
+
document.getElementById('itro_popup').style.top = (browserHeight - popupHeight)/2 + "px"; /* update the top margin of popup */
|
32 |
+
}
|
33 |
+
|
34 |
+
/* function for countdown to show popup when the delay is set */
|
35 |
+
function popup_delay()
|
36 |
+
{
|
37 |
+
delay--;
|
38 |
+
if(delay <= 0)
|
39 |
+
{
|
40 |
+
clearInterval(interval_id_delay);
|
41 |
+
itro_enter_anim();
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/* countdown for automatic closing */
|
46 |
+
function popTimer()
|
47 |
+
{
|
48 |
+
if (popTime>0)
|
49 |
+
{
|
50 |
+
document.getElementById("timer").innerHTML=popTime;
|
51 |
+
popTime--;
|
52 |
+
}
|
53 |
+
else
|
54 |
+
{
|
55 |
+
clearInterval(interval_id);
|
56 |
+
jQuery("#itro_popup").fadeOut(function() {itro_opaco.style.visibility='Hidden';});
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
/* function use to set the cookie for next visualization time */
|
61 |
+
function itro_set_cookie(c_name,value,exhours)
|
62 |
+
{
|
63 |
+
var exdate=new Date();
|
64 |
+
exdate.setTime(exdate.getTime() + (exhours * 3600 * 1000));
|
65 |
+
var c_value=escape(value) + ((exhours==null) ? "" : "; expires="+exdate.toUTCString());
|
66 |
+
document.cookie=c_name + "=" + c_value + "; path=/";
|
67 |
+
}
|