mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
Enable LESS and SASS @ editor style (#988)
* Enable LESS and SASS @ editor style 에디터 스타일에 LESS 또는 SASS를 사용할 수 없어서 기본 설정을 간결하게 반영하기 어려운 감이 있었습니다. 이를 해결합니다. * Replace for to foreach foreach 로 대체 가능한 for 문을 대체합니다.
This commit is contained in:
parent
0dedc76107
commit
bafc9005c6
1 changed files with 27 additions and 33 deletions
|
|
@ -186,30 +186,6 @@ class editorController extends editor
|
|||
|
||||
if ($editor_config)
|
||||
{
|
||||
$content_style = $editor_config->content_style;
|
||||
if($content_style)
|
||||
{
|
||||
$path = _XE_PATH_ . 'modules/editor/styles/'.$content_style.'/';
|
||||
if(is_dir($path) && file_exists($path . 'style.ini'))
|
||||
{
|
||||
$ini = file($path.'style.ini');
|
||||
for($i = 0, $c = count($ini); $i < $c; $i++)
|
||||
{
|
||||
$file = trim($ini[$i]);
|
||||
if(!$file) continue;
|
||||
|
||||
if(substr_compare($file, '.css', -4) === 0)
|
||||
{
|
||||
Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
}
|
||||
elseif(substr_compare($file, '.js', -3) === 0)
|
||||
{
|
||||
Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$default_font_config = $this->default_font_config;
|
||||
if ($editor_config->content_font) $default_font_config['default_font_family'] = $editor_config->content_font;
|
||||
if ($editor_config->content_font_size) $default_font_config['default_font_size'] = $editor_config->content_font_size;
|
||||
|
|
@ -218,6 +194,24 @@ class editorController extends editor
|
|||
if ($editor_config->content_word_break) $default_font_config['default_word_break'] = $editor_config->content_word_break;
|
||||
Context::set('default_font_config', $default_font_config);
|
||||
|
||||
$content_style = $editor_config->content_style;
|
||||
if($content_style)
|
||||
{
|
||||
$path = _XE_PATH_ . 'modules/editor/styles/'.$content_style.'/';
|
||||
if(is_dir($path) && file_exists($path . 'style.ini'))
|
||||
{
|
||||
$ini = file($path.'style.ini');
|
||||
foreach($ini as $file)
|
||||
{
|
||||
$file = trim($file);
|
||||
if(!$file) continue;
|
||||
|
||||
$args = array('./modules/editor/styles/'.$content_style.'/'.$file);
|
||||
Context::loadFile($args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$buff = array();
|
||||
$buff[] = '<style> .xe_content {';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue