다른 프레임워크와 css 충돌을 피하기 위해 rhymix.less의 class/id 이름에 prefix 처리

변경전의 xe.less 파일도 rhymix.less와 함께 load 하여 호환정 유지

CSS 충돌 예)
bootstrap의 .btn
사용 예)
bootstrap 사용시엔 {Context::unloadBasicFiles('xe')}으로 unload 시키면 문제없음
This commit is contained in:
conory 2018-08-03 19:45:30 +09:00
parent 30e0a5c583
commit b1cb1f3f34
251 changed files with 938 additions and 776 deletions

View file

@ -1,37 +1 @@
@charset "utf-8";
/*! Copyright (C) NAVER <http://www.navercorp.com> */
/* @author NAVER <developers@xpressengine.com> */
/* 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;
}

View file

@ -1,22 +1,9 @@
@charset "UTF-8";
/* Element Reset */
body, table, input, textarea, select, button {
font-family: sans-serif;
font-size: 12px;
}
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
display: block;
}
body {
position: relative;
}
a img {
border: 0;
}
[hidden] {
display: none;
}
/* Content Default Styles */
.word_break(@wb) when (@wb = normal), (@wb = keep-all), (@wb = break-all) {
@ -26,7 +13,7 @@ a img {
.word_break(@wb) when (@wb = none) {
white-space: nowrap;
}
.xe_content {
.rhymix_content, .xe_content {
font-family: @default_font_family;
font-size: @default_font_size;
line-height: @default_line_height;
@ -39,14 +26,9 @@ a img {
height: auto;
}
}
@media screen {
img {
max-width: none;
}
}
/* Clearfix */
.xe-clearfix {
.rhymix_clearfix {
&:before, &:after {
content: " ";
display: table;
@ -56,12 +38,12 @@ a img {
}
zoom: 1;
}
.xe-widget-wrapper {
.rhymix_widget {
overflow: hidden;
}
/* Popup Menu Area */
#popup_menu_area {
/* Popup Menu */
#rhymix_popup_menu {
position: absolute;
z-index: 9999;
margin: 10px 0;
@ -94,7 +76,7 @@ a img {
}
}
@media screen and (max-width: 400px) {
#popup_menu_area {
#rhymix_popup_menu {
min-width:120px;
max-width:95%;
font-size: 13px;
@ -108,7 +90,7 @@ a img {
}
/* Editable Preview */
.editable_preview {
.rhymix_editable_preview {
width: 100%;
min-height: 240px;
max-height: 440px;
@ -124,7 +106,7 @@ a img {
margin-bottom: @default_paragraph_spacing !important;
}
}
.editable_preview_iframe {
.rhymix_editable_preview_iframe {
width: 100%;
height: 440px;
box-sizing: border-box;
@ -134,7 +116,7 @@ a img {
}
/* Message */
.message {
.rhymix_message {
position: relative;
margin: 1em 0;
padding: 0 1em;
@ -162,13 +144,13 @@ a img {
color: #468847;
background-color: #DFF0D8;
}
}
body > .message {
margin: 1em;
body > & {
margin: 1em;
}
}
/* Waiting for server response */
.wfsr {
#rhymix_waiting {
z-index: 100;
display: none;
position: fixed;
@ -188,19 +170,7 @@ body > .message {
}
/* Button */
.btnArea {
clear: both;
margin: 10px 0;
padding: 0;
text-align: right;
zoom: 1;
&:after {
clear: both;
display: block;
content: "";
}
}
.btn {
.rhymix_button {
display: inline-block;
*display: inline;
margin: 0;
@ -219,7 +189,7 @@ body > .message {
line-height: 24px !important;
font-family: inherit;
font-size: 12px;
color: #333333;
color: #333;
*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);
@ -233,11 +203,44 @@ body > .message {
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] {
&:hover, &:focus, &:active, &.active, &.disabled &[disabled] {
color: #333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
&:hover, &:focus {
background-position:0 -15px;
-webkit-transition:background-position 0.1s linear;
-moz-transition:background-position 0.1s linear;
-o-transition:background-position 0.1s linear;
transition:background-position 0.1s linear;
}
&:focus {
outline:thin dotted #333;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px;
}
&:active, &.active {
background-color:#ccc;
background-image:none;
outline:0;
box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
&.disabled &[disabled] {
cursor:default;
background-image:none;
opacity:0.65;filter:alpha(opacity=65);
box-shadow:none;
}
button&, input& {
*padding-top:3px;
*padding-bottom:3px;
height: 26px !important;
}
button&::-moz-focus-inner, input&::-moz-focus-inner {
padding:0;
border:0;
}
>a, >button, >input, >span {
display: inline-block;
*zoom: 1;
@ -256,11 +259,46 @@ body > .message {
cursor: pointer;
background: none;
}
&.inverse {
color:#fff;
border-color:#222222 #222222 #000000;
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
background-color:#363636;
*background-color:#222222;
background-image:-moz-linear-gradient(top, #444444, #222222);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
background-image:-webkit-linear-gradient(top, #444444, #222222);
background-image:-o-linear-gradient(top, #444444, #222222);
background-image:linear-gradient(to bottom, #444444, #222222);
background-repeat:repeat-x;
border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
&:hover, &:focus, &:active, &.active, &.disabled &[disabled] {
background-color:#222222;
*background-color:#151515;
}
&:active, &.active {
background-color:#080808
}
&.active {
color:rgba(255, 255, 255, 0.75);
}
}
}
input.btn, button.btn {
height: 26px !important;
.rhymix_button_wrapper {
clear: both;
margin: 10px 0;
padding: 0;
text-align: right;
zoom: 1;
&:after {
clear: both;
display: block;
content: "";
}
}
.btn-group {
.rhymix_button_group {
position: relative;
display: inline-block;
*display: inline;
@ -272,15 +310,15 @@ input.btn, button.btn {
&:first-child {
*margin-left: 0;
}
&+.btn-group {
&+.rhymix_button_group {
margin-left: 5px;
}
>.btn {
>.rhymix_button {
position: relative;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
&+.btn {
&+.rhymix_button {
margin-left: -1px;
}
&:first-child {

245
common/css/xe.less Normal file
View file

@ -0,0 +1,245 @@
@charset "UTF-8";
/* Element Reset */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
display: block;
}
body {
position: relative;
}
a img {
border: 0;
}
[hidden] {
display: none;
}
@media screen {
img {
max-width: none;
}
}
/* Clearfix */
.xe-clearfix {
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
zoom: 1;
}
.xe-widget-wrapper {
overflow: hidden;
}
/* 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;
}
/* 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, &:focus, &:active, &.active, &.disabled &[disabled] {
color: #333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
&:hover, &:focus {
background-position:0 -15px;
-webkit-transition:background-position 0.1s linear;
-moz-transition:background-position 0.1s linear;
-o-transition:background-position 0.1s linear;
transition:background-position 0.1s linear;
}
&:focus {
outline:thin dotted #333;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px;
}
&:active, &.active {
background-color:#ccc;
background-image:none;
outline:0;
box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
&.disabled &[disabled] {
cursor:default;
background-image:none;
opacity:0.65;filter:alpha(opacity=65);
box-shadow:none;
}
button.&, input[type="submit"].& {
*padding-top:3px;
*padding-bottom:3px;
height: 26px !important;
}
button.&::-moz-focus-inner, input[type="submit"].&::-moz-focus-inner {
padding:0;
border:0;
}
>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;
}
}
.btn-inverse {
color:#ffffff!important;
text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
background-color:#363636;
*background-color:#222222;
background-image:-moz-linear-gradient(top, #444444, #222222);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
background-image:-webkit-linear-gradient(top, #444444, #222222);
background-image:-o-linear-gradient(top, #444444, #222222);
background-image:linear-gradient(to bottom, #444444, #222222);
background-repeat:repeat-x;
border-color:#222222 #222222 #000000;
border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);
&:hover, &:focus, &:active, &.active, &.disabled &[disabled] {
color:#ffffff;
background-color:#222222;
*background-color:#151515;
}
&:active, &.active {
background-color:#080808
}
&.active {
color:rgba(255, 255, 255, 0.75);
}
}
.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;
}
}
}

View file

@ -195,7 +195,7 @@
/* 레이어 출력 */
if(html) {
var area = $('#popup_menu_area').html('<ul>'+html+'</ul>');
var area = $('#rhymix_popup_menu').html('<ul>'+html+'</ul>');
var areaOffset = {top:params.page_y, left:params.page_x};
if(area.outerHeight()+areaOffset.top > $(window).height()+$(window).scrollTop())
@ -286,21 +286,21 @@ jQuery(function($) {
});
/* Editor preview replacement */
$(".editable_preview").addClass("xe_content").attr("tabindex", 0);
$(".editable_preview").on("click", function() {
var input = $(this).siblings(".editable_preview_content");
$(".rhymix_editable_preview").addClass("rhymix_content").attr("tabindex", 0);
$(".rhymix_editable_preview").on("click", function() {
var input = $(this).siblings(".rhymix_editable_preview_content");
if (input.size()) {
$(this).off("click").off("focus").hide();
input = input.first();
if (input.attr("type") !== "hidden") {
input.hide();
}
var iframe = $('<iframe class="editable_preview_iframe"></iframe>');
var iframe = $('<iframe class="rhymix_editable_preview_iframe"></iframe>');
iframe.attr("src", current_url.setQuery("module", "editor").setQuery("act", "dispEditorFrame").setQuery("parent_input_id", input.attr("id")).replace(/^https?:/, ''));
iframe.insertAfter(input);
}
});
$(".editable_preview").on("focus", function() {
$(".rhymix_editable_preview").on("focus", function() {
$(this).triggerHandler("click");
});
@ -1080,8 +1080,8 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).on('click', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;" />').appendTo(document.body);
var $area = $('#rhymix_popup_menu');
if(!$area.length) $area = $('<div id="rhymix_popup_menu" tabindex="0" style="display:none;" />').appendTo(document.body);
// 이전에 호출되었을지 모르는 팝업메뉴 숨김
$area.hide();

View file

@ -22,7 +22,7 @@
actDeleteFile : '.xefu-act-delete',
actSetCover : '.xefu-act-set-cover',
tmplXeUploaderFileitem : '<li class="xefu-file xe-clearfix" data-file-srl="{{file_srl}}"><span class="xefu-file-name">{{source_filename}}</span><span class="xefu-file-info"><span>{{disp_file_size}}</span><span><input type="checkbox" data-file-srl="{{file_srl}}"> Select</span></span></li>',
tmplXeUploaderFileitem : '<li class="xefu-file rhymix_clearfix" data-file-srl="{{file_srl}}"><span class="xefu-file-name">{{source_filename}}</span><span class="xefu-file-info"><span>{{disp_file_size}}</span><span><input type="checkbox" data-file-srl="{{file_srl}}"> Select</span></span></li>',
tmplXeUploaderFileitemImage: '<li class="xefu-file xefu-file-image {{#if cover_image}}xefu-is-cover-image{{/if}}" data-file-srl="{{file_srl}}"><strong class="xefu-file-name">{{source_filename}}</strong><span class="xefu-file-info"><span class="xefu-file-size">{{disp_file_size}}</span><span><img src="{{download_url}}" alt=""></span><span><input type="checkbox" data-file-srl="{{file_srl}}"></span><button class="xefu-act-set-cover" data-file-srl="{{file_srl}}" title="Be a cover image"><i class="xi-check-circle"></i></button></span></li>'
};

View file

@ -19,7 +19,7 @@
<div id='header'>
<h1><a href='http://bgrins.github.com/spectrum'>Spectrum</a></h1> <h2><em>The No Hassle jQuery Colorpicker</em></h2>
<div id='links'>
<a href='http://github.com/bgrins/spectrum/zipball/1.8.0' class="btn btn-primary">Download Zip</a>
<a href='http://github.com/bgrins/spectrum/zipball/1.8.0' class="rhymix_button btn-primary">Download Zip</a>
View the <a href='http://github.com/bgrins/spectrum'>Source code</a>.
Spectrum is a project by <a href='http://twitter.com/bgrins'>@bgrins</a>.
</div>

View file

@ -16,9 +16,9 @@
window.show_leaving_warning = true;
/**
* This variable stores the .wfsr jQuery object.
* This variable stores the #rhymix_waiting jQuery object.
*/
var waiting_obj = $(".wfsr");
var waiting_obj = $('#rhymix_waiting');
/**
* Function for compatibility with XE's exec_xml()
@ -56,7 +56,7 @@
// Delay the waiting message for 1 second to prevent rapid blinking.
waiting_obj.css("opacity", 0.0);
var wfsr_timeout = setTimeout(function() {
var waiting_timeout = setTimeout(function() {
if (show_waiting_message) {
waiting_obj.css("opacity", "").show();
}
@ -66,7 +66,7 @@
successHandler = function(data, textStatus, xhr) {
// Hide the waiting message.
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
// Copy data to the result object.
@ -128,7 +128,7 @@
}
// Hide the waiting message and display an error notice.
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
var error_info;
@ -203,7 +203,7 @@
// Delay the waiting message for 1 second to prevent rapid blinking.
waiting_obj.css("opacity", 0.0);
var wfsr_timeout = setTimeout(function() {
var waiting_timeout = setTimeout(function() {
if (show_waiting_message) {
waiting_obj.css("opacity", "").show();
}
@ -213,7 +213,7 @@
var successHandler = function(data, textStatus, xhr) {
// Hide the waiting message.
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
// Add debug information.
@ -263,7 +263,7 @@
// Define the error handler.
var errorHandler = function(xhr, textStatus) {
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
var error_info;
@ -314,7 +314,7 @@
// Delay the waiting message for 1 second to prevent rapid blinking.
waiting_obj.css("opacity", 0.0);
var wfsr_timeout = setTimeout(function() {
var waiting_timeout = setTimeout(function() {
if (show_waiting_message) {
waiting_obj.css("opacity", "").show();
}
@ -322,7 +322,7 @@
// Define the success handler.
var successHandler = function(data, textStatus, xhr) {
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
if (self && self[type]) {
self[type](html);
@ -334,7 +334,7 @@
// Define the error handler.
var errorHandler = function(xhr, textStatus) {
clearTimeout(wfsr_timeout);
clearTimeout(waiting_timeout);
waiting_obj.hide().trigger("cancel_confirm");
var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")";
alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info);
@ -367,7 +367,7 @@
* Register the beforeUnload handler.
*/
$(function() {
waiting_obj = $(".wfsr");
waiting_obj = $('#rhymix_waiting');
if (show_leaving_warning) {
$(document).ajaxStart(function() {
$(window).bind("beforeunload", beforeUnloadHandler);