Skip to content

Commit

Permalink
Merge pull request #106 from oceanwp/rc-2.4.0
Browse files Browse the repository at this point in the history
Rc 2.4.0
  • Loading branch information
eramits authored Oct 16, 2024
2 parents 268127e + ac21bd4 commit b02358f
Show file tree
Hide file tree
Showing 44 changed files with 3,155 additions and 1,256 deletions.
26 changes: 25 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),

browserify: {
prod: {
files: {
"includes/customizer/assets/script.min.js": "includes/customizer/assets/script.js",
},
options: {
transform: [["babelify", { presets: ["@babel/preset-env"] }]],
},
},
dev: {
files: {
"includes/customizer/assets/script.min.js": "includes/customizer/assets/script.js",
},
options: {
transform: [["babelify", { presets: ["@babel/preset-env"] }]],
},
},
},

// Concat and Minify our js.
uglify: {
dev: {
Expand All @@ -27,7 +46,9 @@ module.exports = function (grunt) {
"includes/widgets/js/share.min.js": "includes/widgets/js/share.js",
"includes/shortcodes/js/shortcode.min.js": "includes/shortcodes/js/shortcode.js",
"includes/preloader/assets/js/preloader.min.js": "includes/preloader/assets/js/preloader.js",
"includes/customizer/assets/script.min.js": "includes/customizer/assets/script.min.js",
"includes/preloader/assets/js/customize-preview.min.js": "includes/preloader/assets/js/customize-preview.js",
"includes/themepanel/assets/js/theme-panel.min.js": "includes/themepanel/assets/js/theme-panel.js",
},
},
},
Expand All @@ -42,6 +63,7 @@ module.exports = function (grunt) {
prod: {
files: {
"assets/css/admin.min.css": "assets/css/admin.css",
"assets/css/pluginUpdateMessage.min.css": "assets/css/pluginUpdateMessage.css",
"includes/menu-icons/css/admin.min.css": "includes/menu-icons/css/admin.css",
"includes/panel/assets/css/import-export.min.css": "includes/panel/assets/css/import-export.css",
"includes/panel/assets/css/demos.min.css": "includes/panel/assets/css/demos.css",
Expand All @@ -56,6 +78,7 @@ module.exports = function (grunt) {
"includes/metabox/controls/assets/css/butterbean.min.css":
"includes/metabox/controls/assets/css/butterbean.css",
"includes/preloader/assets/css/preloader.min.css": "includes/preloader/assets/css/preloader.css",
"includes/customizer/assets/style.min.css": "includes/customizer/assets/style.css",
},
},
},
Expand All @@ -71,6 +94,7 @@ module.exports = function (grunt) {
files: {
"assets/css/widgets.css": "sass/widgets.scss",
"includes/preloader/assets/css/preloader.css": "includes/preloader/assets/css/preloader.scss",
"includes/customizer/assets/style.css": "includes/customizer/assets/style.scss",
},
},
},
Expand Down Expand Up @@ -164,7 +188,7 @@ module.exports = function (grunt) {
});

// Dev task
grunt.registerTask("default", ["uglify:dev", "sass:dist", "autoprefixer:main", "cssmin:prod"]);
grunt.registerTask("default", [ "browserify:prod", "browserify:dev", "uglify:dev", "sass:dist", "autoprefixer:main", "cssmin:prod"]);

// Production task
grunt.registerTask("build", ["copy"]);
Expand Down
1 change: 0 additions & 1 deletion assets/css/pluginUpdateMessage.min.css
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
.owp-update-warning__separator{margin:15px -12px;border:1px solid #ffb900}.owp-update-warning{display:-ms-flexbox;display:flex;-webkit-margin-after:10px;margin-block-end:10px;max-width:980px}.owp-update-warning .warning-info-icon{color:#f56e28;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:9px;margin-inline-end:9px}.owp-update-warning .warning-info-icon.green{color:#00bb18}.owp-update-warning .warning__title{font-weight:600;-webkit-margin-after:10px;margin-block-end:10px}.owp-update-warning+p{display:none}.plugins table.owp-required-version-table tr{background:rgba(0,0,0,0)}.plugins table.owp-required-version-table tr td,.plugins table.owp-required-version-table tr th{min-width:250px;font-size:13px;background:rgba(0,0,0,0);box-shadow:none;border:none;-webkit-padding-before:5px;padding-block-start:5px;-webkit-padding-after:5px;padding-block-end:5px;-webkit-padding-end:15px;padding-inline-end:15px;-webkit-padding-start:0;padding-inline-start:0}.plugins table.owp-required-version-table tr th{font-weight:600}.plugins .owp-required-products{margin-top:20px}
65 changes: 65 additions & 0 deletions assets/js/oceanwp-plugin-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
jQuery(document).ready(function($) {
$(document).on('click', '.install-now', function(e) {
e.preventDefault();

var button = $(this);
var pluginSlug = button.data('slug');

button.text('Installing...').addClass('updating-message');

$.ajax({
url: oceanwpPluginInstall.ajax_url,
type: 'POST',
data: {
action: 'oceanwp_install_plugin',
slug: pluginSlug,
_ajax_nonce: oceanwpPluginInstall.nonce
},
success: function(response) {
if (response.success) {
button.text('Activate').removeClass('updating-message').addClass('activate-now button-primary');
button.data('action', 'activate');
} else {
button.text('Install Now').removeClass('updating-message');
alert(response.data);
}
},
error: function() {
button.text('Install Now').removeClass('updating-message');
alert('An error occurred. Please try again.');
}
});
});

$(document).on('click', '.activate-now', function(e) {
e.preventDefault();

var button = $(this);
var pluginSlug = button.data('slug');

button.text('Activating...').addClass('updating-message');

$.ajax({
url: oceanwpPluginInstall.ajax_url,
type: 'POST',
data: {
action: 'oceanwp_activate_plugin',
slug: pluginSlug,
_ajax_nonce: oceanwpPluginInstall.nonce
},
success: function(response) {
if (response.success) {
button.text('Active').removeClass('updating-message').addClass('button-disabled').prop('disabled', true);
} else {
button.text('Activate').removeClass('updating-message');
alert(response.data);
}
},
error: function() {
button.text('Activate').removeClass('updating-message');
alert('An error occurred. Please try again.');
}
});

});
});
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
== Changelog ==

= 2.4.0 - OCT 16 2024 =
- NEW: Customizer: Library upgraded to default WordPress ReactJS.
- NEW: Customizer: User Interface.
- Added: Customizer: Main panel icons for improved visual navigation and user experience.
- Added: Customizer: Panel grouping based website role for improved visual navigation and user experience.
- Added: OceanWP Panel: Customizer: New panels users can disable / enable per need for faster loading and visual navigation.
- Removed: Customizer: Legacy PHP Controls.
- Removed: OceanWP Panel: Customizer: Panels: Legacy panels.

= 2.3.1 - OCT 11 2024 =
- Added: Conditional checks for future updates.
- Updated: Compatibility: WordPress version number.
Expand Down
52 changes: 22 additions & 30 deletions includes/adobe-font.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,39 +217,31 @@ public function elementor_group( $font_groups ) {
* Render Adobe fonts in the Customizer.
*/
public function render_customizer_group() {
$fonts_list = get_option( 'oe-adobe-fonts' );
$all_fonts = $fonts_list['oe-adobe-fonts-list'];
$custom_fonts = array();
if ( ! empty( $all_fonts ) ) {
?>
<optgroup label="<?php esc_attr_e( 'OE Adobe Fonts', 'ocean-extra' ); ?>">
<?php
foreach ( $all_fonts as $font_family_name => $fonts_url ) {
$font_slug = isset( $fonts_url['slug'] ) ? $fonts_url['slug'] : '';
$font_css = isset( $fonts_url['css_names'][0] ) ? $fonts_url['css_names'][0] : $font_slug;
?>

<option value="<?php echo esc_attr( $font_css ); ?>"><?php echo esc_html( $font_slug ); ?></option>
<?php
}
?>
</optgroup>
<?php
$fonts_list = get_option( 'oe-adobe-fonts' );
$all_fonts = isset( $fonts_list['oe-adobe-fonts-list'] ) ? $fonts_list['oe-adobe-fonts-list'] : array();
$fonts_array = array();

if ( ! empty($all_fonts) ) {
$adobeFonts = [];
foreach ($all_fonts as $font_family_name => $fonts_url) {
$font_slug = isset($fonts_url['slug']) ? $fonts_url['slug'] : '';
$font_css = isset($fonts_url['css_names'][0]) ? $fonts_url['css_names'][0] : $font_slug;
$font_weights = isset($fonts_url['weights']) ? $fonts_url['weights'] : [];
$adobeFonts[] = [
'value' => esc_attr($font_css),
'label' => esc_html($font_slug),
'variants' => $font_weights
];
}
$fonts_array[] = [
'label' => esc_attr__('OE Adobe Fonts', 'ocean-extra'),
'options' => $adobeFonts,
];
}

$google_fonts = oceanwp_google_fonts_array();
if ( $google_fonts ) {
?>
$html = wp_json_encode($fonts_array);

<?php
// Loop through font options and add to select.
foreach ( $google_fonts as $font ) {
?>

<?php } ?>

<?php
}
echo $html;
}

/**
Expand Down
9 changes: 6 additions & 3 deletions includes/custom-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function customizer_options( $wp_customize ) {
$section,
array(
'title' => esc_html__( 'Custom CSS/JS', 'ocean-extra' ),
'priority' => 210,
'priority' => 18,
)
);

Expand All @@ -59,13 +59,16 @@ public function customizer_options( $wp_customize ) {
);

$wp_customize->add_control(
new WP_Customize_Control(
new WP_Customize_Code_Editor_Control(
$wp_customize,
'ocean_custom_js',
array(
'label' => esc_html__( 'Custom JS', 'ocean-extra' ),
'description' => esc_html__( 'You need to reload to see the changes. No need to add the <script> tags.', 'ocean-extra' ),
'type' => 'textarea',
'code_type' => 'text/javascript',
'input_attrs' => array(
'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
),
'section' => $section,
'settings' => 'ocean_custom_js',
'priority' => 10,
Expand Down
Loading

0 comments on commit b02358f

Please sign in to comment.