Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0335afa
Make suggestions optional
svineet Jan 6, 2016
311126f
Fixes for suggestions
svineet Jan 17, 2016
03b1965
captcha reset added and right wrap context fixed
Kira-D Jun 6, 2016
843dda6
Bugfix (*/@/# deleted from suggestion form) and style fixes
Kira-D Jun 14, 2016
d22834e
Empty the suggestedWordInput
Kira-D Jun 26, 2016
dcfb368
ReCaptcha widget localization
Kira-D Jun 26, 2016
80a60f9
no suggestions for punctuation and "£@¡"-like patterns
Kira-D Aug 20, 2016
867c023
Style fixes
Kira-D Aug 20, 2016
9236ba5
Fix regression
sushain97 Aug 31, 2016
d1ebd87
Solve errors
Dec 2, 2017
2edf7ef
ReCaptcha error
Dec 2, 2017
0fb073b
Merge branch 'master' into suggestions-Kira-D
diogoscf Dec 2, 2017
6c33410
Fix errors
Dec 2, 2017
ed4a850
Merge branch 'suggestions-Kira-D' of https://github.com/diogoscf/aper…
Dec 2, 2017
6e9bef8
More errors
Dec 2, 2017
092b3cf
Most errors fixed (hopefully)
Dec 3, 2017
ea090f4
Nearly done
Dec 3, 2017
be7ef27
Only one error left (hopefully)
Dec 3, 2017
940d3bd
Finally done(hopefully)
Dec 3, 2017
e86cb58
Silly mistake
Dec 3, 2017
36ed5ee
Hopefully last fix
Dec 3, 2017
0a8cff7
Fix function order
Dec 3, 2017
b236765
Merge pull request #218 from diogoscf/suggestions-Kira-D
sushain97 Dec 4, 2017
e074cae
Context size fixed (#248)
Androbin Jan 2, 2018
854ca0c
Merge branch 'issue-55-suggestions' into master (#249)
Androbin Jan 4, 2018
0d09f8b
Merge branch 'issue-55-suggestions' into master
Androbin Jan 4, 2018
6db02a0
Merge pull request #251 from Androbin/merge
sushain97 Jan 4, 2018
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
Prev Previous commit
Next Next commit
Merge branch 'issue-55-suggestions' into master (#249)
* Add file download workaround for Safari (fixes #97)

* Changed Download_Browser_Warning

* Added workaround for Safari

Fixed translator.js

Fixed wierd bugs that I have no idea how I had made.

* Moved .fadeIn out of conditional block

* Added comments to increase code readability

* Allow right-click to download even if workaraound is used

* Revert string changes

* Fix multiple download in Safari >10

Fix es-lint

Fix es-lint

* Removed Download_Browser_Warning

* Change way we check for Safari version

Instead of looking at specific version (10, 11) look for one digit version (9, 8 and earlier)

* Remove unused global varaibles

* Extended comment about Safari workaround

* Run cleanup

* Fixes #201 (Chrome audit improvements)

* Improved Chrome audit performance

* Update Makefile

* Fixed formatting errors

* Fixed more formatting errors

* Revised "start_url"

* Removed sw.js

* Removed script for registering service worker

* Revised makefile, manifest.json, and index.html

* Improved Chrome audit performance further

* Improved audit performance further

* Fixed errors

* fixed houndci error

* Fixed final errors

* Added whitespace

* Fix <html> localisation

* Disentangle JS modules and fix Flow (fixes #80)

* [WIP] Disentangle JS modules (#225)

* Disentangle JS modules

* Fix imports

* Use flow on individual files

* Declare modules to Flow

* Run Flow directly

* Cleanup

* Fix some import/export issues

* Make the build work

* Tweak flow decl

* Move around the config decl to make build work

* Delete extra line

* Fix make debug (fixes #220)

* Improvements to Flow coverage

* Better flow coverage

* Doesn't look like the stubs actually belong to jQuery 3 so I'm reverting these changes

* Remove unnecessary var

* This name makes a lot more sense

* Remove unnecessary type annotations (clutter code & are obvious e.g. string literals)

* More unnecessary type annotations

* Remove more unnecessary annotations

* Prefer literal union type

* Add a type and remove one

* More fixes

* Fix persist choices

* Remove more redundant annotations

* Remove more unnecessary annotations

* Switch to Array<...> shortform

* Undo one of my 'fixes'

* Final flow fix

* Convert Object to {} shorthand

* Remove a couple more unnecessary annotations

* Some final cleanup

* Implement requested changes

* Add/Remove/Fix types

* Adapt config types

* Un-Flow strict.js

* Allow subtitle to be null

* Final tweaks

* Simplify progress bar update

* Split CSS into multiple files and improve organization (fixes #212)

* Split CSS into multiple files

* Better organization

* Minor tweaks

* Bring all the coverage over 90%

* Fix buggy UI with detect-language (fixes #236)

* Refactor repeated code into a function

* Fix the locale selector I probably broke

* Show translation not available less often

* Remove a warn that gets triggered all the time

* More generic port configuration with Docker

* Less awkward input label placement

* Slightly more sane language sorting with variants

* Significantly more sane translation language column computation

* Fix typo

* Store docker pair data in persistent volume and add update all script

* Include language modules download in deploy script (fixes #244)

* Minify JS and CSS (towards #130)

* Minify all.js and all.css

* Make minification fail gracefully

* Update README section on compression

* Use command line interfaces

* Update Dockerfile

* Update README.md

* Update README.md

* Fix dockerfiles

* Fix debug HTML

* Fetch monolingual modules before pairs in deploy-all script

* Merge handleTranslateSuccessResponse

* Update imports/exports

* Add JQuery modal/tooltip stubs

* Add config.SUGGESTIONS stubs

* Fix remaining Flow issues
  • Loading branch information
Androbin authored and sushain97 committed Jan 4, 2018
commit 854ca0c51fe1ad8e1253dc49adbec3bda80a9e5c
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ jobs:

# Install development dependencies
- run: sudo apt-get install python3 python3-pip
- run: sudo npm install -g jsonlint eslint htmlhint sass-lint
- run: sudo pip3 install flake8
- run: sudo npm install -g jsonlint eslint flow flow-bin flow-coverage-report htmlhint sass-lint
- run: sudo pip3 install flake8 jsmin csscompressor

# Run tests
- run: find assets/strings -type f -name '*.json' -exec jsonlint -q '{}' +
- run: eslint --config assets/js/.eslintrc.json assets/js/*.js
- run: htmlhint --config .htmlhintrc.json *.html
- run: sass-lint --config assets/css/.sass-lint.yml --verbose --no-exit --max-warnings 0
- run: flake8 --config tools/.flake8.ini *.py **/**.py **/**/*.py
- run: flow-coverage-report --config flow-coverage.json
- run: flow check

# Build project
- run: cp config.conf.example config.conf
Expand Down
3 changes: 1 addition & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[ignore]
build/
.*/build/.*

[include]

[libs]
interfaces/

[options]
34 changes: 20 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
CONFIG ?= config.conf
DEFAULT_LOCALE ?= $(shell ./tools/read-conf.py -c $(CONFIG) get DEFAULT_LOCALE)

all: check-deps prod

debug: debugjs debugcss build/index.debug.html build/not-found.html fonts build/js/compat.js build/js/jquery.min.js build/js/bootstrap.min.js build/sitemap.xml build/strings/locales.json build/index.$(DEFAULT_LOCALE).html build/strings/$(DEFAULT_LOCALE).json images

prod: js css html fonts build/sitemap.xml build/strings/locales.json localhtml images
prod: js css html fonts build/sitemap.xml build/manifest.json build/strings/locales.json localhtml images

js: build/js/min.js build/js/compat.js build/js/jquery.min.js build/js/bootstrap.min.js debugjs
debugjs: build/js/jquery.jsonp-2.4.0.min.js build/js/config.js build/js/util.js build/js/store.js build/js/persistence.js build/js/localization.js build/js/translator.js build/js/analyzer.js build/js/generator.js build/js/sandbox.js
debugjs: build/js/jquery.jsonp-2.4.0.min.js build/js/config.js build/js/util.js build/js/init.js build/js/store.js build/js/persistence.js build/js/localization.js build/js/translator.js build/js/analyzer.js build/js/generator.js build/js/sandbox.js
css: build/css/min.css build/css/font-awesome.min.css build/css/bootstrap-rtl.min.css debugcss
debugcss: build/css/bootstrap.css build/css/style.css
debugcss: build/css/bootstrap.css build/css/analysis.css build/css/footer.css build/css/general.css build/css/navbar.css build/css/translation.css
html: build/index.html build/index.debug.html build/not-found.html
fonts: build/fonts/fontawesome-webfont.woff build/fonts/fontawesome-webfont.ttf build/fonts/fontawesome-webfont.svg build/fonts/fontawesome-webfont.eot

Expand All @@ -31,12 +34,12 @@ check-deps:
### JS ###
JSFILES= \
assets/js/strict.js \
assets/js/flow.js \
assets/js/jquery.jsonp-2.4.0.min.js \
build/js/config.js \
build/js/locales.js \
build/js/listrequests.js \
assets/js/util.js \
assets/js/init.js \
assets/js/store.js \
assets/js/persistence.js \
assets/js/localization.js \
Expand All @@ -45,9 +48,6 @@ JSFILES= \
assets/js/generator.js \
assets/js/sandbox.js

CONFIG ?= config.conf
DEFAULT_LOCALE ?= $(shell ./tools/read-conf.py -c $(CONFIG) get DEFAULT_LOCALE)

build/js/config.js: $(CONFIG) tools/read-conf.py build/js/.d
./tools/read-conf.py -c $< js > $@

Expand Down Expand Up @@ -85,7 +85,7 @@ build/js/all.js: $(JSFILES) build/js/.d
cat $(JSFILES) > $@

build/js/min.js: build/js/all.js
cp $< $@
python3 -m jsmin $< > $@ || (echo "jsmin not installed, skipping JS minification" && cp $< $@)

build/js/compat.js: assets/js/compat.js build/js/.d
cp $< $@
Expand All @@ -99,6 +99,9 @@ build/js/bootstrap.min.js: build/js/.d
build/js/%.js: assets/js/%.js build/js/.d
cp $< $@

### MANIFEST ###
build/manifest.json: assets/manifest.json build/.d
cp $< $@

### HTML ###
build/index.debug.html: index.html.in debug-head.html build/l10n-rel.html build/.PIWIK_URL build/.PIWIK_SITEID build/strings/eng.json $(CONFIG) tools/read-conf.py tools/localise-html.py build/.d
Expand Down Expand Up @@ -170,6 +173,13 @@ build/sitemap.xml: sitemap.xml.in build/l10n-rel.html build/.HTML_URL

### CSS ###

CSSFILES= \
assets/css/analysis.css \
assets/css/footer.css \
assets/css/general.css \
assets/css/navbar.css \
assets/css/translation.css

THEMES= cerulean cosmo cyborg darkly journal lumen paper readable sandstone simplex slate spacelab superhero united yeti

$(THEMES): % : all build/css/bootstrap.%.css build/css/.d
Expand All @@ -183,9 +193,9 @@ build/css/all.css: $(if $(theme), build/css/bootstrap.$(theme).css, assets/css/b
cat $^ > $@

build/css/min.css: build/css/all.css
cp $< $@
python3 -m csscompressor $< > $@ || (echo "csscompressor not installed, skipping CSS minification" && cp $< $@)

build/css/style.css: assets/css/style.css $(if $(theme), assets/css/themes/style.$(theme).css, ) build/css/.d
build/css/style.css: $(CSSFILES) $(if $(theme), assets/css/themes/style.$(theme).css, ) build/css/.d
cat $^ > $@

build/css/font-awesome.min.css: build/css/.d
Expand Down Expand Up @@ -223,10 +233,6 @@ build/img/%: assets/img/%

images: $(IMAGES_BUILD)

### Typechecking ###
# grab the bin from https://github.com/facebook/flow/releases
flow: build/js/all.js
grep -Ev '/\*:: *(ex|im)port ' $< | flow check-contents

### Test server ###
server:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ Any changes to the local version of Html-tools will trigger a `make`.

docker-compose up

For production usage, remember to enable gzip compression in your server.
For production usage, remember to

1. Build with `jsmin` and `csscompressor` installed through `pip`.
1. Enable gzip compression on your server.

Contributing
------------
Expand Down
3 changes: 3 additions & 0 deletions assets/css/analysis.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.unit {
margin-left: 30px;
}
49 changes: 49 additions & 0 deletions assets/css/footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
html,
body {
height: 100%; /* The html and body elements cannot have any padding or margin. */
}

/* Wrapper for page content to push down footer */
#wrap {
height: auto !important; /* sass-lint:disable-line no-important */
margin: 0 auto -60px; /* Negative indent footer by it's height */
min-height: 99.5%;
}

#push {
height: 60px; /* Set the fixed height of the footer */
}

#footer {
height: auto;
}

/* Lastly, apply responsive CSS fixes as necessary */
@media(max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}

@media print {
#footer {
display: none;
}
}

#footer-container {
position: relative;
}

#version {
position: absolute;
right: 15px;
top: 40px;
}

#version:hover, #version:active, #version:focus {
text-decoration: none;
}
127 changes: 127 additions & 0 deletions assets/css/general.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
h2 {
margin-top: 0;
}

.modeContainer {
display: none;
}

.outputContainer {
margin: 5em 0;
}

.blurred {
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-webkit-transition: all 1s ease;
opacity: .5;
transition: all 1s ease;
}

#loadingIndicator {
display: none;
left: 48%;
position: absolute;
top: 45%;
z-index: 10000;
}

/* Locale selection */

.localeGlobe {
color: #fff;
font-size: 1.8em;
padding: 0 5px 0 0;
}

.localeSelect {
font-size: 14px;
height: 25px;
margin-bottom: 6px;
margin-top: 7px;
}

/* Clear button */

.clearButton {
background-color: rgba(0, 0, 0, 0);
padding: 0 3px;
position: absolute;
top: 3px;
}

.clearButton:hover,
.clearButton:focus {
background-color: #eee;
color: #000;
}

html[dir='ltr'] .clearButton {
right: 18px;
}

html[dir='rtl'] .clearButton {
left: 18px;
}

/* Back to top button */

#backToTop {
bottom: 20px;
opacity: .5;
position: fixed;
right: 20px;
z-index: 999;
}

#backToTop:hover {
opacity: 1;
}

/* Installation notice */

#installationNotice {
font-size: inherit;
height: 105px;
margin: 8px;
padding: 8px;
position: fixed;
right: 20px;
top: 20px;
width: 360px;
z-index: 9999999;
}

#installationNotice .fa-times:hover { /* sass-lint:disable-line class-name-format */
cursor: pointer;
}

#installationNoticeTitle {
margin: 0;
padding-bottom: 10px;
}

/* No JS banner */

#noscript {
position: fixed;
right: 0;
text-align: center;
top: 5px;
width: 100%;
z-index: 10000000000000;
}

body > .container {
margin-top: 4em;
}

/* RTL checking */

html[dir='rtl'] .pull-right:not(#rtlChecker) { /* sass-lint:disable-line class-name-format */
float: left !important; /* sass-lint:disable-line no-important */
}

html[dir='rtl'] .pull-left:not(#rtlChecker) { /* sass-lint:disable-line class-name-format */
float: right !important; /* sass-lint:disable-line no-important */
}
Loading