Compare commits

..

12 Commits

Author SHA1 Message Date
Dan Brown
0e2bbcec62 Updated version and assets for release v0.27.3 2019-09-03 21:50:12 +01:00
Dan Brown
fdd339f525 Merge branch 'master' into release 2019-09-03 21:49:46 +01:00
Dan Brown
16d8a667b1 Fixed issue preventing FormData posting correctly
- Due to migration from Axios, Instances where we were sending FormData
were not considered and always converted to JSON which resulted in empty
JSON bodies.

Related to #1621
2019-09-03 21:46:46 +01:00
Dan Brown
8cf7d6a83d Updated version and assets for release v0.27.2 2019-09-01 12:12:23 +01:00
Dan Brown
58a5008718 Merge branch 'master' into release 2019-09-01 12:12:10 +01:00
Dan Brown
7a4425473b Fixed URL gen issue causing incorrect scheme to be used
For #1613
2019-09-01 12:07:51 +01:00
Dan Brown
c44a8df55d Updated version and assets for release v0.27.1 2019-09-01 11:13:50 +01:00
Dan Brown
ff1494c519 Merge branch 'master' into release 2019-09-01 11:13:18 +01:00
Dan Brown
f421a2e1d6 Updated pointer button styles so icon not hidden
Related to #1616
2019-09-01 11:06:19 +01:00
Dan Brown
79f1e87cd0 Updated export styles to remove grey bg 2019-09-01 10:55:00 +01:00
Dan Brown
e9d42a2e8c Fixed no md editor preview in FireFox 2019-09-01 10:51:52 +01:00
Dan Brown
712ea21efe Added mailhog to the docker-compose setup 2019-08-31 18:09:40 +01:00
14 changed files with 50 additions and 21 deletions

View File

@@ -25,7 +25,12 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
// Set root URL
URL::forceRootUrl(config('app.url'));
$appUrl = config('app.url');
if ($appUrl) {
$isHttps = (strpos($appUrl, 'https://') === 0);
URL::forceRootUrl($appUrl);
URL::forceScheme($isHttps ? 'https' : 'http');
}
// Custom validation methods
Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {

View File

@@ -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

2
public/dist/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -2567,8 +2567,7 @@ body.mce-fullscreen .page-editor .edit-area {
margin: 0 0 0 -4px;
box-shadow: none; }
.pointer a.button {
margin: 0;
color: #FFF; }
margin: 0; }
.pointer .svg-icon {
width: 1.2em;
height: 1.2em; }
@@ -2759,9 +2758,11 @@ body.mce-fullscreen .page-editor .edit-area {
text-decoration: none;
opacity: 1; }
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; }

View File

@@ -4026,8 +4026,7 @@ body.mce-fullscreen .page-editor .edit-area {
margin: 0 0 0 -4px;
box-shadow: none; }
.pointer a.button {
margin: 0;
color: #FFF; }
margin: 0; }
.pointer .svg-icon {
width: 1.2em;
height: 1.2em; }

View File

@@ -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`.

View File

@@ -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.

View File

@@ -67,7 +67,7 @@ async function dataRequest(method, url, data = null) {
body: data,
};
if (typeof data === 'object') {
if (typeof data === 'object' && !(data instanceof FormData)) {
options.headers = {'Content-Type': 'application/json'};
options.body = JSON.stringify(data);
}

View File

@@ -207,7 +207,6 @@ body.mce-fullscreen .page-editor .edit-area {
}
a.button {
margin: 0;
color: #FFF;
}
.svg-icon {
width: 1.2em;

View File

@@ -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;
}

View File

@@ -28,7 +28,7 @@
<div class="editor-toolbar">
<div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
</div>
<iframe class="markdown-display" sandbox="allow-same-origin"></iframe>
<iframe srcdoc="" class="markdown-display" sandbox="allow-same-origin"></iframe>
</div>
<input type="hidden" name="html"/>

View File

@@ -7,7 +7,7 @@
</div>
@if(userCan('page-update', $page))
<a href="{{ $page->getUrl('/edit') }}" id="pointer-edit" data-edit-href="{{ $page->getUrl('/edit') }}"
class="button outline icon heading-edit-icon ml-s px-s" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit')</a>
class="button primary outline icon heading-edit-icon ml-s px-s" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit')</a>
@endif
</div>
</div>

View File

@@ -22,4 +22,12 @@ class UrlTest extends TestCase
putenv('APP_URL=');
}
public function test_url_helper_sets_correct_scheme_even_when_request_scheme_is_different()
{
putenv('APP_URL=https://example.com/');
$this->refreshApplication();
$this->get('http://example.com/login')->assertSee('https://example.com/dist/styles.css');
putenv('APP_URL=');
}
}

View File

@@ -1 +1 @@
v0.27
v0.27.3