diff options
| author | julian laplace <julescarbon@gmail.com> | 2023-10-11 00:00:06 +0200 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2023-10-11 00:00:06 +0200 |
| commit | d6b39cc6338bd5285581e75f25d3b2403b3593d8 (patch) | |
| tree | 7e73d7b365b3883993189207fcfb0caf730b4eef /public/assets/js/lib/views/stream | |
| parent | 0396aa163256d748897ba16d167e9c262233f49f (diff) | |
wav or aiff
Diffstat (limited to 'public/assets/js/lib/views/stream')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index 143dc92..7d8ac63 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -38,7 +38,7 @@ var HootStream = View.extend({ switch (event.target.className) { case "file": console.log(url.pathname); - if (url.pathname.match(/(mp3|wav|ogg|opus|flac)$/i)) { + if (url.pathname.match(/(mp3|wav|aiff?|ogg|opus|flac)$/i)) { event.preventDefault(); audio.play(event.target.dataset.index); // index set in audio.js } @@ -94,7 +94,7 @@ var HootStream = View.extend({ settings = JSON.parse(response.threads[0].settings); } catch (error) {} audio.index( - this.sortFiles(response.files, settings ? settings.sort : null) + this.sortFiles(response.files, settings ? settings.sort : null), ); audio.play(0); }); @@ -110,10 +110,10 @@ var HootStream = View.extend({ query: response.query, thread: response.threads, images: response.files.filter((file) => - file.filename.match(IMAGE_REGEXP) + file.filename.match(IMAGE_REGEXP), ), files: response.files.filter( - (file) => !file.filename.match(IMAGE_REGEXP) + (file) => !file.filename.match(IMAGE_REGEXP), ), comments: response.comments, }; @@ -121,7 +121,7 @@ var HootStream = View.extend({ $(event.target).closest(".thread").replaceWith($thread); this.state.threadLookup[thread] = expandedThread; this.state.expandedThreads[thread] = true; - }.bind(this) + }.bind(this), ); }, @@ -250,7 +250,7 @@ var HootStream = View.extend({ .sort( filters.order === "asc" ? (a, b) => a[0].localeCompare(b[0]) - : (a, b) => b[0].localeCompare(a[0]) + : (a, b) => b[0].localeCompare(a[0]), ) .map(([, thread_id]) => ({ type: "thread", @@ -288,7 +288,7 @@ var HootStream = View.extend({ if ( (filters.images && thread.images.length) || thread.comments.some((comment) => - CONTAINS_IMAGE_URL_REGEXP.test(comment.comment) + CONTAINS_IMAGE_URL_REGEXP.test(comment.comment), ) ) { return true; @@ -316,7 +316,7 @@ var HootStream = View.extend({ ? thread.comments : filters.images ? thread.comments.filter((comment) => - CONTAINS_IMAGE_URL_REGEXP.test(comment.comment) + CONTAINS_IMAGE_URL_REGEXP.test(comment.comment), ) : [], query: data.query, @@ -328,7 +328,7 @@ var HootStream = View.extend({ ) { return this.renderThread(threadData).reduce( ($el, $item) => $el.append($item), - $("<div class='thread'>") + $("<div class='thread'>"), ); } else { return $(); @@ -339,7 +339,7 @@ var HootStream = View.extend({ : type === "lastlog" ? this.renderLastlog(itemData) : "Unknown item"; - }.bind(this) + }.bind(this), ); this.$hootevents.empty(); this.$el.toggleClass("streamThread", !!data.query.thread); @@ -361,7 +361,7 @@ var HootStream = View.extend({ const rendered = Object.entries(object).reduce( (newTemplate, [key, value]) => newTemplate.replace(new RegExp(`{{${key}}}`, "g"), value), - template + template, ); return $(rendered); }, @@ -439,7 +439,7 @@ var HootStream = View.extend({ const thread_opacity = clamp( get_age_opacity(thread.lastmodified) + 0.2, 0.0, - 1.0 + 1.0, ); const hasAudio = files.some((file) => AUDIO_REGEXP.test(file.filename)); @@ -448,7 +448,7 @@ var HootStream = View.extend({ .map((image) => [image, new RegExp(encodeURIComponent(image.filename))]) .filter( ([, filenameRegexp]) => - !comments.some((comment) => filenameRegexp.test(comment.comment)) + !comments.some((comment) => filenameRegexp.test(comment.comment)), ) .map(([image]) => image); @@ -477,7 +477,7 @@ var HootStream = View.extend({ .filter((action) => !!action) .map( ({ action, icon, label }) => - `<div class="action" data-action="${action}" title="${label}">${icon}</div>` + `<div class="action" data-action="${action}" title="${label}">${icon}</div>`, ) .join(""); @@ -519,7 +519,7 @@ var HootStream = View.extend({ lines: 5, snippetSize: 512, cropSize: 256, - }) + }), ), className: "first_post", }; @@ -533,7 +533,7 @@ var HootStream = View.extend({ lines: 1, snippetSize: 256, cropSize: 128, - }) + }), ) : comments .slice(1) @@ -544,7 +544,7 @@ var HootStream = View.extend({ lines: 1, snippetSize: 256, cropSize: 128, - }) + }), ), }; @@ -697,6 +697,6 @@ var HootStream = View.extend({ } return { threadLookup, order }; }, - { threadLookup: {}, order: [] } + { threadLookup: {}, order: [] }, ), }); |
