Update loot-plugin-editor

Editor data is now set only with setEditorData(), the `data`
member has been removed. All metadata changes need to be
propagated using setEditorData(). Plugin name, version and crc
now exist in the editor's light DOM.
This commit is contained in:
Oliver Hamlet
2016-03-05 11:49:26 +00:00
parent a6ae6d0f52
commit 62edbc917f
3 changed files with 457 additions and 521 deletions
+1
View File
@@ -66,6 +66,7 @@ function vulcanizeTests(releasePath) {
'test_loot-custom-icons.html',
'test_loot-dropdown-menu.html',
'test_loot-message-dialog.html',
'test_loot-plugin-editor.html',
'test_loot-plugin-item.html',
'test_loot-search-toolbar.html',
];
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>test_loot-plugin-editor.html</title>
<link rel="import" href="../../../../gui/html/native-shadow-dom.html">
<link rel="import" href="../../../../gui/html/elements/loot-plugin-editor.html">
<script src="../../../../gui/html/js/plugin.js"></script>
<script src="../../../../gui/html/js/translator.js"></script>
<script src="../../../../gui/html/js/filters.js"></script>
</head>
<body>
<loot-plugin-editor id="editor">
<h1>Skyrim.esm</h1>
<span class="version">1.9</span>
<span class="crc">ABCDEF01</span>
</loot-plugin-editor>
<script>
'use strict';
function onEditorToggle() {
alert('An editor close button was pressed.');
}
loot.filters = new loot.Filters(new loot.Translator());
const plugin = new loot.Plugin({
name: 'Skyrim.esm',
priority: -999999,
});
document.getElementById('editor').setEditorData(plugin);
document.addEventListener('loot-editor-close', onEditorToggle);
</script>
</body>