This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor-work.html
66 lines (60 loc) · 3.31 KB
/
editor-work.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<html dir="rtl" lang="fa-IR">
<head>
<title>Salam Editor</title>
<style type="text/css" media="screen">
body {
overflow: hidden;
}
#editor {
margin: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
<link href="https://cdn.jsdelivr.net/gh/rastikerdar/[email protected]/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="editor"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ace.min.js" integrity="sha512-xylzfb6LZn1im1ge493MNv0fISAU4QkshbKz/jVh6MJFAlZ6T1NRDJa0ZKb7ECuhSTO7fVy8wkXkT95/f4R4nA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/theme-twilight.min.js" integrity="sha512-CQbWpkkaPvt/wFnztAIuDoXvww/t8Ls9p98tRFw241zbd7jO743xfx2T8A48OXOUd7mFrb+iRCRrdwv2XDPHYw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/mode-html.min.js" integrity="sha512-JSkDZ0Crk8+F/F/lCqh6LZ/mzPqhSrRanUC3TExEziPsbLPFIJQmR5R7p954sdM88cOL9+WlVR6XBFJa3nXcdA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/snippets/html.min.js" integrity="sha512-q7p8Vl9Pu2j+nfsWLNLlITCMgOlaXKW3ZWar+86WKPsJIcg0qyxNMfavFsunVbrC7d/Ll6f8e2u8Jdy3NM/etA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-language_tools.min.js" integrity="sha512-4l33zsqrqf1PBA3iEZ399Jl9on7It0HngOkI3TG2c6W0wUyTiXRxd9Eh8zFBXNy8fMlgda/u4u1metnbEf5Hzg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-rtl.min.js" integrity="sha512-Y1PT0DPmdyo8jNcZ7Hlocor6wqXMpfGVp0rU65vQEjd2DipLQoRSgJ5V+3u6Y7Q3a6PcfsANYJ1NnjQvrReCqg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
const elm_editor = document.getElementById("editor");
elm_editor.textContent = ``;
const editor = ace.edit(elm_editor, {
mode: "ace/mode/html",
selectionStyle: "text"
})
// ace.require("ace/ext/rtl");
// ace.require("ace/ext/language_tools");
// editor.session.$bidiHandler.setRtlDirection(editor, true);
editor.setOptions({
// isRtlDir: true,
enableLiveAutocompletion: true,
autoScrollEditorIntoView: true,
copyWithEmptySelection: true,
mergeUndoDeltas: "always",
useWorker: false,
highlightActiveLine: true,
rtl: true,
rtlText: true,
enableSnippets: true,
fontSize: "20px",
fontFamily: "Vazirmatn",
showPrintMargin: false,
showGutter: false,
// spellcheck: false,
// showSpaces: false,
});
editor.setTheme("ace/theme/twilight");
// var JavaScriptMode = ace.require("ace/mode/html").Mode;
// editor.session.setMode(new JavaScriptMode());
</script>
</body>
</html>