mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: change default editor mode to sv
This commit is contained in:
1 parent
e80e8815cb
commit
f4dbce5a76
4 files changed
+20
-8
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import Notification from 'vj/components/notification';
|
||||
import DOMAttachedObject from 'vj/components/DOMAttachedObject';
|
||||
|
||||
export const config = {
|
||||
@@ -168,7 +169,16 @@ export default class Editor extends DOMAttachedObject {
|
||||
this.vditor = new Vditor(ele, {
|
||||
...config,
|
||||
...this.options,
|
||||
after: () => resolve(null),
|
||||
after: () => {
|
||||
const pos = $(ele).find('button[data-mode="sv"]').get();
|
||||
const button = $('<button data-mode="monaco">Monaco Editor</button>');
|
||||
button.on('click', (e) => {
|
||||
Notification.info('You can select this in PreferenceSettings');
|
||||
e.preventDefault();
|
||||
});
|
||||
button.insertAfter(pos);
|
||||
resolve(null);
|
||||
},
|
||||
input(v) {
|
||||
$dom.val(v);
|
||||
$dom.text(v);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.32.8",
|
||||
"version": "4.32.9",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -54,7 +54,7 @@ preferredEditorType:
|
||||
monaco: Monaco Editor
|
||||
family: markdown
|
||||
category: preference
|
||||
value: monaco
|
||||
value: sv
|
||||
monacoTheme:
|
||||
type:
|
||||
vs-dark: VS Dark
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<dt>{{ _('Code blocks') }}</dt>
|
||||
<dd><pre>```c++
|
||||
int main() {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
```</pre></dd>
|
||||
<dt>{{ _('Inline formulas') }}</dt>
|
||||
@@ -20,13 +20,15 @@ return 0;
|
||||
<dt>{{ _('Images') }}</dt>
|
||||
<dd><pre></pre></dd>
|
||||
<dt>{{ _('Images With Size') }}</dt>
|
||||
<dd><pre></pre></dd>
|
||||
<dd><pre></pre></dd>
|
||||
<dt>{{ _('Footnote') }}</dt>
|
||||
<dd><pre>Here is a reference[^1].
|
||||
<dd><pre>Here is a ref[^1].
|
||||
|
||||
[^1]: Here is the footnote.</pre></dd>
|
||||
[^1]: And the footnote.</pre></dd>
|
||||
<dt>{{ _('Videos') }}</dt>
|
||||
<dd><pre>@[video](https://.../file.mp4)</pre></dd>
|
||||
<dd><pre>@[video](https://.../a.mp4)</pre></dd>
|
||||
<dt>{{ _('Mention')}}</dt>
|
||||
<dd><pre>@[](/user/uid)</pre></dd>
|
||||
</dl>
|
||||
<h2>{{ _('Learn More') }}</h2>
|
||||
<ul>
|
||||
|
||||
Reference in new issue
Block a user