From fafc40965415c03ec0d33ea4de4c5e4c5c51b569 Mon Sep 17 00:00:00 2001 From: Ustimenko Alexander Date: Fri, 19 Feb 2016 23:13:07 +0600 Subject: [PATCH 01/27] Introduce maximize for questions and formulas * Use settings in maximize and locale keys * Set max-height for maximizable to 40em * Add latest and old WP maximize icons * Place icon on the right --- css/admin.css | 4 +++ css/maximize.css | 41 ++++++++++++++++++++++ js/maximize.js | 56 ++++++++++++++++++++++++++++++ js/test-edit-maximize-metaboxes.js | 6 ++++ 4 files changed, 107 insertions(+) create mode 100644 css/maximize.css create mode 100644 js/maximize.js create mode 100644 js/test-edit-maximize-metaboxes.js diff --git a/css/admin.css b/css/admin.css index 0066b930..b4392db3 100644 --- a/css/admin.css +++ b/css/admin.css @@ -227,3 +227,7 @@ pre.exposed { #adv-settings > .screen-options { padding-top: 10px; } + +body .wpt_maximizable .wpt_scroll { + max-height: 40em; +} \ No newline at end of file diff --git a/css/maximize.css b/css/maximize.css new file mode 100644 index 00000000..5c822755 --- /dev/null +++ b/css/maximize.css @@ -0,0 +1,41 @@ +body.wpt_maximize { + overflow: hidden; +} + +body.wpt_maximize #wpadminbar, body.wpt_maximize #postdivrich, body.wpt_maximize #adminmenumain { + display: none; +} + +body.wpt_maximize .wpt_maximizable .wpt_scroll { + overflow: scroll; +} + +body.wpt_maximize .wpt_maximizable.wpt_maximized .wpt_scroll { + overflow: visible; + max-height: none; +} + +body.wpt_maximize .wpt_maximized { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + z-index: 99; + overflow: auto; +} + +.wpt_maximizable .qt-dfw { + position: static; +} + +/* Old WP versions */ +.wpt_maximizable .wp_themeSkin { + padding: 0px; + background: none; + border: none; + outline: none; +} +.wpt_maximizable .wp_themeSkin .mceIcon { + margin: auto; +} diff --git a/js/maximize.js b/js/maximize.js new file mode 100644 index 00000000..121e9f0a --- /dev/null +++ b/js/maximize.js @@ -0,0 +1,56 @@ +(function ($) { + + function maximizeItem(maximizable, settings) { + var container = $('body:first'), + scrollable = maximizable.find('.inside:first'), + toggleButton = $('