Commit f34fd5c4 by Brian Talbot

studio html editor - sync'ed up previous style and behavior work to refactored xmodule sass/js

parent e8ba078d
.editor { .editor {
position: relative; position: relative;
.row { .row {
position: relative; position: relative;
} }
...@@ -27,32 +27,37 @@ ...@@ -27,32 +27,37 @@
background: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .5);
} }
} }
}
.editor-tabs { .editor-tabs {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
li {
float: left;
margin-right: 5px;
li { &:last-child {
float: left; margin-right: 0;
} }
}
.tab {
display: block;
height: 24px;
padding: 7px 20px 3px;
border: 1px solid #a5aaaf;
border-radius: 3px 3px 0 0;
@include linear-gradient(top, rgba(0, 0, 0, 0) 87%, rgba(0, 0, 0, .06));
background-color: #e5ecf3;
font-size: 13px;
color: #3c3c3c;
box-shadow: 1px -1px 1px rgba(0, 0, 0, .05);
.tab { &.current {
display: block; background: #fff;
height: 24px; border-bottom-color: #fff;
padding: 7px 20px 3px;
border: 1px solid #a5aaaf;
border-radius: 3px 3px 0 0;
@include linear-gradient(top, rgba(0, 0, 0, 0) 87%, rgba(0, 0, 0, .06));
background-color: #e5ecf3;
font-size: 13px;
color: #3c3c3c;
box-shadow: 1px -1px 1px rgba(0, 0, 0, .05);
&.current {
background: #fff;
border-bottom-color: #fff;
}
} }
} }
} }
......
...@@ -2,19 +2,28 @@ ...@@ -2,19 +2,28 @@
@include clearfix(); @include clearfix();
.CodeMirror { .CodeMirror {
display: none; @include box-sizing(border-box);
position: absolute; position: absolute;
top: 46px; top: 46px;
width: 100%; width: 100%;
height: 378px; height: 379px;
border: 1px solid #3c3c3c;
border-top: 1px solid #8891a1;
background: #fff; background: #fff;
color: #3c3c3c; color: #3c3c3c;
@include box-sizing(border-box); }
.CodeMirror-scroll {
height: 100%;
} }
.editor-tabs { .editor-tabs {
top: 11px; top: 11px !important;
right: 30px; right: 10px;
z-index: 99; z-index: 99;
} }
.is-inactive {
display: none;
}
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ class XMLEditingDescriptor(EditingDescriptor): ...@@ -30,7 +30,7 @@ class XMLEditingDescriptor(EditingDescriptor):
any validation of its definition any validation of its definition
""" """
css = {'scss': [resource_string(__name__, 'css/editor/display.scss'), resource_string(__name__, 'css/codemirror/codemirror.scss')]} css = {'scss': [resource_string(__name__, 'css/codemirror/codemirror.scss')]}
js = {'coffee': [resource_string(__name__, 'js/src/raw/edit/xml.coffee')]} js = {'coffee': [resource_string(__name__, 'js/src/raw/edit/xml.coffee')]}
js_module_name = "XMLEditingDescriptor" js_module_name = "XMLEditingDescriptor"
...@@ -42,7 +42,7 @@ class JSONEditingDescriptor(EditingDescriptor): ...@@ -42,7 +42,7 @@ class JSONEditingDescriptor(EditingDescriptor):
any validation of its definition any validation of its definition
""" """
css = {'scss': [resource_string(__name__, 'css/editor/display.scss'), resource_string(__name__, 'css/codemirror/codemirror.scss')]} css = {'scss': [resource_string(__name__, 'css/codemirror/codemirror.scss')]}
js = {'coffee': [resource_string(__name__, 'js/src/raw/edit/json.coffee')]} js = {'coffee': [resource_string(__name__, 'js/src/raw/edit/json.coffee')]}
js_module_name = "JSONEditingDescriptor" js_module_name = "JSONEditingDescriptor"
...@@ -9,6 +9,8 @@ class @HTMLEditingDescriptor ...@@ -9,6 +9,8 @@ class @HTMLEditingDescriptor
lineNumbers: true lineNumbers: true
lineWrapping: true}) lineWrapping: true})
$(@advanced_editor.getWrapperElement()).addClass('is-inactive')
@tiny_mce_textarea = $(".tiny-mce", @element).tinymce({ @tiny_mce_textarea = $(".tiny-mce", @element).tinymce({
script_url : '/static/js/vendor/tiny_mce/tiny_mce.js', script_url : '/static/js/vendor/tiny_mce/tiny_mce.js',
theme : "advanced", theme : "advanced",
...@@ -41,18 +43,20 @@ class @HTMLEditingDescriptor ...@@ -41,18 +43,20 @@ class @HTMLEditingDescriptor
$(e.currentTarget).addClass('current') $(e.currentTarget).addClass('current')
visualEditor = @getVisualEditor() visualEditor = @getVisualEditor()
$('table.mceToolbar').toggleClass('is-inactive')
$(@advanced_editor.getWrapperElement()).toggleClass('is-inactive')
if $(e.currentTarget).attr('data-tab') is 'visual' if $(e.currentTarget).attr('data-tab') is 'visual'
@showVisualEditor(visualEditor) @showVisualEditor(visualEditor)
$('table.mceToolbar').removeClass('is-inactive')
$(@advanced_editor.getWrapperElement()).addClass('is-inactive')
else else
# @tiny_mce_textarea.hide() # @tiny_mce_textarea.hide()
@showAdvancedEditor(visualEditor) @showAdvancedEditor(visualEditor)
$('table.mceToolbar').addClass('is-inactive')
$(@advanced_editor.getWrapperElement()).removeClass('is-inactive')
# Show the Advanced (codemirror) Editor. Pulled out as a helper method for unit testing. # Show the Advanced (codemirror) Editor. Pulled out as a helper method for unit testing.
showAdvancedEditor: (visualEditor) -> showAdvancedEditor: (visualEditor) ->
# $(@advanced_editor.getWrapperElement()).show()
if visualEditor.isDirty() if visualEditor.isDirty()
@advanced_editor.setValue(visualEditor.getContent({no_events: 1})) @advanced_editor.setValue(visualEditor.getContent({no_events: 1}))
@advanced_editor.setCursor(0) @advanced_editor.setCursor(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment