diff --git a/app/app/components/document/document-heading.js b/app/app/components/document/document-heading.js index 3b0d6a1b..cbb4f954 100644 --- a/app/app/components/document/document-heading.js +++ b/app/app/components/document/document-heading.js @@ -17,7 +17,6 @@ const { computed, } = Ember; - export default Ember.Component.extend(NotifierMixin, TooltipMixin, { documentService: Ember.inject.service('document'), editMode: false, diff --git a/app/app/components/document/document-page.js b/app/app/components/document/document-page.js new file mode 100644 index 00000000..589308f8 --- /dev/null +++ b/app/app/components/document/document-page.js @@ -0,0 +1,72 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; +import NotifierMixin from '../../mixins/notifier'; +import TooltipMixin from '../../mixins/tooltip'; + +export default Ember.Component.extend(NotifierMixin, TooltipMixin, { + documentService: Ember.inject.service('document'), + sectionService: Ember.inject.service('section'), + editMode: false, + + actions: { + onAddBlock(block) { + this.attrs.onAddBlock(block); + }, + + onCopyPage(documentId) { + this.attrs.onCopyPage(this.get('page.id'), documentId); + }, + + onMovePage(documentId) { + this.attrs.onMovePage(this.get('page.id'), documentId); + }, + + onDeletePage(deleteChildren) { + let page = this.get('page'); + + if (is.undefined(page)) { + return; + } + + let params = { + id: page.get('id'), + title: page.get('title'), + children: deleteChildren + }; + + this.attrs.onDeletePage(params); + }, + + onEdit() { + if (this.get('editMode')) { + return; + } + + let page = this.get('page'); + + this.get('documentService').getPageMeta(page.get('documentId'), page.get('id')).then((meta) => { + this.set('editMode', true); + this.set('meta', meta); + }); + }, + + onCancelEdit() { + this.set('editMode', false); + }, + + onSavePage(page, meta) { + this.set('editMode', false); + this.attrs.onSavePage(page, meta); + } + } +}); diff --git a/app/app/components/document/document-view.js b/app/app/components/document/document-view.js index 1d50ce2f..d5c08a78 100644 --- a/app/app/components/document/document-view.js +++ b/app/app/components/document/document-view.js @@ -18,10 +18,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { sectionService: Ember.inject.service('section'), appMeta: Ember.inject.service(), link: Ember.inject.service(), - document: null, - folder: null, - folders: [], - isEditor: false, noSections: Ember.computed('pages', function () { return this.get('pages.length') === 0; @@ -97,5 +93,9 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.attrs.onDeletePage(params); }, + + onSavePage(page, meta) { + this.attrs.onSavePage(page, meta); + } } }); diff --git a/app/app/components/document/page-heading.js b/app/app/components/document/page-heading.js index eb4819b4..81396647 100644 --- a/app/app/components/document/page-heading.js +++ b/app/app/components/document/page-heading.js @@ -92,15 +92,16 @@ export default Ember.Component.extend(TooltipMixin, { this.set('menuOpen', !this.get('menuOpen')); }, - editPage(id) { - this.attrs.onEditPage(id); + onEdit() { + this.attrs.onEdit(); }, - deletePage(id) { - this.attrs.onDeletePage(id, this.get('deleteChildren')); + deletePage() { + this.attrs.onDeletePage(this.get('deleteChildren')); }, - onAddBlock(page) { + onAddBlock() { + let page = this.get('page'); let titleElem = '#' + this.get('blockTitleId'); let blockTitle = this.get('blockTitle'); if (is.empty(blockTitle)) { @@ -158,7 +159,7 @@ export default Ember.Component.extend(TooltipMixin, { this.set('selectedDocument', d); }, - onCopyPage(page) { + onCopyPage() { // can't proceed if no data if (this.get('documentList.length') === 0) { return; @@ -169,11 +170,11 @@ export default Ember.Component.extend(TooltipMixin, { targetDocumentId = this.get('selectedDocument.id'); } - this.attrs.onCopyPage(page.get('id'), targetDocumentId); + this.attrs.onCopyPage(targetDocumentId); return true; }, - onMovePage(page) { + onMovePage() { // can't proceed if no data if (this.get('documentListOthers.length') === 0) { return; @@ -185,7 +186,7 @@ export default Ember.Component.extend(TooltipMixin, { let targetDocumentId = this.get('selectedDocument.id'); - this.attrs.onMovePage(page.get('id'), targetDocumentId); + this.attrs.onMovePage(targetDocumentId); return true; } } diff --git a/app/app/components/section/base-editor-inline.js b/app/app/components/section/base-editor-inline.js new file mode 100644 index 00000000..ce968fc1 --- /dev/null +++ b/app/app/components/section/base-editor-inline.js @@ -0,0 +1,103 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + computed, +} = Ember; + + +export default Ember.Component.extend({ + drop: null, + tip: "Short and concise title", + busy: false, + + hasNameError: computed.empty('page.title'), + pageId: Ember.computed('page', function () { + let page = this.get('page'); + return `page-editor-${page.id}`; + }), + + didRender() { + let self = this; + Mousetrap.bind('esc', function () { + self.send('onCancel'); + return false; + }); + Mousetrap.bind(['ctrl+s', 'command+s'], function () { + self.send('onAction'); + return false; + }); + + $('#' + this.get('pageId')).focus(function() { + $(this).select(); + }); + }, + + willDestroyElement() { + let drop = this.get('drop'); + + if (is.not.null(drop)) { + drop.destroy(); + } + }, + + actions: { + onCancel() { + if (this.attrs.isDirty() !== null && this.attrs.isDirty()) { + $(".discard-edits-dialog").css("display", "block"); + + let page = this.get('page'); + + let drop = new Drop({ + target: $("#editor-cancel" + page.get('id'))[0], + content: $(".cancel-edits-dialog-" + page.get('id'))[0], + classes: 'drop-theme-basic', + position: "bottom right", + openOn: "always", + tetherOptions: { + offset: "5px 0", + targetOffset: "10px 0" + }, + remove: false + }); + + this.set('drop', drop); + + return; + } + + this.attrs.onCancel(); + }, + + onAction() { + if (this.get('busy')) { + return; + } + + if (is.empty(this.get('page.title'))) { + return; + } + + this.attrs.onAction(this.get('page.title')); + }, + + keepEditing() { + let drop = this.get('drop'); + drop.close(); + }, + + discardEdits() { + this.attrs.onCancel(); + } + } +}); diff --git a/app/app/components/section/code/type-editor.js b/app/app/components/section/code/type-editor.js index 14fb6f68..dc7e5b78 100644 --- a/app/app/components/section/code/type-editor.js +++ b/app/app/components/section/code/type-editor.js @@ -18,6 +18,14 @@ export default Ember.Component.extend(TooltipMixin, { codeEditor: null, syntaxOptions: [], codeSyntax: null, + editorId: Ember.computed('page', function () { + let page = this.get('page'); + return `code-editor-${page.id}`; + }), + syntaxId: Ember.computed('page', function () { + let page = this.get('page'); + return `code-editor-syntax-${page.id}`; + }), init() { this._super(...arguments); @@ -64,12 +72,8 @@ export default Ember.Component.extend(TooltipMixin, { } }, - didRender() { - this.addTooltip(document.getElementById("set-syntax-zone")); - }, - didInsertElement() { - var editor = CodeMirror.fromTextArea(document.getElementById("code-editor"), { + var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), { theme: "solarized dark", lineNumbers: true, lineWrapping: true, @@ -79,8 +83,6 @@ export default Ember.Component.extend(TooltipMixin, { dragDrop: false }); - editor.setSize("100%", $(document).height() - $(".document-editor > .toolbar").height() - 180); - this.set('codeEditor', editor); let syntax = this.get("codeSyntax"); @@ -92,7 +94,6 @@ export default Ember.Component.extend(TooltipMixin, { }, willDestroyElement() { - this.destroyTooltips(); this.set('codeEditor', null); }, diff --git a/app/app/components/section/markdown/type-editor.js b/app/app/components/section/markdown/type-editor.js index 35f07d85..6728c85d 100644 --- a/app/app/components/section/markdown/type-editor.js +++ b/app/app/components/section/markdown/type-editor.js @@ -11,34 +11,48 @@ import Ember from 'ember'; import miscUtil from '../../../utils/misc'; +import TooltipMixin from '../../../mixins/tooltip'; const { inject: { service } } = Ember; -export default Ember.Component.extend({ +export default Ember.Component.extend(TooltipMixin, { link: service(), editMode: true, isDirty: false, pageBody: "", pagePreview: "", - height: $(document).height() - 450, + editorId: Ember.computed('page', function () { + let page = this.get('page'); + return `markdown-editor-${page.id}`; + }), + previewId: Ember.computed('page', function () { + let page = this.get('page'); + return `markdown-preview-${page.id}`; + }), + tooltipId: Ember.computed('page', function () { + let page = this.get('page'); + return `markdown-tooltip-${page.id}`; + }), didReceiveAttrs() { this.set("pageBody", this.get("meta.rawBody")); }, didInsertElement() { - $("#section-markdown-editor").css("height", this.get('height')); - $("#section-markdown-preview").css("height", this.get('height')); - - $("#section-markdown-editor").off("keyup").on("keyup", () => { + $("#" + this.get('editorId')).off("keyup").on("keyup", () => { this.set('isDirty', true); }); }, + didRender() { + this.addTooltip(document.getElementById(this.get('tooltipId'))); + }, + willDestroyElement() { - $("#section-markdown-editor").off("keyup"); + this.destroyTooltips(); + $("#" + this.get('editorId')).off("keyup"); }, actions: { @@ -47,16 +61,14 @@ export default Ember.Component.extend({ Ember.run.schedule('afterRender', () => { if (this.get('editMode')) { - $("#section-markdown-editor").off("keyup").on("keyup", () => { + $("#" + this.get('editorId')).off("keyup").on("keyup", () => { this.set('isDirty', true); }); - $("#section-markdown-editor").css("height", this.get('height')); } else { let md = window.markdownit({ linkify: true }); let result = md.render(this.get("pageBody")); this.set('pagePreview', result); - $("#section-markdown-preview").css("height", this.get('height')); } }); }, @@ -64,8 +76,8 @@ export default Ember.Component.extend({ onInsertLink(link) { let linkMarkdown = this.get('link').buildLink(link); - miscUtil.insertAtCursor($("#section-markdown-editor")[0], linkMarkdown); - this.set('pageBody', $("#section-markdown-editor").val()); + miscUtil.insertAtCursor($("#" + this.get('editorId'))[0], linkMarkdown); + this.set('pageBody', $("#" + this.get('editorId')).val()); return true; }, diff --git a/app/app/components/section/table/type-editor.js b/app/app/components/section/table/type-editor.js index c81341e8..4e49dc23 100644 --- a/app/app/components/section/table/type-editor.js +++ b/app/app/components/section/table/type-editor.js @@ -14,6 +14,10 @@ import Ember from 'ember'; export default Ember.Component.extend({ isDirty: false, pageBody: "", + editorId: Ember.computed('page', function () { + let page = this.get('page'); + return `table-editor-${page.id}`; + }), defaultTable: '
















', didReceiveAttrs() { @@ -25,23 +29,20 @@ export default Ember.Component.extend({ }, didInsertElement() { - $('#table-editor').froalaEditor({ + let id = '#' + this.get('editorId'); + $(id).froalaEditor({ toolbarButtons: [], - height: $(document).height() - 400, toolbarInline: true, tableResizerOffset: 10 }); - $('#table-editor').on('froalaEditor.contentChanged', () => { + $(id).on('froalaEditor.contentChanged', () => { this.set('isDirty', true); }); }, willDestroyElement() { - $('#table-editor').off('froalaEditor.contentChanged'); - // if ($('#table-editor').data('froala.editor')) { - // $('#table-editor').froalaEditor('destroy'); - // } + $('#' + this.get('editorId')).off('froalaEditor.contentChanged'); }, actions: { @@ -57,7 +58,7 @@ export default Ember.Component.extend({ let page = this.get('page'); let meta = this.get('meta'); - let body = $("#table-editor").froalaEditor('html.get', true); + let body = $('#' + this.get('editorId')).froalaEditor('html.get', true); page.set('title', title); if (is.empty(body)) { diff --git a/app/app/components/section/wysiwyg/type-editor.js b/app/app/components/section/wysiwyg/type-editor.js index a55fb2d7..571ce005 100644 --- a/app/app/components/section/wysiwyg/type-editor.js +++ b/app/app/components/section/wysiwyg/type-editor.js @@ -25,23 +25,22 @@ export default Ember.Component.extend({ }, didInsertElement() { - let maxHeight = $(document).height() - 450; - let options = { - selector: "#rich-text-editor", + selector: "#rich-text-editor-" + this.get('page.id'), relative_urls: false, cache_suffix: "?v=443", browser_spellcheck: false, gecko_spellcheck: false, theme: "modern", + skin: 'charcoal', statusbar: false, - height: maxHeight, + inline: true, entity_encoding: "raw", paste_data_images: true, image_advtab: true, image_caption: true, media_live_embeds: true, - fontsize_formats: "8px 10px 12px 14px 18px 24px 36px 40px 50px 60px", + fontsize_formats: "8px 10px 12px 14px 17px 18px 24px 36px 40px 50px 60px", formats: { bold: { inline: 'b' @@ -59,8 +58,8 @@ export default Ember.Component.extend({ ], menu: {}, menubar: false, - toolbar1: "bold italic underline strikethrough superscript subscript | outdent indent bullist numlist forecolor backcolor | alignleft aligncenter alignright alignjustify | link unlink | table image media codesample", - toolbar2: "formatselect fontselect fontsizeselect", + toolbar1: "formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink", + toolbar2: "outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table image media codesample", save_onsavecallback: function () { Mousetrap.trigger('ctrl+s'); } diff --git a/app/app/pods/document/controller.js b/app/app/pods/document/controller.js index 9ab198d2..e4a7ea02 100644 --- a/app/app/pods/document/controller.js +++ b/app/app/pods/document/controller.js @@ -96,6 +96,25 @@ export default Ember.Controller.extend(NotifierMixin, { }); }, + onSavePage(page, meta) { + let self = this; + let documentId = this.get('model.document.id'); + let model = { + page: page.toJSON({ includeId: true }), + meta: meta.toJSON({ includeId: true }) + }; + + this.get('documentService').updatePage(documentId, page.get('id'), model).then(function () { + self.audit.record("edited-page"); + self.get('documentService').getPages(documentId).then((pages) => { + self.set('model.allPages', pages); + self.set('model.pages', pages.filterBy('pageType', 'section')); + self.set('model.tabs', pages.filterBy('pageType', 'tab')); + }); + + }); + }, + onPageDeleted(deletePage) { let documentId = this.get('model.document.id'); let pages = this.get('model.pages'); diff --git a/app/app/pods/document/template.hbs b/app/app/pods/document/template.hbs index 47844469..b5133e90 100644 --- a/app/app/pods/document/template.hbs +++ b/app/app/pods/document/template.hbs @@ -6,7 +6,6 @@ {{#if model.document.template}}
TEMPLATE
{{/if}} - {{document/tag-editor documentTags=model.document.tags isEditor=model.isEditor onChange=(action 'onTagChange')}} {{#layout/zone-document-sidebar}} {{/layout/zone-document-sidebar}} @@ -66,7 +65,9 @@ {{/link-to}} {{document/document-heading document=model.document isEditor=model.isEditor onSaveDocument=(action 'onSaveDocument')}} - {{document/document-view document=model.document links=model.links allPages=model.allPages tabs=model.tabs pages=model.pages folder=model.folder folders=model.folders isEditor=model.isEditor gotoPage=(action 'gotoPage') onAddBlock=(action 'onAddBlock') onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onPageDeleted')}} + {{document/document-view document=model.document links=model.links allPages=model.allPages tabs=model.tabs pages=model.pages + folder=model.folder folders=model.folders isEditor=model.isEditor onSavePage=(action 'onSavePage') + gotoPage=(action 'gotoPage') onAddBlock=(action 'onAddBlock') onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onPageDeleted')}} diff --git a/app/app/pods/document/index/controller.js b/app/app/pods/document/zindex/controller.js similarity index 100% rename from app/app/pods/document/index/controller.js rename to app/app/pods/document/zindex/controller.js diff --git a/app/app/pods/document/index/route.js b/app/app/pods/document/zindex/route.js similarity index 100% rename from app/app/pods/document/index/route.js rename to app/app/pods/document/zindex/route.js diff --git a/app/app/pods/document/index/template.hbs b/app/app/pods/document/zindex/template.hbs similarity index 100% rename from app/app/pods/document/index/template.hbs rename to app/app/pods/document/zindex/template.hbs diff --git a/app/app/router.js b/app/app/router.js index 2856dbe5..9fff32c0 100644 --- a/app/app/router.js +++ b/app/app/router.js @@ -41,9 +41,9 @@ export default Router.map(function () { this.route('section', { path: 'section/:page_id' }); - this.route('edit', { - path: 'edit/:page_id' - }); + // this.route('edit', { + // path: 'edit/:page_id' + // }); this.route('wizard', { path: 'add' }); diff --git a/app/app/styles/app.scss b/app/app/styles/app.scss index 00fda878..d3335e60 100644 --- a/app/app/styles/app.scss +++ b/app/app/styles/app.scss @@ -32,3 +32,4 @@ @import "section/table.scss"; @import "section/code.scss"; @import "section/papertrail.scss"; +@import "section/wysiwyg.scss"; diff --git a/app/app/styles/section/code.scss b/app/app/styles/section/code.scss index 62d6d87f..46eb43c6 100644 --- a/app/app/styles/section/code.scss +++ b/app/app/styles/section/code.scss @@ -1,3 +1,13 @@ +.section-code-editor { + margin-top: 6px; + + > .syntax-selector { + position: absolute; + top: 24px; + right: 90px; + } +} + /* BASICS */ .CodeMirror { /* Set height, width, borders, and global font properties here */ diff --git a/app/app/styles/section/markdown.scss b/app/app/styles/section/markdown.scss index 19e0cb48..c2ef35f8 100644 --- a/app/app/styles/section/markdown.scss +++ b/app/app/styles/section/markdown.scss @@ -1,13 +1,15 @@ -#section-markdown-editor { +.section-markdown-editor, .section-markdown-preview { width: 100%; - resize: none; - padding: 10px; - background-color: white; + margin: 0; + padding: 0; + @extend .no-outline; + margin-top: -10px; + border: none; + @extend .no-outline; } -#section-markdown-preview { - width: 100%; - padding: 10px; - background-color: white; - overflow: auto; +.section-markdown-preview-button { + position: absolute; + top: 18px; + right: 118px; } diff --git a/app/app/styles/section/table.scss b/app/app/styles/section/table.scss index 8bd2c2d7..00b68d88 100644 --- a/app/app/styles/section/table.scss +++ b/app/app/styles/section/table.scss @@ -1,3 +1,7 @@ +.table-editor-wrapper { + margin-top: 7px; +} + .fr-element, .fr-element:focus { outline: 0px solid transparent; @@ -1165,12 +1169,12 @@ table th.fr-selected-cell { * Video style */ } -.fr-view table { - border: none; - border-collapse: collapse; - empty-cells: show; - max-width: 100%; -} +// .fr-view table { +// border: none; +// border-collapse: collapse; +// empty-cells: show; +// max-width: 100%; +// } .fr-view table.fr-dashed-borders td, .fr-view table.fr-dashed-borders th { border-style: dashed; @@ -1178,25 +1182,25 @@ table th.fr-selected-cell { .fr-view table.fr-alternate-rows tbody tr:nth-child(2n) { background: #f5f5f5; } -.fr-view table td, -.fr-view table th { - border: 1px solid #dddddd; -} -.fr-view table td:empty, -.fr-view table th:empty { - height: 20px; -} -.fr-view table td.fr-highlighted, -.fr-view table th.fr-highlighted { - border: 1px double red; -} -.fr-view table td.fr-thick, -.fr-view table th.fr-thick { - border-width: 2px; -} -.fr-view table th { - background: #e6e6e6; -} +// .fr-view table td, +// .fr-view table th { +// border: 1px solid #dddddd; +// } +// .fr-view table td:empty, +// .fr-view table th:empty { +// height: 20px; +// } +// .fr-view table td.fr-highlighted, +// .fr-view table th.fr-highlighted { +// border: 1px double red; +// } +// .fr-view table td.fr-thick, +// .fr-view table th.fr-thick { +// border-width: 2px; +// } +// .fr-view table th { +// background: #e6e6e6; +// } .fr-view hr { clear: both; user-select: none; diff --git a/app/app/styles/section/wysiwyg.scss b/app/app/styles/section/wysiwyg.scss new file mode 100644 index 00000000..f37bfe9f --- /dev/null +++ b/app/app/styles/section/wysiwyg.scss @@ -0,0 +1,6 @@ +.wysiwyg-editor { + @extend .no-outline; + font-family: Helvetica,Arial,Verdana,sans-serif; + margin-top: -10px; + color: $color-black; +} diff --git a/app/app/styles/view/document/content.scss b/app/app/styles/view/document/content.scss index abfc14a9..17d95686 100644 --- a/app/app/styles/view/document/content.scss +++ b/app/app/styles/view/document/content.scss @@ -55,32 +55,28 @@ } .document-view { - > .pages { - margin: 30px 0 50px; + margin: 30px 0 50px; + + .is-a-page { + @extend .transition-all; + @include border-radius(2px); + @include ease-in(); + padding: 50px; + box-shadow: 0 0 0 0.75pt $color-stroke,0 0 3pt 0.75pt $color-stroke; + margin: 30px 0; + background-color: $color-white; - > .wysiwyg { - > .is-a-page { - @extend .transition-all; - @include border-radius(2px); - @include ease-in(); - padding: 50px; - box-shadow: 0 0 0 0.75pt $color-stroke,0 0 3pt 0.75pt $color-stroke; - margin: 30px 0; - background-color: $color-white; - - &:hover { - .page-title { - > .page-toolbar { - opacity: 1; - } - } + &:hover { + .page-title { + > .page-toolbar { + opacity: 1; } + } + } - .page-title { - > .page-toolbar { - opacity: 0; - } - } + .page-title { + > .page-toolbar { + opacity: 0; } } } diff --git a/app/app/styles/view/document/edit-tools.scss b/app/app/styles/view/document/edit-tools.scss index 708a6c14..98cba9a6 100644 --- a/app/app/styles/view/document/edit-tools.scss +++ b/app/app/styles/view/document/edit-tools.scss @@ -1,16 +1,7 @@ .edit-tools { - margin: 0 0 0 20px; - min-height: 600px; - - > .toolbar { - margin: 0; - padding: 0; - - > .item { - list-style-type: none; - margin: 0 0 20px; - } - } + position: absolute; + top: 18px; + right: 78px; } .content-counter-dialog { @@ -20,7 +11,7 @@ .content-linker-dialog { width: 350px; - height: 500px; + height: 350px; overflow-y: auto; .link-list { diff --git a/app/app/styles/view/document/editor.scss b/app/app/styles/view/document/editor.scss index 601cc3e5..da9ea604 100644 --- a/app/app/styles/view/document/editor.scss +++ b/app/app/styles/view/document/editor.scss @@ -1,27 +1,28 @@ .document-editor { + position: relative; + > .toolbar { width: 100%; padding: 0; - > .title { - width: 50%; + > .edit-title { + width: 70%; - > .input-control { - margin: 0; - - > input { - margin: 0 0 5px; - } + > input { + font-weight: bold; + font-size: 1.5rem; + margin: 17px 0 0 0; + color: $color-wysiwyg; } } > .buttons { - margin-top: 10px; + margin-top: 17px; } } > .canvas { - padding: 40px 0; + padding: 0; } .cancel-edits-dialog { diff --git a/app/app/styles/view/document/wysiwyg.scss b/app/app/styles/view/document/wysiwyg.scss index 2fc7ef4d..e90cad3e 100644 --- a/app/app/styles/view/document/wysiwyg.scss +++ b/app/app/styles/view/document/wysiwyg.scss @@ -21,11 +21,13 @@ ul { margin: 15px 0; padding: 0 0 0 40px; + line-height: 20px; } ul { li { list-style-type: disc; + line-height: 20px; } } diff --git a/app/app/styles/widget/widget-dropdown.scss b/app/app/styles/widget/widget-dropdown.scss index fd810795..6210fbf6 100644 --- a/app/app/styles/widget/widget-dropdown.scss +++ b/app/app/styles/widget/widget-dropdown.scss @@ -81,7 +81,7 @@ &:hover { color: $color-link; - font-weight: bold; + // font-weight: bold; } a, a:visited { @@ -92,7 +92,7 @@ &:hover { color: $color-link; - font-weight: bold; + // font-weight: bold; } } } @@ -106,7 +106,7 @@ &:hover { color: $color-red; - font-weight: bold; + // font-weight: bold; } } diff --git a/app/app/templates/components/document/document-heading.hbs b/app/app/templates/components/document/document-heading.hbs index b4818fef..6daf8bc3 100644 --- a/app/app/templates/components/document/document-heading.hbs +++ b/app/app/templates/components/document/document-heading.hbs @@ -14,7 +14,6 @@
check
-
close
diff --git a/app/app/templates/components/document/document-page.hbs b/app/app/templates/components/document/document-page.hbs new file mode 100644 index 00000000..8b101391 --- /dev/null +++ b/app/app/templates/components/document/document-page.hbs @@ -0,0 +1,10 @@ +
+ {{#unless editMode}} + {{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor + onEdit=(action 'onEdit') + onAddBlock=(action 'onAddBlock') onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{section/base-renderer page=page}} + {{else}} + {{document/document-editor document=document folder=folder page=page meta=meta onCancel=(action 'onCancelEdit') onAction=(action 'onSavePage')}} + {{/unless}} +
diff --git a/app/app/templates/components/document/document-view.hbs b/app/app/templates/components/document/document-view.hbs index 0fcf6f40..506056d4 100644 --- a/app/app/templates/components/document/document-view.hbs +++ b/app/app/templates/components/document/document-view.hbs @@ -1,15 +1,9 @@
-
- {{#each pages key="id" as |page index|}} -
-
- {{document/page-heading tagName=page.tagName document=document folder=folder page=page isEditor=isEditor - onAddBlock=(action 'onAddBlock') onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} - {{section/base-renderer page=page}} -
-
- {{/each}} -
+ {{#each pages key="id" as |page index|}} + {{#document/document-page document=document folder=folder page=page isEditor=isEditor onSavePage=(action 'onSavePage') + onAddBlock=(action 'onAddBlock') onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{/document/document-page}} + {{/each}}
{{#if noSections}} diff --git a/app/app/templates/components/document/edit-tools.hbs b/app/app/templates/components/document/edit-tools.hbs index 86b977a5..0b596edc 100644 --- a/app/app/templates/components/document/edit-tools.hbs +++ b/app/app/templates/components/document/edit-tools.hbs @@ -1,8 +1,8 @@
  • -
    - link +
    + link
diff --git a/app/app/templates/components/document/page-heading.hbs b/app/app/templates/components/document/page-heading.hbs index 57e75239..50066659 100644 --- a/app/app/templates/components/document/page-heading.hbs +++ b/app/app/templates/components/document/page-heading.hbs @@ -2,13 +2,10 @@ {{ page.title }}