Skip to content

Commit

Permalink
Support Display Options settings
Browse files Browse the repository at this point in the history
Add Larivaar support
Pull latest HTML
  • Loading branch information
navdeepsinghkhalsa committed Apr 21, 2017
1 parent d3f5786 commit 600e3c5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion www/core
Submodule core updated from 78ee45 to 41715a
3 changes: 3 additions & 0 deletions www/js/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"display-translation": true,
"display-transliteration": true,
"display-teeka": true
},
"display-options": {
"larivaar": false
}
}
},
Expand Down
15 changes: 14 additions & 1 deletion www/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,24 @@ module.exports = {
if (rows.length > 0) {
const cards = [];
rows.forEach((row) => {
const gurmukhiShabads = row.Gurmukhi.split(' ');
let taggedGurmukhi = '';
gurmukhiShabads.forEach((val) => {
let tag;
if (val.indexOf(']') !== -1) {
tag = 'i';
} else {
tag = 'span';
}
taggedGurmukhi += `<${tag}>${val}${tag === 'i' ? ' ' : ''}</${tag}> `;
});
const gurmukhiContainer = document.createElement('div');
gurmukhiContainer.innerHTML = taggedGurmukhi;
cards.push(
h(
`div#slide${row.ID}.slide${row.ID === lineID ? '.active' : ''}`,
[
h('h1.gurbani.gurmukhi', row.Gurmukhi),
h('h1.gurbani.gurmukhi', gurmukhiContainer),
h('h2.translation', row.English),
h('h2.transliteration', row.Transliteration),
h('h2.teeka', row.PunjabiUni),
Expand Down
19 changes: 19 additions & 0 deletions www/src/scss/viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ h2 {
font-size: 9vh;
font-weight: normal;
line-height: 1.3em;

i {
font-style: normal;
}
}

.larivaar {
.gurbani {
div {
font-size: 0;
}

i,
span {
font-size: 9vh;
vertical-align: bottom;
white-space: nowrap;
}
}
}

.translation,
Expand Down

0 comments on commit 600e3c5

Please sign in to comment.