diff --git a/.env.example b/.env.example index 5661cda22..e44a46ef3 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,10 @@ APP_ENV=production APP_DEBUG=false APP_KEY=SomeRandomString +# The below url has to be set if using social auth options +# or if you are not using BookStack at the root path of your domain. +# APP_URL=http://bookstack.dev + # Database details DB_HOST=localhost DB_DATABASE=database_database @@ -42,8 +46,6 @@ GITHUB_APP_ID=false GITHUB_APP_SECRET=false GOOGLE_APP_ID=false GOOGLE_APP_SECRET=false -# URL used for social login redirects, NO TRAILING SLASH -APP_URL=http://bookstack.dev # External services such as Gravatar DISABLE_EXTERNAL_SERVICES=false diff --git a/app/Book.php b/app/Book.php index af6d59bfd..aa2dee9c0 100644 --- a/app/Book.php +++ b/app/Book.php @@ -7,10 +7,14 @@ class Book extends Entity /** * Get the url for this book. + * @param string|bool $path * @return string */ - public function getUrl() + public function getUrl($path = false) { + if ($path !== false) { + return baseUrl('/books/' . $this->slug . '/' . trim($path, '/')); + } return baseUrl('/books/' . $this->slug); } diff --git a/app/Chapter.php b/app/Chapter.php index 250e323f5..8f0453172 100644 --- a/app/Chapter.php +++ b/app/Chapter.php @@ -25,11 +25,15 @@ class Chapter extends Entity /** * Get the url of this chapter. + * @param string|bool $path * @return string */ - public function getUrl() + public function getUrl($path = false) { $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug; + if ($path !== false) { + return baseUrl('/books/' . $bookSlug. '/chapter/' . $this->slug . '/' . trim($path, '/')); + } return baseUrl('/books/' . $bookSlug. '/chapter/' . $this->slug); } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 14d553ed0..40dd1ec10 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -48,8 +48,8 @@ class Handler extends ExceptionHandler // Handle notify exceptions which will redirect to the // specified location then show a notification message. if ($e instanceof NotifyException) { - \Session::flash('error', $e->message); - return response()->redirectTo($e->redirectLocation); + session()->flash('error', $e->message); + return redirect($e->redirectLocation); } // Handle pretty exceptions which will show a friendly application-fitting page diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index beb191d62..2cbc047ce 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -1,9 +1,6 @@ -socialAuthService = $socialAuthService; $this->emailConfirmationService = $emailConfirmationService; $this->userRepo = $userRepo; + $this->redirectPath = baseUrl('/'); + $this->redirectAfterLogout = baseUrl('/login'); $this->username = config('auth.method') === 'standard' ? 'email' : 'username'; parent::__construct(); } diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index f35834e62..1509ace95 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -412,7 +412,7 @@ class PageController extends Controller */ public function showRecentlyCreated() { - $pages = $this->pageRepo->getRecentlyCreatedPaginated(20); + $pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created')); return view('pages/detailed-listing', [ 'title' => 'Recently Created Pages', 'pages' => $pages @@ -425,7 +425,7 @@ class PageController extends Controller */ public function showRecentlyUpdated() { - $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20); + $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated')); return view('pages/detailed-listing', [ 'title' => 'Recently Updated Pages', 'pages' => $pages diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 599f40c84..ee5144e6c 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -33,7 +33,7 @@ class Authenticate public function handle($request, Closure $next) { if ($this->auth->check() && setting('registration-confirmation') && !$this->auth->user()->email_confirmed) { - return redirect()->guest('/register/confirm/awaiting'); + return redirect()->guest(baseUrl('/register/confirm/awaiting')); } if ($this->auth->guest() && !setting('app-public')) { diff --git a/app/Page.php b/app/Page.php index 5902f4f5a..1961a4f7f 100644 --- a/app/Page.php +++ b/app/Page.php @@ -56,13 +56,19 @@ class Page extends Entity /** * Get the url for this page. + * @param string|bool $path * @return string */ - public function getUrl() + public function getUrl($path = false) { $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug; $midText = $this->draft ? '/draft/' : '/page/'; $idComponent = $this->draft ? $this->id : $this->slug; + + if ($path !== false) { + return baseUrl('/books/' . $bookSlug . $midText . $idComponent . '/' . trim($path, '/')); + } + return baseUrl('/books/' . $bookSlug . $midText . $idComponent); } diff --git a/app/Providers/PaginationServiceProvider.php b/app/Providers/PaginationServiceProvider.php new file mode 100644 index 000000000..a0e97f70d --- /dev/null +++ b/app/Providers/PaginationServiceProvider.php @@ -0,0 +1,30 @@ +app['request']->path()); + }); + + Paginator::currentPageResolver(function ($pageName = 'page') { + $page = $this->app['request']->input($pageName); + + if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { + return $page; + } + + return 1; + }); + } +} \ No newline at end of file diff --git a/app/Repos/ImageRepo.php b/app/Repos/ImageRepo.php index 916ebd3e1..435b8bbd7 100644 --- a/app/Repos/ImageRepo.php +++ b/app/Repos/ImageRepo.php @@ -13,7 +13,7 @@ class ImageRepo protected $image; protected $imageService; - protected $restictionService; + protected $restrictionService; protected $page; /** @@ -27,7 +27,7 @@ class ImageRepo { $this->image = $image; $this->imageService = $imageService; - $this->restictionService = $permissionService; + $this->restrictionService = $permissionService; $this->page = $page; } @@ -52,7 +52,7 @@ class ImageRepo */ private function returnPaginated($query, $page = 0, $pageSize = 24) { - $images = $this->restictionService->filterRelatedPages($query, 'images', 'uploaded_to'); + $images = $this->restrictionService->filterRelatedPages($query, 'images', 'uploaded_to'); $images = $images->orderBy('created_at', 'desc')->skip($pageSize * $page)->take($pageSize + 1)->get(); $hasMore = count($images) > $pageSize; diff --git a/app/Services/ImageService.php b/app/Services/ImageService.php index dd965c90f..d9bd61e9f 100644 --- a/app/Services/ImageService.php +++ b/app/Services/ImageService.php @@ -265,7 +265,7 @@ class ImageService $this->storageUrl = $storageUrl; } - return ($this->storageUrl == false ? '' : rtrim($this->storageUrl, '/')) . $filePath; + return ($this->storageUrl == false ? rtrim(baseUrl(''), '/') : rtrim($this->storageUrl, '/')) . $filePath; } diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index ba3479349..4b99df789 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -113,20 +113,20 @@ class SocialAuthService if ($isLoggedIn && $socialAccount === null) { $this->fillSocialAccount($socialDriver, $socialUser); $currentUser->socialAccounts()->save($this->socialAccount); - \Session::flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.'); + session()->flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.'); return redirect($currentUser->getEditUrl()); } // When a user is logged in and the social account exists and is already linked to the current user. if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) { - \Session::flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.'); + session()->flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.'); return redirect($currentUser->getEditUrl()); } // When a user is logged in, A social account exists but the users do not match. // Change the user that the social account is assigned to. if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) { - \Session::flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.'); + session()->flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.'); return redirect($currentUser->getEditUrl()); } @@ -135,6 +135,7 @@ class SocialAuthService if (setting('registration-enabled')) { $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option'; } + throw new SocialSignInException($message . '.', '/login'); } diff --git a/app/User.php b/app/User.php index 6ab7ad3bf..32449971d 100644 --- a/app/User.php +++ b/app/User.php @@ -160,6 +160,15 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon return baseUrl('/settings/users/' . $this->id); } + /** + * Get the url that links to this user's profile. + * @return mixed + */ + public function getProfileUrl() + { + return baseUrl('/user/' . $this->id); + } + /** * Get a shortened version of the user's name. * @param int $chars diff --git a/app/helpers.php b/app/helpers.php index 0b9a6afc6..541f23fbe 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -69,10 +69,33 @@ function setting($key, $default = false) */ function baseUrl($path) { + if (strpos($path, 'http') === 0) return $path; $path = trim($path, '/'); return rtrim(config('app.url'), '/') . '/' . $path; } +/** + * Get an instance of the redirector. + * Overrides the default laravel redirect helper. + * Ensures it redirects even when the app is in a subdirectory. + * + * @param string|null $to + * @param int $status + * @param array $headers + * @param bool $secure + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse + */ +function redirect($to = null, $status = 302, $headers = [], $secure = null) +{ + if (is_null($to)) { + return app('redirect'); + } + + $to = baseUrl($to); + + return app('redirect')->to($to, $status, $headers, $secure); +} + /** * Generate a url with multiple parameters for sorting purposes. * Works out the logic to set the correct sorting direction @@ -102,5 +125,5 @@ function sortUrl($path, $data, $overrideData = []) if (count($queryStringSections) === 0) return $path; - return $path . '?' . implode('&', $queryStringSections); + return baseUrl($path . '?' . implode('&', $queryStringSections)); } \ No newline at end of file diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 383013796..29f66ace4 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,6 +14,7 @@ define('LARAVEL_START', microtime(true)); | */ +require __DIR__.'/../app/helpers.php'; require __DIR__.'/../vendor/autoload.php'; /* diff --git a/composer.json b/composer.json index 8f375a279..5c77a68c4 100644 --- a/composer.json +++ b/composer.json @@ -29,10 +29,7 @@ ], "psr-4": { "BookStack\\": "app/" - }, - "files": [ - "app/helpers.php" - ] + } }, "autoload-dev": { "classmap": [ diff --git a/config/app.php b/config/app.php index 6819fa481..0d6f6f2b0 100644 --- a/config/app.php +++ b/config/app.php @@ -130,7 +130,6 @@ return [ Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, Illuminate\Mail\MailServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class, @@ -153,6 +152,8 @@ return [ /* * Application Service Providers... */ + BookStack\Providers\PaginationServiceProvider::class, + BookStack\Providers\AuthServiceProvider::class, BookStack\Providers\AppServiceProvider::class, BookStack\Providers\EventServiceProvider::class, diff --git a/config/setting-defaults.php b/config/setting-defaults.php index 6a55a0dc3..24a49c364 100644 --- a/config/setting-defaults.php +++ b/config/setting-defaults.php @@ -5,8 +5,9 @@ */ return [ - 'app-editor' => 'wysiwyg', - 'app-color' => '#0288D1', + 'app-name' => 'BookStack', + 'app-editor' => 'wysiwyg', + 'app-color' => '#0288D1', 'app-color-light' => 'rgba(21, 101, 192, 0.15)' ]; \ No newline at end of file diff --git a/readme.md b/readme.md index 29ac44f5e..3a745beb1 100644 --- a/readme.md +++ b/readme.md @@ -50,3 +50,4 @@ These are the great projects used to help build BookStack: * [ZeroClipboard](http://zeroclipboard.org/) * [TinyColorPicker](http://www.dematte.at/tinyColorPicker/index.html) * [Marked](https://github.com/chjj/marked) +* [Moment.js](http://momentjs.com/) diff --git a/resources/assets/js/controllers.js b/resources/assets/js/controllers.js index 406fd7e77..9067f6ca4 100644 --- a/resources/assets/js/controllers.js +++ b/resources/assets/js/controllers.js @@ -1,6 +1,6 @@ "use strict"; -var moment = require('moment'); +const moment = require('moment'); module.exports = function (ngApp, events) { @@ -35,7 +35,7 @@ module.exports = function (ngApp, events) { * @returns {string} */ $scope.getUploadUrl = function () { - return '/images/' + $scope.imageType + '/upload'; + return window.baseUrl('/images/' + $scope.imageType + '/upload'); }; /** @@ -133,7 +133,7 @@ module.exports = function (ngApp, events) { $scope.showing = false; }; - var baseUrl = '/images/' + $scope.imageType + '/all/' + var baseUrl = window.baseUrl('/images/' + $scope.imageType + '/all/'); /** * Fetch the list image data from the server. @@ -178,7 +178,7 @@ module.exports = function (ngApp, events) { $scope.images = []; $scope.hasMore = false; page = 0; - baseUrl = '/images/' + $scope.imageType + '/search/'; + baseUrl = window.baseUrl('/images/' + $scope.imageType + '/search/'); fetchData(); }; @@ -192,7 +192,7 @@ module.exports = function (ngApp, events) { $scope.hasMore = false; page = 0; $scope.view = viewName; - baseUrl = '/images/' + $scope.imageType + '/' + viewName + '/'; + baseUrl = window.baseUrl('/images/' + $scope.imageType + '/' + viewName + '/'); fetchData(); } @@ -202,7 +202,7 @@ module.exports = function (ngApp, events) { */ $scope.saveImageDetails = function (event) { event.preventDefault(); - var url = '/images/update/' + $scope.selectedImage.id; + var url = window.baseUrl('/images/update/' + $scope.selectedImage.id); $http.put(url, this.selectedImage).then((response) => { events.emit('success', 'Image details updated'); }, (response) => { @@ -228,7 +228,7 @@ module.exports = function (ngApp, events) { $scope.deleteImage = function (event) { event.preventDefault(); var force = $scope.dependantPages !== false; - var url = '/images/' + $scope.selectedImage.id; + var url = window.baseUrl('/images/' + $scope.selectedImage.id); if (force) url += '?force=true'; $http.delete(url).then((response) => { $scope.images.splice($scope.images.indexOf($scope.selectedImage), 1); @@ -267,7 +267,7 @@ module.exports = function (ngApp, events) { if (term.length == 0) return; $scope.searching = true; $scope.searchResults = ''; - var searchUrl = '/search/book/' + $attrs.bookId; + var searchUrl = window.baseUrl('/search/book/' + $attrs.bookId); searchUrl += '?term=' + encodeURIComponent(term); $http.get(searchUrl).then((response) => { $scope.searchResults = $sce.trustAsHtml(response.data); @@ -368,7 +368,8 @@ module.exports = function (ngApp, events) { if (isMarkdown) data.markdown = $scope.editContent; - $http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => { + let url = window.baseUrl('/ajax/page/' + pageId + '/save-draft'); + $http.put(url, data).then((responseData) => { var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate(); $scope.draftText = responseData.data.message + moment(updateTime).format('HH:mm'); if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true; @@ -393,7 +394,8 @@ module.exports = function (ngApp, events) { * content from the system via an AJAX request. */ $scope.discardDraft = function () { - $http.get('/ajax/page/' + pageId).then((responseData) => { + let url = window.baseUrl('/ajax/page/' + pageId); + $http.get(url).then((responseData) => { if (autoSave) $interval.cancel(autoSave); $scope.draftText = 'Editing Page'; $scope.isUpdateDraft = false; @@ -437,7 +439,8 @@ module.exports = function (ngApp, events) { * Get all tags for the current book and add into scope. */ function getTags() { - $http.get('/ajax/tags/get/page/' + pageId).then((responseData) => { + let url = window.baseUrl('/ajax/tags/get/page/' + pageId); + $http.get(url).then((responseData) => { $scope.tags = responseData.data; addEmptyTag(); }); @@ -486,7 +489,8 @@ module.exports = function (ngApp, events) { $scope.saveTags = function() { setTagOrder(); let postData = {tags: $scope.tags}; - $http.post('/ajax/tags/update/page/' + pageId, postData).then((responseData) => { + let url = window.baseUrl('/ajax/tags/update/page/' + pageId); + $http.post(url, postData).then((responseData) => { $scope.tags = responseData.data.tags; addEmptyTag(); events.emit('success', responseData.data.message); diff --git a/resources/assets/js/directives.js b/resources/assets/js/directives.js index 8554da9f8..897707af5 100644 --- a/resources/assets/js/directives.js +++ b/resources/assets/js/directives.js @@ -1,10 +1,10 @@ "use strict"; -var DropZone = require('dropzone'); -var markdown = require('marked'); +const DropZone = require('dropzone'); +const markdown = require('marked'); -var toggleSwitchTemplate = require('./components/toggle-switch.html'); -var imagePickerTemplate = require('./components/image-picker.html'); -var dropZoneTemplate = require('./components/drop-zone.html'); +const toggleSwitchTemplate = require('./components/toggle-switch.html'); +const imagePickerTemplate = require('./components/image-picker.html'); +const dropZoneTemplate = require('./components/drop-zone.html'); module.exports = function (ngApp, events) { @@ -54,7 +54,7 @@ module.exports = function (ngApp, events) { imageClass: '@' }, link: function (scope, element, attrs) { - var usingIds = typeof scope.currentId !== 'undefined' || scope.currentId === 'false'; + let usingIds = typeof scope.currentId !== 'undefined' || scope.currentId === 'false'; scope.image = scope.currentImage; scope.value = scope.currentImage || ''; if (usingIds) scope.value = scope.currentId; @@ -80,7 +80,7 @@ module.exports = function (ngApp, events) { }; scope.updateImageFromModel = function (model) { - var isResized = scope.resizeWidth && scope.resizeHeight; + let isResized = scope.resizeWidth && scope.resizeHeight; if (!isResized) { scope.$apply(() => { @@ -89,8 +89,9 @@ module.exports = function (ngApp, events) { return; } - var cropped = scope.resizeCrop ? 'true' : 'false'; - var requestString = '/images/thumb/' + model.id + '/' + scope.resizeWidth + '/' + scope.resizeHeight + '/' + cropped; + let cropped = scope.resizeCrop ? 'true' : 'false'; + let requestString = '/images/thumb/' + model.id + '/' + scope.resizeWidth + '/' + scope.resizeHeight + '/' + cropped; + requestString = window.baseUrl(requestString); $http.get(requestString).then((response) => { setImage(model, response.data.url); }); @@ -332,9 +333,9 @@ module.exports = function (ngApp, events) { // Insert image shortcut if (event.which === 73 && event.ctrlKey && event.shiftKey) { event.preventDefault(); - var caretPos = input[0].selectionStart; - var currentContent = input.val(); - var mdImageText = "![](http://)"; + let caretPos = input[0].selectionStart; + let currentContent = input.val(); + const mdImageText = "![](http://)"; input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos)); input.focus(); input[0].selectionStart = caretPos + ("![](".length); @@ -348,9 +349,9 @@ module.exports = function (ngApp, events) { // Insert image from image manager insertImage.click(event => { window.ImageManager.showExternal(image => { - var caretPos = currentCaretPos; - var currentContent = input.val(); - var mdImageText = "![" + image.name + "](" + image.url + ")"; + let caretPos = currentCaretPos; + let currentContent = input.val(); + let mdImageText = "![" + image.name + "](" + image.url + ")"; input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos)); input.change(); }); @@ -624,7 +625,7 @@ module.exports = function (ngApp, events) { // Get search url with correct types function getSearchUrl() { let types = (attrs.entityTypes) ? encodeURIComponent(attrs.entityTypes) : encodeURIComponent('page,book,chapter'); - return `/ajax/search/entities?types=${types}`; + return window.baseUrl(`/ajax/search/entities?types=${types}`); } // Get initial contents diff --git a/resources/assets/js/global.js b/resources/assets/js/global.js index 44562abd0..1c300ad26 100644 --- a/resources/assets/js/global.js +++ b/resources/assets/js/global.js @@ -7,6 +7,14 @@ var ngAnimate = require('angular-animate'); var ngSanitize = require('angular-sanitize'); require('angular-ui-sortable'); +// Url retrieval function +window.baseUrl = function(path) { + let basePath = document.querySelector('meta[name="base-url"]').getAttribute('content'); + if (basePath[basePath.length-1] === '/') basePath = basePath.slice(0, basePath.length-1); + if (path[0] === '/') path = path.slice(1); + return basePath + '/' + path; +}; + var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']); // Global Event System @@ -29,6 +37,7 @@ var Events = { }; window.Events = Events; + var services = require('./services')(ngApp, Events); var directives = require('./directives')(ngApp, Events); var controllers = require('./controllers')(ngApp, Events); diff --git a/resources/assets/js/pages/page-form.js b/resources/assets/js/pages/page-form.js index 611d2e782..f8b314e9c 100644 --- a/resources/assets/js/pages/page-form.js +++ b/resources/assets/js/pages/page-form.js @@ -1,8 +1,8 @@ var mceOptions = module.exports = { selector: '#html-editor', content_css: [ - '/css/styles.css', - '/libs/material-design-iconic-font/css/material-design-iconic-font.min.css' + window.baseUrl('/css/styles.css'), + window.baseUrl('/libs/material-design-iconic-font/css/material-design-iconic-font.min.css') ], body_class: 'page-content', relative_urls: false, @@ -148,7 +148,7 @@ var mceOptions = module.exports = { formData.append('file', file, remoteFilename); formData.append('_token', document.querySelector('meta[name="token"]').getAttribute('content')); - xhr.open('POST', '/images/gallery/upload'); + xhr.open('POST', window.baseUrl('/images/gallery/upload')); xhr.onload = function () { if (xhr.status === 200 || xhr.status === 201) { var result = JSON.parse(xhr.responseText); diff --git a/resources/assets/js/pages/page-show.js b/resources/assets/js/pages/page-show.js index b037612be..41b92453f 100644 --- a/resources/assets/js/pages/page-show.js +++ b/resources/assets/js/pages/page-show.js @@ -2,7 +2,7 @@ // Configure ZeroClipboard var zeroClipBoard = require('zeroclipboard'); zeroClipBoard.config({ - swfPath: '/ZeroClipboard.swf' + swfPath: window.baseUrl('/ZeroClipboard.swf') }); window.setupPageShow = module.exports = function (pageId) { @@ -36,7 +36,8 @@ window.setupPageShow = module.exports = function (pageId) { // Show pointer and set link var $elem = $(this); - var link = window.location.protocol + "//" + window.location.host + '/link/' + pageId + '#' + $elem.attr('id'); + let link = window.baseUrl('/link/' + pageId + '#' + $elem.attr('id')); + if (link.indexOf('http') !== 0) link = window.location.protocol + "//" + window.location.host + link; $pointer.find('input').val(link); $pointer.find('button').first().attr('data-clipboard-text', link); $elem.before($pointer); diff --git a/resources/assets/sass/_fonts.scss b/resources/assets/sass/_fonts.scss index c9dff31e1..c8e8ea833 100644 --- a/resources/assets/sass/_fonts.scss +++ b/resources/assets/sass/_fonts.scss @@ -6,8 +6,8 @@ font-style: normal; font-weight: 100; src: local('Roboto Thin'), local('Roboto-Thin'), - url('/fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-100italic - cyrillic_latin */ @font-face { @@ -15,8 +15,8 @@ font-style: italic; font-weight: 100; src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'), - url('/fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-300 - cyrillic_latin */ @font-face { @@ -24,8 +24,8 @@ font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), - url('/fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-300italic - cyrillic_latin */ @font-face { @@ -33,8 +33,8 @@ font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), - url('/fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-regular - cyrillic_latin */ @font-face { @@ -42,8 +42,8 @@ font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), - url('/fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-italic - cyrillic_latin */ @font-face { @@ -51,8 +51,8 @@ font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), - url('/fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-500 - cyrillic_latin */ @font-face { @@ -60,8 +60,8 @@ font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), - url('/fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-500italic - cyrillic_latin */ @font-face { @@ -69,8 +69,8 @@ font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), - url('/fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-700 - cyrillic_latin */ @font-face { @@ -78,8 +78,8 @@ font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), - url('/fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-700italic - cyrillic_latin */ @font-face { @@ -87,8 +87,8 @@ font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), - url('/fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* roboto-mono-regular - latin */ @@ -97,6 +97,6 @@ font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), - url('/fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ - url('/fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ + url('../fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } \ No newline at end of file diff --git a/resources/views/auth/forms/login/standard.blade.php b/resources/views/auth/forms/login/standard.blade.php index d9be2935a..abefd21a1 100644 --- a/resources/views/auth/forms/login/standard.blade.php +++ b/resources/views/auth/forms/login/standard.blade.php @@ -6,5 +6,5 @@
Enter your email below and you will be sent an email with a password reset link.
-