Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions weave/unwoven-site/collators/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<html>
<head>
<title>Liot R: Collators</title>
@@/head.html
<script src='index.js' type='module'>

</script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>Collators <a href="new">New</a></h1>
<div class="bubbles" id="collator-list">
</div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>
<head>
<title>Liot R: Collators</title>
@@/head.html
<script src="index.js" type="module"></script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>
Collators <a href="new">New</a>
</h1>
<div class="bubbles" id="collator-list"></div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>;
120 changes: 61 additions & 59 deletions weave/unwoven-site/collators/new/index.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bonus_1 = require("../../bonus");
const liotr_1 = require("../../liotr");
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const bonus_1 = require('../../bonus');
const liotr_1 = require('../../liotr');
const liotR = new liotr_1.LiotR();
var COMPARATORS = [
'EQUALS',
'NEQUALS',
'TFNEQUALS',
'OVER',
'OVEROR',
'UNDER',
'UNDEROR'
'EQUALS',
'NEQUALS',
'TFNEQUALS',
'OVER',
'OVEROR',
'UNDER',
'UNDEROR'
];
var OPERATORS = ['AND', 'OR', 'NAND', 'NOR', 'XOR', 'SAME'];
var filterList;
var reg = location.href.match(/after=(-?[0-9]+)/);
var after = reg ? parseInt(reg[1]) : 0;
var filters = [];
bonus_1.load(() => {
liotR.listFilters({}, res => {
if (res.err) {
console.log(res.err);
return;
}
filters = res.filters;
//for(var filter of res.filters)filters.push({id:filter.id,name:filter.name})
});
liotR.listFilters({}, res => {
if (res.err) {
console.log(res.err);
return;
}
filters = res.filters;
//for(var filter of res.filters)filters.push({id:filter.id,name:filter.name})
});
});
function addFilter() {
var select = document.createElement('select');
for (var filter of filters) {
var option = document.createElement('option');
option.value = filter.id;
option.innerHTML = filter.name;
select.appendChild(option);
}
var rem = document.createElement('label');
rem.innerHTML = '-';
var item = document.createElement('div');
item.appendChild(rem);
item.appendChild(select);
bonus_1.grab('filter-list').insertBefore(item, bonus_1.grab('add-filter'));
bonus_1.bind(rem, 'click', k => {
item.parentNode.removeChild(item);
});
var select = document.createElement('select');
for (var filter of filters) {
var option = document.createElement('option');
option.value = filter.id;
option.innerHTML = filter.name;
select.appendChild(option);
}
var rem = document.createElement('label');
rem.innerHTML = '-';
var item = document.createElement('div');
item.appendChild(rem);
item.appendChild(select);
bonus_1.grab('filter-list').insertBefore(item, bonus_1.grab('add-filter'));
bonus_1.bind(rem, 'click', k => {
item.parentNode.removeChild(item);
});
}
function save() {
//addc('save-button', 'disabled');
err('Creating collator...');
var name = bonus_1.grab('collator-name').value;
var filtrets = [];
var selects = document.getElementsByTagName('select');
for (var i of selects)
filtrets.push(i.value);
liotR.addCollators({
collators: [
{
name: name,
filters: filtrets
}
]
}, res => {
if (res.err) {
console.log(res.err);
return;
}
location.href = '/collators';
});
//addc('save-button', 'disabled');
err('Creating collator...');
var name = bonus_1.grab('collator-name').value;
var filtrets = [];
var selects = document.getElementsByTagName('select');
for (var i of selects) filtrets.push(i.value);
liotR.addCollators(
{
collators: [
{
name: name,
filters: filtrets
}
]
},
res => {
if (res.err) {
console.log(res.err);
return;
}
location.href = '/collators';
}
);
}
function err(text) {
bonus_1.grab('compile-errors').innerHTML = text || 'Ready';
bonus_1.setc('compile-errors', 'invalid-json', text);
bonus_1.setc('save-button', 'disabled', text);
bonus_1.grab('compile-errors').innerHTML = text || 'Ready';
bonus_1.setc('compile-errors', 'invalid-json', text);
bonus_1.setc('save-button', 'disabled', text);
}
46 changes: 22 additions & 24 deletions weave/unwoven-site/collectors/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<html>
<head>
<title>Liot R: Collectors</title>
@@/head.html
<script type='module' src='index.js'>

</script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>Collectors <a href="new">New</a></h1>

<div class="bubbles" id="collector-list">
</div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>
<head>
<title>Liot R: Collectors</title>
@@/head.html
<script type="module" src="index.js"></script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>
Collectors <a href="new">New</a>
</h1>
<div class="bubbles" id="collector-list"></div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>;
45 changes: 22 additions & 23 deletions weave/unwoven-site/distributors/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<html>
<head>
<title>Liot R: Distributors</title>
@@/head.html
<script type='module' src='index.js'>

</script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>Distributors <a href="new">New</a></h1>
<div class="bubbles" id="distributor-list">
</div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>
<head>
<title>Liot R: Distributors</title>
@@/head.html
<script type="module" src="index.js"></script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>
Distributors <a href="new">New</a>
</h1>
<div class="bubbles" id="distributor-list"></div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
<button onclick="populate()">Populate</button>
</div>
</div>
</body>
</html>;
45 changes: 22 additions & 23 deletions weave/unwoven-site/filters/index.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<html>
<head>
<title>Liot R: Filters</title>
@@/head.html
<script src='index.js' type='module'>

</script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>Filters <a href="new">New</a></h1>
<div class="bubbles" id="filter-list">
</div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
</div>
<button onclick="populate()">Populate</button>
</div>
</body>
</html>
<head>
<title>Liot R: Filters</title>
@@/head.html
<script src="index.js" type="module"></script>
</head>
<body>
<div id="content">
@@/nav.html
<h1>
Filters <a href="new">New</a>
</h1>
<div class="bubbles" id="filter-list"></div>
<div class="botnav">
<a onclick="gotoStart()">&lt;&lt;</a>
<a onclick="gotoPrevious()">&lt;</a>
<a onclick="gotoNext()">&gt;</a>
<a onclick="gotoLast()">&gt;&gt;</a>
</div>
<button onclick="populate()">Populate</button>
</div>
</body>
</html>;
Loading