Package cleanup and add LICENSE files!

This commit is contained in:
Patrick Jentsch
2020-01-13 15:33:05 +01:00
parent c2923013a3
commit 310c652514
35 changed files with 375 additions and 26583 deletions

View File

@ -1,7 +0,0 @@
class Animations {
static async pulse(statusElement, ms) {
statusElement.classList.add("pulse");
await new Promise(resolve => setTimeout(resolve, ms));
statusElement.classList.remove("pulse");
}
}

View File

@ -1,6 +1,6 @@
class CorpusList extends List {
constructor(idOrElement, subscriberList, options) {
super(idOrElement, options);
constructor(idOrElement, subscriberList, options={}) {
super(idOrElement, {...CorpusList.DEFAULT_OPTIONS, ...options});
subscriberList.push(this);
}
@ -10,8 +10,7 @@ class CorpusList extends List {
this.addCorpus(corpus);
}
this.update()
List.updatePagination(this);
this.update();
}
@ -34,12 +33,6 @@ class CorpusList extends List {
case "replace":
item = this.get("id", pathArray[0])[0];
switch(pathArray[1]) {
case "description":
item.values({"description": operation.value});
break;
case "title":
item.values({"title": operation.value});
break;
default:
break;
}
@ -79,10 +72,18 @@ class CorpusList extends List {
);
}
}
CorpusList.DEFAULT_OPTIONS = {item: `<div>
<span class="title"></span>
<span class="description"></span>
</div>`,
page: 4,
pagination: {innerWindow: 8, outerWindow: 1},
valueNames: ["description", "title", {data: ["id"]}]};
CorpusList.STATUS_COLORS = {"unprepared": "grey",
"preparable": "orange",
"preparing": "yellow",
"prepared": "green",
"start analysis": "yellow",
"analysing": "green",
"stop analysis": "red", "default": "red"};
"stop analysis": "red",
"default": "red"};

View File

@ -0,0 +1,23 @@
MIT License
Copyright (c) 2019 Alexander Shutau
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,18 @@
Copyright 2012 Dharmafly. All rights reserved.
Permission is hereby granted,y free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@ -1,6 +1,6 @@
class JobList extends List {
constructor(idOrElement, subscriberList, options) {
super(idOrElement, options);
constructor(idOrElement, subscriberList, options={}) {
super(idOrElement, {...JobList.DEFAULT_OPTIONS, ...options});
subscriberList.push(this);
}
@ -10,8 +10,7 @@ class JobList extends List {
this.addJob(job);
}
this.update()
List.updatePagination(this);
this.update();
}
@ -27,18 +26,13 @@ class JobList extends List {
if (pathArray.includes("results")) {break;}
this.addJob(operation.value);
this.update();
List.updatePagination(this);
break;
case "remove":
this.remove("id", pathArray[0]);
List.updatePagination(this);
break;
case "replace":
item = this.get("id", pathArray[0])[0];
switch(pathArray[1]) {
case "description":
item.values({"description": operation.value});
break;
case "status":
jobStatusElement = item.elm.querySelector(".status");
status = jobStatusElement.innerHTML;
@ -50,9 +44,6 @@ class JobList extends List {
jobStatusElement.classList.add(newStatusColor);
jobStatusElement.innerHTML = operation.value;
break;
case "title":
item.values({"title": operation.value});
break;
default:
break;
}
@ -103,6 +94,13 @@ class JobList extends List {
);
}
}
JobList.DEFAULT_OPTIONS = {item: `<div>
<span class="title"></span>
<span class="description"></span>
</div>`,
page: 4,
pagination: {innerWindow: 8, outerWindow: 1},
valueNames: ["description", "title", {data: ["id"]}]};
JobList.SERVICE_COLORS = {"merge_images": "amber",
"nlp": "blue",
"ocr": "green",

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2011-2014 Jonny Strömberg, jonnystromberg.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2018 Materialize
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2014 Guillermo Rauch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
List.updatePagination = function(list) {
pagination = list.listContainer.querySelector(".pagination");
if (pagination.childElementCount <= 1) {
pagination.classList.add("hide");
} else {
pagination.classList.remove("hide");
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long