mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-19 03:09:39 +03:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e2bbcec62 | ||
|
|
fdd339f525 | ||
|
|
16d8a667b1 | ||
|
|
8cf7d6a83d | ||
|
|
58a5008718 | ||
|
|
7a4425473b | ||
|
|
c44a8df55d | ||
|
|
ff1494c519 | ||
|
|
f421a2e1d6 | ||
|
|
79f1e87cd0 | ||
|
|
e9d42a2e8c | ||
|
|
712ea21efe |
@@ -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) {
|
||||
|
||||
@@ -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
2
public/dist/app.js
vendored
File diff suppressed because one or more lines are too long
7
public/dist/export-styles.css
vendored
7
public/dist/export-styles.css
vendored
@@ -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; }
|
||||
|
||||
|
||||
3
public/dist/styles.css
vendored
3
public/dist/styles.css
vendored
@@ -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; }
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,6 @@ body.mce-fullscreen .page-editor .edit-area {
|
||||
}
|
||||
a.button {
|
||||
margin: 0;
|
||||
color: #FFF;
|
||||
}
|
||||
.svg-icon {
|
||||
width: 1.2em;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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=');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user