update sample code with some of our own
This commit is contained in:
parent
0a5ba0d7d9
commit
fe4980d367
41
index.html
41
index.html
|
@ -308,33 +308,26 @@
|
||||||
<textarea id="code" name="code">
|
<textarea id="code" name="code">
|
||||||
// Type some code ->
|
// Type some code ->
|
||||||
|
|
||||||
console.log "oO08 iIlL1 g9qCGQ ~-+=>";
|
const similar = "oO08 iIlL1 g9qCGQ"
|
||||||
// â é ù ï ø ç à Ē Æ œ
|
const diacritics_etc = "â é ù ï ø ç à Ē Æ œ"
|
||||||
|
|
||||||
function updateGutters(cm) {
|
window.toggleFavorite = (alias) => {
|
||||||
var gutters = cm.display.gutters,
|
try {
|
||||||
__specs = cm.options.gutters;
|
let favorites = JSON.parse(localStorage.getItem('favorites')) || []
|
||||||
|
if (favorites.indexOf(alias) > -1) {
|
||||||
removeChildren(gutters);
|
favorites = favorites.filter((v) => {
|
||||||
|
return v !== alias
|
||||||
for (var i = 0; i < specs.length; ++i) {
|
})
|
||||||
var gutterClass = __specs[i];
|
} else {
|
||||||
var gElt = gutters.appendChild(
|
favorites.push(alias)
|
||||||
elt(
|
|
||||||
"div",
|
|
||||||
null,
|
|
||||||
"CodeMirror-gutter " + gutterClass
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (gutterClass == "CodeMirror-linenumbers") {
|
|
||||||
cm.display.lineGutter = gElt;
|
|
||||||
gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
|
|
||||||
}
|
}
|
||||||
|
localStorage.setItem('favorites', JSON.stringify(Array.from(new Set(favorites))))
|
||||||
|
} catch (err) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.error('could not save favorite', err)
|
||||||
}
|
}
|
||||||
gutters.style.display = i ? "" : "none";
|
renderSelectList()
|
||||||
updateGutterSpace(cm);
|
return false
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue