Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5007d5d
Mobile landing page (#419)
mmahalwy Jul 31, 2016
2f3c32c
Fix build issue with babel-preset-es2015
ahmedre Aug 6, 2016
6865cda
Merge pull request #421 from quran/fix_build
ahmedre Aug 6, 2016
223fe89
guide updated
Aug 6, 2016
8f92662
Merge pull request #422 from mahboob-awan/fix/contributing_guide
ahmedre Aug 6, 2016
663d46c
Feature/refactor redux (#414)
thabti Aug 6, 2016
73a471a
Babel fixes
Aug 6, 2016
b991953
extract problem
mmahalwy Aug 6, 2016
291dd62
fix this time
mmahalwy Aug 6, 2016
e3b5340
Okay now.
mmahalwy Aug 6, 2016
79dc129
Merge pull request #423 from quran/babel-presets
ahmedre Aug 6, 2016
a705e29
Mobile page updates (#424)
mmahalwy Aug 6, 2016
834de9f
Fixes #411 - Repeat range bug (#425)
mmahalwy Aug 6, 2016
7487f12
Fixes #400 Developer page (#426)
mmahalwy Aug 6, 2016
3aad967
Upgrade express to the stable version (#433)
ahmedre Aug 7, 2016
dda7f09
https all the things (#434)
ahmedre Aug 8, 2016
33396b5
Bump node version (#431)
mmahalwy Aug 8, 2016
08d46c0
Remove svg fonts (#432)
ahmedre Aug 8, 2016
30b86db
Update README.md
thabti Aug 9, 2016
5b9105c
Merge pull request #441 from quran/readme-spelling
thabti Aug 10, 2016
9a2f0b1
duplicate declaration
infacq Aug 10, 2016
e0820ac
Merge pull request #442 from infacq/patch-1
thabti Aug 10, 2016
8e703f1
Let pm2 automagically choose the number of workers (#446)
ahmedre Aug 13, 2016
3c40c6d
Fixes 438 (#448)
mmahalwy Aug 14, 2016
a1d6d7a
Fix bootstrap.config
mmahalwy Aug 15, 2016
35ede18
Simplify audio and segments building (#451)
ahmedre Aug 17, 2016
219920b
Formatting issue corrected and tiny typo (#452)
UmanShahzad Aug 17, 2016
0715e53
Remove supported check for audio (#453)
ahmedre Aug 18, 2016
c20c5ec
Fix formatting of code blocks (#454)
ahmedelgabri Aug 20, 2016
cbc85c2
pure-components + tests
thabti Aug 13, 2016
fddac56
pure-components + tests
thabti Aug 14, 2016
4c40801
moved components to components folder.
thabti Aug 14, 2016
fe05b5d
folder level + merge with master
thabti Aug 16, 2016
3ac5cd8
ensure error routes give a 404 status.
thabti Aug 20, 2016
2ce60fe
renderTopOption as a component + tests
thabti Aug 21, 2016
eaf69f3
pure-components + tests
thabti Aug 13, 2016
b24c9ac
pure-components + tests
thabti Aug 14, 2016
36e661c
moved components to components folder.
thabti Aug 14, 2016
69f9413
folder level + merge with master
thabti Aug 16, 2016
ae9cb74
remove decorators for search
thabti Aug 21, 2016
015b72f
fixes #458 (#459)
thabti Aug 21, 2016
61edf3c
fix some of the suggestions
thabti Aug 21, 2016
61d999d
fix some of the suggestions
thabti Aug 21, 2016
dd11270
Merge pull request #450 from sabeurthabti/feature/pure-components
thabti Aug 22, 2016
b58ad51
Sort language in dropdown alphabetically (#462)
haritsE Aug 26, 2016
661f5ab
Get rid of Bootstrap tooltip & use a CSS tooltip
ahmedelgabri Aug 27, 2016
85980d6
Fix path for config
ahmedelgabri Aug 27, 2016
e37284f
Remove ranges & cleanup excutable paths
ahmedelgabri Aug 27, 2016
7d54e6b
fix indentation
ahmedelgabri Aug 27, 2016
53abaae
Linter fixes for webpack folder & bootstrap config
ahmedelgabri Aug 27, 2016
bdea549
Merge pull request #464 from ahmedelgabri/remove-bootstrap-tooltips
thabti Aug 27, 2016
2c53a21
make sure new npm isntallations will not use ranges
ahmedelgabri Aug 27, 2016
1c66231
tooltip content is always ltr
ahmedelgabri Aug 27, 2016
31bac53
Merge pull request #465 from ahmedelgabri/remove-bootstrap-tooltips
thabti Aug 27, 2016
a36cd79
Update node-sass
ahmedelgabri Aug 27, 2016
5675c6f
Update travis Node version
ahmedelgabri Aug 27, 2016
16f59c8
normalize paths in package.json
ahmedelgabri Aug 28, 2016
83caa1c
make test.sh executable & update env shebang
ahmedelgabri Aug 28, 2016
361c042
Remove npm install noise on CI, etc...
ahmedelgabri Aug 28, 2016
6f0b28d
remove duplicate phantomjs package 😱
ahmedelgabri Aug 28, 2016
54e4373
add comment in .travis.yml for .nvmrc usage
ahmedelgabri Aug 28, 2016
2d311a6
Update Karma & Karma-webpack to fix jenkins error
ahmedelgabri Aug 28, 2016
d06fdd3
missing segment fix (#467)
thabti Aug 29, 2016
3d65508
Merge master & fix conflict
ahmedelgabri Aug 29, 2016
1ec1a9b
Update packages to match production & remove old babel package
ahmedelgabri Aug 29, 2016
5e39c87
multi-purpose function
thabti Aug 27, 2016
f852044
fix unit tests
thabti Aug 28, 2016
67b932f
fix Sentry issues:
thabti Aug 29, 2016
7f57ba1
Merge pull request #466 from ahmedelgabri/code-cleanup
thabti Aug 29, 2016
7094284
Merge pull request #469 from sabeurthabti/feature/sentry-bugs
thabti Aug 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { syncHistoryWithStore } from 'react-router-redux';

import debug from 'debug';

import config from 'config';
import config from './config';
import ApiClient from './helpers/ApiClient';
import createStore from './redux/create';
import routes from './routes';
Expand All @@ -40,16 +40,6 @@ window.clearCookies = () => {
reactCookie.remove('isFirstTime');
};

// Init tooltip
if (typeof window !== 'undefined') {
$(() => {
$(document.body).tooltip({
selector: '[data-toggle="tooltip"]',
animation: false
});
});
}

match({ history, routes: routes() }, (error, redirectLocation, renderProps) => {
const component = (
<Router
Expand Down
2 changes: 2 additions & 0 deletions src/components/Audioplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export class Audioplayer extends Component {

renderPreviousButton() {
const { currentAyah, files } = this.props;
if (!files) return false;
const index = Object.keys(files).findIndex(id => id === currentAyah);

return (
Expand All @@ -358,6 +359,7 @@ export class Audioplayer extends Component {

renderNextButton() {
const { surah, currentAyah } = this.props;
if (!surah) return false;
const isEnd = surah.ayat === parseInt(currentAyah.split(':')[1], 10);

return (
Expand Down
20 changes: 9 additions & 11 deletions src/components/Ayah/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import debug from '../../helpers/debug';

const styles = require('./style.scss');

/* eslint-disable no-unused-vars */
const CHAR_TYPE_WORD = 1;
const CHAR_TYPE_END = 2; // eslint-disable-line no-unused-vars
const CHAR_TYPE_PAUSE = 3; // eslint-disable-line no-unused-vars
const CHAR_TYPE_RUB = 4; // eslint-disable-line no-unused-vars
const CHAR_TYPE_SAJDAH = 5; // eslint-disable-line no-unused-vars
const CHAR_TYPE_END = 2;
const CHAR_TYPE_PAUSE = 3;
const CHAR_TYPE_RUB = 4;
const CHAR_TYPE_SAJDAH = 5;
/* eslint-enable no-unused-vars */

export default class Ayah extends Component {
static propTypes = {
Expand Down Expand Up @@ -92,7 +94,7 @@ export default class Ayah extends Component {
let position = -1;
let text = ayah.words.map(word => {
let id = null;
const className = `${word.className} ${word.highlight && word.highlight}`;
const className = `${word.className} ${word.highlight ? word.highlight : ''}`;

if (word.charTypeId === CHAR_TYPE_WORD) {
position = position + 1;
Expand All @@ -110,12 +112,8 @@ export default class Ayah extends Component {
id={id}
onClick={(event) => onWordClick(event.target.dataset.key)}
data-key={`${word.ayahKey}:${position}`}
className={`${className} pointer`}
data-toggle="tooltip"
data-trigger="hover"
data-placement="top"
data-original-title={tooltipContent}
title={tooltipContent}
className={`${className} ${styles.Tooltip}`}
aria-label={tooltipContent}
dangerouslySetInnerHTML={{__html: word.code}}
/>
);
Expand Down
10 changes: 6 additions & 4 deletions src/components/Ayah/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../../styles/variables.scss';
@import '../../styles/variables';
@import '../../styles/partials/_tooltip';

.container{
padding: 2.5% 0%;
Expand Down Expand Up @@ -84,7 +85,7 @@
color: #000;
width: 100%;
overflow-wrap: break-word;
line-height: 150%;
line-height: 1.5;
word-break: break-all;
text-align: right;
float: left;
Expand All @@ -101,9 +102,10 @@
}

.line{
direction: rtl;
b{
float: none;
display: inline;
display: inline-block;
}
}

Expand All @@ -114,7 +116,7 @@
color: #000;
&:hover{
color: $brand-primary;
cursor: pointer;
cursor: help;
}
&:focus{
color: $brand-primary-darker-10;
Expand Down
7 changes: 2 additions & 5 deletions src/components/Line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ export default class Line extends React.Component {
return (
<b
key={`${word.pageNum}${word.lineNum}${word.position}${word.code}`}
className={`${word.className} pointer`}
data-toggle="tooltip"
className={`${word.className} ${styles.Tooltip}`}
data-ayah={word.ayahKey}
data-line={word.lineNun}
data-page={word.pageNum}
data-position={word.position}
data-placement="top"
data-origin-title={tooltipContent}
title={tooltipContent}
aria-label={tooltipContent}
dangerouslySetInnerHTML={{__html: word.code}}
/>
);
Expand Down
6 changes: 4 additions & 2 deletions src/components/TopOptions/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ describe("<TopOptions />", () => {
};

const actions = {
setOption: () => {},
toggleReadingMode: () => {}
options: {
setOption: () => {},
toggleReadingMode: () => {}
}
};

const component = shallow(<TopOptions
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/buildAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export function buildAudioForAyah(audio) {
if (audio.url) {
scopedAudio.src = audio.url;
segments = audio.encryptedSegments;
return { audio: scopedAudio, segments };
}

if (audio.mp3) {
scopedAudio.src = audio.mp3.url;
segments = audio.mp3.encryptedSegments;
return { audio: scopedAudio, segments };
}

return { audio: scopedAudio, segments };
Expand Down
11 changes: 5 additions & 6 deletions src/redux/modules/audioplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ export default function reducer(state = initialState, action = {}) {
}
case SET_CURRENT_WORD: {
if (!action.word) return state;

const [surahId, ayahNum, word] = action.word.split(':');
let currentTime = null;

if (state.files[surahId][`${surahId}:${ayahNum}`] === state.currentFile) {
const [surahId, ayahNum, word] = action.word.split(':');
const nextId = `${surahId}:${ayahNum}`;
if (!state.segments[surahId][nextId]) return state;
if (state.files[surahId][nextId] === state.currentFile) {
// When the files are the same, set the current time to that word
currentTime = state.segments[surahId][`${surahId}:${ayahNum}`].words[word].startTime;
currentTime = state.segments[surahId][nextId].words[word].startTime;
state.currentFile.currentTime = currentTime; // eslint-disable-line no-param-reassign

return {
Expand All @@ -256,7 +256,6 @@ export default function reducer(state = initialState, action = {}) {
}

// When the files are not the same.
const nextId = `${surahId}:${ayahNum}`;
const currentFile = state.files[surahId][nextId];
const segment = buildSegments(state.segments[surahId][nextId]);
currentTime = segment.words[word].startTime;
Expand Down
46 changes: 40 additions & 6 deletions src/styles/partials/_tooltip.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
.tooltip{
font-size: 16px;
font-weight: 300;
@extend .montserrat;
.Tooltip {
position: relative;

.tooltip-inner{
padding: 10px 15px;
&:after {
content: attr(aria-label);
direction: ltr;
padding: .625rem .9375rem;
position: absolute;
bottom: 100%;
left: 50%;
transform: translate(-50%, 0);
font-family: Montserrat, sans-serif;
font-weight: 300;
font-size: 1.25rem;
line-height: 1.2;
background-color: $tooltip-bg;
color: #fff;
border-radius: 3px;
opacity: 0;
}

// The arrow
&:before {
content: '';
position: absolute;
left: 50%;
transform: translate(-50%, 0);
width: 0;
height: 0;
border-left: .75rem solid transparent;
border-right: .75rem solid transparent;
border-top: .75rem solid $tooltip-bg;
opacity: 0;
}


&:hover {
&:after,
&:before {
opacity: 1;
}
}
}