Update loot-plugin-card

This commit is contained in:
Oliver Hamlet
2016-03-05 11:49:26 +00:00
parent 62edbc917f
commit fd12139eca
4 changed files with 481 additions and 392 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-card.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
+4
View File
@@ -303,6 +303,10 @@
this._isDirty = dirty;
}
get hasUserEdits() {
return this.userlist && Object.keys(this.userlist).length > 1;
}
getCardContent(filters) {
return new PluginCardContent(this, filters);
}
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>test_loot-plugin-card.html</title>
<link rel="import" href="../../../../gui/html/native-shadow-dom.html">
<link rel="import" href="../../../../../bower_components/iron-list/iron-list.html">
<link rel="import" href="../../../../../bower_components/marked-element/marked-element.html">
<link rel="import" href="../../../../gui/html/elements/loot-plugin-card.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>
<iron-list id="pluginList" as="plugin" style="height: 500px;">
<template>
<loot-plugin-card id="[[plugin.id]]" data="{{plugin}}" is-active$="[[plugin.isActive]]"
is-empty$="[[plugin.isEmpty]]"
loads-archive$="[[plugin.loadsArchive]]"
has-user-edits$="[[plugin.hasUserEdits]]"
is-master$="[[plugin.isMaster]]"
is-search-result$="[[plugin.isSearchResult]]">
<h1>[[plugin.name]]</h1>
<span class="version"></span>
<span class="crc"></span>
<span class="tag add"></span>
<span class="tag remove"></span>
<ul>
</ul>
</loot-plugin-card>
</template>
</iron-list>
<script>
'use strict';
loot.filters = new loot.Filters(new loot.Translator());
function onEditorOpen() {
alert('Editor opened');
}
function onEditorClose() {
alert('Editor closed');
}
function onFilterConflicts() {
alert('Conflicts filter toggle clicked');
}
function onCopyMetadata() {
alert('Copy metadata button clicked');
}
function onClearMetadata() {
alert('Clear metadata button clicked');
}
const plugins = [
new loot.Plugin({
name: 'Skyrim.esm',
priority: -999999,
crc: 0xABCD,
version: '1.9',
messages: [{
type: 'say',
content: [{
str: 'This is a *test* note.',
}],
}, {
type: 'warn',
content: [{
str: 'This is a **test** warning.',
}],
}],
}),
];
document.addEventListener('loot-editor-open', onEditorOpen);
document.addEventListener('loot-editor-close', onEditorClose);
document.addEventListener('loot-filter-conflicts', onFilterConflicts);
document.addEventListener('loot-copy-metadata', onCopyMetadata);
document.addEventListener('loot-clear-metadata', onClearMetadata);
document.getElementById('pluginList').items = plugins;
</script>
</body>