Merge pull request #1079 from aragonc/ckeditorcss

Style custom ckeditor
ofaj
Alex Aragon Calixto 9 years ago
commit 3a8253c464
  1. 3
      app/Resources/public/css/base.css
  2. 213
      app/Resources/public/css/editor.css
  3. 22
      app/Resources/public/css/frames.css
  4. 11
      app/Resources/public/css/themes/chamilo/default.css
  5. BIN
      main/img/document/border-title.png
  6. BIN
      main/img/document/hr-1.png
  7. BIN
      main/img/document/hr-2.png
  8. 2
      main/inc/introductionSection.inc.php
  9. 1
      main/inc/lib/elfinder/templates.php
  10. 24
      main/inc/lib/template.lib.php
  11. 81
      main/template/default/javascript/editor/ckeditor/config_js.tpl
  12. 10
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  13. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Announcements.php
  14. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  15. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php
  16. 5
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php
  17. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/PortalNews.php
  18. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php
  19. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/WikiStudent.php
  20. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/WikiTask.php
  21. 1
      src/Chamilo/CoreBundle/Component/Editor/Editor.php

@ -93,6 +93,9 @@ a.thumbnail:hover{
position: relative;
}
.page-course{
padding: 2% 3%;
}
/*------------------------*/
.cursor-pointer {
cursor: pointer;

@ -0,0 +1,213 @@
/*
Theme Name: Frame Scorm
URI Project: http://www.chamilo.org
Description: Styles main base of Chamilo LMS appearance, works with Bootstrap 3.0.x
Author:
alex.aragon@beeznest.com
Version: 1.0
*/
@import url(//fonts.googleapis.com/css?family=Open+Sans:400,300,600,300italic,400italic);
@import url(../assets/fontawesome/css/font-awesome.min.css);
body{
color: #666;
font-family: 'Open Sans', sans-serif;
line-height: 30px;
}
a{
text-decoration: none;
color: #00829C;
}
a:hover{
text-decoration: underline;
}
.ck{
display: block;
font-style: normal;
font-weight: normal;
line-height: 1;
font-size-adjust: none;
font-stretch: normal;
font-feature-settings: normal;
font-language-override: normal;
font-kerning: auto;
font-synthesis: weight style;
font-variant: normal;
}
.ck-article{
text-transform: uppercase;
color: #E95839;
font-weight: bold;
background: url(../../main/img/document/border-title.png) repeat-x 0 80%;
padding-bottom: 2%;
margin-bottom: 10px;
}
.ck-article:before{
content: "\f15c";
margin-right: 5px;
font-family: FontAwesome;
font-weight: normal;
}
.ck-paragraph-box{
background-color: #F5EEE2;
padding: 2% 3%;
line-height: 20px;
}
.ck-title{
display: block;
font-weight: bold;
color: #000;
}
.ck-title2{
padding-top: 0;
margin-top: 0;
font-weight: 500;
position: relative;
color: #000;
}
.ck-title2:after{
background-color:#E95839;
margin: 10px 0px 0px;
width: 50px;
height: 2px;
display: block;
content: "";
}
figure .image.alignleft{
margin: 0 20px 20px 0;
}
figure .image.alignright{
margin: 0 20px 0px 20px;
}
figure .image{
margin: 0 20px 0px 20px;
}
figure figcaption{
text-align: left;
background-color: #f3f3f3;
padding-top: 0px;
margin: 0px;
border-radius: 0px;
padding-left: 5px;
}
figure{
border: 1px solid #ddd;
margin-bottom: 20px !important;
padding: 5px;
border-radius: 5px;
}
blockquote {
background: #f9f9f9;
border-left: 8px solid #ccc;
font: 14px/20px italic Times, serif;
margin: 1.5em 10px;
padding: 0.5em 10px;
quotes: "\201C""\201D""\2018""\2019";
display: inline-block;
}
blockquote:before {
color: #ccc;
content: open-quote;
font-size: 4em;
line-height: 0.1em;
margin-right: 0.25em;
vertical-align: -0.4em;
}
blockquote p {
display: inline;
}
.ck-stand-out{
background-color: yellow;
}
/* line horizontal separation */
.ck-style1 {
height: 6px;
background: url(../../main/img/document/hr-1.png) repeat-x 0 0;
border: 0;
}
.ck-style2 {
height: 6px;
background: url(../../main/img/document/hr-2.png) repeat-x 0 0;
border: 0;
}
.ck-style3 {
border-top: 1px dashed #8c8b8b;
}
.ck-style3:after {
content: '\002702';
display: inline-block;
position: relative;
top: -12px;
left: 40px;
padding: 0 3px;
background: #FFF;
color: #8c8b8b;
font-size: 18px;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-success {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
color: #8a6d3b;
background-color: #fcf8e3;
border-color: #faebcc;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
}
.alert-danger hr {
border-top-color: #e4b9c0;
}
.alert-danger .alert-link {
color: #843534;
}

@ -1,22 +0,0 @@
/*
Theme Name: Frame Scorm
URI Project: http://www.chamilo.org
Description: Styles main base of Chamilo LMS appearance, works with Bootstrap 3.0.x
Author:
alex.aragon@beeznest.com
Version: 1.0
*/
@import url(//fonts.googleapis.com/css?family=Open+Sans:400,300,600,300italic,400italic);
body{
color: #666;
font-family: 'Open Sans', sans-serif;
padding: 20px;
line-height: 30px;
}
a{
text-decoration: none;
color: #00829C;
}
a:hover{
text-decoration: underline;
}

@ -59,7 +59,7 @@ a:focus {
-webkit-border-radius: 0;
}
.navbar {
background: #00829C;
background: #2E75A3;
-webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}
@ -95,7 +95,7 @@ a:focus {
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus{
color: #fff;
background-color:#00677C;
background-color:#07578a;
}
.navbar-default .navbar-nav > li > a{
color: #ffffff;
@ -103,7 +103,7 @@ a:focus {
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus{
background: #00677C;
background: #07578a;
color: #ffffff;
}
.navbar-nav > li > .dropdown-menu{
@ -115,7 +115,7 @@ a:focus {
}
.navbar-default .navbar-nav > .open > .dropdown-menu{
padding: 3px 4px;
background-color: #00677C;
background-color: #07578a;
}
.navbar-default .navbar-nav > .open > .dropdown-menu > li > a{
padding: 6px 9px;
@ -126,8 +126,7 @@ a:focus {
}
.navbar-default .navbar-nav > .open > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > .open > .dropdown-menu > li > a:focus{
background-color:#00829C;
background-color:#2E75A3;
}
.nav > li > a:hover, .nav > li > a:focus{
background-color: transparent;

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -62,7 +62,7 @@ $config = array(
'Height' => '300'
);
$form->addHtmlEditor('intro_content', null, null, false, $config);
$form->addHtmlEditor('intro_content', null, false, false, $config, true);
$form->addButtonSave(get_lang('SaveIntroText'), 'intro_cmdUpdate');
/* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */

@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor;
$template = new Template();
$editor = new CkEditor();
$templates = $editor->simpleFormatTemplates();
$template->assign('templates', $templates);

@ -155,6 +155,8 @@ class Template
//Setting administrator variables
$this->setAdministratorParams();
$this->setCSSEditor();
//header and footer are showed by default
$this->set_footer($show_footer);
@ -566,6 +568,14 @@ class Template
$this->assign('css_static_file_to_string', $css_file_to_string);
}
}
public function setCSSEditor() {
$cssEditor = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css');
if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) {
$cssEditor = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css';
}
$this->assign('cssEditor', $cssEditor);
}
/**
* Prepare custom CSS to be added at the very end of the <head> section
* @return void
@ -575,6 +585,7 @@ class Template
{
global $disable_js_and_css_files;
// Base CSS
$css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'base.css');
if ($this->show_learnpath) {
@ -583,16 +594,19 @@ class Template
$css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/learnpath.css';
}
}
if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) {
$css[] = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css';
}else{
$css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css');
}
$css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/default.css');
$css_file_to_string = null;
foreach ($css as $file) {
$css_file_to_string .= api_get_css($file);
}
// @todo move this somewhere else. Special fix when using tablets in order to see the text near icons
if (SHOW_TEXT_NEAR_ICONS == true) {
//hack in order to fix the actions buttons

@ -18,7 +18,85 @@ CKEDITOR.editorConfig = function (config) {
config.templates_files = [
'{{ _p.web_main ~ 'inc/lib/elfinder/templates.php'}}'
];
//Style for default CKEditor Chamilo LMS
config.stylesSet = [
{
name : 'Title 1',
element : 'h1',
attributes : { 'class': 'ck ck-title' }
},
{
name : 'Title 2',
element : 'h2',
attributes : { 'class': 'ck ck-title2' }
},
{
name : 'Alert Success',
element : 'p',
attributes : { 'class': 'alert alert-success' }
},
{
name : 'Alert Info',
element : 'p',
attributes : { 'class': 'alert alert-info' }
},
{
name : 'Alert Warning',
element : 'p',
attributes : { 'class': 'alert alert-warning' }
},
{
name : 'Alert Danger',
element : 'p',
attributes : { 'class': 'alert alert-danger' }
},
{
name : 'Section Article' ,
element : 'h3' ,
attributes : { 'class': 'ck ck-article' }
}, {
name : 'Paragraph box' ,
element : 'p' ,
attributes: { 'class': 'ck-paragraph-box' }
}, {
name : 'Superscript' ,
element : 'sup'
},
{
name : 'Subscript' ,
element : 'sub'
},
{
name : 'Strikethrough' ,
element : 'del'
},
{
name : 'Underlined' ,
element : 'ins'
},
{
name : 'Stand Out' ,
element : 'span',
attributes: { 'class':'ck-stand-out'}
},
{
name : 'Separate Style 1' ,
element : 'hr',
attributes: { 'class':'ck-style1'}
},
{
name : 'Separate Style 2' ,
element : 'hr',
attributes: { 'class':'ck-style2'}
},
{
name : 'Separate Style 3' ,
element : 'hr',
attributes: { 'class':'ck-style3'}
}
];
{% if moreButtonsInMaximizedMode %}
config.toolbar = 'minToolbar';
config.smallToolbar = 'minToolbar';
@ -30,6 +108,7 @@ CKEDITOR.editorConfig = function (config) {
// Allows to use "class" attribute inside divs and spans.
config.allowedContent = true;
config.contentsCss = '{{ cssEditor }}';
config.customConfig = '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/config_js.php'}}';
};

@ -55,15 +55,16 @@ class CkEditor extends Editor
public function createHtmlStyle()
{
$style = '';
if (trim($this->value) == '<html><head><title></title></head><body></body></html>') {
$cssFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/frames.css';
if (trim($this->value) == '<html><head><title></title></head><body></body></html>' || $this->value == '' ) {
$cssFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/editor.css';
if (!is_file($cssFile)) {
$cssFile = api_get_path(WEB_CSS_PATH).'frames.css';
$cssFile = api_get_path(WEB_CSS_PATH).'editor.css';
} else {
$cssFile = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/frames.css';
$cssFile = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/editor.css';
}
$style = '<link href="'.$cssFile.'" rel="stylesheet" media="screen" type="text/css" />';
}
$html = '<textarea id="'.$this->getName().'" name="'.$this->getName().'" class="ckeditor">
'.$style.$this->value.'
</textarea>';
@ -82,6 +83,7 @@ class CkEditor extends Editor
$config = $toolbar->getConfig();
$javascript = $this->toJavascript($config);
$html = "<script>
CKEDITOR.replace('".$this->getName()."',
$javascript

@ -71,7 +71,7 @@ class Announcements extends Basic
['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Toolbarswitch']
];
}

@ -20,6 +20,7 @@ class Basic extends Toolbar
'adobeair',
'ajax',
'audio',
'image2',
'bidi',
'colorbutton',
'colordialog',
@ -204,7 +205,7 @@ class Basic extends Toolbar
['Link', 'Image', 'Video', 'Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Toolbarswitch']
];

@ -108,7 +108,7 @@ class Documents extends Basic
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
[
[ 'Styles',
'Format',
'Font',
'FontSize',

@ -117,8 +117,9 @@ class LearningPathDocuments extends Basic
['Link', 'Image', 'Video', 'Youtube', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Toolbarswitch']
['Toolbarswitch'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
];
}

@ -96,7 +96,7 @@ class PortalNews extends Basic
['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Toolbarswitch']
];
}

@ -97,7 +97,7 @@ class Wiki extends Basic
['Wikilink', 'Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Styles','Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Toolbarswitch']
];

@ -97,7 +97,7 @@ class WikiStudent extends Basic
['Wikilink', 'Link', 'Unlink', 'Anchor'],
['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio', 'Asciimath'],
['Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'leaflet'],
['Format', 'Font', 'FontSize'],
['Styles', 'Format', 'Font', 'FontSize'],
['Bold', 'Italic', 'Underline'],
[
'Subscript',

@ -93,7 +93,7 @@ class WikiTask extends Basic
['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],
['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],
api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Toolbarswitch']
];

@ -106,6 +106,7 @@ class Editor
CKEDITOR.replace('".$this->name."',
$javascript
);
</script>";
return $html;

Loading…
Cancel
Save