From a489012d6d3d0c0fe620234a95cbe7692f7e09c2 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 4 Aug 2018 23:18:29 +0900 Subject: [PATCH 1/9] Remove unnecessary mobile.css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 해당 파일의 내용은 rhymix.less와 100% 중복되므로 별도 로딩할 필요가 없음 --- classes/display/HTMLDisplayHandler.php | 1 - common/css/mobile.css | 38 +------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index b42e88b39..eca51aee0 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -583,7 +583,6 @@ class HTMLDisplayHandler private function _loadMobileJSCSS() { $this->_loadCommonJSCSS(); - Context::loadFile(array('./common/css/mobile.css', '', '', -1500000000), true); } /** diff --git a/common/css/mobile.css b/common/css/mobile.css index fab53bc83..730bd56a9 100644 --- a/common/css/mobile.css +++ b/common/css/mobile.css @@ -1,37 +1 @@ -@charset "utf-8"; -/*! Copyright (C) NAVER */ -/* @author NAVER */ - -/* Message */ -.message { - position: relative; - margin: 1em 0; - padding: 0 1em; - border: 1px solid #ddd; - border-radius: 4px; - line-height: 1.4; - font-size: 13px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #f8f8f8; -} -body>.message { - margin: 1em; -} -.message p { - margin: 1em 0 !important; -} -.message.info { - border-color: #BCE8F1; - color: #3A87AD; - background-color: #D9EDF7; -} -.message.error { - border-color: #EED3D7; - color: #B94A48; - background-color: #F2DEDE; -} -.message.update { - border-color: #D6E9C6; - color: #468847; - background-color: #DFF0D8; -} +/* This file is not used after Rhymix 1.9.8. See rhymix.less instead. */ \ No newline at end of file From c176be9c9f1d5c0ca90d1993a5e736f094f2f91c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 4 Aug 2018 23:20:45 +0900 Subject: [PATCH 2/9] Add an option to disable XE styles for .btn and .message To disable XE styles for .btn, .btn-group, and .btnArea: define('DISABLE_XE_BTN_STYLES', true); To disable XE styles for .message: define('DISABLE_XE_MSG_STYLES', true); This is a limited version of XE's __DISABLE_DEFAULT_CSS__ constant. Other styles and default CSS/JS resources are not affected. DO NOT UNLOAD DEFAULT CSS/JS RESOURCES. --- .../FrontEndFileHandler.class.php | 6 +- common/css/rhymix.less | 323 +++++++++--------- 2 files changed, 174 insertions(+), 155 deletions(-) diff --git a/classes/frontendfile/FrontEndFileHandler.class.php b/classes/frontendfile/FrontEndFileHandler.class.php index aa037c506..e21fb76c7 100644 --- a/classes/frontendfile/FrontEndFileHandler.class.php +++ b/classes/frontendfile/FrontEndFileHandler.class.php @@ -288,9 +288,11 @@ class FrontEndFileHandler extends Handler if (!file_exists($file->fileFullPath)) { return; - } - + } + $default_font_config = Context::get('default_font_config') ?: getController('editor')->default_font_config; + $file->vars['enable_xe_btn_styles'] = (defined('DISABLE_XE_BTN_STYLES') && DISABLE_XE_BTN_STYLES) ? 'false' : 'true'; + $file->vars['enable_xe_msg_styles'] = (defined('DISABLE_XE_MSG_STYLES') && DISABLE_XE_MSG_STYLES) ? 'false' : 'true'; $file->vars = array_merge($file->vars, $default_font_config); if ($file->fileExtension === 'less') { diff --git a/common/css/rhymix.less b/common/css/rhymix.less index 446ad1bd8..823c5f924 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -137,40 +137,6 @@ a img { border: 0; } -/* Message */ -.message { - position: relative; - margin: 1em 0; - padding: 0 1em; - border: 1px solid #ddd; - border-radius: 4px; - line-height: 1.4; - font-size: 13px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #f8f8f8; - p { - margin: 1em 0 !important; - } - &.info { - border-color: #BCE8F1; - color: #3A87AD; - background-color: #D9EDF7; - } - &.error { - border-color: #EED3D7; - color: #B94A48; - background-color: #F2DEDE; - } - &.update { - border-color: #D6E9C6; - color: #468847; - background-color: #DFF0D8; - } -} -body > .message { - margin: 1em; -} - /* Waiting for server response */ .wfsr { z-index: 100; @@ -191,125 +157,6 @@ body > .message { background: #333 url("../../common/img/msg.loading.gif") no-repeat center 15px; } -/* Button */ -.btnArea { - clear: both; - margin: 10px 0; - padding: 0; - text-align: right; - zoom: 1; - &:after { - clear: both; - display: block; - content: ""; - } -} -.btn { - display: inline-block; - *display: inline; - margin: 0; - padding: 0 12px !important; - height: 24px !important; - overflow: visible; - border: 1px solid #bbbbbb; - border-color: #e6e6e6 #e6e6e6 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - border-bottom-color: #a2a2a2; - border-radius: 2px; - text-decoration: none !important; - text-align: center; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - vertical-align: top; - line-height: 24px !important; - font-family: inherit; - font-size: 12px; - color: #333333; - *zoom: 1; - cursor: pointer; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - background-color: #f5f5f5; - *background-color: #e6e6e6; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(top, #ffffff, #e6e6e6); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - &:hover, &:active, &[disabled] { - color: #333; - background-color: #e6e6e6; - *background-color: #d9d9d9; - } - >a, >button, >input, >span { - display: inline-block; - *zoom: 1; - margin: 0 -12px !important; - padding: 0 12px !important; - overflow: visible; - width: auto; - height: 24px; - border: 0; - vertical-align: top; - text-decoration: none !important; - line-height: 24px; - font-family: inherit; - font-size: 12px; - color: #333; - cursor: pointer; - background: none; - } -} -input.btn, button.btn { - height: 26px !important; -} -.btn-group { - position: relative; - display: inline-block; - *display: inline; - *margin-left: .3em; - white-space: nowrap; - vertical-align: middle; - font-size: 0; - *zoom: 1; - &:first-child { - *margin-left: 0; - } - &+.btn-group { - margin-left: 5px; - } - >.btn { - position: relative; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - &+.btn { - margin-left: -1px; - } - &:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; - border-top-left-radius: 4px; - } - &:last-child { - -webkit-border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -moz-border-radius-bottomright: 4px; - border-bottom-right-radius: 4px; - } - &:hover, &:focus, &:active, &.active { - z-index: 2; - } - } -} - /* Debug */ #rhymix_debug_button { display: none; @@ -449,3 +296,173 @@ input.btn, button.btn { } } } + +/* Button (for XE compatibility */ +.btnArea_mixin(@enabled) when (@enabled = true) { + clear: both; + margin: 10px 0; + padding: 0; + text-align: right; + zoom: 1; + &:after { + clear: both; + display: block; + content: ""; + } +} +.btnArea_mixin(@enabled) when (@enabled = false) { } +.btnArea { + .btnArea_mixin(@enable_xe_btn); +} +.btn_mixin(@enabled) when (@enabled = true) { + display: inline-block; + *display: inline; + margin: 0; + padding: 0 12px !important; + height: 24px !important; + overflow: visible; + border: 1px solid #bbbbbb; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #a2a2a2; + border-radius: 2px; + text-decoration: none !important; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: top; + line-height: 24px !important; + font-family: inherit; + font-size: 12px; + color: #333333; + *zoom: 1; + cursor: pointer; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(top, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + &:hover, &:active, &[disabled] { + color: #333; + background-color: #e6e6e6; + *background-color: #d9d9d9; + } + >a, >button, >input, >span { + display: inline-block; + *zoom: 1; + margin: 0 -12px !important; + padding: 0 12px !important; + overflow: visible; + width: auto; + height: 24px; + border: 0; + vertical-align: top; + text-decoration: none !important; + line-height: 24px; + font-family: inherit; + font-size: 12px; + color: #333; + cursor: pointer; + background: none; + } + input&, button& { + height: 26px !important; + } +} +.btn_mixin(@enabled) when (@enabled = false) { } +.btn { + .btn_mixin(@enable_xe_btn); +} +.btn-group_mixin(@enabled) when (@enabled = true) { + position: relative; + display: inline-block; + *display: inline; + *margin-left: .3em; + white-space: nowrap; + vertical-align: middle; + font-size: 0; + *zoom: 1; + &:first-child { + *margin-left: 0; + } + &+.btn-group { + margin-left: 5px; + } + >.btn { + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + &+.btn { + margin-left: -1px; + } + &:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + } + &:last-child { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; + } + &:hover, &:focus, &:active, &.active { + z-index: 2; + } + } +} +.btn-group_mixin(@enabled) when (@enabled = false) { } +.btn-group { + .btn-group_mixin(@enable_xe_btn); +} + +/* Message (for XE compatibility) */ +@enabled: true; +.message_mixin(@enabled) when (@enabled = true) { + position: relative; + margin: 1em 0; + padding: 0 1em; + border: 1px solid #ddd; + border-radius: 4px; + line-height: 1.4; + font-size: 13px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #f8f8f8; + p { + margin: 1em 0 !important; + } + &.info { + border-color: #BCE8F1; + color: #3A87AD; + background-color: #D9EDF7; + } + &.error { + border-color: #EED3D7; + color: #B94A48; + background-color: #F2DEDE; + } + &.update { + border-color: #D6E9C6; + color: #468847; + background-color: #DFF0D8; + } + body > & { + margin: 1em; + } +} +.message_mixin(@enabled) when (@enabled = false) { } +.message { + .message_mixin(@enable_xe_msg); +} From a39a48594b364b18148cb6598f8930c7b4356c03 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 4 Aug 2018 23:31:29 +0900 Subject: [PATCH 3/9] Remove debug code from rhymix.less --- common/css/rhymix.less | 1 - 1 file changed, 1 deletion(-) diff --git a/common/css/rhymix.less b/common/css/rhymix.less index 823c5f924..a2d6715ea 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -429,7 +429,6 @@ a img { } /* Message (for XE compatibility) */ -@enabled: true; .message_mixin(@enabled) when (@enabled = true) { position: relative; margin: 1em 0; From 59833bb291d063a764fbdf04c85dcaeba7b747a5 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 4 Aug 2018 23:35:51 +0900 Subject: [PATCH 4/9] Remove mobile.css --- common/css/mobile.css | 1 - 1 file changed, 1 deletion(-) delete mode 100644 common/css/mobile.css diff --git a/common/css/mobile.css b/common/css/mobile.css deleted file mode 100644 index 730bd56a9..000000000 --- a/common/css/mobile.css +++ /dev/null @@ -1 +0,0 @@ -/* This file is not used after Rhymix 1.9.8. See rhymix.less instead. */ \ No newline at end of file From e9db9df53b476b7885a87f6df97091d13fd04882 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 5 Aug 2018 01:46:17 +0900 Subject: [PATCH 5/9] Fix incorrect variables --- common/css/rhymix.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/css/rhymix.less b/common/css/rhymix.less index a2d6715ea..4ee161839 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -312,7 +312,7 @@ a img { } .btnArea_mixin(@enabled) when (@enabled = false) { } .btnArea { - .btnArea_mixin(@enable_xe_btn); + .btnArea_mixin(@enable_xe_btn_styles); } .btn_mixin(@enabled) when (@enabled = true) { display: inline-block; @@ -376,7 +376,7 @@ a img { } .btn_mixin(@enabled) when (@enabled = false) { } .btn { - .btn_mixin(@enable_xe_btn); + .btn_mixin(@enable_xe_btn_styles); } .btn-group_mixin(@enabled) when (@enabled = true) { position: relative; @@ -425,7 +425,7 @@ a img { } .btn-group_mixin(@enabled) when (@enabled = false) { } .btn-group { - .btn-group_mixin(@enable_xe_btn); + .btn-group_mixin(@enable_xe_btn_styles); } /* Message (for XE compatibility) */ @@ -463,5 +463,5 @@ a img { } .message_mixin(@enabled) when (@enabled = false) { } .message { - .message_mixin(@enable_xe_msg); + .message_mixin(@enable_xe_msg_styles); } From 6d77e860aa4a1f8ec9a8764b505fd0b5d1623f4f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 5 Aug 2018 01:50:39 +0900 Subject: [PATCH 6/9] Add rhymix aliases to XE CSS classes --- common/css/rhymix.less | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/css/rhymix.less b/common/css/rhymix.less index 4ee161839..fae1e180b 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -26,7 +26,7 @@ a img { .word_break(@wb) when (@wb = none) { white-space: nowrap; } -.xe_content { +.xe_content, .rhymix_content { font-family: @default_font_family; font-size: @default_font_size; line-height: @default_line_height; @@ -65,7 +65,7 @@ a img { } /* Popup Menu Area */ -#popup_menu_area { +#rhymix_popup_menu, #popup_menu_area { position: absolute; z-index: 9999; margin: 10px 0; @@ -98,7 +98,7 @@ a img { } } @media screen and (max-width: 400px) { - #popup_menu_area { + #rhymix_popup_menu, #popup_menu_area { min-width:120px; max-width:95%; font-size: 13px; @@ -314,6 +314,9 @@ a img { .btnArea { .btnArea_mixin(@enable_xe_btn_styles); } +.rhymix_button_wrapper { + .btnArea_mixin(true); +} .btn_mixin(@enabled) when (@enabled = true) { display: inline-block; *display: inline; @@ -378,6 +381,9 @@ a img { .btn { .btn_mixin(@enable_xe_btn_styles); } +.rhymix_button { + .btn_mixin(true); +} .btn-group_mixin(@enabled) when (@enabled = true) { position: relative; display: inline-block; @@ -465,3 +471,6 @@ a img { .message { .message_mixin(@enable_xe_msg_styles); } +.rhymix_message { + .message_mixin(true); +} From 4fc7605e93733dd374981296a64c63bacc9ff8c3 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 5 Aug 2018 19:13:58 +0900 Subject: [PATCH 7/9] Remove mobile.css from unit tests --- tests/unit/classes/FrontEndFileHandlerTest.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/unit/classes/FrontEndFileHandlerTest.php b/tests/unit/classes/FrontEndFileHandlerTest.php index be8b7fecd..dfe99509c 100644 --- a/tests/unit/classes/FrontEndFileHandlerTest.php +++ b/tests/unit/classes/FrontEndFileHandlerTest.php @@ -38,17 +38,13 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test $this->assertEquals($expected, $handler->getJsFileList('body')); }); - $this->specify("css and scss", function() { + $this->specify("css and less", function() { $handler = new FrontEndFileHandler(); $handler->loadFile(array('./common/css/rhymix.less')); - $handler->loadFile(array('./common/css/mobile.css')); $result = $handler->getCssFileList(true); $this->assertRegexp('/\.rhymix\.less\.css\?\d+$/', $result[0]['file']); $this->assertEquals('all', $result[0]['media']); $this->assertEmpty($result[0]['targetie']); - $this->assertEquals('/rhymix/common/css/mobile.css' . $this->_filemtime('common/css/mobile.css'), $result[1]['file']); - $this->assertEquals('all', $result[1]['media']); - $this->assertEmpty($result[1]['targetie']); }); $this->specify("order (duplicate)", function() { @@ -157,14 +153,10 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test $this->specify("minify (css)", function() { $handler = new FrontEndFileHandler(); $handler->loadFile(array('./common/css/rhymix.less')); - $handler->loadFile(array('./common/css/mobile.css')); $result = $handler->getCssFileList(true); $this->assertRegexp('/\.rhymix\.less\.min\.css\b/', $result[0]['file']); $this->assertEquals('all', $result[0]['media']); $this->assertEmpty($result[0]['targetie']); - $this->assertRegexp('/minified\/common\.css\.mobile\.min\.css\?\d+$/', $result[1]['file']); - $this->assertEquals('all', $result[1]['media']); - $this->assertEmpty($result[1]['targetie']); }); $this->specify("minify (js)", function() { @@ -182,7 +174,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test $this->specify("concat (css)", function() { $handler = new FrontEndFileHandler(); $handler->loadFile(array('./common/css/rhymix.less')); - $handler->loadFile(array('./common/css/mobile.css')); + $handler->loadFile(array('./common/css/bootstrap-responsive.css')); $handler->loadFile(array('http://external.host/style.css')); $handler->loadFile(array('./common/css/bootstrap.css', null, 'IE')); $handler->loadFile(array('./tests/_data/formatter/concat.source1.css')); @@ -257,7 +249,6 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test $this->specify("blocked scripts", function() { $handler = new FrontEndFileHandler(); - $handler->loadFile(array('./common/css/mobile.css')); $handler->loadFile(array('./common/css/xe.min.css')); $handler->loadFile(array('./common/js/common.js')); $handler->loadFile(array('./common/js/xe.js')); From 637e4f9e4670916d5d7f3ec9e870d7449166ca0f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 5 Aug 2018 19:19:30 +0900 Subject: [PATCH 8/9] Move admin layout assets to admin layout template files @conory --- classes/display/HTMLDisplayHandler.php | 12 ------------ modules/admin/tpl/_header.html | 7 ++++++- modules/admin/tpl/popup_layout.html | 6 ++++++ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index eca51aee0..3df435402 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -562,19 +562,7 @@ class HTMLDisplayHandler */ function _loadDesktopJSCSS() { - $lang_type = Context::getLangType(); $this->_loadCommonJSCSS(); - - // for admin page, add admin css - if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) - { - Context::loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); - Context::loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true); - Context::loadFile('./modules/admin/tpl/js/admin.js', true); - Context::loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); - Context::loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true); - Context::loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true); - } } /** diff --git a/modules/admin/tpl/_header.html b/modules/admin/tpl/_header.html index 178b93494..4b1da51ca 100644 --- a/modules/admin/tpl/_header.html +++ b/modules/admin/tpl/_header.html @@ -1,5 +1,10 @@ + + + + + + -