From 712ea21efe8647f42a6f21ef9d0324ad7794dcc2 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 31 Aug 2019 18:09:40 +0100 Subject: [PATCH 1/4] Added mailhog to the docker-compose setup --- docker-compose.yml | 7 +++++++ readme.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 47f38184e..ea7a61ab5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,9 @@ services: DB_DATABASE: bookstack-test DB_USERNAME: bookstack-test DB_PASSWORD: bookstack-test + MAIL_DRIVER: smtp + MAIL_HOST: mailhog + MAIL_PORT: 1025 ports: - ${DEV_PORT:-8080}:80 volumes: @@ -39,3 +42,7 @@ services: volumes: - ./:/app entrypoint: /app/dev/docker/entrypoint.node.sh + mailhog: + image: mailhog/mailhog + ports: + - ${DEV_MAIL_PORT:-8025}:8025 diff --git a/readme.md b/readme.md index 6f0956eb5..2efc6b160 100644 --- a/readme.md +++ b/readme.md @@ -103,6 +103,8 @@ If needed, You'll be able to run any artisan commands via docker-compose like so docker-compose run app php artisan list ``` +The docker-compose setup runs an instance of [MailHog](https://github.com/mailhog/MailHog) and sets environment variables to redirect any BookStack-sent emails to MailHog. You can view this mail via the MailHog web interface on `localhost:8025`. You can change the port MailHog is accessible on by setting a `DEV_MAIL_PORT` environment variable. + ## 🌎 Translations All text strings can be found in the `resources/lang` folder where each language option has its own folder. To add a new language you should copy the `en` folder to an new folder (eg. `fr` for french) then go through and translate all text strings in those files, leaving the keys and file-names intact. If a language string is missing then the `en` translation will be used. To show the language option in the user preferences language drop-down you will need to add your language to the options found at the bottom of the `resources/lang/en/settings.php` file. A system-wide language can also be set in the `.env` file like so: `APP_LANG=en`. From e9d42a2e8cf38e48a0886916862505c928faeb07 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 1 Sep 2019 10:51:52 +0100 Subject: [PATCH 2/4] Fixed no md editor preview in FireFox --- .../assets/js/components/markdown-editor.js | 20 +++++++++++-------- .../views/pages/markdown-editor.blade.php | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/markdown-editor.js b/resources/assets/js/components/markdown-editor.js index 7f3d4ef24..c89a7ad8b 100644 --- a/resources/assets/js/components/markdown-editor.js +++ b/resources/assets/js/components/markdown-editor.js @@ -18,21 +18,18 @@ class MarkdownEditor { this.markdown.use(mdTasksLists, {label: true}); this.display = this.elem.querySelector('.markdown-display'); - this.displayDoc = this.display.contentDocument; + this.displayStylesLoaded = false; this.input = this.elem.querySelector('textarea'); this.htmlInput = this.elem.querySelector('input[name=html]'); this.cm = code.markdownEditor(this.input); this.onMarkdownScroll = this.onMarkdownScroll.bind(this); - this.init(); - // Scroll to text if needed. - const queryParams = (new URL(window.location)).searchParams; - const scrollText = queryParams.get('content-text'); - if (scrollText) { - this.scrollToText(scrollText); - } + this.display.addEventListener('load', () => { + this.displayDoc = this.display.contentDocument; + this.init(); + }); } init() { @@ -94,6 +91,13 @@ class MarkdownEditor { this.codeMirrorSetup(); this.listenForBookStackEditorEvents(); + + // Scroll to text if needed. + const queryParams = (new URL(window.location)).searchParams; + const scrollText = queryParams.get('content-text'); + if (scrollText) { + this.scrollToText(scrollText); + } } // Update the input content and render the display. diff --git a/resources/views/pages/markdown-editor.blade.php b/resources/views/pages/markdown-editor.blade.php index d4f6323b0..e39f39fc2 100644 --- a/resources/views/pages/markdown-editor.blade.php +++ b/resources/views/pages/markdown-editor.blade.php @@ -28,7 +28,7 @@
{{ trans('entities.pages_md_preview') }}
- + From 79f1e87cd0d0f8f0893b58a2695ae535c63d9fd4 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 1 Sep 2019 10:55:00 +0100 Subject: [PATCH 3/4] Updated export styles to remove grey bg --- resources/assets/sass/export-styles.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/assets/sass/export-styles.scss b/resources/assets/sass/export-styles.scss index 4cc782dc0..958b78807 100644 --- a/resources/assets/sass/export-styles.scss +++ b/resources/assets/sass/export-styles.scss @@ -11,9 +11,13 @@ @import "lists"; @import "pages"; + +html, body { + background-color: #FFF; +} + body { font-family: 'DejaVu Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Roboto", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; - background-color: #FFF; margin: 0; padding: 0; } From f421a2e1d66ed7fe0a6cbffd4d2b243c9fc248e7 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 1 Sep 2019 11:06:19 +0100 Subject: [PATCH 4/4] Updated pointer button styles so icon not hidden Related to #1616 --- resources/assets/sass/_pages.scss | 1 - resources/views/pages/pointer.blade.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/assets/sass/_pages.scss b/resources/assets/sass/_pages.scss index 86db8782e..709b1a7ef 100755 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -207,7 +207,6 @@ body.mce-fullscreen .page-editor .edit-area { } a.button { margin: 0; - color: #FFF; } .svg-icon { width: 1.2em; diff --git a/resources/views/pages/pointer.blade.php b/resources/views/pages/pointer.blade.php index d4aca5dda..b4b28eaba 100644 --- a/resources/views/pages/pointer.blade.php +++ b/resources/views/pages/pointer.blade.php @@ -7,7 +7,7 @@ @if(userCan('page-update', $page)) @icon('edit') + class="button primary outline icon heading-edit-icon ml-s px-s" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit') @endif \ No newline at end of file