Version Description
- Fixed: Issues with file writing. Basically many users don't install WordPress with all the permissions correct. So... Had to move it back to ~/uploads/. Sorry Otto, that's just how it is.
- Fixed: #1444 - output of typography all_styles when font_style UI was hidden.
- Fixed: #1440 - flaw in new cleanFilePath logic.
- Fixed: #1432 - Theme check failing when double-slashes existed in get_template_directory() return.
- Removed: curlRead from helper class.
- Fixed: #1426 - menu_name not appearing on front end admin bar.
- Added: #1427 - button_set added to customizer UI. Thanks @wpexplorer.
- Fixed: #1429 - ACE Editor erroring with no default value set.
- Fixed: wp_filesystem now initialized with credentials in an effort to combat the tmp file issue.
- Modified: Code purification.
- Modified: How section tabs work. Isolated within the redux-container class.
- Modified: #1412 - Redesigned text label, placeholder fix.
Download this release
Release Info
Developer | dovyp |
Plugin | Redux Framework |
Version | 3.3.4 |
Comparing to | |
See all releases |
Code changes from version 3.3.3 to 3.3.4
- README.md +25 -0
- README.txt +16 -1
- ReduxCore/assets/js/redux.js +132 -35
- ReduxCore/assets/js/redux.min.js +2 -2
- ReduxCore/extensions/customizer/extension_customizer.php +1 -0
- ReduxCore/framework.php +286 -413
- ReduxCore/inc/class.redux_filesystem.php +84 -0
- ReduxCore/inc/class.redux_functions.php +247 -246
- ReduxCore/inc/class.redux_helpers.php +148 -128
- ReduxCore/inc/fields/ace_editor/field_ace_editor.php +15 -3
- ReduxCore/inc/fields/button_set/field_button_set.php +1 -1
- ReduxCore/inc/fields/text/field_text.php +6 -2
- ReduxCore/inc/fields/typography/field_typography.php +44 -23
- class.redux-plugin.php +1 -1
- redux-framework.php +1 -1
- sample/sample-config.php +3 -5
README.md
CHANGED
@@ -78,6 +78,31 @@ Send me an email at ghost1227@reduxframework.com so I can add you to our user sp
|
|
78 |
|
79 |
### Master ###
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
= 3.3.3 =
|
82 |
* Modified: #1412 - Redesigned text label, placeholder fix.
|
83 |
|
78 |
|
79 |
### Master ###
|
80 |
|
81 |
+
= 3.3.3.8 =
|
82 |
+
* Fixed: Issues with file writing. Basically many users don't install WordPress with all the permissions correct. So... Had to move it back to /uploads/. Sorry Otto, that's just how it is.
|
83 |
+
* Fixed: #1444 - output of typography all_styles when font_style UI was hidden.
|
84 |
+
|
85 |
+
= 3.3.3.7 =
|
86 |
+
* Fixed: #1440 - flaw in new cleanFilePath logic.
|
87 |
+
|
88 |
+
= 3.3.3.6 =
|
89 |
+
* Fixed: #1432 - Theme check failing when double-slashes existed in get_template_directory() return.
|
90 |
+
* Removed: curlRead from helper class.
|
91 |
+
|
92 |
+
= 3.3.3.5 =
|
93 |
+
* Fixed: #1426 - menu_name not appearing on front end admin bar.
|
94 |
+
* Added: #1427 - button_set added to customizer UI. Thanks @wpexplorer.
|
95 |
+
|
96 |
+
= 3.3.3.4 =
|
97 |
+
* Fixed: #1429 - ACE Editor erroring with no default value set.
|
98 |
+
* Fixed: wp_filesystem now initialized with credentials in an effort to combat the tmp file issue.
|
99 |
+
|
100 |
+
= 3.3.3.3 =
|
101 |
+
* Modified: Code purification.
|
102 |
+
|
103 |
+
= 3.3.3.2 =
|
104 |
+
* Modified: How section tabs work. Isolated within the redux-container class.
|
105 |
+
|
106 |
= 3.3.3 =
|
107 |
* Modified: #1412 - Redesigned text label, placeholder fix.
|
108 |
|
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: admin, admin interface, options, theme options, plugin options, options framework, settings, web fonts, google fonts
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 3.3.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -125,6 +125,21 @@ That's because the real FAQ section is on our site! Please visit [http://docs.re
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
= 3.3.3 =
|
129 |
* Fixed: #1408 & #1357 - Typography subsets losing value after multiple saves on other panels.
|
130 |
* Fixed: #1403 - unit value no longer prints after empty typography values
|
4 |
Tags: admin, admin interface, options, theme options, plugin options, options framework, settings, web fonts, google fonts
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 3.3.4
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 3.3.4 =
|
129 |
+
* Fixed: Issues with file writing. Basically many users don't install WordPress with all the permissions
|
130 |
+
correct. So... Had to move it back to ~/uploads/. Sorry Otto, that's just how it is.
|
131 |
+
* Fixed: #1444 - output of typography all_styles when font_style UI was hidden.
|
132 |
+
* Fixed: #1440 - flaw in new cleanFilePath logic.
|
133 |
+
* Fixed: #1432 - Theme check failing when double-slashes existed in get_template_directory() return.
|
134 |
+
* Removed: curlRead from helper class.
|
135 |
+
* Fixed: #1426 - menu_name not appearing on front end admin bar.
|
136 |
+
* Added: #1427 - button_set added to customizer UI. Thanks @wpexplorer.
|
137 |
+
* Fixed: #1429 - ACE Editor erroring with no default value set.
|
138 |
+
* Fixed: wp_filesystem now initialized with credentials in an effort to combat the tmp file issue.
|
139 |
+
* Modified: Code purification.
|
140 |
+
* Modified: How section tabs work. Isolated within the redux-container class.
|
141 |
+
* Modified: #1412 - Redesigned text label, placeholder fix.
|
142 |
+
|
143 |
= 3.3.3 =
|
144 |
* Fixed: #1408 & #1357 - Typography subsets losing value after multiple saves on other panels.
|
145 |
* Fixed: #1403 - unit value no longer prints after empty typography values
|
ReduxCore/assets/js/redux.js
CHANGED
@@ -36,9 +36,107 @@
|
|
36 |
$.redux.notices();
|
37 |
$.redux.tabControl();
|
38 |
$.redux.devFunctions();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
$.redux.initEvents = function() {
|
43 |
$('.redux-action_bar, .redux-presets-bar').on(
|
44 |
'click', function() {
|
@@ -52,7 +150,6 @@
|
|
52 |
e.preventDefault();
|
53 |
|
54 |
var url = $(this).attr('href').split('&tab=');
|
55 |
-
|
56 |
$('#' + url[1] + '_section_group_li_a').click();
|
57 |
return false;
|
58 |
}
|
@@ -283,9 +380,9 @@
|
|
283 |
$.redux.tabCheck = function() {
|
284 |
$('.redux-group-tab-link-a').click(
|
285 |
function() {
|
286 |
-
|
287 |
var relid = $(this).data('rel'); // The group ID of interest
|
288 |
-
var oldid =
|
289 |
|
290 |
if (oldid === relid) {
|
291 |
return;
|
@@ -302,15 +399,15 @@
|
|
302 |
);
|
303 |
}
|
304 |
|
305 |
-
if (
|
306 |
-
var parentID =
|
307 |
parentID = parentID[0];
|
308 |
}
|
309 |
|
310 |
-
|
311 |
-
|
312 |
|
313 |
-
|
314 |
function() {
|
315 |
var url = $(this).attr('href').split('&tab=');
|
316 |
if (url[1] == relid || url[1] == parentID) {
|
@@ -320,61 +417,61 @@
|
|
320 |
}
|
321 |
);
|
322 |
|
323 |
-
if (
|
324 |
//console.log('RELID is child of oldid');
|
325 |
-
|
326 |
-
|
327 |
-
} else if (
|
328 |
//console.log('RELID is sibling or child of OLDID');
|
329 |
-
if (
|
330 |
//console.log('child of oldid');
|
331 |
-
|
332 |
} else {
|
333 |
//console.log('sibling');
|
334 |
-
|
335 |
-
|
336 |
}
|
337 |
-
|
338 |
} else {
|
339 |
-
|
340 |
|
341 |
-
if (
|
342 |
//console.log('oldid is parent')
|
343 |
-
|
344 |
'fast', function() {
|
345 |
-
|
346 |
}
|
347 |
);
|
348 |
-
} else if (
|
349 |
//console.log('oldid is a child');
|
350 |
-
if (
|
351 |
//console.log('oldid is child, but not of relid');
|
352 |
-
|
353 |
'fast', function() {
|
354 |
-
|
355 |
-
|
356 |
}
|
357 |
);
|
358 |
} else {
|
359 |
-
|
360 |
}
|
361 |
} else {
|
362 |
//console.log('Normal remove active from child');
|
363 |
-
|
364 |
-
if (
|
365 |
//console.log('here');
|
366 |
-
|
367 |
-
|
368 |
}
|
369 |
}
|
370 |
}
|
371 |
|
372 |
// Show the group
|
373 |
-
|
374 |
|
375 |
-
|
376 |
200, function() {
|
377 |
-
if (
|
378 |
$.redux.stickyInfo(); // race condition fix
|
379 |
}
|
380 |
$.redux.initFields();
|
@@ -410,7 +507,7 @@
|
|
410 |
|
411 |
// Tab the first item or the saved one
|
412 |
if ($.cookie("redux_current_tab") === null || typeof ($.cookie("redux_current_tab")) === "undefined" || sTab.length === 0) {
|
413 |
-
$('.redux-group-tab-link-a:first').click();
|
414 |
} else {
|
415 |
sTab.click();
|
416 |
}
|
36 |
$.redux.notices();
|
37 |
$.redux.tabControl();
|
38 |
$.redux.devFunctions();
|
39 |
+
|
40 |
+
if ( redux.rAds ) {
|
41 |
+
$( '#redux-header' ).append( '<div class="rAds"></div>' );
|
42 |
+
var el = $( '#redux-header' );
|
43 |
+
el.css( 'position', 'relative' );
|
44 |
+
|
45 |
+
el.find( '.rAds' ).attr(
|
46 |
+
'style', 'position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;'
|
47 |
+
).css( 'left', '-99999px' );
|
48 |
+
|
49 |
+
el.find( '.rAds' ).html( redux.rAds.replace( /<br\s?\/?>/, '' ) );
|
50 |
+
var rAds = el.find( '.rAds' );
|
51 |
+
|
52 |
+
var maxHeight = el.height();
|
53 |
+
var maxWidth = el.width() - el.find( '.display_header' ).width() - 30;
|
54 |
+
|
55 |
+
$( rAds ).css( 'height', maxHeight ).css( 'max-width', maxWidth ).css( 'width', maxWidth );
|
56 |
+
|
57 |
+
rAds.find( 'a' ).css( 'float', 'right' ).css( 'line-height', el.height() + 'px' ).css(
|
58 |
+
'margin-left', '5px'
|
59 |
+
);
|
60 |
+
|
61 |
+
$( window ).load(
|
62 |
+
function() {
|
63 |
+
$.redux.resizeAds();
|
64 |
+
}
|
65 |
+
);
|
66 |
+
|
67 |
+
$( window ).resize(
|
68 |
+
function() {
|
69 |
+
$.redux.resizeAds();
|
70 |
+
}
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
}
|
75 |
);
|
76 |
+
|
77 |
+
$.redux.scaleToRatio = function( el, maxHeight, maxWidth ) {
|
78 |
+
var ratio = 0; // Used for aspect ratio
|
79 |
+
var width = el.width(); // Current image width
|
80 |
+
var height = el.height(); // Current image height
|
81 |
+
|
82 |
+
// Check if current height is larger than max
|
83 |
+
if ( height > maxHeight ) {
|
84 |
+
ratio = maxHeight / height; // get ratio for scaling image
|
85 |
+
|
86 |
+
el.css( "height", maxHeight ); // Set new height
|
87 |
+
el.css( "width", width * ratio ); // Scale width based on ratio
|
88 |
+
|
89 |
+
width = width * ratio; // Reset width to match scaled image
|
90 |
+
height = height * ratio; // Reset height to match scaled image
|
91 |
+
} else {
|
92 |
+
el.css( "height", height ); // Set new height
|
93 |
+
}
|
94 |
|
95 |
+
// Check if the current width is larger than the max
|
96 |
+
if ( width > maxWidth ) {
|
97 |
+
ratio = maxWidth / width; // get ratio for scaling image
|
98 |
+
|
99 |
+
el.css( "width", maxWidth ); // Set new width
|
100 |
+
el.css( "height", height * ratio ); // Scale height based on ratio
|
101 |
+
|
102 |
+
height = height * ratio; // Reset height to match scaled image
|
103 |
+
width = width * ratio; // Reset width to match scaled image
|
104 |
+
} else {
|
105 |
+
el.css( "width", width ); // Set new height
|
106 |
+
}
|
107 |
+
};
|
108 |
+
|
109 |
+
$.redux.resizeAds = function() {
|
110 |
+
var el = $( '#redux-header' );
|
111 |
+
var rAds = el.find( '.rAds' );
|
112 |
+
var maxHeight = el.height();
|
113 |
+
var maxWidth = el.width() - el.find( '.display_header' ).width() - 30;
|
114 |
+
|
115 |
+
$( rAds ).find( 'video' ).each(
|
116 |
+
function() {
|
117 |
+
$.redux.scaleToRatio( $( this ), maxHeight, maxWidth );
|
118 |
+
}
|
119 |
+
);
|
120 |
+
|
121 |
+
$( rAds ).find( 'img' ).each(
|
122 |
+
function() {
|
123 |
+
$.redux.scaleToRatio( $( this ), maxHeight, maxWidth );
|
124 |
+
}
|
125 |
+
);
|
126 |
+
|
127 |
+
$( rAds ).find( 'div' ).each(
|
128 |
+
function() {
|
129 |
+
$.redux.scaleToRatio( $( this ), maxHeight, maxWidth );
|
130 |
+
}
|
131 |
+
);
|
132 |
+
|
133 |
+
if ( rAds.css( 'left' ) == "-99999px" ) {
|
134 |
+
rAds.css( 'display', 'none' ).css( 'left', 'auto' );
|
135 |
+
}
|
136 |
+
|
137 |
+
rAds.fadeIn( 'slow' );
|
138 |
+
};
|
139 |
+
|
140 |
$.redux.initEvents = function() {
|
141 |
$('.redux-action_bar, .redux-presets-bar').on(
|
142 |
'click', function() {
|
150 |
e.preventDefault();
|
151 |
|
152 |
var url = $(this).attr('href').split('&tab=');
|
|
|
153 |
$('#' + url[1] + '_section_group_li_a').click();
|
154 |
return false;
|
155 |
}
|
380 |
$.redux.tabCheck = function() {
|
381 |
$('.redux-group-tab-link-a').click(
|
382 |
function() {
|
383 |
+
var el = $(this ).parents('.redux-container:first');
|
384 |
var relid = $(this).data('rel'); // The group ID of interest
|
385 |
+
var oldid = el.find('.redux-group-tab-link-li.active .redux-group-tab-link-a').data('rel');
|
386 |
|
387 |
if (oldid === relid) {
|
388 |
return;
|
399 |
);
|
400 |
}
|
401 |
|
402 |
+
if (el.find('#' + relid + '_section_group_li').parents('.redux-group-tab-link-li').length) {
|
403 |
+
var parentID = el.find('#' + relid + '_section_group_li').parents('.redux-group-tab-link-li').attr('id').split('_');
|
404 |
parentID = parentID[0];
|
405 |
}
|
406 |
|
407 |
+
el.find('#toplevel_page_' + redux.args.slug + ' .wp-submenu a.current').removeClass('current');
|
408 |
+
el.find('#toplevel_page_' + redux.args.slug + ' .wp-submenu li.current').removeClass('current');
|
409 |
|
410 |
+
el.find('#toplevel_page_' + redux.args.slug + ' .wp-submenu a').each(
|
411 |
function() {
|
412 |
var url = $(this).attr('href').split('&tab=');
|
413 |
if (url[1] == relid || url[1] == parentID) {
|
417 |
}
|
418 |
);
|
419 |
|
420 |
+
if (el.find('#' + oldid + '_section_group_li').find('#' + oldid + '_section_group_li').length) {
|
421 |
//console.log('RELID is child of oldid');
|
422 |
+
el.find('#' + oldid + '_section_group_li').addClass('activeChild');
|
423 |
+
el.find('#' + relid + '_section_group_li').addClass('active').removeClass('activeChild');
|
424 |
+
} else if (el.find('#' + relid + '_section_group_li').parents('#' + oldid + '_section_group_li').length || el.find('#' + oldid + '_section_group_li').parents('ul.subsection').find('#' + relid + '_section_group_li').length) {
|
425 |
//console.log('RELID is sibling or child of OLDID');
|
426 |
+
if (el.find('#' + relid + '_section_group_li').parents('#' + oldid + '_section_group_li').length) {
|
427 |
//console.log('child of oldid');
|
428 |
+
el.find('#' + oldid + '_section_group_li').addClass('activeChild').removeClass('active');
|
429 |
} else {
|
430 |
//console.log('sibling');
|
431 |
+
el.find('#' + relid + '_section_group_li').addClass('active');
|
432 |
+
el.find('#' + oldid + '_section_group_li').removeClass('active');
|
433 |
}
|
434 |
+
el.find('#' + relid + '_section_group_li').removeClass('activeChild').addClass('active');
|
435 |
} else {
|
436 |
+
el.find('#' + relid + '_section_group_li').addClass('active').removeClass('activeChild').find('ul.subsection').slideDown();
|
437 |
|
438 |
+
if (el.find('#' + oldid + '_section_group_li').find('ul.subsection').length) {
|
439 |
//console.log('oldid is parent')
|
440 |
+
el.find('#' + oldid + '_section_group_li').find('ul.subsection').slideUp(
|
441 |
'fast', function() {
|
442 |
+
el.find('#' + oldid + '_section_group_li').removeClass('active').removeClass('activeChild');
|
443 |
}
|
444 |
);
|
445 |
+
} else if (el.find('#' + oldid + '_section_group_li').parents('ul.subsection').length) {
|
446 |
//console.log('oldid is a child');
|
447 |
+
if (!el.find('#' + oldid + '_section_group_li').parents('#' + relid + '_section_group_li').length) {
|
448 |
//console.log('oldid is child, but not of relid');
|
449 |
+
el.find('#' + oldid + '_section_group_li').parents('ul.subsection').slideUp(
|
450 |
'fast', function() {
|
451 |
+
el.find('#' + oldid + '_section_group_li').removeClass('active');
|
452 |
+
el.find('#' + oldid + '_section_group_li').parents('.redux-group-tab-link-li').removeClass('active').removeClass('activeChild');
|
453 |
}
|
454 |
);
|
455 |
} else {
|
456 |
+
el.find('#' + oldid + '_section_group_li').removeClass('active');
|
457 |
}
|
458 |
} else {
|
459 |
//console.log('Normal remove active from child');
|
460 |
+
el.find('#' + oldid + '_section_group_li').removeClass('active');
|
461 |
+
if (el.find('#' + relid + '_section_group_li').parents('.redux-group-tab-link-li').length) {
|
462 |
//console.log('here');
|
463 |
+
el.find('#' + relid + '_section_group_li').parents('.redux-group-tab-link-li').addClass('activeChild').find('ul.subsection').slideDown();
|
464 |
+
el.find('#' + relid + '_section_group_li').addClass('active');
|
465 |
}
|
466 |
}
|
467 |
}
|
468 |
|
469 |
// Show the group
|
470 |
+
el.find('#' + oldid + '_section_group').hide();
|
471 |
|
472 |
+
el.find('#' + relid + '_section_group').fadeIn(
|
473 |
200, function() {
|
474 |
+
if (el.find('#redux-footer').length !== 0) {
|
475 |
$.redux.stickyInfo(); // race condition fix
|
476 |
}
|
477 |
$.redux.initFields();
|
507 |
|
508 |
// Tab the first item or the saved one
|
509 |
if ($.cookie("redux_current_tab") === null || typeof ($.cookie("redux_current_tab")) === "undefined" || sTab.length === 0) {
|
510 |
+
$('.redux-container').find('.redux-group-tab-link-a:first').click();
|
511 |
} else {
|
512 |
sTab.click();
|
513 |
}
|
ReduxCore/assets/js/redux.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
function redux_change(a){jQuery("body").trigger("check_dependencies",a),a.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1),window.onbeforeunload=confirmOnPageExit;var b=jQuery(a).parents(".redux-container:first");if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(a).parent().find(".redux-th-error").slideUp();var c=jQuery(a).closest(".redux-group-tab").attr("id"),d=parseInt(b.find(".redux-field-errors span").text())-1,e=parseInt(b.find(".redux-field-warnings span").text())-1;if(0>=d)jQuery("#"+c+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var f=c.split("_");f=f[0];var g=b.find('.redux-group-tab-link-a[data-key="'+f+'"]').parents(".redux-group-tab-link-li:first"),h=parseInt(g.find(".redux-menu-error:first").text())-1;0>=h?g.find(".redux-menu-error:first").fadeOut().remove():g.find(".redux-menu-error:first").text(h);var i=parseInt(g.find(".redux-menu-warning:first").text())-1;0>=i?g.find(".redux-menu-warning:first").fadeOut().remove():g.find(".redux-menu-warning:first").text(i),b.find(".redux-field-errors span").text(d),b.find(".redux-field-warning span").text(e)}var j=jQuery("#"+c+"_li").parents(".hasSubSections:first");0!==j.length&&0===j.find(".redux-menu-error").length&&j.find(".hasError").removeClass("hasError")}redux.args.disable_save_warn||b.find(".redux-save-warn").slideDown()}function colorValidate(a){var b=jQuery(a).val(),c=colorNameToHex(b);return c!==b.replace("#","")?c:b}function colorNameToHex(a){var b=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==c[b.toLowerCase()]?c[b.toLowerCase()]:a}!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return a}function c(a){return decodeURIComponent(a.replace(e," "))}function d(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return f.json?JSON.parse(a):a}catch(b){}}var e=/\+/g,f=a.cookie=function(e,g,h){if(void 0!==g){if(h=a.extend({},f.defaults,h),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=f.json?JSON.stringify(g):String(g),document.cookie=[f.raw?e:encodeURIComponent(e),"=",f.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}for(var k=f.raw?b:c,l=document.cookie.split("; "),m=e?void 0:{},n=0,o=l.length;o>n;n++){var p=l[n].split("="),q=k(p.shift()),r=k(p.join("="));if(e&&e===q){m=d(r);break}e||(m[q]=d(r))}return m};f.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}),function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=G,this.elements={target:a},this._id=T+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:F,attr:e,onTooltip:F,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=F}function f(a){return a===G||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?F:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?F:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==F,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,G,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||F)&&(b.title=F))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===E?{ready:E}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(S,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return W.concat("").join(a?"-"+a+" ":" ")}function l(c){return c&&{type:c.type,pageX:c.pageX,pageY:c.pageY,target:c.target,relatedTarget:c.relatedTarget,scrollX:c.scrollX||a.pageXOffset||b.body.scrollLeft||b.documentElement.scrollLeft,scrollY:c.scrollY||a.pageYOffset||b.body.scrollTop||b.documentElement.scrollTop}||{}}function m(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function n(a){return this.tooltip.hasClass(bb)?F:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),void(this.timers.show=m.call(this,function(){this.toggle(E,a)},this.options.show.delay)))}function o(a){if(this.tooltip.hasClass(bb))return F;var b=d(a.relatedTarget),c=b.closest(X)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(F,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(bb)||!this.options.hide.inactive?F:(clearTimeout(this.timers.inactive),void(this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive)))}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(ib+" "))+ib,function(){var a=z.api[d.attr(this,V)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):G,p="html5"===f.metadata.type&&o?o[f.metadata.name]:G,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(E,{},z.defaults,f,"object"==typeof q?h(q):G,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===F||!j)return F;k.content.text=j}if(i.container.length||(i.container=m),i.target===F&&(i.target=n),k.show.target===F&&(k.show.target=n),k.show.solo===E&&(k.show.solo=i.container.closest("body")),k.hide.target===F&&(k.hide.target=n),k.position.viewport===E&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new B(i.at,E),i.my=new B(i.my),a.data(T))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===F)return F;return a.attr(U,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(db,l).attr("title",""),g=new e(a,k,c,!!j),a.data(T,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(T))&&a.destroy(!0)}),g}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function u(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+tb.join(f+" ")+f).split(" "),h=0;if(sb[b])return a.css(sb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return sb[b]=d,e}function v(a,b){return Math.ceil(parseFloat(u(a,b)))}function w(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function x(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}function y(a){this._ns="ie6",this.init(this.qtip=a)}var z,A,B,C,D,E=!0,F=!1,G=null,H="x",I="y",J="width",K="height",L="top",M="left",N="bottom",O="right",P="center",Q="flipinvert",R="shift",S={},T="qtip",U="data-hasqtip",V="data-qtip-id",W=["ui-widget","ui-tooltip"],X="."+T,Y="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=T+"-fixed",$=T+"-default",_=T+"-focus",ab=T+"-hover",bb=T+"-disabled",cb="_replacedByqTip",db="oldtitle",eb={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||F};A=e.prototype,A._when=function(a){return d.when.apply(d,a)},A.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[T,$,e.style.classes,T+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":F,"aria-describedby":this._id+"-content","aria-hidden":E}).toggleClass(bb,this.disabled).attr(V,this.id).data(T,this).appendTo(k.container).append(g.content=d("<div />",{"class":T+"-content",id:this._id+"-content","aria-atomic":E})),this.rendered=-1,this.positioning=E,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,F))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,F)),this.rendered=E,this._setWidget(),d.each(S,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=F,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(E,f.event,F),c.hiddenDuringWait=F}),z.api[this.id]=this,this},A.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=E;var a=this.target,b=a.attr(db);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(T).removeAttr(V).removeAttr(U).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(db),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=G,delete z.api[this.id]}}return this.destroyed?this.target:(a===E&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},C=A.checks={builtin:{"^id$":function(a,b,c,e){var f=c===E?z.nextid:c,g=T+"-"+f;f!==F&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new B(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(E)||this.toggle(E))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass($,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},A.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var fb=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,gb=/^prerender|show\.ready/i;A.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=F,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&gb.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=fb.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=E,d.each(a,d.proxy(j,this)),this.positioning=F,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?G:this.cache.event),this},A._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=E,a.then(function(a){return e.waiting=F,c._update(a,b)},G,function(a){return c._update(a,b)})):a===F||!a&&""!==a?F:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):F},A._waitForContent=function(a){var b=this.cache;return b.waiting=E,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=F}).promise()},A._updateContent=function(a,b){this._update(a,this.elements.content,b)},A._updateTitle=function(a,b){this._update(a,this.elements.title,b)===F&&this._removeTitle(F)},A._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":T+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":T+"-title","aria-atomic":E})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},A._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=G,a!==F&&this.reposition())},A.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=E;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(F),s=i.outerHeight(F),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,y=c&&"scroll"===c.type,z=d(a),A=o[0].ownerDocument,B=this.mouse;if(d.isArray(k)&&2===k.length)m={x:M,y:L},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:M,y:L},!B||!B.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=B,"static"!==v&&(w=o.offset()),A.body.offsetWidth!==(a.innerWidth||A.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&y&&B&&(w.left-=(B.scrollX||0)-z.scrollLeft(),w.top-=(B.scrollY||0)-z.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=eb.iOS?a.innerWidth:k.width(),u=eb.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):S.imagemap&&k.is("area")?f=S.imagemap(this,k,m,S.viewport?q:F):S.svg&&k&&k[0].ownerSVGElement?f=S.svg(this,k,m,S.viewport?q:F):(t=k.outerWidth(F),u=k.outerHeight(F),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(eb.iOS>3.1&&eb.iOS<4.1||eb.iOS>=4.3&&eb.iOS<4.33||!eb.iOS&&"fixed"===v)&&(w.left-=z.scrollLeft(),w.top-=z.scrollTop()),(!f||f&&f.adjustable!==F)&&(w.left+=m.x===O?t:m.x===P?t/2:0,w.top+=m.y===N?u:m.y===P?u/2:0)}return w.left+=p.x+(l.x===O?-r:l.x===P?-r/2:0),w.top+=p.y+(l.y===N?-s:l.y===P?-s/2:0),S.viewport?(w.adjusted=S.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===F||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),eb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=F,this):this},A.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!eb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var hb=(B=A.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,P).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?I:H}).prototype;hb.invert=function(a,b){this[a]=this[a]===M?O:this[a]===O?M:b||this[a]},hb.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===I||this.forceY&&"center"!==b?b+" "+a:a+" "+b},hb.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},hb.clone=function(){return new B(this.string(),this.forceY)},A.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=E),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?G:!!this._trigger(k,[90]),this.destroyed?this:(i!==F&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,F),d.isFunction(o.title)&&this._updateTitle(o.title,F),!D&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+T,this._storeMouse),D=E),p||g.css("width",g.outerWidth(F)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(X,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,D&&!d(X+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+T),D=F),this.blur(c)),j=d.proxy(function(){a?(eb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===F||r===F?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},A.show=function(a){return this.toggle(E,a)},A.hide=function(a){return this.toggle(F,a)},A.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(X),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=z.zindex+b.length;return c.hasClass(_)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+_).qtip("blur",a)),c.addClass(_)[0].style.zIndex=f),this},A.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(_),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},A.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(bb):this.disabled):"boolean"!=typeof a&&(a=E),this.rendered&&this.tooltip.toggleClass(bb,a).attr("aria-disabled",a),this.disabled=!!a,this)},A.enable=function(){return this.disable(F)},A._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":T+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(bb)||a.hide(b),F})},A._updateButton=function(a){if(!this.rendered)return F;var b=this.elements.button;a?this._createButton():b.remove()},A._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(bb);c.removeClass(bb),bb=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(bb,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass($,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(T+"-icon",!a)},A._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},A._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},A._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var ib="."+T;d(function(){r(X,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Z)&&!c.hasClass(bb)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(ab,b)}),r("["+V+"]",Y,p)}),A._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||G,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=F,!e.isDefaultPrevented()},A._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?void h.push(a.splice(c,1)[0]):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},A._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?F:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),void(this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay)))}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=E}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},A._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Z)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0,e=b.parents(X).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),z.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},A._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},z=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=G,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],T):G;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,T);if(!a)return E;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),F;a.set(b,e)}}),g!==G?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(E,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===F||c.length<1||z.api[c]?z.nextid++:c,b=s(d(this),c,k),b===F?E:(z.api[c]=b,d.each(S,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,z.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,db):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(db,b))}return d.fn["attr"+cb].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+cb].apply(this,arguments));return a||b.filter("["+db+"]").attr("title",function(){return d.attr(this,db)}).removeAttr(db),b}},function(a,b){if(!b||d.fn[a+cb])return E;var c=d.fn[a+cb]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+cb]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(U))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+cb].apply(this,arguments)}),z.version="2.2.0",z.nextid=0,z.inactiveEvents=Y,z.zindex=15e3,z.defaults={prerender:F,id:F,overwrite:E,suppress:E,content:{text:E,attr:"title",title:F,button:F},position:{my:"top left",at:"bottom right",target:F,container:F,viewport:F,adjust:{x:0,y:0,mouse:E,scroll:E,resize:E,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:F})}},show:{target:F,event:"mouseenter",effect:E,delay:90,solo:F,ready:F,autofocus:F},hide:{target:F,event:"mouseleave",effect:E,delay:0,fixed:F,inactive:F,leave:"window",distance:F},style:{classes:"",widget:F,width:F,height:F,def:E},events:{render:G,move:G,show:G,hide:G,toggle:G,visible:G,hidden:G,focus:G,blur:G}};
|
2 |
-
var jb,kb="margin",lb="border",mb="color",nb="background-color",ob="transparent",pb=" !important",qb=!!b.createElement("canvas").getContext,rb=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,sb={},tb=["Webkit","O","Moz","ms"];if(qb)var ub=a.devicePixelRatio||1,vb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),wb=ub/vb;else var xb=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'};d.extend(w.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":T+"-tip"}).prependTo(a.tooltip),qb?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=xb("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===L||a.y===P&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(E))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===F||b===F?a=F:a===E?a=new B(b.string()):a.string||(a=new B(a),a.fixed=E),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=lb+t(b)+"Width";return(c?v(c,e):v(d.content,e)||v(this._useTitle(a)&&d.titlebar||d.content,e)||v(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=lb+t(a.y)+t(a.x)+"Radius";return eb.ie<9?0:v(this._useTitle(a)&&b.titlebar||b.content,c)||v(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||rb.test(d)?F:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=lb+t(a[a.precedance])+t(mb),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,nb)||g(f,nb)||g(b.content,nb)||g(b.tooltip,nb)||c.css(nb),h[1]=g(c,e,mb)||g(f,e,mb)||g(b.content,e,mb)||g(b.tooltip,e,mb)||b.tooltip.css(e),d("*",c).add(c).css("cssText",nb+":"+ob+pb+";"+lb+":0"+pb+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===I,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(qb||eb.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===F?r=b:(r=new B(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===H?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==ob?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!rb.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==E?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===I?[s(r.x===M?l:r.x===O?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===L?k[1]-q[1]:0)]:[s(r.x===M?k[0]-q[0]:0),s(r.y===L?l:r.y===N?k[1]-q[1]-l:(k[1]-q[1])/2)],qb?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,wb),i=this._calculateTip(r,this.size,wb),o.attr(J,k[0]*wb).attr(K,k[1]*wb),o.css(J,k[0]).css(K,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*wb,j[1]*wb),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===eb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(P)>-1),left:j[0]-j[2]*Number(f===H),top:j[1]-j[2]*Number(f===I),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(xb("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==F&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return F;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===H&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===P?(h=c===I?M:L,j[h]="50%",j[kb+"-"+h]=-Math.round(b[c===I?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===H?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===R&&j.precedance===b&&k[d]&&j[c]!==P?j.precedance=j.precedance===H?I:H:a!==R&&k[d]&&(j[b]=j[b]===P?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===P?p[kb+"-"+b]=o[a]=g[kb+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=F),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:F,top:F,x:0,y:0},p={};this.corner.fixed!==E&&(e(m,H,I,M,O),e(n,I,H,L,N),j.string()===i.corner.string()||i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,F)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===R&&!!k.left)&&f(H,M,O),(o.top=n===R&&!!k.top)&&f(I,L,N),this.element.css(p).toggle(!(o.x&&o.y||j.x===P&&o.y||j.y===P&&o.x)),d.left-=g.left.charAt?g.user:m!==R||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==R||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),jb=S.tip=function(a){return new w(a,a.options.style.tip)},jb.initialize="render",jb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=E)}},C.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(E,z.defaults,{style:{tip:{corner:E,mimic:F,width:6,height:6,border:E,offset:0}}});var yb,zb,Ab="qtip-modal",Bb="."+Ab;zb=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(X);b=j.length<1?F:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(X)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return F}}).hide(),d(b.body).bind("focusin"+Bb,e),d(b).bind("keydown"+Bb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+Bb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==F?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(Bb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==F&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==F||!e&&p.length?j:(i.stop(E,F),d.isFunction(m)?m.call(i,e):m===F?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(Bb).length||i.detach(),a()}),h=e,f.destroyed&&(f=G),j)}}),j.init()},zb=new zb,d.extend(x.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=zb.elem,b.addClass(Ab).css("z-index",z.modal_zindex+d(Bb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(zb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(Bb),f=z.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);zb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+_).qtip("blur",a.originalEvent),b.addClass(_)[0].style.zIndex=f,zb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(Bb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void zb.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(Ab),this.qtip._unbind(this.qtip.tooltip,this._ns),zb.toggle(this.qtip,F),delete this.qtip.elements.overlay}}),yb=S.modal=function(a){return new x(a,a.options.show.modal)},yb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=E))},z.modal_zindex=z.zindex-200,yb.initialize="render",C.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(E,z.defaults,{show:{modal:{on:F,effect:E,blur:E,stealfocus:E,escape:E}}}),S.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===R,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===J?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===P?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===J?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===Q?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===P?-C:C)+e,l.invert(a,g)),d[f]<r&&-d[f]>B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),z=y[0],A=y[1]||y[0],B=e.viewport,C=e.container,D=c.cache,E={left:0,top:0};return B.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=C.offset()||E,o="static"===C.css("position"),k="fixed"===u.css("position"),p=B[0]===a?B.width():B.outerWidth(F),q=B[0]===a?B.height():B.outerHeight(F),r={left:k?0:B.scrollLeft(),top:k?0:B.scrollTop()},s=B.offset()||E,("shift"!==z||"shift"!==A)&&(l=v.clone()),E={left:"none"!==z?j(H,I,z,x.x,M,O,J,f,h):0,top:"none"!==A?j(I,H,A,x.y,L,N,K,g,i):0},l&&D.lastClass!==(m=T+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),E):E},S.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:F},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===M?i=d:b.x===O?i=f.width-d:i+=Math.floor(d/2),b.y===L?j=e:b.y===N?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===M&&k>=i||b.x===O&&i>=k||b.x===P&&(i>k||k>f.width-i)||b.y===L&&l>=j||b.y===N&&j>=l||b.y===P&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=S.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:F}},circle:function(a,b,c,d){return S.polys.ellipse(a,b,c,c,d)}},S.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o,p,q=d(b),r=c[0],s=d(r.ownerSVGElement),t=1,u=1,v=!0;!r.getBBox;)r=r.parentNode;if(!r.getBBox||!r.parentNode)return F;f=s.attr("width")||s.width()||parseInt(s.css("width"),10),g=s.attr("height")||s.height()||parseInt(s.css("height"),10);var w=(parseInt(c.css("stroke-width"),10)||0)/2;switch(w&&(t+=w/f,u+=w/g),r.nodeName){case"ellipse":case"circle":o=S.polys.ellipse(r.cx.baseVal.value,r.cy.baseVal.value,(r.rx||r.r).baseVal.value+w,(r.ry||r.r).baseVal.value+w,e);break;case"line":case"polygon":case"polyline":for(n=r.points||[{x:r.x1.baseVal.value,y:r.y1.baseVal.value},{x:r.x2.baseVal.value,y:r.y2.baseVal.value}],o=[],m=-1,k=n.numberOfItems||n.length;++m<k;)l=n.getItem?n.getItem(m):n[m],o.push.apply(o,[l.x,l.y]);o=S.polys.polygon(o,e);break;default:o=r.getBoundingClientRect(),o={width:o.width,height:o.height,position:{left:o.left,top:o.top}},v=!1}return p=o.position,s=s[0],v&&(s.createSVGPoint&&(h=r.getScreenCTM(),n=s.createSVGPoint(),n.x=p.left,n.y=p.top,i=n.matrixTransform(h),p.left=i.x,p.top=i.y),s.viewBox&&(j=s.viewBox.baseVal)&&j.width&&j.height&&(t*=f/j.width,u*=g/j.height)),p.left+=q.scrollLeft(),p.top+=q.scrollTop(),o},S.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=b.attr("shape").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return F;if("polygon"===j)h=S.polys.polygon(m,c);else{if(!S.polys[j])return F;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=S.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(F)-k.width())/2),e.top+=Math.ceil((k.outerHeight(F)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Cb,Db='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(y.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Db).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:T+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(F),width:c.outerWidth(F)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[J,M]:[K,L],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(K,f.height),f.width?e.css(J,f.width):(e.css(J,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(J,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Cb=S.ie6=function(a){return 6===eb.ie?new y(a):F},Cb.initialize="render",C.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&d<c.min&&e.val(""),void(f(c.max)&&d>c.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),a.alphanum_caret(e.length==f.length+1?g-1:g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c<b.min?!0:!1}function s(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");k(g,c,b)&&e.push(c)}return e.join("")}function t(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");l(g,c,b)&&e.push(c)}return e.join("")}function u(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==b&&b!=c?!0:!1}function v(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==c&&b!=c?!0:!1}function w(a){return a.toUpperCase()==a.toLowerCase()?!0:!1}function x(a,b){var c=new B(H+b),d=new B(a),e=c.subtract(d);return e}function y(){var a,b="0123456789".split(""),c={},d=0;for(d=0;d<b.length;d++)a=b[d],c[a]=!0;return c}function z(){var a="abcdefghijklmnopqrstuvwxyz",b=a.toUpperCase(),c=new B(a+b);return c}function A(a){if(0==a.length)return!1;var b=a.indexOf(J);if(b>=0)return!1;var c=a.indexOf(I);if(0>c)return!0;var d=a.lastIndexOf(I),e=a.length-d-1;if(3>e)return!1;var f=m(a.substring(c));return f%3>0?!1:!0}function B(a){this.map="string"==typeof a?C(a):{}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e<d.length;e++)b=d[e],c[b]=!0;return c}a.fn.alphanum=function(a){var b=i(a),c=this;return d(c,s,b),this},a.fn.alpha=function(a){var b=i("alpha"),c=i(a,b),e=this;return d(e,s,c),this},a.fn.numeric=function(a){var b=j(a),c=this;return d(c,t,b),c.blur(function(){e(this,a)}),this};var D={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:0/0},E={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:0/0,maxDecimalPlaces:0/0,maxPreDecimalPlaces:0/0,max:0/0,min:0/0},F={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},G={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},H=b()+c(),I=",",J=".",K=y(),L=z();B.prototype.add=function(a){var b=this.clone();for(var c in a.map)b.map[c]=!0;return b},B.prototype.subtract=function(a){var b=this.clone();for(var c in a.map)delete b.map[c];return b},B.prototype.contains=function(a){return this.map[a]?!0:!1},B.prototype.clone=function(){var a=new B;for(var b in this.map)a.map[b]=!0;return a},a.fn.alphanum.backdoorAlphaNum=function(a,b){var c=i(b);return s(a,c)},a.fn.alphanum.backdoorNumeric=function(a,b){var c=j(b);return t(a,c)},a.fn.alphanum.setNumericSeparators=function(a){1==a.thousandsSeparator.length&&1==a.decimalSeparator.length&&(I=a.thousandsSeparator,J=a.decimalSeparator)}}(jQuery),function(a){function b(a,b){if(a.createTextRange){var c=a.createTextRange();c.move("character",b),c.select()}else null!=a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function c(a){if("selection"in document){var b=a.createTextRange();try{b.setEndPoint("EndToStart",document.selection.createRange())}catch(c){return 0}return b.text.length}return null!=a.selectionStart?a.selectionStart:void 0}a.fn.alphanum_caret=function(d,e){return"undefined"==typeof d?c(this.get(0)):this.queue(function(c){if(isNaN(d)){var f=a(this).val().indexOf(d);e===!0?f+=d.length:"undefined"!=typeof e&&(f+=e),b(this,f)}else b(this,d);c()})}}(jQuery),function(a){var b=function(a){return a?a.ownerDocument.defaultView||a.ownerDocument.parentWindow:window},c=function(b){var c=a.Range.current(b).clone(),d=a.Range(b).select(b);return c.overlaps(d)?(c.compare("START_TO_START",d)<1?(startPos=0,c.move("START_TO_START",d)):(fromElementToCurrent=d.clone(),fromElementToCurrent.move("END_TO_START",c),startPos=fromElementToCurrent.toString().length),endPos=c.compare("END_TO_END",d)>=0?d.toString().length:startPos+c.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]<b&&(c[0]={el:d,count:c[0]-a}),"number"==typeof c[1]&&c[1]<=b&&(c[1]={el:d,count:c[1]-a})},g=function(a,b,c){var d,e;c=c||0;for(var h=0;a[h];h++)d=a[h],3===d.nodeType||4===d.nodeType?(e=c,c+=d.nodeValue.length,f(e,c,b,d)):8!==d.nodeType&&(c=g(d.childNodes,b,c));return c};jQuery.fn.selection=function(a,b){return void 0!==a?this.each(function(){e(this,a,b)}):d(this[0])},a.fn.selection.getCharElement=g}(jQuery),function(a){"use strict";a.redux=a.redux||{},a(document).ready(function(){a.fn.isOnScreen=function(){if(window){var b=a(window),c={top:b.scrollTop(),left:b.scrollLeft()};c.right=c.left+b.width(),c.bottom=c.top+b.height();var d=this.offset();return d.right=d.left+this.outerWidth(),d.bottom=d.top+this.outerHeight(),!(c.right<d.left||c.left>d.right||c.bottom<d.top||c.top>d.bottom)}},a.redux.checkRequired(),a.redux.initEvents(),a.redux.initQtip(),a.redux.tabCheck(),a.redux.notices(),a.redux.tabControl(),a.redux.devFunctions()}),a.redux.initEvents=function(){a(".redux-action_bar, .redux-presets-bar").on("click",function(){window.onbeforeunload=null}),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item").click(function(b){if(a("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||a(this).hasClass("ab-item")){b.preventDefault();var c=a(this).attr("href").split("&tab=");return a("#"+c[1]+"_section_group_li_a").click(),!1}}),a('input[name="'+redux.args.opt_name+'[defaults]"]').click(function(){return confirm(redux.args.reset_confirm)?void(window.onbeforeunload=null):!1}),a('input[name="'+redux.args.opt_name+'[defaults-section]"]').click(function(){return confirm(redux.args.reset_section_confirm)?void(window.onbeforeunload=null):!1}),a(".expand_options").click(function(b){return b.preventDefault(),a.redux.expandOptions(a(this).parents(".redux-container:first")),!1}),a(".saved_notice").is(":visible")&&a(".saved_notice").slideDown(),a(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){a(this).hasClass("noUpdate")||redux_change(a(this))});var b=a("#redux-footer").height();a("#redux-sticky-padder").css({height:b}),0!==a("#redux-footer").length&&(a(window).scroll(function(){a.redux.stickyInfo()}),a(window).resize(function(){a.redux.stickyInfo()})),a(".saved_notice").delay(4e3).slideUp(),a(".redux-save").click(function(){window.onbeforeunload=null})},a.redux.checkRequired=function(){a.redux.required(),a("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(){a.redux.check_dependencies(this)}),a("body").on("check_dependencies",function(b,c){a.redux.check_dependencies(c)}),a("td > fieldset:empty,td > div:empty").parent().parent().hide()},a.redux.initQtip=function(){if(a().qtip){var b="",c=redux.args.hints.tip_style.shadow;c===!0&&(b="qtip-shadow");var d="",e=redux.args.hints.tip_style.color;""!==e&&(d="qtip-"+e);var f="",g=redux.args.hints.tip_style.rounded;g===!0&&(f="qtip-rounded");var h="",i=redux.args.hints.tip_style.style;""!==i&&(h="qtip-"+i);var j=b+","+d+","+f+","+h;j=j.replace(/,/g," ");var k=redux.args.hints.tip_position.my,l=redux.args.hints.tip_position.at;k=a.redux.verifyPos(k.toLowerCase(),!0),l=a.redux.verifyPos(l.toLowerCase(),!1);var m=redux.args.hints.tip_effect.show.event,n=redux.args.hints.tip_effect.hide.event,o=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,q=redux.args.hints.tip_effect.hide.effect,r=redux.args.hints.tip_effect.hide.duration;a("div.redux-hint-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){switch(o){case"slide":a(this).slideDown(p);break;case"fade":a(this).fadeIn(p);break;default:a(this).show()}},event:m},hide:{effect:function(){switch(q){case"slide":a(this).slideUp(r);break;case"fade":a(this).fadeOut(r);break;default:a(this).show(r)}},event:n},style:{classes:j},position:{my:k,at:l}})}),a("input[qtip-content]").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:"focus",hide:"blur",style:j,position:{my:k,at:l}})})}},a.redux.tabCheck=function(){a(".redux-group-tab-link-a").click(function(){var b=a(this).data("rel"),c=a(".redux-group-tab-link-li.active .redux-group-tab-link-a").data("rel");if(c!==b){if(a("#currentSection").val(b),a(this).parents(".postbox-container:first").length||a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").parents(".redux-group-tab-link-li").length){var d=a("#"+b+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");d=d[0]}a("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),a("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var c=a(this).attr("href").split("&tab=");(c[1]==b||c[1]==d)&&(a(this).addClass("current"),a(this).parent().addClass("current"))}),a("#"+c+"_section_group_li").find("#"+c+"_section_group_li").length?(a("#"+c+"_section_group_li").addClass("activeChild"),a("#"+b+"_section_group_li").addClass("active").removeClass("activeChild")):a("#"+b+"_section_group_li").parents("#"+c+"_section_group_li").length||a("#"+c+"_section_group_li").parents("ul.subsection").find("#"+b+"_section_group_li").length?(a("#"+b+"_section_group_li").parents("#"+c+"_section_group_li").length?a("#"+c+"_section_group_li").addClass("activeChild").removeClass("active"):(a("#"+b+"_section_group_li").addClass("active"),a("#"+c+"_section_group_li").removeClass("active")),a("#"+b+"_section_group_li").removeClass("activeChild").addClass("active")):(a("#"+b+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),a("#"+c+"_section_group_li").find("ul.subsection").length?a("#"+c+"_section_group_li").find("ul.subsection").slideUp("fast",function(){a("#"+c+"_section_group_li").removeClass("active").removeClass("activeChild")
|
3 |
-
}):a("#"+c+"_section_group_li").parents("ul.subsection").length?a("#"+c+"_section_group_li").parents("#"+b+"_section_group_li").length?a("#"+c+"_section_group_li").removeClass("active"):a("#"+c+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){a("#"+c+"_section_group_li").removeClass("active"),a("#"+c+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild")}):(a("#"+c+"_section_group_li").removeClass("active"),a("#"+b+"_section_group_li").parents(".redux-group-tab-link-li").length&&(a("#"+b+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),a("#"+b+"_section_group_li").addClass("active")))),a("#"+c+"_section_group").hide(),a("#"+b+"_section_group").fadeIn(200,function(){0!==a("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()})}});var b=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==b?a.cookie("redux_current_tab_get")!==b&&(a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a.cookie("redux_current_tab_get",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").click()):""!==a.cookie("redux_current_tab_get")&&a.removeCookie("redux_current_tab_get");var c=a("#"+a.cookie("redux_current_tab")+"_section_group_li_a");null===a.cookie("redux_current_tab")||"undefined"==typeof a.cookie("redux_current_tab")||0===c.length?a(".redux-group-tab-link-a:first").click():c.click()},a.redux.initFields=function(){a(".redux-field-init:visible").each(function(){var b=a(this).attr("data-type");redux.field_objects[b]&&redux.field_objects[b].init()})},a.redux.notices=function(){void 0!==redux.errors&&(a.each(redux.errors.errors,function(b,c){a.each(c.errors,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-error"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").length&&a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-error">'+c.msg+"</div>")})}),a(".redux-container").each(function(){var b=a(this),c=b.find(".redux-field-error").length;c>0&&(b.find(".redux-field-errors span").text(c),b.find(".redux-field-errors").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-error").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-error">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasError");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasError")}}));var d=b.find(".redux-field-warning").length;d>0&&(b.find(".redux-field-warnings span").text(d),b.find(".redux-field-warnings").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-warning").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-warning">'+total+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasWarning");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},a.redux.tabControl=function(){a(".redux-section-tabs div").hide(),a(".redux-section-tabs div:first").show(),a(".redux-section-tabs ul li:first").addClass("active"),a(".redux-section-tabs ul li a").click(function(){a(".redux-section-tabs ul li").removeClass("active"),a(this).parent().addClass("active");var b=a(this).attr("href");return a(".redux-section-tabs div").hide(),a(b).fadeIn("medium",function(){a.redux.initFields()}),!1})},a.redux.devFunctions=function(){a("#consolePrintObject").on("click",function(b){b.preventDefault(),console.log(a.parseJSON(a("#redux-object-json").html()))}),"function"==typeof jsonView&&jsonView("#redux-object-json","#redux-object-browser")},a.redux.required=function(){a.each(redux.folds,function(b,c){var d=a("#"+redux.args.opt_name+"-"+b);if(d.parents("tr:first").addClass("fold"),"hide"==c){if(d.parents("tr:first").addClass("hide"),d.hasClass("redux-container-section")){var e=a("#section-"+b);e.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).hide().addClass("hide"),e.hide().addClass("hide"))}if(d.hasClass("redux-container-info")&&a("#info-"+b).hide().addClass("hide"),d.hasClass("redux-container-divide")&&a("#divide-"+b).hide().addClass("hide"),d.hasClass("redux-container-raw")){var f=d.parents().find(".redux-raw-table");f.hide().addClass("hide")}}})},a.redux.get_container_value=function(b){var c=a("#"+redux.args.opt_name+"-"+b).serializeForm();return null!==c&&"object"==typeof c&&c.hasOwnProperty(redux.args.opt_name)&&(c=c[redux.args.opt_name][b]),c},a.redux.check_dependencies=function(b){if(null!==redux.required){var c=a(b),d=c.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(d)){var e=c.parents(".redux-field-container:first"),f=e.parents("tr:first").hasClass(".hide");a.each(redux.required[d],function(b){var c=a(this),d=!1,e=a("#"+redux.args.opt_name+"-"+b),g=e.parents("tr:first");if(f||(d=a.redux.check_parents_dependencies(b)),d===!0){if(e.hasClass("redux-container-section")){var h=a("#section-"+b);h.hasClass("redux-section-indent-start")&&h.hasClass("hide")&&(a("#section-table-"+b).fadeIn(300).removeClass("hide"),h.fadeIn(300).removeClass("hide"))}if(e.hasClass("redux-container-info")&&a("#info-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-divide")&&a("#divide-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-raw")){var i=e.parents().find(".redux-raw-table");i.fadeIn(300).removeClass("hide")}g.fadeIn(300,function(){a(this).removeClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.check_dependencies(a("#"+redux.args.opt_name+"-"+b).children().first()),a.redux.initFields()}),(e.hasClass("redux-container-section")||e.hasClass("redux-container-info"))&&g.css({display:"none"})}else d===!1&&g.fadeOut(100,function(){a(this).addClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.required_recursive_hide(b)});c.find("select, radio, input[type=checkbox]").trigger("change")})}}},a.redux.required_recursive_hide=function(b){var c=a("#"+redux.args.opt_name+"-"+b).parents("tr:first");c.fadeOut(50,function(){if(a(this).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-section")){var c=a("#section-"+b);c.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).fadeOut(50).addClass("hide"),c.fadeOut(50).addClass("hide"))}if(a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-info")&&a("#info-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-divide")&&a("#divide-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-raw")){var d=a("#"+redux.args.opt_name+"-"+b).parents().find(".redux-raw-table");d.fadeOut(50).addClass("hide")}redux.required.hasOwnProperty(b)&&a.each(redux.required[b],function(b){a.redux.required_recursive_hide(b)})})},a.redux.check_parents_dependencies=function(b){var c="";return redux.required_child.hasOwnProperty(b)?a.each(redux.required_child[b],function(b,d){if(a("#"+redux.args.opt_name+"-"+d.parent).parents("tr:first").hasClass(".hide"))c=!1;else if(c!==!1){var e=a.redux.get_container_value(d.parent);c=a.redux.check_dependencies_visibility(e,d)}}):c=!0,c},a.redux.check_dependencies_visibility=function(b,c){var d=!1,e=c.checkValue,f=c.operation;switch(f){case"=":case"equals":a.isArray(e)?-1!=a.inArray(b,e)&&(d=!0):b==e?d=!0:a.isArray(b)&&-1!=a.inArray(e,b)&&(d=!0);break;case"!=":case"not":a.isArray(e)?-1==a.inArray(b,e)&&(d=!0):b!=e?d=!0:a.isArray(b)&&-1==a.inArray(e,b)&&(d=!0);break;case">":case"greater":case"is_larger":parseFloat(b)>parseFloat(e)&&(d=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(b)>=parseFloat(e)&&(d=!0);break;case"<":case"less":case"is_smaller":parseFloat(b)<parseFloat(e)&&(d=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(b)<=parseFloat(e)&&(d=!0);break;case"contains":-1!=b.toString().indexOf(e)&&(d=!0);break;case"doesnt_contain":case"not_contain":-1==b.toString().indexOf(e)&&(d=!0);break;case"is_empty_or":(""===b||b==e)&&(d=!0);break;case"not_empty_and":""!==b&&b!=e&&(d=!0);break;case"is_empty":case"empty":case"!isset":b&&""!==b&&null!==b||(d=!0);break;case"not_empty":case"!empty":case"isset":b&&""!==b&&null!==b&&(d=!0)}return d},a.redux.verifyPos=function(a,b){if(a=a.replace(/^\s+|\s+$/gm,""),""===a||-1==a.search(" "))return b===!0?"top left":"bottom right";var c=a.split(" "),d=b?"top":"bottom";("top"==c[0]||"center"==c[0]||"bottom"==c[0])&&(d=c[0]);var e=b?"left":"right";return("left"==c[1]||"center"==c[1]||"right"==c[1])&&(e=c[1]),d+" "+e},a.redux.stickyInfo=function(){var b=a("#info_bar").width()-2;a("#info_bar").isOnScreen()||a("#redux-footer-sticky").isOnScreen()?(a("#redux-sticky").removeClass("sticky-save-warn"),a("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),a("#redux-sticky-padder").hide(),a("#redux-footer").removeClass("sticky-footer-fixed")):(a("#redux-sticky").addClass("sticky-save-warn"),a("#redux-footer").css({position:"fixed",bottom:"0",width:b}),a("#redux-footer").addClass("sticky-footer-fixed"),a(".redux-save-warn").css("left",a("#redux-sticky").offset().left),a("#redux-sticky-padder").show())},a.redux.expandOptions=function(b){var c=b.find(".expand_options"),d=b.find(".redux-sidebar").width(),e=a(".redux-group-menu .active a").data("rel")+"_section_group";return c.hasClass("expanded")?(c.removeClass("expanded"),b.find(".redux-main").removeClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),b.find(".redux-main").stop().animate({"margin-left":d},500),b.find(".redux-group-tab").each(function(){a(this).attr("id")!==e&&a(this).fadeOut("fast")})):(c.addClass("expanded"),b.find(".redux-main").addClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":-d-102},500),b.find(".redux-main").stop().animate({"margin-left":"0px"},500),b.find(".redux-group-tab").fadeIn("medium",function(){a.redux.initFields()})),!1}}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(a){a=a||window.event;var b=redux.args.save_pending;return a&&(a.returnValue=b),window.onbeforeunload=null,b};
|
1 |
function redux_change(a){jQuery("body").trigger("check_dependencies",a),a.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1),window.onbeforeunload=confirmOnPageExit;var b=jQuery(a).parents(".redux-container:first");if(jQuery(a).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(a).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(a).parent().find(".redux-th-error").slideUp();var c=jQuery(a).closest(".redux-group-tab").attr("id"),d=parseInt(b.find(".redux-field-errors span").text())-1,e=parseInt(b.find(".redux-field-warnings span").text())-1;if(0>=d)jQuery("#"+c+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+c+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+c+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(a).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var f=c.split("_");f=f[0];var g=b.find('.redux-group-tab-link-a[data-key="'+f+'"]').parents(".redux-group-tab-link-li:first"),h=parseInt(g.find(".redux-menu-error:first").text())-1;0>=h?g.find(".redux-menu-error:first").fadeOut().remove():g.find(".redux-menu-error:first").text(h);var i=parseInt(g.find(".redux-menu-warning:first").text())-1;0>=i?g.find(".redux-menu-warning:first").fadeOut().remove():g.find(".redux-menu-warning:first").text(i),b.find(".redux-field-errors span").text(d),b.find(".redux-field-warning span").text(e)}var j=jQuery("#"+c+"_li").parents(".hasSubSections:first");0!==j.length&&0===j.find(".redux-menu-error").length&&j.find(".hasError").removeClass("hasError")}redux.args.disable_save_warn||b.find(".redux-save-warn").slideDown()}function colorValidate(a){var b=jQuery(a).val(),c=colorNameToHex(b);return c!==b.replace("#","")?c:b}function colorNameToHex(a){var b=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),c={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==c[b.toLowerCase()]?c[b.toLowerCase()]:a}!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return a}function c(a){return decodeURIComponent(a.replace(e," "))}function d(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return f.json?JSON.parse(a):a}catch(b){}}var e=/\+/g,f=a.cookie=function(e,g,h){if(void 0!==g){if(h=a.extend({},f.defaults,h),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=f.json?JSON.stringify(g):String(g),document.cookie=[f.raw?e:encodeURIComponent(e),"=",f.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}for(var k=f.raw?b:c,l=document.cookie.split("; "),m=e?void 0:{},n=0,o=l.length;o>n;n++){var p=l[n].split("="),q=k(p.shift()),r=k(p.join("="));if(e&&e===q){m=d(r);break}e||(m[q]=d(r))}return m};f.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}),function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=G,this.elements={target:a},this._id=T+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:F,attr:e,onTooltip:F,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=F}function f(a){return a===G||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?F:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?F:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==F,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,G,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||F)&&(b.title=F))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===E?{ready:E}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(S,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return W.concat("").join(a?"-"+a+" ":" ")}function l(c){return c&&{type:c.type,pageX:c.pageX,pageY:c.pageY,target:c.target,relatedTarget:c.relatedTarget,scrollX:c.scrollX||a.pageXOffset||b.body.scrollLeft||b.documentElement.scrollLeft,scrollY:c.scrollY||a.pageYOffset||b.body.scrollTop||b.documentElement.scrollTop}||{}}function m(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function n(a){return this.tooltip.hasClass(bb)?F:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),void(this.timers.show=m.call(this,function(){this.toggle(E,a)},this.options.show.delay)))}function o(a){if(this.tooltip.hasClass(bb))return F;var b=d(a.relatedTarget),c=b.closest(X)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(F,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(bb)||!this.options.hide.inactive?F:(clearTimeout(this.timers.inactive),void(this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive)))}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(ib+" "))+ib,function(){var a=z.api[d.attr(this,V)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):G,p="html5"===f.metadata.type&&o?o[f.metadata.name]:G,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(E,{},z.defaults,f,"object"==typeof q?h(q):G,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===F||!j)return F;k.content.text=j}if(i.container.length||(i.container=m),i.target===F&&(i.target=n),k.show.target===F&&(k.show.target=n),k.show.solo===E&&(k.show.solo=i.container.closest("body")),k.hide.target===F&&(k.hide.target=n),k.position.viewport===E&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new B(i.at,E),i.my=new B(i.my),a.data(T))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===F)return F;return a.attr(U,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(db,l).attr("title",""),g=new e(a,k,c,!!j),a.data(T,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(T))&&a.destroy(!0)}),g}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function u(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+tb.join(f+" ")+f).split(" "),h=0;if(sb[b])return a.css(sb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return sb[b]=d,e}function v(a,b){return Math.ceil(parseFloat(u(a,b)))}function w(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function x(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}function y(a){this._ns="ie6",this.init(this.qtip=a)}var z,A,B,C,D,E=!0,F=!1,G=null,H="x",I="y",J="width",K="height",L="top",M="left",N="bottom",O="right",P="center",Q="flipinvert",R="shift",S={},T="qtip",U="data-hasqtip",V="data-qtip-id",W=["ui-widget","ui-tooltip"],X="."+T,Y="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=T+"-fixed",$=T+"-default",_=T+"-focus",ab=T+"-hover",bb=T+"-disabled",cb="_replacedByqTip",db="oldtitle",eb={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||F};A=e.prototype,A._when=function(a){return d.when.apply(d,a)},A.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[T,$,e.style.classes,T+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":F,"aria-describedby":this._id+"-content","aria-hidden":E}).toggleClass(bb,this.disabled).attr(V,this.id).data(T,this).appendTo(k.container).append(g.content=d("<div />",{"class":T+"-content",id:this._id+"-content","aria-atomic":E})),this.rendered=-1,this.positioning=E,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,F))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,F)),this.rendered=E,this._setWidget(),d.each(S,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=F,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(E,f.event,F),c.hiddenDuringWait=F}),z.api[this.id]=this,this},A.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=E;var a=this.target,b=a.attr(db);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(T).removeAttr(V).removeAttr(U).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(db),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=G,delete z.api[this.id]}}return this.destroyed?this.target:(a===E&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},C=A.checks={builtin:{"^id$":function(a,b,c,e){var f=c===E?z.nextid:c,g=T+"-"+f;f!==F&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new B(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(E)||this.toggle(E))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass($,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},A.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var fb=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,gb=/^prerender|show\.ready/i;A.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=F,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&gb.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=fb.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=E,d.each(a,d.proxy(j,this)),this.positioning=F,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?G:this.cache.event),this},A._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=E,a.then(function(a){return e.waiting=F,c._update(a,b)},G,function(a){return c._update(a,b)})):a===F||!a&&""!==a?F:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):F},A._waitForContent=function(a){var b=this.cache;return b.waiting=E,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=F}).promise()},A._updateContent=function(a,b){this._update(a,this.elements.content,b)},A._updateTitle=function(a,b){this._update(a,this.elements.title,b)===F&&this._removeTitle(F)},A._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":T+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":T+"-title","aria-atomic":E})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},A._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=G,a!==F&&this.reposition())},A.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=E;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(F),s=i.outerHeight(F),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,y=c&&"scroll"===c.type,z=d(a),A=o[0].ownerDocument,B=this.mouse;if(d.isArray(k)&&2===k.length)m={x:M,y:L},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:M,y:L},!B||!B.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=B,"static"!==v&&(w=o.offset()),A.body.offsetWidth!==(a.innerWidth||A.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&y&&B&&(w.left-=(B.scrollX||0)-z.scrollLeft(),w.top-=(B.scrollY||0)-z.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=eb.iOS?a.innerWidth:k.width(),u=eb.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):S.imagemap&&k.is("area")?f=S.imagemap(this,k,m,S.viewport?q:F):S.svg&&k&&k[0].ownerSVGElement?f=S.svg(this,k,m,S.viewport?q:F):(t=k.outerWidth(F),u=k.outerHeight(F),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(eb.iOS>3.1&&eb.iOS<4.1||eb.iOS>=4.3&&eb.iOS<4.33||!eb.iOS&&"fixed"===v)&&(w.left-=z.scrollLeft(),w.top-=z.scrollTop()),(!f||f&&f.adjustable!==F)&&(w.left+=m.x===O?t:m.x===P?t/2:0,w.top+=m.y===N?u:m.y===P?u/2:0)}return w.left+=p.x+(l.x===O?-r:l.x===P?-r/2:0),w.top+=p.y+(l.y===N?-s:l.y===P?-s/2:0),S.viewport?(w.adjusted=S.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===F||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),eb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=F,this):this},A.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!eb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var hb=(B=A.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,P).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?I:H}).prototype;hb.invert=function(a,b){this[a]=this[a]===M?O:this[a]===O?M:b||this[a]},hb.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===I||this.forceY&&"center"!==b?b+" "+a:a+" "+b},hb.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},hb.clone=function(){return new B(this.string(),this.forceY)},A.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=E),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?G:!!this._trigger(k,[90]),this.destroyed?this:(i!==F&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,F),d.isFunction(o.title)&&this._updateTitle(o.title,F),!D&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+T,this._storeMouse),D=E),p||g.css("width",g.outerWidth(F)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(X,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,D&&!d(X+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+T),D=F),this.blur(c)),j=d.proxy(function(){a?(eb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===F||r===F?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},A.show=function(a){return this.toggle(E,a)},A.hide=function(a){return this.toggle(F,a)},A.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(X),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=z.zindex+b.length;return c.hasClass(_)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+_).qtip("blur",a)),c.addClass(_)[0].style.zIndex=f),this},A.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(_),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},A.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(bb):this.disabled):"boolean"!=typeof a&&(a=E),this.rendered&&this.tooltip.toggleClass(bb,a).attr("aria-disabled",a),this.disabled=!!a,this)},A.enable=function(){return this.disable(F)},A._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":T+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(bb)||a.hide(b),F})},A._updateButton=function(a){if(!this.rendered)return F;var b=this.elements.button;a?this._createButton():b.remove()},A._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(bb);c.removeClass(bb),bb=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(bb,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass($,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(T+"-icon",!a)},A._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},A._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},A._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var ib="."+T;d(function(){r(X,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Z)&&!c.hasClass(bb)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(ab,b)}),r("["+V+"]",Y,p)}),A._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||G,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=F,!e.isDefaultPrevented()},A._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?void h.push(a.splice(c,1)[0]):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},A._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?F:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),void(this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay)))}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=E}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},A._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Z)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0,e=b.parents(X).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),z.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},A._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},z=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=G,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],T):G;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,T);if(!a)return E;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),F;a.set(b,e)}}),g!==G?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(E,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===F||c.length<1||z.api[c]?z.nextid++:c,b=s(d(this),c,k),b===F?E:(z.api[c]=b,d.each(S,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,z.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,db):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(db,b))}return d.fn["attr"+cb].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+cb].apply(this,arguments));return a||b.filter("["+db+"]").attr("title",function(){return d.attr(this,db)}).removeAttr(db),b}},function(a,b){if(!b||d.fn[a+cb])return E;var c=d.fn[a+cb]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+cb]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(U))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+cb].apply(this,arguments)}),z.version="2.2.0",z.nextid=0,z.inactiveEvents=Y,z.zindex=15e3,z.defaults={prerender:F,id:F,overwrite:E,suppress:E,content:{text:E,attr:"title",title:F,button:F},position:{my:"top left",at:"bottom right",target:F,container:F,viewport:F,adjust:{x:0,y:0,mouse:E,scroll:E,resize:E,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:F})}},show:{target:F,event:"mouseenter",effect:E,delay:90,solo:F,ready:F,autofocus:F},hide:{target:F,event:"mouseleave",effect:E,delay:0,fixed:F,inactive:F,leave:"window",distance:F},style:{classes:"",widget:F,width:F,height:F,def:E},events:{render:G,move:G,show:G,hide:G,toggle:G,visible:G,hidden:G,focus:G,blur:G}};
|
2 |
+
var jb,kb="margin",lb="border",mb="color",nb="background-color",ob="transparent",pb=" !important",qb=!!b.createElement("canvas").getContext,rb=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,sb={},tb=["Webkit","O","Moz","ms"];if(qb)var ub=a.devicePixelRatio||1,vb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),wb=ub/vb;else var xb=function(a,b,c){return"<qtipvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(b||"")+' style="behavior: url(#default#VML); '+(c||"")+'" />'};d.extend(w.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("<div />",{"class":T+"-tip"}).prependTo(a.tooltip),qb?(b=d("<canvas />").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=xb("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===L||a.y===P&&this.element.position().top+this.size[1]/2+this.options.offset<b.outerHeight(E))},_parseCorner:function(a){var b=this.qtip.options.position.my;return a===F||b===F?a=F:a===E?a=new B(b.string()):a.string||(a=new B(a),a.fixed=E),a},_parseWidth:function(a,b,c){var d=this.qtip.elements,e=lb+t(b)+"Width";return(c?v(c,e):v(d.content,e)||v(this._useTitle(a)&&d.titlebar||d.content,e)||v(d.tooltip,e))||0},_parseRadius:function(a){var b=this.qtip.elements,c=lb+t(a.y)+t(a.x)+"Radius";return eb.ie<9?0:v(this._useTitle(a)&&b.titlebar||b.content,c)||v(b.tooltip,c)||0},_invalidColour:function(a,b,c){var d=a.css(b);return!d||c&&d===a.css(c)||rb.test(d)?F:d},_parseColours:function(a){var b=this.qtip.elements,c=this.element.css("cssText",""),e=lb+t(a[a.precedance])+t(mb),f=this._useTitle(a)&&b.titlebar||b.content,g=this._invalidColour,h=[];return h[0]=g(c,nb)||g(f,nb)||g(b.content,nb)||g(b.tooltip,nb)||c.css(nb),h[1]=g(c,e,mb)||g(f,e,mb)||g(b.content,e,mb)||g(b.tooltip,e,mb)||b.tooltip.css(e),d("*",c).add(c).css("cssText",nb+":"+ob+pb+";"+lb+":0"+pb+";"),h},_calculateSize:function(a){var b,c,d,e=a.precedance===I,f=this.options.width,g=this.options.height,h="c"===a.abbrev(),i=(e?f:g)*(h?.5:1),j=Math.pow,k=Math.round,l=Math.sqrt(j(i,2)+j(g,2)),m=[this.border/i*l,this.border/g*l];return m[2]=Math.sqrt(j(m[0],2)-j(this.border,2)),m[3]=Math.sqrt(j(m[1],2)-j(this.border,2)),b=l+m[2]+m[3]+(h?0:m[0]),c=b/l,d=[k(c*f),k(c*g)],e?d:d.reverse()},_calculateTip:function(a,b,c){c=c||1,b=b||this.size;var d=b[0]*c,e=b[1]*c,f=Math.ceil(d/2),g=Math.ceil(e/2),h={br:[0,0,d,e,d,0],bl:[0,0,d,0,0,e],tr:[0,e,d,0,d,e],tl:[0,0,0,e,d,e],tc:[0,e,f,0,d,e],bc:[0,0,d,0,f,e],rc:[0,0,d,g,0,e],lc:[d,0,d,e,0,g]};return h.lt=h.br,h.rt=h.bl,h.lb=h.tr,h.rb=h.tl,h[a.abbrev()]},_drawCoords:function(a,b){a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.closePath()},create:function(){var a=this.corner=(qb||eb.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=a.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(b,c){if(!this.enabled)return this;var e,f,g,h,i,j,k,l,m=this.qtip.elements,n=this.element,o=n.children(),p=this.options,q=this.size,r=p.mimic,s=Math.round;b||(b=this.qtip.cache.corner||this.corner),r===F?r=b:(r=new B(r),r.precedance=b.precedance,"inherit"===r.x?r.x=b.x:"inherit"===r.y?r.y=b.y:r.x===r.y&&(r[b.precedance]=b[b.precedance])),f=r.precedance,b.precedance===H?this._swapDimensions():this._resetDimensions(),e=this.color=this._parseColours(b),e[1]!==ob?(l=this.border=this._parseWidth(b,b[b.precedance]),p.border&&1>l&&!rb.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==E?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===I?[s(r.x===M?l:r.x===O?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===L?k[1]-q[1]:0)]:[s(r.x===M?k[0]-q[0]:0),s(r.y===L?l:r.y===N?k[1]-q[1]-l:(k[1]-q[1])/2)],qb?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,wb),i=this._calculateTip(r,this.size,wb),o.attr(J,k[0]*wb).attr(K,k[1]*wb),o.css(J,k[0]).css(K,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*wb,j[1]*wb),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===eb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(P)>-1),left:j[0]-j[2]*Number(f===H),top:j[1]-j[2]*Number(f===I),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(xb("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==F&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return F;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===H&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===P?(h=c===I?M:L,j[h]="50%",j[kb+"-"+h]=-Math.round(b[c===I?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===H?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===R&&j.precedance===b&&k[d]&&j[c]!==P?j.precedance=j.precedance===H?I:H:a!==R&&k[d]&&(j[b]=j[b]===P?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===P?p[kb+"-"+b]=o[a]=g[kb+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=F),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:F,top:F,x:0,y:0},p={};this.corner.fixed!==E&&(e(m,H,I,M,O),e(n,I,H,L,N),j.string()===i.corner.string()||i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,F)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===R&&!!k.left)&&f(H,M,O),(o.top=n===R&&!!k.top)&&f(I,L,N),this.element.css(p).toggle(!(o.x&&o.y||j.x===P&&o.y||j.y===P&&o.x)),d.left-=g.left.charAt?g.user:m!==R||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==R||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),jb=S.tip=function(a){return new w(a,a.options.style.tip)},jb.initialize="render",jb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=E)}},C.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(E,z.defaults,{style:{tip:{corner:E,mimic:F,width:6,height:6,border:E,offset:0}}});var yb,zb,Ab="qtip-modal",Bb="."+Ab;zb=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(X);b=j.length<1?F:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(X)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return F}}).hide(),d(b.body).bind("focusin"+Bb,e),d(b).bind("keydown"+Bb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+Bb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==F?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(Bb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==F&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==F||!e&&p.length?j:(i.stop(E,F),d.isFunction(m)?m.call(i,e):m===F?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(Bb).length||i.detach(),a()}),h=e,f.destroyed&&(f=G),j)}}),j.init()},zb=new zb,d.extend(x.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=zb.elem,b.addClass(Ab).css("z-index",z.modal_zindex+d(Bb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(zb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(Bb),f=z.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);zb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+_).qtip("blur",a.originalEvent),b.addClass(_)[0].style.zIndex=f,zb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(Bb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void zb.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(Ab),this.qtip._unbind(this.qtip.tooltip,this._ns),zb.toggle(this.qtip,F),delete this.qtip.elements.overlay}}),yb=S.modal=function(a){return new x(a,a.options.show.modal)},yb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=E))},z.modal_zindex=z.zindex-200,yb.initialize="render",C.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(E,z.defaults,{show:{modal:{on:F,effect:E,blur:E,stealfocus:E,escape:E}}}),S.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===R,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===J?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===P?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===J?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===Q?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===P?-C:C)+e,l.invert(a,g)),d[f]<r&&-d[f]>B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),z=y[0],A=y[1]||y[0],B=e.viewport,C=e.container,D=c.cache,E={left:0,top:0};return B.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=C.offset()||E,o="static"===C.css("position"),k="fixed"===u.css("position"),p=B[0]===a?B.width():B.outerWidth(F),q=B[0]===a?B.height():B.outerHeight(F),r={left:k?0:B.scrollLeft(),top:k?0:B.scrollTop()},s=B.offset()||E,("shift"!==z||"shift"!==A)&&(l=v.clone()),E={left:"none"!==z?j(H,I,z,x.x,M,O,J,f,h):0,top:"none"!==A?j(I,H,A,x.y,L,N,K,g,i):0},l&&D.lastClass!==(m=T+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),E):E},S.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:F},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]<f.position.left&&(f.position.left=c[0]),c[1]>f.position.bottom&&(f.position.bottom=c[1]),c[1]<f.position.top&&(f.position.top=c[1]),h.push(c);if(d=f.width=Math.abs(f.position.right-f.position.left),e=f.height=Math.abs(f.position.bottom-f.position.top),"c"===b.abbrev())f.position={left:f.position.left+f.width/2,top:f.position.top+f.height/2};else{for(;d>0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===M?i=d:b.x===O?i=f.width-d:i+=Math.floor(d/2),b.y===L?j=e:b.y===N?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===M&&k>=i||b.x===O&&i>=k||b.x===P&&(i>k||k>f.width-i)||b.y===L&&l>=j||b.y===N&&j>=l||b.y===P&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=S.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:F}},circle:function(a,b,c,d){return S.polys.ellipse(a,b,c,c,d)}},S.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o,p,q=d(b),r=c[0],s=d(r.ownerSVGElement),t=1,u=1,v=!0;!r.getBBox;)r=r.parentNode;if(!r.getBBox||!r.parentNode)return F;f=s.attr("width")||s.width()||parseInt(s.css("width"),10),g=s.attr("height")||s.height()||parseInt(s.css("height"),10);var w=(parseInt(c.css("stroke-width"),10)||0)/2;switch(w&&(t+=w/f,u+=w/g),r.nodeName){case"ellipse":case"circle":o=S.polys.ellipse(r.cx.baseVal.value,r.cy.baseVal.value,(r.rx||r.r).baseVal.value+w,(r.ry||r.r).baseVal.value+w,e);break;case"line":case"polygon":case"polyline":for(n=r.points||[{x:r.x1.baseVal.value,y:r.y1.baseVal.value},{x:r.x2.baseVal.value,y:r.y2.baseVal.value}],o=[],m=-1,k=n.numberOfItems||n.length;++m<k;)l=n.getItem?n.getItem(m):n[m],o.push.apply(o,[l.x,l.y]);o=S.polys.polygon(o,e);break;default:o=r.getBoundingClientRect(),o={width:o.width,height:o.height,position:{left:o.left,top:o.top}},v=!1}return p=o.position,s=s[0],v&&(s.createSVGPoint&&(h=r.getScreenCTM(),n=s.createSVGPoint(),n.x=p.left,n.y=p.top,i=n.matrixTransform(h),p.left=i.x,p.top=i.y),s.viewBox&&(j=s.viewBox.baseVal)&&j.width&&j.height&&(t*=f/j.width,u*=g/j.height)),p.left+=q.scrollLeft(),p.top+=q.scrollTop(),o},S.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=b.attr("shape").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return F;if("polygon"===j)h=S.polys.polygon(m,c);else{if(!S.polys[j])return F;for(g=-1,i=m.length,f=[];++g<i;)f.push(parseInt(m[g],10));h=S.polys[j].apply(this,f.concat(c))}return e=k.offset(),e.left+=Math.ceil((k.outerWidth(F)-k.width())/2),e.top+=Math.ceil((k.outerHeight(F)-k.height())/2),h.position.left+=e.left,h.position.top+=e.top,h};var Cb,Db='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';d.extend(y.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Db).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("<div/>",{id:T+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(F),width:c.outerWidth(F)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[J,M]:[K,L],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(K,f.height),f.width?e.css(J,f.width):(e.css(J,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(J,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Cb=S.ie6=function(a){return 6===eb.ie?new y(a):F},Cb.initialize="render",C.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&d<c.min&&e.val(""),void(f(c.max)&&d>c.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),a.alphanum_caret(e.length==f.length+1?g-1:g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c<b.min?!0:!1}function s(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");k(g,c,b)&&e.push(c)}return e.join("")}function t(a,b){if("string"!=typeof a)return a;var c,d=a.split(""),e=[],f=0;for(f=0;f<d.length;f++){c=d[f];var g=e.join("");l(g,c,b)&&e.push(c)}return e.join("")}function u(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==b&&b!=c?!0:!1}function v(a){var b=a.toUpperCase(),c=a.toLowerCase();return a==c&&b!=c?!0:!1}function w(a){return a.toUpperCase()==a.toLowerCase()?!0:!1}function x(a,b){var c=new B(H+b),d=new B(a),e=c.subtract(d);return e}function y(){var a,b="0123456789".split(""),c={},d=0;for(d=0;d<b.length;d++)a=b[d],c[a]=!0;return c}function z(){var a="abcdefghijklmnopqrstuvwxyz",b=a.toUpperCase(),c=new B(a+b);return c}function A(a){if(0==a.length)return!1;var b=a.indexOf(J);if(b>=0)return!1;var c=a.indexOf(I);if(0>c)return!0;var d=a.lastIndexOf(I),e=a.length-d-1;if(3>e)return!1;var f=m(a.substring(c));return f%3>0?!1:!0}function B(a){this.map="string"==typeof a?C(a):{}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e<d.length;e++)b=d[e],c[b]=!0;return c}a.fn.alphanum=function(a){var b=i(a),c=this;return d(c,s,b),this},a.fn.alpha=function(a){var b=i("alpha"),c=i(a,b),e=this;return d(e,s,c),this},a.fn.numeric=function(a){var b=j(a),c=this;return d(c,t,b),c.blur(function(){e(this,a)}),this};var D={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:0/0},E={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:0/0,maxDecimalPlaces:0/0,maxPreDecimalPlaces:0/0,max:0/0,min:0/0},F={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},G={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},H=b()+c(),I=",",J=".",K=y(),L=z();B.prototype.add=function(a){var b=this.clone();for(var c in a.map)b.map[c]=!0;return b},B.prototype.subtract=function(a){var b=this.clone();for(var c in a.map)delete b.map[c];return b},B.prototype.contains=function(a){return this.map[a]?!0:!1},B.prototype.clone=function(){var a=new B;for(var b in this.map)a.map[b]=!0;return a},a.fn.alphanum.backdoorAlphaNum=function(a,b){var c=i(b);return s(a,c)},a.fn.alphanum.backdoorNumeric=function(a,b){var c=j(b);return t(a,c)},a.fn.alphanum.setNumericSeparators=function(a){1==a.thousandsSeparator.length&&1==a.decimalSeparator.length&&(I=a.thousandsSeparator,J=a.decimalSeparator)}}(jQuery),function(a){function b(a,b){if(a.createTextRange){var c=a.createTextRange();c.move("character",b),c.select()}else null!=a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function c(a){if("selection"in document){var b=a.createTextRange();try{b.setEndPoint("EndToStart",document.selection.createRange())}catch(c){return 0}return b.text.length}return null!=a.selectionStart?a.selectionStart:void 0}a.fn.alphanum_caret=function(d,e){return"undefined"==typeof d?c(this.get(0)):this.queue(function(c){if(isNaN(d)){var f=a(this).val().indexOf(d);e===!0?f+=d.length:"undefined"!=typeof e&&(f+=e),b(this,f)}else b(this,d);c()})}}(jQuery),function(a){var b=function(a){return a?a.ownerDocument.defaultView||a.ownerDocument.parentWindow:window},c=function(b){var c=a.Range.current(b).clone(),d=a.Range(b).select(b);return c.overlaps(d)?(c.compare("START_TO_START",d)<1?(startPos=0,c.move("START_TO_START",d)):(fromElementToCurrent=d.clone(),fromElementToCurrent.move("END_TO_START",c),startPos=fromElementToCurrent.toString().length),endPos=c.compare("END_TO_END",d)>=0?d.toString().length:startPos+c.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]<b&&(c[0]={el:d,count:c[0]-a}),"number"==typeof c[1]&&c[1]<=b&&(c[1]={el:d,count:c[1]-a})},g=function(a,b,c){var d,e;c=c||0;for(var h=0;a[h];h++)d=a[h],3===d.nodeType||4===d.nodeType?(e=c,c+=d.nodeValue.length,f(e,c,b,d)):8!==d.nodeType&&(c=g(d.childNodes,b,c));return c};jQuery.fn.selection=function(a,b){return void 0!==a?this.each(function(){e(this,a,b)}):d(this[0])},a.fn.selection.getCharElement=g}(jQuery),function(a){"use strict";a.redux=a.redux||{},a(document).ready(function(){if(a.fn.isOnScreen=function(){if(window){var b=a(window),c={top:b.scrollTop(),left:b.scrollLeft()};c.right=c.left+b.width(),c.bottom=c.top+b.height();var d=this.offset();return d.right=d.left+this.outerWidth(),d.bottom=d.top+this.outerHeight(),!(c.right<d.left||c.left>d.right||c.bottom<d.top||c.top>d.bottom)}},a.redux.checkRequired(),a.redux.initEvents(),a.redux.initQtip(),a.redux.tabCheck(),a.redux.notices(),a.redux.tabControl(),a.redux.devFunctions(),redux.rAds){a("#redux-header").append('<div class="rAds"></div>');var b=a("#redux-header");b.css("position","relative"),b.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),b.find(".rAds").html(redux.rAds.replace(/<br\s?\/?>/,""));var c=b.find(".rAds"),d=b.height(),e=b.width()-b.find(".display_header").width()-30;a(c).css("height",d).css("max-width",e).css("width",e),c.find("a").css("float","right").css("line-height",b.height()+"px").css("margin-left","5px"),a(window).load(function(){a.redux.resizeAds()}),a(window).resize(function(){a.redux.resizeAds()})}}),a.redux.scaleToRatio=function(a,b,c){var d=0,e=a.width(),f=a.height();f>b?(d=b/f,a.css("height",b),a.css("width",e*d),e*=d,f*=d):a.css("height",f),e>c?(d=c/e,a.css("width",c),a.css("height",f*d),f*=d,e*=d):a.css("width",e)},a.redux.resizeAds=function(){var b=a("#redux-header"),c=b.find(".rAds"),d=b.height(),e=b.width()-b.find(".display_header").width()-30;a(c).find("video").each(function(){a.redux.scaleToRatio(a(this),d,e)}),a(c).find("img").each(function(){a.redux.scaleToRatio(a(this),d,e)}),a(c).find("div").each(function(){a.redux.scaleToRatio(a(this),d,e)}),"-99999px"==c.css("left")&&c.css("display","none").css("left","auto"),c.fadeIn("slow")},a.redux.initEvents=function(){a(".redux-action_bar, .redux-presets-bar").on("click",function(){window.onbeforeunload=null}),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item").click(function(b){if(a("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||a(this).hasClass("ab-item")){b.preventDefault();var c=a(this).attr("href").split("&tab=");return a("#"+c[1]+"_section_group_li_a").click(),!1}}),a('input[name="'+redux.args.opt_name+'[defaults]"]').click(function(){return confirm(redux.args.reset_confirm)?void(window.onbeforeunload=null):!1}),a('input[name="'+redux.args.opt_name+'[defaults-section]"]').click(function(){return confirm(redux.args.reset_section_confirm)?void(window.onbeforeunload=null):!1}),a(".expand_options").click(function(b){return b.preventDefault(),a.redux.expandOptions(a(this).parents(".redux-container:first")),!1}),a(".saved_notice").is(":visible")&&a(".saved_notice").slideDown(),a(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){a(this).hasClass("noUpdate")||redux_change(a(this))});var b=a("#redux-footer").height();a("#redux-sticky-padder").css({height:b}),0!==a("#redux-footer").length&&(a(window).scroll(function(){a.redux.stickyInfo()}),a(window).resize(function(){a.redux.stickyInfo()})),a(".saved_notice").delay(4e3).slideUp(),a(".redux-save").click(function(){window.onbeforeunload=null})},a.redux.checkRequired=function(){a.redux.required(),a("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(){a.redux.check_dependencies(this)}),a("body").on("check_dependencies",function(b,c){a.redux.check_dependencies(c)}),a("td > fieldset:empty,td > div:empty").parent().parent().hide()},a.redux.initQtip=function(){if(a().qtip){var b="",c=redux.args.hints.tip_style.shadow;c===!0&&(b="qtip-shadow");var d="",e=redux.args.hints.tip_style.color;""!==e&&(d="qtip-"+e);var f="",g=redux.args.hints.tip_style.rounded;g===!0&&(f="qtip-rounded");var h="",i=redux.args.hints.tip_style.style;""!==i&&(h="qtip-"+i);var j=b+","+d+","+f+","+h;j=j.replace(/,/g," ");var k=redux.args.hints.tip_position.my,l=redux.args.hints.tip_position.at;k=a.redux.verifyPos(k.toLowerCase(),!0),l=a.redux.verifyPos(l.toLowerCase(),!1);var m=redux.args.hints.tip_effect.show.event,n=redux.args.hints.tip_effect.hide.event,o=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,q=redux.args.hints.tip_effect.hide.effect,r=redux.args.hints.tip_effect.hide.duration;a("div.redux-hint-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){switch(o){case"slide":a(this).slideDown(p);break;case"fade":a(this).fadeIn(p);break;default:a(this).show()}},event:m},hide:{effect:function(){switch(q){case"slide":a(this).slideUp(r);break;case"fade":a(this).fadeOut(r);break;default:a(this).show(r)
|
3 |
+
}},event:n},style:{classes:j},position:{my:k,at:l}})}),a("input[qtip-content]").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:"focus",hide:"blur",style:j,position:{my:k,at:l}})})}},a.redux.tabCheck=function(){a(".redux-group-tab-link-a").click(function(){var b=a(this).parents(".redux-container:first"),c=a(this).data("rel"),d=b.find(".redux-group-tab-link-li.active .redux-group-tab-link-a").data("rel");if(d!==c){if(a("#currentSection").val(c),a(this).parents(".postbox-container:first").length||a.cookie("redux_current_tab",c,{expires:7,path:"/"}),b.find("#"+c+"_section_group_li").parents(".redux-group-tab-link-li").length){var e=b.find("#"+c+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");e=e[0]}b.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),b.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),b.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var b=a(this).attr("href").split("&tab=");(b[1]==c||b[1]==e)&&(a(this).addClass("current"),a(this).parent().addClass("current"))}),b.find("#"+d+"_section_group_li").find("#"+d+"_section_group_li").length?(b.find("#"+d+"_section_group_li").addClass("activeChild"),b.find("#"+c+"_section_group_li").addClass("active").removeClass("activeChild")):b.find("#"+c+"_section_group_li").parents("#"+d+"_section_group_li").length||b.find("#"+d+"_section_group_li").parents("ul.subsection").find("#"+c+"_section_group_li").length?(b.find("#"+c+"_section_group_li").parents("#"+d+"_section_group_li").length?b.find("#"+d+"_section_group_li").addClass("activeChild").removeClass("active"):(b.find("#"+c+"_section_group_li").addClass("active"),b.find("#"+d+"_section_group_li").removeClass("active")),b.find("#"+c+"_section_group_li").removeClass("activeChild").addClass("active")):(b.find("#"+c+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),b.find("#"+d+"_section_group_li").find("ul.subsection").length?b.find("#"+d+"_section_group_li").find("ul.subsection").slideUp("fast",function(){b.find("#"+d+"_section_group_li").removeClass("active").removeClass("activeChild")}):b.find("#"+d+"_section_group_li").parents("ul.subsection").length?b.find("#"+d+"_section_group_li").parents("#"+c+"_section_group_li").length?b.find("#"+d+"_section_group_li").removeClass("active"):b.find("#"+d+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){b.find("#"+d+"_section_group_li").removeClass("active"),b.find("#"+d+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild")}):(b.find("#"+d+"_section_group_li").removeClass("active"),b.find("#"+c+"_section_group_li").parents(".redux-group-tab-link-li").length&&(b.find("#"+c+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),b.find("#"+c+"_section_group_li").addClass("active")))),b.find("#"+d+"_section_group").hide(),b.find("#"+c+"_section_group").fadeIn(200,function(){0!==b.find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()})}});var b=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==b?a.cookie("redux_current_tab_get")!==b&&(a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a.cookie("redux_current_tab_get",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").click()):""!==a.cookie("redux_current_tab_get")&&a.removeCookie("redux_current_tab_get");var c=a("#"+a.cookie("redux_current_tab")+"_section_group_li_a");null===a.cookie("redux_current_tab")||"undefined"==typeof a.cookie("redux_current_tab")||0===c.length?a(".redux-container").find(".redux-group-tab-link-a:first").click():c.click()},a.redux.initFields=function(){a(".redux-field-init:visible").each(function(){var b=a(this).attr("data-type");redux.field_objects[b]&&redux.field_objects[b].init()})},a.redux.notices=function(){void 0!==redux.errors&&(a.each(redux.errors.errors,function(b,c){a.each(c.errors,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-error"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").length&&a("#"+redux.args.opt_name+"-"+c.id).append('<div class="redux-th-error">'+c.msg+"</div>")})}),a(".redux-container").each(function(){var b=a(this),c=b.find(".redux-field-error").length;c>0&&(b.find(".redux-field-errors span").text(c),b.find(".redux-field-errors").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-error").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-error">'+c+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasError");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasError")}}));var d=b.find(".redux-field-warning").length;d>0&&(b.find(".redux-field-warnings span").text(d),b.find(".redux-field-warnings").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-warning").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend('<span class="redux-menu-warning">'+total+"</span>"),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasWarning");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},a.redux.tabControl=function(){a(".redux-section-tabs div").hide(),a(".redux-section-tabs div:first").show(),a(".redux-section-tabs ul li:first").addClass("active"),a(".redux-section-tabs ul li a").click(function(){a(".redux-section-tabs ul li").removeClass("active"),a(this).parent().addClass("active");var b=a(this).attr("href");return a(".redux-section-tabs div").hide(),a(b).fadeIn("medium",function(){a.redux.initFields()}),!1})},a.redux.devFunctions=function(){a("#consolePrintObject").on("click",function(b){b.preventDefault(),console.log(a.parseJSON(a("#redux-object-json").html()))}),"function"==typeof jsonView&&jsonView("#redux-object-json","#redux-object-browser")},a.redux.required=function(){a.each(redux.folds,function(b,c){var d=a("#"+redux.args.opt_name+"-"+b);if(d.parents("tr:first").addClass("fold"),"hide"==c){if(d.parents("tr:first").addClass("hide"),d.hasClass("redux-container-section")){var e=a("#section-"+b);e.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).hide().addClass("hide"),e.hide().addClass("hide"))}if(d.hasClass("redux-container-info")&&a("#info-"+b).hide().addClass("hide"),d.hasClass("redux-container-divide")&&a("#divide-"+b).hide().addClass("hide"),d.hasClass("redux-container-raw")){var f=d.parents().find(".redux-raw-table");f.hide().addClass("hide")}}})},a.redux.get_container_value=function(b){var c=a("#"+redux.args.opt_name+"-"+b).serializeForm();return null!==c&&"object"==typeof c&&c.hasOwnProperty(redux.args.opt_name)&&(c=c[redux.args.opt_name][b]),c},a.redux.check_dependencies=function(b){if(null!==redux.required){var c=a(b),d=c.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(d)){var e=c.parents(".redux-field-container:first"),f=e.parents("tr:first").hasClass(".hide");a.each(redux.required[d],function(b){var c=a(this),d=!1,e=a("#"+redux.args.opt_name+"-"+b),g=e.parents("tr:first");if(f||(d=a.redux.check_parents_dependencies(b)),d===!0){if(e.hasClass("redux-container-section")){var h=a("#section-"+b);h.hasClass("redux-section-indent-start")&&h.hasClass("hide")&&(a("#section-table-"+b).fadeIn(300).removeClass("hide"),h.fadeIn(300).removeClass("hide"))}if(e.hasClass("redux-container-info")&&a("#info-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-divide")&&a("#divide-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-raw")){var i=e.parents().find(".redux-raw-table");i.fadeIn(300).removeClass("hide")}g.fadeIn(300,function(){a(this).removeClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.check_dependencies(a("#"+redux.args.opt_name+"-"+b).children().first()),a.redux.initFields()}),(e.hasClass("redux-container-section")||e.hasClass("redux-container-info"))&&g.css({display:"none"})}else d===!1&&g.fadeOut(100,function(){a(this).addClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.required_recursive_hide(b)});c.find("select, radio, input[type=checkbox]").trigger("change")})}}},a.redux.required_recursive_hide=function(b){var c=a("#"+redux.args.opt_name+"-"+b).parents("tr:first");c.fadeOut(50,function(){if(a(this).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-section")){var c=a("#section-"+b);c.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).fadeOut(50).addClass("hide"),c.fadeOut(50).addClass("hide"))}if(a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-info")&&a("#info-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-divide")&&a("#divide-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-raw")){var d=a("#"+redux.args.opt_name+"-"+b).parents().find(".redux-raw-table");d.fadeOut(50).addClass("hide")}redux.required.hasOwnProperty(b)&&a.each(redux.required[b],function(b){a.redux.required_recursive_hide(b)})})},a.redux.check_parents_dependencies=function(b){var c="";return redux.required_child.hasOwnProperty(b)?a.each(redux.required_child[b],function(b,d){if(a("#"+redux.args.opt_name+"-"+d.parent).parents("tr:first").hasClass(".hide"))c=!1;else if(c!==!1){var e=a.redux.get_container_value(d.parent);c=a.redux.check_dependencies_visibility(e,d)}}):c=!0,c},a.redux.check_dependencies_visibility=function(b,c){var d=!1,e=c.checkValue,f=c.operation;switch(f){case"=":case"equals":a.isArray(e)?-1!=a.inArray(b,e)&&(d=!0):b==e?d=!0:a.isArray(b)&&-1!=a.inArray(e,b)&&(d=!0);break;case"!=":case"not":a.isArray(e)?-1==a.inArray(b,e)&&(d=!0):b!=e?d=!0:a.isArray(b)&&-1==a.inArray(e,b)&&(d=!0);break;case">":case"greater":case"is_larger":parseFloat(b)>parseFloat(e)&&(d=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(b)>=parseFloat(e)&&(d=!0);break;case"<":case"less":case"is_smaller":parseFloat(b)<parseFloat(e)&&(d=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(b)<=parseFloat(e)&&(d=!0);break;case"contains":-1!=b.toString().indexOf(e)&&(d=!0);break;case"doesnt_contain":case"not_contain":-1==b.toString().indexOf(e)&&(d=!0);break;case"is_empty_or":(""===b||b==e)&&(d=!0);break;case"not_empty_and":""!==b&&b!=e&&(d=!0);break;case"is_empty":case"empty":case"!isset":b&&""!==b&&null!==b||(d=!0);break;case"not_empty":case"!empty":case"isset":b&&""!==b&&null!==b&&(d=!0)}return d},a.redux.verifyPos=function(a,b){if(a=a.replace(/^\s+|\s+$/gm,""),""===a||-1==a.search(" "))return b===!0?"top left":"bottom right";var c=a.split(" "),d=b?"top":"bottom";("top"==c[0]||"center"==c[0]||"bottom"==c[0])&&(d=c[0]);var e=b?"left":"right";return("left"==c[1]||"center"==c[1]||"right"==c[1])&&(e=c[1]),d+" "+e},a.redux.stickyInfo=function(){var b=a("#info_bar").width()-2;a("#info_bar").isOnScreen()||a("#redux-footer-sticky").isOnScreen()?(a("#redux-sticky").removeClass("sticky-save-warn"),a("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),a("#redux-sticky-padder").hide(),a("#redux-footer").removeClass("sticky-footer-fixed")):(a("#redux-sticky").addClass("sticky-save-warn"),a("#redux-footer").css({position:"fixed",bottom:"0",width:b}),a("#redux-footer").addClass("sticky-footer-fixed"),a(".redux-save-warn").css("left",a("#redux-sticky").offset().left),a("#redux-sticky-padder").show())},a.redux.expandOptions=function(b){var c=b.find(".expand_options"),d=b.find(".redux-sidebar").width(),e=a(".redux-group-menu .active a").data("rel")+"_section_group";return c.hasClass("expanded")?(c.removeClass("expanded"),b.find(".redux-main").removeClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),b.find(".redux-main").stop().animate({"margin-left":d},500),b.find(".redux-group-tab").each(function(){a(this).attr("id")!==e&&a(this).fadeOut("fast")})):(c.addClass("expanded"),b.find(".redux-main").addClass("expand"),b.find(".redux-sidebar").stop().animate({"margin-left":-d-102},500),b.find(".redux-main").stop().animate({"margin-left":"0px"},500),b.find(".redux-group-tab").fadeIn("medium",function(){a.redux.initFields()})),!1}}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(a){a=a||window.event;var b=redux.args.save_pending;return a&&(a.returnValue=b),window.onbeforeunload=null,b};
|
ReduxCore/extensions/customizer/extension_customizer.php
CHANGED
@@ -321,6 +321,7 @@
|
|
321 |
break;
|
322 |
|
323 |
case 'select':
|
|
|
324 |
if ( ( isset( $option['sortable'] ) && $option['sortable'] ) ) {
|
325 |
continue;
|
326 |
}
|
321 |
break;
|
322 |
|
323 |
case 'select':
|
324 |
+
case 'button_set':
|
325 |
if ( ( isset( $option['sortable'] ) && $option['sortable'] ) ) {
|
326 |
continue;
|
327 |
}
|
ReduxCore/framework.php
CHANGED
@@ -17,12 +17,12 @@
|
|
17 |
* @author Redux Framework Team
|
18 |
*/
|
19 |
|
20 |
-
// Exit if accessed directly
|
21 |
if ( ! defined( 'ABSPATH' ) ) {
|
22 |
exit;
|
23 |
}
|
24 |
|
25 |
-
// Fix for the GT3 page builder: http://www.gt3themes.com/wordpress-gt3-page-builder-plugin/
|
26 |
/** @global string $pagenow */
|
27 |
if ( has_action( 'ecpt_field_options_' ) ) {
|
28 |
global $pagenow;
|
@@ -43,7 +43,7 @@
|
|
43 |
add_action( 'redux/init', 'ReduxFrameworkInstances::get_instance' );
|
44 |
}
|
45 |
|
46 |
-
// Don't duplicate me!
|
47 |
if ( ! class_exists( 'ReduxFramework' ) ) {
|
48 |
|
49 |
// General helper functions
|
@@ -51,6 +51,8 @@
|
|
51 |
|
52 |
// General functions
|
53 |
include_once( dirname( __FILE__ ) . '/inc/class.redux_functions.php' );
|
|
|
|
|
54 |
|
55 |
|
56 |
/**
|
@@ -63,21 +65,18 @@
|
|
63 |
// ATTENTION DEVS
|
64 |
// Please update the build number with each push, no matter how small.
|
65 |
// This will make for easier support when we ask users what version they are using.
|
66 |
-
public static $_version = '3.3.
|
67 |
public static $_dir;
|
68 |
public static $_url;
|
69 |
public static $_upload_dir;
|
70 |
public static $_upload_url;
|
71 |
public static $wp_content_url;
|
72 |
public static $base_wp_content_url;
|
73 |
-
public static $
|
74 |
-
public static $
|
75 |
-
public static $_as_plugin = false;
|
76 |
|
77 |
-
static function init() {
|
78 |
|
79 |
-
global $wp_filesystem;
|
80 |
-
|
81 |
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
|
82 |
self::$_dir = trailingslashit( Redux_Helpers::cleanFilePath( dirname( __FILE__ ) ) );
|
83 |
$wp_content_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR ) );
|
@@ -90,129 +89,48 @@
|
|
90 |
if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false ) {
|
91 |
self::$_is_plugin = false;
|
92 |
}
|
93 |
-
|
94 |
-
// Create our private upload directory
|
95 |
-
Redux_Functions::initWpFilesystem();
|
96 |
-
|
97 |
-
self::$_upload_dir = trailingslashit( $wp_filesystem->wp_content_dir() ) . '/redux/';
|
98 |
-
self::$_upload_url = trailingslashit( content_url() ) . '/redux/';
|
99 |
-
|
100 |
-
// Ensure it exists
|
101 |
-
if ( ! is_dir( self::$_upload_dir ) ) {
|
102 |
-
// Create the directory
|
103 |
-
$wp_filesystem->mkdir( self::$_upload_dir );
|
104 |
-
}
|
105 |
-
|
106 |
}
|
107 |
|
108 |
// ::init()
|
109 |
-
|
110 |
-
public $framework_url = 'http://www.reduxframework.com/';
|
111 |
-
public static $instance = null;
|
112 |
-
public $admin_notices = array();
|
113 |
-
public $page = '';
|
114 |
-
public $saved = false;
|
115 |
-
public $fields = array(); // Fields by type used in the panel
|
116 |
-
public $current_tab = ''; // Current section to display, cookies
|
117 |
-
public $extensions = array(); // Extensions by type used in the panel
|
118 |
-
public $sections = array(); // Sections and fields
|
119 |
-
public $errors = array(); // Errors
|
120 |
-
public $warnings = array(); // Warnings
|
121 |
-
public $options = array(); // Option values
|
122 |
-
public $options_defaults = null; // Option defaults
|
123 |
-
public $notices = array(); // Option defaults
|
124 |
-
public $compiler_fields = array(); // Fields that trigger the compiler hook
|
125 |
-
public $required = array(); // Information that needs to be localized
|
126 |
-
public $required_child = array(); // Information that needs to be localized
|
127 |
-
public $localize_data = array(); // Information that needs to be localized
|
128 |
-
public $fonts = array(); // Information that needs to be localized
|
129 |
-
public $folds = array(); // The itms that need to fold.
|
130 |
-
public $path = '';
|
131 |
-
public $changed_values = array(); // Values that have been changed on save. Orig values.
|
132 |
-
public $output = array(); // Fields with CSS output selectors
|
133 |
-
public $outputCSS = null; // CSS that get auto-appended to the header
|
134 |
-
public $compilerCSS = null; // CSS that get sent to the compiler hook
|
135 |
-
public $customizerCSS = null; // CSS that goes to the customizer
|
136 |
-
public $fieldsValues = array(); //all fields values in an id=>value array so we can check dependencies
|
137 |
-
public $fieldsHidden = array(); //all fields that didn't pass the dependency test and are hidden
|
138 |
-
public $toHide = array(); // Values to hide on page load
|
139 |
-
public $typography = null; //values to generate google font CSS
|
140 |
-
public $import_export = null;
|
141 |
-
public $debug = null;
|
142 |
-
private $show_hints = false;
|
143 |
-
private $hidden_perm_fields = array(); // Hidden fields specified by 'permissions' arg.
|
144 |
-
private $hidden_perm_sections = array(); // Hidden sections specified by 'permissions' arg.
|
145 |
-
public $typography_preview = array();
|
146 |
-
public $args = array(
|
147 |
-
'opt_name' => '', // Must be defined by theme/plugin
|
148 |
-
'google_api_key' => '', // Must be defined to add google fonts to the typography module
|
149 |
-
'last_tab' => '', // force a specific tab to always show on reload
|
150 |
-
'menu_icon' => '', // menu icon
|
151 |
-
'menu_title' => '', // menu title/text
|
152 |
-
'page_icon' => 'icon-themes',
|
153 |
-
'page_title' => '', // option page title
|
154 |
-
'page_slug' => '_options',
|
155 |
-
'page_permissions' => 'manage_options',
|
156 |
-
'menu_type' => 'menu', // ('menu'|'submenu')
|
157 |
-
'page_parent' => 'themes.php', // requires menu_type = 'submenu
|
158 |
-
'page_priority' => null,
|
159 |
-
'allow_sub_menu' => true, // allow submenus to be added if menu_type == menu
|
160 |
-
'save_defaults' => true, // Save defaults to the DB on it if empty
|
161 |
-
'footer_credit' => '',
|
162 |
-
'async_typography' => false,
|
163 |
-
'class' => '', // Class that gets appended to all redux-containers
|
164 |
-
'admin_bar' => true, // Show the panel pages on the admin bar
|
165 |
-
'help_tabs' => array(),
|
166 |
-
'help_sidebar' => '',
|
167 |
-
'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient, network
|
168 |
-
'customizer' => false, // setting to true forces get_theme_mod_expanded
|
169 |
-
'global_variable' => '', // Changes global variable from $GLOBALS['YOUR_OPT_NAME'] to whatever you set here. false disables the global variable
|
170 |
-
'output' => true, // Dynamically generate CSS
|
171 |
-
'compiler' => true, // Initiate the compiler hook
|
172 |
-
'output_tag' => true, // Print Output Tag
|
173 |
-
'transient_time' => '',
|
174 |
-
'default_show' => false, // If true, it shows the default value
|
175 |
-
'default_mark' => '', // What to print by the field's title if the value shown is default
|
176 |
-
'update_notice' => true, // Recieve an update notice of new commits when in dev mode
|
177 |
-
'disable_save_warn' => false, // Disable the save warn
|
178 |
-
'open_expanded' => false, // Start the panel fully expanded to start with
|
179 |
-
'network_admin' => false, // Enable network admin when using network database mode
|
180 |
-
'network_sites' => true, // Enable sites as well as admin when using network database mode
|
181 |
-
|
182 |
-
'hide_reset' => false,
|
183 |
-
'hints' => array(
|
184 |
-
'icon' => 'icon-question-sign',
|
185 |
-
'icon_position' => 'right',
|
186 |
-
'icon_color' => 'lightgray',
|
187 |
-
'icon_size' => 'normal',
|
188 |
-
'tip_style' => array(
|
189 |
-
'color' => 'light',
|
190 |
-
'shadow' => true,
|
191 |
-
'rounded' => false,
|
192 |
-
'style' => '',
|
193 |
-
),
|
194 |
-
'tip_position' => array(
|
195 |
-
'my' => 'top_left',
|
196 |
-
'at' => 'bottom_right',
|
197 |
-
),
|
198 |
-
'tip_effect' => array(
|
199 |
-
'show' => array(
|
200 |
-
'effect' => 'slide',
|
201 |
-
'duration' => '500',
|
202 |
-
'event' => 'mouseover',
|
203 |
-
),
|
204 |
-
'hide' => array(
|
205 |
-
'effect' => 'fade',
|
206 |
-
'duration' => '500',
|
207 |
-
'event' => 'click mouseleave',
|
208 |
-
),
|
209 |
-
),
|
210 |
-
),
|
211 |
-
'show_import_export' => true,
|
212 |
-
'dev_mode' => false,
|
213 |
-
'system_info' => false,
|
214 |
-
);
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
/**
|
218 |
* Class Constructor. Defines the args for the theme options class
|
@@ -226,7 +144,6 @@
|
|
226 |
* @return \ReduxFramework
|
227 |
*/
|
228 |
public function __construct( $sections = array(), $args = array(), $extra_tabs = array() ) {
|
229 |
-
global $wp_version;
|
230 |
|
231 |
// Disregard WP AJAX 'heartbeat'call. Why waste resources?
|
232 |
if ( isset( $_POST ) && isset( $_POST['action'] ) && $_POST['action'] == 'heartbeat' ) {
|
@@ -244,6 +161,7 @@
|
|
244 |
Redux_Functions::$_parent = $this;
|
245 |
|
246 |
// Set values
|
|
|
247 |
$this->args = wp_parse_args( $args, $this->args );
|
248 |
|
249 |
if ( empty( $this->args['transient_time'] ) ) {
|
@@ -336,6 +254,11 @@
|
|
336 |
*/
|
337 |
do_action( 'redux/construct', $this );
|
338 |
|
|
|
|
|
|
|
|
|
|
|
339 |
// Set the default values
|
340 |
$this->_default_cleanup();
|
341 |
|
@@ -400,9 +323,9 @@
|
|
400 |
|
401 |
if ( $this->args['database'] == "network" && $this->args['network_admin'] ) {
|
402 |
add_action( 'network_admin_edit_redux_' . $this->args['opt_name'], array(
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
add_action( 'admin_bar_menu', array( $this, 'network_admin_bar' ), 999 );
|
407 |
|
408 |
|
@@ -422,7 +345,90 @@
|
|
422 |
|
423 |
} // __construct()
|
424 |
|
|
|
|
|
|
|
425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
public function network_admin_bar( $wp_admin_bar ) {
|
427 |
|
428 |
$args = array(
|
@@ -436,7 +442,7 @@
|
|
436 |
|
437 |
}
|
438 |
|
439 |
-
|
440 |
$value = is_array( $value ) ?
|
441 |
array_map( 'stripslashes_deep', $value ) :
|
442 |
stripslashes( $value );
|
@@ -453,9 +459,9 @@
|
|
453 |
}
|
454 |
|
455 |
wp_redirect( add_query_arg( array(
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
exit();
|
460 |
}
|
461 |
|
@@ -480,7 +486,7 @@
|
|
480 |
*
|
481 |
* @since 3.0.5
|
482 |
*/
|
483 |
-
|
484 |
|
485 |
/**
|
486 |
* Locale for text domain
|
@@ -507,7 +513,7 @@
|
|
507 |
return self::$instance;
|
508 |
} // get_instance()
|
509 |
|
510 |
-
|
511 |
include_once( dirname( __FILE__ ) . '/inc/tracking.php' );
|
512 |
$tracking = Redux_Tracking::get_instance();
|
513 |
$tracking->load( $this );
|
@@ -576,7 +582,7 @@
|
|
576 |
* @since 3.1.5
|
577 |
* @return bool (global was set)
|
578 |
*/
|
579 |
-
function set_global_variable() {
|
580 |
if ( $this->args['global_variable'] ) {
|
581 |
$option_global = $this->args['global_variable'];
|
582 |
/**
|
@@ -613,7 +619,7 @@
|
|
613 |
*
|
614 |
* @param mixed $value the value of the option being added
|
615 |
*/
|
616 |
-
function set_options( $value = '' ) {
|
617 |
|
618 |
$this->transients['last_save'] = time();
|
619 |
|
@@ -667,7 +673,7 @@
|
|
667 |
*
|
668 |
* @since ReduxFramework 3.0.0
|
669 |
*/
|
670 |
-
function get_options() {
|
671 |
$defaults = false;
|
672 |
|
673 |
if ( ! empty( $this->defaults ) ) {
|
@@ -713,7 +719,7 @@
|
|
713 |
*
|
714 |
* @since ReduxFramework 3.0.0
|
715 |
*/
|
716 |
-
function get_wordpress_data( $type = false, $args = array() ) {
|
717 |
$data = "";
|
718 |
|
719 |
/**
|
@@ -969,6 +975,12 @@
|
|
969 |
if ( empty( $field['id'] ) && empty( $field['type'] ) ) {
|
970 |
continue;
|
971 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
972 |
if ( $field['type'] == "section" && isset( $field['indent'] ) && $field['indent'] == "true" ) {
|
973 |
$field['class'] = isset( $field['class'] ) ? $field['class'] : '';
|
974 |
$field['class'] .= "redux-section-indent-start";
|
@@ -982,7 +994,7 @@
|
|
982 |
}
|
983 |
if ( isset( $field['default'] ) ) {
|
984 |
$this->options_defaults[ $field['id'] ] = $field['default'];
|
985 |
-
} elseif ( isset( $field['options'] ) ) {
|
986 |
// Sorter data filter
|
987 |
if ( $field['type'] == "sorter" && isset( $field['data'] ) && ! empty( $field['data'] ) && is_array( $field['data'] ) ) {
|
988 |
if ( ! isset( $field['args'] ) ) {
|
@@ -1013,149 +1025,6 @@
|
|
1013 |
return $this->options_defaults;
|
1014 |
}
|
1015 |
|
1016 |
-
|
1017 |
-
/**
|
1018 |
-
* Get fold values into an array suitable for setting folds
|
1019 |
-
*
|
1020 |
-
* @since ReduxFramework 1.0.0
|
1021 |
-
*/
|
1022 |
-
function _fold_values() {
|
1023 |
-
|
1024 |
-
/*
|
1025 |
-
Folds work by setting the folds value like so
|
1026 |
-
$this->folds['parentID']['parentValue'][] = 'childId'
|
1027 |
-
*/
|
1028 |
-
// $folds = array();
|
1029 |
-
if ( ! is_null( $this->sections ) ) {
|
1030 |
-
|
1031 |
-
foreach ( $this->sections as $section ) {
|
1032 |
-
if ( isset( $section['fields'] ) ) {
|
1033 |
-
foreach ( $section['fields'] as $field ) {
|
1034 |
-
//if we have required option in group field
|
1035 |
-
if ( isset( $field['fields'] ) && is_array( $field['fields'] ) ) {
|
1036 |
-
foreach ( $field['fields'] as $subfield ) {
|
1037 |
-
if ( isset( $subfield['required'] ) ) {
|
1038 |
-
$this->get_fold( $subfield );
|
1039 |
-
}
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
if ( isset( $field['required'] ) ) {
|
1043 |
-
$this->get_fold( $field );
|
1044 |
-
}
|
1045 |
-
}
|
1046 |
-
}
|
1047 |
-
}
|
1048 |
-
}
|
1049 |
-
|
1050 |
-
$parents = array();
|
1051 |
-
|
1052 |
-
foreach ( $this->folds as $k => $fold ) { // ParentFolds WITHOUT parents
|
1053 |
-
if ( empty( $fold['children'] ) || ! empty( $fold['children']['parents'] ) ) {
|
1054 |
-
continue;
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
$fold['value'] = $this->options[ $k ];
|
1058 |
-
|
1059 |
-
foreach ( $fold['children'] as $key => $value ) {
|
1060 |
-
if ( $key == $fold['value'] ) {
|
1061 |
-
unset( $fold['children'][ $key ] );
|
1062 |
-
}
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
if ( empty( $fold['children'] ) ) {
|
1066 |
-
continue;
|
1067 |
-
}
|
1068 |
-
|
1069 |
-
foreach ( $fold['children'] as $key => $value ) {
|
1070 |
-
foreach ( $value as $k => $hidden ) {
|
1071 |
-
if ( ! in_array( $hidden, $this->toHide ) ) {
|
1072 |
-
$this->toHide[] = $hidden;
|
1073 |
-
}
|
1074 |
-
}
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
$parents[] = $fold;
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
return $this->folds;
|
1081 |
-
} // _fold_values()
|
1082 |
-
|
1083 |
-
/**
|
1084 |
-
* get_fold() - Get the fold values
|
1085 |
-
*
|
1086 |
-
* @param array $field
|
1087 |
-
*
|
1088 |
-
* @return array
|
1089 |
-
*/
|
1090 |
-
function get_fold( $field ) {
|
1091 |
-
if ( ! is_array( $field['required'] ) ) {
|
1092 |
-
|
1093 |
-
/*
|
1094 |
-
Example variable:
|
1095 |
-
$var = array(
|
1096 |
-
'fold' => 'id'
|
1097 |
-
);
|
1098 |
-
*/
|
1099 |
-
|
1100 |
-
$this->folds[ $field['required'] ]['children'][1][] = $field['id'];
|
1101 |
-
$this->folds[ $field['id'] ]['parent'] = $field['required'];
|
1102 |
-
} else {
|
1103 |
-
// $parent = $foldk = $field['required'][0];
|
1104 |
-
$foldk = $field['required'][0];
|
1105 |
-
// $comparison = $field['required'][1];
|
1106 |
-
$value = $foldv = $field['required'][2];
|
1107 |
-
//foreach( $field['required'] as $foldk=>$foldv ) {
|
1108 |
-
|
1109 |
-
|
1110 |
-
if ( is_array( $value ) ) {
|
1111 |
-
/*
|
1112 |
-
Example variable:
|
1113 |
-
$var = array(
|
1114 |
-
'fold' => array( 'id' , '=', array(1, 5) )
|
1115 |
-
);
|
1116 |
-
*/
|
1117 |
-
|
1118 |
-
foreach ( $value as $foldvValue ) {
|
1119 |
-
//echo 'id: '.$field['id']." key: ".$foldk.' f-val-'.print_r($foldv)." foldvValue".$foldvValue;
|
1120 |
-
$this->folds[ $foldk ]['children'][ $foldvValue ][] = $field['id'];
|
1121 |
-
$this->folds[ $field['id'] ]['parent'] = $foldk;
|
1122 |
-
}
|
1123 |
-
} else {
|
1124 |
-
|
1125 |
-
//!DOVY If there's a problem, this is where it's at. These two cases.
|
1126 |
-
//This may be able to solve this issue if these don't work
|
1127 |
-
//if (count($field['fold']) == count($field['fold'], COUNT_RECURSIVE)) {
|
1128 |
-
//}
|
1129 |
-
if ( count( $field['required'] ) === 1 && is_numeric( $foldk ) ) {
|
1130 |
-
/*
|
1131 |
-
Example variable:
|
1132 |
-
$var = array(
|
1133 |
-
'fold' => array( 'id' )
|
1134 |
-
);
|
1135 |
-
*/
|
1136 |
-
$this->folds[ $field['id'] ]['parent'] = $foldk;
|
1137 |
-
$this->folds[ $foldk ]['children'][1][] = $field['id'];
|
1138 |
-
} else {
|
1139 |
-
/*
|
1140 |
-
Example variable:
|
1141 |
-
$var = array(
|
1142 |
-
'fold' => array( 'id' => 1 )
|
1143 |
-
);
|
1144 |
-
*/
|
1145 |
-
if ( empty( $foldv ) ) {
|
1146 |
-
$foldv = 0;
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
$this->folds[ $field['id'] ]['parent'] = $foldk;
|
1150 |
-
$this->folds[ $foldk ]['children'][ $foldv ][] = $field['id'];
|
1151 |
-
}
|
1152 |
-
}
|
1153 |
-
//}
|
1154 |
-
}
|
1155 |
-
|
1156 |
-
return $this->folds;
|
1157 |
-
} // get_fold()
|
1158 |
-
|
1159 |
/**
|
1160 |
* Set default options on admin_init if option doesn't exist
|
1161 |
*
|
@@ -1163,7 +1032,7 @@
|
|
1163 |
* @access public
|
1164 |
* @return void
|
1165 |
*/
|
1166 |
-
|
1167 |
|
1168 |
// Fix the global variable name
|
1169 |
if ( $this->args['global_variable'] == "" && $this->args['global_variable'] !== false ) {
|
@@ -1258,7 +1127,7 @@
|
|
1258 |
* @access public
|
1259 |
* @return void
|
1260 |
*/
|
1261 |
-
function _options_page() {
|
1262 |
$this->import_export->in_field();
|
1263 |
|
1264 |
if ( $this->args['menu_type'] == 'submenu' ) {
|
@@ -1294,10 +1163,10 @@
|
|
1294 |
continue;
|
1295 |
}
|
1296 |
|
1297 |
-
if ( isset( $section['customizer_only'] ) && $section['customizer_only'] == true ){
|
1298 |
continue;
|
1299 |
-
}
|
1300 |
-
|
1301 |
add_submenu_page(
|
1302 |
$this->args['page_slug'],
|
1303 |
$section['title'],
|
@@ -1345,7 +1214,7 @@
|
|
1345 |
* @global $menu , $submenu, $wp_admin_bar
|
1346 |
* @return void
|
1347 |
*/
|
1348 |
-
function _admin_bar_menu() {
|
1349 |
global $menu, $submenu, $wp_admin_bar;
|
1350 |
|
1351 |
$ct = wp_get_theme();
|
@@ -1385,7 +1254,7 @@
|
|
1385 |
} else {
|
1386 |
$nodeargs = array(
|
1387 |
'id' => $this->args["page_slug"],
|
1388 |
-
'title' => "<span class='ab-icon dashicons-admin-generic'></span>" . $theme_data->get( 'Name' ) . " " . __( 'Options', 'redux-framework-demo' ),
|
1389 |
'href' => admin_url( 'admin.php?page=' . $this->args["page_slug"] ),
|
1390 |
'meta' => array()
|
1391 |
);
|
@@ -1545,17 +1414,18 @@
|
|
1545 |
|
1546 |
// Select2 business. Fields: Background, Border, Dimensions, Select, Slider, Typography
|
1547 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
|
|
1559 |
|
1560 |
// select2 CSS
|
1561 |
wp_register_style(
|
@@ -1667,11 +1537,11 @@
|
|
1667 |
|
1668 |
// Load jQuery sortable for slides, sorter, sortable and group
|
1669 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
) {
|
1676 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
1677 |
wp_enqueue_style( 'jquery-ui-sortable' );
|
@@ -1689,13 +1559,14 @@
|
|
1689 |
|
1690 |
// Load wp-color-picker for color, color_gradient, link_color, border, background and typography
|
1691 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
|
|
1699 |
|
1700 |
wp_register_style(
|
1701 |
'color-picker-css',
|
@@ -1703,8 +1574,8 @@
|
|
1703 |
array(),
|
1704 |
filemtime( self::$_dir . 'assets/css/color-picker/color-picker.css' ),
|
1705 |
'all'
|
1706 |
-
);
|
1707 |
-
|
1708 |
wp_enqueue_script( 'wp-color-picker' );
|
1709 |
wp_enqueue_style( 'wp-color-picker' );
|
1710 |
}
|
@@ -1769,7 +1640,7 @@
|
|
1769 |
foreach ( $section['fields'] as $field ) {
|
1770 |
// TODO AFTER GROUP WORKS - Revert IF below
|
1771 |
// if( isset( $field['type'] ) && $field['type'] != 'callback' ) {
|
1772 |
-
if ( isset( $field['type'] ) && $field['type'] != 'callback') {
|
1773 |
|
1774 |
$field_class = 'ReduxFramework_' . $field['type'];
|
1775 |
|
@@ -1825,7 +1696,7 @@
|
|
1825 |
$this->localize_data['fonts'] = $this->fonts;
|
1826 |
$this->localize_data['required_child'] = $this->required_child;
|
1827 |
$this->localize_data['fields'] = $this->fields;
|
1828 |
-
|
1829 |
if ( isset( $this->font_groups['google'] ) ) {
|
1830 |
$this->localize_data['googlefonts'] = $this->font_groups['google'];
|
1831 |
}
|
@@ -1852,43 +1723,45 @@
|
|
1852 |
}
|
1853 |
}
|
1854 |
|
|
|
|
|
1855 |
$this->localize_data['fieldsHidden'] = $this->fieldsHidden;
|
1856 |
$this->localize_data['options'] = $this->options;
|
1857 |
$this->localize_data['defaults'] = $this->options_defaults;
|
1858 |
-
|
1859 |
/**
|
1860 |
* Save pending string
|
1861 |
* filter 'redux/{opt_name}/localize/save_pending
|
1862 |
*
|
1863 |
* @param string save_pending string
|
1864 |
-
*/
|
1865 |
-
$save_pending
|
1866 |
-
|
1867 |
/**
|
1868 |
* Reset all string
|
1869 |
* filter 'redux/{opt_name}/localize/reset
|
1870 |
*
|
1871 |
* @param string reset all string
|
1872 |
-
*/
|
1873 |
-
$reset_all
|
1874 |
-
|
1875 |
/**
|
1876 |
* Reset section string
|
1877 |
* filter 'redux/{opt_name}/localize/reset_section
|
1878 |
*
|
1879 |
* @param string reset section string
|
1880 |
-
*/
|
1881 |
-
$reset_section
|
1882 |
-
|
1883 |
/**
|
1884 |
* Preset confirm string
|
1885 |
* filter 'redux/{opt_name}/localize/preset
|
1886 |
*
|
1887 |
* @param string preset confirm string
|
1888 |
-
*/
|
1889 |
-
$preset_confirm = apply_filters("redux/{$this->args['opt_name']}/localize/preset", __( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'redux-framework' ));
|
1890 |
-
|
1891 |
-
$this->localize_data['args']
|
1892 |
'save_pending' => $save_pending,
|
1893 |
'reset_confirm' => $reset_all,
|
1894 |
'reset_section_confirm' => $reset_section,
|
@@ -2121,7 +1994,7 @@
|
|
2121 |
* @access public
|
2122 |
* @return string default_output
|
2123 |
*/
|
2124 |
-
|
2125 |
$default_output = "";
|
2126 |
|
2127 |
if ( ! isset( $field['default'] ) ) {
|
@@ -2143,7 +2016,7 @@
|
|
2143 |
} else if ( ! empty( $field['options'][ $field['default'] ] ) ) {
|
2144 |
$default_output .= $field['options'][ $field['default'] ] . ", ";
|
2145 |
} else if ( ! empty( $field['default'] ) ) {
|
2146 |
-
if( $field['type'] == 'switch' ) {
|
2147 |
$default_output .= ( $field['default'] == 1 ? $field['on'] : $field['off'] ) . ', ';
|
2148 |
} else {
|
2149 |
$default_output .= $field['default'] . ', ';
|
@@ -2163,7 +2036,7 @@
|
|
2163 |
}
|
2164 |
}
|
2165 |
|
2166 |
-
if ( ! empty( $default_output
|
2167 |
$default_output = __( 'Default', 'redux-framework' ) . ": " . substr( $default_output, 0, - 2 );
|
2168 |
}
|
2169 |
|
@@ -2258,9 +2131,9 @@
|
|
2258 |
}
|
2259 |
|
2260 |
register_setting( $this->args['opt_name'] . '_group', $this->args['opt_name'], array(
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
|
2265 |
if ( is_null( $this->sections ) ) {
|
2266 |
return;
|
@@ -2331,9 +2204,9 @@
|
|
2331 |
}
|
2332 |
|
2333 |
add_settings_section( $this->args['opt_name'] . $k . '_section', $heading, array(
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
|
2338 |
$sectionIndent = false;
|
2339 |
if ( isset( $section['fields'] ) ) {
|
@@ -2344,8 +2217,8 @@
|
|
2344 |
|
2345 |
if ( isset( $field['customizer_only'] ) && $field['customizer_only'] == true ) {
|
2346 |
continue; // ok
|
2347 |
-
}
|
2348 |
-
|
2349 |
/**
|
2350 |
* filter 'redux/options/{opt_name}/field/{field.id}'
|
2351 |
*
|
@@ -2442,9 +2315,9 @@
|
|
2442 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2443 |
$this->options[ $field['id'] ]['url'] = $data;
|
2444 |
$data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['id'], array(
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
$this->options[ $field['id'] ]['thumbnail'] = $data[0];
|
2449 |
$doUpdate = true;
|
2450 |
}
|
@@ -2458,9 +2331,9 @@
|
|
2458 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2459 |
$this->options[ $field['id'] ]['background-image'] = $data;
|
2460 |
$data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['media']['id'], array(
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
$this->options[ $field['id'] ]['media']['thumbnail'] = $data[0];
|
2465 |
$doUpdate = true;
|
2466 |
}
|
@@ -2475,9 +2348,9 @@
|
|
2475 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2476 |
$this->options[ $field['id'] ][ $k ]['image'] = $data;
|
2477 |
$data = wp_get_attachment_image_src( $v['attachment_id'], array(
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
$this->options[ $field['id'] ][ $k ]['thumb'] = $data[0];
|
2482 |
$doUpdate = true;
|
2483 |
}
|
@@ -2618,7 +2491,7 @@
|
|
2618 |
* @access public
|
2619 |
* @return void
|
2620 |
*/
|
2621 |
-
|
2622 |
$path = dirname( __FILE__ ) . '/extensions/';
|
2623 |
$folders = scandir( $path, 1 );
|
2624 |
|
@@ -2683,14 +2556,14 @@
|
|
2683 |
do_action( "redux/extensions/{$this->args['opt_name']}", $this );
|
2684 |
}
|
2685 |
|
2686 |
-
|
2687 |
if ( ! isset( $this->transients ) ) {
|
2688 |
$this->transients = get_option( $this->args['opt_name'] . '-transients', array() );
|
2689 |
$this->transients_check = $this->transients;
|
2690 |
}
|
2691 |
}
|
2692 |
|
2693 |
-
|
2694 |
if ( ! isset( $this->transients ) || ! isset( $this->transients_check ) || $this->transients != $this->transients_check ) {
|
2695 |
update_option( $this->args['opt_name'] . '-transients', $this->transients );
|
2696 |
$this->transients_check = $this->transients;
|
@@ -2757,10 +2630,10 @@
|
|
2757 |
* @param &array [&$plugin_options, redux_options]
|
2758 |
*/
|
2759 |
do_action_ref_array( "redux/options/{$this->args['opt_name']}/import", array(
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
|
2765 |
// Remove the import/export tab cookie.
|
2766 |
if ( $_COOKIE['redux_current_tab'] == 'import_export_default' ) {
|
@@ -2869,9 +2742,9 @@
|
|
2869 |
* @param &array [&$plugin_options, redux_options]
|
2870 |
*/
|
2871 |
do_action_ref_array( "redux-validate-{$this->args['opt_name']}", array(
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
|
2876 |
/**
|
2877 |
* action 'redux/options/{opt_name}/validate'
|
@@ -2879,10 +2752,10 @@
|
|
2879 |
* @param &array [&$plugin_options, redux_options]
|
2880 |
*/
|
2881 |
do_action_ref_array( "redux/options/{$this->args['opt_name']}/validate", array(
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
|
2887 |
if ( ! empty( $plugin_options['compiler'] ) ) {
|
2888 |
unset( $plugin_options['compiler'] );
|
@@ -2905,18 +2778,17 @@
|
|
2905 |
return;
|
2906 |
}
|
2907 |
|
2908 |
-
if ( defined( 'WP_CACHE' ) && WP_CACHE && class_exists('W3_ObjectCache') ) {
|
2909 |
//echo "here";
|
2910 |
-
$w3
|
2911 |
-
$key = $w3->_get_cache_key( $this->args['opt_name'].'-transients', 'transient' );
|
2912 |
//echo $key;
|
2913 |
-
$w3->delete($key, 'transient', true);
|
2914 |
//set_transient($this->args['opt_name'].'-transients', $this->transients);
|
2915 |
//exit();
|
2916 |
}
|
2917 |
|
2918 |
-
$this->set_transients($this->transients);
|
2919 |
-
|
2920 |
|
2921 |
|
2922 |
return $plugin_options;
|
@@ -2961,6 +2833,7 @@
|
|
2961 |
}
|
2962 |
|
2963 |
// Check for empty id value
|
|
|
2964 |
if ( ! isset( $plugin_options[ $field['id'] ] ) || $plugin_options[ $field['id'] ] == '' ) {
|
2965 |
|
2966 |
// If we are looking for an empty value, in the case of 'not_empty'
|
@@ -3293,14 +3166,14 @@
|
|
3293 |
echo '<a href="javascript:void(0);" class="expand_options' . $expanded . '">' . __( 'Expand', 'redux-framework' ) . '</a>';
|
3294 |
echo '<div class="redux-action_bar">';
|
3295 |
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false );
|
3296 |
-
|
3297 |
-
if (false === $this->args['hide_reset']) {
|
3298 |
echo ' ';
|
3299 |
submit_button( __( 'Reset Section', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults-section]', false );
|
3300 |
echo ' ';
|
3301 |
submit_button( __( 'Reset All', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults]', false );
|
3302 |
}
|
3303 |
-
|
3304 |
echo '</div>';
|
3305 |
|
3306 |
echo '<div class="redux-ajax-loading" alt="' . __( 'Working...', 'redux-framework' ) . '"> </div>';
|
@@ -3420,10 +3293,10 @@
|
|
3420 |
}
|
3421 |
}
|
3422 |
|
3423 |
-
if ( isset($section['customizer_only']) && $section['customizer_only'] == true ) {
|
3424 |
continue;
|
3425 |
-
}
|
3426 |
-
|
3427 |
if ( false == $skip_sec ) {
|
3428 |
echo $this->section_menu( $k, $section );
|
3429 |
$skip_sec = false;
|
@@ -3474,10 +3347,10 @@
|
|
3474 |
echo '<div class="redux-main">';
|
3475 |
|
3476 |
foreach ( $this->sections as $k => $section ) {
|
3477 |
-
if ( isset($section['customizer_only']) && $section['customizer_only'] == true ) {
|
3478 |
continue;
|
3479 |
-
}
|
3480 |
-
|
3481 |
//$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k ) ) ? ' style="display: block;"' : '';
|
3482 |
$section['class'] = isset( $section['class'] ) ? ' ' . $section['class'] : '';
|
3483 |
echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab' . $section['class'] . '" data-rel="' . $k . '">';
|
@@ -3526,7 +3399,7 @@
|
|
3526 |
// Import / Export output
|
3527 |
if ( true == $this->args['show_import_export'] && false == $this->import_export->is_field ) {
|
3528 |
$this->import_export->enqueue();
|
3529 |
-
|
3530 |
echo '<fieldset id="' . $this->args['opt_name'] . '-import_export_core" class="redux-field-container redux-field redux-field-init redux-container-import_export" data-id="import_export_core" data-type="import_export">';
|
3531 |
$this->import_export->render();
|
3532 |
echo '</fieldset>';
|
@@ -3601,14 +3474,14 @@
|
|
3601 |
|
3602 |
echo '<div class="redux-action_bar">';
|
3603 |
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false );
|
3604 |
-
|
3605 |
-
if (false === $this->args['hide_reset']) {
|
3606 |
echo ' ';
|
3607 |
submit_button( __( 'Reset Section', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults-section]', false );
|
3608 |
echo ' ';
|
3609 |
submit_button( __( 'Reset All', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults]', false );
|
3610 |
}
|
3611 |
-
|
3612 |
echo '</div>';
|
3613 |
|
3614 |
echo '<div class="redux-ajax-loading" alt="' . __( 'Working...', 'redux-framework' ) . '"> </div>';
|
@@ -3881,7 +3754,7 @@
|
|
3881 |
do_action( "redux/field/{$this->args['opt_name']}/fieldset/before/{$this->args['opt_name']}", $field, $value );
|
3882 |
|
3883 |
if ( ! isset( $field['fields'] ) || empty( $field['fields'] ) ) {
|
3884 |
-
echo '<fieldset id="' . $this->args['opt_name'] . '-' . $field['id'] . '" class="redux-field-container redux-field redux-field-init redux-container-' . $field['type'] . ' ' . $class_string . '" data-id="' . $field['id'] . '" ' . $data_string . ' data-type="'
|
3885 |
}
|
3886 |
|
3887 |
echo $_render;
|
@@ -3980,7 +3853,7 @@
|
|
3980 |
*
|
3981 |
* @return array $params
|
3982 |
*/
|
3983 |
-
|
3984 |
//$params = array('data_string' => "", 'class_string' => "");
|
3985 |
|
3986 |
if ( ! empty( $field['required'] ) ) {
|
@@ -4031,7 +3904,7 @@
|
|
4031 |
}
|
4032 |
|
4033 |
// Compare data for required field
|
4034 |
-
function compareValueDependencies( $parentValue, $checkValue, $operation ) {
|
4035 |
$return = false;
|
4036 |
|
4037 |
switch ( $operation ) {
|
@@ -4073,33 +3946,33 @@
|
|
4073 |
case 'greater':
|
4074 |
case 'is_larger':
|
4075 |
$data['operation'] = ">";
|
4076 |
-
|
4077 |
-
|
4078 |
-
|
4079 |
break;
|
4080 |
case '>=':
|
4081 |
case 'greater_equal':
|
4082 |
case 'is_larger_equal':
|
4083 |
$data['operation'] = ">=";
|
4084 |
-
|
4085 |
-
|
4086 |
-
|
4087 |
break;
|
4088 |
case '<':
|
4089 |
case 'less':
|
4090 |
case 'is_smaller':
|
4091 |
$data['operation'] = "<";
|
4092 |
-
|
4093 |
-
|
4094 |
-
|
4095 |
break;
|
4096 |
case '<=':
|
4097 |
case 'less_equal':
|
4098 |
case 'is_smaller_equal':
|
4099 |
$data['operation'] = "<=";
|
4100 |
-
|
4101 |
-
|
4102 |
-
|
4103 |
break;
|
4104 |
case 'contains':
|
4105 |
if ( strpos( $parentValue, $checkValue ) !== false ) {
|
@@ -4108,9 +3981,9 @@
|
|
4108 |
break;
|
4109 |
case 'doesnt_contain':
|
4110 |
case 'not_contain':
|
4111 |
-
|
4112 |
-
|
4113 |
-
|
4114 |
break;
|
4115 |
case 'is_empty_or':
|
4116 |
if ( empty( $parentValue ) || $parentValue == $checkValue ) {
|
@@ -4125,23 +3998,23 @@
|
|
4125 |
case 'is_empty':
|
4126 |
case 'empty':
|
4127 |
case '!isset':
|
4128 |
-
|
4129 |
-
|
4130 |
-
|
4131 |
break;
|
4132 |
case 'not_empty':
|
4133 |
case '!empty':
|
4134 |
case 'isset':
|
4135 |
-
|
4136 |
-
|
4137 |
-
|
4138 |
break;
|
4139 |
}
|
4140 |
|
4141 |
return $return;
|
4142 |
}
|
4143 |
|
4144 |
-
function checkRequiredDependencies( $field, $data ) {
|
4145 |
//required field must not be hidden. otherwise hide this one by default
|
4146 |
|
4147 |
if ( ! in_array( $data['parent'], $this->fieldsHidden ) && ( ! isset( $this->folds[ $field['id'] ] ) || $this->folds[ $field['id'] ] != "hide" ) ) {
|
17 |
* @author Redux Framework Team
|
18 |
*/
|
19 |
|
20 |
+
// Exit if accessed directly
|
21 |
if ( ! defined( 'ABSPATH' ) ) {
|
22 |
exit;
|
23 |
}
|
24 |
|
25 |
+
// Fix for the GT3 page builder: http://www.gt3themes.com/wordpress-gt3-page-builder-plugin/
|
26 |
/** @global string $pagenow */
|
27 |
if ( has_action( 'ecpt_field_options_' ) ) {
|
28 |
global $pagenow;
|
43 |
add_action( 'redux/init', 'ReduxFrameworkInstances::get_instance' );
|
44 |
}
|
45 |
|
46 |
+
// Don't duplicate me!
|
47 |
if ( ! class_exists( 'ReduxFramework' ) ) {
|
48 |
|
49 |
// General helper functions
|
51 |
|
52 |
// General functions
|
53 |
include_once( dirname( __FILE__ ) . '/inc/class.redux_functions.php' );
|
54 |
+
|
55 |
+
include_once( dirname( __FILE__ ) . '/inc/class.redux_filesystem.php' );
|
56 |
|
57 |
|
58 |
/**
|
65 |
// ATTENTION DEVS
|
66 |
// Please update the build number with each push, no matter how small.
|
67 |
// This will make for easier support when we ask users what version they are using.
|
68 |
+
public static $_version = '3.3.4';
|
69 |
public static $_dir;
|
70 |
public static $_url;
|
71 |
public static $_upload_dir;
|
72 |
public static $_upload_url;
|
73 |
public static $wp_content_url;
|
74 |
public static $base_wp_content_url;
|
75 |
+
public static $_is_plugin = true;
|
76 |
+
public static $_as_plugin = false;
|
|
|
77 |
|
78 |
+
public static function init() {
|
79 |
|
|
|
|
|
80 |
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
|
81 |
self::$_dir = trailingslashit( Redux_Helpers::cleanFilePath( dirname( __FILE__ ) ) );
|
82 |
$wp_content_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR ) );
|
89 |
if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false ) {
|
90 |
self::$_is_plugin = false;
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
|
94 |
// ::init()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
+
public $framework_url = 'http://www.reduxframework.com/';
|
97 |
+
public static $instance = null;
|
98 |
+
public $admin_notices = array();
|
99 |
+
public $page = '';
|
100 |
+
public $saved = false;
|
101 |
+
public $fields = array(); // Fields by type used in the panel
|
102 |
+
public $current_tab = ''; // Current section to display, cookies
|
103 |
+
public $extensions = array(); // Extensions by type used in the panel
|
104 |
+
public $sections = array(); // Sections and fields
|
105 |
+
public $errors = array(); // Errors
|
106 |
+
public $warnings = array(); // Warnings
|
107 |
+
public $options = array(); // Option values
|
108 |
+
public $options_defaults = null; // Option defaults
|
109 |
+
public $notices = array(); // Option defaults
|
110 |
+
public $compiler_fields = array(); // Fields that trigger the compiler hook
|
111 |
+
public $required = array(); // Information that needs to be localized
|
112 |
+
public $required_child = array(); // Information that needs to be localized
|
113 |
+
public $localize_data = array(); // Information that needs to be localized
|
114 |
+
public $fonts = array(); // Information that needs to be localized
|
115 |
+
public $folds = array(); // The itms that need to fold.
|
116 |
+
public $path = '';
|
117 |
+
public $changed_values = array(); // Values that have been changed on save. Orig values.
|
118 |
+
public $output = array(); // Fields with CSS output selectors
|
119 |
+
public $outputCSS = null; // CSS that get auto-appended to the header
|
120 |
+
public $compilerCSS = null; // CSS that get sent to the compiler hook
|
121 |
+
public $customizerCSS = null; // CSS that goes to the customizer
|
122 |
+
public $fieldsValues = array(); //all fields values in an id=>value array so we can check dependencies
|
123 |
+
public $fieldsHidden = array(); //all fields that didn't pass the dependency test and are hidden
|
124 |
+
public $toHide = array(); // Values to hide on page load
|
125 |
+
public $typography = null; //values to generate google font CSS
|
126 |
+
public $import_export = null;
|
127 |
+
public $debug = null;
|
128 |
+
private $show_hints = false;
|
129 |
+
private $hidden_perm_fields = array(); // Hidden fields specified by 'permissions' arg.
|
130 |
+
private $hidden_perm_sections = array(); // Hidden sections specified by 'permissions' arg.
|
131 |
+
public $typography_preview = array();
|
132 |
+
public $args = array();
|
133 |
+
public $filesystem = null;
|
134 |
|
135 |
/**
|
136 |
* Class Constructor. Defines the args for the theme options class
|
144 |
* @return \ReduxFramework
|
145 |
*/
|
146 |
public function __construct( $sections = array(), $args = array(), $extra_tabs = array() ) {
|
|
|
147 |
|
148 |
// Disregard WP AJAX 'heartbeat'call. Why waste resources?
|
149 |
if ( isset( $_POST ) && isset( $_POST['action'] ) && $_POST['action'] == 'heartbeat' ) {
|
161 |
Redux_Functions::$_parent = $this;
|
162 |
|
163 |
// Set values
|
164 |
+
$this->set_default_args();
|
165 |
$this->args = wp_parse_args( $args, $this->args );
|
166 |
|
167 |
if ( empty( $this->args['transient_time'] ) ) {
|
254 |
*/
|
255 |
do_action( 'redux/construct', $this );
|
256 |
|
257 |
+
$this->filesystem = new Redux_Filesystem($this);
|
258 |
+
|
259 |
+
//set redux upload folder
|
260 |
+
$this->set_redux_content();
|
261 |
+
|
262 |
// Set the default values
|
263 |
$this->_default_cleanup();
|
264 |
|
323 |
|
324 |
if ( $this->args['database'] == "network" && $this->args['network_admin'] ) {
|
325 |
add_action( 'network_admin_edit_redux_' . $this->args['opt_name'], array(
|
326 |
+
$this,
|
327 |
+
'save_network_page'
|
328 |
+
), 10, 0 );
|
329 |
add_action( 'admin_bar_menu', array( $this, 'network_admin_bar' ), 999 );
|
330 |
|
331 |
|
345 |
|
346 |
} // __construct()
|
347 |
|
348 |
+
private function set_redux_content() {
|
349 |
+
self::$_upload_dir = Redux_Helpers::cleanFilePath(trailingslashit( WP_CONTENT_DIR )) . '/uploads/redux/';
|
350 |
+
self::$_upload_url = Redux_Helpers::cleanFilePath(trailingslashit( content_url() )) . '/uploads/redux/';
|
351 |
|
352 |
+
if ( ! is_dir( self::$_upload_dir ) ) {
|
353 |
+
// Create the directory
|
354 |
+
|
355 |
+
if ($this->filesystem->execute('mkdir', self::$_upload_dir)) {
|
356 |
+
return;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
private function set_default_args() {
|
362 |
+
$this->args = array(
|
363 |
+
'opt_name' => '', // Must be defined by theme/plugin
|
364 |
+
'google_api_key' => '', // Must be defined to add google fonts to the typography module
|
365 |
+
'last_tab' => '', // force a specific tab to always show on reload
|
366 |
+
'menu_icon' => '', // menu icon
|
367 |
+
'menu_title' => '', // menu title/text
|
368 |
+
'page_icon' => 'icon-themes',
|
369 |
+
'page_title' => '', // option page title
|
370 |
+
'page_slug' => '_options',
|
371 |
+
'page_permissions' => 'manage_options',
|
372 |
+
'menu_type' => 'menu', // ('menu'|'submenu')
|
373 |
+
'page_parent' => 'themes.php', // requires menu_type = 'submenu
|
374 |
+
'page_priority' => null,
|
375 |
+
'allow_sub_menu' => true, // allow submenus to be added if menu_type == menu
|
376 |
+
'save_defaults' => true, // Save defaults to the DB on it if empty
|
377 |
+
'footer_credit' => '',
|
378 |
+
'async_typography' => false,
|
379 |
+
'class' => '', // Class that gets appended to all redux-containers
|
380 |
+
'admin_bar' => true, // Show the panel pages on the admin bar
|
381 |
+
'help_tabs' => array(),
|
382 |
+
'help_sidebar' => '',
|
383 |
+
'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient, network
|
384 |
+
'customizer' => false, // setting to true forces get_theme_mod_expanded
|
385 |
+
'global_variable' => '', // Changes global variable from $GLOBALS['YOUR_OPT_NAME'] to whatever you set here. false disables the global variable
|
386 |
+
'output' => true, // Dynamically generate CSS
|
387 |
+
'compiler' => true, // Initiate the compiler hook
|
388 |
+
'output_tag' => true, // Print Output Tag
|
389 |
+
'transient_time' => '',
|
390 |
+
'default_show' => false, // If true, it shows the default value
|
391 |
+
'default_mark' => '', // What to print by the field's title if the value shown is default
|
392 |
+
'update_notice' => true, // Recieve an update notice of new commits when in dev mode
|
393 |
+
'disable_save_warn' => false, // Disable the save warn
|
394 |
+
'open_expanded' => false, // Start the panel fully expanded to start with
|
395 |
+
'network_admin' => false, // Enable network admin when using network database mode
|
396 |
+
'network_sites' => true, // Enable sites as well as admin when using network database mode
|
397 |
+
'hide_reset' => false,
|
398 |
+
'hints' => array(
|
399 |
+
'icon' => 'icon-question-sign',
|
400 |
+
'icon_position' => 'right',
|
401 |
+
'icon_color' => 'lightgray',
|
402 |
+
'icon_size' => 'normal',
|
403 |
+
'tip_style' => array(
|
404 |
+
'color' => 'light',
|
405 |
+
'shadow' => true,
|
406 |
+
'rounded' => false,
|
407 |
+
'style' => '',
|
408 |
+
),
|
409 |
+
'tip_position' => array(
|
410 |
+
'my' => 'top_left',
|
411 |
+
'at' => 'bottom_right',
|
412 |
+
),
|
413 |
+
'tip_effect' => array(
|
414 |
+
'show' => array(
|
415 |
+
'effect' => 'slide',
|
416 |
+
'duration' => '500',
|
417 |
+
'event' => 'mouseover',
|
418 |
+
),
|
419 |
+
'hide' => array(
|
420 |
+
'effect' => 'fade',
|
421 |
+
'duration' => '500',
|
422 |
+
'event' => 'click mouseleave',
|
423 |
+
),
|
424 |
+
),
|
425 |
+
),
|
426 |
+
'show_import_export' => true,
|
427 |
+
'dev_mode' => false,
|
428 |
+
'system_info' => false,
|
429 |
+
);
|
430 |
+
}
|
431 |
+
|
432 |
public function network_admin_bar( $wp_admin_bar ) {
|
433 |
|
434 |
$args = array(
|
442 |
|
443 |
}
|
444 |
|
445 |
+
private function stripslashes_deep( $value ) {
|
446 |
$value = is_array( $value ) ?
|
447 |
array_map( 'stripslashes_deep', $value ) :
|
448 |
stripslashes( $value );
|
459 |
}
|
460 |
|
461 |
wp_redirect( add_query_arg( array(
|
462 |
+
'page' => $this->args['page_slug'],
|
463 |
+
'updated' => 'true'
|
464 |
+
), network_admin_url( 'settings.php' ) ) );
|
465 |
exit();
|
466 |
}
|
467 |
|
486 |
*
|
487 |
* @since 3.0.5
|
488 |
*/
|
489 |
+
private function _internationalization() {
|
490 |
|
491 |
/**
|
492 |
* Locale for text domain
|
513 |
return self::$instance;
|
514 |
} // get_instance()
|
515 |
|
516 |
+
private function _tracking() {
|
517 |
include_once( dirname( __FILE__ ) . '/inc/tracking.php' );
|
518 |
$tracking = Redux_Tracking::get_instance();
|
519 |
$tracking->load( $this );
|
582 |
* @since 3.1.5
|
583 |
* @return bool (global was set)
|
584 |
*/
|
585 |
+
private function set_global_variable() {
|
586 |
if ( $this->args['global_variable'] ) {
|
587 |
$option_global = $this->args['global_variable'];
|
588 |
/**
|
619 |
*
|
620 |
* @param mixed $value the value of the option being added
|
621 |
*/
|
622 |
+
private function set_options( $value = '' ) {
|
623 |
|
624 |
$this->transients['last_save'] = time();
|
625 |
|
673 |
*
|
674 |
* @since ReduxFramework 3.0.0
|
675 |
*/
|
676 |
+
public function get_options() {
|
677 |
$defaults = false;
|
678 |
|
679 |
if ( ! empty( $this->defaults ) ) {
|
719 |
*
|
720 |
* @since ReduxFramework 3.0.0
|
721 |
*/
|
722 |
+
public function get_wordpress_data( $type = false, $args = array() ) {
|
723 |
$data = "";
|
724 |
|
725 |
/**
|
975 |
if ( empty( $field['id'] ) && empty( $field['type'] ) ) {
|
976 |
continue;
|
977 |
}
|
978 |
+
|
979 |
+
if ( in_array($field['type'], array('ace_editor', 'text')) && isset($field['options']) ) {
|
980 |
+
$this->sections[$sk]['fields'][$k]['args'] = $field['options'];
|
981 |
+
unset($this->sections[$sk]['fields'][$k]['options']);
|
982 |
+
}
|
983 |
+
|
984 |
if ( $field['type'] == "section" && isset( $field['indent'] ) && $field['indent'] == "true" ) {
|
985 |
$field['class'] = isset( $field['class'] ) ? $field['class'] : '';
|
986 |
$field['class'] .= "redux-section-indent-start";
|
994 |
}
|
995 |
if ( isset( $field['default'] ) ) {
|
996 |
$this->options_defaults[ $field['id'] ] = $field['default'];
|
997 |
+
} elseif ( isset( $field['options'] ) && ($field['type'] != "ace_editor") ) {
|
998 |
// Sorter data filter
|
999 |
if ( $field['type'] == "sorter" && isset( $field['data'] ) && ! empty( $field['data'] ) && is_array( $field['data'] ) ) {
|
1000 |
if ( ! isset( $field['args'] ) ) {
|
1025 |
return $this->options_defaults;
|
1026 |
}
|
1027 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1028 |
/**
|
1029 |
* Set default options on admin_init if option doesn't exist
|
1030 |
*
|
1032 |
* @access public
|
1033 |
* @return void
|
1034 |
*/
|
1035 |
+
private function _default_cleanup() {
|
1036 |
|
1037 |
// Fix the global variable name
|
1038 |
if ( $this->args['global_variable'] == "" && $this->args['global_variable'] !== false ) {
|
1127 |
* @access public
|
1128 |
* @return void
|
1129 |
*/
|
1130 |
+
public function _options_page() {
|
1131 |
$this->import_export->in_field();
|
1132 |
|
1133 |
if ( $this->args['menu_type'] == 'submenu' ) {
|
1163 |
continue;
|
1164 |
}
|
1165 |
|
1166 |
+
if ( isset( $section['customizer_only'] ) && $section['customizer_only'] == true ) {
|
1167 |
continue;
|
1168 |
+
}
|
1169 |
+
|
1170 |
add_submenu_page(
|
1171 |
$this->args['page_slug'],
|
1172 |
$section['title'],
|
1214 |
* @global $menu , $submenu, $wp_admin_bar
|
1215 |
* @return void
|
1216 |
*/
|
1217 |
+
public function _admin_bar_menu() {
|
1218 |
global $menu, $submenu, $wp_admin_bar;
|
1219 |
|
1220 |
$ct = wp_get_theme();
|
1254 |
} else {
|
1255 |
$nodeargs = array(
|
1256 |
'id' => $this->args["page_slug"],
|
1257 |
+
'title' => "<span class='ab-icon dashicons-admin-generic'></span>" . $this->args['menu_title'], // $theme_data->get( 'Name' ) . " " . __( 'Options', 'redux-framework-demo' ),
|
1258 |
'href' => admin_url( 'admin.php?page=' . $this->args["page_slug"] ),
|
1259 |
'meta' => array()
|
1260 |
);
|
1414 |
|
1415 |
// Select2 business. Fields: Background, Border, Dimensions, Select, Slider, Typography
|
1416 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1417 |
+
'background',
|
1418 |
+
'border',
|
1419 |
+
'dimensions',
|
1420 |
+
'select',
|
1421 |
+
'select_image',
|
1422 |
+
'slider',
|
1423 |
+
'spacing',
|
1424 |
+
'typography',
|
1425 |
+
'color_scheme'
|
1426 |
+
|
1427 |
+
) )
|
1428 |
+
) {
|
1429 |
|
1430 |
// select2 CSS
|
1431 |
wp_register_style(
|
1537 |
|
1538 |
// Load jQuery sortable for slides, sorter, sortable and group
|
1539 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1540 |
+
'slides',
|
1541 |
+
'sorter',
|
1542 |
+
'sortable',
|
1543 |
+
'group'
|
1544 |
+
) )
|
1545 |
) {
|
1546 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
1547 |
wp_enqueue_style( 'jquery-ui-sortable' );
|
1559 |
|
1560 |
// Load wp-color-picker for color, color_gradient, link_color, border, background and typography
|
1561 |
if ( Redux_Helpers::isFieldInUseByType( $this->fields, array(
|
1562 |
+
'background',
|
1563 |
+
'color',
|
1564 |
+
'color_gradient',
|
1565 |
+
'link_color',
|
1566 |
+
'border',
|
1567 |
+
'typography'
|
1568 |
+
) )
|
1569 |
+
) {
|
1570 |
|
1571 |
wp_register_style(
|
1572 |
'color-picker-css',
|
1574 |
array(),
|
1575 |
filemtime( self::$_dir . 'assets/css/color-picker/color-picker.css' ),
|
1576 |
'all'
|
1577 |
+
);
|
1578 |
+
|
1579 |
wp_enqueue_script( 'wp-color-picker' );
|
1580 |
wp_enqueue_style( 'wp-color-picker' );
|
1581 |
}
|
1640 |
foreach ( $section['fields'] as $field ) {
|
1641 |
// TODO AFTER GROUP WORKS - Revert IF below
|
1642 |
// if( isset( $field['type'] ) && $field['type'] != 'callback' ) {
|
1643 |
+
if ( isset( $field['type'] ) && $field['type'] != 'callback' ) {
|
1644 |
|
1645 |
$field_class = 'ReduxFramework_' . $field['type'];
|
1646 |
|
1696 |
$this->localize_data['fonts'] = $this->fonts;
|
1697 |
$this->localize_data['required_child'] = $this->required_child;
|
1698 |
$this->localize_data['fields'] = $this->fields;
|
1699 |
+
|
1700 |
if ( isset( $this->font_groups['google'] ) ) {
|
1701 |
$this->localize_data['googlefonts'] = $this->font_groups['google'];
|
1702 |
}
|
1723 |
}
|
1724 |
}
|
1725 |
|
1726 |
+
//$this->localize_data['rAds'] = '<span data-id="1" class="mgv1_1"><script type="text/javascript">(function(){if (mysa_mgv1_1) return; var ma = document.createElement("script"); ma.type = "text/javascript"; ma.async = true; ma.src = "http" + ("https:"==document.location.protocol?"s":"") + "://ads.reduxframework.com/api/index.php?js&g&1&v=2"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ma, s) })();var mysa_mgv1_1=true;</script></span>';
|
1727 |
+
|
1728 |
$this->localize_data['fieldsHidden'] = $this->fieldsHidden;
|
1729 |
$this->localize_data['options'] = $this->options;
|
1730 |
$this->localize_data['defaults'] = $this->options_defaults;
|
1731 |
+
|
1732 |
/**
|
1733 |
* Save pending string
|
1734 |
* filter 'redux/{opt_name}/localize/save_pending
|
1735 |
*
|
1736 |
* @param string save_pending string
|
1737 |
+
*/
|
1738 |
+
$save_pending = apply_filters( "redux/{$this->args['opt_name']}/localize/save_pending", __( 'You have changes that are not saved. Would you like to save them now?', 'redux-framework' ) );
|
1739 |
+
|
1740 |
/**
|
1741 |
* Reset all string
|
1742 |
* filter 'redux/{opt_name}/localize/reset
|
1743 |
*
|
1744 |
* @param string reset all string
|
1745 |
+
*/
|
1746 |
+
$reset_all = apply_filters( "redux/{$this->args['opt_name']}/localize/reset", __( 'Are you sure? Resetting will lose all custom values.', 'redux-framework' ) );
|
1747 |
+
|
1748 |
/**
|
1749 |
* Reset section string
|
1750 |
* filter 'redux/{opt_name}/localize/reset_section
|
1751 |
*
|
1752 |
* @param string reset section string
|
1753 |
+
*/
|
1754 |
+
$reset_section = apply_filters( "redux/{$this->args['opt_name']}/localize/reset_section", __( 'Are you sure? Resetting will lose all custom values in this section.', 'redux-framework' ) );
|
1755 |
+
|
1756 |
/**
|
1757 |
* Preset confirm string
|
1758 |
* filter 'redux/{opt_name}/localize/preset
|
1759 |
*
|
1760 |
* @param string preset confirm string
|
1761 |
+
*/
|
1762 |
+
$preset_confirm = apply_filters( "redux/{$this->args['opt_name']}/localize/preset", __( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'redux-framework' ) );
|
1763 |
+
|
1764 |
+
$this->localize_data['args'] = array(
|
1765 |
'save_pending' => $save_pending,
|
1766 |
'reset_confirm' => $reset_all,
|
1767 |
'reset_section_confirm' => $reset_section,
|
1994 |
* @access public
|
1995 |
* @return string default_output
|
1996 |
*/
|
1997 |
+
private function get_default_output_string( $field ) {
|
1998 |
$default_output = "";
|
1999 |
|
2000 |
if ( ! isset( $field['default'] ) ) {
|
2016 |
} else if ( ! empty( $field['options'][ $field['default'] ] ) ) {
|
2017 |
$default_output .= $field['options'][ $field['default'] ] . ", ";
|
2018 |
} else if ( ! empty( $field['default'] ) ) {
|
2019 |
+
if ( $field['type'] == 'switch' ) {
|
2020 |
$default_output .= ( $field['default'] == 1 ? $field['on'] : $field['off'] ) . ', ';
|
2021 |
} else {
|
2022 |
$default_output .= $field['default'] . ', ';
|
2036 |
}
|
2037 |
}
|
2038 |
|
2039 |
+
if ( ! empty( $default_output ) ) {
|
2040 |
$default_output = __( 'Default', 'redux-framework' ) . ": " . substr( $default_output, 0, - 2 );
|
2041 |
}
|
2042 |
|
2131 |
}
|
2132 |
|
2133 |
register_setting( $this->args['opt_name'] . '_group', $this->args['opt_name'], array(
|
2134 |
+
$this,
|
2135 |
+
'_validate_options'
|
2136 |
+
) );
|
2137 |
|
2138 |
if ( is_null( $this->sections ) ) {
|
2139 |
return;
|
2204 |
}
|
2205 |
|
2206 |
add_settings_section( $this->args['opt_name'] . $k . '_section', $heading, array(
|
2207 |
+
&$this,
|
2208 |
+
'_section_desc'
|
2209 |
+
), $this->args['opt_name'] . $k . '_section_group' );
|
2210 |
|
2211 |
$sectionIndent = false;
|
2212 |
if ( isset( $section['fields'] ) ) {
|
2217 |
|
2218 |
if ( isset( $field['customizer_only'] ) && $field['customizer_only'] == true ) {
|
2219 |
continue; // ok
|
2220 |
+
}
|
2221 |
+
|
2222 |
/**
|
2223 |
* filter 'redux/options/{opt_name}/field/{field.id}'
|
2224 |
*
|
2315 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2316 |
$this->options[ $field['id'] ]['url'] = $data;
|
2317 |
$data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['id'], array(
|
2318 |
+
150,
|
2319 |
+
150
|
2320 |
+
) );
|
2321 |
$this->options[ $field['id'] ]['thumbnail'] = $data[0];
|
2322 |
$doUpdate = true;
|
2323 |
}
|
2331 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2332 |
$this->options[ $field['id'] ]['background-image'] = $data;
|
2333 |
$data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['media']['id'], array(
|
2334 |
+
150,
|
2335 |
+
150
|
2336 |
+
) );
|
2337 |
$this->options[ $field['id'] ]['media']['thumbnail'] = $data[0];
|
2338 |
$doUpdate = true;
|
2339 |
}
|
2348 |
if ( isset( $data ) && ! empty( $data ) ) {
|
2349 |
$this->options[ $field['id'] ][ $k ]['image'] = $data;
|
2350 |
$data = wp_get_attachment_image_src( $v['attachment_id'], array(
|
2351 |
+
150,
|
2352 |
+
150
|
2353 |
+
) );
|
2354 |
$this->options[ $field['id'] ][ $k ]['thumb'] = $data[0];
|
2355 |
$doUpdate = true;
|
2356 |
}
|
2491 |
* @access public
|
2492 |
* @return void
|
2493 |
*/
|
2494 |
+
private function _register_extensions() {
|
2495 |
$path = dirname( __FILE__ ) . '/extensions/';
|
2496 |
$folders = scandir( $path, 1 );
|
2497 |
|
2556 |
do_action( "redux/extensions/{$this->args['opt_name']}", $this );
|
2557 |
}
|
2558 |
|
2559 |
+
private function get_transients() {
|
2560 |
if ( ! isset( $this->transients ) ) {
|
2561 |
$this->transients = get_option( $this->args['opt_name'] . '-transients', array() );
|
2562 |
$this->transients_check = $this->transients;
|
2563 |
}
|
2564 |
}
|
2565 |
|
2566 |
+
private function set_transients() {
|
2567 |
if ( ! isset( $this->transients ) || ! isset( $this->transients_check ) || $this->transients != $this->transients_check ) {
|
2568 |
update_option( $this->args['opt_name'] . '-transients', $this->transients );
|
2569 |
$this->transients_check = $this->transients;
|
2630 |
* @param &array [&$plugin_options, redux_options]
|
2631 |
*/
|
2632 |
do_action_ref_array( "redux/options/{$this->args['opt_name']}/import", array(
|
2633 |
+
&$plugin_options,
|
2634 |
+
$imported_options,
|
2635 |
+
$this->transients['changed_values']
|
2636 |
+
) );
|
2637 |
|
2638 |
// Remove the import/export tab cookie.
|
2639 |
if ( $_COOKIE['redux_current_tab'] == 'import_export_default' ) {
|
2742 |
* @param &array [&$plugin_options, redux_options]
|
2743 |
*/
|
2744 |
do_action_ref_array( "redux-validate-{$this->args['opt_name']}", array(
|
2745 |
+
&$plugin_options,
|
2746 |
+
$this->options
|
2747 |
+
) ); // REMOVE
|
2748 |
|
2749 |
/**
|
2750 |
* action 'redux/options/{opt_name}/validate'
|
2752 |
* @param &array [&$plugin_options, redux_options]
|
2753 |
*/
|
2754 |
do_action_ref_array( "redux/options/{$this->args['opt_name']}/validate", array(
|
2755 |
+
&$plugin_options,
|
2756 |
+
$this->options,
|
2757 |
+
$this->transients['changed_values']
|
2758 |
+
) );
|
2759 |
|
2760 |
if ( ! empty( $plugin_options['compiler'] ) ) {
|
2761 |
unset( $plugin_options['compiler'] );
|
2778 |
return;
|
2779 |
}
|
2780 |
|
2781 |
+
if ( defined( 'WP_CACHE' ) && WP_CACHE && class_exists( 'W3_ObjectCache' ) ) {
|
2782 |
//echo "here";
|
2783 |
+
$w3 = W3_ObjectCache::instance();
|
2784 |
+
$key = $w3->_get_cache_key( $this->args['opt_name'] . '-transients', 'transient' );
|
2785 |
//echo $key;
|
2786 |
+
$w3->delete( $key, 'transient', true );
|
2787 |
//set_transient($this->args['opt_name'].'-transients', $this->transients);
|
2788 |
//exit();
|
2789 |
}
|
2790 |
|
2791 |
+
$this->set_transients( $this->transients );
|
|
|
2792 |
|
2793 |
|
2794 |
return $plugin_options;
|
2833 |
}
|
2834 |
|
2835 |
// Check for empty id value
|
2836 |
+
|
2837 |
if ( ! isset( $plugin_options[ $field['id'] ] ) || $plugin_options[ $field['id'] ] == '' ) {
|
2838 |
|
2839 |
// If we are looking for an empty value, in the case of 'not_empty'
|
3166 |
echo '<a href="javascript:void(0);" class="expand_options' . $expanded . '">' . __( 'Expand', 'redux-framework' ) . '</a>';
|
3167 |
echo '<div class="redux-action_bar">';
|
3168 |
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false );
|
3169 |
+
|
3170 |
+
if ( false === $this->args['hide_reset'] ) {
|
3171 |
echo ' ';
|
3172 |
submit_button( __( 'Reset Section', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults-section]', false );
|
3173 |
echo ' ';
|
3174 |
submit_button( __( 'Reset All', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults]', false );
|
3175 |
}
|
3176 |
+
|
3177 |
echo '</div>';
|
3178 |
|
3179 |
echo '<div class="redux-ajax-loading" alt="' . __( 'Working...', 'redux-framework' ) . '"> </div>';
|
3293 |
}
|
3294 |
}
|
3295 |
|
3296 |
+
if ( isset( $section['customizer_only'] ) && $section['customizer_only'] == true ) {
|
3297 |
continue;
|
3298 |
+
}
|
3299 |
+
|
3300 |
if ( false == $skip_sec ) {
|
3301 |
echo $this->section_menu( $k, $section );
|
3302 |
$skip_sec = false;
|
3347 |
echo '<div class="redux-main">';
|
3348 |
|
3349 |
foreach ( $this->sections as $k => $section ) {
|
3350 |
+
if ( isset( $section['customizer_only'] ) && $section['customizer_only'] == true ) {
|
3351 |
continue;
|
3352 |
+
}
|
3353 |
+
|
3354 |
//$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k ) ) ? ' style="display: block;"' : '';
|
3355 |
$section['class'] = isset( $section['class'] ) ? ' ' . $section['class'] : '';
|
3356 |
echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab' . $section['class'] . '" data-rel="' . $k . '">';
|
3399 |
// Import / Export output
|
3400 |
if ( true == $this->args['show_import_export'] && false == $this->import_export->is_field ) {
|
3401 |
$this->import_export->enqueue();
|
3402 |
+
|
3403 |
echo '<fieldset id="' . $this->args['opt_name'] . '-import_export_core" class="redux-field-container redux-field redux-field-init redux-container-import_export" data-id="import_export_core" data-type="import_export">';
|
3404 |
$this->import_export->render();
|
3405 |
echo '</fieldset>';
|
3474 |
|
3475 |
echo '<div class="redux-action_bar">';
|
3476 |
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false );
|
3477 |
+
|
3478 |
+
if ( false === $this->args['hide_reset'] ) {
|
3479 |
echo ' ';
|
3480 |
submit_button( __( 'Reset Section', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults-section]', false );
|
3481 |
echo ' ';
|
3482 |
submit_button( __( 'Reset All', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults]', false );
|
3483 |
}
|
3484 |
+
|
3485 |
echo '</div>';
|
3486 |
|
3487 |
echo '<div class="redux-ajax-loading" alt="' . __( 'Working...', 'redux-framework' ) . '"> </div>';
|
3754 |
do_action( "redux/field/{$this->args['opt_name']}/fieldset/before/{$this->args['opt_name']}", $field, $value );
|
3755 |
|
3756 |
if ( ! isset( $field['fields'] ) || empty( $field['fields'] ) ) {
|
3757 |
+
echo '<fieldset id="' . $this->args['opt_name'] . '-' . $field['id'] . '" class="redux-field-container redux-field redux-field-init redux-container-' . $field['type'] . ' ' . $class_string . '" data-id="' . $field['id'] . '" ' . $data_string . ' data-type="' . $field['type'] . '">';
|
3758 |
}
|
3759 |
|
3760 |
echo $_render;
|
3853 |
*
|
3854 |
* @return array $params
|
3855 |
*/
|
3856 |
+
private function check_dependencies( $field ) {
|
3857 |
//$params = array('data_string' => "", 'class_string' => "");
|
3858 |
|
3859 |
if ( ! empty( $field['required'] ) ) {
|
3904 |
}
|
3905 |
|
3906 |
// Compare data for required field
|
3907 |
+
private function compareValueDependencies( $parentValue, $checkValue, $operation ) {
|
3908 |
$return = false;
|
3909 |
|
3910 |
switch ( $operation ) {
|
3946 |
case 'greater':
|
3947 |
case 'is_larger':
|
3948 |
$data['operation'] = ">";
|
3949 |
+
if ( $parentValue > $checkValue ) {
|
3950 |
+
$return = true;
|
3951 |
+
}
|
3952 |
break;
|
3953 |
case '>=':
|
3954 |
case 'greater_equal':
|
3955 |
case 'is_larger_equal':
|
3956 |
$data['operation'] = ">=";
|
3957 |
+
if ( $parentValue >= $checkValue ) {
|
3958 |
+
$return = true;
|
3959 |
+
}
|
3960 |
break;
|
3961 |
case '<':
|
3962 |
case 'less':
|
3963 |
case 'is_smaller':
|
3964 |
$data['operation'] = "<";
|
3965 |
+
if ( $parentValue < $checkValue ) {
|
3966 |
+
$return = true;
|
3967 |
+
}
|
3968 |
break;
|
3969 |
case '<=':
|
3970 |
case 'less_equal':
|
3971 |
case 'is_smaller_equal':
|
3972 |
$data['operation'] = "<=";
|
3973 |
+
if ( $parentValue <= $checkValue ) {
|
3974 |
+
$return = true;
|
3975 |
+
}
|
3976 |
break;
|
3977 |
case 'contains':
|
3978 |
if ( strpos( $parentValue, $checkValue ) !== false ) {
|
3981 |
break;
|
3982 |
case 'doesnt_contain':
|
3983 |
case 'not_contain':
|
3984 |
+
if ( strpos( $parentValue, $checkValue ) === false ) {
|
3985 |
+
$return = true;
|
3986 |
+
}
|
3987 |
break;
|
3988 |
case 'is_empty_or':
|
3989 |
if ( empty( $parentValue ) || $parentValue == $checkValue ) {
|
3998 |
case 'is_empty':
|
3999 |
case 'empty':
|
4000 |
case '!isset':
|
4001 |
+
if ( empty( $parentValue ) || $parentValue == "" || $parentValue == null ) {
|
4002 |
+
$return = true;
|
4003 |
+
}
|
4004 |
break;
|
4005 |
case 'not_empty':
|
4006 |
case '!empty':
|
4007 |
case 'isset':
|
4008 |
+
if ( ! empty( $parentValue ) && $parentValue != "" && $parentValue != null ) {
|
4009 |
+
$return = true;
|
4010 |
+
}
|
4011 |
break;
|
4012 |
}
|
4013 |
|
4014 |
return $return;
|
4015 |
}
|
4016 |
|
4017 |
+
private function checkRequiredDependencies( $field, $data ) {
|
4018 |
//required field must not be hidden. otherwise hide this one by default
|
4019 |
|
4020 |
if ( ! in_array( $data['parent'], $this->fieldsHidden ) && ( ! isset( $this->folds[ $field['id'] ] ) || $this->folds[ $field['id'] ] != "hide" ) ) {
|
ReduxCore/inc/class.redux_filesystem.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
if (!class_exists('Redux_Filesystem')){
|
8 |
+
class Redux_Filesystem {
|
9 |
+
private $parent = null;
|
10 |
+
|
11 |
+
public $fs_object = null;
|
12 |
+
|
13 |
+
public function __construct($parent) {
|
14 |
+
$this->parent = $parent;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function execute($action, $file, $params = '') {
|
18 |
+
global $wp_filesystem;
|
19 |
+
|
20 |
+
if (!empty ($params)) {
|
21 |
+
extract($params);
|
22 |
+
}
|
23 |
+
|
24 |
+
// Setup the filesystem with creds
|
25 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
26 |
+
|
27 |
+
if ($this->parent->args['menu_type'] == 'submenu') {
|
28 |
+
$page_parent = $this->parent->args['page_parent'];
|
29 |
+
$base = $page_parent . '?page=' . $this->parent->args['page_slug'];
|
30 |
+
} else {
|
31 |
+
$base = 'admin.php?page=' . $this->parent->args['page_slug'];
|
32 |
+
}
|
33 |
+
|
34 |
+
$url = wp_nonce_url($base);
|
35 |
+
if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->parent->args['page_slug'] ) {
|
36 |
+
$creds = request_filesystem_credentials($url, '', false, false);
|
37 |
+
} else {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
if (false === $creds) {
|
42 |
+
if (!is_admin()) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
return true;
|
47 |
+
}
|
48 |
+
|
49 |
+
if (!WP_Filesystem($creds)) {
|
50 |
+
if (!is_admin()) {
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
// Never load this unless we're on the panel page.
|
54 |
+
if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->parent->args['page_slug'] ) {
|
55 |
+
$creds = request_filesystem_credentials($url, '', false, false);
|
56 |
+
} else {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
return true;
|
60 |
+
}
|
61 |
+
|
62 |
+
$wp_filesystem =& $wp_filesystem;
|
63 |
+
|
64 |
+
// Do unique stuff
|
65 |
+
if ($action == 'mkdir') {
|
66 |
+
$res = $wp_filesystem->$action($file, 0755 );
|
67 |
+
} elseif ($action == 'copy') {
|
68 |
+
echo $wp_filesystem->copy($file, $destination, $overwrite, 0644 );
|
69 |
+
$res = false;
|
70 |
+
} elseif ($action == 'put_contents') {
|
71 |
+
$wp_filesystem->put_contents($file, $content, 0644);
|
72 |
+
$res = false;
|
73 |
+
} elseif ($action == 'get_contents') {
|
74 |
+
$res = $wp_filesystem->$action($file);
|
75 |
+
} elseif ($action == 'object') {
|
76 |
+
$res = $wp_filesystem;
|
77 |
+
} else {
|
78 |
+
$res = false;
|
79 |
+
}
|
80 |
+
|
81 |
+
return $res;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
ReduxCore/inc/class.redux_functions.php
CHANGED
@@ -1,292 +1,293 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
-
* Redux
|
|
|
5 |
*
|
6 |
-
* @
|
7 |
-
* @subpackage Core
|
8 |
*/
|
9 |
-
|
10 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
-
exit;
|
12 |
-
}
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
/**
|
18 |
-
*
|
19 |
-
* Class of useful functions that can/should be shared among all Redux files.
|
20 |
*
|
21 |
-
* @since
|
|
|
|
|
22 |
*/
|
23 |
-
|
24 |
-
|
25 |
-
static public $_parent;
|
26 |
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
-
$min = '.min';
|
32 |
-
}
|
33 |
|
34 |
-
|
35 |
-
|
|
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
*
|
40 |
-
* @since 3.2.8
|
41 |
-
* @access private
|
42 |
-
* @return $css CSS string
|
43 |
-
*/
|
44 |
-
public static function parseCSS( $cssArray = array(), $style = '', $value = '' ) {
|
45 |
-
|
46 |
-
// Something wrong happened
|
47 |
-
if ( count( $cssArray ) == 0 ) {
|
48 |
-
return;
|
49 |
-
} else { //if ( count( $cssArray ) >= 1 ) {
|
50 |
-
$css = '';
|
51 |
-
|
52 |
-
foreach ( $cssArray as $element => $selector ) {
|
53 |
-
|
54 |
-
// The old way
|
55 |
-
if ( $element === 0 ) {
|
56 |
-
$css = self::theOldWay( $cssArray, $style );
|
57 |
-
|
58 |
-
return $css;
|
59 |
-
}
|
60 |
|
61 |
-
|
62 |
-
|
63 |
|
64 |
-
|
65 |
-
}
|
66 |
}
|
67 |
-
|
68 |
-
return $css;
|
69 |
}
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
$css = $keys . "{" . $style . '}';
|
74 |
|
75 |
-
|
76 |
-
|
|
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
93 |
}
|
|
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
}
|
114 |
}
|
115 |
}
|
|
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
}
|
168 |
}
|
169 |
}
|
170 |
}
|
171 |
}
|
|
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
// If no cookie, check for new ver
|
186 |
-
if ( ! isset( $_COOKIE['redux_update_check'] ) ) { // || 1 == strcmp($_COOKIE['redux_update_check'], self::$_version)) {
|
187 |
-
// actual ver number from git repo
|
188 |
-
$ver = self::verFromGit();
|
189 |
-
|
190 |
-
// hour long cookie.
|
191 |
-
setcookie( "redux_update_check", $ver, time() + 3600, '/' );
|
192 |
-
} else {
|
193 |
-
|
194 |
-
// saved value from cookie. If it's different from current ver
|
195 |
-
// we can still show the update notice.
|
196 |
-
$ver = $_COOKIE['redux_update_check'];
|
197 |
-
}
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
//
|
228 |
-
$
|
229 |
-
|
230 |
-
if (
|
231 |
-
|
232 |
-
//
|
233 |
-
//
|
234 |
-
|
235 |
-
|
236 |
-
//
|
237 |
-
|
238 |
-
$pageName = '';
|
239 |
-
$curTab = '';
|
240 |
-
if ( $pagenow == 'admin.php' || $pagenow == 'themes.php' ) {
|
241 |
-
|
242 |
-
// Get the current page. To avoid errors, we'll set
|
243 |
-
// the redux page slug if the GET is empty.
|
244 |
-
$pageName = empty( $_GET['page'] ) ? '&page=' . self::$_parent->args['page_slug'] : '&page=' . $_GET['page'];
|
245 |
-
|
246 |
-
// Ditto for the current tab.
|
247 |
-
$curTab = empty( $_GET['tab'] ) ? '&tab=0' : '&tab=' . $_GET['tab'];
|
248 |
-
}
|
249 |
-
|
250 |
-
// Print the notice with the dismiss link
|
251 |
-
echo '<div class="' . $notice['type'] . '"><p>' . $notice['msg'] . ' <a href="?dismiss=true&id=' . $notice['id'] . $pageName . $curTab . '">' . __( 'Dismiss', 'redux-framework' ) . '</a>.</p></div>';
|
252 |
}
|
253 |
-
} else {
|
254 |
|
255 |
-
//
|
256 |
-
echo '<div class="' . $notice['type'] . '"><p>' . $notice['msg'] . '</a>.</p></div>';
|
257 |
}
|
258 |
-
}
|
259 |
|
260 |
-
|
261 |
-
|
|
|
262 |
}
|
|
|
|
|
|
|
263 |
}
|
|
|
264 |
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
// Verify the dismiss and id parameters are present.
|
276 |
-
if ( isset( $_GET['dismiss'] ) && isset( $_GET['id'] ) ) {
|
277 |
-
if ( 'true' == $_GET['dismiss'] || 'false' == $_GET['dismiss'] ) {
|
278 |
-
|
279 |
-
// Get the user id
|
280 |
-
$userid = $current_user->ID;
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
|
286 |
-
|
287 |
-
|
288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
}
|
290 |
}
|
291 |
}
|
292 |
-
}
|
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Redux Framework Private Functions Container Class
|
5 |
+
*
|
6 |
+
* @package Redux_Framework
|
7 |
+
* @subpackage Core
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Exit if accessed directly
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit;
|
13 |
+
}
|
14 |
+
|
15 |
+
// Don't duplicate me!
|
16 |
+
if ( ! class_exists( 'Redux_Functions' ) ) {
|
17 |
+
|
18 |
/**
|
19 |
+
* Redux Functions Class
|
20 |
+
* Class of useful functions that can/should be shared among all Redux files.
|
21 |
*
|
22 |
+
* @since 1.0.0
|
|
|
23 |
*/
|
24 |
+
class Redux_Functions {
|
|
|
|
|
|
|
25 |
|
26 |
+
static public $_parent;
|
27 |
+
|
28 |
+
public static function isMin() {
|
29 |
+
$min = '';
|
30 |
+
|
31 |
+
if ( false == self::$_parent->args['dev_mode'] ) {
|
32 |
+
$min = '.min';
|
33 |
+
}
|
34 |
+
|
35 |
+
return $min;
|
36 |
+
}
|
37 |
|
38 |
/**
|
39 |
+
* Parse CSS from output/compiler array
|
|
|
40 |
*
|
41 |
+
* @since 3.2.8
|
42 |
+
* @access private
|
43 |
+
* @return $css CSS string
|
44 |
*/
|
45 |
+
public static function parseCSS( $cssArray = array(), $style = '', $value = '' ) {
|
|
|
|
|
46 |
|
47 |
+
// Something wrong happened
|
48 |
+
if ( count( $cssArray ) == 0 ) {
|
49 |
+
return;
|
50 |
+
} else { //if ( count( $cssArray ) >= 1 ) {
|
51 |
+
$css = '';
|
52 |
|
53 |
+
foreach ( $cssArray as $element => $selector ) {
|
|
|
|
|
54 |
|
55 |
+
// The old way
|
56 |
+
if ( $element === 0 ) {
|
57 |
+
$css = self::theOldWay( $cssArray, $style );
|
58 |
|
59 |
+
return $css;
|
60 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
// New way continued
|
63 |
+
$cssStyle = $element . ':' . $value . ';';
|
64 |
|
65 |
+
$css .= $selector . '{' . $cssStyle . '}';
|
|
|
66 |
}
|
|
|
|
|
67 |
}
|
68 |
|
69 |
+
return $css;
|
70 |
+
}
|
|
|
71 |
|
72 |
+
private static function theOldWay( $cssArray, $style ) {
|
73 |
+
$keys = implode( ",", $cssArray );
|
74 |
+
$css = $keys . "{" . $style . '}';
|
75 |
|
76 |
+
return $css;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* initWpFilesystem - Initialized the Wordpress filesystem, if it already isn't.
|
81 |
+
*
|
82 |
+
* @since 3.2.3
|
83 |
+
* @access public
|
84 |
+
* @return void
|
85 |
+
*/
|
86 |
+
public static function initWpFilesystem() {
|
87 |
+
global $wp_filesystem;
|
88 |
+
|
89 |
+
// Initialize the Wordpress filesystem, no more using file_put_contents function
|
90 |
+
if ( empty( $wp_filesystem ) ) {
|
91 |
+
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
92 |
+
WP_Filesystem();
|
93 |
}
|
94 |
+
}
|
95 |
|
96 |
+
/**
|
97 |
+
* modRewriteCheck - Check for the installation of apache mod_rewrite
|
98 |
+
*
|
99 |
+
* @since 3.2.3
|
100 |
+
* @access public
|
101 |
+
* @return void
|
102 |
+
*/
|
103 |
+
public static function modRewriteCheck() {
|
104 |
+
if ( function_exists( 'apache_get_modules' ) ) {
|
105 |
+
if ( ! in_array( 'mod_rewrite', apache_get_modules() ) ) {
|
106 |
+
self::$_parent->admin_notices[] = array(
|
107 |
+
'type' => 'error',
|
108 |
+
'msg' => '<strong><center>The Apache mod_rewrite module is not enabled on your server.</center></strong>
|
109 |
+
<br/>
|
110 |
+
Both Wordpress and Redux require the enabling of the Apache mod_rewrite module to function properly. Please contact whomever provides support for your server and ask them to enable the mod_rewrite module',
|
111 |
+
'id' => 'mod_rewrite_notice_',
|
112 |
+
'dismiss' => false
|
113 |
+
);
|
|
|
114 |
}
|
115 |
}
|
116 |
+
}
|
117 |
|
118 |
+
/**
|
119 |
+
* verFromGit - Retrives latest Redux version from GIT
|
120 |
+
*
|
121 |
+
* @since 3.2.0
|
122 |
+
* @access private
|
123 |
+
* @return string $ver
|
124 |
+
*/
|
125 |
+
private static function verFromGit() {
|
126 |
+
// Get the raw framework.php from github
|
127 |
+
$gitpage = wp_remote_get(
|
128 |
+
'https://raw.github.com/ReduxFramework/redux-framework/master/ReduxCore/framework.php', array(
|
129 |
+
'headers' => array(
|
130 |
+
'Accept-Encoding' => ''
|
131 |
+
),
|
132 |
+
'sslverify' => true,
|
133 |
+
'timeout' => 300
|
134 |
+
) );
|
135 |
+
|
136 |
+
// Is the response code the corect one?
|
137 |
+
if ( ! is_wp_error( $gitpage ) ) {
|
138 |
+
if ( isset( $gitpage['body'] ) ) {
|
139 |
+
// Get the page text.
|
140 |
+
$body = $gitpage['body'];
|
141 |
+
|
142 |
+
// Find version line in framework.php
|
143 |
+
$needle = 'public static $_version =';
|
144 |
+
$pos = strpos( $body, $needle );
|
145 |
+
|
146 |
+
// If it's there, continue. We don't want errors if $pos = 0.
|
147 |
+
if ( $pos > 0 ) {
|
148 |
+
|
149 |
+
// Look for the semi-colon at the end of the version line
|
150 |
+
$semi = strpos( $body, ";", $pos );
|
151 |
+
|
152 |
+
// Error avoidance. If the semi-colon is there, continue.
|
153 |
+
if ( $semi > 0 ) {
|
154 |
+
|
155 |
+
// Extract the version line
|
156 |
+
$text = substr( $body, $pos, ( $semi - $pos ) );
|
157 |
+
|
158 |
+
// Find the first quote around the veersion number.
|
159 |
+
$quote = strpos( $body, "'", $pos );
|
160 |
+
|
161 |
+
// Extract the version number
|
162 |
+
$ver = substr( $body, $quote, ( $semi - $quote ) );
|
163 |
+
|
164 |
+
// Strip off quotes.
|
165 |
+
$ver = str_replace( "'", '', $ver );
|
166 |
+
|
167 |
+
return $ver;
|
|
|
168 |
}
|
169 |
}
|
170 |
}
|
171 |
}
|
172 |
+
}
|
173 |
|
174 |
+
/**
|
175 |
+
* updateCheck - Checks for updates to Redux Framework
|
176 |
+
*
|
177 |
+
* @since 3.2.0
|
178 |
+
* @access public
|
179 |
+
*
|
180 |
+
* @param string $curVer Current version of Redux Framework
|
181 |
+
*
|
182 |
+
* @return void - Admin notice is diaplyed if new version is found
|
183 |
+
*/
|
184 |
+
public static function updateCheck( $curVer ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
+
// If no cookie, check for new ver
|
187 |
+
if ( ! isset( $_COOKIE['redux_update_check'] ) ) { // || 1 == strcmp($_COOKIE['redux_update_check'], self::$_version)) {
|
188 |
+
// actual ver number from git repo
|
189 |
+
$ver = self::verFromGit();
|
190 |
+
|
191 |
+
// hour long cookie.
|
192 |
+
setcookie( "redux_update_check", $ver, time() + 3600, '/' );
|
193 |
+
} else {
|
194 |
+
|
195 |
+
// saved value from cookie. If it's different from current ver
|
196 |
+
// we can still show the update notice.
|
197 |
+
$ver = $_COOKIE['redux_update_check'];
|
198 |
+
}
|
199 |
+
|
200 |
+
// Set up admin notice on new version
|
201 |
+
if ( 1 == strcmp( $ver, $curVer ) ) {
|
202 |
+
self::$_parent->admin_notices[] = array(
|
203 |
+
'type' => 'updated',
|
204 |
+
'msg' => '<strong>A new build of Redux is now available!</strong><br/><br/>Your version: <strong>' . $curVer . '</strong><br/>New version: <strong><span style="color: red;">' . $ver . '</span></strong><br/><br/><a href="https://github.com/ReduxFramework/redux-framework">Get it now</a> |',
|
205 |
+
'id' => 'dev_notice_' . $ver,
|
206 |
+
'dismiss' => true,
|
207 |
+
);
|
208 |
}
|
209 |
+
}
|
210 |
+
|
211 |
+
/**
|
212 |
+
* adminNotices - Evaluates user dismiss option for displaying admin notices
|
213 |
+
*
|
214 |
+
* @since 3.2.0
|
215 |
+
* @access public
|
216 |
+
* @return void
|
217 |
+
*/
|
218 |
+
public static function adminNotices() {
|
219 |
+
global $current_user, $pagenow;
|
220 |
|
221 |
+
// Check for an active admin notice array
|
222 |
+
if ( ! empty( self::$_parent->admin_notices ) ) {
|
223 |
+
|
224 |
+
// Enum admin notices
|
225 |
+
foreach ( self::$_parent->admin_notices as $notice ) {
|
226 |
+
if ( true == $notice['dismiss'] ) {
|
227 |
+
|
228 |
+
// Get user ID
|
229 |
+
$userid = $current_user->ID;
|
230 |
+
|
231 |
+
if ( ! get_user_meta( $userid, 'ignore_' . $notice['id'] ) ) {
|
232 |
+
|
233 |
+
// Check if we are on admin.php. If we are, we have
|
234 |
+
// to get the current page slug and tab, so we can
|
235 |
+
// feed it back to Wordpress. Why> admin.php cannot
|
236 |
+
// be accessed without the page parameter. We add the
|
237 |
+
// tab to return the user to the last panel they were
|
238 |
+
// on.
|
239 |
+
$pageName = '';
|
240 |
+
$curTab = '';
|
241 |
+
if ( $pagenow == 'admin.php' || $pagenow == 'themes.php' ) {
|
242 |
+
|
243 |
+
// Get the current page. To avoid errors, we'll set
|
244 |
+
// the redux page slug if the GET is empty.
|
245 |
+
$pageName = empty( $_GET['page'] ) ? '&page=' . self::$_parent->args['page_slug'] : '&page=' . $_GET['page'];
|
246 |
+
|
247 |
+
// Ditto for the current tab.
|
248 |
+
$curTab = empty( $_GET['tab'] ) ? '&tab=0' : '&tab=' . $_GET['tab'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
}
|
|
|
250 |
|
251 |
+
// Print the notice with the dismiss link
|
252 |
+
echo '<div class="' . $notice['type'] . '"><p>' . $notice['msg'] . ' <a href="?dismiss=true&id=' . $notice['id'] . $pageName . $curTab . '">' . __( 'Dismiss', 'redux-framework' ) . '</a>.</p></div>';
|
253 |
}
|
254 |
+
} else {
|
255 |
|
256 |
+
// Standard notice
|
257 |
+
echo '<div class="' . $notice['type'] . '"><p>' . $notice['msg'] . '</a>.</p></div>';
|
258 |
+
}
|
259 |
}
|
260 |
+
|
261 |
+
// Clear the admin notice array
|
262 |
+
self::$_parent->admin_notices = array();
|
263 |
}
|
264 |
+
}
|
265 |
|
266 |
+
/**
|
267 |
+
* dismissAdminNotice - Updates user meta to store dismiss notice preference
|
268 |
+
*
|
269 |
+
* @since 3.2.0
|
270 |
+
* @access public
|
271 |
+
* @return void
|
272 |
+
*/
|
273 |
+
public static function dismissAdminNotice() {
|
274 |
+
global $current_user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
|
276 |
+
// Verify the dismiss and id parameters are present.
|
277 |
+
if ( isset( $_GET['dismiss'] ) && isset( $_GET['id'] ) ) {
|
278 |
+
if ( 'true' == $_GET['dismiss'] || 'false' == $_GET['dismiss'] ) {
|
279 |
|
280 |
+
// Get the user id
|
281 |
+
$userid = $current_user->ID;
|
282 |
+
|
283 |
+
// Get the notice id
|
284 |
+
$id = $_GET['id'];
|
285 |
+
$val = $_GET['dismiss'];
|
286 |
+
|
287 |
+
// Add the dismiss request to the user meta.
|
288 |
+
update_user_meta( $userid, 'ignore_' . $id, $val );
|
289 |
}
|
290 |
}
|
291 |
}
|
292 |
+
}
|
293 |
+
}
|
ReduxCore/inc/class.redux_helpers.php
CHANGED
@@ -1,175 +1,195 @@
|
|
1 |
<?php
|
2 |
|
3 |
// Exit if accessed directly
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
|
8 |
// Don't duplicate me!
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
|
24 |
-
|
25 |
-
$data = curl_exec( $ch );
|
26 |
-
|
27 |
-
curl_close( $ch );
|
28 |
-
|
29 |
-
if ( empty( $data ) ) {
|
30 |
-
$data = false;
|
31 |
}
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
public static function tabFromField( $parent, $field ) {
|
37 |
-
foreach ( $parent->sections as $k => $section ) {
|
38 |
-
if ( ! isset( $section['title'] ) ) {
|
39 |
continue;
|
40 |
}
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
}
|
47 |
-
}
|
48 |
}
|
49 |
}
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
return true;
|
|
|
55 |
}
|
56 |
}
|
|
|
|
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
if ( ! isset( $section['title'] ) ) {
|
64 |
-
continue;
|
65 |
-
}
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
74 |
}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
80 |
|
81 |
-
|
|
|
|
|
82 |
}
|
83 |
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
return true;
|
87 |
}
|
88 |
-
|
89 |
-
return false;
|
90 |
}
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
|
96 |
-
|
97 |
-
|
|
|
98 |
return true;
|
99 |
}
|
100 |
-
|
101 |
-
return false;
|
102 |
}
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
if ( ! is_array( $needle ) ) {
|
107 |
-
$needle = array( $needle );
|
108 |
-
}
|
109 |
-
//For each value in $needle, return TRUE if in $haystack
|
110 |
-
foreach ( $needle as $pin ) //echo 'needle' . $pin;
|
111 |
-
{
|
112 |
-
if ( in_array( $pin, $haystack ) ) {
|
113 |
-
return true;
|
114 |
-
}
|
115 |
-
}
|
116 |
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
}
|
127 |
-
|
128 |
-
|
129 |
}
|
|
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
}
|
|
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
* @since ReduxFramework 3.0.4
|
152 |
-
*/
|
153 |
-
public static function hex2rgba( $hex, $alpha = '' ) {
|
154 |
-
$hex = str_replace( "#", "", $hex );
|
155 |
-
if ( strlen( $hex ) == 3 ) {
|
156 |
-
$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
|
157 |
-
$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
|
158 |
-
$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
|
159 |
-
} else {
|
160 |
-
$r = hexdec( substr( $hex, 0, 2 ) );
|
161 |
-
$g = hexdec( substr( $hex, 2, 2 ) );
|
162 |
-
$b = hexdec( substr( $hex, 4, 2 ) );
|
163 |
-
}
|
164 |
-
$rgb = $r . ',' . $g . ',' . $b;
|
165 |
-
|
166 |
-
if ( '' == $alpha ) {
|
167 |
-
return $rgb;
|
168 |
-
} else {
|
169 |
-
$alpha = floatval( $alpha );
|
170 |
|
171 |
-
|
172 |
-
}
|
173 |
}
|
174 |
}
|
175 |
}
|
|
1 |
<?php
|
2 |
|
3 |
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
|
8 |
// Don't duplicate me!
|
9 |
+
if ( ! class_exists( 'Redux_Helpers' ) ) {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Redux Helpers Class
|
13 |
+
* Class of useful functions that can/should be shared among all Redux files.
|
14 |
+
*
|
15 |
+
* @since 1.0.0
|
16 |
+
*/
|
17 |
+
class Redux_Helpers {
|
18 |
+
|
19 |
+
public static function tabFromField( $parent, $field ) {
|
20 |
+
foreach ( $parent->sections as $k => $section ) {
|
21 |
+
if ( ! isset( $section['title'] ) ) {
|
22 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
+
if ( isset( $section['fields'] ) && ! empty( $section['fields'] ) ) {
|
26 |
+
if ( Redux_Helpers::recursive_array_search( $field, $section['fields'] ) ) {
|
27 |
+
return $k;
|
|
|
|
|
|
|
28 |
continue;
|
29 |
}
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
33 |
|
34 |
+
public static function isFieldInUseByType( $fields, $field = array() ) {
|
35 |
+
foreach ( $field as $name ) {
|
36 |
+
if ( array_key_exists( $name, $fields ) ) {
|
37 |
+
return true;
|
|
|
|
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
public static function isFieldInUse( $parent, $field ) {
|
45 |
+
foreach ( $parent->sections as $k => $section ) {
|
46 |
+
if ( ! isset( $section['title'] ) ) {
|
47 |
+
continue;
|
48 |
+
}
|
49 |
+
|
50 |
+
if ( isset( $section['fields'] ) && ! empty( $section['fields'] ) ) {
|
51 |
+
if ( Redux_Helpers::recursive_array_search( $field, $section['fields'] ) ) {
|
52 |
return true;
|
53 |
+
continue;
|
54 |
}
|
55 |
}
|
56 |
+
}
|
57 |
+
}
|
58 |
|
59 |
+
public static function isParentTheme( $file ) {
|
60 |
+
$file = self::cleanFilePath( $file );
|
61 |
+
$dir = self::cleanFilePath( get_template_directory() );
|
62 |
+
|
63 |
+
$file = str_replace('//', '/', $file);
|
64 |
+
$dir = str_replace('//', '/', $dir);
|
65 |
+
|
66 |
+
if ( strpos( $file, $dir ) !== false ) {
|
67 |
+
return true;
|
68 |
}
|
69 |
|
70 |
+
return false;
|
71 |
+
}
|
|
|
|
|
|
|
72 |
|
73 |
+
public static function isChildTheme( $file ) {
|
74 |
+
$file = self::cleanFilePath( $file );
|
75 |
+
$dir = self::cleanFilePath( get_stylesheet_directory() );
|
76 |
+
|
77 |
+
$file = str_replace('//', '/', $file);
|
78 |
+
$dir = str_replace('//', '/', $dir);
|
79 |
+
|
80 |
+
if ( strpos( $file, $dir ) !== false ) {
|
81 |
+
return true;
|
82 |
}
|
83 |
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
private static function reduxAsPlugin() {
|
88 |
+
return ReduxFramework::$_as_plugin;
|
89 |
+
}
|
90 |
|
91 |
+
public static function isTheme( $file ) {
|
92 |
+
if ( true == self::isChildTheme( $file ) || true == self::isParentTheme( $file ) ) {
|
93 |
+
return true;
|
94 |
}
|
95 |
|
96 |
+
return false;
|
97 |
+
}
|
98 |
+
|
99 |
+
public static function array_in_array( $needle, $haystack ) {
|
100 |
+
//Make sure $needle is an array for foreach
|
101 |
+
if ( ! is_array( $needle ) ) {
|
102 |
+
$needle = array( $needle );
|
103 |
+
}
|
104 |
+
//For each value in $needle, return TRUE if in $haystack
|
105 |
+
foreach ( $needle as $pin ) //echo 'needle' . $pin;
|
106 |
+
{
|
107 |
+
if ( in_array( $pin, $haystack ) ) {
|
108 |
return true;
|
109 |
}
|
|
|
|
|
110 |
}
|
111 |
|
112 |
+
//Return FALSE if none of the values from $needle are found in $haystack
|
113 |
+
return false;
|
114 |
+
}
|
115 |
|
116 |
+
public static function recursive_array_search( $needle, $haystack ) {
|
117 |
+
foreach ( $haystack as $key => $value ) {
|
118 |
+
if ( $needle === $value || ( is_array( $value ) && self::recursive_array_search( $needle, $value ) !== false ) ) {
|
119 |
return true;
|
120 |
}
|
|
|
|
|
121 |
}
|
122 |
|
123 |
+
return false;
|
124 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
+
/**
|
127 |
+
* Take a path and return it clean
|
128 |
+
*
|
129 |
+
* @param string $path
|
130 |
+
*
|
131 |
+
* @since 3.1.7
|
132 |
+
*/
|
133 |
+
public static function cleanFilePath( $path ) {
|
134 |
+
$path = str_replace( '', '', str_replace( array( "\\", "\\\\" ), '/', $path ) );
|
135 |
+
|
136 |
+
if ( $path[ strlen( $path ) - 1 ] === '/' ) {
|
137 |
+
$path = rtrim( $path, '/' );
|
138 |
}
|
139 |
|
140 |
+
return $path;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Take a path and delete it
|
145 |
+
*
|
146 |
+
* @param string $path
|
147 |
+
*
|
148 |
+
* @since 3.3.3
|
149 |
+
*/
|
150 |
+
public static function rmdir( $dir ) {
|
151 |
+
if ( is_dir( $dir ) ) {
|
152 |
+
$objects = scandir( $dir );
|
153 |
+
foreach ( $objects as $object ) {
|
154 |
+
if ( $object != "." && $object != ".." ) {
|
155 |
+
if ( filetype( $dir . "/" . $object ) == "dir" ) {
|
156 |
+
rrmdir( $dir . "/" . $object );
|
157 |
+
} else {
|
158 |
+
unlink( $dir . "/" . $object );
|
159 |
+
}
|
160 |
}
|
161 |
}
|
162 |
+
reset( $objects );
|
163 |
+
rmdir( $dir );
|
164 |
}
|
165 |
+
}
|
166 |
|
167 |
+
/**
|
168 |
+
* Field Render Function.
|
169 |
+
* Takes the color hex value and converts to a rgba.
|
170 |
+
*
|
171 |
+
* @since ReduxFramework 3.0.4
|
172 |
+
*/
|
173 |
+
public static function hex2rgba( $hex, $alpha = '' ) {
|
174 |
+
$hex = str_replace( "#", "", $hex );
|
175 |
+
if ( strlen( $hex ) == 3 ) {
|
176 |
+
$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
|
177 |
+
$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
|
178 |
+
$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
|
179 |
+
} else {
|
180 |
+
$r = hexdec( substr( $hex, 0, 2 ) );
|
181 |
+
$g = hexdec( substr( $hex, 2, 2 ) );
|
182 |
+
$b = hexdec( substr( $hex, 4, 2 ) );
|
183 |
}
|
184 |
+
$rgb = $r . ',' . $g . ',' . $b;
|
185 |
|
186 |
+
if ( '' == $alpha ) {
|
187 |
+
return $rgb;
|
188 |
+
} else {
|
189 |
+
$alpha = floatval( $alpha );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
+
return 'rgba(' . $rgb . ',' . $alpha . ')';
|
|
|
192 |
}
|
193 |
}
|
194 |
}
|
195 |
+
}
|
ReduxCore/inc/fields/ace_editor/field_ace_editor.php
CHANGED
@@ -33,7 +33,19 @@
|
|
33 |
function __construct( $field = array(), $value = '', $parent ) {
|
34 |
$this->parent = $parent;
|
35 |
$this->field = $field;
|
36 |
-
$this->value =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
/**
|
@@ -113,8 +125,8 @@
|
|
113 |
'maxLines' => 30,
|
114 |
);
|
115 |
|
116 |
-
if ( isset( $field['
|
117 |
-
$params = wp_parse_args( $field['
|
118 |
}
|
119 |
|
120 |
return $params;
|
33 |
function __construct( $field = array(), $value = '', $parent ) {
|
34 |
$this->parent = $parent;
|
35 |
$this->field = $field;
|
36 |
+
$this->value = $value;
|
37 |
+
|
38 |
+
if ( is_array($this->value)) {
|
39 |
+
$this->value = '';
|
40 |
+
} else {
|
41 |
+
$this->value = trim($this->value);
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( ! empty( $this->field['options'] ) ) {
|
45 |
+
$this->field['args'] = $this->field['options'];
|
46 |
+
unset( $this->field['options'] );
|
47 |
+
}
|
48 |
+
|
49 |
}
|
50 |
|
51 |
/**
|
125 |
'maxLines' => 30,
|
126 |
);
|
127 |
|
128 |
+
if ( isset( $field['args'] ) && ! empty( $field['args'] ) && is_array( $field['args'] ) ) {
|
129 |
+
$params = wp_parse_args( $field['args'], $params );
|
130 |
}
|
131 |
|
132 |
return $params;
|
ReduxCore/inc/fields/button_set/field_button_set.php
CHANGED
@@ -84,7 +84,7 @@
|
|
84 |
* @return void
|
85 |
*/
|
86 |
public function render() {
|
87 |
-
|
88 |
// multi => true renders the field multi-selectable (checkbox vs radio)
|
89 |
echo '<div class="buttonset ui-buttonset">';
|
90 |
|
84 |
* @return void
|
85 |
*/
|
86 |
public function render() {
|
87 |
+
|
88 |
// multi => true renders the field multi-selectable (checkbox vs radio)
|
89 |
echo '<div class="buttonset ui-buttonset">';
|
90 |
|
ReduxCore/inc/fields/text/field_text.php
CHANGED
@@ -48,8 +48,12 @@
|
|
48 |
$readonly = isset( $this->field['readonly'] ) ? ' readonly="readonly"' : '';
|
49 |
|
50 |
if ( isset( $this->field['options'] ) && ! empty( $this->field['options'] ) ) {
|
51 |
-
|
52 |
-
$placeholder =
|
|
|
|
|
|
|
|
|
53 |
foreach ( $this->field['options'] as $k => $v ) {
|
54 |
if ( ! empty( $placeholder ) ) {
|
55 |
$placeholder = ( is_array( $this->field['placeholder'] ) && isset( $this->field['placeholder'][ $k ] ) ) ? ' placeholder="' . esc_attr( $this->field['placeholder'][ $k ] ) . '" ' : '';
|
48 |
$readonly = isset( $this->field['readonly'] ) ? ' readonly="readonly"' : '';
|
49 |
|
50 |
if ( isset( $this->field['options'] ) && ! empty( $this->field['options'] ) ) {
|
51 |
+
|
52 |
+
$placeholder = '';
|
53 |
+
if ( isset( $this->field['placeholder'] ) ) {
|
54 |
+
$placeholder = $this->field['placeholder'];
|
55 |
+
}
|
56 |
+
|
57 |
foreach ( $this->field['options'] as $k => $v ) {
|
58 |
if ( ! empty( $placeholder ) ) {
|
59 |
$placeholder = ( is_array( $this->field['placeholder'] ) && isset( $this->field['placeholder'][ $k ] ) ) ? ' placeholder="' . esc_attr( $this->field['placeholder'][ $k ] ) . '" ' : '';
|
ReduxCore/inc/fields/typography/field_typography.php
CHANGED
@@ -49,15 +49,15 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
49 |
* @since ReduxFramework 1.0.0
|
50 |
*/
|
51 |
function __construct($field = array(), $value = '', $parent) {
|
52 |
-
global $wp_filesystem;
|
53 |
-
|
54 |
$this->parent = $parent;
|
55 |
$this->field = $field;
|
56 |
$this->value = $value;
|
57 |
|
58 |
// Init wp_filesystem
|
59 |
-
Redux_Functions::initWpFilesystem();
|
60 |
-
|
|
|
|
|
61 |
// Set upload dir path for google fonts
|
62 |
$this->font_dir = ReduxFramework::$_upload_dir . 'google-fonts/';
|
63 |
|
@@ -65,7 +65,10 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
65 |
if (!is_dir($this->font_dir)) {
|
66 |
|
67 |
// Create it, if not found
|
68 |
-
|
|
|
|
|
|
|
69 |
}
|
70 |
|
71 |
// Set google font file variables
|
@@ -73,7 +76,12 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
73 |
|
74 |
// Move installed googlefonts.json to upload location, if not exists
|
75 |
if (!file_exists($this->google_json)) {
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
// Set field array defaults. No errors please
|
@@ -138,7 +146,7 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
138 |
function localize($field, $value = "") {
|
139 |
$params = array();
|
140 |
|
141 |
-
if (true == $this->user_fonts) {
|
142 |
$params['std_font'] = $this->field['fonts'];
|
143 |
}
|
144 |
|
@@ -154,8 +162,6 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
154 |
* @since ReduxFramework 1.0.0
|
155 |
*/
|
156 |
function render() {
|
157 |
-
global $wp_filesystem;
|
158 |
-
|
159 |
// Since fonts declared is CSS (@font-face) are not rendered in the preview,
|
160 |
// they can be declared in a CSS file and passed here so they DO display in
|
161 |
// font preview. Do NOT pass style.css in your theme, as that will mess up
|
@@ -575,12 +581,14 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
575 |
}
|
576 |
$link.= $family;
|
577 |
|
578 |
-
if (!empty($font['font-style'])) {
|
579 |
$link.= ':';
|
|
|
580 |
if (!empty($font['all-styles'])) {
|
581 |
-
|
|
|
582 |
} else if (!empty($font['font-style'])) {
|
583 |
-
$link.= implode(',', $font['font-style']);
|
584 |
}
|
585 |
}
|
586 |
|
@@ -617,7 +625,7 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
617 |
}
|
618 |
$link.= $family;
|
619 |
|
620 |
-
if (!empty($font['font-style'])) {
|
621 |
$link.= ':';
|
622 |
if (!empty($font['all-styles'])) {
|
623 |
$link.= implode(',', $font['all-styles']);
|
@@ -842,10 +850,8 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
842 |
*
|
843 |
*/
|
844 |
function getGoogleArray() {
|
845 |
-
global $wp_filesystem;
|
846 |
-
|
847 |
// Is already present?
|
848 |
-
if (isset($this->parent->fonts['google']) && !empty($this->parent->fonts['google'])) {
|
849 |
return;
|
850 |
}
|
851 |
|
@@ -863,7 +869,9 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
863 |
}
|
864 |
|
865 |
// Initialize the Wordpress filesystem, no more using file_put_contents function
|
866 |
-
Redux_Functions::initWpFilesystem();
|
|
|
|
|
867 |
|
868 |
if (!file_exists($this->google_json)) {
|
869 |
$result = wp_remote_get(apply_filters('redux-google-fonts-api-url', 'https://www.googleapis.com/webfonts/v1/webfonts?key=') . $this->parent->args['google_api_key'], array('sslverify' => false));
|
@@ -878,20 +886,33 @@ if (!class_exists('ReduxFramework_typography')) {
|
|
878 |
}
|
879 |
|
880 |
if (!empty($this->parent->googleArray)) {
|
881 |
-
$
|
882 |
-
|
883 |
);
|
|
|
|
|
|
|
|
|
|
|
884 |
}
|
885 |
} //if
|
886 |
}
|
887 |
|
888 |
if (!isset($this->parent->fonts['google']) || empty($this->parent->fonts['google'])) {
|
889 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
890 |
|
891 |
// Fallback if file_get_contents won't work for wordpress. MEDIATEMPLE
|
892 |
-
if (empty($fonts)) {
|
893 |
-
$fonts = Redux_Helpers::curlRead($this->google_json);
|
894 |
-
}
|
895 |
|
896 |
if (isset($fonts) && !empty($fonts) && is_array($fonts) && $fonts != false) {
|
897 |
$this->parent->fonts['google'] = $fonts;
|
49 |
* @since ReduxFramework 1.0.0
|
50 |
*/
|
51 |
function __construct($field = array(), $value = '', $parent) {
|
|
|
|
|
52 |
$this->parent = $parent;
|
53 |
$this->field = $field;
|
54 |
$this->value = $value;
|
55 |
|
56 |
// Init wp_filesystem
|
57 |
+
//Redux_Functions::initWpFilesystem();
|
58 |
+
|
59 |
+
//global $wp_filesystem;
|
60 |
+
|
61 |
// Set upload dir path for google fonts
|
62 |
$this->font_dir = ReduxFramework::$_upload_dir . 'google-fonts/';
|
63 |
|
65 |
if (!is_dir($this->font_dir)) {
|
66 |
|
67 |
// Create it, if not found
|
68 |
+
//$wp_filesystem->mkdir($this->font_dir, FS_CHMOD_DIR);
|
69 |
+
if ($this->parent->filesystem->execute('mkdir', $this->font_dir)) {
|
70 |
+
return;
|
71 |
+
}
|
72 |
}
|
73 |
|
74 |
// Set google font file variables
|
76 |
|
77 |
// Move installed googlefonts.json to upload location, if not exists
|
78 |
if (!file_exists($this->google_json)) {
|
79 |
+
//(ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.json', $this->font_dir . 'googlefonts.json', false);
|
80 |
+
$param_array = array(
|
81 |
+
'destination' => $this->google_json,
|
82 |
+
'overwrite' => false
|
83 |
+
);
|
84 |
+
$this->parent->filesystem->execute('copy', ReduxFramework::$_dir . 'inc/fields/typography/googlefonts.json', $param_array );
|
85 |
}
|
86 |
|
87 |
// Set field array defaults. No errors please
|
146 |
function localize($field, $value = "") {
|
147 |
$params = array();
|
148 |
|
149 |
+
if (true == $this->user_fonts && !empty($this->field['fonts'])) {
|
150 |
$params['std_font'] = $this->field['fonts'];
|
151 |
}
|
152 |
|
162 |
* @since ReduxFramework 1.0.0
|
163 |
*/
|
164 |
function render() {
|
|
|
|
|
165 |
// Since fonts declared is CSS (@font-face) are not rendered in the preview,
|
166 |
// they can be declared in a CSS file and passed here so they DO display in
|
167 |
// font preview. Do NOT pass style.css in your theme, as that will mess up
|
581 |
}
|
582 |
$link.= $family;
|
583 |
|
584 |
+
if (!empty($font['font-style']) || !empty($font['all-styles'])) {
|
585 |
$link.= ':';
|
586 |
+
print_r($font['all-styles']);
|
587 |
if (!empty($font['all-styles'])) {
|
588 |
+
|
589 |
+
$link .= implode(',', $font['all-styles']);
|
590 |
} else if (!empty($font['font-style'])) {
|
591 |
+
$link .= implode(',', $font['font-style']);
|
592 |
}
|
593 |
}
|
594 |
|
625 |
}
|
626 |
$link.= $family;
|
627 |
|
628 |
+
if (!empty($font['font-style']) || !empty($font['all-styles'])) {
|
629 |
$link.= ':';
|
630 |
if (!empty($font['all-styles'])) {
|
631 |
$link.= implode(',', $font['all-styles']);
|
850 |
*
|
851 |
*/
|
852 |
function getGoogleArray() {
|
|
|
|
|
853 |
// Is already present?
|
854 |
+
if ((isset($this->parent->fonts['google']) && !empty($this->parent->fonts['google'])) || isset($this->parent->fonts['google']) && $this->parent->fonts['google'] == false) {
|
855 |
return;
|
856 |
}
|
857 |
|
869 |
}
|
870 |
|
871 |
// Initialize the Wordpress filesystem, no more using file_put_contents function
|
872 |
+
//Redux_Functions::initWpFilesystem();
|
873 |
+
|
874 |
+
//global $wp_filesystem;
|
875 |
|
876 |
if (!file_exists($this->google_json)) {
|
877 |
$result = wp_remote_get(apply_filters('redux-google-fonts-api-url', 'https://www.googleapis.com/webfonts/v1/webfonts?key=') . $this->parent->args['google_api_key'], array('sslverify' => false));
|
886 |
}
|
887 |
|
888 |
if (!empty($this->parent->googleArray)) {
|
889 |
+
$param_array = array(
|
890 |
+
'content' => json_encode($this->parent->googleArray)
|
891 |
);
|
892 |
+
|
893 |
+
if ($this->parent->filesystem->execute('put_contents', $this->google_json, $param_array )) {
|
894 |
+
return;
|
895 |
+
}
|
896 |
+
//$wp_filesystem->put_contents($this->google_json, json_encode($this->parent->googleArray), FS_CHMOD_FILE );
|
897 |
}
|
898 |
} //if
|
899 |
}
|
900 |
|
901 |
if (!isset($this->parent->fonts['google']) || empty($this->parent->fonts['google'])) {
|
902 |
+
//$fonts = json_decode($wp_filesystem->get_contents($this->google_json), true);
|
903 |
+
$fonts = $this->parent->filesystem->execute('get_contents', $this->google_json );
|
904 |
+
|
905 |
+
if ($fonts === true) {
|
906 |
+
$this->parent->fonts['google'] = false;
|
907 |
+
return;
|
908 |
+
} else {
|
909 |
+
$fonts = json_decode($fonts, true);
|
910 |
+
}
|
911 |
|
912 |
// Fallback if file_get_contents won't work for wordpress. MEDIATEMPLE
|
913 |
+
// if (empty($fonts)) {
|
914 |
+
// $fonts = Redux_Helpers::curlRead($this->google_json);
|
915 |
+
// }
|
916 |
|
917 |
if (isset($fonts) && !empty($fonts) && is_array($fonts) && $fonts != false) {
|
918 |
$this->parent->fonts['google'] = $fonts;
|
class.redux-plugin.php
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
* @const string VERSION The plugin version, used for cache-busting and script file references
|
26 |
* @since 3.0.0
|
27 |
*/
|
28 |
-
const VERSION = '3.3.
|
29 |
|
30 |
/**
|
31 |
* @access protected
|
25 |
* @const string VERSION The plugin version, used for cache-busting and script file references
|
26 |
* @since 3.0.0
|
27 |
*/
|
28 |
+
const VERSION = '3.3.4';
|
29 |
|
30 |
/**
|
31 |
* @access protected
|
redux-framework.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Description: Redux is a simple, truly extensible options framework for WordPress themes and plugins.
|
13 |
* Author: Team Redux
|
14 |
* Author URI: http://reduxframework.com
|
15 |
-
* Version: 3.3.
|
16 |
* Text Domain: redux-framework
|
17 |
* License: GPL3+
|
18 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
12 |
* Description: Redux is a simple, truly extensible options framework for WordPress themes and plugins.
|
13 |
* Author: Team Redux
|
14 |
* Author URI: http://reduxframework.com
|
15 |
+
* Version: 3.3.4
|
16 |
* Text Domain: redux-framework
|
17 |
* License: GPL3+
|
18 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
sample/sample-config.php
CHANGED
@@ -228,12 +228,10 @@ if (!class_exists('Redux_Framework_sample_config')) {
|
|
228 |
|
229 |
$sampleHTML = '';
|
230 |
if (file_exists(dirname(__FILE__) . '/info-html.html')) {
|
231 |
-
|
|
|
232 |
global $wp_filesystem;
|
233 |
-
|
234 |
-
require_once(ABSPATH . '/wp-admin/includes/file.php');
|
235 |
-
WP_Filesystem();
|
236 |
-
}
|
237 |
$sampleHTML = $wp_filesystem->get_contents(dirname(__FILE__) . '/info-html.html');
|
238 |
}
|
239 |
|
228 |
|
229 |
$sampleHTML = '';
|
230 |
if (file_exists(dirname(__FILE__) . '/info-html.html')) {
|
231 |
+
Redux_Functions::initWpFilesystem();
|
232 |
+
|
233 |
global $wp_filesystem;
|
234 |
+
|
|
|
|
|
|
|
235 |
$sampleHTML = $wp_filesystem->get_contents(dirname(__FILE__) . '/info-html.html');
|
236 |
}
|
237 |
|