-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from martialblog/feature/update-editor
Update CodeMirror and some CSS fixes
- Loading branch information
Showing
25 changed files
with
10,609 additions
and
9,459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,16 @@ msgstr "" | |
"Project-Id-Version: Toplevelview Module (0.0.0)\n" | ||
"Report-Msgid-Bugs-To: [email protected]\n" | ||
"POT-Creation-Date: 2017-10-13 11:53+0000\n" | ||
"PO-Revision-Date: 2017-10-13 14:00+0200\n" | ||
"PO-Revision-Date: 2024-04-24 12:51+0200\n" | ||
"Last-Translator: Markus Opolka <[email protected]>\n" | ||
"Language-Team: \n" | ||
"Language: de_DE\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Poedit-Basepath: .\n" | ||
"Last-Translator: Markus Frosch <[email protected]>\n" | ||
"Language-Team: \n" | ||
"X-Generator: Poedit 1.8.11\n" | ||
"X-Generator: Poedit 3.0.1\n" | ||
"X-Poedit-SearchPath-0: .\n" | ||
|
||
#: ../../../../modules/toplevelview/application/views/helpers/Tree.php:58 | ||
|
@@ -161,3 +161,7 @@ msgstr "Nicht-Gespeicherte Änderungen!" | |
#: ../../../../modules/toplevelview/application/forms/EditForm.php:120 | ||
msgid "YAML Config" | ||
msgstr "YAML Konfiguration" | ||
|
||
#: ../../../../modules/toplevelview/application/forms/EditForm.php:173 | ||
msgid "Confirm deletion" | ||
msgstr "Löschen bestätigen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.CodeMirror-foldmarker { | ||
color: blue; | ||
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; | ||
font-family: arial; | ||
line-height: .3; | ||
cursor: pointer; | ||
} | ||
.CodeMirror-foldgutter { | ||
width: .7em; | ||
} | ||
.CodeMirror-foldgutter-open, | ||
.CodeMirror-foldgutter-folded { | ||
cursor: pointer; | ||
} | ||
.CodeMirror-foldgutter-open:after { | ||
content: "\25BE"; | ||
} | ||
.CodeMirror-foldgutter-folded:after { | ||
content: "\25B8"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.30.0 | ||
5.65.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
// Distributed under an MIT license: https://codemirror.net/5/LICENSE | ||
|
||
(function(mod) { | ||
if (typeof exports == "object" && typeof module == "object") // CommonJS | ||
mod(require("../../lib/codemirror")); | ||
else if (typeof define == "function" && define.amd) // AMD | ||
define(["../../lib/codemirror"], mod); | ||
else // Plain browser env | ||
mod(CodeMirror); | ||
})(function(CodeMirror) { | ||
"use strict"; | ||
|
||
function bracketFolding(pairs) { | ||
return function(cm, start) { | ||
var line = start.line, lineText = cm.getLine(line); | ||
|
||
function findOpening(pair) { | ||
var tokenType; | ||
for (var at = start.ch, pass = 0;;) { | ||
var found = at <= 0 ? -1 : lineText.lastIndexOf(pair[0], at - 1); | ||
if (found == -1) { | ||
if (pass == 1) break; | ||
pass = 1; | ||
at = lineText.length; | ||
continue; | ||
} | ||
if (pass == 1 && found < start.ch) break; | ||
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); | ||
if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType, pair: pair}; | ||
at = found - 1; | ||
} | ||
} | ||
|
||
function findRange(found) { | ||
var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh | ||
outer: for (var i = line; i <= lastLine; ++i) { | ||
var text = cm.getLine(i), pos = i == line ? startCh : 0; | ||
for (;;) { | ||
var nextOpen = text.indexOf(found.pair[0], pos), nextClose = text.indexOf(found.pair[1], pos); | ||
if (nextOpen < 0) nextOpen = text.length; | ||
if (nextClose < 0) nextClose = text.length; | ||
pos = Math.min(nextOpen, nextClose); | ||
if (pos == text.length) break; | ||
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) { | ||
if (pos == nextOpen) ++count; | ||
else if (!--count) { end = i; endCh = pos; break outer; } | ||
} | ||
++pos; | ||
} | ||
} | ||
|
||
if (end == null || line == end) return null | ||
return {from: CodeMirror.Pos(line, startCh), | ||
to: CodeMirror.Pos(end, endCh)}; | ||
} | ||
|
||
var found = [] | ||
for (var i = 0; i < pairs.length; i++) { | ||
var open = findOpening(pairs[i]) | ||
if (open) found.push(open) | ||
} | ||
found.sort(function(a, b) { return a.ch - b.ch }) | ||
for (var i = 0; i < found.length; i++) { | ||
var range = findRange(found[i]) | ||
if (range) return range | ||
} | ||
return null | ||
} | ||
} | ||
|
||
CodeMirror.registerHelper("fold", "brace", bracketFolding([["{", "}"], ["[", "]"]])); | ||
|
||
CodeMirror.registerHelper("fold", "brace-paren", bracketFolding([["{", "}"], ["[", "]"], ["(", ")"]])); | ||
|
||
CodeMirror.registerHelper("fold", "import", function(cm, start) { | ||
function hasImport(line) { | ||
if (line < cm.firstLine() || line > cm.lastLine()) return null; | ||
var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); | ||
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); | ||
if (start.type != "keyword" || start.string != "import") return null; | ||
// Now find closing semicolon, return its position | ||
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { | ||
var text = cm.getLine(i), semi = text.indexOf(";"); | ||
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; | ||
} | ||
} | ||
|
||
var startLine = start.line, has = hasImport(startLine), prev; | ||
if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1)) | ||
return null; | ||
for (var end = has.end;;) { | ||
var next = hasImport(end.line + 1); | ||
if (next == null) break; | ||
end = next.end; | ||
} | ||
return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end}; | ||
}); | ||
|
||
CodeMirror.registerHelper("fold", "include", function(cm, start) { | ||
function hasInclude(line) { | ||
if (line < cm.firstLine() || line > cm.lastLine()) return null; | ||
var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); | ||
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); | ||
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; | ||
} | ||
|
||
var startLine = start.line, has = hasInclude(startLine); | ||
if (has == null || hasInclude(startLine - 1) != null) return null; | ||
for (var end = startLine;;) { | ||
var next = hasInclude(end + 1); | ||
if (next == null) break; | ||
++end; | ||
} | ||
return {from: CodeMirror.Pos(startLine, has + 1), | ||
to: cm.clipPos(CodeMirror.Pos(end))}; | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// CodeMirror, copyright (c) by Marijn Haverbeke and others | ||
// Distributed under an MIT license: https://codemirror.net/5/LICENSE | ||
|
||
(function(mod) { | ||
if (typeof exports == "object" && typeof module == "object") // CommonJS | ||
mod(require("../../lib/codemirror")); | ||
else if (typeof define == "function" && define.amd) // AMD | ||
define(["../../lib/codemirror"], mod); | ||
else // Plain browser env | ||
mod(CodeMirror); | ||
})(function(CodeMirror) { | ||
"use strict"; | ||
|
||
CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { | ||
return mode.blockCommentStart && mode.blockCommentEnd; | ||
}, function(cm, start) { | ||
var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; | ||
if (!startToken || !endToken) return; | ||
var line = start.line, lineText = cm.getLine(line); | ||
|
||
var startCh; | ||
for (var at = start.ch, pass = 0;;) { | ||
var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); | ||
if (found == -1) { | ||
if (pass == 1) return; | ||
pass = 1; | ||
at = lineText.length; | ||
continue; | ||
} | ||
if (pass == 1 && found < start.ch) return; | ||
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) && | ||
(found == 0 || lineText.slice(found - endToken.length, found) == endToken || | ||
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) { | ||
startCh = found + startToken.length; | ||
break; | ||
} | ||
at = found - 1; | ||
} | ||
|
||
var depth = 1, lastLine = cm.lastLine(), end, endCh; | ||
outer: for (var i = line; i <= lastLine; ++i) { | ||
var text = cm.getLine(i), pos = i == line ? startCh : 0; | ||
for (;;) { | ||
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); | ||
if (nextOpen < 0) nextOpen = text.length; | ||
if (nextClose < 0) nextClose = text.length; | ||
pos = Math.min(nextOpen, nextClose); | ||
if (pos == text.length) break; | ||
if (pos == nextOpen) ++depth; | ||
else if (!--depth) { end = i; endCh = pos; break outer; } | ||
++pos; | ||
} | ||
} | ||
if (end == null || line == end && endCh == startCh) return; | ||
return {from: CodeMirror.Pos(line, startCh), | ||
to: CodeMirror.Pos(end, endCh)}; | ||
}); | ||
|
||
}); |
Oops, something went wrong.