mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Implemented game table row editing.
Text input is made editable on double click.
This commit is contained in:
@@ -373,3 +373,11 @@ li.warn{
|
||||
.dialog .buttons {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
border: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
td input {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -463,14 +463,32 @@ function processURLParams() {
|
||||
var clone = document.importNode(content, true);
|
||||
gameTable.appendChild(clone);
|
||||
clone = gameTable.lastElementChild;
|
||||
clone.children[0].textContent = data.games[i].name;
|
||||
clone.children[1].textContent = data.games[i].type;
|
||||
clone.children[2].textContent = data.games[i].folder;
|
||||
clone.children[3].textContent = data.games[i].masterFile;
|
||||
clone.children[4].textContent = data.games[i].url;
|
||||
clone.children[5].textContent = data.games[i].branch;
|
||||
clone.children[6].textContent = data.games[i].path;
|
||||
clone.children[7].textContent = data.games[i].registryKey;
|
||||
clone.querySelector('.name').value = data.games[i].name;
|
||||
var inputs = clone.getElementsByTagName('input');
|
||||
for (var j = 0; j < inputs.length; ++j) {
|
||||
inputs[j].addEventListener('dblclick', function(evt){
|
||||
if (evt.target.readOnly) {
|
||||
evt.target.removeAttribute('readonly');
|
||||
} else {
|
||||
evt.target.setAttribute('readonly', '');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (var j = 0; j < data.gameTypes.length; ++j) {
|
||||
var option = document.createElement('option');
|
||||
option.value = data.gameTypes[j];
|
||||
option.textContent = data.gameTypes[j];
|
||||
clone.querySelector('.type').appendChild(option);
|
||||
}
|
||||
clone.querySelector('.type').value = data.games[i].type;
|
||||
|
||||
clone.querySelector('.folder').value = data.games[i].folder;
|
||||
clone.querySelector('.masterFile').value = data.games[i].masterFile;
|
||||
clone.querySelector('.url').value = data.games[i].url;
|
||||
clone.querySelector('.branch').value = data.games[i].branch;
|
||||
clone.querySelector('.path').value = data.games[i].path;
|
||||
clone.querySelector('.registryKey').value = data.games[i].registryKey;
|
||||
}
|
||||
|
||||
/* Now fill in language options. */
|
||||
|
||||
@@ -9,15 +9,18 @@
|
||||
</head>
|
||||
<body>
|
||||
<template id="gameRow">
|
||||
<tr contenteditable>
|
||||
<td >Name
|
||||
<td>Base Game
|
||||
<td>LOOT Folder
|
||||
<td>Master File
|
||||
<td>Masterlist Repository URL
|
||||
<td>Masterlist Repository Branch
|
||||
<td>Install Path
|
||||
<td>Install Path Registry Key
|
||||
<tr>
|
||||
<td><input class="name" type="text" readonly>
|
||||
<td>
|
||||
<select class="type" >
|
||||
<!-- Game <option> elements go here. -->
|
||||
</select>
|
||||
<td><input class="folder" type="text" readonly>
|
||||
<td><input class="masterFile" type="text" readonly>
|
||||
<td><input class="url" type="text" readonly>
|
||||
<td><input class="branch" type="text" readonly>
|
||||
<td><input class="path" type="text" readonly>
|
||||
<td><input class="registryKey" type="text" readonly>
|
||||
</template>
|
||||
<template id="pluginNav">
|
||||
<li>
|
||||
|
||||
@@ -998,6 +998,12 @@ var data = {
|
||||
"registryKey": "Software\\Bethesda Softworks\\FalloutNV\\Installed Path",
|
||||
},
|
||||
],
|
||||
"gameTypes": [
|
||||
"Oblivion",
|
||||
"Skyrim",
|
||||
"Fallout3",
|
||||
"FalloutNV",
|
||||
],
|
||||
"languages": [
|
||||
"None Specified",
|
||||
"English",
|
||||
|
||||
Reference in New Issue
Block a user