Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

Commit ff5489b

Browse files
ahmedremmahalwy
authored andcommitted
Merge master into production (#436)
* Mobile landing page (#419) * Fix build issue with babel-preset-es2015 babel-preset-es2015 6.13.1 causes issues with babel-preset-es2015-webpack, so this freezes the dependency of babel-preset-es2105 to 6.9.0. * guide updated * Feature/refactor redux (#414) * refactoring the redux structure to something more standard. * ayahs actions/reducers * SURAHS actions/reducers * search action * options and fontface actions * lowercase the file names * rename actions/actionTypes * isLoaded is now a helper function, added audioplayer * fix * action unit tests * Babel fixes * extract problem * fix this time * Okay now. * Mobile page updates (#424) * Mobile page updates * smaller * fix * Fixes #411 - Repeat range bug (#425) * Fixes #400 Developer page (#426) * Upgrade express to the stable version (#433) Express 4.3.2, which we use, has a vulnerability. The stable version should not have this vulnerability (the version we are using is from 2014, whereas the stable one was just updated in June of this year). * https all the things (#434) * Bump node version (#431) * Remove svg fonts (#432) This patch removes svg fonts, since browsers are dropping support for svg fonts, and, furthermore, these fonts don't actually work at the moment. Fixes #429.
1 parent ed1049e commit ff5489b

File tree

659 files changed

+694
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

659 files changed

+694
-383
lines changed

CONTRIBUTING.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
2626
# Install the tools necessary for development
2727
npm install
2828
```
29+
2. Pull latest changes from "upstream" and push these changes to your "origin"(forked)
30+
> NOTE - This step will repeat every time You plan to contribute
2931

30-
2. Create a branch for your feature or fix:
32+
```bash
33+
# Pull latest changes from "upstream" repository
34+
git pull upstream master
35+
#Push latest changes to Your "origin" repository
36+
git push origin master
37+
```
38+
3. Create a branch for your feature or fix:
3139
```bash
3240
# Move into a new branch for a feature
3341
git checkout -b feature/thing
@@ -37,7 +45,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
3745
git checkout -b fix/something
3846
```
3947

40-
3. Be sure your code follows our practices.
48+
4. Be sure your code follows our practices.
4149
```bash
4250
# Test current code
4351
npm run test
@@ -49,7 +57,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
4957
nightwatch --test tests/functional/specs/Index_spec.js
5058
```
5159

52-
4. To create a PR you need to push your branch to the origin(forked) remote and then press some buttons on GitHub:
60+
5. To create a PR you need to push your branch to the origin(forked) remote and then press some buttons on GitHub:
5361
```bash
5462
# Push a feature branch
5563
git push -u origin feature/thing
@@ -61,7 +69,7 @@ Pull requests are the greatest contributions, so be sure they are focused in sco
6169

6270
This will create the branch on your GitHub project. The ```-u``` flag links this branch with the remote one, so that in the future, you can simply type ```git push origin```.
6371

64-
5. Now [open a pull request] with a clear title and description.
72+
6. Now [open a pull request] with a clear title and description.
6573

6674
## Sever-side integration
6775
Unless you have the backend API running locally, you will need to update the `API_URL`, in `development.env` file, from `localhost` to `api.quran.com`. Leave the port number same.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:5.10.0
1+
FROM node:6.3
22

33
ENV NODE_ENV production
44
ENV API_URL http://api.quran.com:3000

bootstrap.config.prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const bootstrapConfig = require('./bootstrap.config.js');
22
const ExtractTextPlugin = require('extract-text-webpack-plugin');
3-
bootstrapConfig.styleLoader = ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader');
3+
bootstrapConfig.styleLoader = ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader'});
44
module.exports = bootstrapConfig;

package.json

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
"name": "quran",
33
"version": "1.0.0",
44
"private": false,
5+
"repository": "https://github.com/quran/quran.com-frontend",
56
"scripts": {
67
"test": "npm run test:dev:unit",
7-
"test:ci:unit": "./node_modules/karma/bin/karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
8+
"test:ci:unit": "karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
89
"test:ci:functional": "BROWSER=phantomjs bash tests/functional/test.sh start-ci",
910
"posttest:ci:functional": "bash tests/functional/test.sh stop",
10-
"test:ci:unit": "karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
11-
"test:dev:unit": "karma start",
12-
"test:ci:lint": "eslint ./src/**/*.js",
1311
"test:dev:unit": "./node_modules/karma/bin/karma start",
12+
"test:ci:lint": "eslint ./src/**/*.js",
1413
"test:dev:functional": "BROWSER=chrome bash tests/functional/test.sh start",
1514
"posttest:dev:functional": "bash tests/functional/test.sh stop",
16-
"test:dev:lint": "eslint ./src/scripts/**/*.js",
17-
"test:stylelint": "stylelint './src/**/*.scss' --config webpack/.stylelintrc",
15+
"test:dev:lint": "node_modules/eslint/bin/eslint.js ./src/scripts/**/*.js",
16+
"test:stylelint": "node_modules/stylelint/dist/cli.js './src/**/*.scss' --config webpack/.stylelintrc",
1817
"dev": "node webpack/dev-server.js & PORT=8000 node start.js",
1918
"start": "NODE_PATH=\"./src\" node ./start",
2019
"build": "node ./node_modules/webpack/bin/webpack.js --config webpack/prod.config.js",
@@ -23,12 +22,13 @@
2322
"analyze:json": "webpack-bundle-size-analyzer bundle-stats.json"
2423
},
2524
"engines": {
26-
"node": ">= 5.1.0"
25+
"node": ">= 6.3.0"
2726
},
2827
"dependencies": {
2928
"app-module-path": "^1.0.2",
3029
"autoprefixer-loader": "^3.1.0",
3130
"babel": "^6.5.2",
31+
"babel-core": "^6.13.2",
3232
"babel-loader": "^6.2.4",
3333
"babel-plugin-add-module-exports": "^0.1.4",
3434
"babel-plugin-system-import-transformer": "^2.0.0",
@@ -37,12 +37,11 @@
3737
"babel-plugin-transform-runtime": "^6.7.5",
3838
"babel-plugin-typecheck": "^3.8.0",
3939
"babel-polyfill": "^6.7.4",
40-
"babel-preset-es2015": "^6.6.0",
41-
"babel-preset-es2015-webpack": "^6.4.1",
40+
"babel-preset-es2015": "^6.13.2",
4241
"babel-preset-react": "^6.5.0",
4342
"babel-preset-stage-0": "^6.5.0",
44-
"babel-register": "^6.7.2",
45-
"babel-runtime": "^6.6.1",
43+
"babel-register": "^6.11.6",
44+
"babel-runtime": "^6.11.6",
4645
"body-parser": "^1.14.1",
4746
"bootstrap-loader": "^1.0.10",
4847
"bootstrap-sass": "~3.3.1",
@@ -59,10 +58,10 @@
5958
"debug": "^2.2.0",
6059
"dotenv": "^1.2.0",
6160
"errorhandler": "^1.4.2",
62-
"express": "^4.3.2",
61+
"express": "~4.14.0",
6362
"express-state": "^1.2.0",
6463
"express-useragent": "^0.2.0",
65-
"extract-text-webpack-plugin": "^1.0.1",
64+
"extract-text-webpack-plugin": "2.0.0-beta.3",
6665
"file-loader": "^0.8.4",
6766
"fontfaceobserver": "^1.7.1",
6867
"html-webpack-plugin": "^1.4.0",
@@ -107,17 +106,16 @@
107106
"superagent": "^1.2.0",
108107
"url": "^0.11.0",
109108
"url-loader": "~0.5.5",
110-
"webpack": "2.1.0-beta.7",
109+
"webpack": "2.1.0-beta.20",
111110
"webpack-isomorphic-tools": "^2.2.41",
112111
"winston": "^1.1.2"
113112
},
114113
"devDependencies": {
115-
"babel-core": "^6.7.7",
116114
"babel-eslint": "^6.0.4",
117115
"babel-plugin-react-transform": "^2.0.2",
118116
"babel-preset-react-hmre": "^1.1.1",
119117
"chai": "^3.0.0",
120-
"chromedriver": "^2.19.0",
118+
"chromedriver": "^2.22.2",
121119
"del": "^2.0.2",
122120
"enzyme": "^2.2.0",
123121
"eslint": "^2.13.0",
@@ -127,7 +125,7 @@
127125
"eslint-plugin-jsx-a11y": "^1.5.3",
128126
"eslint-plugin-react": "^5.2.2",
129127
"jscs": "^2.1.1",
130-
"karma": "^0.13.9",
128+
"karma": "^1.1.2",
131129
"karma-chai": "^0.1.0",
132130
"karma-chai-sinon": "^0.1.5",
133131
"karma-chrome-launcher": "^0.2.0",
@@ -155,6 +153,7 @@
155153
"selenium-server": "^2.48.2",
156154
"sinon": "^1.15.3",
157155
"sinon-chai": "^2.8.0",
156+
"stylelint": "^7.1.0",
158157
"stylelint-webpack-plugin": "^0.2.0",
159158
"wdio-mocha-framework": "^0.3.7",
160159
"wdio-spec-reporter": "0.0.3",

server.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import debug from './src/helpers/debug';
2525

2626
import Html from './src/helpers/Html';
2727

28-
import { setUserAgent } from './src/redux/modules/audioplayer';
29-
import { setOption } from './src/redux/modules/options';
28+
import { setUserAgent } from './src/redux/actions/audioplayer.js';
29+
import { setOption } from './src/redux/actions/options.js';
3030

3131
// Use varnish for the static routes, which will cache too
3232
server.use(raven.middleware.express.requestHandler(config.sentryServer));

server/config/sitemap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default (server) => {
3535

3636

3737
const xml = sitemap.createSitemap({
38-
hostname: 'http://quran.com',
38+
hostname: 'https://quran.com',
3939
cacheTime: 600000, // 600 sec cache period
4040
urls: [
4141
...urls,

src/components/Audioplayer/RepeatDropdown/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class RepeatButton extends Component {
6868
onChange={(event) => setRepeat({
6969
...repeat,
7070
from: parseInt(event.target.value, 10),
71-
to: parseInt(event.target.value, 10)
71+
to: parseInt(event.target.value, 10) + 3
7272
})}
7373
>
7474
{

src/components/Audioplayer/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
33
import { camelize } from 'humps';
44

55
// Redux
6-
import * as AudioActions from '../../redux/modules/audioplayer';
6+
import * as AudioActions from '../../redux/actions/audioplayer';
77

88
// Components
99
import Track from './Track';

src/components/FontStyles/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component, PropTypes } from 'react';
22
import { connect } from 'react-redux';
33
import { fontFaceStyle, fontFaceStyleLoaded } from '../../helpers/buildFontFaces';
4-
import { load } from 'redux/modules/fontFaces';
4+
import { load } from 'redux/actions/fontFace.js';
55

66
import debug from 'helpers/debug';
77
import selector from './selector';

src/components/IndexHeader/Nav/index.js

+20
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ class IndexHeaderNav extends Component {
2222
if (this.props.navlink === false) {
2323
return (
2424
<ul className={classNames}>
25+
<li>
26+
<Link to="/apps" data-metrics-event-name="IndexHeader:Link:Mobile">
27+
Mobile
28+
</Link>
29+
</li>
30+
<li>
31+
<a href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help" target="_blank" data-metrics-event-name="IndexHeader:Link:Developer">
32+
Developers
33+
</a>
34+
</li>
2535
<li>
2636
<a href="http://legacy.quran.com" data-metrics-event-name="IndexHeader:Link:Legacy">Legacy Quran.com</a>
2737
</li>
@@ -36,6 +46,16 @@ class IndexHeaderNav extends Component {
3646

3747
return (
3848
<ul className={classNames}>
49+
<li>
50+
<Link to="/apps" data-metrics-event-name="IndexHeader:Link:Mobile">
51+
Mobile
52+
</Link>
53+
</li>
54+
<li>
55+
<a href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help" target="_blank" data-metrics-event-name="IndexHeader:Link:Developer">
56+
Developers
57+
</a>
58+
</li>
3959
<li>
4060
<a href="http://legacy.quran.com" data-metrics-event-name="IndexHeader:Link:Legacy">Legacy Quran.com</a>
4161
</li>

src/components/Share/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class Share extends Component {
1515
render() {
1616

1717
const {surahId, name} = this.props.surah;
18-
const surahUrl = encodeURIComponent(`http://quran.com/${surahId}`);
18+
const surahUrl = encodeURIComponent(`https://quran.com/${surahId}`);
1919

2020
return (
2121
<div className={`${Style.shareContainer} hidden-xs`}>

src/config.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ module.exports = Object.assign({
3232
{name: 'google-site-verification', content: 'ehFz7FvmL7V9MzP40F8_kLABhCzqGzMDMrCnUP44Too'},
3333
{name: 'theme-color', content: '#004f54'},
3434
{property: 'og:site_name', content: title},
35-
{property: 'og:image', content: 'http://quran.com/images/thumbnail.png'},
35+
{property: 'og:image', content: 'https://quran.com/images/thumbnail.png'},
3636
{property: 'og:locale', content: 'en_US'},
3737
{property: 'og:title', content: title},
3838
{property: 'og:description', content: description},
39-
{property: 'og:url', content: 'http://quran.com'},
39+
{property: 'og:url', content: 'https://quran.com'},
4040
{property: 'og:type', content: 'website'},
4141
{name: 'twitter:card', content: 'summary'},
4242
{name: 'twitter:title', content: title},
4343
{name: 'twitter:description', content: description},
44-
{name: 'twitter:image', content: 'http://quran.com/images/thumbnail.png'},
44+
{name: 'twitter:image', content: 'https://quran.com/images/thumbnail.png'},
4545
{name: 'twitter:image:width', content: '200'},
4646
{name: 'twitter:image:height', content: '200'}
4747
],
@@ -59,10 +59,10 @@ module.exports = Object.assign({
5959
"@type": "WebSite",
6060
"name": "Quran",
6161
"alternateName": "Quran.com",
62-
"url": "http://quran.com",
62+
"url": "https://quran.com",
6363
"potentialAction": {
6464
"@type": "SearchAction",
65-
"target": "http://quran.com/search?q={search_term_string}&referrer=sitelinks_searchbox",
65+
"target": "https://quran.com/search?q={search_term_string}&referrer=sitelinks_searchbox",
6666
"query-input": "required name=search_term_string"
6767
}
6868
}`
@@ -72,8 +72,8 @@ module.exports = Object.assign({
7272
innerHTML: `{
7373
"@context": "http://schema.org",
7474
"@type": "Organization",
75-
"url": "http://quran.com",
76-
"logo": "http://quran.com/images/thumbnail.png"
75+
"url": "https://quran.com",
76+
"logo": "https://quran.com/images/thumbnail.png"
7777
}`
7878
}
7979
],

src/containers/App/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ class App extends Component {
4444
<li><a href="/about">About</a></li>
4545
<li><a href="/contact">Contact</a></li>
4646
<li>
47-
<a href="https://github.com/quran/quran.com-frontend" target="_blank">
47+
<a href="https://quran.zendesk.com/hc/en-us/articles/210090626-Development-help" target="_blank" data-metrics-event-name="Footer:Link:Developer">
4848
Developers
4949
</a>
5050
</li>
5151
</ul>
5252
</Col>
5353
<Col md={2} xs={5} className={styles.links}>
5454
<ul className={`source-sans ${styles.list}`}>
55-
<li><a target="_blank" href="http://sunnah.com/">Sunnah.com</a></li>
56-
<li><a target="_blank" href="http://salah.com/">Salah.com</a></li>
57-
<li><a target="_blank" href="http://quranicaudio.com/">QuranicAudio.com</a></li>
55+
<li><a target="_blank" href="http://sunnah.com/" data-metrics-event-name="Footer:Link:Sunnah">Sunnah.com</a></li>
56+
<li><a target="_blank" href="http://salah.com/" data-metrics-event-name="Footer:Link:Salah">Salah.com</a></li>
57+
<li><a target="_blank" href="http://quranicaudio.com/" data-metrics-event-name="Footer:Link:QuranicAudio">QuranicAudio.com</a></li>
5858
<li>
59-
<a target="_blank" href="http://corpus.quran.com/wordbyword.jsp">
59+
<a target="_blank" href="http://corpus.quran.com/wordbyword.jsp" data-metrics-event-name="Footer:Link:Corpus">
6060
Corpus: Word by Word
6161
</a>
6262
</li>
@@ -77,7 +77,7 @@ class App extends Component {
7777
<li>
7878
<Link
7979
to="/36"
80-
data-metrics-event-name="FooterLinks:Click"
80+
data-metrics-event-name="Footer:Link:Click"
8181
data-metrics-surah-id="36"
8282
>
8383
Surah Yasin, Yaseen (يس)
@@ -86,7 +86,7 @@ class App extends Component {
8686
<li>
8787
<Link
8888
to="/2/255"
89-
data-metrics-event-name="FooterLinks:Click"
89+
data-metrics-event-name="Footer:Link:Click"
9090
data-metrics-surah-id="2/255"
9191
>
9292
Ayat Al-Kursi (آية الكرسي)

src/containers/Home/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { connect } from 'react-redux';
77

88
import debug from '../../helpers/debug';
99

10-
import { isAllLoaded, loadAll } from '../../redux/modules/surahs';
10+
import { isAllLoaded, loadAll } from '../../redux/actions/surahs.js';
1111

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

0 commit comments

Comments
 (0)