Plugin Directory

Changeset 1806236


Ignore:
Timestamp:
01/20/2018 01:44:09 PM (8 years ago)
Author:
fugudesign
Message:

Release 1.5.1

Location:
maintenance-switch
Files:
50 added
4 edited

Legend:

Unmodified
Added
Removed
  • maintenance-switch/trunk/admin/class-maintenance-switch-admin.php

    r1805892 r1806236  
    8787     */
    8888    public function enqueue_styles() {
    89 
    90         wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/maintenance-switch-admin.css', array(), $this->version, 'all' );
    91 
     89        if ($this->isSettingsPage()) {
     90            wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/maintenance-switch-admin.css', array(), $this->version, 'all' );
     91        }
    9292        wp_enqueue_style( $this->plugin_name . '-button', plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/maintenance-switch-button.css', array(), $this->version, 'all' );
    93 
    9493    }
    9594
     
    10099     */
    101100    public function enqueue_scripts() {
    102 
    103         wp_enqueue_script( 'jquery-ui-tabs' );
    104 
    105         wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/maintenance-switch-admin.js', array( 'jquery' ), $this->version, false );
    106 
     101        if ($this->isSettingsPage()) {
     102            wp_enqueue_script( 'jquery-ui-tabs' );
     103            wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/maintenance-switch-admin.js', array( 'jquery' ), $this->version, false );
     104            wp_enqueue_code_editor( ['file' => $this->plugin_name.'.php'] );
     105        }
    107106        wp_enqueue_script( $this->plugin_name . '-button', plugin_dir_url( dirname( __FILE__ ) ) . 'assets/js/maintenance-switch-button.js', array( 'jquery' ), $this->version, false );
    108 
    109         wp_enqueue_code_editor( ['file' => $this->plugin_name.'.php'] );
    110107    }
    111108
     
    145142        );
    146143    }
     144
     145    /**
     146     * Check if the current screen is the settings page
     147     *
     148     * @since 1.5.1
     149     *
     150     * @return bool
     151     */
     152    public function isSettingsPage() {
     153        return get_current_screen()->base == 'settings_page_maintenance-switch';
     154    }
    147155}
  • maintenance-switch/trunk/admin/js/maintenance-switch-admin.js

    r1805892 r1806236  
    2424       
    2525        function toggleTextareaReadonly(status) {
    26             var checked = status || $('#ms_use_theme').checked;
     26            var checked = status || $('#ms_use_theme').prop('checked');
    2727            $('#ms_page_html').prop('readonly', checked);
    2828            $('#ms_page_html').next('.CodeMirror').toggleClass('readonly', checked);
  • maintenance-switch/trunk/maintenance-switch.php

    r1805892 r1806236  
    1717 * Plugin URI:        https://wordpress.org/plugins/maintenance-switch
    1818 * Description:       Customize easily and switch in one-click to (native) maintenance mode from your backend or frontend.
    19  * Version:           1.5.0
     19 * Version:           1.5.1
    2020 * Author:            Fugu
    2121 * Author URI:        http://www.fugu.fr
     
    4141 * @since    1.3.6
    4242 */
    43 define( 'PLUGIN_VERSION', '1.5.0' );
     43define( 'PLUGIN_VERSION', '1.5.1' );
    4444
    4545/**
  • maintenance-switch/trunk/readme.txt

    r1805892 r1806236  
    55Requires at least: 3.5
    66Tested up to: 4.9
    7 Stable tag: 1.5.0
     7Stable tag: 1.5.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.5.1 =
     112* Fix the disabled code field bug
     113* Enqueue admin assets only on settings page
     114
    111115= 1.5.0 =
    112116* Add a gitignore and gulp files
Note: See TracChangeset for help on using the changeset viewer.