Plugin Directory

Changeset 2647911


Ignore:
Timestamp:
12/22/2021 02:31:07 PM (4 years ago)
Author:
myapos
Message:

v1.1

Location:
max-css
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • max-css/trunk/admin/js/maxcss-admin.js

    r2191248 r2647911  
    1 var idMaxCSS = 'maxCSS';
     1var idMaxCSS = "maxCSS";
    22
    3 function addStylesToDiv (div) {
     3function addStylesToDiv(div) {
    44  div.id = idMaxCSS;
    5   div.classList.add('dashicons', 'dashicons-editor-expand');
     5  div.classList.add("dashicons", "dashicons-editor-expand");
    66}
    77
    8 function createDiv (form) {
    9   var div = document.createElement('div'); // Create a <div> element
     8function createDiv(form) {
     9  var div = document.createElement("div"); // Create a <div> element
    1010
    1111  div.onclick = function () {
    1212    if (!document.fullscreenElement) {
    1313      if (form.requestFullscreen) {
    14         form.requestFullscreen().catch( function (err) {
    15           alert('maxCSS:Error attempting to enable full-screen mode:'+ err.message + '('+err.name+')');
     14        form.requestFullscreen().catch(function (err) {
     15          alert(
     16            "maxCSS:Error attempting to enable full-screen mode:" +
     17              err.message +
     18              "(" +
     19              err.name +
     20              ")"
     21          );
    1622        });
    1723      } else {
    18         alert('maxCSS:Maximize css editor feature is not supported. Please try Chrome or Firefox');
     24        alert(
     25          "maxCSS:Maximize css editor feature is not supported. Please try Chrome or Firefox"
     26        );
    1927      }
    2028    } else {
     
    2735}
    2836
    29 window.addEventListener('DOMContentLoaded', function (event) {
    30 
    31   var form = document.getElementById('customize-controls');
     37function setupMaximizeBtn(event) {
     38  var form = document.getElementById("customize-controls");
    3239  // get ul
    33   var ul = document.getElementById('sub-accordion-section-custom_css');
     40  var ul = document.getElementById("sub-accordion-section-custom_css");
    3441
    3542  if (form && ul) {
    36     form.style.maxWidth = 'auto';
    37     form.style.width = 'auto';
     43    form.style.maxWidth = "auto";
     44    form.style.width = "auto";
    3845
    3946    // get help button
    40     const helpBtn = ul.getElementsByClassName('customize-help-toggle')[0];
     47    const helpBtn = (ul || document).getElementsByClassName(
     48      "customize-help-toggle"
     49    )[0];
    4150
    4251    // check if element already exists
    43 
    4452    var maxCSS = document.getElementById(idMaxCSS);
    4553
     
    4856      helpBtn.parentNode.insertBefore(div, helpBtn);
    4957    }
     58  } else {
     59    alert(
     60      "maxCSS: Not found element to add maximize button. Please contact technical support or submit an issue in https://github.com/myapos/maxCSS"
     61    );
     62  }
     63}
    5064
    51   } else {
    52     alert('maxCSS: Not form is found. Please contact technical support or submit an issue in https://github.com/myapos/maxCSS')
     65window.document.onreadystatechange = function (event) {
     66  if (document.readyState === "complete") {
     67    setupMaximizeBtn(event);
    5368  }
    54 });
    55 
     69};
  • max-css/trunk/maxCSS.php

    r2191248 r2647911  
    44* Plugin URI: https://github.com/myapos/maxCSS
    55* Description: Adds maximize button to extra css in customize theme section
    6 * Version: 1.0
     6* Version: 1.1
    77* Author: Apostolakis Myron
    88* Author URI: http://myapos.oncrete.gr/
  • max-css/trunk/readme.txt

    r2191269 r2647911  
    55Tags: css,editor, maximize, icon, addtional-css, maxCSS
    66Requires at least: 5.2
    7 Tested up to: 5.2
     7Tested up to: 5.8.2
    88Requires PHP: 5.0
    99Stable Tag: trunk
     
    31312. Maximized CSS editor (running with WordPress 5.2 here)
    3232
     33== Upgrade Notice ==
     34= 1.1 =
     35* This update fixes an issue with form not found for versions greater than 5.6.
     36
    3337== Changelog ==
    3438
     39= 1.1 =
     40* Tested with latest wordpress version.
    3541= 1.0 =
    3642* First version.
     43
Note: See TracChangeset for help on using the changeset viewer.