Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rte styles #166

Merged
merged 3 commits into from Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -6,15 +6,12 @@ export default class questionText extends React.Component {
return (
<div className="c-input c-question-text">
<label htmlFor={`question_text_${this.props.id}`} />
<div className="c-input__contain">
<Editor
text={this.props.text}
onBlur={val => this.props.updateItem({ question: { text: val } })}
bankId={this.props.bankId}
id={this.props.id}
/>
<div className="c-input__bottom" />
</div>
<Editor
text={this.props.text}
onBlur={val => this.props.updateItem({ question: { text: val } })}
bankId={this.props.bankId}
id={this.props.id}
/>
</div>
);
}
Expand Down
15 changes: 9 additions & 6 deletions client/js/_author/components/common/oea_editor.jsx
Expand Up @@ -31,12 +31,15 @@ export default class OeaEditor extends React.Component {
const active = this.state.focused ? 'is-focused' : '';

return (
<div className={`c-text-input c-text-input--medium c-wysiwyg ${active}`}>
<TinyWrapper
{...this.props}
onBlur={editorText => this.onBlur(editorText)}
onFocus={() => this.setState({ focused: true })}
/>
<div className="c-input__contain">
<div className={`c-text-input c-text-input--medium c-wysiwyg ${active}`}>
<TinyWrapper
{...this.props}
onBlur={editorText => this.onBlur(editorText)}
onFocus={() => this.setState({ focused: true })}
/>
</div>
<div className={`c-input__bottom ${active}`} />
</div>
);
}
Expand Down
9 changes: 5 additions & 4 deletions client/js/_author/components/common/tiny_wrapper.jsx
Expand Up @@ -6,7 +6,9 @@ import 'tinymce/themes/modern/theme';
import 'tinymce/plugins/autolink/plugin';
import 'tinymce/plugins/paste/plugin';
import 'tinymce/plugins/link/plugin';
import 'tinymce/plugins/code/plugin';
import 'tinymce/plugins/image/plugin';
import 'tinymce/plugins/charmap/plugin';
import 'tinymce/plugins/lists/plugin';
import guid from '../../../utils/guid';

Expand Down Expand Up @@ -82,8 +84,8 @@ export class TinyWrapper extends React.Component {
this.imageFilePicker.click();
}
},
plugins: 'autolink link image lists paste',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright image paste',
plugins: 'autolink link image lists paste code charmap',
toolbar: 'bold italic removeformat | bullist numlist blockquote | code charmap subscript superscript | image',
inline: true,
paste_data_images: true,
};
Expand All @@ -100,8 +102,7 @@ export class TinyWrapper extends React.Component {
onFocus={this.props.onFocus}
/>
<input
style={{width: '0.1px', height: '0.1px', display: 'none'}}
className="c-image-uploader"
className="c-image-uploader c-file"
type="file"
ref={ref => (this.imageFilePicker = ref)}
onChange={e => this.uploadImage(e)}
Expand Down
1 change: 1 addition & 0 deletions client/styles/_author/modules/_mixins.scss
@@ -1,3 +1,4 @@
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,600i,700,700i');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use font URL's this will need to run offline

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now, but will need to be changed later


$border: 0.1rem solid $gray3;

Expand Down
113 changes: 111 additions & 2 deletions client/styles/_author/partials/_inputs.scss
Expand Up @@ -40,6 +40,10 @@
&.has-error{
border-color: $red;
}
&.is-focused{
border-color: $blue;
background: $blue;
}
}

.c-text-input--large{
Expand All @@ -65,8 +69,105 @@
}

.c-wysiwyg{
&:focus{
border-top: $border;
&.is-focused{

.mce-content-body{
border-top: $border;
outline: none;
}

}

.mce-content-body{
padding: 0.5rem 0;
}

.mce-panel{
background: none;
width: 100% !important;
border-bottom: none;
border-left: none;
border-right: none;
border-top-color: $gray3;
}

.mce-btn{
background: none;
border-radius: $radius;
border: 0.1rem solid transparent;
&:hover{
background: $gray3;
border: $border;
.mce-ico{
color: $text-color;
}
}
&.mce-active{
background: $gray2;
border: $border;
.mce-ico{
color: $text-color;
}
&:hover{
background: $gray3;
border: $border;
}
}
}

.mce-flow-layout-item{
margin: 0;
}

.mce-ico{
color: $gray9;
}

p{
margin: 0;
}
strong{
@include bold;
}
sub{
vertical-align: sub !important;
}
sup{
vertical-align: super !important;
}
}

.mce-floatpanel{

.mce-window-head{
height: 5rem;
padding: 0 1rem 0 2rem;
@include display-flex;
@include align-items(center);
.mce-close{
position: relative;
margin-left: auto;
}
}
.mce-btn button{
border: none;
background: none;
text-transform: uppercase;
cursor: pointer;
border-radius: $radius;
@include display-flex;
@include align-items(center);
height: 3rem;
padding: 0 2rem;

span{
@include bold;
font-size: 1.2rem;
}

&:active{
@include transform(scale(0.98));
}
}
}

Expand Down Expand Up @@ -238,6 +339,14 @@
}
}

input.c-file{
opacity: 0;
margin: 0;
height: 0.01rem;
width: 0.01rem;
position: absolute;
}

.c-answer{

.c-checkbox, .c-radio{
Expand Down