mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Started trying to use Polymer.
Not very successfully, none of the icons show up, and I can't figure out why not.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "report",
|
||||
"version": "0.7.0",
|
||||
"description": "Load order optimisation tool",
|
||||
"main": "report.html",
|
||||
"license": "GPL",
|
||||
"private": true,
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#~0.4.2",
|
||||
"paper-icon-button": "Polymer/paper-icon-button#~0.4.2",
|
||||
"paper-dropdown-menu": "Polymer/paper-dropdown-menu#~0.4.2",
|
||||
"core-header-panel": "Polymer/core-header-panel#~0.4.2",
|
||||
"core-toolbar": "Polymer/core-toolbar#~0.4.2",
|
||||
"core-icons": "Polymer/core-icons#~0.4.2"
|
||||
}
|
||||
}
|
||||
@@ -36,14 +36,14 @@ noscript {
|
||||
padding:10px 5px;
|
||||
color:white;
|
||||
}
|
||||
header {
|
||||
#mainToolbar {
|
||||
background:#e3e3e3;
|
||||
position:fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
z-index:2;
|
||||
box-shadow: 0 0 3px 1px rgba(0,0,0,0.5);
|
||||
width:100%;
|
||||
font-size: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
header > ol {
|
||||
|
||||
@@ -37,12 +37,11 @@ var loot = {
|
||||
/* Call whenever game is changed or game menu / game table are rewritten. */
|
||||
updateSelectedGame: function() {
|
||||
/* Highlight game in menu. Could use fa-chevron-right instead. */
|
||||
var gameMenuItems = document.getElementById('gameMenu').children[0].children;
|
||||
var gameMenuItems = document.getElementById('gameMenu').children;
|
||||
for (var i = 0; i < gameMenuItems.length; ++i) {
|
||||
if (gameMenuItems[i].getAttribute('data-folder') == this.folder) {
|
||||
gameMenuItems[i].getElementsByClassName('fa')[0].classList.toggle('fa-angle-double-right', true);
|
||||
} else {
|
||||
gameMenuItems[i].getElementsByClassName('fa')[0].classList.toggle('fa-angle-double-right', false);
|
||||
document.getElementById('gameMenu').selected = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +149,7 @@ var loot = {
|
||||
/* Call whenever installedGames is changed or game menu is rewritten. */
|
||||
updateEnabledGames: function() {
|
||||
/* Update the disabled games in the game menu. */
|
||||
var gameMenuItems = document.getElementById('gameMenu').firstElementChild.children;
|
||||
var gameMenuItems = document.getElementById('gameMenu').children;
|
||||
for (var i = 0; i < gameMenuItems.length; ++i) {
|
||||
if (this.installedGames.indexOf(gameMenuItems[i].getAttribute('data-folder')) == -1) {
|
||||
gameMenuItems[i].classList.toggle('disabled', true);
|
||||
@@ -171,7 +170,7 @@ var loot = {
|
||||
/* Call whenever settings are changed. */
|
||||
updateSettingsUI: function() {
|
||||
var gameSelect = document.getElementById('defaultGameSelect');
|
||||
var gameMenu = document.getElementById('gameMenu').firstElementChild;
|
||||
var gameMenu = document.getElementById('gameMenu');
|
||||
var gameTable = document.getElementById('gameTable');
|
||||
|
||||
/* First make sure game listing elements don't have any existing entries. */
|
||||
@@ -193,17 +192,9 @@ var loot = {
|
||||
option.textContent = game.name;
|
||||
gameSelect.appendChild(option);
|
||||
|
||||
var li = document.createElement('li');
|
||||
var li = document.createElement('paper-item');
|
||||
li.setAttribute('data-folder', game.folder);
|
||||
|
||||
var icon = document.createElement('span');
|
||||
icon.className = 'fa fa-fw';
|
||||
li.appendChild(icon);
|
||||
|
||||
var text = document.createElement('span');
|
||||
text.textContent = game.name;
|
||||
li.appendChild(text);
|
||||
|
||||
li.setAttribute('label', game.name);
|
||||
gameMenu.appendChild(li);
|
||||
|
||||
var row = gameTable.addRow(game);
|
||||
@@ -1226,15 +1217,12 @@ function setupEventHandlers() {
|
||||
document.getElementById('hideMessagelessPlugins').addEventListener('click', applyFilters, false);
|
||||
|
||||
/* Set up handlers for buttons. */
|
||||
document.getElementById('fileMenu').addEventListener('click', openMenu, false);
|
||||
document.getElementById('redatePluginsButton').addEventListener('click', redatePlugins, false);
|
||||
document.getElementById('openLogButton').addEventListener('click', openLogLocation, false);
|
||||
document.getElementById('wipeUserlistButton').addEventListener('click', clearAllMetadata, false);
|
||||
document.getElementById('copyContentButton').addEventListener('click', copyContent, false);
|
||||
document.getElementById('refreshContentButton').addEventListener('click', onFocus, false);
|
||||
document.getElementById('gameMenu').addEventListener('click', openMenu, false);
|
||||
document.getElementById('settingsButton').addEventListener('click', showSettingsDialog, false);
|
||||
document.getElementById('helpMenu').addEventListener('click', openMenu, false);
|
||||
document.getElementById('helpButton').addEventListener('click', openReadme, false);
|
||||
document.getElementById('aboutButton').addEventListener('click', showAboutDialog, false);
|
||||
document.getElementById('updateMasterlistButton').addEventListener('click', updateMasterlist, false);
|
||||
|
||||
@@ -4,47 +4,54 @@
|
||||
<title>LOOT</title>
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link rel="stylesheet" href="css/font-awesome.min.css" />
|
||||
<link rel="import" href="loot://import/message-dialog.html">
|
||||
<link rel="import" href="loot://import/plugin-li.html">
|
||||
<link rel="import" href="loot://import/plugin-card.html">
|
||||
<link rel="import" href="loot://import/editable-table.html">
|
||||
<link rel="import" href="loot://import/html/message-dialog.html">
|
||||
<link rel="import" href="loot://import/html/plugin-li.html">
|
||||
<link rel="import" href="loot://import/html/plugin-card.html">
|
||||
<link rel="import" href="loot://import/html/editable-table.html">
|
||||
|
||||
<script src="loot://import/bower_components/platform/platform.js"></script>
|
||||
<link rel="import" href="loot://import/bower_components/polymer/polymer.html">
|
||||
|
||||
<link rel="import" href="loot://import/bower_components/core-toolbar/core-toolbar.html">
|
||||
<link rel="import" href="loot://import/bower_components/core-icon/core-icon.html">
|
||||
<link rel="import" href="loot://import/bower_components/core-icons/core-icons.html">
|
||||
|
||||
<link rel="import" href="loot://import/bower_components/paper-menu-button/paper-menu-button.html">
|
||||
<link rel="import" href="loot://import/bower_components/paper-item/paper-item.html">
|
||||
<link rel="import" href="loot://import/bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
|
||||
<link rel="import" href="loot://import/bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="loot://import/bower_components/paper-button/paper-button.html">
|
||||
|
||||
<script src="js/require.js"></script>
|
||||
</head>
|
||||
<!-- oncontextmenu attribute disables the right-click menu. -->
|
||||
<body oncontextmenu="return false">
|
||||
<header>
|
||||
<div id="headerOverlay"></div>
|
||||
<img src="../icon.ico">
|
||||
<ol>
|
||||
<li id="fileMenu">File
|
||||
<ol class="hidden">
|
||||
<li id="redatePluginsButton"><span class="fa fa-fw fa-calendar-o"></span>Redate Plugins</li>
|
||||
<li id="openLogButton"><span class="fa fa-fw fa-folder-open"></span>Open Debug Log Location</li>
|
||||
<li id="wipeUserlistButton"><span class="fa fa-fw fa-trash-o"></span>Clear All User Metadata</li>
|
||||
<li id="copyContentButton"><span class="fa fa-fw fa-copy"></span>Copy Content As Text</li>
|
||||
<li id="refreshContentButton"><span class="fa fa-fw fa-refresh"></span>Refresh Content</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li id="gameMenu">Game
|
||||
<ol class="hidden">
|
||||
<!-- Generated game <li> elements go here. -->
|
||||
</ol>
|
||||
</li>
|
||||
<li id="settingsButton">Settings</li>
|
||||
<li id="helpMenu">Help
|
||||
<ol class="hidden">
|
||||
<li id="helpButton"><span class="fa fa-fw fa-book"></span>View Documentation
|
||||
<li id="aboutButton"><span class="fa fa-fw fa-info-circle"></span>About
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
<ol>
|
||||
<li id="updateMasterlistButton"><span class="fa fa-fw fa-download"></span>Update Masterlist</li>
|
||||
<li id="sortButton"><span class="fa fa-fw fa-magic"></span>Sort</li>
|
||||
<li id="applySortButton" class="hidden"><span class="fa fa-fw fa-check"></span>Apply</li>
|
||||
<li id="cancelSortButton" class="hidden"><span class="fa fa-fw fa-times"></span>Cancel</li>
|
||||
</ol>
|
||||
</header>
|
||||
<body oncontextmenu="return false" unresolved fullbleed vertical layout >
|
||||
<core-toolbar id="mainToolbar">
|
||||
<paper-menu-button src="../icon.ico">
|
||||
<paper-item id="redatePluginsButton" icon="today" label="Redate Plugins"></paper-item>
|
||||
<paper-item id="openLogButton" icon="folder" label="Open Debug Log Location"></paper-item>
|
||||
<paper-item id="wipeUserlistButton" icon="delete" label="Clear All User Metadata"></paper-item>
|
||||
<paper-item id="copyContentButton" icon="copy-content" label="Copy Content As Text"></paper-item>
|
||||
<paper-item id="refreshContentButton" icon="cache" label="Refresh Content"></paper-item>
|
||||
<paper-item id="settingsButton" icon="settings" label="Settings"></paper-item>
|
||||
<paper-item id="helpButton" icon="book" label="View Documentation"></paper-item>
|
||||
<paper-item id="aboutButton" icon="help" label="About"></paper-item>
|
||||
</paper-menu-button>
|
||||
<paper-dropdown-menu id="gameMenu">
|
||||
<!-- Generated game <li> elements go here. -->
|
||||
</paper-dropdown-menu>
|
||||
<span flex></span>
|
||||
<paper-icon-button id="updateMasterlistButton" icon="file-download"></paper-icon-button>
|
||||
<paper-icon-button id="sortButton" icon="swap-vert"></paper-icon-button>
|
||||
<paper-button id="applySortButton" class="colored custom hidden">
|
||||
<core-icon icon="check"></core-icon>
|
||||
Apply
|
||||
</paper-button>
|
||||
<paper-button id="cancelSortButton" class="colored custom hidden">
|
||||
<core-icon icon="close"></core-icon>
|
||||
Cancel
|
||||
</paper-button>
|
||||
</core-toolbar>
|
||||
<div id="container">
|
||||
<nav>
|
||||
<ol>
|
||||
|
||||
Reference in New Issue
Block a user