markdownr 0.6.16 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,22 @@
1
1
  <style>
2
+ /* Word highlight during verse audio playback */
3
+ .word.audio-playing {
4
+ background: #fef08a;
5
+ border-radius: 3px;
6
+ transition: background 0.15s ease;
7
+ }
8
+
9
+ /* Interlinear translit-link with dictionary definition available */
10
+ .word[data-popup-url] .translit-link {
11
+ color: #7b3fa0;
12
+ text-decoration: underline dotted #b07fd4 1px;
13
+ text-underline-offset: 2px;
14
+ }
15
+ .word[data-popup-url] .translit-link:hover {
16
+ color: #5a2c78;
17
+ text-decoration: underline solid #5a2c78 1px;
18
+ }
19
+
2
20
  /* Bible Gateway citation links */
3
21
  a[href*="biblegateway.com"],
4
22
  a[href*="scrip.risensavior.com"] {
@@ -197,6 +215,26 @@
197
215
  .link-ctx-popup-body th, .link-ctx-popup-body td { border: 1px solid #ddd; padding: 0.3rem 0.5rem; }
198
216
  .link-ctx-popup-body th { background: #f5f0e4; }
199
217
 
218
+ /*
219
+ * Reset interlinear .verse flex layout back to inline for passage popups.
220
+ * Interlinear pages define .verse { display: flex; border-bottom: ... } which
221
+ * would break inline passage content rendered inside a popup.
222
+ */
223
+ .link-ctx-popup-body .verse { display: inline; flex-wrap: initial; align-items: initial; gap: initial; margin: 0; padding: 0; border-bottom: none; }
224
+
225
+ /*
226
+ * Substitution mode for popups: force translation-only.
227
+ * The source CSS uses body.show-t / body.show-l / etc. to toggle modes, but
228
+ * those body classes leak into popup content. Override with !important to
229
+ * ensure only the translation span is visible inside popups.
230
+ */
231
+ .link-ctx-popup-body .subst-x { display: inline !important; color: #1a5276; font-style: italic; }
232
+ .link-ctx-popup-body .subst-t,
233
+ .link-ctx-popup-body .subst-l,
234
+ .link-ctx-popup-body .subst-o,
235
+ .link-ctx-popup-body .subst-p,
236
+ .link-ctx-popup-body .subst-s { display: none !important; }
237
+
200
238
  /* Blue Letter Bible popup tables */
201
239
  .blb-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 0.6rem; }
202
240
  .blb-table th, .blb-table td { padding: 3px 7px; border: 1px solid #ddd; }
@@ -739,6 +777,12 @@
739
777
  if (!m) return false;
740
778
  var audioUrl = 'https://www.studylight.org/multi-media/audio/lexicons/eng/' + m[1] + '.html?n=' + m[2];
741
779
  if (!anchor._slAudio) anchor._slAudio = new Audio(audioUrl);
780
+ var wordEl = anchor.closest('.word');
781
+ if (wordEl) {
782
+ wordEl.classList.add('audio-playing');
783
+ anchor._slAudio.onended = function() { wordEl.classList.remove('audio-playing'); };
784
+ anchor._slAudio.onerror = function() { wordEl.classList.remove('audio-playing'); };
785
+ }
742
786
  anchor._slAudio.currentTime = 0;
743
787
  anchor._slAudio.play();
744
788
  return true;
@@ -1005,6 +1049,15 @@
1005
1049
  });
1006
1050
  })();
1007
1051
 
1052
+ // Rewrite translit-link hrefs for words with dictionary definitions
1053
+ // so the existing popup system uses the dictionary URL instead of BLB
1054
+ (function() {
1055
+ document.querySelectorAll('.word[data-popup-url]').forEach(function(word) {
1056
+ var link = word.querySelector('.translit-link');
1057
+ if (link) link.setAttribute('href', word.dataset.popupUrl);
1058
+ });
1059
+ })();
1060
+
1008
1061
  })();
1009
1062
 
1010
1063
  // Full-page verse highlighting from URL hash (#vN or #vN-M)
@@ -1063,14 +1116,14 @@
1063
1116
  var words = verse.querySelectorAll('.word');
1064
1117
  if (!words.length) return;
1065
1118
 
1066
- // Collect audio URLs for all words in this verse
1067
- var urls = [];
1119
+ // Collect audio URLs paired with their word elements
1120
+ var items = [];
1068
1121
  words.forEach(function(w) {
1069
1122
  var link = w.querySelector('.pronunc-link');
1070
1123
  var url = audioUrlFromLink(link);
1071
- if (url) urls.push(url);
1124
+ if (url) items.push({ word: w, url: url });
1072
1125
  });
1073
- if (!urls.length) return;
1126
+ if (!items.length) return;
1074
1127
 
1075
1128
  // Create a column-flex container to replace the bare verse-num,
1076
1129
  // with the number at top (row 1) and speaker icon at row 5
@@ -1093,16 +1146,15 @@
1093
1146
  btn.style.cssText = 'background:none;border:none;cursor:pointer;padding:0;font-size:1em;line-height:1;opacity:0.6;';
1094
1147
  btn.addEventListener('mouseleave', function() { if (!btn._playing) btn.style.opacity = '0.6'; });
1095
1148
 
1096
- var audioCache = [];
1097
1149
  var preloaded = false;
1098
1150
  function preloadAll() {
1099
1151
  if (preloaded) return;
1100
1152
  preloaded = true;
1101
- urls.forEach(function(u) {
1102
- var a = new Audio(u);
1153
+ items.forEach(function(item) {
1154
+ var a = new Audio(item.url);
1103
1155
  a.preload = 'auto';
1104
1156
  a.load();
1105
- audioCache.push(a);
1157
+ item.audio = a;
1106
1158
  });
1107
1159
  }
1108
1160
  // Start preloading on hover so audio is ready before click
@@ -1119,16 +1171,21 @@
1119
1171
 
1120
1172
  var i = 0;
1121
1173
  function playNext() {
1122
- if (i >= audioCache.length) {
1174
+ if (i >= items.length) {
1123
1175
  btn._playing = false;
1124
1176
  btn.style.opacity = '0.6';
1125
1177
  return;
1126
1178
  }
1127
- var audio = audioCache[i];
1128
- audio.currentTime = 0;
1129
- audio.onended = function() { i++; playNext(); };
1130
- audio.onerror = function() { i++; playNext(); };
1131
- audio.play().catch(function() { i++; playNext(); });
1179
+ var item = items[i];
1180
+ item.word.classList.add('audio-playing');
1181
+ item.audio.currentTime = 0;
1182
+ var advance = function() {
1183
+ item.word.classList.remove('audio-playing');
1184
+ i++; playNext();
1185
+ };
1186
+ item.audio.onended = advance;
1187
+ item.audio.onerror = advance;
1188
+ item.audio.play().catch(advance);
1132
1189
  }
1133
1190
  playNext();
1134
1191
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdownr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.16
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
@@ -105,8 +105,15 @@ files:
105
105
  - bin/markdownr
106
106
  - lib/markdown_server.rb
107
107
  - lib/markdown_server/app.rb
108
+ - lib/markdown_server/helpers/admin_helpers.rb
109
+ - lib/markdown_server/helpers/fetch_helpers.rb
110
+ - lib/markdown_server/helpers/formatting_helpers.rb
111
+ - lib/markdown_server/helpers/markdown_helpers.rb
112
+ - lib/markdown_server/helpers/path_helpers.rb
113
+ - lib/markdown_server/helpers/search_helpers.rb
108
114
  - lib/markdown_server/plugin.rb
109
115
  - lib/markdown_server/plugins/bible_citations/citations.rb
116
+ - lib/markdown_server/plugins/bible_citations/helpers.rb
110
117
  - lib/markdown_server/plugins/bible_citations/plugin.rb
111
118
  - lib/markdown_server/version.rb
112
119
  - views/admin_login.erb