diff --git a/.gitignore b/.gitignore index 0a6215ba9..e7e053505 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,8 @@ _ide_helper.php .phpstorm.meta.php yarn.lock /bin -nbproject \ No newline at end of file +nbproject +.buildpath +.project +.settings/org.eclipse.wst.common.project.facet.core.xml +.settings/org.eclipse.php.core.prefs diff --git a/.travis.yml b/.travis.yml index 0ad753ced..909e3e1f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ dist: trusty -sudo: required +sudo: false language: php php: - 7.0 @@ -8,15 +8,11 @@ cache: directories: - $HOME/.composer/cache -addons: - apt: - packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - before_script: - mysql -u root -e 'create database `bookstack-test`;' + - mysql -u root -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED BY 'bookstack-test';" + - mysql -u root -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';" + - mysql -u root -e "FLUSH PRIVILEGES;" - phpenv config-rm xdebug.ini - composer dump-autoload --no-interaction - composer install --prefer-dist --no-interaction @@ -25,5 +21,8 @@ before_script: - php artisan migrate --force -n --database=mysql_testing - php artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing +after_failure: + - cat storage/logs/laravel.log + script: - phpunit \ No newline at end of file diff --git a/app/Comment.php b/app/Comment.php index 9ef892bdc..4a9c48c74 100644 --- a/app/Comment.php +++ b/app/Comment.php @@ -1,6 +1,7 @@ belongsTo(User::class); } + + public function getParentCommentsByPage($pageId, $pageNum = 0, $limit = 0) { + $data = ['pageId' => $pageId]; + $query = static::newQuery(); + $query->join('users AS u', 'comments.created_by', '=', 'u.id'); + $query->leftJoin('users AS u1', 'comments.updated_by', '=', 'u1.id'); + $query->leftJoin('images AS i', 'i.id', '=', 'u.image_id'); + $query->selectRaw('comments.id, text, html, comments.created_by, comments.updated_by, comments.created_at, comments.updated_at, ' + . 'u.name AS created_by_name, u1.name AS updated_by_name, ' + . '(SELECT count(c.id) FROM bookstack.comments c WHERE c.parent_id = comments.id AND page_id = ?) AS cnt_sub_comments, i.url AS avatar ', + [$pageId]); + $query->whereRaw('page_id = ? AND parent_id IS NULL', [$pageId]); + $query->orderBy('created_at'); + return $query; + } } diff --git a/app/Console/Commands/ClearActivity.php b/app/Console/Commands/ClearActivity.php new file mode 100644 index 000000000..66babd9a9 --- /dev/null +++ b/app/Console/Commands/ClearActivity.php @@ -0,0 +1,47 @@ +activity = $activity; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $this->activity->newQuery()->truncate(); + $this->comment('System activity cleared'); + } +} diff --git a/app/Console/Commands/ClearRevisions.php b/app/Console/Commands/ClearRevisions.php new file mode 100644 index 000000000..f0c8a5e85 --- /dev/null +++ b/app/Console/Commands/ClearRevisions.php @@ -0,0 +1,50 @@ +pageRevision = $pageRevision; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + $deleteTypes = $this->option('all') ? ['version', 'update_draft'] : ['version']; + $this->pageRevision->newQuery()->whereIn('type', $deleteTypes)->delete(); + $this->comment('Revisions deleted'); + } +} diff --git a/app/Console/Commands/ResetViews.php b/app/Console/Commands/ClearViews.php similarity index 74% rename from app/Console/Commands/ResetViews.php rename to app/Console/Commands/ClearViews.php index 3a3903ff8..678c64d33 100644 --- a/app/Console/Commands/ResetViews.php +++ b/app/Console/Commands/ClearViews.php @@ -4,21 +4,21 @@ namespace BookStack\Console\Commands; use Illuminate\Console\Command; -class ResetViews extends Command +class ClearViews extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'views:reset'; + protected $signature = 'bookstack:clear-views'; /** * The console command description. * * @var string */ - protected $description = 'Reset all view-counts for all entities.'; + protected $description = 'Clear all view-counts for all entities.'; /** * Create a new command instance. @@ -37,5 +37,6 @@ class ResetViews extends Command public function handle() { \Views::resetAll(); + $this->comment('Views cleared'); } } diff --git a/app/Console/Commands/Inspire.php b/app/Console/Commands/Inspire.php deleted file mode 100644 index 4b115cfb9..000000000 --- a/app/Console/Commands/Inspire.php +++ /dev/null @@ -1,33 +0,0 @@ -comment(PHP_EOL.Inspiring::quote().PHP_EOL); - } -} diff --git a/app/Console/Commands/RegeneratePermissions.php b/app/Console/Commands/RegeneratePermissions.php index 60d5f4e45..966ee4a82 100644 --- a/app/Console/Commands/RegeneratePermissions.php +++ b/app/Console/Commands/RegeneratePermissions.php @@ -12,7 +12,7 @@ class RegeneratePermissions extends Command * * @var string */ - protected $signature = 'permissions:regen'; + protected $signature = 'bookstack:regenerate-permissions'; /** * The console command description. @@ -47,5 +47,6 @@ class RegeneratePermissions extends Command public function handle() { $this->permissionService->buildJointPermissions(); + $this->comment('Permissions regenerated'); } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b725c9e21..0112e72ca 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,8 +13,9 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - \BookStack\Console\Commands\Inspire::class, - \BookStack\Console\Commands\ResetViews::class, + \BookStack\Console\Commands\ClearViews::class, + \BookStack\Console\Commands\ClearActivity::class, + \BookStack\Console\Commands\ClearRevisions::class, \BookStack\Console\Commands\RegeneratePermissions::class, ]; @@ -26,7 +27,6 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command('inspire') - ->hourly(); + // } } diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 408192ff9..fe9ece5b2 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -3,6 +3,7 @@ use Activity; use BookStack\Repos\EntityRepo; use BookStack\Repos\UserRepo; +use BookStack\Services\ExportService; use Illuminate\Http\Request; use Illuminate\Http\Response; use Views; @@ -12,16 +13,19 @@ class BookController extends Controller protected $entityRepo; protected $userRepo; + protected $exportService; /** * BookController constructor. * @param EntityRepo $entityRepo * @param UserRepo $userRepo + * @param ExportService $exportService */ - public function __construct(EntityRepo $entityRepo, UserRepo $userRepo) + public function __construct(EntityRepo $entityRepo, UserRepo $userRepo, ExportService $exportService) { $this->entityRepo = $entityRepo; $this->userRepo = $userRepo; + $this->exportService = $exportService; parent::__construct(); } @@ -258,4 +262,49 @@ class BookController extends Controller session()->flash('success', trans('entities.books_permissions_updated')); return redirect($book->getUrl()); } + + /** + * Export a book as a PDF file. + * @param string $bookSlug + * @return mixed + */ + public function exportPdf($bookSlug) + { + $book = $this->entityRepo->getBySlug('book', $bookSlug); + $pdfContent = $this->exportService->bookToPdf($book); + return response()->make($pdfContent, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $bookSlug . '.pdf' + ]); + } + + /** + * Export a book as a contained HTML file. + * @param string $bookSlug + * @return mixed + */ + public function exportHtml($bookSlug) + { + $book = $this->entityRepo->getBySlug('book', $bookSlug); + $htmlContent = $this->exportService->bookToContainedHtml($book); + return response()->make($htmlContent, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $bookSlug . '.html' + ]); + } + + /** + * Export a book as a plain text file. + * @param $bookSlug + * @return mixed + */ + public function exportPlainText($bookSlug) + { + $book = $this->entityRepo->getBySlug('book', $bookSlug); + $htmlContent = $this->exportService->bookToPlainText($book); + return response()->make($htmlContent, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $bookSlug . '.txt' + ]); + } } diff --git a/app/Http/Controllers/ChapterController.php b/app/Http/Controllers/ChapterController.php index 1760ee5c6..ceeb2a3ef 100644 --- a/app/Http/Controllers/ChapterController.php +++ b/app/Http/Controllers/ChapterController.php @@ -3,6 +3,7 @@ use Activity; use BookStack\Repos\EntityRepo; use BookStack\Repos\UserRepo; +use BookStack\Services\ExportService; use Illuminate\Http\Request; use Illuminate\Http\Response; use Views; @@ -12,16 +13,19 @@ class ChapterController extends Controller protected $userRepo; protected $entityRepo; + protected $exportService; /** * ChapterController constructor. * @param EntityRepo $entityRepo * @param UserRepo $userRepo + * @param ExportService $exportService */ - public function __construct(EntityRepo $entityRepo, UserRepo $userRepo) + public function __construct(EntityRepo $entityRepo, UserRepo $userRepo, ExportService $exportService) { $this->entityRepo = $entityRepo; $this->userRepo = $userRepo; + $this->exportService = $exportService; parent::__construct(); } @@ -236,4 +240,52 @@ class ChapterController extends Controller session()->flash('success', trans('entities.chapters_permissions_success')); return redirect($chapter->getUrl()); } + + /** + * Exports a chapter to pdf . + * @param string $bookSlug + * @param string $chapterSlug + * @return \Illuminate\Http\Response + */ + public function exportPdf($bookSlug, $chapterSlug) + { + $chapter = $this->entityRepo->getBySlug('chapter', $chapterSlug, $bookSlug); + $pdfContent = $this->exportService->chapterToPdf($chapter); + return response()->make($pdfContent, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $chapterSlug . '.pdf' + ]); + } + + /** + * Export a chapter to a self-contained HTML file. + * @param string $bookSlug + * @param string $chapterSlug + * @return \Illuminate\Http\Response + */ + public function exportHtml($bookSlug, $chapterSlug) + { + $chapter = $this->entityRepo->getBySlug('chapter', $chapterSlug, $bookSlug); + $containedHtml = $this->exportService->chapterToContainedHtml($chapter); + return response()->make($containedHtml, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $chapterSlug . '.html' + ]); + } + + /** + * Export a chapter to a simple plaintext .txt file. + * @param string $bookSlug + * @param string $chapterSlug + * @return \Illuminate\Http\Response + */ + public function exportPlainText($bookSlug, $chapterSlug) + { + $chapter = $this->entityRepo->getBySlug('chapter', $chapterSlug, $bookSlug); + $containedHtml = $this->exportService->chapterToPlainText($chapter); + return response()->make($containedHtml, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="' . $chapterSlug . '.txt' + ]); + } } diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index de97169a8..3df441766 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -1,33 +1,91 @@ -checkOwnablePermission('page-view', $page); + protected $entityRepo; + + public function __construct(EntityRepo $entityRepo, CommentRepo $commentRepo) + { + $this->entityRepo = $entityRepo; + $this->commentRepo = $commentRepo; + parent::__construct(); } - - public function update(Request $request, $id) { - // Check whether its an admin or the comment owner. - // $this->checkOwnablePermission('page-view', $page); + + public function save(Request $request, $pageId, $commentId) + { + $this->validate($request, [ + 'text' => 'required|string', + 'html' => 'required|string', + ]); + + try { + $page = $this->entityRepo->getById('page', $pageId, true); + } catch (ModelNotFoundException $e) { + return response('Not found', 404); + } + + if($page->draft) { + // cannot add comments to drafts. + return response()->json([ + 'status' => 'error', + 'message' => trans('errors.cannot_add_comment_to_draft'), + ], 400); + } + + $this->checkOwnablePermission('page-view', $page); + if (empty($commentId)) { + // create a new comment. + $this->checkPermission('comment-create-all'); + $comment = $this->commentRepo->create($page, $request->only(['text', 'html', 'parent_id'])); + $respMsg = trans('entities.comment_created'); + } else { + // update existing comment + // get comment by ID and check if this user has permission to update. + $comment = $this->comment->findOrFail($commentId); + $this->checkOwnablePermission('comment-update', $comment); + $this->commentRepo->update($comment, $request->all()); + $respMsg = trans('entities.comment_updated'); + } + + return response()->json([ + 'status' => 'success', + 'message' => $respMsg + ]); + } public function destroy($id) { - // Check whether its an admin or the comment owner. - // $this->checkOwnablePermission('page-view', $page); + $comment = $this->comment->findOrFail($id); + $this->checkOwnablePermission('comment-delete', $comment); + + // } - - public function getLastXComments($pageId) { - // $this->checkOwnablePermission('page-view', $page); - } - - public function getChildComments($pageId, $id) { - // $this->checkOwnablePermission('page-view', $page); + + public function getComments($pageId, $commentId = null) { + try { + $page = $this->entityRepo->getById('page', $pageId, true); + } catch (ModelNotFoundException $e) { + return response('Not found', 404); + } + + if($page->draft) { + // cannot add comments to drafts. + return response()->json([ + 'status' => 'error', + 'message' => trans('errors.no_comments_for_draft'), + ], 400); + } + + $this->checkOwnablePermission('page-view', $page); + + $comments = $this->commentRepo->getCommentsForPage($pageId, $commentId); + + return response()->json(array('success' => true, 'comments'=> $comments)); } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f4706a5c4..7892fe8ae 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,10 +1,7 @@ - trans('common', [], null, 'en'), - 'components' => trans('components', [], null, 'en'), - 'entities' => trans('entities', [], null, 'en'), - 'errors' => trans('errors', [], null, 'en') + 'common' => trans('common', [], 'en'), + 'components' => trans('components', [], 'en'), + 'entities' => trans('entities', [], 'en'), + 'errors' => trans('errors', [], 'en') ]; $translations = array_replace_recursive($enTrans, $translations); } diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 4ed10d61e..736197213 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -369,10 +369,13 @@ class PageController extends Controller public function showRevision($bookSlug, $pageSlug, $revisionId) { $page = $this->entityRepo->getBySlug('page', $pageSlug, $bookSlug); - $revision = $this->entityRepo->getById('page_revision', $revisionId, false); + $revision = $page->revisions()->where('id', '=', $revisionId)->first(); + if ($revision === null) { + abort(404); + } $page->fill($revision->toArray()); - $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()])); + $this->setPageTitle(trans('entities.pages_revision_named', ['pageName' => $page->getShortName()])); return view('pages/revision', [ 'page' => $page, @@ -390,7 +393,10 @@ class PageController extends Controller public function showRevisionChanges($bookSlug, $pageSlug, $revisionId) { $page = $this->entityRepo->getBySlug('page', $pageSlug, $bookSlug); - $revision = $this->entityRepo->getById('page_revision', $revisionId); + $revision = $page->revisions()->where('id', '=', $revisionId)->first(); + if ($revision === null) { + abort(404); + } $prev = $revision->getPrevious(); $prevContent = ($prev === null) ? '' : $prev->html; @@ -423,7 +429,7 @@ class PageController extends Controller } /** - * Exports a page to pdf format using barryvdh/laravel-dompdf wrapper. + * Exports a page to a PDF. * https://github.com/barryvdh/laravel-dompdf * @param string $bookSlug * @param string $pageSlug @@ -433,7 +439,6 @@ class PageController extends Controller { $page = $this->entityRepo->getBySlug('page', $pageSlug, $bookSlug); $pdfContent = $this->exportService->pageToPdf($page); -// return $pdfContent; return response()->make($pdfContent, 200, [ 'Content-Type' => 'application/octet-stream', 'Content-Disposition' => 'attachment; filename="' . $pageSlug . '.pdf' @@ -585,4 +590,9 @@ class PageController extends Controller return redirect($page->getUrl()); } + public function getLastXComments($pageId) + { + // $this->checkOwnablePermission('page-view', $page); + } + } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index c55cc9ab8..839590c95 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -13,6 +13,8 @@ class Kernel extends HttpKernel */ protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, ]; /** @@ -24,8 +26,6 @@ class Kernel extends HttpKernel 'web' => [ \BookStack\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, \BookStack\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, \BookStack\Http\Middleware\Localization::class diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 118271f51..49cc15dd6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,5 +1,7 @@ app->singleton(SettingService::class, function($app) { + return new SettingService($app->make(Setting::class), $app->make('Illuminate\Contracts\Cache\Repository')); + }); } } diff --git a/app/Repos/CommentRepo.php b/app/Repos/CommentRepo.php index e8db3f83e..c2a19ec0b 100644 --- a/app/Repos/CommentRepo.php +++ b/app/Repos/CommentRepo.php @@ -1,7 +1,7 @@ comment = $comment; + } + + public function create (Page $page, $data = []) { + $userId = user()->id; + $comment = $this->comment->newInstance(); + $comment->fill($data); + // new comment + $comment->page_id = $page->id; + $comment->created_by = $userId; + $comment->save(); + return $comment; + } + + public function update($comment, $input) { + $userId = user()->id; + $comment->updated_by = $userId; + $comment->fill($input); + $comment->save(); + return $comment; + } + public function getCommentsForPage($pageId, $commentId, $count = 20) { + if (empty($commentId)) { + // requesting parent comments + $query = $this->comment->getParentCommentsByPage($pageId); + return $query->paginate($count); + } else { + // requesting the child comments. + return Comment::whereRaw("page_id = $pageId AND parent_id = $commentId")->get(); + } + } } \ No newline at end of file diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index 8a8740d76..8f4b533ff 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -86,8 +86,7 @@ class EntityRepo $this->entities = [ 'page' => $this->page, 'chapter' => $this->chapter, - 'book' => $this->book, - 'page_revision' => $this->pageRevision + 'book' => $this->book ]; $this->viewService = $viewService; $this->permissionService = $permissionService; @@ -314,11 +313,12 @@ class EntityRepo * Loads the book slug onto child elements to prevent access database access for getting the slug. * @param Book $book * @param bool $filterDrafts + * @param bool $renderPages * @return mixed */ - public function getBookChildren(Book $book, $filterDrafts = false) + public function getBookChildren(Book $book, $filterDrafts = false, $renderPages = false) { - $q = $this->permissionService->bookChildrenQuery($book->id, $filterDrafts)->get(); + $q = $this->permissionService->bookChildrenQuery($book->id, $filterDrafts, $renderPages)->get(); $entities = []; $parents = []; $tree = []; @@ -326,6 +326,10 @@ class EntityRepo foreach ($q as $index => $rawEntity) { if ($rawEntity->entity_type === 'BookStack\\Page') { $entities[$index] = $this->page->newFromBuilder($rawEntity); + if ($renderPages) { + $entities[$index]->html = $rawEntity->description; + $entities[$index]->html = $this->renderPage($entities[$index]); + }; } else if ($rawEntity->entity_type === 'BookStack\\Chapter') { $entities[$index] = $this->chapter->newFromBuilder($rawEntity); $key = $entities[$index]->entity_type . ':' . $entities[$index]->id; @@ -1054,7 +1058,7 @@ class EntityRepo public function restorePageRevision(Page $page, Book $book, $revisionId) { $this->savePageRevision($page); - $revision = $this->getById('page_revision', $revisionId); + $revision = $page->revisions()->where('id', '=', $revisionId)->first(); $page->fill($revision->toArray()); $page->slug = $this->findSuitableSlug('page', $page->name, $page->id, $book->id); $page->text = strip_tags($page->html); diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php index 880bc54ad..78cef41a4 100644 --- a/app/Services/ExportService.php +++ b/app/Services/ExportService.php @@ -1,5 +1,7 @@ $page, 'pageContent' => $this->entityRepo->renderPage($page), 'css' => $cssContent])->render(); + $pageHtml = view('pages/export', [ + 'page' => $page, + 'pageContent' => $this->entityRepo->renderPage($page) + ])->render(); return $this->containHtml($pageHtml); } /** - * Convert a page to a pdf file. + * Convert a chapter to a self-contained HTML file. + * @param Chapter $chapter + * @return mixed|string + */ + public function chapterToContainedHtml(Chapter $chapter) + { + $pages = $this->entityRepo->getChapterChildren($chapter); + $pages->each(function($page) { + $page->html = $this->entityRepo->renderPage($page); + }); + $html = view('chapters/export', [ + 'chapter' => $chapter, + 'pages' => $pages + ])->render(); + return $this->containHtml($html); + } + + /** + * Convert a book to a self-contained HTML file. + * @param Book $book + * @return mixed|string + */ + public function bookToContainedHtml(Book $book) + { + $bookTree = $this->entityRepo->getBookChildren($book, true, true); + $html = view('books/export', [ + 'book' => $book, + 'bookChildren' => $bookTree + ])->render(); + return $this->containHtml($html); + } + + /** + * Convert a page to a PDF file. * @param Page $page * @return mixed|string */ public function pageToPdf(Page $page) { - $cssContent = file_get_contents(public_path('/css/export-styles.css')); - $pageHtml = view('pages/pdf', ['page' => $page, 'pageContent' => $this->entityRepo->renderPage($page), 'css' => $cssContent])->render(); -// return $pageHtml; + $html = view('pages/pdf', [ + 'page' => $page, + 'pageContent' => $this->entityRepo->renderPage($page) + ])->render(); + return $this->htmlToPdf($html); + } + + /** + * Convert a chapter to a PDF file. + * @param Chapter $chapter + * @return mixed|string + */ + public function chapterToPdf(Chapter $chapter) + { + $pages = $this->entityRepo->getChapterChildren($chapter); + $pages->each(function($page) { + $page->html = $this->entityRepo->renderPage($page); + }); + $html = view('chapters/export', [ + 'chapter' => $chapter, + 'pages' => $pages + ])->render(); + return $this->htmlToPdf($html); + } + + /** + * Convert a book to a PDF file + * @param Book $book + * @return string + */ + public function bookToPdf(Book $book) + { + $bookTree = $this->entityRepo->getBookChildren($book, true, true); + $html = view('books/export', [ + 'book' => $book, + 'bookChildren' => $bookTree + ])->render(); + return $this->htmlToPdf($html); + } + + /** + * Convert normal webpage HTML to a PDF. + * @param $html + * @return string + */ + protected function htmlToPdf($html) + { + $containedHtml = $this->containHtml($html); $useWKHTML = config('snappy.pdf.binary') !== false; - $containedHtml = $this->containHtml($pageHtml); if ($useWKHTML) { $pdf = \SnappyPDF::loadHTML($containedHtml); + $pdf->setOption('print-media-type', true); } else { $pdf = \PDF::loadHTML($containedHtml); } @@ -123,6 +205,40 @@ class ExportService return $text; } + /** + * Convert a chapter into a plain text string. + * @param Chapter $chapter + * @return string + */ + public function chapterToPlainText(Chapter $chapter) + { + $text = $chapter->name . "\n\n"; + $text .= $chapter->description . "\n\n"; + foreach ($chapter->pages as $page) { + $text .= $this->pageToPlainText($page); + } + return $text; + } + + /** + * Convert a book into a plain text string. + * @param Book $book + * @return string + */ + public function bookToPlainText(Book $book) + { + $bookTree = $this->entityRepo->getBookChildren($book, true, true); + $text = $book->name . "\n\n"; + foreach ($bookTree as $bookChild) { + if ($bookChild->isA('chapter')) { + $text .= $this->chapterToPlainText($bookChild); + } else { + $text .= $this->pageToPlainText($bookChild); + } + } + return $text; + } + } diff --git a/app/Services/LdapService.php b/app/Services/LdapService.php index f8a4b88bb..71dc9c0e1 100644 --- a/app/Services/LdapService.php +++ b/app/Services/LdapService.php @@ -41,7 +41,8 @@ class LdapService // Find user $userFilter = $this->buildFilter($this->config['user_filter'], ['user' => $userName]); $baseDn = $this->config['base_dn']; - $users = $this->ldap->searchAndGetEntries($ldapConnection, $baseDn, $userFilter, ['cn', 'uid', 'dn', 'mail']); + $emailAttr = $this->config['email_attribute']; + $users = $this->ldap->searchAndGetEntries($ldapConnection, $baseDn, $userFilter, ['cn', 'uid', 'dn', $emailAttr]); if ($users['count'] === 0) return null; $user = $users[0]; @@ -49,7 +50,7 @@ class LdapService 'uid' => (isset($user['uid'])) ? $user['uid'][0] : $user['dn'], 'name' => $user['cn'][0], 'dn' => $user['dn'], - 'email' => (isset($user['mail'])) ? $user['mail'][0] : null + 'email' => (isset($user[$emailAttr])) ? (is_array($user[$emailAttr]) ? $user[$emailAttr][0] : $user[$emailAttr]) : null ]; } diff --git a/app/Services/PermissionService.php b/app/Services/PermissionService.php index ab0c5867c..6f27db9b7 100644 --- a/app/Services/PermissionService.php +++ b/app/Services/PermissionService.php @@ -474,11 +474,13 @@ class PermissionService /** * Get the children of a book in an efficient single query, Filtered by the permission system. * @param integer $book_id - * @param bool $filterDrafts + * @param bool $filterDrafts + * @param bool $fetchPageContent * @return \Illuminate\Database\Query\Builder */ - public function bookChildrenQuery($book_id, $filterDrafts = false) { - $pageSelect = $this->db->table('pages')->selectRaw("'BookStack\\\\Page' as entity_type, id, slug, name, text, '' as description, book_id, priority, chapter_id, draft")->where('book_id', '=', $book_id)->where(function($query) use ($filterDrafts) { + public function bookChildrenQuery($book_id, $filterDrafts = false, $fetchPageContent = false) { + $pageContentSelect = $fetchPageContent ? 'html' : "''"; + $pageSelect = $this->db->table('pages')->selectRaw("'BookStack\\\\Page' as entity_type, id, slug, name, text, {$pageContentSelect} as description, book_id, priority, chapter_id, draft")->where('book_id', '=', $book_id)->where(function($query) use ($filterDrafts) { $query->where('draft', '=', 0); if (!$filterDrafts) { $query->orWhere(function($query) { diff --git a/app/Services/SettingService.php b/app/Services/SettingService.php index 40094a513..18a7c0d1b 100644 --- a/app/Services/SettingService.php +++ b/app/Services/SettingService.php @@ -16,6 +16,7 @@ class SettingService protected $setting; protected $cache; + protected $localCache = []; protected $cachePrefix = 'setting-'; @@ -40,8 +41,12 @@ class SettingService public function get($key, $default = false) { if ($default === false) $default = config('setting-defaults.' . $key, false); + if (isset($this->localCache[$key])) return $this->localCache[$key]; + $value = $this->getValueFromStore($key, $default); - return $this->formatValue($value, $default); + $formatted = $this->formatValue($value, $default); + $this->localCache[$key] = $formatted; + return $formatted; } /** @@ -71,9 +76,8 @@ class SettingService // Check the cache $cacheKey = $this->cachePrefix . $key; - if ($this->cache->has($cacheKey)) { - return $this->cache->get($cacheKey); - } + $cacheVal = $this->cache->get($cacheKey, null); + if ($cacheVal !== null) return $cacheVal; // Check the database $settingObject = $this->getSettingObjectByKey($key); diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index 710f95696..2c15e73ce 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -181,14 +181,24 @@ class SocialAuthService public function getActiveDrivers() { $activeDrivers = []; - foreach ($this->validSocialDrivers as $driverName) { - if ($this->checkDriverConfigured($driverName)) { - $activeDrivers[$driverName] = true; + foreach ($this->validSocialDrivers as $driverKey) { + if ($this->checkDriverConfigured($driverKey)) { + $activeDrivers[$driverKey] = $this->getDriverName($driverKey); } } return $activeDrivers; } + /** + * Get the presentational name for a driver. + * @param $driver + * @return mixed + */ + public function getDriverName($driver) + { + return config('services.' . strtolower($driver) . '.name'); + } + /** * @param string $socialDriver * @param \Laravel\Socialite\Contracts\User $socialUser diff --git a/app/helpers.php b/app/helpers.php index 8103ad1ff..153f1e49f 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -37,6 +37,15 @@ function user() return auth()->user() ?: \BookStack\User::getDefault(); } +/** + * Check if current user is a signed in user. + * @return bool + */ +function signedInUser() +{ + return auth()->user() && !auth()->user()->isDefault(); +} + /** * Check if the current user has a permission. * If an ownable element is passed in the jointPermissions are checked against @@ -64,7 +73,7 @@ function userCan($permission, Ownable $ownable = null) */ function setting($key = null, $default = false) { - $settingService = app(\BookStack\Services\SettingService::class); + $settingService = resolve(\BookStack\Services\SettingService::class); if (is_null($key)) return $settingService; return $settingService->get($key, $default); } diff --git a/composer.json b/composer.json index 959bdbdc2..396a9babd 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "barryvdh/laravel-ide-helper": "^2.2.3", "barryvdh/laravel-debugbar": "^2.3.2", "league/flysystem-aws-s3-v3": "^1.0", - "barryvdh/laravel-dompdf": "^0.7", + "barryvdh/laravel-dompdf": "^0.8", "predis/predis": "^1.1", "gathercontent/htmldiff": "^0.2.1", "barryvdh/laravel-snappy": "^0.3.1", @@ -36,10 +36,9 @@ } }, "autoload-dev": { - "classmap": [ - "tests/TestCase.php", - "tests/BrowserKitTest.php" - ] + "psr-4": { + "Tests\\": "tests/" + } }, "scripts": { "post-root-package-install": [ @@ -48,6 +47,14 @@ "post-create-project-cmd": [ "php artisan key:generate" ], + "pre-update-cmd": [ + "php -r \"!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');\"", + "php -r \"!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');\"" + ], + "pre-install-cmd": [ + "php -r \"!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');\"", + "php -r \"!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');\"" + ], "post-install-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postInstall", "php artisan optimize", diff --git a/composer.lock b/composer.lock index 586213e57..54218ee48 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "27dd30e92f700ea9a8c2a0a2327d4f9f", - "content-hash": "e851e9fd06efac8362604c39b0a17542", + "hash": "e6d32752d02dae662bedc69fa5856feb", + "content-hash": "5f0f4e912f1207e761caf9344f2308a0", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.21.4", + "version": "3.22.11", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "6408a4904a04eca44461a65ba4a0fae53f80417b" + "reference": "277939bd789204b314f3aaca06976cf3ddf78f07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6408a4904a04eca44461a65ba4a0fae53f80417b", - "reference": "6408a4904a04eca44461a65ba4a0fae53f80417b", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/277939bd789204b314f3aaca06976cf3ddf78f07", + "reference": "277939bd789204b314f3aaca06976cf3ddf78f07", "shasum": "" }, "require": { @@ -85,7 +85,7 @@ "s3", "sdk" ], - "time": "2017-01-25 00:43:08" + "time": "2017-02-24 21:47:48" }, { "name": "barryvdh/laravel-debugbar", @@ -143,27 +143,27 @@ }, { "name": "barryvdh/laravel-dompdf", - "version": "v0.7.1", + "version": "v0.8.0", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-dompdf.git", - "reference": "6cb20d3f397d739163d2d743a4600009e52cd453" + "reference": "22ee9cb8e0ac0d5f11633d1194280ab40b2bba1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/6cb20d3f397d739163d2d743a4600009e52cd453", - "reference": "6cb20d3f397d739163d2d743a4600009e52cd453", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/22ee9cb8e0ac0d5f11633d1194280ab40b2bba1f", + "reference": "22ee9cb8e0ac0d5f11633d1194280ab40b2bba1f", "shasum": "" }, "require": { - "dompdf/dompdf": "^0.7", + "dompdf/dompdf": "^0.8", "illuminate/support": "5.1.x|5.2.x|5.3.x|5.4.x", "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.7-dev" + "dev-master": "0.8-dev" } }, "autoload": { @@ -187,20 +187,20 @@ "laravel", "pdf" ], - "time": "2017-01-24 18:12:54" + "time": "2017-02-19 06:45:54" }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.2.3", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "a7fc2ec489aada6062d3a63ddc915004a21e38af" + "reference": "e82de98cef0d6597b1b686be0b5813a3a4bb53c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/a7fc2ec489aada6062d3a63ddc915004a21e38af", - "reference": "a7fc2ec489aada6062d3a63ddc915004a21e38af", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/e82de98cef0d6597b1b686be0b5813a3a4bb53c5", + "reference": "e82de98cef0d6597b1b686be0b5813a3a4bb53c5", "shasum": "" }, "require": { @@ -223,7 +223,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -253,20 +253,20 @@ "phpstorm", "sublime" ], - "time": "2017-01-05 21:20:42" + "time": "2017-02-22 12:27:33" }, { "name": "barryvdh/laravel-snappy", - "version": "v0.3.2", + "version": "v0.3.3", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-snappy.git", - "reference": "864470e81952f8e568c93754d9d0d2c05145f773" + "reference": "dea728426bd867652c2f3a307a9cbea3f1ed7dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-snappy/zipball/864470e81952f8e568c93754d9d0d2c05145f773", - "reference": "864470e81952f8e568c93754d9d0d2c05145f773", + "url": "https://api.github.com/repos/barryvdh/laravel-snappy/zipball/dea728426bd867652c2f3a307a9cbea3f1ed7dff", + "reference": "dea728426bd867652c2f3a307a9cbea3f1ed7dff", "shasum": "" }, "require": { @@ -305,7 +305,7 @@ "wkhtmltoimage", "wkhtmltopdf" ], - "time": "2017-01-20 06:21:34" + "time": "2017-02-09 23:18:54" }, { "name": "barryvdh/reflection-docblock", @@ -476,28 +476,29 @@ }, { "name": "dompdf/dompdf", - "version": "v0.7.0", + "version": "v0.8.0", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "5c98652b1a5beb7e3cc8ec35419b2828dd63ab14" + "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/5c98652b1a5beb7e3cc8ec35419b2828dd63ab14", - "reference": "5c98652b1a5beb7e3cc8ec35419b2828dd63ab14", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", + "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", "shasum": "" }, "require": { "ext-dom": "*", "ext-gd": "*", "ext-mbstring": "*", - "phenx/php-font-lib": "0.4.*", - "phenx/php-svg-lib": "0.1.*", + "phenx/php-font-lib": "0.5.*", + "phenx/php-svg-lib": "0.2.*", "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "4.8.*", + "squizlabs/php_codesniffer": "2.*" }, "type": "library", "extra": { @@ -533,7 +534,7 @@ ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2016-05-11 00:36:29" + "time": "2017-02-16 02:40:40" }, { "name": "erusev/parsedown", @@ -799,16 +800,16 @@ }, { "name": "intervention/image", - "version": "2.3.9", + "version": "2.3.11", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "2bce9a59c43b868300b02a7d31a1e4aa67a200ae" + "reference": "e8881fd99b9804b29e02d6d1c2c15ee459335cf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/2bce9a59c43b868300b02a7d31a1e4aa67a200ae", - "reference": "2bce9a59c43b868300b02a7d31a1e4aa67a200ae", + "url": "https://api.github.com/repos/Intervention/image/zipball/e8881fd99b9804b29e02d6d1c2c15ee459335cf1", + "reference": "e8881fd99b9804b29e02d6d1c2c15ee459335cf1", "shasum": "" }, "require": { @@ -857,7 +858,7 @@ "thumbnail", "watermark" ], - "time": "2017-01-10 14:15:56" + "time": "2017-02-04 10:37:19" }, { "name": "knplabs/knp-snappy", @@ -926,22 +927,22 @@ }, { "name": "laravel/browser-kit-testing", - "version": "v1.0.2", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/laravel/browser-kit-testing.git", - "reference": "60e038e3dcfef2977347f9610c14b48721802278" + "reference": "0adfb725147815bff5516d157577f375a6e66ebd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/60e038e3dcfef2977347f9610c14b48721802278", - "reference": "60e038e3dcfef2977347f9610c14b48721802278", + "url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/0adfb725147815bff5516d157577f375a6e66ebd", + "reference": "0adfb725147815bff5516d157577f375a6e66ebd", "shasum": "" }, "require": { "php": ">=5.5.9", - "symfony/css-selector": "3.1.*", - "symfony/dom-crawler": "3.1.*" + "symfony/css-selector": "~3.1", + "symfony/dom-crawler": "~3.1" }, "type": "library", "extra": { @@ -969,20 +970,20 @@ "laravel", "testing" ], - "time": "2017-01-25 13:07:25" + "time": "2017-02-08 22:32:37" }, { "name": "laravel/framework", - "version": "v5.4.3", + "version": "v5.4.13", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9fa94bf77272ea7f920292c6f016b0f6e0853f98" + "reference": "3eebfaa759156e06144892b00bb95304aa5a71c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9fa94bf77272ea7f920292c6f016b0f6e0853f98", - "reference": "9fa94bf77272ea7f920292c6f016b0f6e0853f98", + "url": "https://api.github.com/repos/laravel/framework/zipball/3eebfaa759156e06144892b00bb95304aa5a71c1", + "reference": "3eebfaa759156e06144892b00bb95304aa5a71c1", "shasum": "" }, "require": { @@ -1098,20 +1099,20 @@ "framework", "laravel" ], - "time": "2017-01-25 16:40:49" + "time": "2017-02-22 16:07:04" }, { "name": "laravel/socialite", - "version": "v3.0.2", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "d3aaffa5e122395e54eb2c26062fde3a848c40fd" + "reference": "01588748beef55ad5dd4f172d235548d3a6be79a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/d3aaffa5e122395e54eb2c26062fde3a848c40fd", - "reference": "d3aaffa5e122395e54eb2c26062fde3a848c40fd", + "url": "https://api.github.com/repos/laravel/socialite/zipball/01588748beef55ad5dd4f172d235548d3a6be79a", + "reference": "01588748beef55ad5dd4f172d235548d3a6be79a", "shasum": "" }, "require": { @@ -1152,20 +1153,20 @@ "laravel", "oauth" ], - "time": "2017-01-25 17:58:13" + "time": "2017-02-01 13:43:56" }, { "name": "league/flysystem", - "version": "1.0.33", + "version": "1.0.35", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "5c7f98498b12d47f9de90ec9186a90000125777c" + "reference": "dda7f3ab94158a002d9846a97dc18ebfb7acc062" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/5c7f98498b12d47f9de90ec9186a90000125777c", - "reference": "5c7f98498b12d47f9de90ec9186a90000125777c", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/dda7f3ab94158a002d9846a97dc18ebfb7acc062", + "reference": "dda7f3ab94158a002d9846a97dc18ebfb7acc062", "shasum": "" }, "require": { @@ -1235,7 +1236,7 @@ "sftp", "storage" ], - "time": "2017-01-23 10:32:09" + "time": "2017-02-09 11:33:58" }, { "name": "league/flysystem-aws-s3-v3", @@ -1688,22 +1689,25 @@ }, { "name": "phenx/php-font-lib", - "version": "0.4", + "version": "0.5", "source": { "type": "git", "url": "https://github.com/PhenX/php-font-lib.git", - "reference": "b8af0cacdc3cbf1e41a586fcb78f506f4121a088" + "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/b8af0cacdc3cbf1e41a586fcb78f506f4121a088", - "reference": "b8af0cacdc3cbf1e41a586fcb78f506f4121a088", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/19ad2bebc35be028fcc0221025fcbf3d436a3962", + "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962", "shasum": "" }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, "type": "library", "autoload": { - "psr-0": { - "FontLib\\": "src/" + "psr-4": { + "FontLib\\": "src/FontLib" } }, "notification-url": "https://packagist.org/downloads/", @@ -1718,22 +1722,25 @@ ], "description": "A library to read, parse, export and make subsets of different types of font files.", "homepage": "https://github.com/PhenX/php-font-lib", - "time": "2015-05-06 20:02:39" + "time": "2017-02-11 10:58:43" }, { "name": "phenx/php-svg-lib", - "version": "0.1", + "version": "v0.2", "source": { "type": "git", "url": "https://github.com/PhenX/php-svg-lib.git", - "reference": "b419766515b3426c6da74b0e29e93d71c4f17099" + "reference": "de291bec8449b89acfe85691b5c71434797959dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/b419766515b3426c6da74b0e29e93d71c4f17099", - "reference": "b419766515b3426c6da74b0e29e93d71c4f17099", + "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/de291bec8449b89acfe85691b5c71434797959dc", + "reference": "de291bec8449b89acfe85691b5c71434797959dc", "shasum": "" }, + "require": { + "sabberworm/php-css-parser": "6.0.*" + }, "type": "library", "autoload": { "psr-0": { @@ -1752,7 +1759,7 @@ ], "description": "A library to read, parse and export to PDF SVG files.", "homepage": "https://github.com/PhenX/php-svg-lib", - "time": "2015-05-06 18:49:49" + "time": "2016-12-13 20:25:45" }, { "name": "predis/predis", @@ -1984,17 +1991,58 @@ "time": "2016-11-22 19:21:44" }, { - "name": "socialiteproviders/manager", - "version": "v3.0.2", + "name": "sabberworm/php-css-parser", + "version": "6.0.1", "source": { "type": "git", - "url": "https://github.com/SocialiteProviders/Manager.git", - "reference": "3bf2b405b6bfd4bec66f706f5390323f51033eb1" + "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", + "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/3bf2b405b6bfd4bec66f706f5390323f51033eb1", - "reference": "3bf2b405b6bfd4bec66f706f5390323f51033eb1", + "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/9ea4b00c569b19f731d0c2e0e802055877ff40c2", + "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "Sabberworm\\CSS": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "time": "2015-08-24 08:48:52" + }, + { + "name": "socialiteproviders/manager", + "version": "v3.0.4", + "source": { + "type": "git", + "url": "https://github.com/SocialiteProviders/Manager.git", + "reference": "f57877e96c46f0f9157fcd8fa68a547f6d344ed5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/f57877e96c46f0f9157fcd8fa68a547f6d344ed5", + "reference": "f57877e96c46f0f9157fcd8fa68a547f6d344ed5", "shasum": "" }, "require": { @@ -2023,20 +2071,20 @@ } ], "description": "Easily add new or override built-in providers in Laravel Socialite.", - "time": "2017-01-27 08:35:03" + "time": "2017-02-07 07:26:42" }, { "name": "socialiteproviders/slack", - "version": "v3.0.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/SocialiteProviders/Slack.git", - "reference": "a0d676a07bb8293547df6678f1da0258ac40bfec" + "reference": "6f8f0599cd80ecea4958ad37ed729805c4100c8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SocialiteProviders/Slack/zipball/a0d676a07bb8293547df6678f1da0258ac40bfec", - "reference": "a0d676a07bb8293547df6678f1da0258ac40bfec", + "url": "https://api.github.com/repos/SocialiteProviders/Slack/zipball/6f8f0599cd80ecea4958ad37ed729805c4100c8c", + "reference": "6f8f0599cd80ecea4958ad37ed729805c4100c8c", "shasum": "" }, "require": { @@ -2060,20 +2108,20 @@ } ], "description": "Slack OAuth2 Provider for Laravel Socialite", - "time": "2017-01-25 09:48:29" + "time": "2017-02-20 04:42:11" }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.5", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "cd142238a339459b10da3d8234220963f392540c" + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/cd142238a339459b10da3d8234220963f392540c", - "reference": "cd142238a339459b10da3d8234220963f392540c", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", + "reference": "81fdccfaf8bdc5d5d7a1ef6bb3a61bbb1a6c4a3e", "shasum": "" }, "require": { @@ -2114,20 +2162,20 @@ "mail", "mailer" ], - "time": "2016-12-29 10:02:40" + "time": "2017-02-13 07:52:53" }, { "name": "symfony/class-loader", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "0152f7a47acd564ca62c652975c2b32ac6d613a6" + "reference": "2847d56f518ad5721bf85aa9174b3aa3fd12aa03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/0152f7a47acd564ca62c652975c2b32ac6d613a6", - "reference": "0152f7a47acd564ca62c652975c2b32ac6d613a6", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/2847d56f518ad5721bf85aa9174b3aa3fd12aa03", + "reference": "2847d56f518ad5721bf85aa9174b3aa3fd12aa03", "shasum": "" }, "require": { @@ -2170,20 +2218,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-01-10 14:14:38" + "time": "2017-01-21 17:06:35" }, { "name": "symfony/console", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd" + "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/4f9e449e76996adf310498a8ca955c6deebe29dd", - "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd", + "url": "https://api.github.com/repos/symfony/console/zipball/0e5e6899f82230fcb1153bcaf0e106ffaa44b870", + "reference": "0e5e6899f82230fcb1153bcaf0e106ffaa44b870", "shasum": "" }, "require": { @@ -2233,11 +2281,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:47:33" + "time": "2017-02-16 14:07:22" }, { "name": "symfony/css-selector", - "version": "v3.1.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2290,16 +2338,16 @@ }, { "name": "symfony/debug", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05" + "reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/810ba5c1c5352a4ddb15d4719e8936751dff0b05", - "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05", + "url": "https://api.github.com/repos/symfony/debug/zipball/9b98854cb45bc59d100b7d4cc4cf9e05f21026b9", + "reference": "9b98854cb45bc59d100b7d4cc4cf9e05f21026b9", "shasum": "" }, "require": { @@ -2343,20 +2391,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-02-16 16:34:18" }, { "name": "symfony/dom-crawler", - "version": "v3.1.9", + "version": "v3.1.10", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "a950260ebc947578fba82a3222e2085d90682376" + "reference": "7eede2a901a19928494194f7d1815a77b9a473a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/a950260ebc947578fba82a3222e2085d90682376", - "reference": "a950260ebc947578fba82a3222e2085d90682376", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7eede2a901a19928494194f7d1815a77b9a473a0", + "reference": "7eede2a901a19928494194f7d1815a77b9a473a0", "shasum": "" }, "require": { @@ -2399,11 +2447,11 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:31:54" + "time": "2017-01-21 17:13:55" }, { "name": "symfony/event-dispatcher", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2463,7 +2511,7 @@ }, { "name": "symfony/finder", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2512,16 +2560,16 @@ }, { "name": "symfony/http-foundation", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "33eb76bf1d833c705433e5361a646c164696394b" + "reference": "a90da6dd679605d88c9803a57a6fc1fb7a19a6e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/33eb76bf1d833c705433e5361a646c164696394b", - "reference": "33eb76bf1d833c705433e5361a646c164696394b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a90da6dd679605d88c9803a57a6fc1fb7a19a6e0", + "reference": "a90da6dd679605d88c9803a57a6fc1fb7a19a6e0", "shasum": "" }, "require": { @@ -2561,20 +2609,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:47:33" + "time": "2017-02-16 22:46:52" }, { "name": "symfony/http-kernel", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "8a898e340a89022246645b1288d295f49c9381e4" + "reference": "4cd0d4bc31819095c6ef13573069f621eb321081" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8a898e340a89022246645b1288d295f49c9381e4", - "reference": "8a898e340a89022246645b1288d295f49c9381e4", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4cd0d4bc31819095c6ef13573069f621eb321081", + "reference": "4cd0d4bc31819095c6ef13573069f621eb321081", "shasum": "" }, "require": { @@ -2643,7 +2691,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-01-12 21:36:33" + "time": "2017-02-16 23:59:56" }, { "name": "symfony/polyfill-mbstring", @@ -2706,16 +2754,16 @@ }, { "name": "symfony/process", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893" + "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/350e810019fc52dd06ae844b6a6d382f8a0e8893", - "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893", + "url": "https://api.github.com/repos/symfony/process/zipball/0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856", + "reference": "0ab87c1e7570b3534a6e51eb4ca8e9f6d7327856", "shasum": "" }, "require": { @@ -2751,20 +2799,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-02-16 14:07:22" }, { "name": "symfony/routing", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "fda2c67d47ec801726ca888c95d701d31b27b444" + "reference": "af464432c177dbcdbb32295113b7627500331f2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/fda2c67d47ec801726ca888c95d701d31b27b444", - "reference": "fda2c67d47ec801726ca888c95d701d31b27b444", + "url": "https://api.github.com/repos/symfony/routing/zipball/af464432c177dbcdbb32295113b7627500331f2d", + "reference": "af464432c177dbcdbb32295113b7627500331f2d", "shasum": "" }, "require": { @@ -2826,20 +2874,20 @@ "uri", "url" ], - "time": "2017-01-02 20:32:22" + "time": "2017-01-28 02:37:08" }, { "name": "symfony/translation", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda" + "reference": "d6825c6bb2f1da13f564678f9f236fe8242c0029" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/6520f3d4cce604d9dd1e86cac7af954984dd9bda", - "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda", + "url": "https://api.github.com/repos/symfony/translation/zipball/d6825c6bb2f1da13f564678f9f236fe8242c0029", + "reference": "d6825c6bb2f1da13f564678f9f236fe8242c0029", "shasum": "" }, "require": { @@ -2890,20 +2938,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-02-16 22:46:52" }, { "name": "symfony/var-dumper", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2" + "reference": "cb50260b674ee1c2d4ab49f2395a42e0b4681e20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b54b23f9a19b465e76fdaac0f6732410467c83b2", - "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/cb50260b674ee1c2d4ab49f2395a42e0b4681e20", + "reference": "cb50260b674ee1c2d4ab49f2395a42e0b4681e20", "shasum": "" }, "require": { @@ -2953,7 +3001,7 @@ "debug", "dump" ], - "time": "2017-01-03 08:53:57" + "time": "2017-02-16 22:46:52" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3203,16 +3251,16 @@ }, { "name": "mockery/mockery", - "version": "0.9.7", + "version": "0.9.8", "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371" + "reference": "1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4de7969f4664da3cef1ccd83866c9f59378c3371", - "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371", + "url": "https://api.github.com/repos/padraic/mockery/zipball/1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855", + "reference": "1e5e2ffdc4d71d7358ed58a6fdd30a4a0c506855", "shasum": "" }, "require": { @@ -3264,20 +3312,20 @@ "test double", "testing" ], - "time": "2016-12-19 14:50:55" + "time": "2017-02-09 13:29:38" }, { "name": "myclabs/deep-copy", - "version": "1.5.5", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108", - "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { @@ -3306,7 +3354,7 @@ "object", "object graph" ], - "time": "2016-10-31 17:19:45" + "time": "2017-01-26 22:05:40" }, { "name": "phpdocumentor/reflection-common", @@ -3519,23 +3567,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971" + "reference": "ca060f645beeddebedb1885c97bf163e93264c35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c19cfc7cbb0e9338d8c469c7eedecc2a428b0971", - "reference": "c19cfc7cbb0e9338d8c469c7eedecc2a428b0971", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca060f645beeddebedb1885c97bf163e93264c35", + "reference": "ca060f645beeddebedb1885c97bf163e93264c35", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", "sebastian/code-unit-reverse-lookup": "~1.0", "sebastian/environment": "^1.3.2 || ^2.0", "sebastian/version": "~1.0|~2.0" @@ -3578,7 +3626,7 @@ "testing", "xunit" ], - "time": "2017-01-20 15:06:43" + "time": "2017-02-23 07:38:02" }, { "name": "phpunit/php-file-iterator", @@ -3714,16 +3762,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.9", + "version": "1.4.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/284fb0679dd25fb5ffb56dad92c72860c0a22f1b", + "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b", "shasum": "" }, "require": { @@ -3759,20 +3807,20 @@ "keywords": [ "tokenizer" ], - "time": "2016-11-15 14:06:22" + "time": "2017-02-23 06:14:45" }, { "name": "phpunit/phpunit", - "version": "5.7.6", + "version": "5.7.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "caf8141b89691498d91aaac6c82e9cd5f685ae86" + "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/caf8141b89691498d91aaac6c82e9cd5f685ae86", - "reference": "caf8141b89691498d91aaac6c82e9cd5f685ae86", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4906b8faf23e42612182fd212eb6f4c0f2954b57", + "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57", "shasum": "" }, "require": { @@ -3789,14 +3837,14 @@ "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.2.2", + "sebastian/comparator": "^1.2.4", "sebastian/diff": "~1.2", "sebastian/environment": "^1.3.4 || ^2.0", "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.0 || ^2.0", + "sebastian/global-state": "^1.1", "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", + "sebastian/version": "~1.0.3|~2.0", "symfony/yaml": "~2.1|~3.0" }, "conflict": { @@ -3841,7 +3889,7 @@ "testing", "xunit" ], - "time": "2017-01-22 08:39:59" + "time": "2017-02-19 07:22:16" }, { "name": "phpunit/phpunit-mock-objects", @@ -3949,16 +3997,16 @@ }, { "name": "sebastian/comparator", - "version": "1.2.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { @@ -4009,7 +4057,7 @@ "compare", "equality" ], - "time": "2016-11-19 09:18:40" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -4233,16 +4281,16 @@ }, { "name": "sebastian/object-enumerator", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35", - "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { @@ -4275,7 +4323,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-11-19 07:35:10" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", @@ -4417,16 +4465,16 @@ }, { "name": "symfony/yaml", - "version": "v3.2.2", + "version": "v3.2.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "50eadbd7926e31842893c957eca362b21592a97d" + "reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/50eadbd7926e31842893c957eca362b21592a97d", - "reference": "50eadbd7926e31842893c957eca362b21592a97d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9724c684646fcb5387d579b4bfaa63ee0b0c64c8", + "reference": "9724c684646fcb5387d579b4bfaa63ee0b0c64c8", "shasum": "" }, "require": { @@ -4468,7 +4516,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-01-03 13:51:32" + "time": "2017-02-16 22:46:52" }, { "name": "webmozart/assert", diff --git a/config/database.php b/config/database.php index cfeeaa75a..d13268cea 100644 --- a/config/database.php +++ b/config/database.php @@ -82,7 +82,7 @@ return [ 'mysql_testing' => [ 'driver' => 'mysql', - 'host' => 'localhost', + 'host' => '127.0.0.1', 'database' => 'bookstack-test', 'username' => env('MYSQL_USER', 'bookstack-test'), 'password' => env('MYSQL_PASSWORD', 'bookstack-test'), diff --git a/config/dompdf.php b/config/dompdf.php index 924bdb9cd..036e1bb3c 100644 --- a/config/dompdf.php +++ b/config/dompdf.php @@ -1,6 +1,6 @@ false, // Throw an Exception on warnings from dompdf 'orientation' => 'portrait', - 'defines' => array( + 'defines' => [ /** * The location of the DOMPDF font directory * @@ -143,7 +143,7 @@ return array( * the desired content might be different (e.g. screen or projection view of html file). * Therefore allow specification of content here. */ - "DOMPDF_DEFAULT_MEDIA_TYPE" => "screen", + "DOMPDF_DEFAULT_MEDIA_TYPE" => "print", /** * The default paper size. @@ -260,7 +260,7 @@ return array( "DOMPDF_ENABLE_HTML5PARSER" => true, - ), + ], -); +]; diff --git a/config/services.php b/config/services.php index 8c17897e4..99022e5f2 100644 --- a/config/services.php +++ b/config/services.php @@ -41,30 +41,35 @@ return [ 'client_id' => env('GITHUB_APP_ID', false), 'client_secret' => env('GITHUB_APP_SECRET', false), 'redirect' => env('APP_URL') . '/login/service/github/callback', + 'name' => 'GitHub', ], 'google' => [ 'client_id' => env('GOOGLE_APP_ID', false), 'client_secret' => env('GOOGLE_APP_SECRET', false), 'redirect' => env('APP_URL') . '/login/service/google/callback', + 'name' => 'Google', ], 'slack' => [ 'client_id' => env('SLACK_APP_ID', false), 'client_secret' => env('SLACK_APP_SECRET', false), 'redirect' => env('APP_URL') . '/login/service/slack/callback', + 'name' => 'Slack', ], 'facebook' => [ 'client_id' => env('FACEBOOK_APP_ID', false), 'client_secret' => env('FACEBOOK_APP_SECRET', false), 'redirect' => env('APP_URL') . '/login/service/facebook/callback', + 'name' => 'Facebook', ], 'twitter' => [ 'client_id' => env('TWITTER_APP_ID', false), 'client_secret' => env('TWITTER_APP_SECRET', false), 'redirect' => env('APP_URL') . '/login/service/twitter/callback', + 'name' => 'Twitter', ], 'ldap' => [ @@ -73,7 +78,8 @@ return [ 'pass' => env('LDAP_PASS', false), 'base_dn' => env('LDAP_BASE_DN', false), 'user_filter' => env('LDAP_USER_FILTER', '(&(uid=${user}))'), - 'version' => env('LDAP_VERSION', false) + 'version' => env('LDAP_VERSION', false), + 'email_attribute' => env('LDAP_EMAIL_ATTRIBUTE', 'mail'), ] ]; diff --git a/database/seeds/DummyContentSeeder.php b/database/seeds/DummyContentSeeder.php index c64ca2a8c..efcda4220 100644 --- a/database/seeds/DummyContentSeeder.php +++ b/database/seeds/DummyContentSeeder.php @@ -11,14 +11,14 @@ class DummyContentSeeder extends Seeder */ public function run() { - $user = factory(BookStack\User::class, 1)->create(); + $user = factory(\BookStack\User::class)->create(); $role = \BookStack\Role::getRole('editor'); $user->attachRole($role); - $books = factory(BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id]) + $books = factory(\BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id]) ->each(function($book) use ($user) { - $chapters = factory(BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id]) + $chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id]) ->each(function($chapter) use ($user, $book){ $pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]); $chapter->pages()->saveMany($pages); diff --git a/public/libs/simplemde/simplemde.min.js b/public/libs/simplemde/simplemde.min.js new file mode 100644 index 000000000..50c624f20 --- /dev/null +++ b/public/libs/simplemde/simplemde.min.js @@ -0,0 +1,15 @@ +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,r){function i(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;at;++t)s[t]=e[t],c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function i(e){var t,n,r,i,o,a,l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[l-2]?2:"="===e[l-1]?1:0,a=new u(3*l/4-o),r=o>0?l-4:l;var s=0;for(t=0,n=0;r>t;t+=4,n+=3)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[s++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}function o(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,i=[],a=t;n>a;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(o(r));return i.join("")}function l(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,c=0,u=n-r;u>c;c+=l)o.push(a(e,c,c+l>u?u:c+l));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}n.toByteArray=i,n.fromByteArray=l;var s=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()=t?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}function u(e,t){if(s(t),e=o(e,0>t?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function f(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);return e=o(e,r),e.write(t,n),e}function h(e,t){var n=0|m(t.length);e=o(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function d(e,t,n,r){if(t.byteLength,0>n||t.byteLength=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return N(this,t,n);case"ascii":return E(this,t,n);case"binary":return O(this,t,n);case"base64":return M(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,l=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}for(var s=-1,c=0;a>n+c;c++)if(i(e,n+c)===i(t,-1===s?0:c-s)){if(-1===s&&(s=c),c-s+1===l)return(n+s)*o}else-1!==s&&(c-=c-s),s=-1;return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var l=parseInt(t.substr(2*a,2),16);if(isNaN(l))return a;e[n+a]=l}return a}function k(e,t,n,r){return V(q(t,e.length-n),e,n,r)}function S(e,t,n,r){return V(G(t),e,n,r)}function C(e,t,n,r){return S(e,t,n,r)}function L(e,t,n,r){return V($(t),e,n,r)}function T(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function M(e,t,n){return 0===t&&n===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,n))}function N(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n>=i+l){var s,c,u,f;switch(l){case 1:128>o&&(a=o);break;case 2:s=e[i+1],128===(192&s)&&(f=(31&o)<<6|63&s,f>127&&(a=f));break;case 3:s=e[i+1],c=e[i+2],128===(192&s)&&128===(192&c)&&(f=(15&o)<<12|(63&s)<<6|63&c,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:s=e[i+1],c=e[i+2],u=e[i+3],128===(192&s)&&128===(192&c)&&128===(192&u)&&(f=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&u,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return A(r)}function A(e){var t=e.length;if(Q>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function E(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=U(e[o]);return i}function P(e,t,n){for(var r=e.slice(t,n),i="",o=0;oe)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||o>t)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function _(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,n,r,52,8),n+8}function z(e){if(e=j(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;r>a;a++){if(n=e.charCodeAt(a),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function G(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function $(e){return X.toByteArray(z(e))}function V(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function K(e){return e!==e}var X=e("base64-js"),Z=e("ieee754"),J=e("isarray");n.Buffer=a,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return l(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return c(null,e,t,n)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);o>i;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return r>n?-1:n>r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;nt;t+=2)x(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},a.prototype.compare=function(e,t,n,r,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),0>t||n>e.length||0>r||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,l=n-t,s=Math.min(o,l),c=this.slice(r,i),u=e.slice(t,n),f=0;s>f;++f)if(c[f]!==u[f]){o=c[f],l=u[f];break}return l>o?-1:o>l?1:0},a.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(this,e,t,n);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):b(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return S(this,e,t,n);case"binary":return C(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var i=t-e;r=new a(i,void 0);for(var o=0;i>o;o++)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++oe&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)0>e&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return _(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return _(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-tn&&r>t)for(i=o-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);256>i&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(0>t||this.length=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;o++)this[o]=e;else{var l=a.isBuffer(e)?e:q(new a(e,r).toString()),s=l.length;for(o=0;n-t>o;o++)this[o+t]=l[o%s]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function r(e){return e=e||{},"function"!=typeof e.codeMirrorInstance||"function"!=typeof e.codeMirrorInstance.defineMode?void console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`"):(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var a='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',l={token:function(e){var t=e.peek(),n="";if(a.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!a.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},s=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(s,l,!0)}))}var i=e("typo-js");r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,t.exports=r},{"typo-js":18}],5:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":10}],6:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":10}],7:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l")>=0?d[2]:parseInt(d[3],10)+1+d[4];a[l]="\n"+p+g+m}}i.replaceSelections(a)}})},{"../../lib/codemirror":10}],8:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)=n.line,d=h?n:s(f,0),p=e.markText(u,d,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),h)break;a=f}}function i(e){for(var t=e.state.markedSelection,n=0;n1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var s=a[0].find(),u=a[a.length-1].find();if(!s||!u||n.line-t.line=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)a.shift().clear(),s=a[0].find();for(c(t,s.from)<0&&(s.to.line-t.line0&&(n.line-u.from.linebo&&setTimeout(function(){s.display.input.reset(!0)},20),jt(this),Ki(),bt(this),this.curOp.forceUpdate=!0,Xr(this,i),r.autofocus&&!Ao||s.hasFocus()?setTimeout(Bi(vn,this),20):yn(this);for(var u in ta)ta.hasOwnProperty(u)&&ta[u](this,r[u],na);k(this),r.finishInit&&r.finishInit(this);for(var f=0;fbo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),wo||go&&Ao||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null, +r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,_e(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Ja(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Za(e.display.wrapper,"CodeMirror-wrap"),h(e)),a(e),Dt(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(kr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;at.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function d(e){var t=Pi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qe(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ye(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=ji("div",[ji("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=ji("div",[ji("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ea(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ea(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>bo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Za(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ea(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Ja(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,r=e.display.barHeight;x(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),x(e,p(e)),n=e.display.barWidth,r=e.display.barHeight}function x(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ue(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),a=ni(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ni(t,ri(Zr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ni(t,ri(Zr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zt(e))return!1;k(e)&&(Wt(e),t.dims=P(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Wo&&(o=br(e.doc,o),a=wr(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ri(Zr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=zt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return s>4&&(n.lineDiv.style.display="none"),R(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,_e(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=$e(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qe(e.display)-Ve(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);r=!1){O(e);var i=p(e);Re(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new L(e,t);if(M(e,n)){O(e),N(e,n);var r=p(e);Re(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ye(e)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;rbo){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(ei(o.line,i),I(o.line),o.rest))for(var c=0;c=t&&f.lineNumber;f.changes&&(Pi(f.changes,"gutter")>-1&&(h=!1),D(e,f,c,n)),h&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,c)))),l=f.node.nextSibling}else{var d=U(e,f,c,n);a.insertBefore(d,l)}c+=f.size}for(;l;)l=r(l)}function D(e,t,n,r){for(var i=0;ibo&&(e.node.style.zIndex=2)),e.node}function W(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=H(e);e.background=n.insertBefore(ji("div",null,t),n.firstChild)}}function B(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Br(e,t)}function _(e,t){var n=t.text.className,r=B(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,F(t)):n&&(t.text.className=n)}function F(e){W(e),e.line.wrapClass?H(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function z(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=H(t);t.gutterBackground=ji("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=H(t),a=t.gutter=ji("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(ji("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l1)if(Fo&&Fo.text.join("\n")==t){if(r.ranges.length%Fo.text.length==0){s=[];for(var c=0;c=0;c--){var u=r.ranges[c],f=u.from(),h=u.to();u.empty()&&(n&&n>0?f=Bo(f.line,f.ch-n):e.state.overwrite&&!a?h=Bo(h.line,Math.min(Zr(o,h.line).text.length,h.ch+Ii(l).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=h=Bo(f.line,0)));var d=e.curOp.updateInput,p={from:f,to:h,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),Ci(e,"inputRead",e,p)}t&&!a&&Q(e,t),Bn(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||At(t,function(){Z(t,n,0,null,"paste")}),!0):void 0}function Q(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Ci(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;ri?c.map:u[i],a=0;ai?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Bo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Va(i,t))return ae(Bo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Ii(e.rest):e.line;return ae(Bo(ti(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return ae(f,o);for(var h=s.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=r(h,h.firstChild,0))return ae(Bo(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=s.previousSibling,d=n;p;p=p.previousSibling){if(f=r(p,p.firstChild,-1))return ae(Bo(f.line,f.ch+d),o);d+=h.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var u,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(Bo(r,0),Bo(i+1,0),o(+f));return void(h.length&&(u=h[0].find())&&(l+=Jr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d=0){var a=K(o.from(),i.from()),l=V(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new ue(e,t)}function de(e,t){return new ue([new fe(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.linen?Bo(n,Zr(e,n).text.length):ge(t,Zr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Bo(e.line,t):0>n?Bo(e.line,0):e}function ve(e,t){return t>=e.first&&t=t.ch:l.to>t.ch))){if(i&&(Pa(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Pe(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=_o(u,n))&&(0>r?0>c:c>0))return Oe(e,u,t,r,i)}var f=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(f=Pe(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Bo(e.first,0))}function Pe(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Bo(t.line-1)):null:n>0&&t.ch==(r||Zr(e,t.line)).text.length?t.line=e.display.viewTo||l.to().linet&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(ji("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ht(e,Bo(t,n),"div",f,r)}var l,s,f=Zr(a,t),h=f.text.length;return eo(ii(f),n||0,null==i?h:i,function(e,t,a){var f,d,p,m=o(e,"left");if(e==t)f=m,d=p=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}d=m.left,p=f.right}null==n&&0==e&&(d=c),f.top-m.top>3&&(r(d,m.top,null,m.bottom),d=c,m.bottoms.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>d&&(d=c),r(d,f.top,p-d,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ge(e.display),c=s.left,u=Math.max(o.sizerWidth,$e(e)-o.sizer.offsetLeft)-s.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Zr(a,f.line),p=Zr(a,h.line),m=yr(d)==yr(p),g=i(f.line,f.ch,m?d.text.length+1:null).end,v=i(h.line,m?0:null,h.ch).start;m&&(g.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function _e(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Rr(e,o,l?sa(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&hn?(_e(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;ta;--l){if(l<=o.first)return o.first;var s=Zr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Fa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function je(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=ze(e,t,n),a=o>r.first&&Zr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ca(r.mode),r.iter(o,t,function(n){Hr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Xe(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ze(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new Pt(e.doc,t,n);r.lineN=n;var i=r.built=Br(e,r);return r.text=i.pre,qi(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return tt(e,et(e,t),n,r)}function Qe(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;lu;u++){for(;l&&zi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+sbo&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var f=qa(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:qo}else i=qa(a,l,s).getBoundingClientRect()||qo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}xo&&11>bo&&(i=it(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&9>bo&&!l&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}:qo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(d+p)/2,g=t.view.measure.heights,u=0;un.from?a(e-1):a(e,r)}r=r||Zr(e.doc,t.line),i||(i=et(e,r));var s=ii(r),c=t.ch;if(!s)return a(c);var u=co(s,c),f=l(c,u);return null!=al&&(f.other=l(c,al)),f}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Zr(e.doc,t.line),i=ri(r)+Ue(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Bo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Zr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Zr(r,i);;){var l=vt(e,a,i,t,n),s=gr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=ti(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=dt(e,Bo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:ag)return mt(n,d,v,1);for(;;){if(u?d==h||d==fo(t,h,1):1>=d-h){for(var y=p>r||g-r>=r-p?h:d,x=r-(y==h?p:g);zi(t.text.charAt(y));)++y;var b=mt(n,y,y==h?m:v,-1>x?-1:x>1?1:0);return b}var w=Math.ceil(f/2),k=h+w;if(u){k=h;for(var S=0;w>S;++S)k=fo(t,k,1)}var C=o(k);C>r?(d=k,g=C,(v=l)&&(g+=1e3),f=w):(h=k,p=C,m=l,f-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==zo){zo=ji("pre");for(var t=0;49>t;++t)zo.appendChild(document.createTextNode("x")),zo.appendChild(ji("br"));zo.appendChild(document.createTextNode("x"))}qi(e.measure,zo);var n=zo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ji("span","xxxxxxxxxx"),n=ji("pre",[t]);qi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yo},Go?Go.ops.push(e.curOp):e.curOp.ownsGroup=Go={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ye(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=r){var a=new Pt(e.doc,Zr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Wo&&br(e.doc,t)i.viewFrom?Wt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Wt(e);else if(t<=i.viewFrom){var o=_t(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Wt(e)}else if(n>=i.viewTo){var o=_t(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Wt(e)}else{var a=_t(e,t,t,-1),l=_t(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Rt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Wt(e)}var s=i.externalMeasured;s&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Bt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Pi(a,n)&&a.push(n)}}}function Wt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;rt)return r}function _t(e,t,n,r){var i,o=Bt(e,t),a=e.display.view;if(!Wo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;br(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Rt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Bt(e,n)))),r.viewTo=n}function zt(e){for(var t=e.display.view,n=0,r=0;r400}var i=e.display;Ea(i.scroller,"mousedown",Et(e,$t)),xo&&11>bo?Ea(i.scroller,"dblclick",Et(e,function(t){if(!Ti(e,t)){var n=Yt(e,t);if(n&&!Jt(e,t)&&!Gt(e.display,t)){Ma(t);var r=e.findWordAt(n);be(e.doc,r.anchor,r.head)}}})):Ea(i.scroller,"dblclick",function(t){Ti(e,t)||Ma(t)}),Do||Ea(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Ea(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ea(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ea(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Gt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(Bo(l.line,0),me(e.doc,Bo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ma(n)}t()}),Ea(i.scroller,"touchcancel",t),Ea(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),Pa(e,"scroll",e))}),Ea(i.scroller,"mousewheel",function(t){an(e,t)}),Ea(i.scroller,"DOMMouseScroll",function(t){an(e,t)}),Ea(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Aa(t)},over:function(t){Ti(e,t)||(tn(e,t),Aa(t))},start:function(t){en(e,t)},drop:Et(e,Qt),leave:function(t){Ti(e,t)||nn(e)}};var l=i.input.getField();Ea(l,"keyup",function(t){pn.call(e,t)}),Ea(l,"keydown",Et(e,hn)),Ea(l,"keypress",Et(e,mn)),Ea(l,"focus",Bi(vn,e)),Ea(l,"blur",Bi(yn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Ea:Ia;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function qt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gt(e,t){for(var n=wi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yt(e,t,n,r){var i=e.display;if(!n&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Zr(e.doc,c.line).text).length==c.ch){var u=Fa(s,s.length,e.options.tabSize)-s.length;c=Bo(c.line,Math.max(0,Math.round((o-Ge(e.display).left)/xt(e.display))-u))}return c}function $t(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Gt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(t,e)){var r=Yt(t,e);switch(window.focus(),ki(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Vt(t,e,r):wi(e)==n.scroller&&Ma(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),r&&be(t.doc,r),setTimeout(function(){n.input.focus()},20),Ma(e);break;case 3:Do?xn(t,e):gn(t)}}}}function Vt(e,t,n){xo?setTimeout(Bi(X,e),0):e.curOp.focus=Gi();var r,i=+new Date;Uo&&Uo.time>i-400&&0==_o(Uo.pos,n)?r="triple":jo&&jo.time>i-400&&0==_o(jo.pos,n)?(r="double",Uo={time:i,pos:n}):(r="single",jo={time:i,pos:n});var o,a=e.doc.sel,l=Eo?t.metaKey:t.ctrlKey;e.options.dragDrop&&el&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(_o((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(_o(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,l):Xt(e,t,n,r,l)}function Kt(e,t,n,r){var i=e.display,o=+new Date,a=Et(e,function(l){wo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ia(document,"mouseup",a),Ia(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ma(l),!r&&+new Date-200=p;p++){var v=Zr(c,p).text,y=za(v,s,o);s==d?i.push(new fe(Bo(p,y),Bo(p,y))):v.length>y&&i.push(new fe(Bo(p,y),Bo(p,za(v,d,o))))}i.length||i.push(new fe(n,n)),Te(c,he(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=u,b=x.anchor,w=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new fe(Bo(t.line,0),me(c,Bo(t.line+1,0)));_o(k.anchor,b)>0?(w=k.head,b=K(x.from(),k.anchor)):(w=k.anchor,b=V(x.to(),k.head))}var i=h.ranges.slice(0);i[f]=new fe(me(c,b),w),Te(c,he(i,f),Ba)}}function a(t){var n=++y,i=Yt(e,t,!0,"rect"==r);if(i)if(0!=_o(i,g)){e.curOp.focus=Gi(),o(i);var l=b(s,c);(i.line>=l.to||i.linev.bottom?20:0;u&&setTimeout(Et(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(t){e.state.selectingText=!1,y=1/0,Ma(t),s.input.focus(),Ia(document,"mousemove",x),Ia(document,"mouseup",w),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;Ma(t);var u,f,h=c.sel,d=h.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?d[f]:new fe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),Oo?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new fe(n,n)),n=Yt(e,t,!0,!0),f=-1;else if("double"==r){var p=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,p.anchor,p.head):p}else if("triple"==r){var m=new fe(Bo(n.line,0),me(c,Bo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==f?(f=d.length,Te(c,he(d.concat([u]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(d.slice(0,f).concat(d.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):ke(c,f,u,Ba):(f=0,Te(c,new ue([u],0),Ba),h=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,x=Et(e,function(e){ki(e)?a(e):l(e)}),w=Et(e,l);e.state.selectingText=w,Ea(document,"mousemove",x),Ea(document,"mouseup",w)}function Zt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ma(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ni(e,n))return bi(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var u=ni(e.doc,o),f=e.options.gutters[s];return Pa(e,n,e,u,f,t),bi(t)}}}function Jt(e,t){return Zt(e,t,"gutterClick",!0)}function Qt(e){var t=this;if(nn(t),!Ti(t,e)&&!Gt(t.display,e)){Ma(e),xo&&($o=+new Date);var n=Yt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Pi(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Et(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=me(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,s),Le(t.doc,de(n,Qo(s)))}}),l.readAsText(e)}},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Eo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Me(t.doc,de(n,n)),c)for(var s=0;sa.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&Eo&&wo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;fh?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),A(e,{top:d,bottom:p})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ko=(Ko*Vo+n)/(Vo+1),++Vo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function ln(e,t,n){if("string"==typeof t&&(t=ua[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ha}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function sn(e,t,n){for(var r=0;rbo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=un(t,e);Co&&(Jo=r?n:null,!r&&88==n&&!rl&&(Eo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||dn(t)}}function dn(e){function t(e){18!=e.keyCode&&e.altKey||(Za(n,"CodeMirror-crosshair"),Ia(document,"keyup",t),Ia(document,"mouseover",t))}var n=e.display.lineDiv;Ja(n,"CodeMirror-crosshair"),Ea(document,"keyup",t),Ea(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Gt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Eo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Co&&n==Jo)return Jo=null,void Ma(e);if(!Co||e.which&&!(e.which<10)||!un(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Pa(e,"focus",e),e.state.focused=!0,Ja(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Pa(e,"blur",e),e.state.focused=!1,Za(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Gt(e.display,t)||bn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function bn(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wn(e,t){if(_o(e,t.from)<0)return e;if(_o(e,t.to)<=0)return Qo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qo(t).ch-t.to.ch),Bo(n,r)}function kn(e,t){for(var n=[],r=0;r=0;--i)Mn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Mn(e,t)}}function Mn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=_o(t.from,t.to)){var n=kn(e,t);ci(e,t,n,e.cm?e.cm.curOp.id:NaN),En(e,t,n,or(e,t));var r=[];Kr(e,function(e,n){n||-1!=Pi(r,e.history)||(xi(e.history,t),r.push(e.history)),En(e,t,null,or(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s=0;--s){var f=r.changes[s];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(ai(e,f));var h=s?kn(e,f):Ii(a);En(e,f,h,lr(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Qo(f)});var d=[];Kr(e,function(e,t){t||-1!=Pi(d,e.history)||(xi(e.history,f),d.push(e.history)),En(e,f,null,lr(e,f))})}}}}function An(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Ri(e.sel.ranges,function(e){return new fe(Bo(e.anchor.line+t,e.anchor.ch),Bo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Bo(o,Zr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),n||(n=kn(e,t)),e.cm?On(e.cm,t,r):Yr(e,t,r),Me(e,n,Wa)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ti(yr(Zr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Mi(e),Yr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),_e(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?Dt(e):a.line!=l.line||1!=t.text.length||Gr(e.doc,t)?Dt(e,a.line,l.line+1,u):Ht(e,a.line,"text");var h=Ni(e,"changes"),d=Ni(e,"change");if(d||h){var p={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&Ci(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function In(e,t,n,r,i){if(r||(r=n),_o(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function Pn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=ji("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+Ye(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Rn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=dt(e,t),l=n&&n!=t?dt(e,n):a,s=Hn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(rn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(on(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Dn(e,t,n,r,i){var o=Hn(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Hn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ve(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+qe(o),f=a>n,h=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var d=Math.min(n,(h?u:i)-s);d!=l&&(c.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$e(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+p-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Wn(e,t,n){null==t&&null==n||_n(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){_n(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Bo(t.line,t.ch-1):t,r=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function _n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),r=pt(e,t.to),i=Hn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=je(e,t):n="prev");var a=e.options.tabSize,l=Zr(o,t),s=Fa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ha||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Zr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)h+=a,f+=" ";if(c>h&&(f+=Oi(c-h)),f!=u)return In(o,f,Bo(t,0),Bo(t,u.length),"+input"),l.stateAfter=null,!0;for(var d=0;d=0;t--)In(e.doc,"",r[t].from,r[t].to,"+delete");Bn(e)})}function Un(e,t,n,r,i){function o(){var t=l+n;return t=e.first+e.size?!1:(l=t,u=Zr(e,t))}function a(e){var t=(i?fo:ho)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?io:ro)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Zr(e,l);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||a(!p);p=!1){var m=u.text.charAt(s)||"\n",g=_i(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),f&&f!=g){0>n&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!p))break}var v=Ie(e,Bo(l,s),t,c,!0);return _o(t,v)||(v.hitSide=!0),v}function qn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Gn(t,n,r,i){e.defaults[t]=n,r&&(ta[t]=i?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Yn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ji("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vr(e,t.line,t,n,o)||t.line!=n.line&&vr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wo=!0}o.addToHistory&&ci(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ei(e,0),nr(e,new Qn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){kr(e,t)&&ei(t,0)}),o.clearOnEnter&&Ea(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ho=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Dt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Ht(c,u,"text");o.atomic&&Ae(c.doc),Ci(c,"markerAdded",c,o)}return o}function Kn(e,t,n,r,i){r=Wi(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Kr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,me(e,t),me(e,n),r,i));for(var s=0;s=t:o.to>t);(r||(r=[])).push(new Qn(a,o.from,s?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var f=0;ff;++f)p.push(m);p.push(s)}return p}function ar(e){for(var t=0;t0)){var u=[s,1],f=_o(c.from,l.from),h=_o(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function cr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.to,n)>=0:_o(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.from,r)<=0:_o(c.from,r)<0)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function br(e,t){var n=Zr(e,t),r=yr(n);return n==r?t:ti(r)}function wr(e,t){if(t>e.lastLine())return t;var n,r=Zr(e,t);if(!kr(e,r))return t;for(;n=gr(r);)r=n.find(1,!0).line;return ti(r)+1}function kr(e,t){var n=Wo&&t.markedSpans;if(n)for(var r,i=0;io;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Ir(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?sa(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=me(a,t);var s,c=Zr(a,t.line),u=je(e,t.line,n),f=new ma(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pose.options.maxHighlightLength?(l=!1,a&&Hr(e,t,r,f.pos),f.pos=t.length,s=null):s=Ar(Or(n,f,r,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!l||u!=s){for(;cc;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=je(e,ti(t)),i=Rr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Hr(e,t,n,r){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Er(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function Wr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ka:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Br(e,t){var n=ji("span",null,null,wo?"padding-right: .1px":null),r={pre:ji("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,Ji(e.display.measure)&&(o=ii(a))&&(r.addToken=jr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ti(a);qr(a,r,Dr(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=$i(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=$i(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wo){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=$i(r.pre.className,r.textClass||"")),r}function _r(e){var t=ji("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,zr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var h=s.exec(t),d=h?h.index-f:t.length-f;if(d){var p=document.createTextNode(l.slice(f,f+d));xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!h)break;if(f+=d+1," "==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(ji("span",Oi(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(ji("span","\r"==h[0]?"â":"â¤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),xo&&9>bo&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=ji("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function zr(e){for(var t=" ",n=0;nc&&h.from<=c)break}if(h.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-c),i,o,null,l,s),o=null,r=r.slice(h.to-c),c=h.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function qr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",h=null,v=1/0;for(var y,x=[],b=0;bp||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!h||dr(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var b=0;b=d)break;for(var S=Math.min(d,v);;){if(g){var C=p+g.length;if(!h){var L=C>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",f,l)}if(C>=S){g=g.slice(S-p),p=S;break}p=C,u=""}g=i.slice(o,o=n[m++]),a=Wr(n[m++],t.cm.options)}}else for(var m=1;mn;++n)o.push(new ba(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Zr(e,l.line),f=Zr(e,s.line),h=Ii(c),d=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var m=a(0,c.length-1);o(f,f.text,d),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+h+u.text.slice(s.ch),d);else{var m=a(1,c.length-1);m.push(new ba(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var m=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}Ci(e,"change",e,t)}function $r(e){this.lines=e,this.parent=null;for(var t=0,n=0;tt||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Qr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Pi(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ni(e,t){var n=e.first;e:do{for(var r=0;rt){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;rt)break;t-=l}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ii(e.done)):void 0}function ci(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==r))){var l=Ii(o.changes);0==_o(t.from,t.to)&&0==_o(t.from,l.to)?l.to=Qo(t):o.changes.push(ai(e,t))}else{var s=Ii(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[ai(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Pa(e,"historyAdded")}function ui(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Ii(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&li(i.undone)}function hi(e,t){var n=Ii(t);n&&n.ranges&&n.equals(e)||t.push(e)}function di(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,n=0;n-1&&(Ii(l)[f]=u[f],delete u[f])}}}return i}function vi(e,t,n,r){n0?r.slice():Oa:r||Oa}function Ci(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Go?i=Go.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Li,0));for(var a=0;a0}function Ai(e){e.prototype.on=function(e,t){Ea(this,e,t)},e.prototype.off=function(e,t){Ia(this,e,t)}}function Ei(){this.id=null}function Oi(e){for(;ja.length<=e;)ja.push(Ii(ja)+" ");return ja[e]}function Ii(e){return e[e.length-1]}function Pi(e,t){for(var n=0;n-1&&Ya(e)?!0:t.test(e):Ya(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function zi(e){return e.charCodeAt(0)>=768&&$a.test(e)}function ji(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function qi(e,t){return Ui(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Yi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var n=e.split(" "),r=0;r2&&!(xo&&8>bo))}var n=Ka?ji("span","​"):ji("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ji(e){if(null!=Xa)return Xa;var t=qi(e,document.createTextNode("AØ®A")),n=qa(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=qa(t,1,2).getBoundingClientRect();return Xa=r.right-n.right<3}function Qi(e){if(null!=il)return il;var t=qi(e,ji("span","x")),n=t.getBoundingClientRect(),r=qa(t,0,1).getBoundingClientRect();return il=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Ii(t)):e.text.length}function oo(e,t){var n=Zr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return Bo(t,o)}function ao(e,t){for(var n,r=Zr(e.doc,t);n=gr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return Bo(null==t?ti(r):t,o)}function lo(e,t){var n=oo(e,t.line),r=Zr(e.doc,n.line),i=ii(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Bo(n.line,a?0:o)}return n}function so(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function co(e,t){al=null;for(var n,r=0;rt)return r;if(i.from==t||i.to==t){if(null!=n)return so(e,i.level,e[n].level)?(i.from!=i.to&&(al=n),r):(i.from!=i.to&&(al=r),n);n=r}}return n}function uo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&zi(e.text.charAt(t)));return t}function fo(e,t,n,r){var i=ii(e);if(!i)return ho(e,t,n,r);for(var o=co(i,t),a=i[o],l=uo(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?uo(e,a.to,-1,r):uo(e,a.from,1,r)}}function ho(e,t,n,r){var i=t+n;if(r)for(;i>0&&zi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),xo=vo||yo,bo=xo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),ko=wo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Co=/Opera\//.test(po),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Ao=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Eo=No||/Mac/.test(mo),Oo=/\bCrOS\b/.test(po),Io=/win/i.test(mo),Po=Co&&po.match(/Version\/(\d*\.\d*)/);Po&&(Po=Number(Po[1])),Po&&Po>=15&&(Co=!1,wo=!0);var Ro=Eo&&(ko||Co&&(null==Po||12.11>Po)),Do=go||xo&&bo>=9,Ho=!1,Wo=!1;m.prototype=Wi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Eo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Wi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},L.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ea(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ea(o,"cut",t),Ea(o,"copy",t),Ea(e.scroller,"paste",function(t){Gt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ea(e.lineSpace,"selectstart",function(t){Gt(e,t)||Ma(t)}),Ea(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ea(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;qi(n.cursorDiv,e.cursors),qi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rl&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Ua(this.textarea),xo&&bo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",xo&&bo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0; +},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&bo>=9&&this.hasSelection===r||Eo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){Z(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&bo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,xo&&9>bo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!xo||xo&&9>bo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Et(i,ua.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Yt(i,e),s=o.scroller.scrollTop;if(l&&!Co){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Et(i,Te)(i.doc,de(l),Wa);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var d=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&bo>=9&&t(),Do){Aa(e);var p=function(){Ia(window,"mouseup",p),setTimeout(n,20)};Ea(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Wa),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fo.text.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Fo.text.join("\n");var o=document.activeElement;Ua(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Ea(i,"paste",function(e){Ti(r,e)||J(e,r)}),Ea(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=de(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Ea(i,"compositionupdate",function(e){n.composing.data=e.data}),Ea(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ea(i,"touchstart",function(){n.forceCompositionEnd()}),Ea(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(r)})}),Ea(i,"copy",t),Ea(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=_o(K(n,r),t.from())||0!=_o(V(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=qa(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){qi(this.cm.display.cursorDiv,e.cursors),qi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Va(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,de(n,r),Wa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.linet.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Bt(e,r.line)))var a=ti(t.view[0].line),l=t.view[0].node;else var a=ti(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Bt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ti(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=e.doc.splitLines(ce(e,l,u,a,c)),h=Jr(e.doc,Bo(a,0),Bo(c,Zr(e.doc,c).text.length));f.length>1&&h.length>1;)if(Ii(f)==Ii(h))f.pop(),h.pop(),c--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),a++}for(var d=0,p=0,m=f[0],g=h[0],v=Math.min(m.length,g.length);v>d&&m.charCodeAt(d)==g.charCodeAt(d);)++d;for(var y=Ii(f),x=Ii(h),b=Math.min(y.length-(1==f.length?d:0),x.length-(1==h.length?d:0));b>p&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var w=Bo(a,d),k=Bo(c,h.length?Ii(h).length-p:0);return f.length>1||f[0]||_o(w,k)?(In(e.doc,f,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Et(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Et(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Et(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&_o(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return V(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var zo,jo,Uo,qo={left:0,right:0,top:0,bottom:0},Go=null,Yo=0,$o=0,Vo=0,Ko=null;xo?Ko=-.53:go?Ko=15:So?Ko=-.7:Lo&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Ko,t.y*=Ko,t};var Zo=new Ei,Jo=null,Qo=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Ii(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ta.hasOwnProperty(e)&&Et(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($n(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Fn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new fe(o,c[r].to()),Wa)}}}),getTokenAt:function(e,t){return Ir(this,e,t)},getLineTokens:function(e,t){return Ir(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Zr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!la.hasOwnProperty(t))return n;var r=la[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;oi&&(e=i,r=!0),n=Zr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return zn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Ht(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Zr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=dt(this,me(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&Dn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(hn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:pn,execCommand:function(e){return ua.hasOwnProperty(e)?ua[e].call(null,this):void 0},triggerElectric:Ot(function(e){Q(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Un(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Un(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},_a)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):jn(this,function(n){var i=Un(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=me(this.doc,e);t>a;++a){var s=dt(this,l,"div");if(null==o?o=s.left:s.left=o,l=qn(this,s,i,n),l.hitSide)break}return l},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=dt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=qn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Wn(n,null,ht(n,s,"div").top-l.top),s},_a),i.length)for(var a=0;a0&&l(n.charAt(r-1));)--r;for(;i.5)&&a(this),Pa(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Xr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ai(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),lt(e),Dt(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Bo(r,o))}r++});for(var i=n.length-1;i>=0;i--)In(e.doc,t,n[i],Bo(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",_r,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Io),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){l(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){var i=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){d(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){d(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){return e},s,!0),Gn("showCursorWhenSelecting",!1,Re,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,Ut),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,Re,!0),Gn("singleCursorHeightPerLine",!0,Re,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);var ra=e.modes={},ia=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){ia[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ia.hasOwnProperty(t))t=ia[t];else if(t&&"string"==typeof t.name&&ia.hasOwnProperty(t.name)){var n=ia[t.name];"string"==typeof n&&(n={name:n}),t=Hi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(oa.hasOwnProperty(n.name)){var o=oa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var oa=e.modeExtensions={};e.extendMode=function(e,t){var n=oa.hasOwnProperty(e)?oa[e]:oa[e]={};Wi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ca.prototype[e]=t},e.defineOption=Gn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var la=e.helpers={};e.registerHelper=function(t,n,r){la.hasOwnProperty(t)||(la[t]=e[t]={_global:[]}),la[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),la[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ca=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ua=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Wa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Wa)},killLine:function(e){jn(e,function(t){if(t.empty()){var n=Zr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Zr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Bn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},fa=e.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa["default"]=Eo?fa.macDefault:fa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Ri(n.split(" "),Yn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ga=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ga};Ai(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),Ni(this,"clear")){var n=this.find();n&&Ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Ci(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;in;++n){var i=this.lines[n];this.height-=i.height,Nr(i),Ci(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;re;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;ne){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $r))){var l=[];this.collapse(l),this.children=[new $r(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Sa=0,Ca=e.Doc=function(e,t,n,r){if(!(this instanceof Ca))return new Ca(e,t,n,r);null==n&&(n=0),Vr.call(this,[new $r([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=Bo(n,0);this.sel=de(i),this.history=new oi(null),this.id=++Sa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Yr(this,{from:i,to:i,text:e}),Te(this,de(i),Wa)};Ca.prototype=Hi(Vr.prototype,{constructor:Ca,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r=0;o--)Tn(this,r[o]);l?Le(this,l):this.cm&&Bn(this.cm)}),undo:It(function(){Nn(this,"undo")}),redo:It(function(){Nn(this,"redo")}),undoSelection:It(function(){Nn(this,"undo",!0)}),redoSelection:It(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=o,void++n)}),me(this,Bo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.tol||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},za=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},ja=[""],Ua=function(e){e.select()};No?Ua=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(Ua=function(e){try{e.select()}catch(t){}});var qa,Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ya=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ga.test(e))},$a=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;qa=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Va=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>bo&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Ka,Xa,Za=e.rmClass=function(e,t){var n=e.className,r=Yi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ja=e.addClass=function(e,t){var n=e.className;Yi(t).test(n)||(e.className+=(n?" ":"")+t)},Qa=!1,el=function(){if(xo&&9>bo)return!1;var e=ji("div");return"draggable"in e||"dragDrop"in e}(),tl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rl=function(){var e=ji("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),il=null,ol=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)ol[e+48]=ol[e+96]=String(e);for(var e=65;90>=e;e++)ol[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ol[e+111]=ol[e+63235]="F"+e}();var al,ll=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],h=0;u>h;++h)f.push(r=e(n.charCodeAt(h)));for(var h=0,d=c;u>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=c;u>h;++h){var r=f[h];"1"==r&&"r"==p?f[h]="n":a.test(r)&&(p=r,"r"==r&&(f[h]="R"))}for(var h=1,d=f[0];u-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=r}for(var h=0;u>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var m=h+1;u>m&&"%"==f[m];++m);for(var g=h&&"!"==f[h-1]||u>m&&"1"==f[m]?"1":"N",v=h;m>v;++v)f[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;u>h;++h)if(o.test(f[h])){for(var m=h+1;u>m&&o.test(f[m]);++m);for(var y="L"==(h?f[h-1]:c),x="L"==(u>m?f[m]:c),g=y||x?"L":"R",v=h;m>v;++v)f[v]=g;h=m-1}for(var b,w=[],h=0;u>h;)if(l.test(f[h])){var k=h;for(++h;u>h&&l.test(f[h]);++h);w.push(new t(0,k,h))}else{var S=h,C=w.length;for(++h;u>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(s.test(f[v])){v>S&&w.splice(C,0,new t(1,S,v));var L=v;for(++v;h>v&&s.test(f[v]);++v);w.splice(C,0,new t(2,L,v)),S=v}else++v;h>S&&w.splice(C,0,new t(1,S,h))}return 1==w[0].level&&(b=n.match(/^\s+/))&&(w[0].from=b[0].length,w.unshift(new t(0,0,b[0].length))),1==Ii(w).level&&(b=n.match(/\s+$/))&&(Ii(w).to-=b[0].length,w.push(new t(0,u-b[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=Ii(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.15.2",e})},{}],11:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],i):i(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},l={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)l[s]=r[s];return l.name="markdown",e.overlayMode(e.getMode(n,l),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],i):i(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,k&&e.f==c&&(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(t,o){var l=t.sol(),s=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,s&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,S.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(!(a(o.prevLine)||o.quote||s||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(t.eat(">"))return o.quote=l?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),h(o);if("["===t.peek())return i(t,o,y);if(t.match(L,!0))return o.hr=!0,S.hr;if((a(o.prevLine)||s)&&(t.match(T,!1)||t.match(M,!1))){var d=null;for(t.match(T,!0)?d="ul":(t.match(M,!0),d="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()")>-1)&&(n.f=p,n.block=s,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function f(e,t){e.match(t.fencedChars),t.block=s,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=h(t);return t.code=0,r}function h(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(S.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.quote+"-"+e.quote):t.push(S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(S.list2):t.push(S.list3):t.push(S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(O,!0)?h(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,h(r);if(r.taskList){var a="x"!==t.match(N,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,h(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"), +h(r);var l=t.sol(),s=t.next();if(r.linkTitle){r.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return S.linkHref}if("`"===s){var d=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==r.code)return r.code=p,h(r);if(p==r.code){var v=h(r);return r.code=0,v}return r.formatting=d,h(r)}if(r.code)return h(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var y=h(r),x=S.formatting+"-escape";return y?y+" "+x:x}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),h(r);if("]"===s&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=h(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var k=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(C=!0)}}if("*"===s||"_"===s&&!C)if(l&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var v=h(r);return r.strong=!1,v}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),h(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var v=h(r);return r.em=!1,v}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),h(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=h(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),h(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return h(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),h(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=h(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=h(r);return r.linkHref=!1,o}return t.match(P[e]),r.linkHref=!0,h(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=x,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):i(e,t,p)}function x(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=h(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,S.linkHref+" url")}var w=e.getMode(t,"text/html"),k="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in S)S.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(S[C]=n.tokenTypeOverrides[C]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,M=/^[0-9]+([.)])\s+/,N=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,O=/^[^#!\[\]*_\\<>` "'(~]+/,I=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},R={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:R}},blankLine:l,getType:h,fold:"markdown"};return R},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||S.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(f(n),d)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),d}return M="error",y}function x(e,t,n){return"equals"==e?b:(S.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&S.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,S={},C=i.htmlMode?t:n;for(var L in C)S[L]=C[L];for(var L in i)S[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return S.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/$/,blockCommentStart:"",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=l;u>0;o=256*o+e[t+f],f+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,l,s,c=8*o-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),t+=a+f>=1?h/s:h*Math.pow(2,1-f),t*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*s-1)*Math.pow(2,i),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&l,d+=p,l/=256,i-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],16:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],17:[function(t,n,r){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}function i(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function a(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function l(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function f(e){for(var t,n,r=1;rAn error occured:

"+l(u.message+"",!0)+"
";throw u}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=c(d.item,"gm")(/bull/g,d.bullet)(),d.list=c(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=c(d.blockquote)("def",d.def)(),d._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",d.html=c(d.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,d._tag)(),d.paragraph=c(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=f({},d),d.gfm=f({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=c(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=f({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=d,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,l,s,c,u,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,f=o.length,u=0;f>u;u++)s=o[u],c=s.length,s=s.replace(/^ *([*+-]|\d+\.) +/,""),~s.indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(l=d.bullet.exec(o[u+1])[0],a===l||a.length>1&&l.length>1||(e=o.slice(u+1).join("\n")+e,u=f-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==f-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table", +header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=f({},p),p.pedantic=f({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=f({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=f({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),i.rules=p,i.output=function(e,t,n){var r=new i(t,n);return r.output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=l(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):l(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(l(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(l(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=l(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=l(t.href),r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"â€").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:l(e,!0))+"\n
\n":"
"+(n?e:l(e,!0))+"\n
"},o.prototype.blockquote=function(e){return"
\n"+e+"
\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"'+e+"\n"},o.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},o.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},o.prototype.paragraph=function(e){return"

    "+e+"

    \n"},o.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},o.prototype.tablerow=function(e){return"\n"+e+"\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},o.prototype.strong=function(e){return""+e+""},o.prototype.em=function(e){return""+e+""},o.prototype.codespan=function(e){return""+e+""},o.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},o.prototype.del=function(e){return""+e+""},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='
    "},o.prototype.image=function(e,t,n){var r=''+n+'":">"},o.prototype.text=function(e){return e},a.parse=function(e,t,n){var r=new a(t,n);return r.parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;ea;a++)for(var s=this.compoundRules[a],c=0,u=s.length;u>c;c++)this.compoundRuleCodes[s[c]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var a in this.compoundRuleCodes)0==this.compoundRuleCodes[a].length&&delete this.compoundRuleCodes[a];for(var a=0,l=this.compoundRules.length;l>a;a++){for(var f=this.compoundRules[a],h="",c=0,u=f.length;u>c;c++){var d=f[c];h+=d in this.compoundRuleCodes?"("+this.compoundRuleCodes[d].join("|")+")":d}this.compoundRules[a]=new RegExp(h,"i")}}return this};i.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(t,r){if(r||(r="utf8"),"undefined"!=typeof XMLHttpRequest){var i=new XMLHttpRequest;return i.open("GET",t,!1),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+r),i.send(null),i.responseText}if("undefined"!=typeof e){var o=e("fs");try{if(o.existsSync(t)){var a=o.statSync(t),l=o.openSync(t,"r"),s=new n(a.size);return o.readSync(l,s,0,s.length,null),s.toString(r,0,s.length)}console.log("Path "+t+" does not exist.")}catch(c){return console.log(c),""}}},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),r=0,i=n.length;i>r;r++){var o=n[r],a=o.split(/\s+/),l=a[0];if("PFX"==l||"SFX"==l){for(var s=a[1],c=a[2],u=parseInt(a[3],10),f=[],h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),x=p[4],b={};b.add=v,y.length>0&&(b.continuationClasses=y),"."!==x&&("SFX"===l?b.match=new RegExp(x+"$"):b.match=new RegExp("^"+x)),"0"!=m&&("SFX"===l?b.remove=new RegExp(m+"$"):b.remove=m),f.push(b)}t[s]={type:l,combineable:"Y"==c,entries:f},r+=u}else if("COMPOUNDRULE"===l){for(var u=parseInt(a[1],10),h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}r+=u}else if("REP"===l){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[l]=a[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),r={},i=1,o=n.length;o>i;i++){var a=n[i],l=a.split("/",2),s=l[0];if(l.length>1){var c=this.parseRuleCodes(l[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(s,c);for(var u=0,f=c.length;f>u;u++){var h=c[u],d=this.rules[h];if(d)for(var p=this._applyRule(s,d),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),d.combineable)for(var y=u+1;f>y;y++){var x=c[y],b=this.rules[x];if(b&&b.combineable&&d.type!=b.type)for(var w=this._applyRule(v,b),k=0,S=w.length;S>k;k++){var C=w[k];t(C,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;r>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;o>i;i++){var a=n[i];if(!a.match||e.match(a.match)){var l=e;if(a.remove&&(l=l.replace(a.remove,"")),"SFX"===t.type?l+=a.add:l=a.add+l,r.push(l),"continuationClasses"in a)for(var s=0,c=a.continuationClasses.length;c>s;s++){var u=this.rules[a.continuationClasses[s]];u&&(r=r.concat(this._applyRule(l,u)))}}}return r},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;r>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(var n=0,r=t.length;r>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,r=e.length;r>n;n++){for(var i=e[n],o=[],a=0,l=i.length+1;l>a;a++)o.push([i.substring(0,a),i.substring(a,i.length)]);for(var s=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1]&&s.push(u[0]+u[1].substring(1))}for(var f=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1].length>1&&f.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1].substring(1))}for(var m=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1])}t=t.concat(s),t=t.concat(f),t=t.concat(h),t=t.concat(m)}return t}function r(e){for(var t=[],n=0;nu;u++)l[u]in s?s[l[u]]+=1:s[l[u]]=1;var h=[];for(var u in s)h.push([u,s[u]]);h.sort(i).reverse();for(var d=[],u=0,f=Math.min(t,h.length);f>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||d.push(h[u][0]);return d}if(t||(t=5),this.check(e))return[];for(var o=0,a=this.replacementTable.length;a>o;o++){var l=this.replacementTable[o];if(-1!==e.indexOf(l[0])){var s=e.replace(l[0],l[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",i(e)}},"undefined"!=typeof t&&(t.exports=i)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){var r=e("codemirror");r.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentMore");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}},r.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentLess");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}}},{codemirror:10}],20:[function(e,t,n){"use strict";function r(e){return e=U?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function i(e,t,n){e=e||{};var r=document.createElement("a");return t=void 0==t?!0:t,e.title&&t&&(r.title=a(e.title,e.action,n),U&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function a(e,t,n){var i,o=e;return t&&(i=Y(t),n[i]&&(o+=" ("+r(n[i])+")")),o}function l(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},l=0;l=0&&(d=c.getLineHandle(o),!t(d));o--);var v,y,x,b,w=c.getTokenAt({line:o,ch:1}),k=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=k+"\n",y=u.line),t(c.getLineHandle(f.line))?(x="",b=f.line,0===f.ch&&(b+=1)):0!==f.ch&&t(c.getLineHandle(f.line+1))?(x="",b=f.line+1):(x=k+"\n",b=f.line+1),0===f.ch&&(b-=1),c.operation(function(){c.replaceRange(x,{line:b,ch:0},{line:b+(x?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:b+(v?1:-1),ch:0}),c.focus()}else{var S=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===r(c,u.line+1)?(o=u.line,S=u.line+1):(a=u.line,S=u.line-1)),void 0===o)for(o=S;o>=0&&(d=c.getLineHandle(o),!t(d));o--);if(void 0===a)for(l=c.lineCount(),a=S;l>a&&(d=c.getLineHandle(a),!t(d));a++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:a-1,ch:0},{line:a,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==f.line||u.ch!==f.ch)o=u.line,a=f.line,0===f.ch&&a--;else{for(o=u.line;o>=0;o--)if(d=c.getLineHandle(o),!d.text.match(/^\s*$/)&&"indented"!==r(c,o,d)){o+=1;break}for(l=c.lineCount(),a=u.line;l>a;a++)if(d=c.getLineHandle(a),!d.text.match(/^\s*$/)&&"indented"!==r(c,a,d)){a-=1;break}}var C=c.getLineHandle(a+1),L=C&&c.getTokenAt({line:a+1,ch:C.text.length-1}),T=L&&n(L).indentedCode;T&&c.replaceRange("\n",{line:a+1,ch:0});for(var M=o;a>=M;M++)c.indentLine(M,"subtract");c.focus()}else{var N=u.line===f.line&&u.ch===f.ch&&0===u.ch,A=u.line!==f.line;N||A?i(c,u,f,s):E(c,!1,["`","`"])}}function d(e){var t=e.codemirror;I(t,"quote")}function p(e){var t=e.codemirror;O(t,"smaller")}function m(e){var t=e.codemirror;O(t,"bigger")}function g(e){var t=e.codemirror;O(t,void 0,1)}function v(e){var t=e.codemirror;O(t,void 0,2)}function y(e){var t=e.codemirror;O(t,void 0,3)}function x(e){var t=e.codemirror;I(t,"unordered-list")}function b(e){var t=e.codemirror;I(t,"ordered-list")}function w(e){var t=e.codemirror;R(t)}function k(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.link),!i)?!1:void E(t,n.link,r.insertTexts.link,i)}function S(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.image),!i)?!1:void E(t,n.image,r.insertTexts.image,i)}function C(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,c=n.previousSibling;l.className=l.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){r.innerHTML=e.options.previewRender(e.value(),r)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=e.options.toolbar?e.toolbarElements.preview:!1,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&N(e)}function E(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end");r&&(a=a.replace("#url#",r)),t?(i=e.getLine(l.line),o=i.slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function O(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?0>=o?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?0>=o?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?0>=o?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):0>=o?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function I(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=l(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function P(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeof r?n:r;var i,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}function R(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function D(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=D(e[n]||{},t[n]):e[n]=t[n]);return e}function H(e){for(var t=1;t=19968?n[i].length:1;return r}function B(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in K)K.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(K[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=H({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=H({},X,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=H({},J,e.blockStyles||{}),e.shortcuts=H({},G,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function _(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var F=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var z=e("codemirror-spell-checker"),j=e("marked"),U=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:S,toggleBlockquote:d,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:f,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:C,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},G={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Y=function(e){for(var t in q)if(q[t]===e)return t;return null},$=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0); +}(navigator.userAgent||navigator.vendor||window.opera),e},V="",K={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:f,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:d,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:S,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:C,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},X={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Z={link:"URL for the link:",image:"URL of the image:"},J={bold:"**",code:"```",italic:"*"};B.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},B.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&!function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var a,l;if(t.spellChecker!==!1?(a="spell-checker",l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1,z({codeMirrorInstance:F})):(a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1),this.codemirror=F.fromTextArea(e,{mode:a,backdrop:l,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0!=t.styleSelectedText?t.styleSelectedText:!0}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},B.prototype.autosave=function(){if(_()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r;a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=10>i?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.clearAutosavedValue=function(){if(_()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)return void(r=!1);i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,a=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=a}),n.onscroll=function(){if(i)return void(i=!1);r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,a)},n},B.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t { + $scope.clearInput(); + if (!resp.data || resp.data.status !== 'success') { + return events.emit('error', trans('error')); + } + events.emit('success', trans(resp.data.message)); + }, checkError('add')); + + }; + + function checkError(errorGroupName) { + $scope.errors[errorGroupName] = {}; + return function(response) { + if (typeof response.data !== 'undefined' && typeof response.data.error !== 'undefined') { + events.emit('error', response.data.error); + } + if (typeof response.data !== 'undefined' && typeof response.data.validation !== 'undefined') { + $scope.errors[errorGroupName] = response.data.validation; + console.log($scope.errors[errorGroupName]) + } + } + } + }]); + + + // CommentListController + ngApp.controller('CommentListController', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) { + let vm = this; + $scope.errors = {}; + $scope.defaultAvatar = defaultAvatar; + vm.totalCommentsStr = 'Loading...'; + $scope.editorChange = function (content) { + console.log(content); + } + + $timeout(function() { + console.log($scope.pageId); + $http.get(window.baseUrl(`/ajax/page/${$scope.pageId}/comments/`)).then(resp => { + if (!resp.data || resp.data.success !== true) { + // TODO : Handle error + return; + } + vm.comments = resp.data.comments.data; + vm.totalComments = resp.data.comments.total; + if (vm.totalComments === 0) { + vm.totalCommentsStr = 'No comments found.'; + } else if (vm.totalComments === 1) { + vm.totalCommentsStr = '1 Comments'; + } else { + vm.totalCommentsStr = vm.totalComments + ' Comments' + } + }, checkError('app')); + }); + + function checkError(errorGroupName) { + $scope.errors[errorGroupName] = {}; + return function(response) { + console.log(resp); + } + } + }]); + }; diff --git a/resources/assets/js/directives.js b/resources/assets/js/directives.js index ef8bcd85c..537a016f5 100644 --- a/resources/assets/js/directives.js +++ b/resources/assets/js/directives.js @@ -214,6 +214,19 @@ export default function (ngApp, events) { } }]); + let renderer = new markdown.Renderer(); + // Custom markdown checkbox list item + // Attribution: https://github.com/chjj/marked/issues/107#issuecomment-44542001 + renderer.listitem = function(text) { + if (/^\s*\[[x ]\]\s*/.test(text)) { + text = text + .replace(/^\s*\[ \]\s*/, '') + .replace(/^\s*\[x\]\s*/, ''); + return `
  • ${text}
  • `; + } + return `
  • ${text}
  • `; + }; + /** * Markdown input * Handles the logic for just the editor input field. @@ -231,13 +244,13 @@ export default function (ngApp, events) { element = element.find('textarea').first(); let content = element.val(); scope.mdModel = content; - scope.mdChange(markdown(content)); + scope.mdChange(markdown(content, {renderer: renderer})); element.on('change input', (event) => { content = element.val(); $timeout(() => { scope.mdModel = content; - scope.mdChange(markdown(content)); + scope.mdChange(markdown(content, {renderer: renderer})); }); }); @@ -814,4 +827,52 @@ export default function (ngApp, events) { } }; }]); + + + ngApp.directive('simpleMarkdownInput', ['$timeout', function ($timeout) { + return { + restrict: 'A', + scope: { + smdModel: '=', + smdChange: '=', + smdGetContent: '=', + smdClear: '=' + }, + link: function (scope, element, attrs) { + // Set initial model content + element = element.find('textarea').first(); + let simplemde = new SimpleMDE({ + element: element[0], + status: [] + }); + let content = element.val(); + simplemde.value(content) + scope.smdModel = content; + + simplemde.codemirror.on('change', (event) => { + content = simplemde.value(); + $timeout(() => { + scope.smdModel = content; + if (scope.smdChange) { + scope.smdChange(element, content); + } + }); + }); + + if ('smdGetContent' in attrs) { + scope.smdGetContent = function () { + return simplemde.options.previewRender(simplemde.value()); + }; + } + + if ('smdClear' in attrs) { + scope.smdClear = function () { + simplemde.value(''); + scope.smdModel = ''; + }; + } + } + } + }]); + }; diff --git a/resources/assets/sass/_blocks.scss b/resources/assets/sass/_blocks.scss index a2023aa37..bd3f8ff4e 100644 --- a/resources/assets/sass/_blocks.scss +++ b/resources/assets/sass/_blocks.scss @@ -135,11 +135,19 @@ border-left: 3px solid #BBB; background-color: #EEE; padding: $-s; + padding-left: $-xl; display: block; + position: relative; &:before { font-family: 'Material-Design-Iconic-Font'; - padding-right: $-s; + left: $-xs + 4px; + top: 50%; + margin-top: -9px; + //top: $-xs + 5px; display: inline-block; + position: absolute; + font-size: 1.222em; + line-height: 1; } &.success { border-left-color: $positive; diff --git a/resources/assets/sass/_buttons.scss b/resources/assets/sass/_buttons.scss index 791a5bb72..6e03c9217 100644 --- a/resources/assets/sass/_buttons.scss +++ b/resources/assets/sass/_buttons.scss @@ -54,6 +54,9 @@ $button-border-radius: 2px; &.muted { @include generate-button-colors(#EEE, #888); } + &.muted-light { + @include generate-button-colors(#666, #e4e4e4); + } } .text-button { @@ -92,6 +95,9 @@ $button-border-radius: 2px; width: 100%; text-align: center; display: block; + &.text-left { + text-align: left; + } } .button.icon { @@ -100,6 +106,19 @@ $button-border-radius: 2px; } } +.button.svg { + svg { + display: inline-block; + position: absolute; + left: $-m; + top: $-s - 2px; + width: 24px; + } + padding: $-s $-m; + padding-bottom: $-s - 2px; + padding-left: $-m*2 + 24px; +} + .button[disabled] { background-color: #BBB; cursor: default; diff --git a/resources/assets/sass/_grid.scss b/resources/assets/sass/_grid.scss index 231c12d4d..b32dafd38 100644 --- a/resources/assets/sass/_grid.scss +++ b/resources/assets/sass/_grid.scss @@ -55,20 +55,6 @@ div[class^="col-"] img { } } -.center-box { - margin: $-xl auto 0 auto; - padding: $-m $-xxl $-xl*2 $-xxl; - max-width: 346px; - display: inline-block; - text-align: left; - vertical-align: top; - &.login { - background-color: #EEE; - box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1); - border: 1px solid #DDD; - } -} - .row { margin-left: -$-m; margin-right: -$-m; diff --git a/resources/assets/sass/_pages.scss b/resources/assets/sass/_pages.scss index e5334c69c..b06892c1d 100755 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -310,4 +310,8 @@ background-color: #EEE; } } +} + +.comment-editor .CodeMirror, .comment-editor .CodeMirror-scroll { + min-height: 175px; } \ No newline at end of file diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index 79d3c3a92..a74a81647 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -281,6 +281,14 @@ ol { overflow: hidden; } +li.checkbox-item { + list-style: none; + margin-left: - ($-m * 1.3); + input[type="checkbox"] { + margin-right: $-xs; + } +} + /* * Generic text styling classes */ diff --git a/resources/assets/sass/_variables.scss b/resources/assets/sass/_variables.scss index 23bf2b219..3e864aaa4 100644 --- a/resources/assets/sass/_variables.scss +++ b/resources/assets/sass/_variables.scss @@ -56,3 +56,6 @@ $text-light: #EEE; $bs-light: 0 0 4px 1px #CCC; $bs-med: 0 1px 3px 1px rgba(76, 76, 76, 0.26); $bs-hover: 0 2px 2px 1px rgba(0,0,0,.13); + +// comments +$comment-border: #DDD; \ No newline at end of file diff --git a/resources/assets/sass/export-styles.scss b/resources/assets/sass/export-styles.scss index 7e1ab4e9e..72b5b16b5 100644 --- a/resources/assets/sass/export-styles.scss +++ b/resources/assets/sass/export-styles.scss @@ -1,4 +1,4 @@ -@import "reset"; +//@import "reset"; @import "variables"; @import "mixins"; @import "html"; @@ -10,6 +10,7 @@ @import "header"; @import "lists"; @import "pages"; +@import "comments"; table { border-spacing: 0; diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 7d33bd0a6..cd43650ee 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -12,10 +12,12 @@ @import "animations"; @import "tinymce"; @import "highlightjs"; +@import "simplemde"; @import "components"; @import "header"; @import "lists"; @import "pages"; +@import "comments"; [v-cloak], [v-show] {display: none;} @@ -251,15 +253,24 @@ $btt-size: 40px; } } - - - - - - - - - +.center-box { + margin: $-xl auto 0 auto; + padding: $-m $-xxl $-xl $-xxl; + width: 420px; + max-width: 100%; + display: inline-block; + text-align: left; + vertical-align: top; + //border: 1px solid #DDD; + input { + width: 100%; + } + &.login { + background-color: #EEE; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1); + border: 1px solid #DDD; + } +} diff --git a/resources/lang/de/auth.php b/resources/lang/de/auth.php index c58d9d974..f253cdfa1 100644 --- a/resources/lang/de/auth.php +++ b/resources/lang/de/auth.php @@ -14,7 +14,50 @@ return [ 'throttle' => 'Zu viele Anmeldeversuche. Bitte versuchen sie es in :seconds Sekunden erneut.', /** - * Email Confirmation Text + * Login & Register + */ + 'sign_up' => 'Registrieren', + 'log_in' => 'Anmelden', + 'logout' => 'Abmelden', + + 'name' => 'Name', + 'username' => 'Benutzername', + 'email' => 'E-Mail', + 'password' => 'Passwort', + 'password_confirm' => 'Passwort bestätigen', + 'password_hint' => 'Mindestlänge: 5 Zeichen', + 'forgot_password' => 'Passwort vergessen?', + 'remember_me' => 'Angemeldet bleiben', + 'ldap_email_hint' => 'Bitte geben Sie eine E-Mail-Adresse ein, um diese mit dem Account zu nutzen.', + 'create_account' => 'Account anlegen', + 'social_login' => 'Social Login', + 'social_registration' => 'Social Registrierung', + 'social_registration_text' => 'Mit einem dieser Möglichkeiten registrieren oder anmelden.', + + + 'register_thanks' => 'Vielen Dank für Ihre Registrierung!', + 'register_confirm' => 'Bitte prüfen Sie Ihren E-Mail Eingang und klicken auf den Verifizieren-Button, um :appName nutzen zu können.', + 'registrations_disabled' => 'Die Registrierung ist momentan nicht möglich', + 'registration_email_domain_invalid' => 'Diese E-Mail-Domain ist für die Benutzer der Applikation nicht freigeschaltet.', + 'register_success' => 'Vielen Dank für Ihre Registrierung! Die Daten sind gespeichert und Sie sind angemeldet.', + + + /** + * Password Reset + */ + 'reset_password' => 'Passwort vergessen', + 'reset_password_send_instructions' => 'Bitte geben Sie unten Ihre E-Mail-Adresse ein und Sie erhalten eine E-Mail, um Ihr Passwort zurück zu setzen.', + 'reset_password_send_button' => 'Passwort zurücksetzen', + 'reset_password_sent_success' => 'Eine E-Mail mit den Instruktionen, um Ihr Passwort zurückzusetzen wurde an :email gesendet.', + 'reset_password_success' => 'Ihr Passwort wurde erfolgreich zurück gesetzt.', + + 'email_reset_subject' => 'Passwort zurücksetzen für :appName', + 'email_reset_text' => 'Sie erhalten diese E-Mail, weil eine Passwort-Rücksetzung für Ihren Account beantragt wurde.', + 'email_reset_not_requested' => 'Wenn Sie die Passwort-Rücksetzung nicht ausgelöst haben, ist kein weiteres Handeln notwendig.', + + + /** + * Email Confirmation */ 'email_confirm_subject' => 'Bestätigen sie ihre E-Mail Adresse bei :appName', 'email_confirm_greeting' => 'Danke, dass sie :appName beigetreten sind!', @@ -23,4 +66,10 @@ return [ 'email_confirm_send_error' => 'Bestätigungs-E-Mail benötigt, aber das System konnte die E-Mail nicht versenden. Kontaktieren sie den Administrator, um sicherzustellen, dass das Sytsem korrekt eingerichtet ist.', 'email_confirm_success' => 'Ihre E-Mail Adresse wurde bestätigt!', 'email_confirm_resent' => 'Bestätigungs-E-Mail wurde erneut versendet, bitte überprüfen sie ihren Posteingang.', + + 'email_not_confirmed' => 'E-Mail-Adresse ist nicht bestätigt', + 'email_not_confirmed_text' => 'Ihre E-Mail-Adresse ist bisher nicht bestätigt.', + 'email_not_confirmed_click_link' => 'Bitte klicken Sie auf den Link in der E-Mail, die Sie nach der Registrierung erhalten haben.', + 'email_not_confirmed_resend' => 'Wenn Sie die E-Mail nicht erhalten haben, können Sie die Nachricht erneut anfordern. Füllen Sie hierzu bitte das folgende Formular aus:', + 'email_not_confirmed_resend_button' => 'Bestätigungs E-Mail erneut senden', ]; diff --git a/resources/lang/de/common.php b/resources/lang/de/common.php new file mode 100644 index 000000000..7ad1743a0 --- /dev/null +++ b/resources/lang/de/common.php @@ -0,0 +1,58 @@ + 'Abbrechen', + 'confirm' => 'Bestätigen', + 'back' => 'Zurück', + 'save' => 'Speichern', + 'continue' => 'Weiter', + 'select' => 'Auswählen', + + /** + * Form Labels + */ + 'name' => 'Name', + 'description' => 'Beschreibung', + 'role' => 'Rolle', + + /** + * Actions + */ + 'actions' => 'Aktionen', + 'view' => 'Anzeigen', + 'create' => 'Anlegen', + 'update' => 'Aktualisieren', + 'edit' => 'Bearbeiten', + 'sort' => 'Sortieren', + 'move' => 'Verschieben', + 'delete' => 'Löschen', + 'search' => 'Suchen', + 'search_clear' => 'Suche löschen', + 'reset' => 'Zurücksetzen', + 'remove' => 'Entfernen', + + + /** + * Misc + */ + 'deleted_user' => 'Gelöschte Benutzer', + 'no_activity' => 'Keine Aktivitäten zum Anzeigen', + 'no_items' => 'Keine Einträge gefunden.', + 'back_to_top' => 'nach oben', + 'toggle_details' => 'Details zeigen/verstecken', + + /** + * Header + */ + 'view_profile' => 'Profil ansehen', + 'edit_profile' => 'Profil bearbeiten', + + /** + * Email Content + */ + 'email_action_help' => 'Sollte es beim Anklicken des ":actionText" Buttons Probleme geben, kopieren Sie folgende URL und fügen diese in Ihrem Webbrowser ein:', + 'email_rights' => 'Alle Rechte vorbehalten', +]; \ No newline at end of file diff --git a/resources/lang/de/components.php b/resources/lang/de/components.php new file mode 100644 index 000000000..a8538c465 --- /dev/null +++ b/resources/lang/de/components.php @@ -0,0 +1,24 @@ + 'Bild auswählen', + 'image_all' => 'Alle', + 'image_all_title' => 'Alle Bilder anzeigen', + 'image_book_title' => 'Zeige alle Bilder, die in dieses Buch hochgeladen wurden', + 'image_page_title' => 'Zeige alle Bilder, die auf diese Seite hochgeladen wurden', + 'image_search_hint' => 'Nach Bildnamen suchen', + 'image_uploaded' => 'Hochgeladen am :uploadedDate', + 'image_load_more' => 'Mehr', + 'image_image_name' => 'Bildname', + 'image_delete_confirm' => 'Dieses Bild wird auf den folgenden Seiten benutzt. Bitte klicken Sie erneut auf löschen, wenn Sie dieses Bild tatsächlich entfernen möchten.', + 'image_select_image' => 'Bild auswählen', + 'image_dropzone' => 'Ziehen Sie Bilder hier hinein oder klicken Sie hier, um ein Bild auszuwählen', + 'images_deleted' => 'Bilder gelöscht', + 'image_preview' => 'Bildvorschau', + 'image_upload_success' => 'Bild erfolgreich hochgeladen', + 'image_update_success' => 'Bilddetails erfolgreich aktualisiert', + 'image_delete_success' => 'Bild erfolgreich gelöscht' +]; \ No newline at end of file diff --git a/resources/lang/de/entities.php b/resources/lang/de/entities.php new file mode 100644 index 000000000..2859e4ec5 --- /dev/null +++ b/resources/lang/de/entities.php @@ -0,0 +1,225 @@ + 'Kürzlich angelegt', + 'recently_created_pages' => 'Kürzlich angelegte Seiten', + 'recently_updated_pages' => 'Kürzlich aktualisierte Seiten', + 'recently_created_chapters' => 'Kürzlich angelegte Kapitel', + 'recently_created_books' => 'Kürzlich angelegte Bücher', + 'recently_update' => 'Kürzlich aktualisiert', + 'recently_viewed' => 'Kürzlich angesehen', + 'recent_activity' => 'Kürzliche Aktivität', + 'create_now' => 'Jetzt anlegen', + 'revisions' => 'Revisionen', + 'meta_created' => 'Angelegt am :timeLength', + 'meta_created_name' => 'Angelegt am :timeLength durch :user', + 'meta_updated' => 'Aktualisiert am :timeLength', + 'meta_updated_name' => 'Aktualisiert am :timeLength durch :user', + 'x_pages' => ':count Seiten', + 'entity_select' => 'Eintrag auswählen', + 'images' => 'Bilder', + 'my_recent_drafts' => 'Meine kürzlichen Entwürfe', + 'my_recently_viewed' => 'Kürzlich von mir angesehen', + 'no_pages_viewed' => 'Sie haben bisher keine Seiten angesehen.', + 'no_pages_recently_created' => 'Sie haben bisher keine Seiten angelegt.', + 'no_pages_recently_updated' => 'Sie haben bisher keine Seiten aktualisiert.', + 'export' => 'Exportieren', + 'export_html' => 'HTML-Datei', + 'export_pdf' => 'PDF-Datei', + 'export_text' => 'Text-Datei', + + /** + * Permissions and restrictions + */ + 'permissions' => 'Berechtigungen', + 'permissions_intro' => 'Wenn individuelle Berechtigungen aktiviert werden, überschreiben diese Einstellungen durch Rollen zugewiesene Berechtigungen.', + 'permissions_enable' => 'Individuelle Berechtigungen aktivieren', + 'permissions_save' => 'Berechtigungen speichern', + + /** + * Search + */ + 'search_results' => 'Suchergebnisse', + 'search_results_page' => 'Seiten-Suchergebnisse', + 'search_results_chapter' => 'Kapitel-Suchergebnisse', + 'search_results_book' => 'Buch-Suchergebnisse', + 'search_clear' => 'Suche zurücksetzen', + 'search_view_pages' => 'Zeige alle passenden Seiten', + 'search_view_chapters' => 'Zeige alle passenden Kapitel', + 'search_view_books' => 'Zeige alle passenden Bücher', + 'search_no_pages' => 'Es wurden keine passenden Suchergebnisse gefunden', + 'search_for_term' => 'Suche nach :term', + 'search_page_for_term' => 'Suche nach :term in Seiten', + 'search_chapter_for_term' => 'Suche nach :term in Kapiteln', + 'search_book_for_term' => 'Suche nach :term in Büchern', + + /** + * Books + */ + 'book' => 'Buch', + 'books' => 'Bücher', + 'books_empty' => 'Es wurden keine Bücher angelegt', + 'books_popular' => 'Populäre Bücher', + 'books_recent' => 'Kürzlich genutzte Bücher', + 'books_popular_empty' => 'Die populärsten Bücher werden hier angezeigt.', + 'books_create' => 'Neues Buch anlegen', + 'books_delete' => 'Buch löschen', + 'books_delete_named' => 'Buch :bookName löschen', + 'books_delete_explain' => 'Sie möchten das Buch \':bookName\' löschen und alle Seiten und Kapitel entfernen.', + 'books_delete_confirmation' => 'Sind Sie sicher, dass Sie dieses Buch löschen möchten?', + 'books_edit' => 'Buch bearbeiten', + 'books_edit_named' => 'Buch :bookName bearbeiten', + 'books_form_book_name' => 'Buchname', + 'books_save' => 'Buch speichern', + 'books_permissions' => 'Buch-Berechtigungen', + 'books_permissions_updated' => 'Buch-Berechtigungen aktualisiert', + 'books_empty_contents' => 'Es sind noch keine Seiten oder Kapitel für dieses Buch angelegt.', + 'books_empty_create_page' => 'Neue Seite anlegen', + 'books_empty_or' => 'oder', + 'books_empty_sort_current_book' => 'Aktuelles Buch sortieren', + 'books_empty_add_chapter' => 'Neues Kapitel hinzufügen', + 'books_permissions_active' => 'Buch-Berechtigungen aktiv', + 'books_search_this' => 'Dieses Buch durchsuchen', + 'books_navigation' => 'Buch-Navigation', + 'books_sort' => 'Buchinhalte sortieren', + 'books_sort_named' => 'Buch :bookName sortieren', + 'books_sort_show_other' => 'Andere Bücher zeigen', + 'books_sort_save' => 'Neue Reihenfolge speichern', + + /** + * Chapters + */ + 'chapter' => 'Kapitel', + 'chapters' => 'Kapitel', + 'chapters_popular' => 'Populäre Kapitel', + 'chapters_new' => 'Neues Kapitel', + 'chapters_create' => 'Neues Kapitel anlegen', + 'chapters_delete' => 'Kapitel entfernen', + 'chapters_delete_named' => 'Kapitel :chapterName entfernen', + 'chapters_delete_explain' => 'Sie möchten das Kapitel \':chapterName\' löschen und alle Seiten dem direkten Eltern-Buch hinzugefügen.', + 'chapters_delete_confirm' => 'Sind Sie sicher, dass Sie dieses Kapitel löschen möchten?', + 'chapters_edit' => 'Kapitel bearbeiten', + 'chapters_edit_named' => 'Kapitel :chapterName bearbeiten', + 'chapters_save' => 'Kapitel speichern', + 'chapters_move' => 'Kapitel verschieben', + 'chapters_move_named' => 'Kapitel :chapterName verschieben', + 'chapter_move_success' => 'Kapitel in das Buch :bookName verschoben.', + 'chapters_permissions' => 'Kapitel-Berechtigungen', + 'chapters_empty' => 'Aktuell sind keine Kapitel in diesem Buch angelegt.', + 'chapters_permissions_active' => 'Kapitel-Berechtigungen aktiv', + 'chapters_permissions_success' => 'Kapitel-Berechtigungenen aktualisisert', + + /** + * Pages + */ + 'page' => 'Seite', + 'pages' => 'Seiten', + 'pages_popular' => 'Populäre Seiten', + 'pages_new' => 'Neue Seite', + 'pages_attachments' => 'Anhänge', + 'pages_navigation' => 'Seitennavigation', + 'pages_delete' => 'Seite löschen', + 'pages_delete_named' => 'Seite :pageName löschen', + 'pages_delete_draft_named' => 'Seitenentwurf von :pageName löschen', + 'pages_delete_draft' => 'Seitenentwurf löschen', + 'pages_delete_success' => 'Seite gelöscht', + 'pages_delete_draft_success' => 'Seitenentwurf gelöscht', + 'pages_delete_confirm' => 'Sind Sie sicher, dass Sie diese Seite löschen möchen?', + 'pages_delete_draft_confirm' => 'Sind Sie sicher, dass Sie diesen Seitenentwurf löschen möchten?', + 'pages_editing_named' => 'Seite :pageName bearbeiten', + 'pages_edit_toggle_header' => 'Toggle header', + 'pages_edit_save_draft' => 'Entwurf speichern', + 'pages_edit_draft' => 'Seitenentwurf bearbeiten', + 'pages_editing_draft' => 'Seitenentwurf bearbeiten', + 'pages_editing_page' => 'Seite bearbeiten', + 'pages_edit_draft_save_at' => 'Entwurf gespeichert um ', + 'pages_edit_delete_draft' => 'Entwurf löschen', + 'pages_edit_discard_draft' => 'Entwurf verwerfen', + 'pages_edit_set_changelog' => 'Veränderungshinweis setzen', + 'pages_edit_enter_changelog_desc' => 'Bitte geben Sie eine kurze Zusammenfassung Ihrer Änderungen ein', + 'pages_edit_enter_changelog' => 'Veränderungshinweis eingeben', + 'pages_save' => 'Seite speichern', + 'pages_title' => 'Seitentitel', + 'pages_name' => 'Seitenname', + 'pages_md_editor' => 'Redakteur', + 'pages_md_preview' => 'Vorschau', + 'pages_md_insert_image' => 'Bild einfügen', + 'pages_md_insert_link' => 'Link zu einem Objekt einfügen', + 'pages_not_in_chapter' => 'Seite ist in keinem Kapitel', + 'pages_move' => 'Seite verschieben', + 'pages_move_success' => 'Seite nach ":parentName" verschoben', + 'pages_permissions' => 'Seiten Berechtigungen', + 'pages_permissions_success' => 'Seiten Berechtigungen aktualisiert', + 'pages_revisions' => 'Seitenversionen', + 'pages_revisions_named' => 'Seitenversionen von :pageName', + 'pages_revision_named' => 'Seitenversion von :pageName', + 'pages_revisions_created_by' => 'Angelegt von', + 'pages_revisions_date' => 'Versionsdatum', + 'pages_revisions_changelog' => 'Veränderungshinweise', + 'pages_revisions_changes' => 'Veränderungen', + 'pages_revisions_current' => 'Aktuelle Version', + 'pages_revisions_preview' => 'Vorschau', + 'pages_revisions_restore' => 'Zurück sichern', + 'pages_revisions_none' => 'Diese Seite hat keine älteren Versionen.', + 'pages_copy_link' => 'Link kopieren', + 'pages_permissions_active' => 'Seiten-Berechtigungen aktiv', + 'pages_initial_revision' => 'Erste Veröffentlichung', + 'pages_initial_name' => 'Neue Seite', + 'pages_editing_draft_notification' => 'Sie bearbeiten momenten einen Entwurf, der zuletzt um :timeDiff gespeichert wurde.', + 'pages_draft_edited_notification' => 'Diese Seite wurde seit diesem Zeitpunkt verändert. Wir empfehlen Ihnen, diesen Entwurf zu verwerfen.', + 'pages_draft_edit_active' => [ + 'start_a' => ':count Benutzer haben die Bearbeitung dieser Seite begonnen.', + 'start_b' => ':userName hat die Bearbeitung dieser Seite begonnen.', + 'time_a' => 'seit die Seiten zuletzt aktualisiert wurden.', + 'time_b' => 'in den letzten :minCount Minuten', + 'message' => ':start :time. Achten Sie darauf keine Aktualisierungen von anderen Benutzern zu überschreiben!', + ], + 'pages_draft_discarded' => 'Entwurf verworfen. Der aktuelle Seiteninhalt wurde geladen.', + + /** + * Editor sidebar + */ + 'page_tags' => 'Seiten-Schlagwörter', + 'tag' => 'Schlagwort', + 'tags' => 'Schlagworte', + 'tag_value' => 'Schlagwortinhalt (Optional)', + 'tags_explain' => "Fügen Sie Schlagworte hinzu, um Ihren Inhalt zu kategorisieren. \n Sie können einen erklärenden Inhalt hinzufügen, um eine genauere Unterteilung vorzunehmen.", + 'tags_add' => 'Weiteres Schlagwort hinzufügen', + 'attachments' => 'Anhänge', + 'attachments_explain' => 'Sie können auf Ihrer Seite Dateien hochladen oder Links anfügen. Diese werden in der seitlich angezeigt.', + 'attachments_explain_instant_save' => 'Änderungen werden direkt gespeichert.', + 'attachments_items' => 'Angefügte Elemente', + 'attachments_upload' => 'Datei hochladen', + 'attachments_link' => 'Link anfügen', + 'attachments_set_link' => 'Link setzen', + 'attachments_delete_confirm' => 'Klicken Sie erneut auf löschen, um diesen Anhang zu entfernen.', + 'attachments_dropzone' => 'Ziehen Sie Dateien hier hinein oder klicken Sie hier, um eine Datei auszuwählen', + 'attachments_no_files' => 'Es wurden bisher keine Dateien hochgeladen.', + 'attachments_explain_link' => 'Wenn Sie keine Datei hochladen möchten, können Sie stattdessen einen Link anfügen. Dieser Link kann auf eine andere Seite oder zu einer Datei in der Cloud weisen.', + 'attachments_link_name' => 'Link-Name', + 'attachment_link' => 'Link zum Anhang', + 'attachments_link_url' => 'Link zu einer Datei', + 'attachments_link_url_hint' => 'URL einer Seite oder Datei', + 'attach' => 'anfügen', + 'attachments_edit_file' => 'Datei bearbeiten', + 'attachments_edit_file_name' => 'Dateiname', + 'attachments_edit_drop_upload' => 'Ziehen Sie Dateien hier hinein, um diese hochzuladen und zu überschreiben', + 'attachments_order_updated' => 'Reihenfolge der Anhänge aktualisiert', + 'attachments_updated_success' => 'Anhang-Details aktualisiert', + 'attachments_deleted' => 'Anhang gelöscht', + 'attachments_file_uploaded' => 'Datei erfolgrecich hochgeladen', + 'attachments_file_updated' => 'Datei erfolgreich aktualisisert', + 'attachments_link_attached' => 'Link erfolgreich der Seite hinzugefügt', + + /** + * Profile View + */ + 'profile_user_for_x' => 'Benutzer seit :time', + 'profile_created_content' => 'Angelegte Inhalte', + 'profile_not_created_pages' => ':userName hat bisher keine Seiten angelegt.', + 'profile_not_created_chapters' => ':userName hat bisher keine Kapitel angelegt.', + 'profile_not_created_books' => ':userName hat bisher keine Bücher angelegt.', +]; \ No newline at end of file diff --git a/resources/lang/de/errors.php b/resources/lang/de/errors.php index 697952086..e085d9915 100644 --- a/resources/lang/de/errors.php +++ b/resources/lang/de/errors.php @@ -8,5 +8,63 @@ return [ // Pages 'permission' => 'Sie haben keine Berechtigung auf diese Seite zuzugreifen.', - 'permissionJson' => 'Sie haben keine Berechtigung die angeforderte Aktion auszuführen.' + 'permissionJson' => 'Sie haben keine Berechtigung die angeforderte Aktion auszuführen.', + + // Auth + 'error_user_exists_different_creds' => 'Ein Benutzer mit der E-Mail-Adresse :email ist bereits mit anderen Anmeldedaten angelegt.', + 'email_already_confirmed' => 'Die E-Mail-Adresse ist bereits bestätigt. Bitte melden Sie sich an.', + 'email_confirmation_invalid' => 'Der Bestätigungs-Token ist nicht gültig oder wurde bereits verwendet. Bitte registrieren Sie sich erneut.', + 'email_confirmation_expired' => 'Der Bestätigungs-Token ist abgelaufen. Es wurde eine neue Bestätigungs-E-Mail gesendet.', + 'ldap_fail_anonymous' => 'Anonymer LDAP Zugriff ist fehlgeschlafgen', + 'ldap_fail_authed' => 'LDAP Zugriff mit DN & Passwort ist fehlgeschlagen', + 'ldap_extension_not_installed' => 'LDAP PHP Erweiterung ist nicht installiert.', + 'ldap_cannot_connect' => 'Die Verbindung zu LDAP-Server ist fehlgeschlagen. Beim initialen Verbindungsaufbau trat ein Fehler auf.', + 'social_no_action_defined' => 'Es ist keine Aktion definiert', + 'social_account_in_use' => 'Dieses :socialAccount Konto wird bereits verwendet. Bitte melden Sie sich mit dem :socialAccount Konto an.', + 'social_account_email_in_use' => 'Die E-Mail-Adresse :email ist bereits registriert. Wenn Sie bereits registriert sind, können Sie Ihr :socialAccount Konto in Ihren Profil-Einstellungen verknüpfen.', + 'social_account_existing' => 'Dieses :socialAccount Konto ist bereits mit Ihrem Profil verknüpft.', + 'social_account_already_used_existing' => 'Dieses :socialAccount Konto wird bereits durch einen anderen Benutzer verwendet.', + 'social_account_not_used' => 'Dieses :socialAccount Konto ist bisher keinem Benutzer zugeordnet. Bitte verknüpfen Sie deses in Ihrem Profil-Einstellungen.', + 'social_account_register_instructions' => 'Wenn Sie bisher keinen Social-Media Konto besitzen können Sie ein solches Konto mit der :socialAccount Option anlegen.', + 'social_driver_not_found' => 'Social-Media Konto Treiber nicht gefunden', + 'social_driver_not_configured' => 'Ihr :socialAccount Konto ist nicht korrekt konfiguriert.', + + // System + 'path_not_writable' => 'Die Datei kann nicht in den angegebenen Pfad :filePath hochgeladen werden. Stellen Sie sicher, dass dieser Ordner auf dem Server beschreibbar ist.', + 'cannot_get_image_from_url' => 'Bild konnte nicht von der URL :url geladen werden.', + 'cannot_create_thumbs' => 'Der Server kann keine Vorschau-Bilder erzeugen. Bitte prüfen Sie, ob Sie die GD PHP Erweiterung installiert haben.', + 'server_upload_limit' => 'Der Server verbietet das Hochladen von Dateien mit dieser Dateigröße. Bitte versuchen Sie es mit einer kleineren Datei.', + 'image_upload_error' => 'Beim Hochladen des Bildes trat ein Fehler auf.', + + // Attachments + 'attachment_page_mismatch' => 'Die Seite stimmt nach dem Hochladen des Anhangs nicht überein.', + + // Pages + 'page_draft_autosave_fail' => 'Fehler beim Speichern des Entwurfs. Stellen Sie sicher, dass Sie mit dem Internet verbunden sind, bevor Sie den Entwurf dieser Seite speichern.', + + // Entities + 'entity_not_found' => 'Eintrag nicht gefunden', + 'book_not_found' => 'Buch nicht gefunden', + 'page_not_found' => 'Seite nicht gefunden', + 'chapter_not_found' => 'Kapitel nicht gefunden', + 'selected_book_not_found' => 'Das gewählte Buch wurde nicht gefunden.', + 'selected_book_chapter_not_found' => 'Das gewählte Buch oder Kapitel wurde nicht gefunden.', + 'guests_cannot_save_drafts' => 'Gäste können keine Entwürfe speichern', + + // Users + 'users_cannot_delete_only_admin' => 'Sie können den einzigen Administrator nicht löschen.', + 'users_cannot_delete_guest' => 'Sie können den Gast-Benutzer nicht löschen', + + // Roles + 'role_cannot_be_edited' => 'Diese Rolle kann nicht bearbeitet werden.', + 'role_system_cannot_be_deleted' => 'Dies ist eine Systemrolle und kann nicht gelöscht werden', + 'role_registration_default_cannot_delete' => 'Diese Rolle kann nicht gelöscht werden solange sie als Standardrolle für neue Registrierungen gesetzt ist', + + // Error pages + '404_page_not_found' => 'Seite nicht gefunden', + 'sorry_page_not_found' => 'Entschuldigung. Die Seite, die Sie angefordert haben wurde nicht gefunden.', + 'return_home' => 'Zurück zur Startseite', + 'error_occurred' => 'Es ist ein Fehler aufgetreten', + 'app_down' => ':appName befindet sich aktuell im Wartungsmodus.', + 'back_soon' => 'Wir werden so schnell wie möglich wieder online sein.', ]; diff --git a/resources/lang/de/passwords.php b/resources/lang/de/passwords.php index f71358055..c44b49baa 100644 --- a/resources/lang/de/passwords.php +++ b/resources/lang/de/passwords.php @@ -16,7 +16,7 @@ return [ 'password' => 'Passörter müssen mindestens sechs Zeichen enthalten und die Wiederholung muss identisch sein.', 'user' => "Wir können keinen Benutzer mit dieser E-Mail Adresse finden.", 'token' => 'Dieser Passwort-Reset-Token ist ungültig.', - 'sent' => 'Wir haben ihnen eine E-Mail mit einem Link zum Zurücksetzen des Passworts zugesendet!', + 'sent' => 'Wir haben Ihnen eine E-Mail mit einem Link zum Zurücksetzen des Passworts zugesendet!', 'reset' => 'Ihr Passwort wurde zurückgesetzt!', ]; diff --git a/resources/lang/de/settings.php b/resources/lang/de/settings.php index 0017acd1d..668eecf33 100644 --- a/resources/lang/de/settings.php +++ b/resources/lang/de/settings.php @@ -10,14 +10,19 @@ return [ 'settings' => 'Einstellungen', 'settings_save' => 'Einstellungen speichern', + 'settings_save_success' => 'Einstellungen gespeichert', + + /** + * App settings + */ 'app_settings' => 'Anwendungseinstellungen', 'app_name' => 'Anwendungsname', - 'app_name_desc' => 'Dieser Name wird im Header und E-Mails angezeigt.', + 'app_name_desc' => 'Dieser Name wird im Header und in E-Mails angezeigt.', 'app_name_header' => 'Anwendungsname im Header anzeigen?', 'app_public_viewing' => 'Öffentliche Ansicht erlauben?', 'app_secure_images' => 'Erhöhte Sicherheit für Bilduploads aktivieren?', - 'app_secure_images_desc' => 'Aus Leistungsgründen sind alle Bilder öffentlich sichtbar. Diese Option fügt zufällige, schwer zu eratene, Zeichenketten vor die Bild-URLs hinzu. Stellen sie sicher, dass Verzeichnindexes deaktiviert sind, um einen einfachen Zugrif zu verhindern.', + 'app_secure_images_desc' => 'Aus Leistungsgründen sind alle Bilder öffentlich sichtbar. Diese Option fügt zufällige, schwer zu eratene, Zeichenketten vor die Bild-URLs hinzu. Stellen sie sicher, dass Verzeichnindexes deaktiviert sind, um einen einfachen Zugriff zu verhindern.', 'app_editor' => 'Seiteneditor', 'app_editor_desc' => 'Wählen sie den Editor aus, der von allen Benutzern genutzt werden soll, um Seiten zu editieren.', 'app_custom_html' => 'Benutzerdefinierter HTML Inhalt', @@ -25,15 +30,82 @@ return [ 'app_logo' => 'Anwendungslogo', 'app_logo_desc' => 'Dieses Bild sollte 43px hoch sein.
    Größere Bilder werden verkleinert.', 'app_primary_color' => 'Primäre Anwendungsfarbe', - 'app_primary_color_desc' => 'Dies sollte ein HEX Wert sein.
    Leer lassen des Feldes setzt auf die Standard-Anwendungsfarbe zurück.', + 'app_primary_color_desc' => 'Dies sollte ein HEX Wert sein.
    Wenn Sie nicht eingeben, wird die Anwendung auf die Standardfarbe zurückgesetzt.', + + /** + * Registration settings + */ 'reg_settings' => 'Registrierungseinstellungen', 'reg_allow' => 'Registrierung erlauben?', 'reg_default_role' => 'Standard-Benutzerrolle nach Registrierung', 'reg_confirm_email' => 'Bestätigung per E-Mail erforderlich?', - 'reg_confirm_email_desc' => 'Falls die Einschränkung für; Domains genutzt wird, ist die Bestätigung per E-Mail zwingend erforderlich und der untenstehende Wert wird ignoriert.', + 'reg_confirm_email_desc' => 'Falls die Einschränkung für Domains genutzt wird, ist die Bestätigung per E-Mail zwingend erforderlich und der untenstehende Wert wird ignoriert.', 'reg_confirm_restrict_domain' => 'Registrierung auf bestimmte Domains einschränken', 'reg_confirm_restrict_domain_desc' => 'Fügen sie eine, durch Komma getrennte, Liste von E-Mail Domains hinzu, auf die die Registrierung eingeschränkt werden soll. Benutzern wird eine E-Mail gesendet, um ihre E-Mail Adresse zu bestätigen, bevor sie diese Anwendung nutzen können.
    Hinweis: Benutzer können ihre E-Mail Adresse nach erfolgreicher Registrierung ändern.', 'reg_confirm_restrict_domain_placeholder' => 'Keine Einschränkung gesetzt', + /** + * Role settings + */ + + 'roles' => 'Rollen', + 'role_user_roles' => 'Benutzer-Rollen', + 'role_create' => 'Neue Rolle anlegen', + 'role_create_success' => 'Rolle erfolgreich angelegt', + 'role_delete' => 'Rolle löschen', + 'role_delete_confirm' => 'Sie möchten die Rolle \':roleName\' löschen.', + 'role_delete_users_assigned' => 'Diese Rolle ist :userCount Benutzern zugeordnet. Sie können unten eine neue Rolle auswählen, die Sie diesen Benutzern zuordnen möchten.', + 'role_delete_no_migration' => "Den Benutzern keine andere Rolle zuordnen", + 'role_delete_sure' => 'Sind Sie sicher, dass Sie diese Rolle löschen möchten?', + 'role_delete_success' => 'Rolle erfolgreich gelöscht', + 'role_edit' => 'Rolle bearbeiten', + 'role_details' => 'Rollen-Details', + 'role_name' => 'Rollenname', + 'role_desc' => 'Kurzbeschreibung der Rolle', + 'role_system' => 'System-Berechtigungen', + 'role_manage_users' => 'Benutzer verwalten', + 'role_manage_roles' => 'Rollen & Rollen-Berechtigungen verwalten', + 'role_manage_entity_permissions' => 'Alle Buch-, Kapitel und Seiten-Berechtigungen verwalten', + 'role_manage_own_entity_permissions' => 'Nur Berechtigungen eigener Bücher, Kapitel und Seiten verwalten', + 'role_manage_settings' => 'Globaleinstellungen verwalrten', + 'role_asset' => 'Berechtigungen', + 'role_asset_desc' => 'Diese Berechtigungen gelten für den Standard-Zugriff innerhalb des Systems. Berechtigungen für Bücher, Kapitel und Seiten überschreiben diese Berechtigungenen.', + 'role_all' => 'Alle', + 'role_own' => 'Eigene', + 'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to', + 'role_save' => 'Rolle speichern', + 'role_update_success' => 'Rolle erfolgreich gespeichert', + 'role_users' => 'Dieser Rolle zugeordnete Benutzer', + 'role_users_none' => 'Bisher sind dieser Rolle keiner Benutzer zugeordnet,', + + /** + * Users + */ + + 'users' => 'Benutzer', + 'user_profile' => 'Benutzerprofil', + 'users_add_new' => 'Benutzer hinzufügen', + 'users_search' => 'Benutzer suchen', + 'users_role' => 'Benutzerrollen', + 'users_external_auth_id' => 'Externe Authentifizierungs-ID', + 'users_password_warning' => 'Füllen Sie die folgenden Felder nur aus, wenn Sie Ihr Passwort ändern möchten:', + 'users_system_public' => 'Dieser Benutzer repräsentiert alle Gast-Benutzer, die diese Seite betrachten. Er kann nicht zum Anmelden benutzt werden, sondern wird automatisch zugeordnet.', + 'users_delete' => 'Benutzer löschen', + 'users_delete_named' => 'Benutzer :userName löschen', + 'users_delete_warning' => 'Sie möchten den Benutzer \':userName\' gänzlich aus dem System löschen.', + 'users_delete_confirm' => 'Sind Sie sicher, dass Sie diesen Benutzer löschen möchten?', + 'users_delete_success' => 'Benutzer erfolgreich gelöscht.', + 'users_edit' => 'Benutzer bearbeiten', + 'users_edit_profile' => 'Profil bearbeiten', + 'users_edit_success' => 'Benutzer erfolgreich aktualisisert', + 'users_avatar' => 'Benutzer-Bild', + 'users_avatar_desc' => 'Dieses Bild sollte einen Durchmesser von ca. 256px haben.', + 'users_preferred_language' => 'Bevorzugte Sprache', + 'users_social_accounts' => 'Social-Media Konten', + 'users_social_accounts_info' => 'Hier können Sie andere Social-Media Konten für eine schnellere und einfachere Anmeldung verknüpfen. Wenn Sie ein Social-Media Konto hier lösen, bleibt der Zugriff erhalteb. Entfernen Sie in diesem Falle die Berechtigung in Ihren Profil-Einstellungen des verknüpften Social-Media Kontos.', + 'users_social_connect' => 'Social-Media Konto verknüpfen', + 'users_social_disconnect' => 'Social-Media Kontoverknüpfung lösen', + 'users_social_connected' => ':socialAccount Konto wurde erfolgreich mit dem Profil verknüpft.', + 'users_social_disconnected' => ':socialAccount Konto wurde erfolgreich vom Profil gelöst.', ]; diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index b734828fc..a1232efc6 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -18,6 +18,8 @@ return [ */ 'sign_up' => 'Sign up', 'log_in' => 'Log in', + 'log_in_with' => 'Login with :socialDriver', + 'sign_up_with' => 'Sign up with :socialDriver', 'logout' => 'Logout', 'name' => 'Name', diff --git a/resources/lang/en/entities.php b/resources/lang/en/entities.php index 80bb96669..afe6f7ec1 100644 --- a/resources/lang/en/entities.php +++ b/resources/lang/en/entities.php @@ -26,6 +26,10 @@ return [ 'no_pages_viewed' => 'You have not viewed any pages', 'no_pages_recently_created' => 'No pages have been recently created', 'no_pages_recently_updated' => 'No pages have been recently updated', + 'export' => 'Export', + 'export_html' => 'Contained Web File', + 'export_pdf' => 'PDF File', + 'export_text' => 'Plain Text File', /** * Permissions and restrictions @@ -161,10 +165,6 @@ return [ 'pages_revisions_preview' => 'Preview', 'pages_revisions_restore' => 'Restore', 'pages_revisions_none' => 'This page has no revisions', - 'pages_export' => 'Export', - 'pages_export_html' => 'Contained Web File', - 'pages_export_pdf' => 'PDF File', - 'pages_export_text' => 'Plain Text File', 'pages_copy_link' => 'Copy Link', 'pages_permissions_active' => 'Page Permissions Active', 'pages_initial_revision' => 'Initial publish', diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index ed8a0db43..fa60f99a8 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -116,8 +116,10 @@ return [ 'language_select' => [ 'en' => 'English', 'de' => 'Deutsch', + 'es' => 'Español', 'fr' => 'Français', - 'pt_BR' => 'Português do Brasil' + 'nl' => 'Nederlands', + 'pt_BR' => 'Português do Brasil', ] /////////////////////////////////// ]; diff --git a/resources/lang/es/activities.php b/resources/lang/es/activities.php new file mode 100644 index 000000000..649b8c7d2 --- /dev/null +++ b/resources/lang/es/activities.php @@ -0,0 +1,40 @@ + 'página creada', + 'page_create_notification' => 'Página creada exitosamente', + 'page_update' => 'página actualizada', + 'page_update_notification' => 'Página actualizada exitosamente', + 'page_delete' => 'página borrada', + 'page_delete_notification' => 'Página borrada exitosamente', + 'page_restore' => 'página restaurada', + 'page_restore_notification' => 'Página restaurada exitosamente', + 'page_move' => 'página movida', + + // Chapters + 'chapter_create' => 'capítulo creado', + 'chapter_create_notification' => 'Capítulo creado exitosamente', + 'chapter_update' => 'capítulo actualizado', + 'chapter_update_notification' => 'Capítulo actualizado exitosamente', + 'chapter_delete' => 'capítulo borrado', + 'chapter_delete_notification' => 'Capítulo borrado exitosamente', + 'chapter_move' => 'capítulo movido', + + // Books + 'book_create' => 'libro creado', + 'book_create_notification' => 'Libro creado exitosamente', + 'book_update' => 'libro actualizado', + 'book_update_notification' => 'Libro actualizado exitosamente', + 'book_delete' => 'libro borrado', + 'book_delete_notification' => 'Libro borrado exitosamente', + 'book_sort' => 'libro ordenado', + 'book_sort_notification' => 'Libro re-ordenado exitosamente', + +]; diff --git a/resources/lang/es/auth.php b/resources/lang/es/auth.php new file mode 100644 index 000000000..8837525ae --- /dev/null +++ b/resources/lang/es/auth.php @@ -0,0 +1,74 @@ + 'Las credenciales no concuerdan con nuestros registros.', + 'throttle' => 'Demasiados intentos fallidos de conexiÃn. Por favor intente nuevamente en :seconds segundos.', + + /** + * Login & Register + */ + 'sign_up' => 'Inscribete', + 'log_in' => 'Log in', + 'logout' => 'Logout', + + 'name' => 'Nombre', + 'username' => 'Username', + 'email' => 'Email', + 'password' => 'Password', + 'password_confirm' => 'Confirmar Password', + 'password_hint' => 'Debe contener al menos 5 caracteres', + 'forgot_password' => 'Olvidó Password?', + 'remember_me' => 'Recordarme', + 'ldap_email_hint' => 'Por favor introduzca un mail para utilizar con esta cuenta.', + 'create_account' => 'Crear una cuenta', + 'social_login' => 'Login Social', + 'social_registration' => 'Registro Social', + 'social_registration_text' => 'Registrar y entrar utilizando otro servicio.', + + 'register_thanks' => 'Gracias por registrarse!', + 'register_confirm' => 'Por favor chequee su email y haga clic en el botón de confirmación enviado para acceder a :appName.', + 'registrations_disabled' => 'Los registros están deshabilitados actualmente', + 'registration_email_domain_invalid' => 'Este dominio de Email no tiene acceso a esta aplicación', + 'register_success' => 'Gracias por registrarse! Ahora se encuentra registrado y logueado.', + + + /** + * Password Reset + */ + 'reset_password' => 'Reset Password', + 'reset_password_send_instructions' => 'Introduzca su email a continuación y le será enviado un correo con un link para la restauración', + 'reset_password_send_button' => 'Enviar Link de Reset', + 'reset_password_sent_success' => 'Un link para resetear password ha sido enviado a :email.', + 'reset_password_success' => 'Su password ha sido reiniciado de manera éxitosa.', + + 'email_reset_subject' => 'Reset de su password de :appName', + 'email_reset_text' => 'Ud. esta recibiendo este email debido a que recibimos una solicitud de reset de password de su cuenta.', + 'email_reset_not_requested' => 'Si ud. no solicitó un reset de password, no es requerida ninguna acción.', + + + /** + * Email Confirmation + */ + 'email_confirm_subject' => 'Confirme su email en :appName', + 'email_confirm_greeting' => 'Gracias por unirse a :appName!', + 'email_confirm_text' => 'Por favor confirme su dirección de email haciendo click en el siguiente botón:', + 'email_confirm_action' => 'Confirmar Email', + 'email_confirm_send_error' => 'Confirmation de email requerida pero el sistema no pudo enviar el mail. Contacte al administrador para asegurarse que el email está seteado correctamente.', + 'email_confirm_success' => 'Su email hasido confirmado!', + 'email_confirm_resent' => 'Email de confirmación reenviado, Por favor chequee su Inbox.', + + 'email_not_confirmed' => 'Dirección de email no confirmada', + 'email_not_confirmed_text' => 'Su cuenta de email todavía no ha sido confirmada.', + 'email_not_confirmed_click_link' => 'Por favor chequee el email con el link de confirmación que ha sido enviado luego de registrarse.', + 'email_not_confirmed_resend' => 'Si no puede encontrar el email, puede solicitar el renvío del email de confirmación rellenando el formulario a continuación.', + 'email_not_confirmed_resend_button' => 'Reenviar Email de confirmación', +]; diff --git a/resources/lang/es/common.php b/resources/lang/es/common.php new file mode 100644 index 000000000..3a62a2177 --- /dev/null +++ b/resources/lang/es/common.php @@ -0,0 +1,58 @@ + 'Cancelar', + 'confirm' => 'Confirmar', + 'back' => 'Atrás', + 'save' => 'Guardar', + 'continue' => 'Continuar', + 'select' => 'Seleccionar', + + /** + * Form Labels + */ + 'name' => 'Nombre', + 'description' => 'Descripción', + 'role' => 'Rol', + + /** + * Actions + */ + 'actions' => 'Acciones', + 'view' => 'Ver', + 'create' => 'Crear', + 'update' => 'Actualizar', + 'edit' => 'Editar', + 'sort' => 'Ordenar', + 'move' => 'Mover', + 'delete' => 'Borrar', + 'search' => 'Buscar', + 'search_clear' => 'Limpiar búsqueda', + 'reset' => 'Reset', + 'remove' => 'Remover', + + + /** + * Misc + */ + 'deleted_user' => 'Usuario borrado', + 'no_activity' => 'Ninguna actividad para mostrar', + 'no_items' => 'No hay items disponibles', + 'back_to_top' => 'Volver arriba', + 'toggle_details' => 'Alternar detalles', + + /** + * Header + */ + 'view_profile' => 'Ver Perfil', + 'edit_profile' => 'Editar Perfil', + + /** + * Email Content + */ + 'email_action_help' => 'Si está teniendo problemas haga click en el botón ":actionText", copie y pegue la siguiente URL en su navegador web:', + 'email_rights' => 'Todos los derechos reservados', +]; diff --git a/resources/lang/es/components.php b/resources/lang/es/components.php new file mode 100644 index 000000000..fead3d4a3 --- /dev/null +++ b/resources/lang/es/components.php @@ -0,0 +1,24 @@ + 'Seleccionar Imagen', + 'image_all' => 'Todo', + 'image_all_title' => 'Ver todas las imágenes', + 'image_book_title' => 'Ver las imágenes subidas a este libro', + 'image_page_title' => 'Ver las imágenes subidas a esta página', + 'image_search_hint' => 'Buscar por nombre de imagen', + 'image_uploaded' => 'Subido el :uploadedDate', + 'image_load_more' => 'Cargar más', + 'image_image_name' => 'Nombre de imagen', + 'image_delete_confirm' => 'Esta imagen esta siendo utilizada en las páginas a continuación, haga click de nuevo para confirmar que quiere borrar esta imagen.', + 'image_select_image' => 'Seleccionar Imagen', + 'image_dropzone' => 'Arrastre las imágenes o hacer click aquí para Subir', + 'images_deleted' => 'Imágenes borradas', + 'image_preview' => 'Preview de la imagen', + 'image_upload_success' => 'Imagen subida exitosamente', + 'image_update_success' => 'Detalles de la imagen actualizados exitosamente', + 'image_delete_success' => 'Imagen borrada exitosamente' +]; diff --git a/resources/lang/es/entities.php b/resources/lang/es/entities.php new file mode 100644 index 000000000..14e952f1a --- /dev/null +++ b/resources/lang/es/entities.php @@ -0,0 +1,226 @@ + 'Recientemente creadod', + 'recently_created_pages' => 'Páginas recientemente creadas', + 'recently_updated_pages' => 'Páginas recientemente actualizadas', + 'recently_created_chapters' => 'Capítulos recientemente creados', + 'recently_created_books' => 'Libros recientemente creados', + 'recently_update' => 'Recientemente actualizado', + 'recently_viewed' => 'Recientemente visto', + 'recent_activity' => 'Actividad reciente', + 'create_now' => 'Crear uno ahora', + 'revisions' => 'Revisiones', + 'meta_created' => 'Creado el :timeLength', + 'meta_created_name' => 'Creado el :timeLength por :user', + 'meta_updated' => 'Actualizado el :timeLength', + 'meta_updated_name' => 'Actualizado el :timeLength por :user', + 'x_pages' => ':count Páginas', + 'entity_select' => 'Seleccione entidad', + 'images' => 'Imágenes', + 'my_recent_drafts' => 'Mis borradores recientes', + 'my_recently_viewed' => 'Mis visualizaciones recientes', + 'no_pages_viewed' => 'Ud. no ha visto ninguna página', + 'no_pages_recently_created' => 'Ninguna página ha sido creada recientemente', + 'no_pages_recently_updated' => 'Ninguna página ha sido actualizada recientemente', + 'export' => 'Export', + 'export_html' => 'Contained Web File', + 'export_pdf' => 'PDF File', + 'export_text' => 'Plain Text File', + + /** + * Permissions and restrictions + */ + 'permissions' => 'Permisos', + 'permissions_intro' => 'una vez habilitado, Estos permisos tendrán prioridad por encima de cualquier permiso establecido.', + 'permissions_enable' => 'Habilitar permisos custom', + 'permissions_save' => 'Guardar permisos', + + /** + * Search + */ + 'search_results' => 'Buscar resultados', + 'search_results_page' => 'resultados de búsqueda en página', + 'search_results_chapter' => 'Resultados de búsqueda en capítulo ', + 'search_results_book' => 'Resultados de búsqueda en libro', + 'search_clear' => 'Limpiar resultados', + 'search_view_pages' => 'Ver todas las páginas que concuerdan', + 'search_view_chapters' => 'Ver todos los capítulos que concuerdan', + 'search_view_books' => 'Ver todos los libros que concuerdan', + 'search_no_pages' => 'Ninguna página encontrada para la búsqueda', + 'search_for_term' => 'Busqueda por :term', + 'search_page_for_term' => 'Búsqueda de página por :term', + 'search_chapter_for_term' => 'Búsqueda por capítulo de :term', + 'search_book_for_term' => 'Búsqueda en libro de :term', + + /** + * Books + */ + 'book' => 'Libro', + 'books' => 'Libros', + 'books_empty' => 'No hay libros creados', + 'books_popular' => 'Libros populares', + 'books_recent' => 'Libros recientes', + 'books_popular_empty' => 'Los libros más populares aparecerán aquí.', + 'books_create' => 'Crear nuevo libro', + 'books_delete' => 'Borrar libro', + 'books_delete_named' => 'Borrar libro :bookName', + 'books_delete_explain' => 'Esto borrará el libro con el nombre \':bookName\', Todos las páginas y capítulos serán removios.', + 'books_delete_confirmation' => '¿Está seguro de que desea borrar este libro?', + 'books_edit' => 'Editar Libro', + 'books_edit_named' => 'Editar Libro :bookName', + 'books_form_book_name' => 'Nombre de libro', + 'books_save' => 'Guardar libro', + 'books_permissions' => 'permisos de libro', + 'books_permissions_updated' => 'Permisos de libro actualizados', + 'books_empty_contents' => 'Ninguna página o capítulo ha sido creada para este libro.', + 'books_empty_create_page' => 'Crear una nueva página', + 'books_empty_or' => 'ó', + 'books_empty_sort_current_book' => 'Organizar el libro actual', + 'books_empty_add_chapter' => 'Agregar un capítulo', + 'books_permissions_active' => 'Permisos de libro activados', + 'books_search_this' => 'Buscar en este libro', + 'books_navigation' => 'Navegación de libro', + 'books_sort' => 'Organizar contenido de libro', + 'books_sort_named' => 'Organizar libro :bookName', + 'books_sort_show_other' => 'Mostrar otros libros', + 'books_sort_save' => 'Guardar nuevo orden', + + /** + * Chapters + */ + 'chapter' => 'Capítulo', + 'chapters' => 'Capítulos', + 'chapters_popular' => 'Capítulos populares', + 'chapters_new' => 'Nuevo capítulo', + 'chapters_create' => 'Crear nuevo capítulo', + 'chapters_delete' => 'Borrar capítulo', + 'chapters_delete_named' => 'Borrar capítulo :chapterName', + 'chapters_delete_explain' => 'Esto borrará el caítulo con el nombre \':chapterName\', todas las páginas serán removidas + y agregadas directamente al libro padre.', + 'chapters_delete_confirm' => 'Está ud. seguro de borrar este capítulo?', + 'chapters_edit' => 'Editar capítulo', + 'chapters_edit_named' => 'Editar capítulo :chapterName', + 'chapters_save' => 'Guardar capítulo', + 'chapters_move' => 'Mover capítulo', + 'chapters_move_named' => 'Mover Capítulo :chapterName', + 'chapter_move_success' => 'Capítulo movido a :bookName', + 'chapters_permissions' => 'Permisos de capítulo', + 'chapters_empty' => 'No existen páginas en este capítulo.', + 'chapters_permissions_active' => 'Permisos de capítulo activado', + 'chapters_permissions_success' => 'Permisos de capítulo actualizados', + + /** + * Pages + */ + 'page' => 'Página', + 'pages' => 'Páginas', + 'pages_popular' => 'Páginas populares', + 'pages_new' => 'Nueva página', + 'pages_attachments' => 'Adjuntos', + 'pages_navigation' => 'Navegación de página', + 'pages_delete' => 'Borrar página', + 'pages_delete_named' => 'Borrar página :pageName', + 'pages_delete_draft_named' => 'Borrar borrador de página :pageName', + 'pages_delete_draft' => 'Borrar borrador de página', + 'pages_delete_success' => 'Página borrada', + 'pages_delete_draft_success' => 'Borrador de página borrado', + 'pages_delete_confirm' => 'Está ud. seguro de borrar esta página ?', + 'pages_delete_draft_confirm' => 'Está ud. seguro de que desea borrar este borrador de página?', + 'pages_editing_named' => 'Editando página :pageName', + 'pages_edit_toggle_header' => 'Toggle Título', + 'pages_edit_save_draft' => 'Guardar borrador', + 'pages_edit_draft' => 'Editar borrador de página', + 'pages_editing_draft' => 'Editando borrador', + 'pages_editing_page' => 'Editando página', + 'pages_edit_draft_save_at' => 'Borrador guardado el ', + 'pages_edit_delete_draft' => 'Borrar borrador', + 'pages_edit_discard_draft' => 'Descartar borrador', + 'pages_edit_set_changelog' => 'Set Changelog', + 'pages_edit_enter_changelog_desc' => 'Introduzca una breve descripción de los cambios que ha realizado', + 'pages_edit_enter_changelog' => 'Entrar en Changelog', + 'pages_save' => 'Guardar página', + 'pages_title' => 'Título de página', + 'pages_name' => 'Nombre de página', + 'pages_md_editor' => 'Editor', + 'pages_md_preview' => 'Preview', + 'pages_md_insert_image' => 'Insertar Imagen', + 'pages_md_insert_link' => 'Insert Entity Link', + 'pages_not_in_chapter' => 'Page is not in a chapter', + 'pages_move' => 'Move Page', + 'pages_move_success' => 'Page moved to ":parentName"', + 'pages_permissions' => 'Page Permissions', + 'pages_permissions_success' => 'Page permissions updated', + 'pages_revisions' => 'Page Revisions', + 'pages_revisions_named' => 'Page Revisions for :pageName', + 'pages_revision_named' => 'Page Revision for :pageName', + 'pages_revisions_created_by' => 'Created By', + 'pages_revisions_date' => 'Revision Date', + 'pages_revisions_changelog' => 'Changelog', + 'pages_revisions_changes' => 'Changes', + 'pages_revisions_current' => 'Current Version', + 'pages_revisions_preview' => 'Preview', + 'pages_revisions_restore' => 'Restore', + 'pages_revisions_none' => 'This page has no revisions', + 'pages_copy_link' => 'Copy Link', + 'pages_permissions_active' => 'Page Permissions Active', + 'pages_initial_revision' => 'Initial publish', + 'pages_initial_name' => 'New Page', + 'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.', + 'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.', + 'pages_draft_edit_active' => [ + 'start_a' => ':count users have started editing this page', + 'start_b' => ':userName has started editing this page', + 'time_a' => 'since the pages was last updated', + 'time_b' => 'in the last :minCount minutes', + 'message' => ':start :time. Take care not to overwrite each other\'s updates!', + ], + 'pages_draft_discarded' => 'Draft discarded, The editor has been updated with the current page content', + + /** + * Editor sidebar + */ + 'page_tags' => 'Page Tags', + 'tag' => 'Tag', + 'tags' => '', + 'tag_value' => 'Tag Value (Optional)', + 'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.", + 'tags_add' => 'Add another tag', + 'attachments' => 'Attachments', + 'attachments_explain' => 'Upload some files or attach some link to display on your page. These are visible in the page sidebar.', + 'attachments_explain_instant_save' => 'Changes here are saved instantly.', + 'attachments_items' => 'Attached Items', + 'attachments_upload' => 'Upload File', + 'attachments_link' => 'Attach Link', + 'attachments_set_link' => 'Set Link', + 'attachments_delete_confirm' => 'Click delete again to confirm you want to delete this attachment.', + 'attachments_dropzone' => 'Drop files or click here to attach a file', + 'attachments_no_files' => 'No files have been uploaded', + 'attachments_explain_link' => 'You can attach a link if you\'d prefer not to upload a file. This can be a link to another page or a link to a file in the cloud.', + 'attachments_link_name' => 'Link Name', + 'attachment_link' => 'Attachment link', + 'attachments_link_url' => 'Link to file', + 'attachments_link_url_hint' => 'Url of site or file', + 'attach' => 'Attach', + 'attachments_edit_file' => 'Edit File', + 'attachments_edit_file_name' => 'File Name', + 'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite', + 'attachments_order_updated' => 'Attachment order updated', + 'attachments_updated_success' => 'Attachment details updated', + 'attachments_deleted' => 'Attachment deleted', + 'attachments_file_uploaded' => 'File successfully uploaded', + 'attachments_file_updated' => 'File successfully updated', + 'attachments_link_attached' => 'Link successfully attached to page', + + /** + * Profile View + */ + 'profile_user_for_x' => 'User for :time', + 'profile_created_content' => 'Created Content', + 'profile_not_created_pages' => ':userName has not created any pages', + 'profile_not_created_chapters' => ':userName has not created any chapters', + 'profile_not_created_books' => ':userName has not created any books', +]; diff --git a/resources/lang/es/errors.php b/resources/lang/es/errors.php new file mode 100644 index 000000000..08b8b0946 --- /dev/null +++ b/resources/lang/es/errors.php @@ -0,0 +1,70 @@ + 'You do not have permission to access the requested page.', + 'permissionJson' => 'You do not have permission to perform the requested action.', + + // Auth + 'error_user_exists_different_creds' => 'A user with the email :email already exists but with different credentials.', + 'email_already_confirmed' => 'Email has already been confirmed, Try logging in.', + 'email_confirmation_invalid' => 'This confirmation token is not valid or has already been used, Please try registering again.', + 'email_confirmation_expired' => 'The confirmation token has expired, A new confirmation email has been sent.', + 'ldap_fail_anonymous' => 'LDAP access failed using anonymous bind', + 'ldap_fail_authed' => 'LDAP access failed using given dn & password details', + 'ldap_extension_not_installed' => 'LDAP PHP extension not installed', + 'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed', + 'social_no_action_defined' => 'No action defined', + 'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.', + 'social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.', + 'social_account_existing' => 'This :socialAccount is already attached to your profile.', + 'social_account_already_used_existing' => 'This :socialAccount account is already used by another user.', + 'social_account_not_used' => 'This :socialAccount account is not linked to any users. Please attach it in your profile settings. ', + 'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.', + 'social_driver_not_found' => 'Social driver not found', + 'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.', + + // System + 'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.', + 'cannot_get_image_from_url' => 'Cannot get image from :url', + 'cannot_create_thumbs' => 'The server cannot create thumbnails. Please check you have the GD PHP extension installed.', + 'server_upload_limit' => 'The server does not allow uploads of this size. Please try a smaller file size.', + 'image_upload_error' => 'An error occurred uploading the image', + + // Attachments + 'attachment_page_mismatch' => 'Page mismatch during attachment update', + + // Pages + 'page_draft_autosave_fail' => 'Failed to save draft. Ensure you have internet connection before saving this page', + + // Entities + 'entity_not_found' => 'Entity not found', + 'book_not_found' => 'Book not found', + 'page_not_found' => 'Page not found', + 'chapter_not_found' => 'Chapter not found', + 'selected_book_not_found' => 'The selected book was not found', + 'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found', + 'guests_cannot_save_drafts' => 'Guests cannot save drafts', + + // Users + 'users_cannot_delete_only_admin' => 'You cannot delete the only admin', + 'users_cannot_delete_guest' => 'You cannot delete the guest user', + + // Roles + 'role_cannot_be_edited' => 'This role cannot be edited', + 'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted', + 'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role', + + // Error pages + '404_page_not_found' => 'Page Not Found', + 'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.', + 'return_home' => 'Return to home', + 'error_occurred' => 'An Error Occurred', + 'app_down' => ':appName is down right now', + 'back_soon' => 'It will be back up soon.', +]; diff --git a/resources/lang/es/pagination.php b/resources/lang/es/pagination.php new file mode 100644 index 000000000..325916dc3 --- /dev/null +++ b/resources/lang/es/pagination.php @@ -0,0 +1,19 @@ + '« Anterior', + 'next' => 'Siguiente »', + +]; diff --git a/resources/lang/es/passwords.php b/resources/lang/es/passwords.php new file mode 100644 index 000000000..3fa17b066 --- /dev/null +++ b/resources/lang/es/passwords.php @@ -0,0 +1,22 @@ + 'El Password debe ser como mínimo de seis caracteres y coincidir con la confirmación.', + 'user' => "No podemos encontrar un usuario con esta dirección de e-mail.", + 'token' => 'El token de reset del password es inválido.', + 'sent' => 'Hemos enviado a su cuenta de e-mail un link para restaurar su password!', + 'reset' => 'Su password ha sido restaurado!', + +]; diff --git a/resources/lang/es/settings.php b/resources/lang/es/settings.php new file mode 100644 index 000000000..cf926ae52 --- /dev/null +++ b/resources/lang/es/settings.php @@ -0,0 +1,112 @@ + 'Settings', + 'settings_save' => 'Save Settings', + 'settings_save_success' => 'Settings saved', + + /** + * App settings + */ + + 'app_settings' => 'App Settings', + 'app_name' => 'Application name', + 'app_name_desc' => 'This name is shown in the header and any emails.', + 'app_name_header' => 'Show Application name in header?', + 'app_public_viewing' => 'Allow public viewing?', + 'app_secure_images' => 'Enable higher security image uploads?', + 'app_secure_images_desc' => 'For performance reasons, all images are public. This option adds a random, hard-to-guess string in front of image urls. Ensure directory indexes are not enabled to prevent easy access.', + 'app_editor' => 'Page editor', + 'app_editor_desc' => 'Select which editor will be used by all users to edit pages.', + 'app_custom_html' => 'Custom HTML head content', + 'app_custom_html_desc' => 'Any content added here will be inserted into the bottom of the section of every page. This is handy for overriding styles or adding analytics code.', + 'app_logo' => 'Application logo', + 'app_logo_desc' => 'This image should be 43px in height.
    Large images will be scaled down.', + 'app_primary_color' => 'Application primary color', + 'app_primary_color_desc' => 'This should be a hex value.
    Leave empty to reset to the default color.', + + /** + * Registration settings + */ + + 'reg_settings' => 'Registration Settings', + 'reg_allow' => 'Allow registration?', + 'reg_default_role' => 'Default user role after registration', + 'reg_confirm_email' => 'Require email confirmation?', + 'reg_confirm_email_desc' => 'If domain restriction is used then email confirmation will be required and the below value will be ignored.', + 'reg_confirm_restrict_domain' => 'Restrict registration to domain', + 'reg_confirm_restrict_domain_desc' => 'Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application.
    Note that users will be able to change their email addresses after successful registration.', + 'reg_confirm_restrict_domain_placeholder' => 'No restriction set', + + /** + * Role settings + */ + + 'roles' => 'Roles', + 'role_user_roles' => 'User Roles', + 'role_create' => 'Create New Role', + 'role_create_success' => 'Role successfully created', + 'role_delete' => 'Delete Role', + 'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.', + 'role_delete_users_assigned' => 'This role has :userCount users assigned to it. If you would like to migrate the users from this role select a new role below.', + 'role_delete_no_migration' => "Don't migrate users", + 'role_delete_sure' => 'Are you sure you want to delete this role?', + 'role_delete_success' => 'Role successfully deleted', + 'role_edit' => 'Edit Role', + 'role_details' => 'Role Details', + 'role_name' => 'Role Name', + 'role_desc' => 'Short Description of Role', + 'role_system' => 'System Permissions', + 'role_manage_users' => 'Manage users', + 'role_manage_roles' => 'Manage roles & role permissions', + 'role_manage_entity_permissions' => 'Manage all book, chapter & page permissions', + 'role_manage_own_entity_permissions' => 'Manage permissions on own book, chapter & pages', + 'role_manage_settings' => 'Manage app settings', + 'role_asset' => 'Asset Permissions', + 'role_asset_desc' => 'These permissions control default access to the assets within the system. Permissions on Books, Chapters and Pages will override these permissions.', + 'role_all' => 'All', + 'role_own' => 'Own', + 'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to', + 'role_save' => 'Save Role', + 'role_update_success' => 'Role successfully updated', + 'role_users' => 'Users in this role', + 'role_users_none' => 'No users are currently assigned to this role', + + /** + * Users + */ + + 'users' => 'Users', + 'user_profile' => 'User Profile', + 'users_add_new' => 'Add New User', + 'users_search' => 'Search Users', + 'users_role' => 'User Roles', + 'users_external_auth_id' => 'External Authentication ID', + 'users_password_warning' => 'Only fill the below if you would like to change your password:', + 'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.', + 'users_delete' => 'Delete User', + 'users_delete_named' => 'Delete user :userName', + 'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.', + 'users_delete_confirm' => 'Are you sure you want to delete this user?', + 'users_delete_success' => 'Users successfully removed', + 'users_edit' => 'Edit User', + 'users_edit_profile' => 'Edit Profile', + 'users_edit_success' => 'User successfully updated', + 'users_avatar' => 'User Avatar', + 'users_avatar_desc' => 'This image should be approx 256px square.', + 'users_preferred_language' => 'Preferred Language', + 'users_social_accounts' => 'Social Accounts', + 'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not previously authorized access. Revoke access from your profile settings on the connected social account.', + 'users_social_connect' => 'Connect Account', + 'users_social_disconnect' => 'Disconnect Account', + 'users_social_connected' => ':socialAccount account was successfully attached to your profile.', + 'users_social_disconnected' => ':socialAccount account was successfully disconnected from your profile.', + +]; diff --git a/resources/lang/es/validation.php b/resources/lang/es/validation.php new file mode 100644 index 000000000..b75af7485 --- /dev/null +++ b/resources/lang/es/validation.php @@ -0,0 +1,108 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'email' => 'The :attribute must be a valid email address.', + 'filled' => 'The :attribute field is required.', + 'exists' => 'The selected :attribute is invalid.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'password-confirm' => [ + 'required_with' => 'Password confirmation required', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/lang/fr/entities.php b/resources/lang/fr/entities.php index 941259f80..cfd206b91 100644 --- a/resources/lang/fr/entities.php +++ b/resources/lang/fr/entities.php @@ -26,6 +26,10 @@ return [ 'no_pages_viewed' => 'Vous n\'avez rien visité récemment', 'no_pages_recently_created' => 'Aucune page créée récemment', 'no_pages_recently_updated' => 'Aucune page mise à jour récemment', + 'export' => 'Exporter', + 'export_html' => 'Fichiers web', + 'export_pdf' => 'Fichier PDF', + 'export_text' => 'Document texte', /** * Permissions and restrictions @@ -160,10 +164,6 @@ return [ 'pages_revisions_preview' => 'Prévisualisation', 'pages_revisions_restore' => 'Restaurer', 'pages_revisions_none' => 'Cette page n\'a aucune révision', - 'pages_export' => 'Exporter', - 'pages_export_html' => 'Fichiers web', - 'pages_export_pdf' => 'Fichier PDF', - 'pages_export_text' => 'Document texte', 'pages_copy_link' => 'Copier le lien', 'pages_permissions_active' => 'Permissions de page actives', 'pages_initial_revision' => 'Publication initiale', diff --git a/resources/lang/nl/activities.php b/resources/lang/nl/activities.php new file mode 100644 index 000000000..66a320456 --- /dev/null +++ b/resources/lang/nl/activities.php @@ -0,0 +1,40 @@ + 'maakte pagina', + 'page_create_notification' => 'Pagina Succesvol Aangemaakt', + 'page_update' => 'veranderde pagina', + 'page_update_notification' => 'Pagina Succesvol Bijgewerkt', + 'page_delete' => 'verwijderde pagina', + 'page_delete_notification' => 'Pagina Succesvol Verwijderd', + 'page_restore' => 'herstelde pagina', + 'page_restore_notification' => 'Pagina Succesvol Hersteld', + 'page_move' => 'verplaatste pagina', + + // Chapters + 'chapter_create' => 'maakte hoofdstuk', + 'chapter_create_notification' => 'Hoofdstuk Succesvol Aangemaakt', + 'chapter_update' => 'veranderde hoofdstuk', + 'chapter_update_notification' => 'Hoofdstuk Succesvol Bijgewerkt', + 'chapter_delete' => 'verwijderde hoofdstuk', + 'chapter_delete_notification' => 'Hoofdstuk Succesvol Verwijderd', + 'chapter_move' => 'verplaatste hoofdstuk', + + // Books + 'book_create' => 'maakte boek', + 'book_create_notification' => 'Boek Succesvol Aangemaakt', + 'book_update' => 'veranderde boek', + 'book_update_notification' => 'Boek Succesvol Bijgewerkt', + 'book_delete' => 'verwijderde boek', + 'book_delete_notification' => 'Boek Succesvol Verwijderd', + 'book_sort' => 'sorteerde boek', + 'book_sort_notification' => 'Boek Succesvol Gesorteerd', + +]; diff --git a/resources/lang/nl/auth.php b/resources/lang/nl/auth.php new file mode 100644 index 000000000..d8813f07b --- /dev/null +++ b/resources/lang/nl/auth.php @@ -0,0 +1,76 @@ + 'Deze inloggegevens zijn niet bij ons bekend.', + 'throttle' => 'Te veel loginpogingen! Probeer het opnieuw na :seconds seconden.', + + /** + * Login & Register + */ + 'sign_up' => 'Registreren', + 'log_in' => 'Log in', + 'log_in_with' => 'Login met :socialDriver', + 'sign_up_with' => 'Registreer met :socialDriver', + 'logout' => 'Uitloggen', + + 'name' => 'Naam', + 'username' => 'Gebruikersnaam', + 'email' => 'Email', + 'password' => 'Wachtwoord', + 'password_confirm' => 'Wachtwoord Bevestigen', + 'password_hint' => 'Minimaal 5 tekens', + 'forgot_password' => 'Wachtwoord vergeten?', + 'remember_me' => 'Mij onthouden', + 'ldap_email_hint' => 'Geef een email op waarmee je dit account wilt gebruiken.', + 'create_account' => 'Account Aanmaken', + 'social_login' => 'Social Login', + 'social_registration' => 'Social Registratie', + 'social_registration_text' => 'Registreer en log in met een andere dienst.', + + 'register_thanks' => 'Bedankt voor het registreren!', + 'register_confirm' => 'Controleer je e-mail en bevestig je registratie om in te loggen op :appName.', + 'registrations_disabled' => 'Registratie is momenteel niet mogelijk', + 'registration_email_domain_invalid' => 'Dit e-maildomein is niet toegestaan', + 'register_success' => 'Bedankt voor het inloggen. Je bent ook geregistreerd.', + + + /** + * Password Reset + */ + 'reset_password' => 'Wachtwoord Herstellen', + 'reset_password_send_instructions' => 'Geef je e-mail en we sturen je een link om je wachtwoord te herstellen', + 'reset_password_send_button' => 'Link Sturen', + 'reset_password_sent_success' => 'Een link om je wachtwoord te herstellen is verstuurd naar :email.', + 'reset_password_success' => 'Je wachtwoord is succesvol hersteld.', + + 'email_reset_subject' => 'Herstel je wachtwoord van :appName', + 'email_reset_text' => 'Je ontvangt deze e-mail zodat je je wachtwoord kunt herstellen.', + 'email_reset_not_requested' => 'Als je jouw wachtwoord niet wilt wijzigen, doe dan niets.', + + + /** + * Email Confirmation + */ + 'email_confirm_subject' => 'Bevestig je e-mailadres op :appName', + 'email_confirm_greeting' => 'Bedankt voor je aanmelding op :appName!', + 'email_confirm_text' => 'Bevestig je registratie door op onderstaande knop te drukken:', + 'email_confirm_action' => 'Bevestig je e-mail', + 'email_confirm_send_error' => 'E-mail bevestiging is vereisd maar het systeem kon geen mail verzenden. Neem contact op met de beheerder.', + 'email_confirm_success' => 'Je e-mailadres is bevestigt!', + 'email_confirm_resent' => 'De bevestigingse-mails is opnieuw verzonden. Controleer je inbox.', + + 'email_not_confirmed' => 'E-mail nog niet bevestigd', + 'email_not_confirmed_text' => 'Je e-mailadres is nog niet bevestigd.', + 'email_not_confirmed_click_link' => 'Klik op de link in de e-mail die vlak na je registratie is verstuurd.', + 'email_not_confirmed_resend' => 'Als je deze e-mail niet kunt vinden kun je deze met onderstaande formulier opnieuw verzenden.', + 'email_not_confirmed_resend_button' => 'Bevestigingsmail Opnieuw Verzenden', +]; \ No newline at end of file diff --git a/resources/lang/nl/common.php b/resources/lang/nl/common.php new file mode 100644 index 000000000..bdde9eb95 --- /dev/null +++ b/resources/lang/nl/common.php @@ -0,0 +1,58 @@ + 'Annuleren', + 'confirm' => 'Bevestigen', + 'back' => 'Terug', + 'save' => 'Opslaan', + 'continue' => 'Doorgaan', + 'select' => 'Kies', + + /** + * Form Labels + */ + 'name' => 'Naam', + 'description' => 'Beschrijving', + 'role' => 'Rol', + + /** + * Actions + */ + 'actions' => 'Acties', + 'view' => 'Bekijk', + 'create' => 'Aanmaken', + 'update' => 'Update', + 'edit' => 'Bewerk', + 'sort' => 'Sorteer', + 'move' => 'Verplaats', + 'delete' => 'Verwijder', + 'search' => 'Zoek', + 'search_clear' => 'Zoekopdracht wissen', + 'reset' => 'Reset', + 'remove' => 'Verwijderen', + + + /** + * Misc + */ + 'deleted_user' => 'Verwijderde gebruiker', + 'no_activity' => 'Geen activiteiten', + 'no_items' => 'Geen items beschikbaar', + 'back_to_top' => 'Terug naar boven', + 'toggle_details' => 'Details Weergeven', + + /** + * Header + */ + 'view_profile' => 'Profiel Weergeven', + 'edit_profile' => 'Profiel Bewerken', + + /** + * Email Content + */ + 'email_action_help' => 'Als je de knop ":actionText" niet werkt, kopieer en plak de onderstaande URL in je web browser:', + 'email_rights' => 'Alle rechten voorbehouden', +]; \ No newline at end of file diff --git a/resources/lang/nl/components.php b/resources/lang/nl/components.php new file mode 100644 index 000000000..3fc82c04b --- /dev/null +++ b/resources/lang/nl/components.php @@ -0,0 +1,24 @@ + 'Selecteer Afbeelding', + 'image_all' => 'Alles', + 'image_all_title' => 'Alle afbeeldingen weergeven', + 'image_book_title' => 'Afbeeldingen van dit boek weergeven', + 'image_page_title' => 'Afbeeldingen van deze pagina weergeven', + 'image_search_hint' => 'Zoek op afbeeldingsnaam', + 'image_uploaded' => 'Uploaded :uploadedDate', + 'image_load_more' => 'Meer Laden', + 'image_image_name' => 'Afbeeldingsnaam', + 'image_delete_confirm' => 'Deze afbeeldingen is op onderstaande pagina\'s in gebruik, Klik opnieuw op verwijderen om de afbeelding echt te verwijderen.', + 'image_select_image' => 'Kies Afbeelding', + 'image_dropzone' => 'Sleep afbeeldingen hier of klik hier om te uploaden', + 'images_deleted' => 'Verwijderde Afbeeldingen', + 'image_preview' => 'Afbeelding Voorbeeld', + 'image_upload_success' => 'Afbeelding succesvol geüpload', + 'image_update_success' => 'Afbeeldingsdetails succesvol verwijderd', + 'image_delete_success' => 'Afbeelding succesvol verwijderd' +]; \ No newline at end of file diff --git a/resources/lang/nl/entities.php b/resources/lang/nl/entities.php new file mode 100644 index 000000000..610116c8b --- /dev/null +++ b/resources/lang/nl/entities.php @@ -0,0 +1,226 @@ + 'Recent Aangemaakt', + 'recently_created_pages' => 'Recent Aangemaakte Pagina\'s', + 'recently_updated_pages' => 'Recent Bijgewerkte Pagina\'s', + 'recently_created_chapters' => 'Recent Aangemaakte Hoofdstukken', + 'recently_created_books' => 'Recent Aangemaakte Boeken', + 'recently_update' => 'Recent Bijgewerkt', + 'recently_viewed' => 'Recent Bekeken', + 'recent_activity' => 'Recente Activiteit', + 'create_now' => 'Maak er zelf één', + 'revisions' => 'Revisies', + 'meta_created' => 'Aangemaakt :timeLength', + 'meta_created_name' => 'Aangemaakt: :timeLength door :user', + 'meta_updated' => ':timeLength Aangepast', + 'meta_updated_name' => 'Aangepast: :timeLength door :user', + 'x_pages' => ':count Pagina\'s', + 'entity_select' => 'Entiteit Selecteren', + 'images' => 'Afbeeldingen', + 'my_recent_drafts' => 'Mijn Concepten', + 'my_recently_viewed' => 'Mijn Recent Bekeken', + 'no_pages_viewed' => 'Je hebt nog niets bekeken', + 'no_pages_recently_created' => 'Er zijn geen recent aangemaakte pagina\'s', + 'no_pages_recently_updated' => 'Er zijn geen recente wijzigingen', + 'export' => 'Exporteren', + 'export_html' => 'Contained Web File', + 'export_pdf' => 'PDF File', + 'export_text' => 'Plain Text File', + + /** + * Permissions and restrictions + */ + 'permissions' => 'Permissies', + 'permissions_intro' => 'Als je dit aanzet, dan gelden rol-permissies niet meer voor deze pagina.', + 'permissions_enable' => 'Custom Permissies Aanzetten', + 'permissions_save' => 'Permissies Opslaan', + + /** + * Search + */ + 'search_results' => 'Zoekresultaten', + 'search_results_page' => 'Pagina Zoekresultaten', + 'search_results_chapter' => 'Hoofdstuk Zoekresultaten', + 'search_results_book' => 'Boek Zoekresultaten', + 'search_clear' => 'Zoekopdracht wissen', + 'search_view_pages' => 'Bekijk alle gevonden pagina\'s', + 'search_view_chapters' => 'Bekijk alle gevonden hoofdstukken', + 'search_view_books' => 'Bekijk alle gevonden boeken', + 'search_no_pages' => 'Er zijn geen pagina\'s gevonden', + 'search_for_term' => 'Zoeken op :term', + 'search_page_for_term' => 'Pagina doorzoeken op :term', + 'search_chapter_for_term' => 'Hoofdstuk doorzoeken op :term', + 'search_book_for_term' => 'Boeken doorzoeken op :term', + + /** + * Books + */ + 'book' => 'Boek', + 'books' => 'Boeken', + 'books_empty' => 'Er zijn geen boeken aangemaakt', + 'books_popular' => 'Populaire Boeken', + 'books_recent' => 'Recente Boeken', + 'books_popular_empty' => 'De meest populaire boeken worden hier weergegeven.', + 'books_create' => 'Nieuw Boek Aanmaken', + 'books_delete' => 'Boek Verwijderen', + 'books_delete_named' => 'Verwijder Boek :bookName', + 'books_delete_explain' => 'Deze actie verwijdert het boek \':bookName\', Alle pagina\'s en hoofdstukken worden verwijderd.', + 'books_delete_confirmation' => 'Weet je zeker dat je dit boek wilt verwijderen?', + 'books_edit' => 'Boek Bewerken', + 'books_edit_named' => 'Bewerkt Boek :bookName', + 'books_form_book_name' => 'Boek Naam', + 'books_save' => 'Boek Opslaan', + 'books_permissions' => 'Boek Permissies', + 'books_permissions_updated' => 'Boek Permissies Opgeslagen', + 'books_empty_contents' => 'Er zijn nog een hoofdstukken en pagina\'s voor dit boek gemaakt.', + 'books_empty_create_page' => 'Pagina Toevoegen', + 'books_empty_or' => 'of', + 'books_empty_sort_current_book' => 'Boek sorteren', + 'books_empty_add_chapter' => 'Hoofdstuk Toevoegen', + 'books_permissions_active' => 'Boek Permissies Actief', + 'books_search_this' => 'Zoeken in dit boek', + 'books_navigation' => 'Boek Navigatie', + 'books_sort' => 'Inhoud van het boek sorteren', + 'books_sort_named' => 'Sorteer Boek :bookName', + 'books_sort_show_other' => 'Bekijk Andere Boeken', + 'books_sort_save' => 'Nieuwe Order Opslaan', + + /** + * Chapters + */ + 'chapter' => 'Hoofdstuk', + 'chapters' => 'Hoofdstukken', + 'chapters_popular' => 'Populaire Hoofdstukken', + 'chapters_new' => 'Nieuw Hoofdstuk', + 'chapters_create' => 'Hoofdstuk Toevoegen', + 'chapters_delete' => 'Hoofdstuk Verwijderen', + 'chapters_delete_named' => 'Verwijder Hoofdstuk :chapterName', + 'chapters_delete_explain' => 'Dit verwijdert het hoofdstuk \':chapterName\', Alle pagina\'s zullen verwijdert worden. + en toegevoegd worden aan het bijbehorende boek.', + 'chapters_delete_confirm' => 'Weet je zeker dat je dit boek wilt verwijderen?', + 'chapters_edit' => 'Hoofdstuk Aanpassen', + 'chapters_edit_named' => 'Hoofdstuk :chapterName Aanpassen', + 'chapters_save' => 'Hoofdstuk Opslaan', + 'chapters_move' => 'Hoofdstuk Verplaatsen', + 'chapters_move_named' => 'Verplaatst Hoofdstuk :chapterName', + 'chapter_move_success' => 'Hoofdstuk Verplaatst Naar :bookName', + 'chapters_permissions' => 'Hoofdstuk Permissies', + 'chapters_empty' => 'Er zijn geen pagina\'s in dit hoofdstuk aangemaakt.', + 'chapters_permissions_active' => 'Hoofdstuk Permissies Actief', + 'chapters_permissions_success' => 'Hoofdstuk Permissies Bijgewerkt', + + /** + * Pages + */ + 'page' => 'Pagina', + 'pages' => 'Pagina\'s', + 'pages_popular' => 'Populaire Pagina\'s', + 'pages_new' => 'Nieuwe Pagina', + 'pages_attachments' => 'Bijlages', + 'pages_navigation' => 'Pagina Navigatie', + 'pages_delete' => 'Pagina Verwijderen', + 'pages_delete_named' => 'Verwijderde Pagina :pageName', + 'pages_delete_draft_named' => 'Verwijderde Conceptpagina :pageName', + 'pages_delete_draft' => 'Verwijder Conceptpagina', + 'pages_delete_success' => 'Pagina verwijderd', + 'pages_delete_draft_success' => 'Concept verwijderd', + 'pages_delete_confirm' => 'Weet je zeker dat je deze pagina wilt verwijderen?', + 'pages_delete_draft_confirm' => 'Weet je zeker dat je dit concept wilt verwijderen?', + 'pages_editing_named' => 'Pagina :pageName Bewerken', + 'pages_edit_toggle_header' => 'Toggle header', + 'pages_edit_save_draft' => 'Concept opslaan', + 'pages_edit_draft' => 'Paginaconcept Bewerken', + 'pages_editing_draft' => 'Concept Bewerken', + 'pages_editing_page' => 'Concept Bewerken', + 'pages_edit_draft_save_at' => 'Concept opgeslagen op ', + 'pages_edit_delete_draft' => 'Concept Verwijderen', + 'pages_edit_discard_draft' => 'Concept Verwijderen', + 'pages_edit_set_changelog' => 'Changelog', + 'pages_edit_enter_changelog_desc' => 'Geef een korte omschrijving van de wijzingen die je gemaakt hebt.', + 'pages_edit_enter_changelog' => 'Enter Changelog', + 'pages_save' => 'Pagina Opslaan', + 'pages_title' => 'Pagina Titel', + 'pages_name' => 'Pagina Naam', + 'pages_md_editor' => 'Bewerker', + 'pages_md_preview' => 'Preview', + 'pages_md_insert_image' => 'Afbeelding Invoegen', + 'pages_md_insert_link' => 'Entity Link Invoegen', + 'pages_not_in_chapter' => 'Deze pagina staat niet in een hoofdstuk', + 'pages_move' => 'Pagina Verplaatsten', + 'pages_move_success' => 'Pagina verplaatst naar ":parentName"', + 'pages_permissions' => 'Pagina Permissies', + 'pages_permissions_success' => 'Pagina Permissies bijgwerkt', + 'pages_revisions' => 'Pagina Revisies', + 'pages_revisions_named' => 'Pagina Revisies voor :pageName', + 'pages_revision_named' => 'Pagina Revisie voor :pageName', + 'pages_revisions_created_by' => 'Aangemaakt door', + 'pages_revisions_date' => 'Revisiedatum', + 'pages_revisions_changelog' => 'Changelog', + 'pages_revisions_changes' => 'Wijzigingen', + 'pages_revisions_current' => 'Huidige Versie', + 'pages_revisions_preview' => 'Preview', + 'pages_revisions_restore' => 'Herstellen', + 'pages_revisions_none' => 'Deze pagina heeft geen revisies', + 'pages_copy_link' => 'Link Kopiëren', + 'pages_permissions_active' => 'Pagina Permissies Actief', + 'pages_initial_revision' => 'Eerste publicatie', + 'pages_initial_name' => 'Nieuwe Pagina', + 'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.', + 'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.', + 'pages_draft_edit_active' => [ + 'start_a' => ':count users have started editing this page', + 'start_b' => ':userName has started editing this page', + 'time_a' => 'since the pages was last updated', + 'time_b' => 'in the last :minCount minutes', + 'message' => ':start :time. Take care not to overwrite each other\'s updates!', + ], + 'pages_draft_discarded' => 'Draft discarded, The editor has been updated with the current page content', + + /** + * Editor sidebar + */ + 'page_tags' => 'Pagina Labels', + 'tag' => 'Label', + 'tags' => '', + 'tag_value' => 'Label Waarde (Optioneel)', + 'tags_explain' => "Voeg labels toe om de inhoud te categoriseren. \n Je kunt meerdere labels toevoegen.", + 'tags_add' => 'Voeg een extra label toe', + 'attachments' => 'Bijlages', + 'attachments_explain' => 'Upload bijlages of voeg een link toe. Deze worden zichtbaar in het navigatiepaneel.', + 'attachments_explain_instant_save' => 'Wijzigingen worden meteen opgeslagen.', + 'attachments_items' => 'Bijlages', + 'attachments_upload' => 'Bestand Uploaden', + 'attachments_link' => 'Link Toevoegen', + 'attachments_set_link' => 'Zet Link', + 'attachments_delete_confirm' => 'Klik opnieuw op \'verwijderen\' om de bijlage definitief te verwijderen.', + 'attachments_dropzone' => 'Sleep hier een bestand of klik hier om een bestand toe te voegen', + 'attachments_no_files' => 'Er zijn geen bestanden geüpload', + 'attachments_explain_link' => 'Je kunt een link toevoegen als je geen bestanden wilt uploaden. Dit kan een link naar een andere pagina op deze website zijn, maar ook een link naar een andere website.', + 'attachments_link_name' => 'Link Naam', + 'attachment_link' => 'Bijlage link', + 'attachments_link_url' => 'Link naar bestand', + 'attachments_link_url_hint' => 'Url, site of bestand', + 'attach' => 'Koppelen', + 'attachments_edit_file' => 'Bestand Bewerken', + 'attachments_edit_file_name' => 'Bestandsnaam', + 'attachments_edit_drop_upload' => 'Sleep een bestand of klik hier om te uploaden en te overschrijven', + 'attachments_order_updated' => 'De volgorde van de bijlages is bijgewerkt', + 'attachments_updated_success' => 'Bijlage details bijgewerkt', + 'attachments_deleted' => 'Bijlage verwijderd', + 'attachments_file_uploaded' => 'Bestand succesvol geüpload', + 'attachments_file_updated' => 'Bestand succesvol bijgewerkt', + 'attachments_link_attached' => 'Link successfully gekoppeld aan de pagina', + + /** + * Profile View + */ + 'profile_user_for_x' => 'Lid sinds :time', + 'profile_created_content' => 'Aangemaakte Inhoud', + 'profile_not_created_pages' => ':userName heeft geen pagina\'s gemaakt', + 'profile_not_created_chapters' => ':userName heeft geen hoofdstukken gemaakt', + 'profile_not_created_books' => ':userName heeft geen boeken gemaakt', +]; \ No newline at end of file diff --git a/resources/lang/nl/errors.php b/resources/lang/nl/errors.php new file mode 100644 index 000000000..f8b635bce --- /dev/null +++ b/resources/lang/nl/errors.php @@ -0,0 +1,70 @@ + 'Je hebt onvoldoende rechten om deze pagina te zien.', + 'permissionJson' => 'Je hebt onvoldoende rechten voor deze actie.', + + // Auth + 'error_user_exists_different_creds' => 'Een gebruiker met het e-mailadres :email bestaat al.', + 'email_already_confirmed' => 'Het e-mailadres is al bevestigd. Probeer in te loggen.', + 'email_confirmation_invalid' => 'Deze bevestigingstoken is ongeldig, Probeer opnieuw te registreren.', + 'email_confirmation_expired' => 'De bevestigingstoken is verlopen, Een nieuwe bevestigingsmail is verzonden.', + 'ldap_fail_anonymous' => 'LDAP toegang kon geen \'anonymous bind\' uitvoeren', + 'ldap_fail_authed' => 'LDAP toegang was niet mogelijk met de opgegeven dn & wachtwoord', + 'ldap_extension_not_installed' => 'LDAP PHP extension not installed', + 'ldap_cannot_connect' => 'Kon niet met de LDAP server verbinden', + 'social_no_action_defined' => 'Geen actie gedefineerd', + 'social_account_in_use' => 'Dit :socialAccount account is al in gebruik, Probeer in te loggen met de :socialAccount optie.', + 'social_account_email_in_use' => 'Het e-mailadres :email is al in gebruik. Als je al een account hebt kun je een :socialAccount account verbinden met je profielinstellingen.', + 'social_account_existing' => 'Dit :socialAccount is al gekoppeld aan een profiel.', + 'social_account_already_used_existing' => 'Dit :socialAccount account is ingebruik door een andere gebruiker.', + 'social_account_not_used' => 'Dit :socialAccount account is niet gekopeld aan een gebruiker. Koppel het via je profielinstellingen. ', + 'social_account_register_instructions' => 'Als je nog geen account hebt kun je je registreren met de :socialAccount optie.', + 'social_driver_not_found' => 'Social driver niet gevonden', + 'social_driver_not_configured' => 'Je :socialAccount instellingen zijn correct geconfigureerd.', + + // System + 'path_not_writable' => 'Bestand :filePath kon niet geupload worden. Zorg dat je schrijfrechten op de server hebt.', + 'cannot_get_image_from_url' => 'Kon geen afbeelding genereren van :url', + 'cannot_create_thumbs' => 'De server kon geen thumbnails maken. Controleer of je de GD PHP extensie geïnstalleerd hebt.', + 'server_upload_limit' => 'Het afbeeldingsformaat is te groot. Probeer een kleinere bestandsgrootte.', + 'image_upload_error' => 'Er ging iets fout bij het uploaden van de afbeelding', + + // Attachments + 'attachment_page_mismatch' => 'Bij het bijwerken van de bijlage bleek de pagina onjuist', + + // Pages + 'page_draft_autosave_fail' => 'Kon het concept niet opslaan. Zorg ervoor dat je een werkende internetverbinding hebt.', + + // Entities + 'entity_not_found' => 'Entiteit niet gevonden', + 'book_not_found' => 'Boek niet gevonden', + 'page_not_found' => 'Pagina niet gevonden', + 'chapter_not_found' => 'Hoofdstuk niet gevonden', + 'selected_book_not_found' => 'Het geselecteerde boek is niet gevonden', + 'selected_book_chapter_not_found' => 'Het geselecteerde boek of hoofdstuk is niet gevonden', + 'guests_cannot_save_drafts' => 'Gasten kunnen geen concepten opslaan', + + // Users + 'users_cannot_delete_only_admin' => 'Je kunt niet het enige admin account verwijderen', + 'users_cannot_delete_guest' => 'Je kunt het gastaccount niet verwijderen', + + // Roles + 'role_cannot_be_edited' => 'Deze rol kan niet bewerkt worden', + 'role_system_cannot_be_deleted' => 'Dit is een systeemrol en kan niet verwijderd worden', + 'role_registration_default_cannot_delete' => 'Deze rol kan niet verwijerd worden zolang dit de standaardrol na registratie is.', + + // Error pages + '404_page_not_found' => 'Pagina Niet Gevonden', + 'sorry_page_not_found' => 'Sorry, de pagina die je zocht is niet beschikbaar.', + 'return_home' => 'Terug naar home', + 'error_occurred' => 'Er Ging Iets Fout', + 'app_down' => ':appName is nu niet beschikbaar', + 'back_soon' => 'Komt snel weer online.', +]; \ No newline at end of file diff --git a/resources/lang/nl/pagination.php b/resources/lang/nl/pagination.php new file mode 100644 index 000000000..9a2a9677a --- /dev/null +++ b/resources/lang/nl/pagination.php @@ -0,0 +1,19 @@ + '« Vorige', + 'next' => 'Volgende »', + +]; diff --git a/resources/lang/nl/passwords.php b/resources/lang/nl/passwords.php new file mode 100644 index 000000000..f89830804 --- /dev/null +++ b/resources/lang/nl/passwords.php @@ -0,0 +1,22 @@ + 'Wachtwoorden moeten overeenkomen en minimaal zes tekens lang zijn.', + 'user' => "We kunnen niemand vinden met dat e-mailadres.", + 'token' => 'De token om het wachtwoord te herstellen is ongeldig.', + 'sent' => 'We hebben je een link gestuurd om je wachtwoord te herstellen!', + 'reset' => 'Je wachtwoord is hersteld!', + +]; diff --git a/resources/lang/nl/settings.php b/resources/lang/nl/settings.php new file mode 100644 index 000000000..7408a2dc3 --- /dev/null +++ b/resources/lang/nl/settings.php @@ -0,0 +1,111 @@ + 'Instellingen', + 'settings_save' => 'Instellingen Opslaan', + 'settings_save_success' => 'Instellingen Opgeslagen', + + /** + * App settings + */ + + 'app_settings' => 'App Instellingen', + 'app_name' => 'Applicatienaam', + 'app_name_desc' => 'De applicatienaam wordt in e-mails in in de header weergegeven.', + 'app_name_header' => 'Applicatienaam in de header weergeven?', + 'app_public_viewing' => 'Publieke bewerkingen toestaan?', + 'app_secure_images' => 'Beter beveiligide afbeeldingen gebruiken?', + 'app_secure_images_desc' => 'Omwille van de performance zijn alle afbeeldingen publiek toegankelijk. Zorg ervoor dat je de \'directory index\' niet hebt ingeschakeld.', + 'app_editor' => 'Pagina Bewerken', + 'app_editor_desc' => 'Selecteer welke tekstverwerker je wilt gebruiken.', + 'app_custom_html' => 'Speciale HTML toevoegen', + 'app_custom_html_desc' => 'Alles wat je hier toevoegd wordt in de sectie van elke pagina meengenomen. Dit kun je bijvoorbeeld voor analytics gebruiken.', + 'app_logo' => 'Applicatielogo', + 'app_logo_desc' => 'De afbeelding moet 43px hoog zijn.
    Grotere afbeeldingen worden geschaald.', + 'app_primary_color' => 'Applicatie hoofdkleur', + 'app_primary_color_desc' => 'Geef een hexadecimale waarde.
    Als je niks invult wordt de standaardkleur gebruikt.', + + /** + * Registration settings + */ + + 'reg_settings' => 'Registratieinstellingen', + 'reg_allow' => 'Registratie toestaan?', + 'reg_default_role' => 'Standaard rol na registratie', + 'reg_confirm_email' => 'E-mailbevesting vereist?', + 'reg_confirm_email_desc' => 'Als domeinrestricties aan staan dan is altijd e-maibevestiging nodig. Onderstaande instelling wordt dan genegeerd.', + 'reg_confirm_restrict_domain' => 'Beperk registratie tot een maildomein', + 'reg_confirm_restrict_domain_desc' => 'Geen een komma-gescheiden lijst van domeinnamen die gebruikt mogen worden bij registratie.
    Let op: na registratie kunnen gebruikers hun e-mailadres nog steeds wijzigen.', + 'reg_confirm_restrict_domain_placeholder' => 'Geen beperkingen ingesteld', + + /** + * Role settings + */ + + 'roles' => 'Rollen', + 'role_user_roles' => 'Gebruikrollen', + 'role_create' => 'Nieuwe Rol Maken', + 'role_create_success' => 'Rol succesvol aangemaakt', + 'role_delete' => 'Rol Verwijderen', + 'role_delete_confirm' => 'Dit verwijdert de rol \':roleName\'.', + 'role_delete_users_assigned' => 'Er zijn :userCount gebruikers met deze rol. Selecteer hieronder een nieuwe rol als je deze gebruikers een andere rol wilt geven.', + 'role_delete_no_migration' => "Geen gebruikers migreren", + 'role_delete_sure' => 'Weet je zeker dat je deze rol wilt verwijderen?', + 'role_delete_success' => 'Rol succesvol verwijderd', + 'role_edit' => 'Rol Bewerken', + 'role_details' => 'Rol Details', + 'role_name' => 'Rolnaam', + 'role_desc' => 'Korte beschrijving van de rol', + 'role_system' => 'Systeem Permissies', + 'role_manage_users' => 'Gebruikers beheren', + 'role_manage_roles' => 'Rollen en rechten beheren', + 'role_manage_entity_permissions' => 'Beheer alle boeken-, hoofdstukken- en paginaresitrcties', + 'role_manage_own_entity_permissions' => 'Beheer restricties van je eigen boeken, hoofdstukken en pagina\'s', + 'role_manage_settings' => 'Beheer app instellingen', + 'role_asset' => 'Asset Permissies', + 'role_asset_desc' => 'Deze permissies bepalen de standaardtoegangsrechten. Permissies op boeken, hoofdstukken en pagina\'s overschrijven deze instelling.', + 'role_all' => 'Alles', + 'role_own' => 'Eigen', + 'role_controlled_by_asset' => 'Gecontroleerd door de asset waar deze is geüpload', + 'role_save' => 'Rol Opslaan', + 'role_update_success' => 'Rol succesvol bijgewerkt', + 'role_users' => 'Gebruikers in deze rol', + 'role_users_none' => 'Geen enkele gebruiker heeft deze rol', + + /** + * Users + */ + + 'users' => 'Gebruikers', + 'user_profile' => 'Gebruikersprofiel', + 'users_add_new' => 'Gebruiker toevoegen', + 'users_search' => 'Gebruiker zoeken', + 'users_role' => 'Gebruikersrollen', + 'users_external_auth_id' => 'External Authentication ID', + 'users_password_warning' => 'Vul onderstaande formulier alleen in als je het wachtwoord wilt aanpassen:', + 'users_system_public' => 'De eigenschappen van deze gebruiker worden voor elke gastbezoeker gebruikt. Er kan niet mee ingelogd worden en wordt automatisch toegewezen.', + 'users_delete' => 'Verwijder gebruiker', + 'users_delete_named' => 'Verwijder gebruiker :userName', + 'users_delete_warning' => 'Dit zal de gebruiker \':userName\' volledig uit het systeem verwijderen.', + 'users_delete_confirm' => 'Weet je zeker dat je deze gebruiker wilt verwijderen?', + 'users_delete_success' => 'Gebruiker succesvol verwijderd', + 'users_edit' => 'Bewerk Gebruiker', + 'users_edit_profile' => 'Bewerk Profiel', + 'users_edit_success' => 'Gebruiker succesvol bijgewerkt', + 'users_avatar' => 'Avatar', + 'users_avatar_desc' => 'De afbeelding moet vierkant zijn en ongeveer 256px breed.', + 'users_preferred_language' => 'Voorkeurstaal', + 'users_social_accounts' => 'Social Accounts', + 'users_social_accounts_info' => 'Hier kun je accounts verbinden om makkelijker in te loggen. Via je profiel kun je ook weer rechten intrekken die bij deze social accountsh horen.', + 'users_social_connect' => 'Account Verbinden', + 'users_social_disconnect' => 'Account Ontkoppelen', + 'users_social_connected' => ':socialAccount account is succesvol aan je profiel gekoppeld.', + 'users_social_disconnected' => ':socialAccount account is succesvol ontkoppeld van je profiel.', +]; diff --git a/resources/lang/nl/validation.php b/resources/lang/nl/validation.php new file mode 100644 index 000000000..b75af7485 --- /dev/null +++ b/resources/lang/nl/validation.php @@ -0,0 +1,108 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'email' => 'The :attribute must be a valid email address.', + 'filled' => 'The :attribute field is required.', + 'exists' => 'The selected :attribute is invalid.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'password-confirm' => [ + 'required_with' => 'Password confirmation required', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/lang/pt_BR/entities.php b/resources/lang/pt_BR/entities.php index a6e670353..922342424 100644 --- a/resources/lang/pt_BR/entities.php +++ b/resources/lang/pt_BR/entities.php @@ -26,6 +26,10 @@ return [ 'no_pages_viewed' => 'Você não visualizou nenhuma página', 'no_pages_recently_created' => 'Nenhuma página recentemente criada', 'no_pages_recently_updated' => 'Nenhuma página recentemente atualizada', + 'export' => 'Exportar', + 'export_html' => 'Arquivo Web Contained', + 'export_pdf' => 'Arquivo PDF', + 'export_text' => 'Arquivo Texto', /** * Permissions and restrictions @@ -161,10 +165,6 @@ return [ 'pages_revisions_preview' => 'Preview', 'pages_revisions_restore' => 'Restaurar', 'pages_revisions_none' => 'Essa página não tem revisões', - 'pages_export' => 'Exportar', - 'pages_export_html' => 'Arquivo Web Contained', - 'pages_export_pdf' => 'Arquivo PDF', - 'pages_export_text' => 'Arquivo Texto', 'pages_copy_link' => 'Copia Link', 'pages_permissions_active' => 'Permissões de Página Ativas', 'pages_initial_revision' => 'Publicação Inicial', diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 6c8b1720c..706747b8b 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -32,10 +32,11 @@ @if(count($socialDrivers) > 0)
    -

    {{ trans('auth.social_login') }}

    - @foreach($socialDrivers as $driver => $enabled) -
    @icon($driver, ['width' => 56]) -   + @foreach($socialDrivers as $driver => $name) + + @icon($driver) + {{ trans('auth.log_in_with', ['socialDriver' => $name]) }} + @endforeach @endif diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 860508df0..d5db4afa8 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -35,11 +35,11 @@ @if(count($socialDrivers) > 0)
    -

    {{ trans('auth.social_registration') }}

    -

    {{ trans('auth.social_registration_text') }}

    - @foreach($socialDrivers as $driver => $enabled) - @icon($driver, ['width' => 56]) -   + @foreach($socialDrivers as $driver => $name) + + @icon($driver) + {{ trans('auth.sign_up_with', ['socialDriver' => $name]) }} + @endforeach @endif diff --git a/resources/views/base.blade.php b/resources/views/base.blade.php index 43f22d89a..4287014c2 100644 --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@ -17,15 +17,16 @@ - + @yield('head') @include('partials/custom-styles') - - @if(setting('app-custom-head')) + @if(setting('app-custom-head') && \Route::currentRouteName() !== 'settings') + {!! setting('app-custom-head') !!} + @endif @@ -55,15 +56,15 @@
    - @if(isset($signedIn) && $signedIn) - @include('partials._header-dropdown', ['currentUser' => $currentUser]) + @if(signedInUser()) + @include('partials._header-dropdown', ['currentUser' => user()]) @endif
    diff --git a/resources/views/books/export.blade.php b/resources/views/books/export.blade.php new file mode 100644 index 000000000..3ea3c9d65 --- /dev/null +++ b/resources/views/books/export.blade.php @@ -0,0 +1,80 @@ + + + + + {{ $book->name }} + + + @yield('head') + + +
    +
    +
    +
    + +

    {{$book->name}}

    + +

    {{ $book->description }}

    + + @if(count($bookChildren) > 0) +
      + @foreach($bookChildren as $bookChild) +
    • {{ $bookChild->name }}
    • + @if($bookChild->isA('chapter') && count($bookChild->pages) > 0) + + @endif + @endforeach +
    + @endif + + @foreach($bookChildren as $bookChild) +
    +

    {{ $bookChild->name }}

    + @if($bookChild->isA('chapter')) +

    {{ $bookChild->description }}

    + @if(count($bookChild->pages) > 0) + @foreach($bookChild->pages as $page) +
    +
    {{$bookChild->name}}
    +

    {{ $page->name }}

    + {!! $page->html !!} + @endforeach + @endif + @else + {!! $bookChild->html !!} + @endif + @endforeach + +
    +
    +
    +
    + + diff --git a/resources/views/books/form.blade.php b/resources/views/books/form.blade.php index 514abf42c..b1484d129 100644 --- a/resources/views/books/form.blade.php +++ b/resources/views/books/form.blade.php @@ -11,6 +11,6 @@
    - {{ trans('common.cancel') }} + {{ trans('common.cancel') }}
    \ No newline at end of file diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index 6a18302bc..f5e08b2f6 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -5,11 +5,19 @@
    -
    +
    @include('books._breadcrumbs', ['book' => $book])
    -
    +
    + +
    {{ trans('entities.export') }}
    + +
    @if(userCan('page-create', $book)) {{ trans('entities.pages_new') }} @endif diff --git a/resources/views/chapters/export.blade.php b/resources/views/chapters/export.blade.php new file mode 100644 index 000000000..0fc1295df --- /dev/null +++ b/resources/views/chapters/export.blade.php @@ -0,0 +1,54 @@ + + + + + {{ $chapter->name }} + + + @yield('head') + + +
    +
    +
    +
    + +

    {{$chapter->name}}

    + +

    {{ $chapter->description }}

    + + @if(count($pages) > 0) + + @endif + + @foreach($pages as $page) +
    +

    {{ $page->name }}

    + {!! $page->html !!} + @endforeach + +
    +
    +
    +
    + + diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php index 93eee6424..28c34eef2 100644 --- a/resources/views/chapters/show.blade.php +++ b/resources/views/chapters/show.blade.php @@ -10,6 +10,14 @@
    + +
    {{ trans('entities.export') }}
    + +
    @if(userCan('page-create', $chapter)) {{ trans('entities.pages_new') }} @endif diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php index c9e600ceb..a0e34e83d 100644 --- a/resources/views/errors/404.blade.php +++ b/resources/views/errors/404.blade.php @@ -10,22 +10,24 @@

    {{ trans('errors.sorry_page_not_found') }}

    {{ trans('errors.return_home') }}

    -
    + @if (setting('app-public') || !user()->isDefault()) +
    -
    -
    -

    {{ trans('entities.pages_popular') }}

    - @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Page::class]), 'style' => 'compact']) +
    +
    +

    {{ trans('entities.pages_popular') }}

    + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Page::class]), 'style' => 'compact']) +
    +
    +

    {{ trans('entities.books_popular') }}

    + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Book::class]), 'style' => 'compact']) +
    +
    +

    {{ trans('entities.chapters_popular') }}

    + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Chapter::class]), 'style' => 'compact']) +
    -
    -

    {{ trans('entities.books_popular') }}

    - @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Book::class]), 'style' => 'compact']) -
    -
    -

    {{ trans('entities.chapters_popular') }}

    - @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Chapter::class]), 'style' => 'compact']) -
    -
    + @endif
    @stop \ No newline at end of file diff --git a/resources/views/pages/export.blade.php b/resources/views/pages/export.blade.php index 19a635563..0bb376a9a 100644 --- a/resources/views/pages/export.blade.php +++ b/resources/views/pages/export.blade.php @@ -5,7 +5,9 @@ {{ $page->name }} @yield('head') diff --git a/resources/views/pages/page-display.blade.php b/resources/views/pages/page-display.blade.php index 6eb927687..cb7cae445 100644 --- a/resources/views/pages/page-display.blade.php +++ b/resources/views/pages/page-display.blade.php @@ -1,6 +1,6 @@
    -

    {{$page->name}}

    +

    {{$page->name}}

    diff --git a/resources/views/pages/pdf.blade.php b/resources/views/pages/pdf.blade.php index 7e43c5e1a..33a009fee 100644 --- a/resources/views/pages/pdf.blade.php +++ b/resources/views/pages/pdf.blade.php @@ -30,11 +30,5 @@ clear: both; display: block; } - - .tag-display { - min-width: 0; - max-width: none; - display: none; - } @stop \ No newline at end of file diff --git a/resources/views/pages/show.blade.php b/resources/views/pages/show.blade.php index fd6cebf41..244a47c02 100644 --- a/resources/views/pages/show.blade.php +++ b/resources/views/pages/show.blade.php @@ -11,11 +11,11 @@ +
    +
    +
    + @include('pages/comments', ['pageId' => $page->id]) +
    +
    +
    @include('partials/highlight') @stop @section('scripts') @stop diff --git a/resources/views/users/create.blade.php b/resources/views/users/create.blade.php index de3a3151f..e0019e618 100644 --- a/resources/views/users/create.blade.php +++ b/resources/views/users/create.blade.php @@ -21,6 +21,10 @@
    {!! csrf_field() !!} @include('users/forms/' . $authMethod) +
    + {{ trans('common.cancel') }} + +
    diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index bf10b829d..ff3475194 100644 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -19,38 +19,42 @@
    -
    - {!! csrf_field() !!} - - @include('users.forms.' . $authMethod, ['model' => $user]) +
    + {!! csrf_field() !!} + + @include('users.forms.' . $authMethod, ['model' => $user]) -
    -
    -
    - -

    {{ trans('settings.users_avatar_desc') }}

    - - @include('components.image-picker', [ - 'resizeHeight' => '512', - 'resizeWidth' => '512', - 'showRemove' => false, - 'defaultImage' => baseUrl('/user_avatar.png'), - 'currentImage' => $user->getAvatar(80), - 'currentId' => $user->image_id, - 'name' => 'image_id', - 'imageClass' => 'avatar large' - ])
    -
    - - +
    +
    + +

    {{ trans('settings.users_avatar_desc') }}

    + + @include('components.image-picker', [ + 'resizeHeight' => '512', + 'resizeWidth' => '512', + 'showRemove' => false, + 'defaultImage' => baseUrl('/user_avatar.png'), + 'currentImage' => $user->getAvatar(80), + 'currentId' => $user->image_id, + 'name' => 'image_id', + 'imageClass' => 'avatar large' + ]) +
    +
    + + +
    -
    +
    + {{ trans('common.cancel') }} + +

    @@ -60,7 +64,7 @@

    {{ trans('settings.users_social_accounts_info') }}

    @foreach($activeSocialDrivers as $driver => $enabled) -
    +
    @icon($driver, ['width' => 56])
    @if($user->hasSocialAccount($driver)) diff --git a/resources/views/users/forms/ldap.blade.php b/resources/views/users/forms/ldap.blade.php index 0a6cf79ae..f6e8b4c80 100644 --- a/resources/views/users/forms/ldap.blade.php +++ b/resources/views/users/forms/ldap.blade.php @@ -22,9 +22,4 @@ @include('form.text', ['name' => 'external_auth_id'])
    -@endif - -
    - {{ trans('common.cancel') }} - -
    \ No newline at end of file +@endif \ No newline at end of file diff --git a/resources/views/users/forms/standard.blade.php b/resources/views/users/forms/standard.blade.php index 39ae4c770..fa712368b 100644 --- a/resources/views/users/forms/standard.blade.php +++ b/resources/views/users/forms/standard.blade.php @@ -31,10 +31,4 @@
    @include('form.password', ['name' => 'password-confirm']) -
    - -
    - {{ trans('common.cancel') }} - -
    - +
    \ No newline at end of file diff --git a/resources/views/users/forms/system.blade.php b/resources/views/users/forms/system.blade.php index 868dad854..6243010a4 100644 --- a/resources/views/users/forms/system.blade.php +++ b/resources/views/users/forms/system.blade.php @@ -19,8 +19,3 @@
    @endif -
    - {{ trans('common.cancel') }} - -
    - diff --git a/routes/web.php b/routes/web.php index 42b88f3d6..4b57138e2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,6 @@ 'auth'], function () { @@ -26,6 +26,9 @@ Route::group(['middleware' => 'auth'], function () { Route::get('/{slug}/delete', 'BookController@showDelete'); Route::get('/{bookSlug}/sort', 'BookController@sort'); Route::put('/{bookSlug}/sort', 'BookController@saveSort'); + Route::get('/{bookSlug}/export/html', 'BookController@exportHtml'); + Route::get('/{bookSlug}/export/pdf', 'BookController@exportPdf'); + Route::get('/{bookSlug}/export/plaintext', 'BookController@exportPlainText'); // Pages Route::get('/{bookSlug}/page/create', 'PageController@create'); @@ -64,6 +67,9 @@ Route::group(['middleware' => 'auth'], function () { Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move'); Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit'); Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showRestrict'); + Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', 'ChapterController@exportPdf'); + Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', 'ChapterController@exportHtml'); + Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', 'ChapterController@exportPlainText'); Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@restrict'); Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete'); Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy'); @@ -114,12 +120,12 @@ Route::group(['middleware' => 'auth'], function () { Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax'); // Comments - Route::post('/ajax/page/{pageId}/comment/', 'CommentController@add'); - Route::put('/ajax/page/comment/{id}', 'CommentController@update'); + Route::post('/ajax/page/{pageId}/comment/', 'CommentController@save'); + Route::put('/ajax/page/{pageId}/comment/{commentId}', 'CommentController@save'); Route::delete('/ajax/comment/{id}', 'CommentController@destroy'); - Route::get('/ajax/page/{pageId}/comment/', 'CommentController@getLastXComments'); - Route::get('/ajax/page/{pageId}/comment/{id}/sub-comments', 'CommentController@getChildComments'); - + Route::get('/ajax/page/{pageId}/comments/{commentId}/sub-comments', 'CommentController@getComments'); + Route::get('/ajax/page/{pageId}/comments/', 'CommentController@getComments'); + // Links Route::get('/link/{id}', 'PageController@redirectFromLink'); @@ -136,7 +142,7 @@ Route::group(['middleware' => 'auth'], function () { // Settings Route::group(['prefix' => 'settings'], function() { - Route::get('/', 'SettingController@index'); + Route::get('/', 'SettingController@index')->name('settings'); Route::post('/', 'SettingController@update'); // Users diff --git a/tests/ActivityTrackingTest.php b/tests/ActivityTrackingTest.php index 137317996..bb65fbcf4 100644 --- a/tests/ActivityTrackingTest.php +++ b/tests/ActivityTrackingTest.php @@ -1,4 +1,4 @@ -asAdmin(); - $admin = $this->getAdmin(); $fileName = 'upload_test_file.txt'; $this->uploadFile($fileName, $page->id); diff --git a/tests/Auth/AuthTest.php b/tests/Auth/AuthTest.php index f75958838..4de35faff 100644 --- a/tests/Auth/AuthTest.php +++ b/tests/Auth/AuthTest.php @@ -1,4 +1,4 @@ -press('Resend Confirmation Email'); // Get confirmation and confirm notification matches - $emailConfirmation = DB::table('email_confirmations')->where('user_id', '=', $dbUser->id)->first(); + $emailConfirmation = \DB::table('email_confirmations')->where('user_id', '=', $dbUser->id)->first(); Notification::assertSentTo($dbUser, ConfirmEmail::class, function($notification, $channels) use ($emailConfirmation) { return $notification->token === $emailConfirmation->token; }); @@ -177,7 +177,7 @@ class AuthTest extends BrowserKitTest ->seePageIs('/settings/users'); $userPassword = \BookStack\User::find($user->id)->password; - $this->assertTrue(Hash::check('newpassword', $userPassword)); + $this->assertTrue(\Hash::check('newpassword', $userPassword)); } public function test_user_deletion() @@ -238,7 +238,6 @@ class AuthTest extends BrowserKitTest Notification::assertSentTo($user, \BookStack\Notifications\ResetPassword::class); $n = Notification::sent($user, \BookStack\Notifications\ResetPassword::class); - $reset = DB::table('password_resets')->where('email', '=', 'admin@admin.com')->first(); $this->visit('/password/reset/' . $n->first()->token) ->see('Reset Password') ->submitForm('Reset Password', [ diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index 80d0c9fe2..681ead91c 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -1,4 +1,4 @@ -set(['auth.method' => 'ldap', 'services.ldap.base_dn' => 'dc=ldap,dc=local', 'auth.providers.users.driver' => 'ldap']); - $this->mockLdap = Mockery::mock(BookStack\Services\Ldap::class); + $this->mockLdap = \Mockery::mock(\BookStack\Services\Ldap::class); $this->app['BookStack\Services\Ldap'] = $this->mockLdap; $this->mockUser = factory(User::class)->make(); } @@ -22,7 +22,7 @@ class LdapTest extends BrowserKitTest $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ 'uid' => [$this->mockUser->name], 'cn' => [$this->mockUser->name], @@ -50,7 +50,7 @@ class LdapTest extends BrowserKitTest $this->mockLdap->shouldReceive('setVersion')->once(); $ldapDn = 'cn=test-user,dc=test' . config('services.ldap.base_dn'); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ 'cn' => [$this->mockUser->name], 'dn' => $ldapDn, @@ -73,7 +73,7 @@ class LdapTest extends BrowserKitTest $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ 'uid' => [$this->mockUser->name], 'cn' => [$this->mockUser->name], diff --git a/tests/Auth/SocialAuthTest.php b/tests/Auth/SocialAuthTest.php index aff86a81e..e3494d073 100644 --- a/tests/Auth/SocialAuthTest.php +++ b/tests/Auth/SocialAuthTest.php @@ -1,4 +1,4 @@ -setSettings(['registration-enabled' => 'true']); config(['GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']); - $mockSocialite = Mockery::mock('Laravel\Socialite\Contracts\Factory'); + $mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory'); $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; - $mockSocialDriver = Mockery::mock('Laravel\Socialite\Contracts\Provider'); - $mockSocialUser = Mockery::mock('\Laravel\Socialite\Contracts\User'); + $mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider'); + $mockSocialUser = \Mockery::mock('\Laravel\Socialite\Contracts\User'); $mockSocialite->shouldReceive('driver')->twice()->with('google')->andReturn($mockSocialDriver); $mockSocialDriver->shouldReceive('redirect')->once()->andReturn(redirect('/')); @@ -34,18 +34,16 @@ class SocialAuthTest extends BrowserKitTest public function test_social_login() { - $user = factory(\BookStack\User::class)->make(); - config([ 'GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'GITHUB_APP_ID' => 'abc123', 'GITHUB_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost' ]); - $mockSocialite = Mockery::mock('Laravel\Socialite\Contracts\Factory'); + $mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory'); $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; - $mockSocialDriver = Mockery::mock('Laravel\Socialite\Contracts\Provider'); - $mockSocialUser = Mockery::mock('\Laravel\Socialite\Contracts\User'); + $mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider'); + $mockSocialUser = \Mockery::mock('\Laravel\Socialite\Contracts\User'); $mockSocialUser->shouldReceive('getId')->twice()->andReturn('logintest123'); @@ -68,7 +66,7 @@ class SocialAuthTest extends BrowserKitTest ->seePageIs('/login'); // Test social callback with matching social account - DB::table('social_accounts')->insert([ + \DB::table('social_accounts')->insert([ 'user_id' => $this->getAdmin()->id, 'driver' => 'github', 'driver_id' => 'logintest123' diff --git a/tests/BrowserKitTest.php b/tests/BrowserKitTest.php index 0a97c1292..8e02cb5f1 100644 --- a/tests/BrowserKitTest.php +++ b/tests/BrowserKitTest.php @@ -1,9 +1,12 @@ -make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + $app->make(Kernel::class)->bootstrap(); return $app; } @@ -48,7 +51,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase */ public function getAdmin() { if($this->admin === null) { - $adminRole = \BookStack\Role::getRole('admin'); + $adminRole = Role::getSystemRole('admin'); $this->admin = $adminRole->users->first(); } return $this->admin; @@ -95,9 +98,9 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase protected function createEntityChainBelongingToUser($creatorUser, $updaterUser = false) { if ($updaterUser === false) $updaterUser = $creatorUser; - $book = factory(BookStack\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); - $chapter = factory(BookStack\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); - $page = factory(BookStack\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]); + $book = factory(\BookStack\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); + $chapter = factory(\BookStack\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); + $page = factory(\BookStack\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]); $book->chapters()->saveMany([$chapter]); $chapter->pages()->saveMany([$page]); $restrictionService = $this->app[\BookStack\Services\PermissionService::class]; @@ -117,7 +120,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase protected function getEditor($attributes = []) { $user = factory(\BookStack\User::class)->create($attributes); - $role = \BookStack\Role::getRole('editor'); + $role = Role::getRole('editor'); $user->attachRole($role);; return $user; } @@ -211,7 +214,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase /** * Check if the page contains the given element. * @param string $selector - * @return bool */ protected function pageHasElement($selector) { @@ -223,7 +225,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase /** * Check if the page contains the given element. * @param string $selector - * @return bool */ protected function pageNotHasElement($selector) { diff --git a/tests/CommandsTest.php b/tests/CommandsTest.php new file mode 100644 index 000000000..5df82ee51 --- /dev/null +++ b/tests/CommandsTest.php @@ -0,0 +1,102 @@ +asEditor(); + $page = Page::first(); + + $this->get($page->getUrl()); + + $this->assertDatabaseHas('views', [ + 'user_id' => $this->getEditor()->id, + 'viewable_id' => $page->id, + 'views' => 1 + ]); + + $exitCode = \Artisan::call('bookstack:clear-views'); + $this->assertTrue($exitCode === 0, 'Command executed successfully'); + + $this->assertDatabaseMissing('views', [ + 'user_id' => $this->getEditor()->id + ]); + } + + public function test_clear_activity_command() + { + $this->asEditor(); + $page = Page::first(); + \Activity::add($page, 'page_update', $page->book->id); + + $this->assertDatabaseHas('activities', [ + 'key' => 'page_update', + 'entity_id' => $page->id, + 'user_id' => $this->getEditor()->id + ]); + + $exitCode = \Artisan::call('bookstack:clear-activity'); + $this->assertTrue($exitCode === 0, 'Command executed successfully'); + + + $this->assertDatabaseMissing('activities', [ + 'key' => 'page_update' + ]); + } + + public function test_clear_revisions_command() + { + $this->asEditor(); + $entityRepo = $this->app[EntityRepo::class]; + $page = Page::first(); + $entityRepo->updatePage($page, $page->book_id, ['name' => 'updated page', 'html' => '

    new content

    ', 'summary' => 'page revision testing']); + $entityRepo->updatePageDraft($page, ['name' => 'updated page', 'html' => '

    new content in draft

    ', 'summary' => 'page revision testing']); + + $this->assertDatabaseHas('page_revisions', [ + 'page_id' => $page->id, + 'type' => 'version' + ]); + $this->assertDatabaseHas('page_revisions', [ + 'page_id' => $page->id, + 'type' => 'update_draft' + ]); + + $exitCode = \Artisan::call('bookstack:clear-revisions'); + $this->assertTrue($exitCode === 0, 'Command executed successfully'); + + $this->assertDatabaseMissing('page_revisions', [ + 'page_id' => $page->id, + 'type' => 'version' + ]); + $this->assertDatabaseHas('page_revisions', [ + 'page_id' => $page->id, + 'type' => 'update_draft' + ]); + + $exitCode = \Artisan::call('bookstack:clear-revisions', ['--all' => true]); + $this->assertTrue($exitCode === 0, 'Command executed successfully'); + + $this->assertDatabaseMissing('page_revisions', [ + 'page_id' => $page->id, + 'type' => 'update_draft' + ]); + } + + public function test_regen_permissions_command() + { + JointPermission::query()->truncate(); + $page = Page::first(); + + $this->assertDatabaseMissing('joint_permissions', ['entity_id' => $page->id]); + + $exitCode = \Artisan::call('bookstack:regenerate-permissions'); + $this->assertTrue($exitCode === 0, 'Command executed successfully'); + + $this->assertDatabaseHas('joint_permissions', ['entity_id' => $page->id]); + } +} diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php new file mode 100644 index 000000000..42a5da2d1 --- /dev/null +++ b/tests/CreatesApplication.php @@ -0,0 +1,18 @@ +make(Kernel::class)->bootstrap(); + return $app; + } +} \ No newline at end of file diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php index 23351e546..4ef8d46fb 100644 --- a/tests/Entity/EntitySearchTest.php +++ b/tests/Entity/EntitySearchTest.php @@ -1,4 +1,4 @@ -asEditor(); + + $resp = $this->get($page->getUrl('/export/plaintext')); + $resp->assertStatus(200); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $page->slug . '.txt'); + } + + public function test_page_pdf_export() + { + $page = Page::first(); + $this->asEditor(); + + $resp = $this->get($page->getUrl('/export/pdf')); + $resp->assertStatus(200); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $page->slug . '.pdf'); + } + + public function test_page_html_export() + { + $page = Page::first(); + $this->asEditor(); + + $resp = $this->get($page->getUrl('/export/html')); + $resp->assertStatus(200); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $page->slug . '.html'); + } + + public function test_book_text_export() + { + $page = Page::first(); + $book = $page->book; + $this->asEditor(); + + $resp = $this->get($book->getUrl('/export/plaintext')); + $resp->assertStatus(200); + $resp->assertSee($book->name); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.txt'); + } + + public function test_book_pdf_export() + { + $page = Page::first(); + $book = $page->book; + $this->asEditor(); + + $resp = $this->get($book->getUrl('/export/pdf')); + $resp->assertStatus(200); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.pdf'); + } + + public function test_book_html_export() + { + $page = Page::first(); + $book = $page->book; + $this->asEditor(); + + $resp = $this->get($book->getUrl('/export/html')); + $resp->assertStatus(200); + $resp->assertSee($book->name); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $book->slug . '.html'); + } + + public function test_chapter_text_export() + { + $chapter = Chapter::first(); + $page = $chapter->pages[0]; + $this->asEditor(); + + $resp = $this->get($chapter->getUrl('/export/plaintext')); + $resp->assertStatus(200); + $resp->assertSee($chapter->name); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $chapter->slug . '.txt'); + } + + public function test_chapter_pdf_export() + { + $chapter = Chapter::first(); + $this->asEditor(); + + $resp = $this->get($chapter->getUrl('/export/pdf')); + $resp->assertStatus(200); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $chapter->slug . '.pdf'); + } + + public function test_chapter_html_export() + { + $chapter = Chapter::first(); + $page = $chapter->pages[0]; + $this->asEditor(); + + $resp = $this->get($chapter->getUrl('/export/html')); + $resp->assertStatus(200); + $resp->assertSee($chapter->name); + $resp->assertSee($page->name); + $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $chapter->slug . '.html'); + } + +} \ No newline at end of file diff --git a/tests/Entity/MarkdownTest.php b/tests/Entity/MarkdownTest.php index 03f3aa12f..b85e92565 100644 --- a/tests/Entity/MarkdownTest.php +++ b/tests/Entity/MarkdownTest.php @@ -1,4 +1,4 @@ -get(2); + $page = Page::first(); + $secondPage = Page::all()->get(2); $secondPage->html = "

    Hello, This is a test

    This is a second block of content

    "; $secondPage->save(); - $this->asAdmin()->visit($page->getUrl()) - ->dontSee('Hello, This is a test'); + $this->asEditor(); + + $pageContent = $this->get($page->getUrl()); + $pageContent->assertDontSee('Hello, This is a test'); $originalHtml = $page->html; $page->html .= "{{@{$secondPage->id}}}"; $page->save(); - $this->asAdmin()->visit($page->getUrl()) - ->see('Hello, This is a test') - ->see('This is a second block of content'); + $pageContent = $this->get($page->getUrl()); + $pageContent->assertSee('Hello, This is a test'); + $pageContent->assertSee('This is a second block of content'); $page->html = $originalHtml . " Well {{@{$secondPage->id}#section2}}"; $page->save(); - $this->asAdmin()->visit($page->getUrl()) - ->dontSee('Hello, This is a test') - ->see('Well This is a second block of content'); + $pageContent = $this->get($page->getUrl()); + $pageContent->assertDontSee('Hello, This is a test'); + $pageContent->assertSee('Well This is a second block of content'); + } + + public function test_page_revision_views_viewable() + { + $this->asEditor(); + + $entityRepo = $this->app[EntityRepo::class]; + $page = Page::first(); + $entityRepo->updatePage($page, $page->book_id, ['name' => 'updated page', 'html' => '

    new content

    ', 'summary' => 'page revision testing']); + $pageRevision = $page->revisions->last(); + + $revisionView = $this->get($page->getUrl() . '/revisions/' . $pageRevision->id); + $revisionView->assertStatus(200); + $revisionView->assertSee('new content'); + + $revisionView = $this->get($page->getUrl() . '/revisions/' . $pageRevision->id . '/changes'); + $revisionView->assertStatus(200); + $revisionView->assertSee('new content'); + } + + public function test_page_revision_restore_updates_content() + { + $this->asEditor(); + + $entityRepo = $this->app[EntityRepo::class]; + $page = Page::first(); + $entityRepo->updatePage($page, $page->book_id, ['name' => 'updated page abc123', 'html' => '

    new contente def456

    ', 'summary' => 'initial page revision testing']); + $entityRepo->updatePage($page, $page->book_id, ['name' => 'updated page again', 'html' => '

    new content

    ', 'summary' => 'page revision testing']); + $page = Page::find($page->id); + + + $pageView = $this->get($page->getUrl()); + $pageView->assertDontSee('abc123'); + $pageView->assertDontSee('def456'); + + $revToRestore = $page->revisions()->where('name', 'like', '%abc123')->first(); + $restoreReq = $this->get($page->getUrl() . '/revisions/' . $revToRestore->id . '/restore'); + $page = Page::find($page->id); + + $restoreReq->assertStatus(302); + $restoreReq->assertRedirect($page->getUrl()); + + $pageView = $this->get($page->getUrl()); + $pageView->assertSee('abc123'); + $pageView->assertSee('def456'); } } diff --git a/tests/Entity/PageDraftTest.php b/tests/Entity/PageDraftTest.php index de875c3f3..b8ac9d3ae 100644 --- a/tests/Entity/PageDraftTest.php +++ b/tests/Entity/PageDraftTest.php @@ -1,4 +1,4 @@ -asAdmin(); - $entityRepo = app('\BookStack\Repos\EntityRepo'); + $entityRepo = app(EntityRepo::class); $draft = $entityRepo->getDraftPage($this->book); - $this->visit($this->book->getUrl()) - ->see($draft->name) - ->visit($this->book->getUrl() . '/sort') - ->dontSee($draft->name); + $resp = $this->get($this->book->getUrl()); + $resp->assertSee($draft->name); + + $resp = $this->get($this->book->getUrl() . '/sort'); + $resp->assertDontSee($draft->name); } public function test_page_move() @@ -27,17 +32,21 @@ class SortTest extends BrowserKitTest $page = \BookStack\Page::first(); $currentBook = $page->book; $newBook = \BookStack\Book::where('id', '!=', $currentBook->id)->first(); - $this->asAdmin()->visit($page->getUrl() . '/move') - ->see('Move Page') - ->type('book:' . $newBook->id, 'entity_selection')->press('Move Page'); + $resp = $this->asAdmin()->get($page->getUrl() . '/move'); + $resp->assertSee('Move Page'); + + $movePageResp = $this->put($page->getUrl() . '/move', [ + 'entity_selection' => 'book:' . $newBook->id + ]); $page = \BookStack\Page::find($page->id); - $this->seePageIs($page->getUrl()); + + $movePageResp->assertRedirect($page->getUrl()); $this->assertTrue($page->book->id == $newBook->id, 'Page book is now the new book'); - $this->visit($newBook->getUrl()) - ->seeInNthElement('.activity-list-item', 0, 'moved page') - ->seeInNthElement('.activity-list-item', 0, $page->name); + $newBookResp = $this->get($newBook->getUrl()); + $newBookResp->assertSee('moved page'); + $newBookResp->assertSee($page->name); } public function test_chapter_move() @@ -47,22 +56,68 @@ class SortTest extends BrowserKitTest $pageToCheck = $chapter->pages->first(); $newBook = \BookStack\Book::where('id', '!=', $currentBook->id)->first(); - $this->asAdmin()->visit($chapter->getUrl() . '/move') - ->see('Move Chapter') - ->type('book:' . $newBook->id, 'entity_selection')->press('Move Chapter'); + $chapterMoveResp = $this->asAdmin()->get($chapter->getUrl() . '/move'); + $chapterMoveResp->assertSee('Move Chapter'); + + $moveChapterResp = $this->put($chapter->getUrl() . '/move', [ + 'entity_selection' => 'book:' . $newBook->id + ]); $chapter = \BookStack\Chapter::find($chapter->id); - $this->seePageIs($chapter->getUrl()); + $moveChapterResp->assertRedirect($chapter->getUrl()); $this->assertTrue($chapter->book->id === $newBook->id, 'Chapter Book is now the new book'); - $this->visit($newBook->getUrl()) - ->seeInNthElement('.activity-list-item', 0, 'moved chapter') - ->seeInNthElement('.activity-list-item', 0, $chapter->name); + $newBookResp = $this->get($newBook->getUrl()); + $newBookResp->assertSee('moved chapter'); + $newBookResp->assertSee($chapter->name); $pageToCheck = \BookStack\Page::find($pageToCheck->id); $this->assertTrue($pageToCheck->book_id === $newBook->id, 'Chapter child page\'s book id has changed to the new book'); - $this->visit($pageToCheck->getUrl()) - ->see($newBook->name); + $pageCheckResp = $this->get($pageToCheck->getUrl()); + $pageCheckResp->assertSee($newBook->name); + } + + public function test_book_sort() + { + $oldBook = Book::query()->first(); + $chapterToMove = $this->newChapter(['name' => 'chapter to move'], $oldBook); + $newBook = $this->newBook(['name' => 'New sort book']); + $pagesToMove = Page::query()->take(5)->get(); + + // Create request data + $reqData = [ + [ + 'id' => $chapterToMove->id, + 'sort' => 0, + 'parentChapter' => false, + 'type' => 'chapter', + 'book' => $newBook->id + ] + ]; + foreach ($pagesToMove as $index => $page) { + $reqData[] = [ + 'id' => $page->id, + 'sort' => $index, + 'parentChapter' => $index === count($pagesToMove) - 1 ? $chapterToMove->id : false, + 'type' => 'page', + 'book' => $newBook->id + ]; + } + + $sortResp = $this->asAdmin()->put($newBook->getUrl() . '/sort', ['sort-tree' => json_encode($reqData)]); + $sortResp->assertRedirect($newBook->getUrl()); + $sortResp->assertStatus(302); + $this->assertDatabaseHas('chapters', [ + 'id' => $chapterToMove->id, + 'book_id' => $newBook->id, + 'priority' => 0 + ]); + $this->assertTrue($newBook->chapters()->count() === 1); + $this->assertTrue($newBook->chapters()->first()->pages()->count() === 1); + + $checkPage = $pagesToMove[1]; + $checkResp = $this->get(Page::find($checkPage->id)->getUrl()); + $checkResp->assertSee($newBook->name); } } \ No newline at end of file diff --git a/tests/Entity/TagTest.php b/tests/Entity/TagTest.php index f4ce581e3..257c20789 100644 --- a/tests/Entity/TagTest.php +++ b/tests/Entity/TagTest.php @@ -1,4 +1,4 @@ -langs = array_diff(scandir(resource_path('lang')), ['..', '.']); + } + + public function test_js_endpoint_for_each_language() + { + + $visibleKeys = ['common', 'components', 'entities', 'errors']; + + $this->asEditor(); + foreach ($this->langs as $lang) { + setting()->putUser($this->getEditor(), 'language', $lang); + $transResp = $this->get('/translations'); + foreach ($visibleKeys as $key) { + $transResp->assertSee($key); + } + } + } + + public function test_all_lang_files_loadable() + { + $files = array_diff(scandir(resource_path('lang/en')), ['..', '.']); + foreach ($this->langs as $lang) { + foreach ($files as $file) { + $loadError = false; + try { + $translations = trans(str_replace('.php', '', $file), [], $lang); + } catch (\Exception $e) { + $loadError = true; + } + $this->assertFalse($loadError, "Translation file {$lang}/{$file} failed to load"); + } + } + } + +} \ No newline at end of file diff --git a/tests/Permissions/RestrictionsTest.php b/tests/Permissions/RestrictionsTest.php index e874fccae..7007985e4 100644 --- a/tests/Permissions/RestrictionsTest.php +++ b/tests/Permissions/RestrictionsTest.php @@ -1,4 +1,4 @@ -asAdmin()->visit($page->getUrl()); + \Auth::logout(); + view()->share('pageTitle', ''); + $this->forceVisit('/cats/dogs/hippos'); + $this->dontSee($page->name); + } + } \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index e0455f447..f3f36ca1c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,31 +1,79 @@ -make(Kernel::class)->bootstrap(); - - return $app; + return $this->actingAs($this->getAdmin()); } -} + + /** + * Get the current admin user. + * @return mixed + */ + public function getAdmin() { + if($this->admin === null) { + $adminRole = Role::getSystemRole('admin'); + $this->admin = $adminRole->users->first(); + } + return $this->admin; + } + + /** + * Set the current user context to be an editor. + * @return $this + */ + public function asEditor() + { + return $this->actingAs($this->getEditor()); + } + + + /** + * Get a editor user. + * @return mixed + */ + public function getEditor() { + if($this->editor === null) { + $editorRole = Role::getRole('editor'); + $this->editor = $editorRole->users->first(); + } + return $this->editor; + } + + /** + * Create and return a new book. + * @param array $input + * @return Book + */ + public function newBook($input = ['name' => 'test book', 'description' => 'My new test book']) { + return $this->app[EntityRepo::class]->createFromInput('book', $input, false); + } + + /** + * Create and return a new test chapter + * @param array $input + * @param Book $book + * @return Chapter + */ + public function newChapter($input = ['name' => 'test chapter', 'description' => 'My new test chapter'], Book $book) { + return $this->app[EntityRepo::class]->createFromInput('chapter', $input, $book); + } +} \ No newline at end of file diff --git a/tests/UserProfileTest.php b/tests/UserProfileTest.php index a448e3a9f..12f88483f 100644 --- a/tests/UserProfileTest.php +++ b/tests/UserProfileTest.php @@ -1,4 +1,4 @@ -getEditor(); $this->actingAs($newUser); $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); - Activity::add($entities['book'], 'book_update', $entities['book']->id); - Activity::add($entities['page'], 'page_create', $entities['book']->id); + \Activity::add($entities['book'], 'book_update', $entities['book']->id); + \Activity::add($entities['page'], 'page_create', $entities['book']->id); $this->asAdmin()->visit('/user/' . $newUser->id) ->seeInElement('#recent-activity', 'updated book') @@ -69,8 +69,8 @@ class UserProfileTest extends BrowserKitTest $newUser = $this->getEditor(); $this->actingAs($newUser); $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); - Activity::add($entities['book'], 'book_update', $entities['book']->id); - Activity::add($entities['page'], 'page_create', $entities['book']->id); + \Activity::add($entities['book'], 'book_update', $entities['book']->id); + \Activity::add($entities['page'], 'page_create', $entities['book']->id); $this->asAdmin()->visit('/')->clickInElement('#recent-activity', $newUser->name) ->seePageIs('/user/' . $newUser->id)