mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 09:00:40 +00:00
Use JSON patch the correct way!
This commit is contained in:
@ -11,9 +11,8 @@
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='fonts/material-icons/material-icons.css') }}">
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/materialize.min.css') }}" media="screen,projection"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/opaque.css') }}" media="screen,projection"/>
|
||||
<script src="{{ url_for('static', filename='js/socket.io.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jsonpatch.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/jsondiffpatch.umd.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/socket.io.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/list.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/list.utils.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/CorpusList.js') }}"></script>
|
||||
@ -29,7 +28,7 @@
|
||||
var subscriber;
|
||||
|
||||
corpora = JSON.parse(msg);
|
||||
for (subscriber of corporaSubscribers) {subscriber.init();}
|
||||
for (subscriber of corporaSubscribers) {subscriber._init();}
|
||||
});
|
||||
|
||||
|
||||
@ -37,7 +36,7 @@
|
||||
var subscriber;
|
||||
|
||||
jobs = JSON.parse(msg);
|
||||
for (subscriber of jobsSubscribers) {subscriber.init();}
|
||||
for (subscriber of jobsSubscribers) {subscriber._init();}
|
||||
});
|
||||
|
||||
|
||||
@ -45,12 +44,8 @@
|
||||
var patch, patchedCorpora, subscriber;
|
||||
|
||||
patch = JSON.parse(msg);
|
||||
patchedCorpora = jsonpatch.apply_patch(corpora, patch);
|
||||
delta = jsondiffpatch.diff(corpora, patchedCorpora);
|
||||
corpora = patchedCorpora;
|
||||
for (subscriber of corporaSubscribers) {
|
||||
subscriber.updateWithPatch(delta);
|
||||
}
|
||||
corpora = jsonpatch.apply_patch(corpora, patch);
|
||||
for (subscriber of corporaSubscribers) {subscriber._update(patch);}
|
||||
});
|
||||
|
||||
|
||||
@ -58,12 +53,8 @@
|
||||
var patch, patchedJobs, subscriber;
|
||||
|
||||
patch = JSON.parse(msg);
|
||||
patchedJobs = jsonpatch.apply_patch(jobs, patch);
|
||||
delta = jsondiffpatch.diff(jobs, patchedJobs);
|
||||
jobs = patchedJobs;
|
||||
for (subscriber of jobsSubscribers) {
|
||||
subscriber.updateWithPatch(delta);
|
||||
}
|
||||
jobs = jsonpatch.apply_patch(jobs, patch);
|
||||
for (subscriber of jobsSubscribers) {subscriber._update(patch);}
|
||||
});
|
||||
|
||||
|
||||
|
@ -31,11 +31,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var corpusListOptions = {item: '<a><span class="title"></span><span class="description"></span></a>',
|
||||
page: 4,
|
||||
pagination: true,
|
||||
valueNames: ["description", "title", {data: ["id"]}]}
|
||||
var corpusList = new CorpusList("corpus-list", corpusListOptions);
|
||||
var corpusList = new CorpusList("corpus-list", {
|
||||
item: '<div><span class="title"></span><span class="description"></span></div>',
|
||||
page: 4,
|
||||
pagination: true,
|
||||
valueNames: ["description", "title", {data: ["id"]}]
|
||||
});
|
||||
corpusList.on("filterComplete", List.updatePagination);
|
||||
corpusList.on("searchComplete", List.updatePagination);
|
||||
</script>
|
||||
@ -74,13 +75,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jobListOptions = {item: '<a><span class="title"></span><span class="description"></span></a>',
|
||||
page: 4,
|
||||
pagination: true,
|
||||
valueNames: ["description", "title", {data: ["id"]}]}
|
||||
var jobList = new JobList("job-list", jobListOptions);
|
||||
jobList.on("filterComplete", List.updatePagination);
|
||||
jobList.on("searchComplete", List.updatePagination);
|
||||
var jobList = new JobList("job-list", {
|
||||
item: '<div><span class="title"></span><span class="description"></span></div>',
|
||||
page: 4,
|
||||
pagination: true,
|
||||
valueNames: ["description", "title", {data: ["id"]}]
|
||||
});
|
||||
jobList.on("filterComplete", List.updatePagination);
|
||||
jobList.on("searchComplete", List.updatePagination);
|
||||
</script>
|
||||
|
||||
<div id="new-corpus-modal" class="modal">
|
||||
|
Reference in New Issue
Block a user