Cian Butler
3 years ago
committed by
GitHub
14 changed files with 780 additions and 659 deletions
@ -1,126 +1,162 @@ |
|||||
function optionGenericGet() { return this.el.querySelector("input").value; } |
function optionGenericGet() { |
||||
function optionGenericSet(value) { this.el.querySelector("input").value = value; } |
return this.el.querySelector('input').value; |
||||
function optionEnumGet() { return this.el.querySelector("select").value; } |
} |
||||
function optionEnumSet(value) { this.el.querySelector("select").value = value; } |
function optionGenericSet(value) { |
||||
function optionBoolGet() { return this.el.querySelector("input").checked; } |
this.el.querySelector('input').value = value; |
||||
function optionBoolSet(value) { this.el.querySelector("input").checked = value; } |
} |
||||
|
function optionEnumGet() { |
||||
|
return this.el.querySelector('select').value; |
||||
|
} |
||||
|
function optionEnumSet(value) { |
||||
|
this.el.querySelector('select').value = value; |
||||
|
} |
||||
|
function optionBoolGet() { |
||||
|
return this.el.querySelector('input').checked; |
||||
|
} |
||||
|
function optionBoolSet(value) { |
||||
|
this.el.querySelector('input').checked = value; |
||||
|
} |
||||
function optionNumberGet() { |
function optionNumberGet() { |
||||
let value = (this.float === true ? parseFloat : parseInt)(this.el.querySelector("input").value); |
let value = (this.float === true ? parseFloat : parseInt)( |
||||
if (Number.isNaN(value) || typeof value !== "number") value = 0; |
this.el.querySelector('input').value, |
||||
if (typeof this.min === "number") value = Math.max(value, this.min); |
); |
||||
if (typeof this.max === "number") value = Math.min(value, this.max); |
if (Number.isNaN(value) || typeof value !== 'number') value = 0; |
||||
return value; |
if (typeof this.min === 'number') value = Math.max(value, this.min); |
||||
|
if (typeof this.max === 'number') value = Math.min(value, this.max); |
||||
|
return value; |
||||
|
} |
||||
|
function optionNumberSet(value) { |
||||
|
this.el.querySelector('input').value = value; |
||||
} |
} |
||||
function optionNumberSet(value) { this.el.querySelector("input").value = value; } |
|
||||
|
|
||||
const allOptions = []; |
const allOptions = []; |
||||
function inflateOptions(optionsSchema) { |
function inflateOptions(optionsSchema) { |
||||
const booleanOption = document.querySelector("#boolean_option.templ"); |
const booleanOption = document.querySelector('#boolean_option.templ'); |
||||
const enumOption = document.querySelector("#enum_option.templ"); |
const enumOption = document.querySelector('#enum_option.templ'); |
||||
const textOption = document.querySelector("#text_option.templ"); |
const textOption = document.querySelector('#text_option.templ'); |
||||
const numberOption = document.querySelector("#number_option.templ"); |
const numberOption = document.querySelector('#number_option.templ'); |
||||
const colorOption = document.querySelector("#color_option.templ"); |
const colorOption = document.querySelector('#color_option.templ'); |
||||
|
|
||||
function copyOver(element) { |
function copyOver(element) { |
||||
while (element.children.length > 0) document.body.append(element.children[0]); |
while (element.children.length > 0) |
||||
} |
document.body.append(element.children[0]); |
||||
|
} |
||||
|
|
||||
optionsSchema.forEach(option => { |
optionsSchema.forEach(option => { |
||||
let el; |
let el; |
||||
option.get = optionGenericGet.bind(option); |
option.get = optionGenericGet.bind(option); |
||||
option.set = optionGenericSet.bind(option); |
option.set = optionGenericSet.bind(option); |
||||
|
|
||||
switch (option.type) { |
switch (option.type) { |
||||
case "boolean": |
case 'boolean': |
||||
el = booleanOption.cloneNode(true); |
el = booleanOption.cloneNode(true); |
||||
option.get = optionBoolGet.bind(option); |
option.get = optionBoolGet.bind(option); |
||||
option.set = optionBoolSet.bind(option); |
option.set = optionBoolSet.bind(option); |
||||
break; |
break; |
||||
|
|
||||
case "enum": |
case 'enum': |
||||
el = enumOption.cloneNode(true); |
el = enumOption.cloneNode(true); |
||||
option.enum.forEach(varriant => { |
option.enum.forEach(varriant => { |
||||
const optionEl = document.createElement("option"); |
const optionEl = document.createElement('option'); |
||||
optionEl.innerText = varriant; |
optionEl.innerText = varriant; |
||||
optionEl.value = varriant; |
optionEl.value = varriant; |
||||
el.querySelector("select").appendChild(optionEl); |
el.querySelector('select').appendChild(optionEl); |
||||
}); |
}); |
||||
option.get = optionEnumGet.bind(option); |
option.get = optionEnumGet.bind(option); |
||||
option.set = optionEnumSet.bind(option); |
option.set = optionEnumSet.bind(option); |
||||
break; |
break; |
||||
|
|
||||
case "text": |
case 'text': |
||||
el = textOption.cloneNode(true); |
el = textOption.cloneNode(true); |
||||
break; |
break; |
||||
|
|
||||
case "number": |
case 'number': |
||||
el = numberOption.cloneNode(true); |
el = numberOption.cloneNode(true); |
||||
if (option.float === true) el.querySelector("input").setAttribute("step", "0.001"); |
if (option.float === true) |
||||
option.get = optionNumberGet.bind(option); |
el.querySelector('input').setAttribute('step', '0.001'); |
||||
option.set = optionNumberSet.bind(option); |
option.get = optionNumberGet.bind(option); |
||||
if (typeof option.min === "number") el.querySelector("input").setAttribute("min", option.min.toString()); |
option.set = optionNumberSet.bind(option); |
||||
if (typeof option.max === "number") el.querySelector("input").setAttribute("max", option.max.toString()); |
if (typeof option.min === 'number') |
||||
break; |
el.querySelector('input').setAttribute('min', option.min.toString()); |
||||
|
if (typeof option.max === 'number') |
||||
|
el.querySelector('input').setAttribute('max', option.max.toString()); |
||||
|
break; |
||||
|
|
||||
case "color": |
case 'color': |
||||
el = colorOption.cloneNode(true); |
el = colorOption.cloneNode(true); |
||||
break; |
break; |
||||
|
|
||||
default: |
default: |
||||
throw new Error(`Unknown option type ${ option.type}`); |
throw new Error(`Unknown option type ${option.type}`); |
||||
} |
} |
||||
|
|
||||
el.querySelector(".title").innerText = option.name; |
el.querySelector('.title').innerText = option.name; |
||||
el.querySelector(".desc").innerText = option.description; |
el.querySelector('.desc').innerText = option.description; |
||||
[ option.el ] = el.children; |
[option.el] = el.children; |
||||
copyOver(el); |
copyOver(el); |
||||
allOptions.push(option); |
allOptions.push(option); |
||||
}); |
}); |
||||
} |
} |
||||
|
|
||||
function getItem(json, path) { |
function getItem(json, path) { |
||||
const mypath = path[0]; |
const mypath = path[0]; |
||||
if (path.length === 1) return json[mypath]; |
if (path.length === 1) return json[mypath]; |
||||
if (json[mypath] != null) return getItem(json[mypath], path.slice(1)); |
if (json[mypath] != null) return getItem(json[mypath], path.slice(1)); |
||||
return null; |
return null; |
||||
} |
} |
||||
function setItem(json, path, item) { |
function setItem(json, path, item) { |
||||
const mypath = path[0]; |
const mypath = path[0]; |
||||
if (path.length === 1) json[mypath] = item; |
if (path.length === 1) json[mypath] = item; |
||||
else { |
else { |
||||
if (json[mypath] == null) json[mypath] = {}; |
if (json[mypath] == null) json[mypath] = {}; |
||||
setItem(json[mypath], path.slice(1), item); |
setItem(json[mypath], path.slice(1), item); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
window.loadOptions = function(config) { |
window.loadOptions = function (config) { |
||||
allOptions.forEach(option => { |
allOptions.forEach(option => { |
||||
let value = getItem(config, option.path); |
let value = getItem(config, option.path); |
||||
if (option.nullable === true && option.type === "text" && value == null) value = null; |
if (option.nullable === true && option.type === 'text' && value == null) |
||||
else if (option.nullable === true && option.type === "number" && value == null) value = -1; |
value = null; |
||||
else if (value == null) return; |
else if ( |
||||
if (option.json === true && option.type === "text") value = JSON.stringify(value); |
option.nullable === true && |
||||
option.set(value); |
option.type === 'number' && |
||||
option.el.classList.remove("unbounded"); |
value == null |
||||
}); |
) |
||||
} |
value = -1; |
||||
|
else if (value == null) return; |
||||
|
if (option.json === true && option.type === 'text') |
||||
|
value = JSON.stringify(value); |
||||
|
option.set(value); |
||||
|
option.el.classList.remove('unbounded'); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
if (window.top === window) alert("Error: Page is top level. This page is supposed to be accessed from inside Wetty."); |
if (window.top === window) |
||||
|
alert( |
||||
|
'Error: Page is top level. This page is supposed to be accessed from inside Wetty.', |
||||
|
); |
||||
|
|
||||
function saveConfig() { |
function saveConfig() { |
||||
const newConfig = {}; |
const newConfig = {}; |
||||
allOptions.forEach(option => { |
allOptions.forEach(option => { |
||||
let newValue = option.get(); |
let newValue = option.get(); |
||||
if (option.nullable === true && ((option.type === "text" && newValue === "") || ( option.type === "number" && newValue < 0))) return; |
if ( |
||||
if (option.json === true && option.type === "text") newValue = JSON.parse(newValue); |
option.nullable === true && |
||||
setItem(newConfig, option.path, newValue); |
((option.type === 'text' && newValue === '') || |
||||
}); |
(option.type === 'number' && newValue < 0)) |
||||
window.wetty_save_config(newConfig); |
) |
||||
}; |
return; |
||||
|
if (option.json === true && option.type === 'text') |
||||
|
newValue = JSON.parse(newValue); |
||||
|
setItem(newConfig, option.path, newValue); |
||||
|
}); |
||||
|
window.wetty_save_config(newConfig); |
||||
|
} |
||||
|
|
||||
window.addEventListener("input", () => { |
window.addEventListener('input', () => { |
||||
const els = document.querySelectorAll("input, select"); |
const els = document.querySelectorAll('input, select'); |
||||
for (let i = 0; i < els.length; i += 1) { |
for (let i = 0; i < els.length; i += 1) { |
||||
els[i].addEventListener("input", saveConfig); |
els[i].addEventListener('input', saveConfig); |
||||
} |
} |
||||
}); |
}); |
||||
|
@ -1,71 +1,71 @@ |
|||||
<!DOCTYPE HTML> |
<!DOCTYPE html> |
||||
<html> |
<html> |
||||
<head> |
<head> |
||||
<title>Wetty XTerm Configuration</title> |
<title>Wetty XTerm Configuration</title> |
||||
<link rel="stylesheet" href="./style.css" /> |
<link rel="stylesheet" href="./style.css" /> |
||||
</head> |
</head> |
||||
<body> |
<body> |
||||
<header> |
<header> |
||||
<h1>Configure</h1> |
<h1>Configure</h1> |
||||
</header> |
</header> |
||||
|
|
||||
<div class="templ" id="boolean_option"> |
|
||||
<div class="boolean_option unbounded"> |
|
||||
<p> |
|
||||
<b class="title"></b><br> |
|
||||
<span class="desc"></span> |
|
||||
</p> |
|
||||
<input type="checkbox" /> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="templ" id="enum_option"> |
|
||||
<div class="enum_option unbounded"> |
|
||||
<p> |
|
||||
<b class="title"></b><br> |
|
||||
<span class="desc"></span> |
|
||||
</p> |
|
||||
<select></select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="templ" id="text_option"> |
|
||||
<div class="text_option unbounded"> |
|
||||
<p> |
|
||||
<b class="title"></b><br> |
|
||||
<span class="desc"></span> |
|
||||
</p> |
|
||||
<input type="text" /> |
|
||||
</div> |
|
||||
<div class="error_reporting"></div> |
|
||||
</div> |
|
||||
<div class="templ" id="number_option"> |
|
||||
<div class="number_option unbounded"> |
|
||||
<p> |
|
||||
<b class="title"></b><br> |
|
||||
<span class="desc"></span> |
|
||||
</p> |
|
||||
<input type="number" size="10" /> |
|
||||
</div> |
|
||||
<div class="error_reporting"></div> |
|
||||
</div> |
|
||||
<div class="templ" id="color_option"> |
|
||||
<div class="color_option unbounded"> |
|
||||
<p> |
|
||||
<b class="title"></b><br> |
|
||||
<span class="desc"></span> |
|
||||
</p> |
|
||||
<input type="color" /> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<script src="./functionality.js"></script> |
<div class="templ" id="boolean_option"> |
||||
|
<div class="boolean_option unbounded"> |
||||
|
<p> |
||||
|
<b class="title"></b><br /> |
||||
|
<span class="desc"></span> |
||||
|
</p> |
||||
|
<input type="checkbox" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="templ" id="enum_option"> |
||||
|
<div class="enum_option unbounded"> |
||||
|
<p> |
||||
|
<b class="title"></b><br /> |
||||
|
<span class="desc"></span> |
||||
|
</p> |
||||
|
<select></select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="templ" id="text_option"> |
||||
|
<div class="text_option unbounded"> |
||||
|
<p> |
||||
|
<b class="title"></b><br /> |
||||
|
<span class="desc"></span> |
||||
|
</p> |
||||
|
<input type="text" /> |
||||
|
</div> |
||||
|
<div class="error_reporting"></div> |
||||
|
</div> |
||||
|
<div class="templ" id="number_option"> |
||||
|
<div class="number_option unbounded"> |
||||
|
<p> |
||||
|
<b class="title"></b><br /> |
||||
|
<span class="desc"></span> |
||||
|
</p> |
||||
|
<input type="number" size="10" /> |
||||
|
</div> |
||||
|
<div class="error_reporting"></div> |
||||
|
</div> |
||||
|
<div class="templ" id="color_option"> |
||||
|
<div class="color_option unbounded"> |
||||
|
<p> |
||||
|
<b class="title"></b><br /> |
||||
|
<span class="desc"></span> |
||||
|
</p> |
||||
|
<input type="color" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
<h2>General Options</h2> |
<script src="./functionality.js"></script> |
||||
<script src="./xterm_general_options.js"></script> |
|
||||
<h2>Color Theme</h2> |
|
||||
<script src="./xterm_color_theme.js"></script> |
|
||||
<h2>Advanced XTerm Options</h2> |
|
||||
<script src="./xterm_advanced_options.js"></script> |
|
||||
|
|
||||
<script src="./xterm_defaults.js"></script> |
<h2>General Options</h2> |
||||
</body> |
<script src="./xterm_general_options.js"></script> |
||||
|
<h2>Color Theme</h2> |
||||
|
<script src="./xterm_color_theme.js"></script> |
||||
|
<h2>Advanced XTerm Options</h2> |
||||
|
<script src="./xterm_advanced_options.js"></script> |
||||
|
|
||||
|
<script src="./xterm_defaults.js"></script> |
||||
|
</body> |
||||
</html> |
</html> |
||||
|
@ -1,59 +1,78 @@ |
|||||
html { background-color: black; } |
html { |
||||
html, body { overflow: hidden auto; } |
background-color: black; |
||||
|
} |
||||
|
html, |
||||
|
body { |
||||
|
overflow: hidden auto; |
||||
|
} |
||||
body { |
body { |
||||
display: flex; |
display: flex; |
||||
flex-flow: column nowrap; |
flex-flow: column nowrap; |
||||
font-family: monospace; |
font-family: monospace; |
||||
font-size: 1rem; |
font-size: 1rem; |
||||
color: white; |
color: white; |
||||
} |
} |
||||
.templ { display: none; } |
.templ { |
||||
h2 { text-align: center; text-decoration: underline; } |
display: none; |
||||
|
} |
||||
|
h2 { |
||||
|
text-align: center; |
||||
|
text-decoration: underline; |
||||
|
} |
||||
|
|
||||
header { |
header { |
||||
display: flex; |
display: flex; |
||||
flex-flow: row nowrap; |
flex-flow: row nowrap; |
||||
align-items: center; |
align-items: center; |
||||
} |
} |
||||
header button { |
header button { |
||||
padding: 0.5em; |
padding: 0.5em; |
||||
font-size: 1em; |
font-size: 1em; |
||||
margin: 0.5em; |
margin: 0.5em; |
||||
border-radius: 0.5em; |
border-radius: 0.5em; |
||||
collapse-margin; |
|
||||
} |
} |
||||
|
|
||||
.boolean_option, .number_option, .color_option, .enum_option, .text_option { |
.boolean_option, |
||||
display: grid; |
.number_option, |
||||
grid-template-columns: 100fr min(30em, 50%); |
.color_option, |
||||
grid-template-rows: auto; |
.enum_option, |
||||
align-items: center; |
.text_option { |
||||
} |
display: grid; |
||||
.boolean_option input, .number_option input, .color_option input, .text_option input, .enum_option select { |
grid-template-columns: 100fr min(30em, 50%); |
||||
margin: 0 0.5em; |
grid-template-rows: auto; |
||||
font-size: 1em; |
align-items: center; |
||||
background-color: hsl(0,0%,20%); |
} |
||||
color: white; |
.boolean_option input, |
||||
border: 2px solid white; |
.number_option input, |
||||
|
.color_option input, |
||||
|
.text_option input, |
||||
|
.enum_option select { |
||||
|
margin: 0 0.5em; |
||||
|
font-size: 1em; |
||||
|
background-color: hsl(0, 0%, 20%); |
||||
|
color: white; |
||||
|
border: 2px solid white; |
||||
} |
} |
||||
|
|
||||
.number_option input, .text_option input, .enum_option select { |
.number_option input, |
||||
padding: 0.4em; |
.text_option input, |
||||
|
.enum_option select { |
||||
|
padding: 0.4em; |
||||
} |
} |
||||
.boolean_option input { |
.boolean_option input { |
||||
width: 2em; |
width: 2em; |
||||
height: 2em; |
height: 2em; |
||||
font-size: 0.75em; |
font-size: 0.75em; |
||||
justify-self: center; |
justify-self: center; |
||||
} |
} |
||||
.color_option input { |
.color_option input { |
||||
width: 100%; |
width: 100%; |
||||
height: 100%; |
height: 100%; |
||||
background-color: lightgray; |
background-color: lightgray; |
||||
} |
} |
||||
|
|
||||
.unbounded .title::before { |
.unbounded .title::before { |
||||
content: "UNBOUND OPTION "; |
content: 'UNBOUND OPTION '; |
||||
color: red; |
color: red; |
||||
font-weight: bold; |
font-weight: bold; |
||||
} |
} |
||||
|
@ -1,69 +1,70 @@ |
|||||
const DEFAULT_BELL_SOUND = 'data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq'; |
const DEFAULT_BELL_SOUND = |
||||
|
'data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq'; |
||||
window.loadOptions({ |
window.loadOptions({ |
||||
wettyFitTerminal: true, |
wettyFitTerminal: true, |
||||
wettyVoid: 0, |
wettyVoid: 0, |
||||
|
|
||||
xterm: { |
xterm: { |
||||
cols: 80, |
cols: 80, |
||||
rows: 24, |
rows: 24, |
||||
cursorBlink: false, |
cursorBlink: false, |
||||
cursorStyle: 'block', |
cursorStyle: 'block', |
||||
cursorWidth: 1, |
cursorWidth: 1, |
||||
bellSound: DEFAULT_BELL_SOUND, |
bellSound: DEFAULT_BELL_SOUND, |
||||
bellStyle: 'none', |
bellStyle: 'none', |
||||
drawBoldTextInBrightColors: true, |
drawBoldTextInBrightColors: true, |
||||
fastScrollModifier: 'alt', |
fastScrollModifier: 'alt', |
||||
fastScrollSensitivity: 5, |
fastScrollSensitivity: 5, |
||||
fontFamily: 'courier-new, courier, monospace', |
fontFamily: 'courier-new, courier, monospace', |
||||
fontSize: 15, |
fontSize: 15, |
||||
fontWeight: 'normal', |
fontWeight: 'normal', |
||||
fontWeightBold: 'bold', |
fontWeightBold: 'bold', |
||||
lineHeight: 1.0, |
lineHeight: 1.0, |
||||
linkTooltipHoverDuration: 500, |
linkTooltipHoverDuration: 500, |
||||
letterSpacing: 0, |
letterSpacing: 0, |
||||
logLevel: 'info', |
logLevel: 'info', |
||||
scrollback: 1000, |
scrollback: 1000, |
||||
scrollSensitivity: 1, |
scrollSensitivity: 1, |
||||
screenReaderMode: false, |
screenReaderMode: false, |
||||
macOptionIsMeta: false, |
macOptionIsMeta: false, |
||||
macOptionClickForcesSelection: false, |
macOptionClickForcesSelection: false, |
||||
minimumContrastRatio: 1, |
minimumContrastRatio: 1, |
||||
disableStdin: false, |
disableStdin: false, |
||||
allowProposedApi: true, |
allowProposedApi: true, |
||||
allowTransparency: false, |
allowTransparency: false, |
||||
tabStopWidth: 8, |
tabStopWidth: 8, |
||||
rightClickSelectsWord: false, |
rightClickSelectsWord: false, |
||||
rendererType: 'canvas', |
rendererType: 'canvas', |
||||
windowOptions: {}, |
windowOptions: {}, |
||||
windowsMode: false, |
windowsMode: false, |
||||
wordSeparator: ' ()[]{}\',"`', |
wordSeparator: ' ()[]{}\',"`', |
||||
convertEol: false, |
convertEol: false, |
||||
termName: 'xterm', |
termName: 'xterm', |
||||
cancelEvents: false, |
cancelEvents: false, |
||||
|
|
||||
theme: { |
theme: { |
||||
foreground: "#ffffff", |
foreground: '#ffffff', |
||||
background: "#000000", |
background: '#000000', |
||||
cursor: "#ffffff", |
cursor: '#ffffff', |
||||
cursorAccent: "#000000", |
cursorAccent: '#000000', |
||||
selection: "#FFFFFF4D", |
selection: '#FFFFFF4D', |
||||
|
|
||||
black: "#2e3436", |
black: '#2e3436', |
||||
red: "#cc0000", |
red: '#cc0000', |
||||
green: "#4e9a06", |
green: '#4e9a06', |
||||
yellow: "#c4a000", |
yellow: '#c4a000', |
||||
blue: "#3465a4", |
blue: '#3465a4', |
||||
magenta: "#75507b", |
magenta: '#75507b', |
||||
cyan: "#06989a", |
cyan: '#06989a', |
||||
white: "#d3d7cf", |
white: '#d3d7cf', |
||||
brightBlack: "#555753", |
brightBlack: '#555753', |
||||
brightRed: "#ef2929", |
brightRed: '#ef2929', |
||||
brightGreen: "#8ae234", |
brightGreen: '#8ae234', |
||||
brightYellow: "#fce94f", |
brightYellow: '#fce94f', |
||||
brightBlue: "#729fcf", |
brightBlue: '#729fcf', |
||||
brightMagenta: "#ad7fa8", |
brightMagenta: '#ad7fa8', |
||||
brightCyan: "#34e2e2", |
brightCyan: '#34e2e2', |
||||
brightWhite: "#eeeeec" |
brightWhite: '#eeeeec', |
||||
} |
}, |
||||
} |
}, |
||||
}); |
}); |
||||
|
@ -1,107 +1,136 @@ |
|||||
window.inflateOptions([ |
window.inflateOptions([ |
||||
{ |
{ |
||||
type: "text", |
type: 'text', |
||||
name: "Font Family", |
name: 'Font Family', |
||||
description: "The font family for terminal text.", |
description: 'The font family for terminal text.', |
||||
path: ["xterm", "fontFamily"], |
path: ['xterm', 'fontFamily'], |
||||
}, |
}, |
||||
{ |
{ |
||||
type: "number", |
type: 'number', |
||||
name: "Font Size", |
name: 'Font Size', |
||||
description: "The font size in CSS pixels for terminal text.", |
description: 'The font size in CSS pixels for terminal text.', |
||||
path: ["xterm", "fontSize"], |
path: ['xterm', 'fontSize'], |
||||
min: 4, |
min: 4, |
||||
}, |
}, |
||||
{ |
{ |
||||
type: "enum", |
type: 'enum', |
||||
name: "Regular Font Weight", |
name: 'Regular Font Weight', |
||||
description: "The font weight for non-bold text.", |
description: 'The font weight for non-bold text.', |
||||
path: ["xterm", "fontWeight"], |
path: ['xterm', 'fontWeight'], |
||||
enum: ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"], |
enum: [ |
||||
}, |
'normal', |
||||
{ |
'bold', |
||||
type: "enum", |
'100', |
||||
name: "Bold Font Weight", |
'200', |
||||
description: "The font weight for bold text.", |
'300', |
||||
path: ["xterm", "fontWeightBold"], |
'400', |
||||
enum: ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"], |
'500', |
||||
}, |
'600', |
||||
{ |
'700', |
||||
type: "boolean", |
'800', |
||||
name: "Fit Terminal", |
'900', |
||||
description: "Automatically fits the terminal to the page, overriding terminal columns and rows.", |
], |
||||
path: ["wettyFitTerminal"], |
}, |
||||
}, |
{ |
||||
{ |
type: 'enum', |
||||
type: "number", |
name: 'Bold Font Weight', |
||||
name: "Terminal Columns", |
description: 'The font weight for bold text.', |
||||
description: "The number of columns in the terminal. Overridden by the Fit Terminal option.", |
path: ['xterm', 'fontWeightBold'], |
||||
path: ["xterm", "cols"], |
enum: [ |
||||
nullable: true, |
'normal', |
||||
}, |
'bold', |
||||
{ |
'100', |
||||
type: "number", |
'200', |
||||
name: "Terminal Rows", |
'300', |
||||
description: "The number of rows in the terminal. Overridden by the Fit Terminal option.", |
'400', |
||||
path: ["xterm", "rows"], |
'500', |
||||
nullable: true, |
'600', |
||||
}, |
'700', |
||||
{ |
'800', |
||||
type: "enum", |
'900', |
||||
name: "Cursor Style", |
], |
||||
description: "The style of the cursor", |
}, |
||||
path: ["xterm", "cursorStyle"], |
{ |
||||
enum: ["block", "underline", "bar"], |
type: 'boolean', |
||||
}, |
name: 'Fit Terminal', |
||||
{ |
description: |
||||
type: "boolean", |
'Automatically fits the terminal to the page, overriding terminal columns and rows.', |
||||
name: "Blinking Cursor", |
path: ['wettyFitTerminal'], |
||||
description: "Whether the cursor blinks", |
}, |
||||
path: ["xterm", "cursorBlink"], |
{ |
||||
}, |
type: 'number', |
||||
{ |
name: 'Terminal Columns', |
||||
type: "number", |
description: |
||||
name: "Bar Cursor Width", |
'The number of columns in the terminal. Overridden by the Fit Terminal option.', |
||||
description: "The width of the cursor in CSS pixels. Only applies when Cursor Style is set to 'bar'.", |
path: ['xterm', 'cols'], |
||||
path: ["xterm", "cursorWidth"], |
nullable: true, |
||||
}, |
}, |
||||
{ |
{ |
||||
type: "boolean", |
type: 'number', |
||||
name: "Draw Bold Text In Bright Colors", |
name: 'Terminal Rows', |
||||
description: "Whether to draw bold text in bright colors", |
description: |
||||
path: ["xterm", "drawBoldTextInBrightColors"], |
'The number of rows in the terminal. Overridden by the Fit Terminal option.', |
||||
}, |
path: ['xterm', 'rows'], |
||||
{ |
nullable: true, |
||||
type: "number", |
}, |
||||
name: "Scroll Sensitivity", |
{ |
||||
description: "The scroll speed multiplier for regular scrolling.", |
type: 'enum', |
||||
path: ["xterm", "scrollSensitivity"], |
name: 'Cursor Style', |
||||
float: true, |
description: 'The style of the cursor', |
||||
}, |
path: ['xterm', 'cursorStyle'], |
||||
{ |
enum: ['block', 'underline', 'bar'], |
||||
type: "enum", |
}, |
||||
name: "Fast Scroll Key", |
{ |
||||
description: "The modifier key to hold to multiply scroll speed.", |
type: 'boolean', |
||||
path: ["xterm", "fastScrollModifier"], |
name: 'Blinking Cursor', |
||||
enum: ["none", "alt", "shift", "ctrl"], |
description: 'Whether the cursor blinks', |
||||
}, |
path: ['xterm', 'cursorBlink'], |
||||
{ |
}, |
||||
type: "number", |
{ |
||||
name: "Fast Scroll Multiplier", |
type: 'number', |
||||
description: "The scroll speed multiplier used for fast scrolling.", |
name: 'Bar Cursor Width', |
||||
path: ["xterm", "fastScrollSensitivity"], |
description: |
||||
float: true, |
"The width of the cursor in CSS pixels. Only applies when Cursor Style is set to 'bar'.", |
||||
}, |
path: ['xterm', 'cursorWidth'], |
||||
{ |
}, |
||||
type: "number", |
{ |
||||
name: "Scrollback Rows", |
type: 'boolean', |
||||
description: "The amount of scrollback rows, rows you can scroll up to after they leave the viewport, to keep.", |
name: 'Draw Bold Text In Bright Colors', |
||||
path: ["xterm", "scrollback"], |
description: 'Whether to draw bold text in bright colors', |
||||
}, |
path: ['xterm', 'drawBoldTextInBrightColors'], |
||||
{ |
}, |
||||
type: "number", |
{ |
||||
name: "Tab Stop Width", |
type: 'number', |
||||
description: "The size of tab stops in the terminal.", |
name: 'Scroll Sensitivity', |
||||
path: ["xterm", "tabStopWidth"], |
description: 'The scroll speed multiplier for regular scrolling.', |
||||
}, |
path: ['xterm', 'scrollSensitivity'], |
||||
|
float: true, |
||||
|
}, |
||||
|
{ |
||||
|
type: 'enum', |
||||
|
name: 'Fast Scroll Key', |
||||
|
description: 'The modifier key to hold to multiply scroll speed.', |
||||
|
path: ['xterm', 'fastScrollModifier'], |
||||
|
enum: ['none', 'alt', 'shift', 'ctrl'], |
||||
|
}, |
||||
|
{ |
||||
|
type: 'number', |
||||
|
name: 'Fast Scroll Multiplier', |
||||
|
description: 'The scroll speed multiplier used for fast scrolling.', |
||||
|
path: ['xterm', 'fastScrollSensitivity'], |
||||
|
float: true, |
||||
|
}, |
||||
|
{ |
||||
|
type: 'number', |
||||
|
name: 'Scrollback Rows', |
||||
|
description: |
||||
|
'The amount of scrollback rows, rows you can scroll up to after they leave the viewport, to keep.', |
||||
|
path: ['xterm', 'scrollback'], |
||||
|
}, |
||||
|
{ |
||||
|
type: 'number', |
||||
|
name: 'Tab Stop Width', |
||||
|
description: 'The size of tab stops in the terminal.', |
||||
|
path: ['xterm', 'tabStopWidth'], |
||||
|
}, |
||||
]); |
]); |
||||
|
@ -1,5 +1,5 @@ |
|||||
caches.keys().then(cacheNames => { |
caches.keys().then((cacheNames) => { |
||||
cacheNames.forEach(cacheName => { |
cacheNames.forEach((cacheName) => { |
||||
caches.delete(cacheName); |
caches.delete(cacheName); |
||||
}); |
}); |
||||
}); |
}); |
||||
|
Loading…
Reference in new issue