Skip to content

Commit 2049f3c

Browse files
authored
Add audio repeat and use Digitalkhatt script in segments (#740)
1 parent 9ef64d5 commit 2049f3c

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

app/controllers/surah_audio_files_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def save_segments
104104
timestamp_from: segment.timestamp_from,
105105
timestamp_to: segment.timestamp_to,
106106
segments: segment.segments,
107-
words: segment.verse.words.map(&:text_qpc_hafs)
107+
words: segment.verse.words.map(&:text_digital_khatt)
108108
}
109109
}
110110
}

app/javascript/segments/components/ActionBar.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,22 @@
203203
</label>
204204
</div>
205205

206+
<div class="flex items-center">
207+
<input
208+
type="checkbox"
209+
:checked="isLooingAyah"
210+
@change="loopAyah"
211+
id="repeat-ayah"
212+
class="w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
213+
/>
214+
<label for="repeat-ayah"
215+
class="ml-2 text-sm text-gray-700"
216+
data-controller="tooltip"
217+
title="If checked, player will keep repeating the current ayah instead of moving to the next one.">
218+
Repeat ayah
219+
</label>
220+
</div>
221+
206222
<div class="flex items-center">
207223
<input
208224
type="checkbox"

app/javascript/segments/components/Timeline.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ export default {
923923

924924
<style scoped>
925925
.timeline{
926-
font-family: qpc-hafs;
926+
font-family: digitalkhatt-v2;
927927
font-size: 15px;
928928
}
929929
.tl-word {

app/javascript/segments/components/Verse.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="flex flex-wrap">
33
<div class="w-full" v-if="segmentsLoaded">
4-
<div class="qpc-hafs flex flex-wrap gap-2 p-4 bg-gray-50 rounded-lg mb-6 sticky top-0 z-50 shadow-sm words">
4+
<div class="digitalkhatt-v2 flex flex-wrap gap-2 p-4 bg-gray-50 rounded-lg mb-6 sticky top-0 z-50 shadow-sm words">
55
<span
66
:id="index + 1"
77
:class="[this.getWordCssClass(index)]"
@@ -355,7 +355,7 @@
355355
</small>
356356
</td>
357357

358-
<td class="px-4 py-2 text-lg qpc-hafs">
358+
<td class="px-4 py-2 text-lg digitalkhatt-v2">
359359
{{ segmentText(segment) }}
360360
<small class="block text-[10px] text-gray-400 mt-0.5" v-if="segmentDuration(segment)">
361361
{{ segmentDuration(segment) }}

app/views/surah_audio_files/segments.json.jbuilder

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ json.segments do
1212
json.timestamp_from segment&.timestamp_from
1313
json.timestamp_to segment&.timestamp_to
1414
json.segments segment&.segments || []
15-
json.set! :words, verse.words.map(&:text_qpc_hafs)
15+
json.set! :words, verse.words.map(&:text_digital_khatt)
1616
end
1717
end
1818
end

0 commit comments

Comments
 (0)