mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 16:47:12 -05:00
Apply the Monokai theme
This commit is contained in:
parent
8a902944a8
commit
7f76a98546
5 changed files with 17 additions and 9 deletions
|
|
@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
function onHtmlEdit() {
|
function onHtmlEdit() {
|
||||||
forEditorField([], (field) => {
|
forEditorField([], (field) => {
|
||||||
field.editingArea.toggleHtmlEdit();
|
field.editingArea.toggleHtmlEdit();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -170,7 +170,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<WithShortcut shortcut={"Control+Shift+X"} let:createShortcut let:shortcutLabel>
|
<WithShortcut shortcut={"Control+Shift+X"} let:createShortcut let:shortcutLabel>
|
||||||
<WithState
|
<WithState
|
||||||
key="htmledit"
|
key="htmledit"
|
||||||
update={(event) => { console.log(event); return true }}
|
update={(event) => {
|
||||||
|
console.log(event);
|
||||||
|
return true;
|
||||||
|
}}
|
||||||
let:state={active}
|
let:state={active}
|
||||||
let:updateState
|
let:updateState
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import CodeMirror from "codemirror/src/codemirror"
|
import CodeMirror from "codemirror/src/codemirror";
|
||||||
|
|
||||||
const codeMirrorOptions = {
|
const codeMirrorOptions = {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
|
lineWrapping: true,
|
||||||
mode: "htmlmixed",
|
mode: "htmlmixed",
|
||||||
}
|
theme: "monokai",
|
||||||
|
};
|
||||||
|
|
||||||
export class Codable extends HTMLTextAreaElement {
|
export class Codable extends HTMLTextAreaElement {
|
||||||
codeMirror: any;
|
codeMirror: any;
|
||||||
|
|
@ -28,7 +30,7 @@ export class Codable extends HTMLTextAreaElement {
|
||||||
teardown(): string {
|
teardown(): string {
|
||||||
this.codeMirror.toTextArea();
|
this.codeMirror.toTextArea();
|
||||||
this.codeMirror = undefined;
|
this.codeMirror = undefined;
|
||||||
console.log(this.innerHTML)
|
console.log(this.innerHTML);
|
||||||
return this.innerHTML;
|
return this.innerHTML;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
@use 'ts/sass/scrollbar';
|
@use 'ts/sass/scrollbar';
|
||||||
|
|
||||||
@import 'ts/sass/codemirror/codemirror';
|
@import "ts/sass/codemirror/lib/codemirror";
|
||||||
|
@import "ts/sass/codemirror/theme/monokai";
|
||||||
|
|
||||||
anki-editable {
|
anki-editable {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class EditingArea extends HTMLDivElement {
|
||||||
this.editable = document.createElement("anki-editable") as Editable;
|
this.editable = document.createElement("anki-editable") as Editable;
|
||||||
this.shadowRoot!.appendChild(this.editable);
|
this.shadowRoot!.appendChild(this.editable);
|
||||||
|
|
||||||
this.codable = document.createElement("textarea", { is: "anki-codable" }) as Codable;
|
this.codable = document.createElement("textarea", {
|
||||||
|
is: "anki-codable",
|
||||||
|
}) as Codable;
|
||||||
this.shadowRoot!.appendChild(this.codable);
|
this.shadowRoot!.appendChild(this.codable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ vendor_js_lib(
|
||||||
name = "sass-sources",
|
name = "sass-sources",
|
||||||
include = [
|
include = [
|
||||||
"lib/codemirror.css",
|
"lib/codemirror.css",
|
||||||
|
"theme",
|
||||||
],
|
],
|
||||||
base = "external/npm/node_modules/codemirror/",
|
base = "external/npm/node_modules/codemirror/",
|
||||||
pkg = pkg_from_name("codemirror"),
|
pkg = pkg_from_name("codemirror"),
|
||||||
strip_prefix = "lib/",
|
|
||||||
visibility = ["//visibility:private"],
|
visibility = ["//visibility:private"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue