Permalink
Comparing changes
Open a pull request
- 8 commits
- 65 files changed
- 0 commit comments
- 3 contributors
Unified
Split
Showing
with
1,464 additions
and 1,116 deletions.
- +3 −0 .gitignore
- +7 −8 Makefile
- +2 −5 README.rst
- +1 −2 development.ini
- +32 −0 h/assets.py
- +72 −212 h/assets.yaml
- +47 −2 h/static/bootstrap.js
- +0 −2 h/static/scripts/.gitignore
- +5 −0 h/static/scripts/account/account.coffee
- +2 −0 h/static/scripts/annotator/monkey.coffee
- +4 −0 h/static/scripts/annotator/plugin/bucket-bar.coffee
- +4 −0 h/static/scripts/annotator/plugin/cross-frame.coffee
- +3 −1 h/static/scripts/annotator/plugin/enhancedanchoring.coffee
- +4 −0 h/static/scripts/annotator/plugin/texthighlights.coffee
- +43 −0 h/static/scripts/app.coffee
- +3 −0 h/static/scripts/bridge.coffee
- +4 −4 h/static/scripts/controllers.coffee
- +3 −0 h/static/scripts/filters.coffee
- +4 −3 h/static/scripts/guest.coffee
- +8 −0 h/static/scripts/helpers/helpers.coffee
- +3 −0 h/static/scripts/helpers/string-helpers.coffee
- +1 −0 h/static/scripts/helpers/time-helpers.coffee
- +4 −3 h/static/scripts/host.coffee
- +4 −0 h/static/scripts/session/session.coffee
- +3 −0 h/static/scripts/threading-service.coffee
- +0 −2 h/static/scripts/vendor/.gitignore
- +0 −1 h/static/scripts/vendor/polyfills/.gitignore
- +27 −32 karma.config.js
- +30 −2 package.json
- +13 −2 tests/js/account/account-controller-test.coffee
- +7 −1 tests/js/account/auth-controller-test.coffee
- +7 −0 tests/js/annotation-mapper-service-test.coffee
- +7 −0 tests/js/annotation-sync-test.coffee
- +7 −0 tests/js/annotation-ui-service-test.coffee
- +7 −0 tests/js/annotation-ui-sync-test.coffee
- +3 −1 tests/js/annotator/plugins/bucket-bar-test.coffee
- +13 −17 tests/js/annotator/plugins/cross-frame-test.coffee
- +7 −0 tests/js/auth-service-test.coffee
- +8 −0 tests/js/bridge-test.coffee
- +305 −235 tests/js/controllers-test.coffee
- +7 −0 tests/js/cross-frame-service-test.coffee
- +12 −128 tests/js/directives-test.coffee
- +57 −30 tests/js/directives/annotation-test.coffee
- +65 −96 tests/js/directives/privacy-test.coffee
- +66 −61 tests/js/directives/simple-search-test.coffee
- +8 −1 tests/js/directives/status-button-test.coffee
- +152 −140 tests/js/directives/thread-test.coffee
- +7 −0 tests/js/discovery-test.coffee
- +35 −27 tests/js/filters-test.coffee
- +29 −10 tests/js/guest-test.coffee
- +156 −0 tests/js/helpers/form-helpers-test.coffee
- +8 −1 tests/js/helpers/string-helpers-test.coffee
- +9 −2 tests/js/helpers/time-helpers-test.coffee
- +4 −1 tests/js/host-test.coffee
- +7 −1 tests/js/identity-service-test.coffee
- +8 −1 tests/js/permissions-service-test.coffee
- +11 −12 tests/js/plugin/enhancedanchoring-test.coffee
- +6 −9 tests/js/plugin/texthighlight-test.coffee
- +17 −6 tests/js/services-test.coffee
- +26 −11 tests/js/session-service-test.coffee
- +7 −0 tests/js/store-service-test.coffee
- +8 −1 tests/js/streamer-service-test.coffee
- +7 −0 tests/js/threading-service-test.coffee
- +0 −43 tests/js/util-test.coffee
- +45 −0 tools/browserify-pipe
| @@ -20,6 +20,9 @@ | ||
| /share | ||
| /src | ||
| # All minified javascript is built | ||
| *.min.js | ||
| *.pyc | ||
| *.pyo | ||
| @@ -7,20 +7,19 @@ default: | ||
| clean: | ||
| @rm -rf h/static/.sass-cache | ||
| @rm -rf h/static/.webassets-cache | ||
| find h/static/scripts \ | ||
| -path 'h/static/scripts/vendor' -prune \ | ||
| -o -iname '*.js' \ | ||
| -exec rm {} \; | ||
| find h/static/styles/*.css \ | ||
| -iname 'icomoon.css' -prune \ | ||
| -o -exec rm {} \; | ||
| find . -type f -name "*.py[co]" -delete | ||
| find . -type d -name "__pycache__" -delete | ||
| find h/static/scripts -mindepth 1 -name '*.min.js' \ | ||
| -delete | ||
| find h/static/styles -mindepth 1 \ | ||
| -name 'icomoon.css' -prune \ | ||
| -o -name '*.css' -delete | ||
| test: | ||
| @echo -n "Checking to see if elasticsearch is running..." | ||
| $(eval es := $(shell wget --quiet --output-document - http://localhost:9200)) | ||
| @if [ -n '${es}' ] ; then echo "yes." ; else echo "no!"; exit 1; fi | ||
| python setup.py develop test | ||
| hypothesis assets development.ini | ||
| "$$(npm bin)"/karma start karma.config.js --single-run | ||
| "$$(npm bin)"/karma start h/browser/chrome/karma.config.js --single-run | ||
| @@ -107,10 +107,8 @@ To run the Python suite, invoke the tests in the standard fashion:: | ||
| $ ./bin/python setup.py test | ||
| To run the JavaScript suite, ensure the assets are built and then invoke the | ||
| karma test runner:: | ||
| To run the JavaScript suite, run:: | ||
| $ hypothesis assets development.ini | ||
| $ $(npm bin)/karma start karma.config.js --single-run | ||
| As a convenience, there is a make target which will do all of the above:: | ||
| @@ -120,8 +118,7 @@ As a convenience, there is a make target which will do all of the above:: | ||
| It's also possible to run a subset of the tests using ``karma run``:: | ||
| $ $(npm bin)/karma start karma.config.js & # Start the server in the bg. | ||
| $ hypothesis assets development.ini && \ | ||
| $(npm bin)/karma run karma.config.js -- --grep={FILTER_STRING} | ||
| $ $(npm bin)/karma run karma.config.js -- --grep={FILTER_STRING} | ||
| This will run generally be much faster than running ``karma start --single-run`` | ||
| each time. The frontend tests can also be debugged by visiting | ||
| @@ -47,13 +47,12 @@ jinja2.extensions: h.jinja_extensions:IncludeRawExtension | ||
| webassets.base_dir: h:static | ||
| webassets.base_url: assets | ||
| webassets.coffee_no_bare: True | ||
| webassets.debug: True | ||
| webassets.manifest: False | ||
| webassets.static_view: True | ||
| webassets.uglifyjs_bin: %(here)s/node_modules/.bin/uglifyjs | ||
| webassets.cleancss_bin: %(here)s/node_modules/.bin/cleancss | ||
| webassets.coffee_bin: %(here)s/node_modules/.bin/coffee | ||
| webassets.browserify_pipe_bin: %(here)s/tools/browserify-pipe | ||
| ;http://docs.pylonsproject.org/projects/pyramid-debugtoolbar/en/latest/#settings | ||
| debugtoolbar.show_on_exc_only: True | ||
| @@ -2,9 +2,41 @@ | ||
| import re | ||
| from deform.field import Field | ||
| from webassets.filter import ExternalTool, register_filter | ||
| import pyramid | ||
| class Browserify(ExternalTool): | ||
| """ | ||
| An input filter for webassets that browserifies CoffeeScript or JavaScript. | ||
| The browserify command-line client has several limitations when piping | ||
| input to STDIN: | ||
| - it uses a dummy name for the piped file in sourcemaps | ||
| - because it does not know the real name of the piped file, it cannot | ||
| accept CoffeeScript, because it does not know the real extension of the | ||
| piped file | ||
| The filter uses the browserify-pipe tool, shipped in ``tools/`` in the | ||
| repository root, which circumvents these issues. | ||
| """ | ||
| name = 'browserify' | ||
| options = {'binary': 'BROWSERIFY_PIPE_BIN'} | ||
| max_debug_level = None | ||
| def input(self, in_, out, source_path, **kwargs): | ||
| args = [self.binary or 'browserify-pipe'] | ||
| if self.get_config('debug'): | ||
| args.append('-d') | ||
| args.append(source_path) | ||
| self.subprocess(args, out, in_) | ||
| register_filter(Browserify) | ||
| class WebassetsResourceRegistry(object): | ||
| def __init__(self, env): | ||
Oops, something went wrong.