gitlatex 1.5.0__tar.gz → 1.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gitlatex-1.5.0 → gitlatex-1.5.2}/PKG-INFO +1 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/__init__.py +1 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/http.py +0 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/base.css +1 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/layout.css +6 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/versions.css +2 -2
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/index.html +1 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/layout.js +37 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/files.py +18 -14
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/PKG-INFO +1 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/pyproject.toml +1 -1
- {gitlatex-1.5.0 → gitlatex-1.5.2}/README.md +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/__main__.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/app.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/app.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/bib-commands.json +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/console.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/docs.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/editor.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/home.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/loading.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/outline.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/problems.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/settings.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/sidebar.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/support.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/toolbar.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/css/updates.css +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/favicon.svg +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/build/compile.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/build/problems.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/api.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/filetypes.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/router.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/state.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/core/storage.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/completions.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/envcolors.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/filetree.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/languages.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/mainfile.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/monaco.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/outline.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/projectindex.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/session.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/editor/spell.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/actions.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/diffview.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/menu.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/git/versions.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/home/repolist.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/consolepane.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/loading.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/modals.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/settings.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/theme.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/js/ui/viewer.js +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/public/latex-commands.json +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/__init__.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/compile.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/git.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/pages.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/projectindex.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/repos.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/spell.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/routes/system.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/server.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/__init__.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/git_backend.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/gitrepo.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/latex.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/paths.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/projectindex.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/spell.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/services/updates.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex/state.py +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/SOURCES.txt +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/dependency_links.txt +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/entry_points.txt +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/requires.txt +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/gitlatex.egg-info/top_level.txt +0 -0
- {gitlatex-1.5.0 → gitlatex-1.5.2}/setup.cfg +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""GitLaTeX IDE - LaTeX projects with Git support."""
|
|
2
|
-
__version__ = "1.5.
|
|
2
|
+
__version__ = "1.5.2"
|
|
@@ -16,7 +16,6 @@ MIME_TYPES = {
|
|
|
16
16
|
".js": "application/javascript; charset=utf-8",
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
REPO_FILE_MAX_SIZE = 5 * 1024 * 1024
|
|
20
19
|
STATIC_EXTENSIONS = frozenset({".css", ".js", ".html", ".ico", ".png", ".jpg", ".svg", ".woff", ".woff2"})
|
|
21
20
|
ASSET_EXTENSIONS = frozenset({".css", ".js", ".svg", ".ico", ".png", ".jpeg", ".jpg", ".json", ".woff", ".woff2"})
|
|
22
21
|
|
|
@@ -29,6 +29,12 @@
|
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/* The versions handle only exists while the panel does, otherwise it would
|
|
33
|
+
sit against the right edge with nothing to resize. */
|
|
34
|
+
#resizer-versions:has(+ #versions-panel.hidden) {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
/* --- Main content area --- */
|
|
33
39
|
#container {
|
|
34
40
|
display: flex;
|
|
@@ -621,6 +621,7 @@ app.listen(8080, () => console.log("Compiler API on http://localhost:8080/compil
|
|
|
621
621
|
</div>
|
|
622
622
|
<div class="resizer resizer-v" id="resizer-pdf" title="Resize editor / PDF"></div>
|
|
623
623
|
<iframe id="pdf"></iframe>
|
|
624
|
+
<div class="resizer resizer-v" id="resizer-versions" title="Resize versions panel"></div>
|
|
624
625
|
<aside id="versions-panel" class="hidden" aria-hidden="true" aria-label="Version history">
|
|
625
626
|
<div class="versions-header">
|
|
626
627
|
<span class="material-icons" aria-hidden="true">history</span>
|
|
@@ -18,7 +18,7 @@ export function toggleSidebar() {
|
|
|
18
18
|
// FA's fa-file-* set draws an actual document of that type, rather than a
|
|
19
19
|
|
|
20
20
|
// ----- Resizable panels -----
|
|
21
|
-
export const STORAGE_KEYS = { sidebar: "gitlatex-sidebar-width", pdf: "gitlatex-pdf-width", console: "gitlatex-console-height", consoleVisible: "gitlatex-console-visible" };
|
|
21
|
+
export const STORAGE_KEYS = { sidebar: "gitlatex-sidebar-width", pdf: "gitlatex-pdf-width", console: "gitlatex-console-height", consoleVisible: "gitlatex-console-visible", versions: "gitlatex-versions-width" };
|
|
22
22
|
|
|
23
23
|
export function px(n) {
|
|
24
24
|
return n + "px";
|
|
@@ -40,15 +40,18 @@ export function setupResizers() {
|
|
|
40
40
|
const sidebar = document.getElementById("sidebar");
|
|
41
41
|
const pdf = document.getElementById("pdf");
|
|
42
42
|
const consoleEl = document.getElementById("console");
|
|
43
|
+
const versions = document.getElementById("versions-panel");
|
|
43
44
|
if (!view || !sidebar || !pdf || !consoleEl) return;
|
|
44
45
|
|
|
45
46
|
function loadStored() {
|
|
46
47
|
const sw = localStorage.getItem(STORAGE_KEYS.sidebar);
|
|
47
48
|
const pw = localStorage.getItem(STORAGE_KEYS.pdf);
|
|
48
49
|
const ch = localStorage.getItem(STORAGE_KEYS.console);
|
|
50
|
+
const vw = localStorage.getItem(STORAGE_KEYS.versions);
|
|
49
51
|
if (sw) view.style.setProperty("--sidebar-width", sw);
|
|
50
52
|
if (pw) view.style.setProperty("--pdf-width", pw);
|
|
51
53
|
if (ch) view.style.setProperty("--console-height", ch);
|
|
54
|
+
if (vw) view.style.setProperty("--versions-width", vw);
|
|
52
55
|
}
|
|
53
56
|
loadStored();
|
|
54
57
|
|
|
@@ -108,6 +111,36 @@ export function setupResizers() {
|
|
|
108
111
|
document.addEventListener("mouseup", up);
|
|
109
112
|
}
|
|
110
113
|
|
|
114
|
+
// Drags from the panel's left edge, so moving left widens it - same
|
|
115
|
+
// direction as the PDF pane.
|
|
116
|
+
function onResizeVersions(e) {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
const startX = e.clientX;
|
|
119
|
+
const startW = versions.offsetWidth;
|
|
120
|
+
view.classList.add("resizing");
|
|
121
|
+
document.getElementById("resizer-versions").classList.add("active");
|
|
122
|
+
const overlay = createResizeOverlay();
|
|
123
|
+
overlay.style.cursor = "col-resize";
|
|
124
|
+
document.body.appendChild(overlay);
|
|
125
|
+
|
|
126
|
+
function move(e2) {
|
|
127
|
+
const delta = startX - e2.clientX;
|
|
128
|
+
let w = Math.round(startW + delta);
|
|
129
|
+
w = Math.max(220, Math.min(window.innerWidth - 400, w));
|
|
130
|
+
view.style.setProperty("--versions-width", px(w));
|
|
131
|
+
}
|
|
132
|
+
function up() {
|
|
133
|
+
view.classList.remove("resizing");
|
|
134
|
+
document.getElementById("resizer-versions").classList.remove("active");
|
|
135
|
+
overlay.remove();
|
|
136
|
+
localStorage.setItem(STORAGE_KEYS.versions, px(versions.offsetWidth));
|
|
137
|
+
document.removeEventListener("mousemove", move);
|
|
138
|
+
document.removeEventListener("mouseup", up);
|
|
139
|
+
}
|
|
140
|
+
document.addEventListener("mousemove", move);
|
|
141
|
+
document.addEventListener("mouseup", up);
|
|
142
|
+
}
|
|
143
|
+
|
|
111
144
|
function onResizeConsole(e) {
|
|
112
145
|
e.preventDefault();
|
|
113
146
|
const startY = e.clientY;
|
|
@@ -139,6 +172,9 @@ export function setupResizers() {
|
|
|
139
172
|
document.getElementById("resizer-sidebar").addEventListener("mousedown", onResizeSidebar);
|
|
140
173
|
document.getElementById("resizer-pdf").addEventListener("mousedown", onResizePdf);
|
|
141
174
|
document.getElementById("resizer-console").addEventListener("mousedown", onResizeConsole);
|
|
175
|
+
if (versions) {
|
|
176
|
+
document.getElementById("resizer-versions")?.addEventListener("mousedown", onResizeVersions);
|
|
177
|
+
}
|
|
142
178
|
|
|
143
179
|
const consoleToggle = document.getElementById("console-toggle");
|
|
144
180
|
if (consoleToggle) {
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import base64
|
|
4
4
|
import os
|
|
5
|
-
import re
|
|
6
5
|
import shutil
|
|
7
6
|
|
|
8
7
|
from flask import Blueprint, jsonify, request, send_file
|
|
9
8
|
|
|
10
9
|
from gitlatex import state
|
|
11
|
-
from gitlatex.http import MIME_TYPES,
|
|
10
|
+
from gitlatex.http import MIME_TYPES, _json
|
|
12
11
|
from gitlatex.services.paths import flatten_file_tree, read_dir_recursive, resolve_repo_path
|
|
13
12
|
|
|
14
13
|
bp = Blueprint("files", __name__)
|
|
@@ -44,21 +43,26 @@ def repo_files_content():
|
|
|
44
43
|
for rel in paths:
|
|
45
44
|
full_path = os.path.join(state.current_repo_path, rel)
|
|
46
45
|
try:
|
|
47
|
-
|
|
48
|
-
if not os.path.isfile(full_path) or stat.st_size > REPO_FILE_MAX_SIZE:
|
|
46
|
+
if not os.path.isfile(full_path):
|
|
49
47
|
continue
|
|
50
|
-
ext = os.path.splitext(full_path)[1].lower()
|
|
51
|
-
is_binary = ext in MIME_TYPES or re.search(r"\.(pdf|zip|exe|dll)$", rel, re.I)
|
|
52
48
|
rel_slash = rel.replace("\\", "/")
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
with open(full_path, "rb") as f:
|
|
50
|
+
raw = f.read()
|
|
51
|
+
# Sniff the bytes rather than trusting the extension: anything that
|
|
52
|
+
# is not valid UTF-8 (binary .eps, fonts, archives) must travel as
|
|
53
|
+
# base64, or lossy decoding silently corrupts it in transit.
|
|
54
|
+
if b"\0" in raw:
|
|
55
|
+
text = None
|
|
57
56
|
else:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
try:
|
|
58
|
+
text = raw.decode("utf-8")
|
|
59
|
+
except UnicodeDecodeError:
|
|
60
|
+
text = None
|
|
61
|
+
if text is None:
|
|
62
|
+
files.append({"path": rel_slash, "base64": base64.b64encode(raw).decode("ascii")})
|
|
63
|
+
else:
|
|
64
|
+
files.append({"path": rel_slash, "content": text})
|
|
65
|
+
except OSError:
|
|
62
66
|
pass
|
|
63
67
|
return jsonify(files=files)
|
|
64
68
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|