|
|
@@ -1,5 +1,26 @@
|
|
|
+body:not(.on-edit) {
|
|
|
+ // hide #page-form
|
|
|
+ #page-form {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
body.on-edit {
|
|
|
|
|
|
+ %expand-by-flex {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // calculate margin
|
|
|
+ $header-plus-footer: 2px // .main padding-top
|
|
|
+ + 42px // .nav height
|
|
|
+ + 1px // .page-editor-footer border-top
|
|
|
+ + 40px; // .page-editor-footer min-height
|
|
|
+ $editor-margin: $header-plus-footer + 22px; // .btn-open-dropzone height
|
|
|
+ $editor-margin-sm: $header-plus-footer;
|
|
|
+
|
|
|
// hide unnecessary elements
|
|
|
.navbar.navbar-static-top,
|
|
|
.row.row-alerts,
|
|
|
@@ -29,15 +50,17 @@ body.on-edit {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
+ // show only either Edit button or HackMD button
|
|
|
+ &.hackmd .nav-tab-edit {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ &:not(.hackmd) .nav-tab-hackmd {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
|
|
|
/*****************
|
|
|
* Expand Editor
|
|
|
*****************/
|
|
|
- .expand-by-flex {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
.container-fluid {
|
|
|
padding-bottom: 0;
|
|
|
}
|
|
|
@@ -60,71 +83,8 @@ body.on-edit {
|
|
|
|
|
|
&,
|
|
|
.content-main,
|
|
|
- .tab-content,
|
|
|
- .edit-form,
|
|
|
- .page-form {
|
|
|
- @extend .expand-by-flex;
|
|
|
- }
|
|
|
-
|
|
|
- .page-form {
|
|
|
-
|
|
|
- // calculate margin
|
|
|
- $header-plus-footer: 2px // .main padding-top
|
|
|
- + 42px // .nav height
|
|
|
- + 1px // .page-editor-footer border-top
|
|
|
- + 40px; // .page-editor-footer min-height
|
|
|
- $editor-margin: $header-plus-footer + 22px; // .btn-open-dropzone height
|
|
|
- $editor-margin-sm: $header-plus-footer;
|
|
|
-
|
|
|
- #page-editor {
|
|
|
- // right(preview)
|
|
|
- &,
|
|
|
- .row,
|
|
|
- .page-editor-preview-container,
|
|
|
- .page-editor-preview-body {
|
|
|
- min-height: calc(100vh - #{$header-plus-footer}); // for IE11
|
|
|
- height: calc(100vh - #{$header-plus-footer});
|
|
|
- }
|
|
|
- // left(editor)
|
|
|
- .page-editor-editor-container {
|
|
|
- min-height: calc(100vh - #{$header-plus-footer}); // for IE11
|
|
|
- height: calc(100vh - #{$header-plus-footer});
|
|
|
-
|
|
|
- .react-codemirror2, .CodeMirror, .CodeMirror-scroll,
|
|
|
- .textarea-editor {
|
|
|
- height: calc(100vh - #{$editor-margin});
|
|
|
- // less than smartphone
|
|
|
- @media (max-width: $screen-xs) {
|
|
|
- height: calc(100vh - #{$editor-margin-sm});
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- .page-editor-footer {
|
|
|
- width: 100%;
|
|
|
- margin: 0;
|
|
|
- padding: 3px;
|
|
|
- min-height: 40px;
|
|
|
- border-top: solid 1px transparent;
|
|
|
-
|
|
|
- .btn-submit {
|
|
|
- width: 100px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // slack
|
|
|
- .input-group-slack {
|
|
|
- .input-group-addon {
|
|
|
- padding: 2px 8px;
|
|
|
- line-height: 1em;
|
|
|
- img, input {
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ .tab-content {
|
|
|
+ @extend %expand-by-flex;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -167,198 +127,262 @@ body.on-edit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*****************
|
|
|
- * Editor styles
|
|
|
- *****************/
|
|
|
- .page-editor-editor-container {
|
|
|
- border-right: 1px solid transparent;
|
|
|
- padding-right: 0;
|
|
|
- // override CodeMirror styles
|
|
|
- .CodeMirror {
|
|
|
- .cm-matchhighlight {
|
|
|
- background-color: cyan;
|
|
|
- }
|
|
|
- .CodeMirror-selection-highlight-scrollbar {
|
|
|
- background-color: darkcyan;
|
|
|
+ .page-editor-footer {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0;
|
|
|
+ padding: 3px;
|
|
|
+ min-height: 40px;
|
|
|
+ border-top: solid 1px transparent;
|
|
|
+
|
|
|
+ // slack
|
|
|
+ .input-group-slack {
|
|
|
+ .input-group-addon {
|
|
|
+ padding: 2px 8px;
|
|
|
+ line-height: 1em;
|
|
|
+ img, input {
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .overlay {
|
|
|
- // layout
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- // style
|
|
|
- margin: 0 15px;
|
|
|
- }
|
|
|
- .overlay-content {
|
|
|
- font-size: 2.5em;
|
|
|
- padding: 0.5em;
|
|
|
+ .btn-submit {
|
|
|
+ width: 100px;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- @mixin overlay-processing-style() {
|
|
|
- .overlay {
|
|
|
- background: rgba(255,255,255,0.5);
|
|
|
- }
|
|
|
- .overlay-content {
|
|
|
- padding: 0.3em;
|
|
|
- background: rgba(200,200,200,0.5);
|
|
|
- color: #444;
|
|
|
+
|
|
|
+ &.builtin-editor #edit-form {
|
|
|
+ @extend %expand-by-flex;
|
|
|
+
|
|
|
+ #page-editor {
|
|
|
+ // right(preview)
|
|
|
+ &,
|
|
|
+ .row,
|
|
|
+ .page-editor-preview-container,
|
|
|
+ .page-editor-preview-body {
|
|
|
+ min-height: calc(100vh - #{$header-plus-footer}); // for IE11
|
|
|
+ height: calc(100vh - #{$header-plus-footer});
|
|
|
}
|
|
|
- }
|
|
|
- // add icon on cursor
|
|
|
- .autoformat-markdown-table-activated .CodeMirror-cursor {
|
|
|
- &:after {
|
|
|
- font-family: 'FontAwesome';
|
|
|
- content: '\f0ce';
|
|
|
+ // left(editor)
|
|
|
+ .page-editor-editor-container {
|
|
|
+ min-height: calc(100vh - #{$header-plus-footer}); // for IE11
|
|
|
+ height: calc(100vh - #{$header-plus-footer});
|
|
|
+
|
|
|
+ .react-codemirror2, .CodeMirror, .CodeMirror-scroll,
|
|
|
+ .textarea-editor {
|
|
|
+ height: calc(100vh - #{$editor-margin});
|
|
|
+ // less than smartphone
|
|
|
+ @media (max-width: $screen-xs) {
|
|
|
+ height: calc(100vh - #{$editor-margin-sm});
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // for Dropzone
|
|
|
- .dropzone {
|
|
|
- @mixin insertSimpleLineIcons($code) {
|
|
|
- &:before {
|
|
|
- margin-right: 0.2em;
|
|
|
- font-family: 'simple-line-icons';
|
|
|
- content: $code;
|
|
|
+ /*****************
|
|
|
+ * Editor styles
|
|
|
+ *****************/
|
|
|
+ .page-editor-editor-container {
|
|
|
+ border-right: 1px solid transparent;
|
|
|
+ padding-right: 0;
|
|
|
+ // override CodeMirror styles
|
|
|
+ .CodeMirror {
|
|
|
+ .cm-matchhighlight {
|
|
|
+ background-color: cyan;
|
|
|
+ }
|
|
|
+ .CodeMirror-selection-highlight-scrollbar {
|
|
|
+ background-color: darkcyan;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // unuploadable or rejected
|
|
|
- &.dropzone-unuploadable, &.dropzone-rejected {
|
|
|
+ .overlay {
|
|
|
+ // layout
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ // style
|
|
|
+ margin: 0 15px;
|
|
|
+ }
|
|
|
+ .overlay-content {
|
|
|
+ font-size: 2.5em;
|
|
|
+ padding: 0.5em;
|
|
|
+ }
|
|
|
+
|
|
|
+ @mixin overlay-processing-style() {
|
|
|
.overlay {
|
|
|
- background: rgba(200,200,200,0.8);
|
|
|
+ background: rgba(255,255,255,0.5);
|
|
|
}
|
|
|
.overlay-content {
|
|
|
+ padding: 0.3em;
|
|
|
+ background: rgba(200,200,200,0.5);
|
|
|
color: #444;
|
|
|
}
|
|
|
}
|
|
|
- // uploading
|
|
|
- &.dropzone-uploading {
|
|
|
- @include overlay-processing-style();
|
|
|
+ // add icon on cursor
|
|
|
+ .autoformat-markdown-table-activated .CodeMirror-cursor {
|
|
|
+ &:after {
|
|
|
+ font-family: 'FontAwesome';
|
|
|
+ content: '\f0ce';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // unuploadable
|
|
|
- &.dropzone-unuploadable {
|
|
|
- .overlay-content {
|
|
|
- // insert content
|
|
|
- @include insertSimpleLineIcons("\e617"); // icon-exclamation
|
|
|
- &:after {
|
|
|
- content: "File uploading is disabled";
|
|
|
+ // for Dropzone
|
|
|
+ .dropzone {
|
|
|
+ @mixin insertSimpleLineIcons($code) {
|
|
|
+ &:before {
|
|
|
+ margin-right: 0.2em;
|
|
|
+ font-family: 'simple-line-icons';
|
|
|
+ content: $code;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- // uploadable
|
|
|
- &.dropzone-uploadable {
|
|
|
- // accepted
|
|
|
- &.dropzone-accepted:not(.dropzone-rejected) {
|
|
|
+
|
|
|
+ // unuploadable or rejected
|
|
|
+ &.dropzone-unuploadable, &.dropzone-rejected {
|
|
|
.overlay {
|
|
|
- border: 4px dashed #ccc;
|
|
|
+ background: rgba(200,200,200,0.8);
|
|
|
}
|
|
|
+ .overlay-content {
|
|
|
+ color: #444;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // uploading
|
|
|
+ &.dropzone-uploading {
|
|
|
+ @include overlay-processing-style();
|
|
|
+ }
|
|
|
+
|
|
|
+ // unuploadable
|
|
|
+ &.dropzone-unuploadable {
|
|
|
.overlay-content {
|
|
|
// insert content
|
|
|
- @include insertSimpleLineIcons("\e084"); // icon-cloud-upload
|
|
|
+ @include insertSimpleLineIcons("\e617"); // icon-exclamation
|
|
|
&:after {
|
|
|
- content: "Drop here to upload";
|
|
|
+ content: "File uploading is disabled";
|
|
|
}
|
|
|
- // style
|
|
|
- color: #666;
|
|
|
- background: rgba(200,200,200,0.8);
|
|
|
}
|
|
|
}
|
|
|
- // file type mismatch
|
|
|
- &.dropzone-rejected:not(.dropzone-uploadablefile) .overlay-content {
|
|
|
- // insert content
|
|
|
- @include insertSimpleLineIcons("\e032"); // icon-picture
|
|
|
- &:after {
|
|
|
- content: "Only an image file is allowed";
|
|
|
+ // uploadable
|
|
|
+ &.dropzone-uploadable {
|
|
|
+ // accepted
|
|
|
+ &.dropzone-accepted:not(.dropzone-rejected) {
|
|
|
+ .overlay {
|
|
|
+ border: 4px dashed #ccc;
|
|
|
+ }
|
|
|
+ .overlay-content {
|
|
|
+ // insert content
|
|
|
+ @include insertSimpleLineIcons("\e084"); // icon-cloud-upload
|
|
|
+ &:after {
|
|
|
+ content: "Drop here to upload";
|
|
|
+ }
|
|
|
+ // style
|
|
|
+ color: #666;
|
|
|
+ background: rgba(200,200,200,0.8);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // multiple files
|
|
|
- &.dropzone-accepted.dropzone-rejected .overlay-content {
|
|
|
- // insert content
|
|
|
- @include insertSimpleLineIcons("\e617"); // icon-exclamation
|
|
|
- &:after {
|
|
|
- content: "Only 1 file is allowed";
|
|
|
+ // file type mismatch
|
|
|
+ &.dropzone-rejected:not(.dropzone-uploadablefile) .overlay-content {
|
|
|
+ // insert content
|
|
|
+ @include insertSimpleLineIcons("\e032"); // icon-picture
|
|
|
+ &:after {
|
|
|
+ content: "Only an image file is allowed";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // multiple files
|
|
|
+ &.dropzone-accepted.dropzone-rejected .overlay-content {
|
|
|
+ // insert content
|
|
|
+ @include insertSimpleLineIcons("\e617"); // icon-exclamation
|
|
|
+ &:after {
|
|
|
+ content: "Only 1 file is allowed";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- } // end of.dropzone
|
|
|
+ } // end of.dropzone
|
|
|
|
|
|
- .textarea-editor {
|
|
|
- border: none;
|
|
|
- font-family: monospace;
|
|
|
- }
|
|
|
-
|
|
|
- .loading-keymap {
|
|
|
- @include overlay-processing-style();
|
|
|
- }
|
|
|
+ .textarea-editor {
|
|
|
+ border: none;
|
|
|
+ font-family: monospace;
|
|
|
+ }
|
|
|
|
|
|
- .btn-open-dropzone {
|
|
|
- z-index: 2;
|
|
|
- font-size: small;
|
|
|
- text-align: right;
|
|
|
- padding-top: 3px;
|
|
|
- padding-bottom: 0;
|
|
|
- border: none;
|
|
|
- border-radius: 0;
|
|
|
- border-top: 1px dotted #ccc;
|
|
|
-
|
|
|
- &:active {
|
|
|
- box-shadow: none;
|
|
|
+ .loading-keymap {
|
|
|
+ @include overlay-processing-style();
|
|
|
}
|
|
|
|
|
|
- // hide if screen size is less than smartphone
|
|
|
- @media (max-width: $screen-xs) {
|
|
|
- display: none;
|
|
|
+ .btn-open-dropzone {
|
|
|
+ z-index: 2;
|
|
|
+ font-size: small;
|
|
|
+ text-align: right;
|
|
|
+ padding-top: 3px;
|
|
|
+ padding-bottom: 0;
|
|
|
+ border: none;
|
|
|
+ border-radius: 0;
|
|
|
+ border-top: 1px dotted #ccc;
|
|
|
+
|
|
|
+ &:active {
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ // hide if screen size is less than smartphone
|
|
|
+ @media (max-width: $screen-xs) {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .page-editor-preview-container {
|
|
|
- }
|
|
|
-
|
|
|
- .page-editor-preview-body {
|
|
|
- padding-top: 18px;
|
|
|
- padding-right: 15px;
|
|
|
- overflow-y: scroll;
|
|
|
- }
|
|
|
+ .page-editor-preview-container {
|
|
|
+ }
|
|
|
|
|
|
- #page-editor-options-selector {
|
|
|
- label {
|
|
|
- margin-right: 0.5em;
|
|
|
+ .page-editor-preview-body {
|
|
|
+ padding-top: 18px;
|
|
|
+ padding-right: 15px;
|
|
|
+ overflow-y: scroll;
|
|
|
}
|
|
|
|
|
|
- // configuration dropdown
|
|
|
- .configuration-dropdown {
|
|
|
- .icon-container {
|
|
|
- display: inline-block;
|
|
|
- width: 20px;
|
|
|
+ #page-editor-options-selector {
|
|
|
+ label {
|
|
|
+ margin-right: 0.5em;
|
|
|
}
|
|
|
- .dropdown-menu > li > a {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
|
|
|
- .menuitem-label {
|
|
|
- flex: 1;
|
|
|
- margin-right: 10px;
|
|
|
+ // configuration dropdown
|
|
|
+ .configuration-dropdown {
|
|
|
+ .icon-container {
|
|
|
+ display: inline-block;
|
|
|
+ width: 20px;
|
|
|
+ }
|
|
|
+ .dropdown-menu > li > a {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .menuitem-label {
|
|
|
+ flex: 1;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
|
|
|
- display: none;
|
|
|
+ #page-grant-selector {
|
|
|
+ .btn-group {
|
|
|
+ min-width: 150px;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- #page-grant-selector {
|
|
|
- .btn-group {
|
|
|
- min-width: 150px;
|
|
|
+ } // .builtin-editor #edit-form
|
|
|
+
|
|
|
+
|
|
|
+ &.hackmd #hackmd {
|
|
|
+ @extend %expand-by-flex;
|
|
|
+
|
|
|
+ #hackmd-editor {
|
|
|
+ min-height: calc(100vh - #{$header-plus-footer}); // for IE11
|
|
|
+ height: calc(100vh - #{$header-plus-footer});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+}
|
|
|
|
|
|
-} // }}}
|
|
|
|
|
|
/*
|
|
|
* for creating portal
|