Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit ea5df01

Browse files
authored
Merge pull request #90 from andi34/add-build-pipeline
Add build pipeline, improve JavaScript This PR contains the following changes: * Installed `gulp-babel` and `@babel/env`. These are used for JavaScript transpilation, meaning that you can use ES6 (like `const`, `let`, etc.) while having support for older browsers, such as Safari 9. * Changed the Gulp pipeline to also transpile the JavaScript. * Moved the raw, unprocessed Sass and JavaScript files into a new folder `src`. When Gulp has ran, it will put the processed (and ready-to-use) files into `resources/(js|css)`, like they where before. Meaning that from now on, you should edit the Sass in and JavaScript in the `src` directory and let Gulp put them into `resources`. * Updated `simple-translator` to version 2.0.2. It now supports more browsers, is already transpiled and could also be loaded from a CDN. The API has also slightly changed. * In `package.json`, there were 3 dependencies that had version numbers referenced to some GitHub repos, which prevented a successful installation on my machine. I added the latest version numbers, if you don't want this let me know. * I installed and used the `whatwg-fetch` polyfill which should enable Safari to use the simple translator. * added Prettier to have consistent formatting for both JavaScript & SCSS
2 parents 48de366 + f7051a1 commit ea5df01

Some content is hidden

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

71 files changed

+3624
-2310
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# top-most EditorConfig file
44
root = true
55

6-
[resources/js/**.js]
6+
[src/js/**.js]
77
charset = utf-8
88
indent_style = space
99
indent_size = 4
1010
insert_final_newline = true
11-
trim_trailing_whitespace = true
11+
trim_trailing_whitespace = true

.eslintrc.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"array-bracket-newline": "error",
2121
"array-bracket-spacing": "error",
2222
"array-callback-return": "error",
23-
"array-element-newline": "error",
23+
"array-element-newline": "off",
2424
"arrow-body-style": "error",
2525
"arrow-parens": "error",
2626
"arrow-spacing": [
@@ -88,7 +88,7 @@
8888
"error",
8989
"consistent"
9090
],
91-
"function-paren-newline": "error",
91+
"function-paren-newline": "off",
9292
"generator-star-spacing": "error",
9393
"global-require": "error",
9494
"guard-for-in": "error",
@@ -289,19 +289,11 @@
289289
],
290290
"valid-jsdoc": "error",
291291
"vars-on-top": "off",
292-
"wrap-regex": "error",
292+
"wrap-regex": "off",
293293
"yield-star-spacing": "error",
294294
"yoda": [
295295
"error",
296296
"never"
297297
]
298-
},
299-
"overrides": [
300-
{
301-
"files": ["i18n.js", "i18n-sub.js"],
302-
"parserOptions": {
303-
"sourceType": "module"
304-
}
305-
}
306-
]
298+
}
307299
}

.github/workflows/gulp_sass.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
- name: Install modules
2424
run: yarn install
2525
- name: Running gulp-sass
26-
run: yarn build
26+
run: yarn build:sass

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ digicamcontrol/
77
node_modules/
88
package-lock.json
99
resources/css/
10+
resources/js/
1011
stats
1112
trash
13+
vendor/simple-translator/
1214
.sass-cache
1315
/.htaccess
1416
.htpasswd

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
[submodule "vendor/rpihotspot"]
99
path = vendor/rpihotspot
1010
url = https://github.com/andi34/rpihotspot
11+
[submodule "vendor/PhotoSwipe"]
12+
path = vendor/PhotoSwipe
13+
url = https://github.com/andi34/PhotoSwipe

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scripts-prepend-node-path=true

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "none",
3+
"singleQuote": true,
4+
"bracketSpacing": false,
5+
"printWidth": 120
6+
}

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ This is my personal Photobooth fork with some extras on top (more information ca
1010
![Lint](https://github.com/andi34/photobooth/workflows/Lint/badge.svg?branch=stable2)
1111
![gulp-sass](https://github.com/andi34/photobooth/workflows/gulp-sass/badge.svg?branch=stable2)
1212

13-
**Please note:**
14-
15-
Safari Browser on iOS 9 in not compatible with es6, which means Photobooth won't work. Supported browser can be found inside the [Wiki](https://github.com/andi34/photobooth/wiki#browser-support).
16-
If you like to use an old iPad anyway, please take a look [here (andi34/photobooth#47)](https://github.com/andi34/photobooth/issues/47).
17-
If I find enough time I'll post some updates from time to time
18-
1913
## :heart_eyes: Features
2014

2115
- Works on Windows and Linux.
@@ -61,6 +55,7 @@ If I find enough time I'll post some updates from time to time
6155
## Extras on my personal fork
6256
### General changes:
6357

58+
- javascript transpiled to es5 to support older browsers (e.g. Safari 9)
6459
- install-raspbian: use Apache2 webserver by default again
6560
- added Slideshow option to Gallery
6661
- standalone slideshow via [localhost/slideshow](http://localhost/slideshow)

admin/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@
148148
</div>
149149
</div>
150150

151+
<script src="../node_modules/whatwg-fetch/dist/fetch.umd.js"></script>
151152
<script type="text/javascript" src="../api/config.php"></script>
152153
<script type="text/javascript" src="../node_modules/jquery/dist/jquery.min.js"></script>
153154
<script type="text/javascript" src="../resources/js/theme.js"></script>
154155
<script type="text/javascript" src="../resources/js/admin.js"></script>
155-
<script type="module" src="../resources/js/i18n-sub.js"></script>
156+
<script src="../node_modules/@andreasremdt/simple-translator/dist/umd/translator.min.js"></script>
157+
<script type="text/javascript" src="../resources/js/i18n-sub.js"></script>
156158

157159
</body>
158160
</html>

api/language.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)