Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Develop] Improve PHPCS and updates #438

Merged
merged 1 commit into from Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions assets/js/facetwp-pagination.js
Expand Up @@ -8,9 +8,11 @@

(function($) {
$(document).on('facetwp-loaded', function() {
$('html, body').animate({
scrollTop: $('.facetwp-page-title')
}, 500);
if ( FWP.loaded ) { // Run only after the first page load
$('html, body').animate({
scrollTop: $('.facetwp-page-title') // Scroll to the top of the element with class "facetwp-page-title"
}, 500);
}
});
})(jQuery);

Expand Down
3 changes: 2 additions & 1 deletion assets/js/palette.js
Expand Up @@ -2,6 +2,7 @@
*
* Colour Palette Generator script.
* Copyright (c) 2014 Google Inc.
* https://github.com/google/palette.js/blob/master/palette.js
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may
Expand Down Expand Up @@ -1498,4 +1499,4 @@ palette.SchemeType;

if(typeof module === "object" && module.exports) {
module.exports = palette
}
}
1 change: 1 addition & 0 deletions functions.php
Expand Up @@ -47,6 +47,7 @@

// Plugin Home:
define( 'LWTV_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'LWTV_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

// Timezones:
define( 'LWTV_TIMEZONE', 'America/New_York' );
Expand Down
152 changes: 76 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions php/_components/class-statistics.php
Expand Up @@ -22,7 +22,7 @@ class Statistics implements Component, Templater {
*/
const VERSIONING = array(
'chartjs' => '4.4.1',
'chartjs-plugin-annotation' => '2.2.1',
'chartjs-plugin-annotation' => '3.0.1',
'palette' => '1.0.0',
'tablesorter' => '2.31.3',
'tablesorter-bootstrap' => '2.31.1',
Expand Down Expand Up @@ -66,14 +66,14 @@ public function enqueue_scripts() {
}

// Enqueue files shared:
wp_enqueue_script( 'chartjs', plugin_dir_url( dirname( __DIR__, 1 ) ) . 'assets/js/chart.js', array( 'jquery' ), self::VERSIONING['chartjs'], false );
wp_enqueue_script( 'chartjs-plugin-annotation', plugin_dir_url( dirname( __DIR__, 1 ) ) . 'assets/js/chartjs-plugin-annotation.min.js', array( 'chartjs' ), self::VERSIONING['chartjs-plugin-annotation'], false );
wp_enqueue_script( 'palette', plugin_dir_url( dirname( __DIR__, 1 ) ) . 'assets/js/palette.js', array(), self::VERSIONING['palette'], false );
wp_enqueue_script( 'chartjs', LWTV_PLUGIN_URL . 'assets/js/chart.js', array( 'jquery' ), self::VERSIONING['chartjs'], false );
wp_enqueue_script( 'chartjs-plugin-annotation', LWTV_PLUGIN_URL . 'assets/js/chartjs-plugin-annotation.min.js', array( 'chartjs' ), self::VERSIONING['chartjs-plugin-annotation'], false );
wp_enqueue_script( 'palette', LWTV_PLUGIN_URL . 'assets/js/palette.js', array(), self::VERSIONING['palette'], false );

// Custom extra for stats pages:
if ( is_page( array( 'statistics' ) ) ) {
wp_enqueue_script( 'tablesorter', plugin_dir_url( dirname( __DIR__, 1 ) ) . 'assets/js/jquery.tablesorter.js', array( 'jquery' ), self::VERSIONING['tablesorter'], false );
wp_enqueue_style( 'tablesorter', plugin_dir_url( dirname( __DIR__, 1 ) ) . 'assets/css/theme.bootstrap_4.min.css', array(), self::VERSIONING['tablesorter-bootstrap'], false );
wp_enqueue_script( 'tablesorter', LWTV_PLUGIN_URL . 'assets/js/jquery.tablesorter.js', array( 'jquery' ), self::VERSIONING['tablesorter'], false );
wp_enqueue_style( 'tablesorter', LWTV_PLUGIN_URL . 'assets/css/theme.bootstrap_4.min.css', array(), self::VERSIONING['tablesorter-bootstrap'], false );

$statistics = get_query_var( 'statistics', 'none' );
$stat_view = get_query_var( 'view', 'main' );
Expand Down
2 changes: 1 addition & 1 deletion php/cpts/shows/class-cmb2-metaboxes.php
Expand Up @@ -48,7 +48,7 @@ public function __construct() {
* @return mixed
*/
public function cmb2_scripts( $scripts ) {
wp_enqueue_script( 'ajaxified_dropdown', plugin_dir_url( dirname( __DIR__, 2 ) ) . 'assets/js/cmb2_ajax.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'ajaxified_dropdown', LWTV_PLUGIN_URL . 'assets/js/cmb2_ajax.js', array( 'jquery' ), '1.0.0', true );
$return = $scripts;

return $return;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.