Compare commits

..

No commits in common. "d875623a8c939791363998fcd75f6bdff4aa5ee8" and "78dd375ef842de9fe43e6fa1495ee19339087c92" have entirely different histories.

27 changed files with 157 additions and 112 deletions

View File

@ -104,7 +104,7 @@ class CorpusAnalysisStaticVisualization {
renderTextInfoList() { renderTextInfoList() {
let corpusData = this.data.corpus.o.staticData; let corpusData = this.data.corpus.o.staticData;
let corpusTextInfoListElement = document.querySelector('.corpus-text-info-list'); let corpusTextInfoListElement = document.querySelector('.corpus-text-info-list');
let corpusTextInfoList = new ResourceLists.CorpusTextInfoList(corpusTextInfoListElement); let corpusTextInfoList = new CorpusTextInfoList(corpusTextInfoListElement);
let texts = corpusData.s_attrs.text.lexicon; let texts = corpusData.s_attrs.text.lexicon;
let textData = []; let textData = [];
for (let i = 0; i < Object.entries(texts).length; i++) { for (let i = 0; i < Object.entries(texts).length; i++) {
@ -213,7 +213,7 @@ class CorpusAnalysisStaticVisualization {
async renderTokenList() { async renderTokenList() {
let corpusTokenListElement = document.querySelector('.corpus-token-list'); let corpusTokenListElement = document.querySelector('.corpus-token-list');
let corpusTokenList = new ResourceLists.CorpusTokenList(corpusTokenListElement); let corpusTokenList = new CorpusTokenList(corpusTokenListElement);
let filteredData = this.filterData(); let filteredData = this.filterData();
let stopwords = this.data.stopwords; let stopwords = this.data.stopwords;
if (this.data.stopwords === undefined) { if (this.data.stopwords === undefined) {

View File

@ -1,5 +1,9 @@
ResourceLists.AdminUserList = class AdminUserList extends ResourceLists.ResourceList { class AdminUserList extends ResourceList {
static htmlClass = 'admin-user-list'; static autoInit() {
for (let adminUserListElement of document.querySelectorAll('.admin-user-list:not(.no-autoinit)')) {
new AdminUserList(adminUserListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -104,4 +108,4 @@ ResourceLists.AdminUserList = class AdminUserList extends ResourceLists.Resource
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.CorpusFileList = class CorpusFileList extends ResourceLists.ResourceList { class CorpusFileList extends ResourceList {
static htmlClass = 'corpus-file-list'; static autoInit() {
for (let corpusFileListElement of document.querySelectorAll('.corpus-file-list:not(.no-autoinit)')) {
new CorpusFileList(corpusFileListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -365,4 +369,4 @@ ResourceLists.CorpusFileList = class CorpusFileList extends ResourceLists.Resour
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.CorpusFollowerList = class CorpusFollowerList extends ResourceLists.ResourceList { class CorpusFollowerList extends ResourceList {
static htmlClass = 'corpus-follower-list'; static autoInit() {
for (let corpusFollowerListElement of document.querySelectorAll('.corpus-follower-list:not(.no-autoinit)')) {
new CorpusFollowerList(corpusFollowerListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -192,4 +196,4 @@ ResourceLists.CorpusFollowerList = class CorpusFollowerList extends ResourceList
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.CorpusList = class CorpusList extends ResourceLists.ResourceList { class CorpusList extends ResourceList {
static htmlClass = 'corpus-list'; static autoInit() {
for (let corpusListElement of document.querySelectorAll('.corpus-list:not(.no-autoinit)')) {
new CorpusList(corpusListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -366,4 +370,4 @@ ResourceLists.CorpusList = class CorpusList extends ResourceLists.ResourceList {
} }
} }
} }
}; }

View File

@ -1,5 +1,10 @@
ResourceLists.CorpusTextInfoList = class CorpusTextInfoList extends ResourceLists.ResourceList { class CorpusTextInfoList extends ResourceList {
static htmlClass = 'corpus-text-info-list';
static autoInit() {
for (let corpusTextInfoListElement of document.querySelectorAll('.corpus-text-info-list:not(.no-autoinit)')) {
new CorpusTextInfoList(corpusTextInfoListElement);
}
}
static defaultOptions = { static defaultOptions = {
page: 5 page: 5
@ -7,7 +12,7 @@ ResourceLists.CorpusTextInfoList = class CorpusTextInfoList extends ResourceList
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
let _options = Utils.mergeObjectsDeep( let _options = Utils.mergeObjectsDeep(
ResourceLists.CorpusTextInfoList.defaultOptions, CorpusTextInfoList.defaultOptions,
options options
); );
super(listContainerElement, _options); super(listContainerElement, _options);
@ -21,7 +26,7 @@ ResourceLists.CorpusTextInfoList = class CorpusTextInfoList extends ResourceList
get item() { get item() {
return (values) => { return (values) => {
return ` return `
<tr class="list-item hoverable"> <tr class="list-item clickable hoverable">
<td><span class="title"></span> (<span class="publishing_year"></span>)</td> <td><span class="title"></span> (<span class="publishing_year"></span>)</td>
<td><span class="num_tokens"></span></td> <td><span class="num_tokens"></span></td>
<td><span class="num_sentences"></span></td> <td><span class="num_sentences"></span></td>
@ -104,4 +109,4 @@ ResourceLists.CorpusTextInfoList = class CorpusTextInfoList extends ResourceList
clickedSortElement.style.color = '#aa9cc9'; clickedSortElement.style.color = '#aa9cc9';
clickedSortElement.innerHTML = clickedSortElement.classList.contains('asc') ? 'arrow_drop_down' : 'arrow_drop_up'; clickedSortElement.innerHTML = clickedSortElement.classList.contains('asc') ? 'arrow_drop_down' : 'arrow_drop_up';
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.CorpusTokenList = class CorpusTokenList extends ResourceLists.ResourceList { class CorpusTokenList extends ResourceList {
static htmlClass = 'corpus-token-list'; static autoInit() {
for (let corpusTokenListElement of document.querySelectorAll('.corpus-token-list:not(.no-autoinit)')) {
new CorpusTokenList(corpusTokenListElement);
}
}
static defaultOptions = { static defaultOptions = {
page: 7 page: 7
@ -7,7 +11,7 @@ ResourceLists.CorpusTokenList = class CorpusTokenList extends ResourceLists.Reso
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
let _options = Utils.mergeObjectsDeep( let _options = Utils.mergeObjectsDeep(
ResourceLists.CorpusTokenList.defaultOptions, CorpusTokenList.defaultOptions,
options options
); );
super(listContainerElement, _options); super(listContainerElement, _options);
@ -134,4 +138,4 @@ ResourceLists.CorpusTokenList = class CorpusTokenList extends ResourceLists.Reso
} }
} }
}; }

View File

@ -1,6 +1,4 @@
ResourceLists.DetailedPublicCorpusList = class DetailedPublicCorpusList extends ResourceLists.ResourceList { class DetailledPublicCorpusList extends CorpusList {
static htmlClass = 'detailed-public-corpus-list';
get item() { get item() {
return (values) => { return (values) => {
return ` return `
@ -70,4 +68,4 @@ ResourceLists.DetailedPublicCorpusList = class DetailedPublicCorpusList extends
'current-user-is-following': Object.values(corpus.corpus_follower_associations).some(association => association.follower.id === currentUserId) 'current-user-is-following': Object.values(corpus.corpus_follower_associations).some(association => association.follower.id === currentUserId)
}; };
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.JobInputList = class JobInputList extends ResourceLists.ResourceList { class JobInputList extends ResourceList {
static htmlClass = 'job-input-list'; static autoInit() {
for (let jobInputListElement of document.querySelectorAll('.job-input-list:not(.no-autoinit)')) {
new JobInputList(jobInputListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -86,4 +90,4 @@ ResourceLists.JobInputList = class JobInputList extends ResourceLists.ResourceLi
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.JobList = class JobList extends ResourceLists.ResourceList { class JobList extends ResourceList {
static htmlClass = 'job-list'; static autoInit() {
for (let jobListElement of document.querySelectorAll('.job-list:not(.no-autoinit)')) {
new JobList(jobListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -319,4 +323,4 @@ ResourceLists.JobList = class JobList extends ResourceLists.ResourceList {
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.JobResultList = class JobResultList extends ResourceLists.ResourceList { class JobResultList extends ResourceList {
static htmlClass = 'job-result-list'; static autoInit() {
for (let jobResultListElement of document.querySelectorAll('.job-result-list:not(.no-autoinit)')) {
new JobResultList(jobResultListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -111,4 +115,4 @@ ResourceLists.JobResultList = class JobResultList extends ResourceLists.Resource
} }
} }
} }
}; }

View File

@ -1,6 +1,4 @@
ResourceLists.PublicCorpusList = class PublicCorpusList extends ResourceLists.ResourceList { class PublicCorpusList extends CorpusList {
static htmlClass = 'public-corpus-list';
get item() { get item() {
return (values) => { return (values) => {
return ` return `
@ -54,4 +52,4 @@ ResourceLists.PublicCorpusList = class PublicCorpusList extends ResourceLists.Re
<ul class="pagination"></ul> <ul class="pagination"></ul>
`.trim(); `.trim();
} }
}; }

View File

@ -1,4 +1,31 @@
ResourceLists.ResourceList = class ResourceList { var ResourceLists = {};
ResourceLists.autoInit = () => {
for (let propertyName in ResourceLists) {
let property = ResourceLists[propertyName];
// Call autoInit of all properties that are subclasses of `ResourceLists.BaseList`.
// This does not include `ResourceLists.BaseList` itself.
if (property.prototype instanceof ResourceLists.BaseList) {
// Check if the static `htmlClass` property is defined.
if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class
// and do not have the `no-autoinit` class.
let listElements = document.querySelectorAll(`.${property.htmlClass}:not(.no-autoinit)`);
// Create an instance of this class for each display element.
for (let listElement of listElements) {new property(listElement);}
}
}
};
ResourceLists.defaultOptions = {
page: 5,
pagination: {
innerWindow: 2,
outerWindow: 2
}
};
ResourceLists.BaseList = class BaseList {
/* A wrapper class for the list.js list. /* A wrapper class for the list.js list.
* This class is not meant to be used directly, instead it should be used as * This class is not meant to be used directly, instead it should be used as
* a base class for concrete resource list implementations. * a base class for concrete resource list implementations.
@ -6,14 +33,6 @@ ResourceLists.ResourceList = class ResourceList {
static htmlClass; static htmlClass;
static defaultOptions = {
page: 5,
pagination: {
innerWindow: 2,
outerWindow: 2
}
};
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
if ('items' in options) { if ('items' in options) {
throw '"items" is not supported as an option, define it as a getter in the list class'; throw '"items" is not supported as an option, define it as a getter in the list class';
@ -23,7 +42,7 @@ ResourceLists.ResourceList = class ResourceList {
} }
let _options = Utils.mergeObjectsDeep( let _options = Utils.mergeObjectsDeep(
{item: this.item, valueNames: this.valueNames}, {item: this.item, valueNames: this.valueNames},
ResourceLists.ResourceList.defaultOptions, ResourceLists.defaultOptions,
options options
); );
this.listContainerElement = listContainerElement; this.listContainerElement = listContainerElement;

View File

@ -1,5 +1,9 @@
ResourceLists.SpaCyNLPPipelineModelList = class SpaCyNLPPipelineModelList extends ResourceLists.ResourceList { class SpaCyNLPPipelineModelList extends ResourceList {
static htmlClass = 'spacy-nlp-pipeline-model-list'; static autoInit() {
for (let spaCyNLPPipelineModelListElement of document.querySelectorAll('.spacy-nlp-pipeline-model-list:not(.no-autoinit)')) {
new SpaCyNLPPipelineModelList(spaCyNLPPipelineModelListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -216,4 +220,4 @@ ResourceLists.SpaCyNLPPipelineModelList = class SpaCyNLPPipelineModelList extend
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.TesseractOCRPipelineModelList = class TesseractOCRPipelineModelList extends ResourceLists.ResourceList { class TesseractOCRPipelineModelList extends ResourceList {
static htmlClass = 'tesseract-ocr-pipeline-model-list'; static autoInit() {
for (let tesseractOCRPipelineModelListElement of document.querySelectorAll('.tesseract-ocr-pipeline-model-list:not(.no-autoinit)')) {
new TesseractOCRPipelineModelList(tesseractOCRPipelineModelListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -225,4 +229,4 @@ ResourceLists.TesseractOCRPipelineModelList = class TesseractOCRPipelineModelLis
} }
} }
} }
}; }

View File

@ -1,5 +1,9 @@
ResourceLists.UserList = class UserList extends ResourceLists.ResourceList { class UserList extends ResourceList {
static htmlClass = 'user-list'; static autoInit() {
for (let userListElement of document.querySelectorAll('.user-list:not(.no-autoinit)')) {
new UserList(userListElement);
}
}
constructor(listContainerElement, options = {}) { constructor(listContainerElement, options = {}) {
super(listContainerElement, options); super(listContainerElement, options);
@ -97,4 +101,4 @@ ResourceLists.UserList = class UserList extends ResourceLists.ResourceList {
} }
} }
} }
}; }

View File

@ -1,4 +1,4 @@
ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.ResourceDisplay { ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.BaseDisplay {
static htmlClass = 'corpus-display'; static htmlClass = 'corpus-display';
constructor(displayElement) { constructor(displayElement) {

View File

@ -3,9 +3,9 @@ var ResourceDisplays = {};
ResourceDisplays.autoInit = () => { ResourceDisplays.autoInit = () => {
for (let propertyName in ResourceDisplays) { for (let propertyName in ResourceDisplays) {
let property = ResourceDisplays[propertyName]; let property = ResourceDisplays[propertyName];
// Call autoInit of all properties that are subclasses of `ResourceDisplays.ResourceDisplay`. // Call autoInit of all properties that are subclasses of `ResourceDisplays.BaseDisplay`.
// This does not include `ResourceDisplays.ResourceDisplay` itself. // This does not include `ResourceDisplays.BaseDisplay` itself.
if (property.prototype instanceof ResourceDisplays.ResourceDisplay) { if (property.prototype instanceof ResourceDisplays.BaseDisplay) {
// Check if the static `htmlClass` property is defined. // Check if the static `htmlClass` property is defined.
if (property.htmlClass === undefined) {return;} if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class // Gather all HTML elements that have the `this.htmlClass` class
@ -15,4 +15,4 @@ ResourceDisplays.autoInit = () => {
for (let displayElement of displayElements) {new property(displayElement);} for (let displayElement of displayElements) {new property(displayElement);}
} }
} }
}; }

View File

@ -1,4 +1,4 @@
ResourceDisplays.JobDisplay = class JobDisplay extends ResourceDisplays.ResourceDisplay { ResourceDisplays.JobDisplay = class JobDisplay extends ResourceDisplays.BaseDisplay {
static htmlClass = 'job-display'; static htmlClass = 'job-display';
constructor(displayElement) { constructor(displayElement) {

View File

@ -1,4 +1,4 @@
ResourceDisplays.ResourceDisplay = class ResourceDisplay { ResourceDisplays.BaseDisplay = class BaseDisplay {
static htmlClass; static htmlClass;
constructor(displayElement) { constructor(displayElement) {

View File

@ -1,18 +0,0 @@
var ResourceLists = {};
ResourceLists.autoInit = () => {
for (let propertyName in ResourceLists) {
let property = ResourceLists[propertyName];
// Call autoInit of all properties that are subclasses of `ResourceLists.ResourceList`.
// This does not include `ResourceLists.ResourceList` itself.
if (property.prototype instanceof ResourceLists.ResourceList) {
// Check if the static `htmlClass` property is defined.
if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class
// and do not have the `no-autoinit` class.
let listElements = document.querySelectorAll(`.${property.htmlClass}:not(.no-autoinit)`);
// Create an instance of this class for each display element.
for (let listElement of listElements) {new property(listElement);}
}
}
};

View File

@ -36,7 +36,7 @@
filters='rjsmin', filters='rjsmin',
output='gen/Forms.%(version)s.js', output='gen/Forms.%(version)s.js',
'js/forms/index.js', 'js/forms/index.js',
'js/forms/base-form.js', 'js/forms/form.js'
'js/forms/create-contribution-form.js', 'js/forms/create-contribution-form.js',
'js/forms/create-corpus-file-form.js', 'js/forms/create-corpus-file-form.js',
'js/forms/create-job-form.js' 'js/forms/create-job-form.js'
@ -48,7 +48,7 @@
filters='rjsmin', filters='rjsmin',
output='gen/resource-displays.%(version)s.js', output='gen/resource-displays.%(version)s.js',
'js/resource-displays/index.js', 'js/resource-displays/index.js',
'js/resource-displays/resource-display.js', 'js/resource-displays/base-display.js',
'js/resource-displays/corpus-display.js', 'js/resource-displays/corpus-display.js',
'js/resource-displays/job-display.js' 'js/resource-displays/job-display.js'
%} %}
@ -57,23 +57,22 @@
{%- assets {%- assets
filters='rjsmin', filters='rjsmin',
output='gen/resource-lists.%(version)s.js', output='gen/ResourceLists.%(version)s.js',
'js/resource-lists/index.js', 'js/ResourceLists/ResourceList.js',
'js/resource-lists/resource-list.js', 'js/ResourceLists/CorpusFileList.js',
'js/resource-lists/admin-user-list.js', 'js/ResourceLists/CorpusList.js',
'js/resource-lists/corpus-file-list.js', 'js/ResourceLists/PublicCorpusList.js',
'js/resource-lists/corpus-follower-list.js', 'js/ResourceLists/JobList.js',
'js/resource-lists/corpus-list.js', 'js/ResourceLists/JobInputList.js',
'js/resource-lists/corpus-text-info-list.js', 'js/ResourceLists/JobResultList.js',
'js/resource-lists/corpus-token-list.js', 'js/ResourceLists/SpacyNLPPipelineModelList.js',
'js/resource-lists/detailed-public-corpus-list.js', 'js/ResourceLists/TesseractOCRPipelineModelList.js',
'js/resource-lists/job-input-list.js', 'js/ResourceLists/UserList.js',
'js/resource-lists/job-list.js', 'js/ResourceLists/AdminUserList.js',
'js/resource-lists/job-result-list.js', 'js/ResourceLists/CorpusFollowerList.js',
'js/resource-lists/public-corpus-list.js', 'js/ResourceLists/CorpusTextInfoList.js',
'js/resource-lists/spacy-nlp-pipeline-model-list.js', 'js/ResourceLists/DetailledPublicCorpusList.js',
'js/resource-lists/tesseract-ocr-pipeline-model-list.js', 'js/ResourceLists/CorpusTokenList.js'
'js/resource-lists/user-list.js'
%} %}
<script src="{{ ASSET_URL }}"></script> <script src="{{ ASSET_URL }}"></script>
{%- endassets %} {%- endassets %}
@ -144,7 +143,7 @@
{alignment: 'right', constrainWidth: false, coverTrigger: false} {alignment: 'right', constrainWidth: false, coverTrigger: false}
); );
ResourceDisplays.autoInit(); ResourceDisplays.autoInit();
ResourceLists.autoInit(); ResourceList.autoInit();
Forms.autoInit(); Forms.autoInit();
// Display flashed messages // Display flashed messages

View File

@ -17,7 +17,7 @@
{{ super() }} {{ super() }}
<script> <script>
let corpusListElement = document.querySelector('#corpus-list'); let corpusListElement = document.querySelector('#corpus-list');
let corpusList = new ResourceLists.CorpusList(corpusListElement); let corpusList = new CorpusList(corpusListElement);
corpusList.add( corpusList.add(
[ [
{% for corpus in corpora %} {% for corpus in corpora %}

View File

@ -22,7 +22,7 @@
{{ super() }} {{ super() }}
<script> <script>
let adminUserListElement = document.querySelector('#admin-user-list'); let adminUserListElement = document.querySelector('#admin-user-list');
let adminUserList = new ResourceLists.AdminUserList(adminUserListElement); let adminUserList = new AdminUserList(adminUserListElement);
adminUserList.add( adminUserList.add(
[ [
{% for user in users %} {% for user in users %}

View File

@ -242,7 +242,7 @@
{{ super() }} {{ super() }}
<script> <script>
let publicCorpusFileList = new ResourceLists.CorpusFileList(document.querySelector('#corpus-file-list')); let publicCorpusFileList = new CorpusFileList(document.querySelector('#corpus-file-list'));
publicCorpusFileList.add( publicCorpusFileList.add(
[ [
{% for corpus_file in corpus.files %} {% for corpus_file in corpus.files %}
@ -259,7 +259,7 @@ refreshButton.addEventListener('click', () => {
{% endif %} {% endif %}
{% if cfr.has_permission('MANAGE_FOLLOWERS') %} {% if cfr.has_permission('MANAGE_FOLLOWERS') %}
let publicCorpusFollowerList = new ResourceLists.CorpusFollowerList(document.querySelector('.corpus-follower-list')); let publicCorpusFollowerList = new CorpusFollowerList(document.querySelector('.corpus-follower-list'));
publicCorpusFollowerList.add( publicCorpusFollowerList.add(
[ [
{% for cfa in cfas %} {% for cfa in cfas %}

View File

@ -62,7 +62,7 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script> <script>
let userList = new ResourceLists.UserList(document.querySelector('.user-list')); let userList = new UserList(document.querySelector('.user-list'));
userList.add( userList.add(
[ [
{% for user in users %} {% for user in users %}
@ -70,7 +70,7 @@
{% endfor %} {% endfor %}
] ]
); );
let publicCorpusList = new ResourceLists.PublicCorpusList(document.querySelector('.public-corpus-list')); let publicCorpusList = new PublicCorpusList(document.querySelector('.public-corpus-list'));
publicCorpusList.add( publicCorpusList.add(
[ [
{% for corpus in corpora %} {% for corpus in corpora %}

View File

@ -122,7 +122,7 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script> <script>
let followedCorpusList = new ResourceLists.PublicCorpusList(document.querySelector('.followed-corpus-list')); let followedCorpusList = new PublicCorpusList(document.querySelector('.followed-corpus-list'));
followedCorpusList.add( followedCorpusList.add(
[ [
{% for corpus in user.followed_corpora %} {% for corpus in user.followed_corpora %}
@ -132,7 +132,7 @@ followedCorpusList.add(
{% endfor %} {% endfor %}
] ]
); );
let publicCorpusList = new ResourceLists.PublicCorpusList(document.querySelector('.public-corpus-list')); let publicCorpusList = new PublicCorpusList(document.querySelector('.public-corpus-list'));
publicCorpusList.add( publicCorpusList.add(
[ [
{% for corpus in user.corpora %} {% for corpus in user.corpora %}