Hi Dave,
We've split these changes up into separate patches, added docs, pulled jasmine out of the packaged app, and enabled running from the commandline:
Add jasmine
- it runs with karma from the commandline
- it is outside of the /web folder so that tests and test dependencies are excluded from the packaged app.
Enable refactoring javascript with translations:
- Create a translations.js and translate.js which uses flask to pull in translations, but
lets us have the flask template rendering confined to that one file,
enabling us to test javascript files that rely on translations
Refactor copying text to clipboard into a separate file (this demonstrates use of translate.js)
remove some dead code from sqleditor
Change quotes in sqleditor to make it valid js independent of flask (it makes our IDE happy)
- The changes to the translation mechanism need discussion. How will
it work? What do developers have to do differently? When will the
changes it allows be implemented?
Instead of using flask to render translations into javascript, developers will need to require "translate" and use it in much the same way as the flask _ method. So, for example, translate("My name is %(name)s.", {name: "Tira"}) would replace {{ _("My name is %(name)s.", {name: "Tira"}) }}
We would like to start on these changes right away! We refactored the clipboard functionality out of sqleditor.js and used this translate functionality. The resulting file is now testable javascript.
Tira & George