Skip to content

Commit c29c095

Browse files
Bug fotorama
1 parent 4dadeff commit c29c095

File tree

8 files changed

+73
-8
lines changed

8 files changed

+73
-8
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"lint": "eslint --format=node_modules/eslint-formatter-pretty . *.js",
99
"test": "ava"
1010
},
11+
"browserify": {
12+
"transform": [
13+
"browserify-global-shim"
14+
]
15+
},
16+
"browserify-global-shim": {
17+
"jQuery": "$"
18+
},
1119
"author": "Codercokr",
1220
"license": "MIT",
1321
"devDependencies": {
@@ -59,7 +67,9 @@
5967
},
6068
"dependencies": {
6169
"bootstrap-sass": "^3.3.7",
70+
"browserify-global-shim": "^1.0.3",
6271
"jquery": "3.1.1",
72+
"jquery-bridget": "^2.0.1",
6373
"jquery-validation": "^1.17.0",
6474
"jquery.maskedinput": "^1.4.1",
6575
"material-design-lite": "^1.3.0",

source/html/about.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@
562562
</div>
563563
</nav>
564564

565+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
565566
<script src="bundle.min.js"></script>
566567
</body>
567568
</html>

source/html/contact.ejs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@
304304
</div>
305305
</div>
306306
</nav>
307-
308307
<script src="bundle.min.js"></script>
309308
</body>
310309
</html>

source/html/index.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
</div>
293293
</div>
294294
</nav>
295-
295+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
296296
<script src="bundle.min.js"></script>
297297
</body>
298298
</html>

source/scripts/lib/fotorama.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/scripts/main.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
'use strict';
22

3-
import $ from 'jquery';
4-
// import fotorama from 'fotorama/fotorama.js'
3+
window.$ = window.jQuery = require('jquery');
4+
// $.fotorama = require('fotorama/fotorama.js');
5+
6+
// import { $, jquery } from 'jquery';
7+
// window.$ = $;
8+
// window.jquery = jquery;
9+
import fotorama from 'fotorama/fotorama.js'
510
import plyr from 'plyr'
611
import noUiSlider from 'nouislider'
712
import material from 'material-design-lite'
8-
import 'jquery.maskedinput/src/jquery.maskedinput.js'
13+
import mask from 'jquery.maskedinput/src/jquery.maskedinput.js'
914
import 'jquery-validation'
1015

1116
var Main = {
1217
init: function(){
18+
1319
var page = $('.wrap').attr('id');
1420
switch(page) {
1521
case 'home':
1622
Main.initVideo();
17-
// Main.initTestimonials();
23+
Main.initTestimonials();
1824
break;
1925
case 'contact':
2026
Main.initForm();

tasks/scripts.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ import browserify from 'browserify';
66
import watchify from 'watchify';
77
import source from 'vinyl-source-stream';
88
import buffer from 'vinyl-buffer';
9+
import browserifyGlobal from 'browserify-global-shim';
910
import { join } from 'path';
1011

1112
import browserSync from './connect';
1213
import { libraries, server, browserify as blabla } from '../config';
1314

1415
const { dest } = server
1516
const config = Object.assign({}, watchify.args, blabla);
17+
const globalShim = browserifyGlobal.configure({
18+
'jQuery': '$'
19+
})
1620
const bundler = watchify(browserify(config));
1721
const buildBundler = browserify(config);
1822

yarn.lock

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ acorn@^3.0.4, acorn@^3.1.0:
8080
version "3.3.0"
8181
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
8282

83+
acorn@^5.0.0:
84+
version "5.1.2"
85+
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7"
86+
8387
after@0.8.1:
8488
version "0.8.1"
8589
resolved "https://registry.yarnpkg.com/after/-/after-0.8.1.tgz#ab5d4fb883f596816d3515f8f791c0af486dd627"
@@ -1305,6 +1309,12 @@ browserify-des@^1.0.0:
13051309
des.js "^1.0.0"
13061310
inherits "^2.0.1"
13071311

1312+
browserify-global-shim@^1.0.3:
1313+
version "1.0.3"
1314+
resolved "https://registry.yarnpkg.com/browserify-global-shim/-/browserify-global-shim-1.0.3.tgz#b2f0de3d7220e2309ba0a8c4b5638ec1d97868a8"
1315+
dependencies:
1316+
browserify-transform-tools "^1.5.0"
1317+
13081318
browserify-rsa@^4.0.0:
13091319
version "4.0.1"
13101320
resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524"
@@ -1324,6 +1334,13 @@ browserify-sign@^4.0.0:
13241334
inherits "^2.0.1"
13251335
parse-asn1 "^5.0.0"
13261336

1337+
browserify-transform-tools@^1.5.0:
1338+
version "1.7.0"
1339+
resolved "https://registry.yarnpkg.com/browserify-transform-tools/-/browserify-transform-tools-1.7.0.tgz#83e277221f63259bed2e7eb2a283a970a501f4c4"
1340+
dependencies:
1341+
falafel "^2.0.0"
1342+
through "^2.3.7"
1343+
13271344
browserify-zlib@~0.1.2:
13281345
version "0.1.4"
13291346
resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d"
@@ -2935,6 +2952,15 @@ extsprintf@1.0.2:
29352952
version "1.0.2"
29362953
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
29372954

2955+
falafel@^2.0.0:
2956+
version "2.1.0"
2957+
resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c"
2958+
dependencies:
2959+
acorn "^5.0.0"
2960+
foreach "^2.0.5"
2961+
isarray "0.0.1"
2962+
object-keys "^1.0.6"
2963+
29382964
fancy-log@^1.1.0:
29392965
version "1.2.0"
29402966
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.2.0.tgz#d5a51b53e9ab22ca07d558f2b67ae55fdb5fcbd8"
@@ -3110,6 +3136,10 @@ for-own@^0.1.4:
31103136
dependencies:
31113137
for-in "^0.1.5"
31123138

3139+
foreach@^2.0.5:
3140+
version "2.0.5"
3141+
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
3142+
31133143
forever-agent@~0.6.1:
31143144
version "0.6.1"
31153145
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@@ -4432,6 +4462,12 @@ jpegtran-bin@^3.0.0:
44324462
bin-wrapper "^3.0.0"
44334463
logalot "^2.0.0"
44344464

4465+
jquery-bridget@^2.0.1:
4466+
version "2.0.1"
4467+
resolved "https://registry.yarnpkg.com/jquery-bridget/-/jquery-bridget-2.0.1.tgz#784d17a85e641780c5d89ac3f8a7eb47b0bce1fc"
4468+
dependencies:
4469+
jquery ">=1.4.2 <4"
4470+
44354471
jquery-validation@^1.17.0:
44364472
version "1.17.0"
44374473
resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.17.0.tgz#ab66b6b583d7740b9bbd148993e50e8ac041f35b"
@@ -4442,7 +4478,7 @@ jquery.maskedinput@^1.4.1:
44424478
version "1.4.1"
44434479
resolved "https://registry.yarnpkg.com/jquery.maskedinput/-/jquery.maskedinput-1.4.1.tgz#3ea8f4cdc4eafce7354c27b66a73d0f44defc327"
44444480

4445-
"jquery@1.9.1 - 3", jquery@3.1.1, jquery@>=1.8, "jquery@^1.7 || ^2.0 || ^3.1":
4481+
"jquery@1.9.1 - 3", jquery@3.1.1, "jquery@>=1.4.2 <4", jquery@>=1.8, "jquery@^1.7 || ^2.0 || ^3.1":
44464482
version "3.1.1"
44474483
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.1.1.tgz#347c1c21c7e004115e0a4da32cece041fad3c8a3"
44484484

@@ -5456,6 +5492,10 @@ object-component@0.0.3:
54565492
version "0.0.3"
54575493
resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
54585494

5495+
object-keys@^1.0.6:
5496+
version "1.0.11"
5497+
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
5498+
54595499
object-path@^0.9.0:
54605500
version "0.9.2"
54615501
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.9.2.tgz#0fd9a74fc5fad1ae3968b586bda5c632bd6c05a5"
@@ -7234,7 +7274,7 @@ through2@^0.6.0, through2@^0.6.1, through2@^0.6.3:
72347274
readable-stream ">=1.0.33-1 <1.1.0-0"
72357275
xtend ">=4.0.0 <4.1.0-0"
72367276

7237-
through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3, through@~2.3.1:
7277+
through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.7, through@~2.3, through@~2.3.1:
72387278
version "2.3.8"
72397279
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
72407280

0 commit comments

Comments
 (0)