]> BookStack Code Mirror - bookstack/blob - resources/views/pages/parts/code-editor.blade.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / resources / views / pages / parts / code-editor.blade.php
1 <div>
2     <div components="popup code-editor"
3          option:code-editor:favourites="{{ setting()->getForCurrentUser('code-language-favourites', '') }}"
4          class="popup-background code-editor">
5         <div refs="code-editor@container" class="popup-body" tabindex="-1">
6
7             <div class="popup-header flex-container-row primary-background">
8                 <div class="popup-title">{{ trans('components.code_editor') }}</div>
9                 <div component="dropdown" refs="code-editor@historyDropDown" class="flex-container-row">
10                     <button refs="dropdown@toggle">
11                         <span>@icon('history')</span>
12                         <span>{{ trans('components.code_session_history') }}</span>
13                     </button>
14                     <ul refs="dropdown@menu code-editor@historyList" class="dropdown-menu"></ul>
15                 </div>
16                 <button class="popup-header-close" refs="popup@hide">@icon('close')</button>
17             </div>
18
19             <div class="code-editor-body-wrap flex-container-row flex-fill">
20                 <div class="code-editor-language-list flex-container-column flex-fill">
21                     <label for="code-editor-language">{{ trans('components.code_language') }}</label>
22                     <input refs="code-editor@languageInput" id="code-editor-language" type="text">
23                     <div refs="code-editor@language-options-container" class="lang-options">
24                         @php
25                             $languages = [
26                                 'Bash', 'CSS', 'C', 'C++', 'C#', 'Clojure', 'Dart', 'Diff', 'Fortran', 'F#', 'Go', 'Haskell', 'HTML', 'INI',
27                                 'Java', 'JavaScript', 'JSON', 'Julia', 'Kotlin', 'LaTeX', 'Lua', 'MarkDown', 'MATLAB', 'MSSQL', 'MySQL',
28                                 'Nginx', 'OCaml', 'Octave', 'Pascal', 'Perl', 'PHP', 'PL/SQL', 'PostgreSQL', 'Powershell', 'Python',
29                                 'R', 'Ruby', 'Rust', 'SAS', 'Scala', 'Scheme', 'Shell', 'Smarty', 'SQL', 'SQLite', 'Swift',
30                                 'Twig', 'TypeScript', 'VBScript', 'VB.NET', 'XML', 'YAML',
31                             ];
32                         @endphp
33
34                         @foreach($languages as $language)
35                             <div class="relative">
36                                 <button type="button" refs="code-editor@language-button" data-favourite="false" data-lang="{{ strtolower($language) }}">{{ $language }}</button>
37                                 <button class="lang-option-favorite-toggle action-favourite" data-title="{{ trans('common.favourite') }}">@icon('star-outline')</button>
38                                 <button class="lang-option-favorite-toggle action-unfavourite" data-title="{{ trans('common.unfavourite') }}">@icon('star')</button>
39                             </div>
40                         @endforeach
41                     </div>
42                 </div>
43
44                 <div class="code-editor-main flex-fill">
45                     <textarea refs="code-editor@editor"></textarea>
46                 </div>
47
48             </div>
49
50             <div class="popup-footer">
51                 <button refs="code-editor@saveButton" type="button" class="button">{{ trans('components.code_save') }}</button>
52             </div>
53
54         </div>
55     </div>
56 </div>