Changeset 2606381
- Timestamp:
- 09/28/2021 08:48:29 PM (5 years ago)
- Location:
- blaze-css/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
blaze-css.php (modified) (2 diffs)
-
dist/scripts/blaze-admin.js (modified) (2 diffs)
-
lib/Admin.php (modified) (3 diffs)
-
lib/Common/File.php (modified) (2 diffs)
-
lib/Plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
blaze-css/trunk/README.txt
r2606364 r2606381 5 5 Requires at least: 5.2 6 6 Tested up to: 5.8 7 Stable tag: 1.1. 27 Stable tag: 1.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 == Changelog == 34 34 35 = 1.1.3 = 36 * Fixed CSV generation from manual command. 37 35 38 = 1.1.2 = 36 39 * Added settings menu. -
blaze-css/trunk/blaze-css.php
r2606364 r2606381 10 10 * 11 11 * @link https://motto.ca 12 * @since 1.1. 212 * @since 1.1.3 13 13 * @package Blaze_CSS 14 14 * … … 17 17 * Plugin URI: https://github.com/wpmotto/wp-blaze-css 18 18 * Description: WordPress plugin to render your CSS as fast as possible. Crush your lighthouse scores by simply activating the plugin. 19 * Version: 1.1. 219 * Version: 1.1.3 20 20 * Author: Motto 21 21 * Author URI: https://motto.ca -
blaze-css/trunk/dist/scripts/blaze-admin.js
r2606364 r2606381 1 (function( $ ) {2 'use strict';3 4 $( window ).load(function() {5 1 2 (function($) { 3 $(document).ready(function(){ 6 4 $( "#blaze_btn_generate_csv" ).click(function() { 7 8 5 fetch(blaze_ajax_object.ajax_url, { 9 6 method: 'POST', … … 17 14 .then(response => { 18 15 console.log('response', response); 19 // return response.json();20 16 }) 21 // .then(data => {22 // console.log('Success:', data);23 // })24 // .catch(error => {25 // console.error('Error:', error);26 // });27 28 17 }); 29 30 18 }); 31 32 33 })( jQuery ); 19 })(jQuery); -
blaze-css/trunk/lib/Admin.php
r2606364 r2606381 45 45 * @param Plugin $plugin This plugin's instance. 46 46 */ 47 public function __construct( Plugin $plugin ) { 47 public function __construct( Plugin $plugin ) { 48 48 $this->plugin = $plugin; 49 49 $this->settings = new Settings( $plugin ); … … 85 85 public function enqueue_scripts() { 86 86 87 /** 88 * This function is provided for demonstration purposes only. 89 * 90 * An instance of this class should be passed to the run() function 91 * defined in BlazeCss_Loader as all of the hooks are defined 92 * in that particular class. 93 * 94 * The BlazeCss_Loader will then create the relationship 95 * between the defined hooks and the functions defined in this 96 * class. 97 */ 87 $admin_js = 'dist/scripts/blaze-admin.js'; 98 88 99 89 \wp_enqueue_script( 100 90 $this->plugin->get_plugin_name(), 101 \plugin_dir_url( dirname( __FILE__ ) ) . 'dist/scripts/blaze-admin.js',91 \plugin_dir_url( dirname( __FILE__ ) ) . $admin_js, 102 92 array( 'jquery' ), 103 $this->plugin->get_version(), 104 false ); 93 filectime($this->plugin->get_root_path() . $admin_js), 94 false 95 ); 105 96 106 97 \wp_localize_script( … … 189 180 '_ajax_nonce' 190 181 ); 191 182 192 183 $file = new File($this->plugin); 193 $ file->write();194 die();184 $result = $file->write(); 185 echo json_encode((bool) $result); die(); 195 186 } 196 187 -
blaze-css/trunk/lib/Common/File.php
r2606364 r2606381 16 16 { 17 17 $csv_file_path = $this->plugin->settings->get_option('gcsv_path_file'); 18 $path = WP_CONTENT_DIR . $csv_file_path; 19 18 $path = WP_CONTENT_DIR . '/' . $csv_file_path; 20 19 $elements = (new Element)->select('DISTINCT el_class') 21 20 ->where('el_class IS NOT NULL') … … 26 25 ); 27 26 28 file_put_contents($path, $classes);27 return file_put_contents($path, $classes); 29 28 } 30 29 -
blaze-css/trunk/lib/Plugin.php
r2606364 r2606381 111 111 112 112 // $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); 113 //$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );113 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); 114 114 115 115 $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_settings_page' ); 116 116 $this->loader->add_action( 'admin_init', $plugin_admin, 'init_settings' ); 117 118 if( (bool) $this->settings->get_option('gcsv_auto') ) 119 $this->loader->add_action( 'wp_ajax_blaze_generate_csv', $plugin_admin, 'generate_csv' ); 117 $this->loader->add_action( 'wp_ajax_blaze_generate_csv', $plugin_admin, 'generate_csv' ); 120 118 } 121 119
Note: See TracChangeset
for help on using the changeset viewer.