mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Finished implementing data loading.
This commit is contained in:
@@ -1,3 +1,43 @@
|
||||
var data = {
|
||||
lootVersion: '0.6.0',
|
||||
masterlist: {
|
||||
revision: 'be2c19078',
|
||||
date: '',
|
||||
},
|
||||
masterlistUpdater: 'Enabled',
|
||||
globalMessages: [
|
||||
{
|
||||
type: 'say',
|
||||
message: 'Note: <a href="http://forums.bethsoft.com/topic/1498392-rel-loot-thread-7/">Latest LOOT thread</a>.',
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
{
|
||||
name: 'Skyrim.esm',
|
||||
version: '2.0.0b',
|
||||
crc: 'C665FD56',
|
||||
tagsAdd: [
|
||||
'Delev',
|
||||
'Relev',
|
||||
],
|
||||
tagsRemove: [
|
||||
'Delev',
|
||||
'Relev',
|
||||
],
|
||||
messages: [
|
||||
{
|
||||
type: 'say',
|
||||
message: 'Note: Requires: <a href="http://www.nexusmods.com/skyrim/mods/60">Dragonborn Compatibility_Patch</a>.',
|
||||
},
|
||||
{
|
||||
type: 'warn',
|
||||
message: 'Warning: Contains 3 UDR records. Clean with <a href="http://www.nexusmods.com/skyrim/mods/25859">TES5Edit</a>.',
|
||||
},
|
||||
{
|
||||
type: 'error',
|
||||
message: 'Error: This plugin requires "Dawnguard.esm" to be installed, but it is missing.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -20,18 +20,6 @@
|
||||
</noscript>
|
||||
<div id="plugins" class="hidden">
|
||||
<ul id="pluginsList">
|
||||
<li>
|
||||
<span class="mod">Skyrim.esm</span>
|
||||
<div class="crc">CRC: C665FD56</div>
|
||||
<div class="version">Version: 2.0.0b</div>
|
||||
<div class="tag add">Add: Delev, Relev</div>
|
||||
<div class="tag remove">Remove: Delev, Relev</div>
|
||||
<ul>
|
||||
<li class="say">Note: Requires: <a href="http://www.nexusmods.com/skyrim/mods/60">Dragonborn Compatibility_Patch</a>.</li>
|
||||
<li class="warn">Warning: Contains 3 UDR records. Clean with <a href="http://www.nexusmods.com/skyrim/mods/25859">TES5Edit</a>.</li>
|
||||
<li class="error">Error: This plugin requires "Dawnguard.esm" to be installed, but it is missing.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="summary">
|
||||
@@ -39,19 +27,18 @@
|
||||
<h2>Summary</h2>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><td>LOOT Version</td><td id="lootVersion">0.5.0</td></tr>
|
||||
<tr><td>Masterlist Version</td><td id="masterlistRevision">be2c19078</td></tr>
|
||||
<tr><td>Masterlist Updating</td><td id="masterlistUpdating">Enabled</td></tr>
|
||||
<tr><td>Total Number of Messages</td><td id="totalMessageNo">49</td></tr>
|
||||
<tr><td>Number of Warnings</td><td id="totalWarningNo">4</td></tr>
|
||||
<tr><td>Number of Errors</td><td id="totalErrorNo">37</td></tr>
|
||||
<tr><td>LOOT Version</td><td id="lootVersion"></td></tr>
|
||||
<tr><td>Masterlist Version</td><td id="masterlistRevision"></td></tr>
|
||||
<tr><td>Masterlist Updating</td><td id="masterlistUpdating"></td></tr>
|
||||
<tr><td>Total Number of Messages</td><td id="totalMessageNo"></td></tr>
|
||||
<tr><td>Number of Warnings</td><td id="totalWarningNo"></td></tr>
|
||||
<tr><td>Number of Errors</td><td id="totalErrorNo"></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h2>General Messages</h2>
|
||||
<ul id="generalMessagesList">
|
||||
<li class="say">Note: <a href="http://forums.bethsoft.com/topic/1498392-rel-loot-thread-7/">Latest LOOT thread</a>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,10 +52,10 @@
|
||||
<label><input type="checkbox" id="hideAllPluginMessages" />Hide All Plugin Messages</label>
|
||||
<label><input type="checkbox" id="hideMessagelessPlugins" />Hide Messageless Plugins</label>
|
||||
<div>
|
||||
<span id="hiddenPluginNo">0</span> of <span id="totalPluginNo">128</span> plugins hidden.
|
||||
<span id="hiddenPluginNo">0</span> of <span id="totalPluginNo"></span> plugins hidden.
|
||||
</div>
|
||||
<div>
|
||||
<span id="hiddenMessageNo">0</span> of <span id="totalMessageNo">46</span> messages hidden.
|
||||
<span id="hiddenMessageNo">0</span> of <span id="filterTotalMessageNo"></span> messages hidden.
|
||||
</div>
|
||||
</div>
|
||||
<script src="script.js"></script>
|
||||
|
||||
@@ -220,8 +220,88 @@ function processURLParams() {
|
||||
var datapath = 'file:///' + document.URL.substring(pos+6);
|
||||
console.log(datapath);
|
||||
require([datapath], function(){
|
||||
console.log(data);
|
||||
var totalMessageNo = 0;
|
||||
var warnMessageNo = 0;
|
||||
var errorMessageNo = 0;
|
||||
/* Fill report with data. */
|
||||
document.getElementById('lootVersion').textContent = data.lootVersion;
|
||||
document.getElementById('masterlistRevision').textContent = data.masterlist.revision;
|
||||
document.getElementById('masterlistUpdating').textContent = data.masterlistUpdater;
|
||||
var generalMessagesList = document.getElementById('generalMessagesList');
|
||||
for (var i = 0; i < data.globalMessages.length; ++i) {
|
||||
var li = document.createElement('li');
|
||||
li.className = data.globalMessages[i].type;
|
||||
/* innerHTML is open to abuse, but for hyperlinking it's too useful. */
|
||||
li.innerHTML = data.globalMessages[i].message;
|
||||
generalMessagesList.appendChild(li);
|
||||
|
||||
if (li.className == 'warn') {
|
||||
warnMessageNo += 1;
|
||||
} else if (li.className == 'error') {
|
||||
errorMessageNo += 1;
|
||||
}
|
||||
}
|
||||
totalMessageNo = data.globalMessages.length;
|
||||
var pluginsList = document.getElementById('pluginsList');
|
||||
for (var i = 0; i < data.plugins.length; ++i) {
|
||||
var li = document.createElement('li');
|
||||
|
||||
var mod = document.createElement('div');
|
||||
mod.className = 'mod';
|
||||
mod.textContent = data.plugins[i].name;
|
||||
li.appendChild(mod);
|
||||
|
||||
var crc = document.createElement('div');
|
||||
crc.className = 'crc';
|
||||
crc.textContent = 'CRC: ' + data.plugins[i].crc;
|
||||
li.appendChild(crc);
|
||||
|
||||
if (data.plugins[i].version) {
|
||||
var version = document.createElement('div');
|
||||
version.className = 'version';
|
||||
version.textContent = 'Version: ' + data.plugins[i].version;
|
||||
li.appendChild(version);
|
||||
}
|
||||
|
||||
if (data.plugins[i].tagsAdd && data.plugins[i].tagsAdd.length != 0) {
|
||||
var tagAdd = document.createElement('div');
|
||||
tagAdd.className = 'tag add';
|
||||
tagAdd.textContent = data.plugins[i].tagsAdd.join(', ');
|
||||
li.appendChild(tagAdd);
|
||||
}
|
||||
|
||||
if (data.plugins[i].tagRemove && data.plugins[i].tagRemove.length != 0) {
|
||||
var tagRemove = document.createElement('div');
|
||||
tagRemove.className = 'tag remove';
|
||||
tagRemove.textContent = data.plugins[i].tagsRemove.join(', ');
|
||||
li.appendChild(tagRemove);
|
||||
}
|
||||
|
||||
if (data.plugins[i].messages && data.plugins[i].messages.length != 0) {
|
||||
var ul = document.createElement('ul');
|
||||
for (var j = 0; j < data.plugins[i].messages.length; ++j) {
|
||||
var messageLi = document.createElement('li');
|
||||
messageLi.className = data.plugins[i].messages[j].type;
|
||||
/* innerHTML is open to abuse, but for hyperlinking it's too useful. */
|
||||
messageLi.innerHTML = data.plugins[i].messages[j].message;
|
||||
ul.appendChild(messageLi);
|
||||
|
||||
if (messageLi.className == 'warn') {
|
||||
warnMessageNo += 1;
|
||||
} else if (messageLi.className == 'error') {
|
||||
errorMessageNo += 1;
|
||||
}
|
||||
totalMessageNo += 1;
|
||||
}
|
||||
li.appendChild(ul);
|
||||
}
|
||||
pluginsList.appendChild(li);
|
||||
}
|
||||
document.getElementById('totalMessageNo').textContent = totalMessageNo;
|
||||
document.getElementById('filterTotalMessageNo').textContent = totalMessageNo;
|
||||
document.getElementById('totalPluginNo').textContent = data.plugins.length;
|
||||
document.getElementById('totalWarningNo').textContent = warnMessageNo;
|
||||
document.getElementById('totalErrorNo').textContent = errorMessageNo;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,10 +128,6 @@ ul {
|
||||
}
|
||||
.mod {
|
||||
font-size:1.3em;
|
||||
display:block;
|
||||
font-weight:normal;
|
||||
margin-bottom:0em;
|
||||
margin-top:0;
|
||||
}
|
||||
.version{
|
||||
color:#6394F8;
|
||||
|
||||
Reference in New Issue
Block a user