Changeset 2647911
- Timestamp:
- 12/22/2021 02:31:07 PM (4 years ago)
- Location:
- max-css
- Files:
-
- 1 added
- 3 edited
-
tags/1.0 (added)
-
trunk/admin/js/maxcss-admin.js (modified) (3 diffs)
-
trunk/maxCSS.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
max-css/trunk/admin/js/maxcss-admin.js
r2191248 r2647911 1 var idMaxCSS = 'maxCSS';1 var idMaxCSS = "maxCSS"; 2 2 3 function addStylesToDiv (div) {3 function addStylesToDiv(div) { 4 4 div.id = idMaxCSS; 5 div.classList.add( 'dashicons', 'dashicons-editor-expand');5 div.classList.add("dashicons", "dashicons-editor-expand"); 6 6 } 7 7 8 function createDiv (form) {9 var div = document.createElement( 'div'); // Create a <div> element8 function createDiv(form) { 9 var div = document.createElement("div"); // Create a <div> element 10 10 11 11 div.onclick = function () { 12 12 if (!document.fullscreenElement) { 13 13 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 ); 16 22 }); 17 23 } 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 ); 19 27 } 20 28 } else { … … 27 35 } 28 36 29 window.addEventListener('DOMContentLoaded', function (event) { 30 31 var form = document.getElementById('customize-controls'); 37 function setupMaximizeBtn(event) { 38 var form = document.getElementById("customize-controls"); 32 39 // get ul 33 var ul = document.getElementById( 'sub-accordion-section-custom_css');40 var ul = document.getElementById("sub-accordion-section-custom_css"); 34 41 35 42 if (form && ul) { 36 form.style.maxWidth = 'auto';37 form.style.width = 'auto';43 form.style.maxWidth = "auto"; 44 form.style.width = "auto"; 38 45 39 46 // get help button 40 const helpBtn = ul.getElementsByClassName('customize-help-toggle')[0]; 47 const helpBtn = (ul || document).getElementsByClassName( 48 "customize-help-toggle" 49 )[0]; 41 50 42 51 // check if element already exists 43 44 52 var maxCSS = document.getElementById(idMaxCSS); 45 53 … … 48 56 helpBtn.parentNode.insertBefore(div, helpBtn); 49 57 } 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 } 50 64 51 } else { 52 alert('maxCSS: Not form is found. Please contact technical support or submit an issue in https://github.com/myapos/maxCSS') 65 window.document.onreadystatechange = function (event) { 66 if (document.readyState === "complete") { 67 setupMaximizeBtn(event); 53 68 } 54 }); 55 69 }; -
max-css/trunk/maxCSS.php
r2191248 r2647911 4 4 * Plugin URI: https://github.com/myapos/maxCSS 5 5 * Description: Adds maximize button to extra css in customize theme section 6 * Version: 1. 06 * Version: 1.1 7 7 * Author: Apostolakis Myron 8 8 * Author URI: http://myapos.oncrete.gr/ -
max-css/trunk/readme.txt
r2191269 r2647911 5 5 Tags: css,editor, maximize, icon, addtional-css, maxCSS 6 6 Requires at least: 5.2 7 Tested up to: 5. 27 Tested up to: 5.8.2 8 8 Requires PHP: 5.0 9 9 Stable Tag: trunk … … 31 31 2. Maximized CSS editor (running with WordPress 5.2 here) 32 32 33 == Upgrade Notice == 34 = 1.1 = 35 * This update fixes an issue with form not found for versions greater than 5.6. 36 33 37 == Changelog == 34 38 39 = 1.1 = 40 * Tested with latest wordpress version. 35 41 = 1.0 = 36 42 * First version. 43
Note: See TracChangeset
for help on using the changeset viewer.