Skip to content

Commit 0f9f536

Browse files
author
Ghost1227
committed
Bring embedded sources up to date
1 parent 8bb9a4f commit 0f9f536

21 files changed

+464
-248
lines changed

assets/js/admin.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@
133133
case '>':
134134
case 'greater':
135135
case 'is_larger':
136-
if(value1 > value2)
136+
if(parseFloat(value1) > parseFloat(value2))
137137
show = true;
138138
break;
139139
case '<':
140140
case 'less':
141141
case 'is_smaller':
142-
if(value1 < value2)
142+
if(parseFloat(value1) < parseFloat(value2))
143143
show = true;
144144
break;
145145
case 'contains':
@@ -158,8 +158,6 @@
158158
if(value1 != "" && value1 != value2)
159159
show = true;
160160
break;
161-
162-
163161
}
164162
}
165163

@@ -379,16 +377,35 @@ jQuery(document).ready(function($) {
379377
opacity: 0.7
380378
});
381379
}
380+
381+
$('#toplevel_page_'+redux_opts.slug+' .wp-submenu a').click(function(e) {
382+
//if ( $(this).hasClass('wp-menu-open') ) {
383+
e.preventDefault();
384+
var url = $(this).attr('href').split('&tab=');
385+
$('#'+url[1]+'_section_group_li_a').click();
386+
console.log(url[1]);
387+
return false;
388+
//}
389+
});
390+
382391
/**
383392
Current tab checks, based on cookies
384393
**/
385394
jQuery('.redux-group-tab-link-a').click(function() {
386395
relid = jQuery(this).data('rel'); // The group ID of interest
387396
// Set the proper page cookie
388-
$.cookie('redux_current_tab', relid, {
389-
expires: 7,
390-
path: '/'
397+
398+
$('#toplevel_page_'+redux_opts.slug+' .wp-submenu a.current').removeClass('current');
399+
$('#toplevel_page_'+redux_opts.slug+' .wp-submenu li.current').removeClass('current');
400+
401+
$('#toplevel_page_'+redux_opts.slug+' .wp-submenu a').each(function() {
402+
var url = $(this).attr('href').split('&tab=');
403+
if (url[1] == relid) {
404+
$(this).addClass('current');
405+
$(this).parent().addClass('current');
406+
}
391407
});
408+
392409
// Remove the old active tab
393410
var oldid = jQuery('.redux-group-tab-link-li.active .redux-group-tab-link-a').data('rel');
394411
jQuery('#' + oldid + '_section_group_li').removeClass('active');

assets/js/admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

framework.php

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// Don't duplicate me!
2727
if( !class_exists( 'ReduxFramework' ) ) {
2828

29-
define('REDUX_VERSION', '3.0.3');
29+
define('REDUX_VERSION', '3.0.4');
3030

3131
// Windows-proof constants: replace backward by forward slashes
3232
// Thanks to: https://github.com/peterbouwmeester
@@ -115,8 +115,7 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
115115
$defaults['show_import_export'] = true;
116116
$defaults['dev_mode'] = false;
117117
$defaults['system_info'] = false;
118-
$defaults['admin_stylesheet'] = 'standard';
119-
$defaults['footer_credit'] = '<span id="footer-thankyou">' . __( 'Options panel created using', 'redux-framework') . '<a href="' . $this->framework_url . '" target="_blank">' . __('Redux Framework', 'redux-framework') . '</a> v' . $this->framework_version . '</span>';
118+
$defaults['footer_credit'] = '<span id="footer-thankyou">' . __( 'Options panel created using', 'redux-framework') . ' <a href="' . $this->framework_url . '" target="_blank">' . __('Redux Framework', 'redux-framework') . '</a> v' . $this->framework_version . '</span>';
120119
$defaults['help_tabs'] = array();
121120
$defaults['help_sidebar'] = ''; // __( '', 'redux-framework' );
122121
$defaults['database'] = ''; // possible: options, theme_mods, theme_mods_expanded, transient
@@ -153,6 +152,9 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
153152

154153
$this->extra_tabs = $extra_tabs;
155154

155+
// Options page
156+
add_action( 'admin_menu', array( &$this, '_internationalization' ) );
157+
156158
// Set option with defaults
157159
add_action( 'init', array( &$this, '_set_default_options' ) );
158160

@@ -173,6 +175,10 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
173175

174176
}
175177

178+
public function _internationalization() {
179+
load_plugin_textdomain('redux-framework', false, basename( dirname( __FILE__ ) ) . '/languages' );
180+
}
181+
176182
public function get_instance() {
177183
return $this->instance;
178184
}
@@ -736,9 +742,9 @@ public function _enqueue_output() {
736742
public function _enqueue() {
737743
global $wp_styles;
738744

739-
wp_enqueue_script('jquery');
740-
wp_enqueue_script('jquery-ui-core');
741-
745+
wp_enqueue_script('jquery');
746+
wp_enqueue_script('jquery-ui-core');
747+
add_thickbox();
742748

743749
wp_register_style(
744750
'redux-css',
@@ -785,11 +791,7 @@ public function _enqueue() {
785791

786792
wp_enqueue_style( 'redux-lte-ie8' );
787793

788-
if( $this->args['admin_stylesheet'] == 'standard' ) {
789-
wp_enqueue_style( 'redux-css' );
790-
} elseif( $this->args['admin_stylesheet'] == 'custom' ) {
791-
wp_enqueue_style( 'redux-custom-css' );
792-
}
794+
wp_enqueue_style( 'redux-css' );
793795

794796
wp_enqueue_style( 'redux-elusive-icon' );
795797
wp_enqueue_style( 'redux-elusive-icon-ie7' );
@@ -1059,11 +1061,15 @@ public function _register_setting() {
10591061
if( isset( $field['title'] ) && isset( $field['type'] ) && $field['type'] !== "info" && $field['type'] !== "group" ) {
10601062
$default_mark = ( !empty($field['default']) && isset($this->options[$field['id']]) && $this->options[$field['id']] == $field['default'] && !empty( $this->args['default_mark'] ) && isset( $field['default'] ) ) ? $this->args['default_mark'] : '';
10611063
if (!empty($field['title'])) {
1062-
$th = $field['title'] . $default_mark;
1064+
$th = $field['title'] . $default_mark."";
10631065
}
1066+
10641067
if( isset( $field['subtitle'] ) ) {
10651068
$th .= '<span class="description">' . $field['subtitle'] . '</span>';
10661069
}
1070+
1071+
1072+
10671073
}
10681074
if (!isset($field['id'])) {
10691075
print_r($field);
@@ -1128,6 +1134,11 @@ public function _register_setting() {
11281134
}
11291135
$this->sections[$k]['fields'][$fieldk] = $field;
11301136

1137+
if( isset( $this->args['display_source'] ) ) {
1138+
$th .= '<div id="'.$field['id'].'-settings" style="display:none;"><pre>'.var_export($this->sections[$k]['fields'][$fieldk], true).'</pre></div>';
1139+
$th .= '<br /><a href="#TB_inline?width=600&height=800&inlineId='.$field['id'].'-settings" class="thickbox"><small>View Source</small></a>';
1140+
}
1141+
11311142
add_settings_field( $fieldk . '_field', $th, array( &$this, '_field_input' ), $this->args['opt_name'] . $k . '_section_group', $this->args['opt_name'] . $k . '_section', $field ); // checkbox
11321143
}
11331144
}
@@ -1427,7 +1438,7 @@ public function _options_page_html() {
14271438
echo '<div id="info_bar">';
14281439
echo '<a href="javascript:void(0);" id="expand_options">' . __( 'Expand', 'redux-framework' ) . '</a>';
14291440
echo '<div class="redux-action_bar">';
1430-
submit_button( '', 'primary', 'redux_save', false );
1441+
submit_button( __( 'Save Changes', 'redux-framework'), 'primary', 'redux_save', false );
14311442
echo '&nbsp;';
14321443
submit_button( __( 'Reset to Defaults', 'redux-framework' ), 'secondary', $this->args['opt_name'] . '[defaults]', false );
14331444
echo '</div>';
@@ -1684,7 +1695,7 @@ public function _options_page_html() {
16841695
}
16851696

16861697
echo '<div class="redux-action_bar">';
1687-
submit_button( '', 'primary', 'redux_save', false );
1698+
submit_button( __( 'Save Changes', 'redux-framework'), 'primary', 'redux_save', false );
16881699
echo '&nbsp;';
16891700
submit_button( __( 'Reset to Defaults', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false );
16901701
echo '</div>';

inc/fields/color/field_color.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct( $field = array(), $value ='', $parent ) {
6161
* @return void
6262
*/
6363
public function render() {
64+
print_r($this->value);
6465

6566
echo '<input data-id="'.$this->field['id'].'" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" id="' . $this->field['id'] . '-color" class="redux-color redux-color-init ' . $this->field['class'] . '" type="text" value="' . $this->value . '" data-default-color="' . $this->field['default'] . '" />';
6667

@@ -69,7 +70,7 @@ public function render() {
6970
if ( $this->value == "transparent" ) {
7071
$tChecked = ' checked="checked"';
7172
}
72-
echo '<label for="' . $this->field['id'] . '-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency ' . $this->field['class'] . '" id="' . $this->field['id'] . '-transparency" data-id="'.$this->field['id'] . '-color" value="1"'.$tChecked.'> Transparent</label>';
73+
echo '<label for="' . $this->field['id'] . '-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency ' . $this->field['class'] . '" id="' . $this->field['id'] . '-transparency" data-id="'.$this->field['id'] . '-color" value="1"'.$tChecked.'> '.__('Transparent', 'redux-framework').'</label>';
7374
}
7475

7576
}

inc/fields/color_gradient/field_color_gradient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function render() {
7878
if ( $this->value['from'] == "transparent" ) {
7979
$tChecked = ' checked="checked"';
8080
}
81-
echo '<label for="' . $this->field['id'] . '-from-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency ' . $this->field['class'] . '" id="' . $this->field['id'] . '-from-transparency" data-id="' . $this->field['id'] . '-from" value="1"'.$tChecked.'> Transparent</label>';
81+
echo '<label for="' . $this->field['id'] . '-from-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency ' . $this->field['class'] . '" id="' . $this->field['id'] . '-from-transparency" data-id="' . $this->field['id'] . '-from" value="1"'.$tChecked.'> '.__('Transparent', 'redux-framework').'</label>';
8282
}
8383

8484
echo '&nbsp;&nbsp;&nbsp;&nbsp;<strong>' . __( 'To ', 'redux-framework' ) . '</strong>&nbsp;<input data-id="'.$this->field['id'].'" id="' . $this->field['id'] . '-to" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][to]" value="' . $this->value['to'] . '" class="redux-color redux-color-init ' . $this->field['class'] . '" type="text" data-default-color="' . $this->field['default']['to'] . '" />';
@@ -88,7 +88,7 @@ public function render() {
8888
if ( $this->value['from'] == "transparent" ) {
8989
$tChecked = ' checked="checked"';
9090
}
91-
echo '<label for="' . $this->field['id'] . '-to-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency" id="' . $this->field['id'] . '-to-transparency" data-id="' . $this->field['id'] . '-to" value="1"'.$tChecked.'> Transparent</label>';
91+
echo '<label for="' . $this->field['id'] . '-to-transparency" class="color-transparency-check"><input type="checkbox" class="checkbox color-transparency" id="' . $this->field['id'] . '-to-transparency" data-id="' . $this->field['id'] . '-to" value="1"'.$tChecked.'> '.__('Transparent', 'redux-framework').'</label>';
9292
}
9393

9494
}

inc/fields/gallery/field_gallery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public function render() {
7373
}
7474
endif;
7575
echo '</div>';
76-
echo '<a href="#" onclick="return false;" id="edit-gallery" class="gallery-attachments button button-primary">' . __('Add/Edit Gallery', 'so-panels') . '</a> ';
77-
echo '<a href="#" onclick="return false;" id="clear-gallery" class="gallery-attachments button">' . __('Clear Gallery', 'so-panels') . '</a>'; echo '<input type="hidden" class="gallery_values ' . $this->field['class'] . '" value="' . esc_attr($this->value) . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" />';
76+
echo '<a href="#" onclick="return false;" id="edit-gallery" class="gallery-attachments button button-primary">' . __('Add/Edit Gallery', 'redux-framework') . '</a> ';
77+
echo '<a href="#" onclick="return false;" id="clear-gallery" class="gallery-attachments button">' . __('Clear Gallery', 'redux-framework') . '</a>'; echo '<input type="hidden" class="gallery_values ' . $this->field['class'] . '" value="' . esc_attr($this->value) . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" />';
7878

7979

8080
}

inc/fields/group/field_group.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,7 @@
5858
$(newSlide).find('h3').text('').append('<span class="redux-groups-header">New Group</span><span class="ui-accordion-header-icon ui-icon ui-icon-plus"></span>');
5959
$(this).prev().append(newSlide);
6060

61-
//we need to add slideCount1 data-id in fieldset , to make it work with fold
62-
$(newSlide).find('fieldset').each(function(){
63-
var fieldset = $(this),
64-
data_id = fieldset.data('id'),
65-
tr = fieldset.parents('tr:eq(0)');
66-
if (typeof data_id !== 'undefined' && data_id !== false){
67-
//fieldset.attr("data-id", data_id.replace(/\d+/, slideCount1) );
68-
//tr.attr('data-check-id' , data_id.replace(/\d+/, slideCount1) );
69-
//console.log(tr.attr('data-check-field'));
70-
//alert("eee");
71-
//tr.attr('data-check-field' , tr.attr('data-check-field')+'-'+slideCount1 );
72-
}
73-
//console.log($(this).attr("data-id"));
74-
//$(this).attr("data-id", $(this).data('id').replace(/\d+/, slideCount1) );
75-
});
61+
7662
$(newSlide).find('input[type="text"], input[type="hidden"], textarea , select').each(function(){
7763
var attr_name = $(this).attr('name');
7864
var attr_id = $(this).attr('id');
@@ -88,13 +74,8 @@
8874
//we clean select2 first
8975
$(newSlide).find('.select2-container').remove();
9076
$(newSlide).find('select').removeClass('select2-offscreen');
91-
92-
//we rebind the select2
93-
//$(newSlide).find('.redux-select-item').addClass('xxxxxxxxxxxxxxxx');
94-
95-
//$.redux.select();
9677
}
97-
//$(this).attr("name", $(this).attr("name").replace(/\d+/, slideCount1) ).attr("id", $(this).attr("id").replace(/\d+/, slideCount1) );
78+
9879
$(this).val('');
9980
if ($(this).hasClass('slide-sort')){
10081
$(this).val(slideCount1);

inc/fields/media/field_media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function render() {
108108
$hide = '';
109109
}
110110

111-
echo '<input class="' . $hide . 'upload ' . $this->field['class'] . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][url]" id="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][url]" value="' . $this->value['url'] . '" readonly="readonly" />';
111+
echo '<input placeholder="'.__('None media selected', 'redux-framework').'" type="text" class="' . $hide . 'upload ' . $this->field['class'] . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][url]" id="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][url]" value="' . $this->value['url'] . '" readonly="readonly" />';
112112
echo '<input type="hidden" class="upload-id ' . $this->field['class'] . '" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][id]" id="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][id]" value="' . $this->value['id'] . '" />';
113113
echo '<input type="hidden" class="upload-height" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][height]" id="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][height]" value="' . $this->value['height'] . '" />';
114114
echo '<input type="hidden" class="upload-width" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][width]" id="' . $this->args['opt_name'] . '[' . $this->field['id'] . '][width]" value="' . $this->value['width'] . '" />';

inc/fields/raw/field_raw.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
class ReduxFramework_raw {
3+
4+
/**
5+
* Field Constructor.
6+
*
7+
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
8+
*
9+
* @since ReduxFramework 3.0.4
10+
*/
11+
function __construct($field = array(), $value ='', $parent) {
12+
$this->field = $field;
13+
$this->value = $value;
14+
$this->args = $parent->args;
15+
}
16+
17+
/**
18+
* Field Render Function.
19+
*
20+
* Takes the vars and outputs the HTML for the field in the settings
21+
*
22+
* @since ReduxFramework 1.0.0
23+
*/
24+
function render() {
25+
26+
echo '</td></tr></table><table class="form-table no-border redux-group-table" style="margin-top: 0;"><tbody><tr><td>';
27+
echo '<fieldset id="'.$this->parent->args['opt_name'].'-'.$this->field['id'].'" class="redux-field redux-container-'.$this->field['type'].' '.$this->field['class'].'" data-id="'.$this->field['id'].'">';
28+
29+
if ( !empty( $this->field['include'] ) && file_exists( $this->field['include'] ) ) {
30+
include( $this->field['include'] );
31+
}
32+
33+
do_action('redux-field-raw-'.$this->parent->args['opt_name'].'-'.$this->field['id']);
34+
35+
echo '</fieldset>';
36+
echo '</td></tr></table><table class="form-table no-border" style="margin-top: 0;"><tbody><tr><th></th><td>';
37+
38+
}
39+
}

inc/fields/slides/field_slides.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)