0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-17 22:02:05 +00:00

Started code-editor lang favorites system

- Split bash from shell in language list
- Updated code-lang highlighting to be exact match only to prevent
  confusion scenarios (Java matching JavaScript, etc..)
- Added design for favorites
- Changed blade language list to be generated from array.
This commit is contained in:
Dan Brown 2022-07-24 21:15:43 +01:00
parent da6169159d
commit ebc5a53410
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
4 changed files with 38 additions and 40 deletions
resources/js/components

View file

@ -94,15 +94,13 @@ class CodeEditor {
languageInputChange(language) {
this.updateEditorMode(language);
const inputLang = language.toLowerCase();
let matched = false;
for (const link of this.languageLinks) {
const lang = link.dataset.lang.toLowerCase().trim();
const isMatch = inputLang && lang.startsWith(inputLang);
const isMatch = inputLang === lang;
link.classList.toggle('active', isMatch);
if (isMatch && !matched) {
if (isMatch) {
link.scrollIntoView({block: "center", behavior: "smooth"});
matched = true;
}
}
}