Commit Graph

64 Commits

Author SHA1 Message Date
Aditya Bansal
a103949c2b i18n.js: Fix issue of i18n stub not returning 'translated: ' prefix. 2017-06-29 15:18:08 -04:00
Aditya Bansal
4d84be16ca i18n.js: Fix issue with i18n being cleaned up in namespace cleanup. 2017-06-29 15:18:08 -04:00
Aditya Bansal
103f19e236 zjsunit: Add i18n minimal lib. 2017-06-28 07:34:04 -04:00
Aditya Bansal
1ed499fffc zjquery: Add stop() function. 2017-06-28 07:34:04 -04:00
Aditya Bansal
bd370993ea zjquery: Add fadeTo() function. 2017-06-28 07:34:04 -04:00
Aditya Bansal
fb723f9477 zjquery: Reorder functions in lexographic order. 2017-06-28 07:34:04 -04:00
Yago González
8ae0c90e9f zjquery: Return element in some jQuery methods.
jQuery's behavior in methods that, because of their nature, don't need to
return anything is to return the element itself in the jQuery object form.

Now the zjquery element is returned when one of these methods is called.
2017-06-26 08:38:21 -04:00
Yago González
1343216002 zjquery: Add select function. 2017-06-26 08:38:21 -04:00
Yago González
4b8a52cee0 zjquery: Handle passing elements to $().
There are some cases when the jQuery dollar
function is called with an element as argument.

If such element has already been created using
zjquery, we should simply return it.
2017-06-26 08:38:21 -04:00
Yago González
679325733d zjquery: Add extend method. 2017-06-26 08:38:21 -04:00
Yago González
a9c8efe871 zjquery: Add keydown and keyup functions. 2017-06-26 08:38:21 -04:00
Yago González
ad154da174 zjquery: Add generic event setter/handler. 2017-06-26 08:38:21 -04:00
Joshua Pan
8a6e8906bd zjquery: Add .click() function. 2017-06-20 19:49:23 -04:00
Steve Howell
6c722843ef node tests: Fix namespace leaks related to require().
The node tests have purged modules from cache that were
included via things like set_global(), but calling require
directly would leak modules into the next test, which made
a couple tests only work when you ran the whole suite.  I
fixed those tests to work standalone.  And then I now make
dependencies explicitly clear the require cache before we
require them in namespace.js.
2017-06-19 22:36:58 -04:00
Steve Howell
e0d79acac0 zjquery: Add attr() method. 2017-06-16 14:58:27 -04:00
Steve Howell
f91dc2fec9 zjquery: Add prop() function. 2017-06-16 08:47:54 -04:00
Steve Howell
dc9ea24d79 zjquery: Add get(). 2017-06-14 15:29:17 -04:00
Steve Howell
7722539504 zjquery: Add better trigger stubbing. 2017-06-14 15:26:41 -04:00
Steve Howell
5272b6644e zjquery: Support $('<div>').html(). 2017-06-14 08:17:03 -04:00
Steve Howell
736f4c2930 zjquery: Fix missing wrapper from last commit. 2017-06-12 07:43:04 -04:00
Steve Howell
8da391b51e zjquery: Fix chaining semantics.
We now make it so that $('foo').addClass(whatever) and similar
functions properly return the wrapper object for chaining
purposes.  We may eventually want to change the wrapper object
to automatically dispatch to the first child object, but this
should work for now.
2017-06-12 07:28:23 -04:00
Steve Howell
0b0c57bbe0 zjquery: Throw Error() object to get tracebacks.
If you throw a raw string in node, you don't get a traceback.
2017-05-31 09:10:43 -07:00
Steve Howell
689605dd2e Introduce make_zjquery(). 2017-05-24 17:41:41 -07:00
Steve Howell
46e72289d1 Add features to zjquery. 2017-05-24 17:41:41 -07:00
Steve Howell
4a062d47a6 Add more features to zjquery. 2017-05-24 13:08:54 -07:00
Steve Howell
1cb58d72b2 zjquery: Add focus/blur methods. 2017-05-23 18:52:25 -07:00
Steve Howell
cd08bbe7d8 zjquery: Add array-like functionality to elements.
(We simulate the behavior that a jquery object looks like an
array, but also has methods that can be called as if it were a
scalar.)
2017-05-23 18:52:25 -07:00
Steve Howell
4c520780a1 zjquery: Support $(func) flavor of $() calls. 2017-05-23 18:52:25 -07:00
Joshua Pan
f3369b266a node_tests: Extract and create fake_jquery as zjquery.
This allows us to use fake_jquery (originally only in
compose_actions.js) in all our node tests.
2017-05-23 10:27:07 -07:00
adnrs96
a91012bd70 Move thirdparty-fonts.css from static/styles to static/third. 2017-03-21 13:40:05 -07:00
Steve Howell
ef3033c79e node tests: Make with_overrides() more granular.
The with_overrides() function no longer works at the module
level, so you can temporarily override one function in a module
without breaking more permanent monkey patches.

This makes us slightly more vulnerable to unintentional test
leakages, but it solves the problem where you often need lots
of temporary overrides for writer functions but you want to
keep a more permanent override for some sort of reader function.
2017-03-13 15:09:53 -07:00
Steve Howell
a98999ce27 node tests: Extract with_overrides() helper.
The function with_overrides() uses the logic from the old
run() function in dispatch.js to allow you to call a test
function and override parts of the global namespace only
for the duration of when test_function runs.
2017-03-13 15:09:53 -07:00
Steve Howell
51c57bb05d node tests: Add with_stub() helper. 2017-03-13 15:09:53 -07:00
Tim Abbott
f037979fe0 zjsunit: Don't run tests on editor backup files. 2017-03-01 22:43:19 -08:00
Rafid Aslam
84e802422e deps: Upgrade and move underscore.js from static/third to npm
- Remove `underscore.js` from `static/third` and fetch it from `npm`.
- Upgrade `underscore.js` to 1.8.3.
- Bump up the `PROVISION_VERSION` to 4.2.

Part of #1709
2017-01-19 17:07:45 -08:00
Rafid Aslam
911fcd3831 deps: Upgrade and move codepointat from static/third to npm
- Remove `codepointat` from `static/third` and fetch it from `npm`.
- Upgrade `codepointat` to 0.2.0.
- Bump up the `PROVISION_VERSION` to 4.1.

Part of #1709.
2017-01-19 17:07:32 -08:00
Rafid Aslam
0290aeb6ab lint: Fix several no-unused-vars eslint rule violations.
These changes were extracted by tabbott from the original commit
to merge now because they have been reviewed as safe.
2016-12-03 18:43:47 -08:00
Tim Abbott
1a161c6e33 eslint: Fix comma-dangle rules in JS support files.
This was done via eslint --fix.
2016-12-03 15:00:24 -08:00
Tommy Ip
b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
Tommy Ip
c90da24541 eslint: change keyword-spacing from warning to error and fix violations. 2016-12-01 14:22:15 -08:00
Steve Howell
d953eca14c Make group PMs reply-to's more consistent in case.
We now sort lists of users ids deterministically, and we also
sort list of emails deterministically and without regard to case.

This probably fixes the bug #2343, although I never got a great
repro on that.
2016-11-26 11:48:52 -08:00
Steve Howell
578b276523 node tests: Add tests for message_store.js. 2016-11-26 11:48:52 -08:00
Steve Howell
6fe86adac8 node tests: Add newer stylesheets for HTML output. 2016-11-05 15:03:29 -07:00
Steve Howell
dae53573cb node tests: Fix make_sure_all_templates_have_been_compiled().
This now searches subdirectories.
2016-11-04 21:23:35 -07:00
Steve Howell
3d0c0e2e81 node tests: Remove retry logic for compiling templates.
We can now use template_finder.get() to find the name we need.
2016-11-04 21:23:35 -07:00
Steve Howell
a2874a3fe9 node tests: Simplify compiling of templates.
Now we just have two methods of importance:

    compile_template
    render_template

The compile_template() function will automatically
(and recursively) compile any partials it depends
on and mark those as compiled.
2016-11-04 11:23:11 -07:00
Steve Howell
0085164ad9 node tests: Avoid re-compiling templates.
This is a minor optimization to avoid re-compiling templates
that have already encountered.
2016-11-04 11:23:11 -07:00
Steve Howell
dd4a8eeebd node tests: Extract render.find_included_partials(). 2016-11-04 11:23:11 -07:00
Steve Howell
155f7881b2 node tests: Extact template_finder() class. 2016-11-04 11:23:11 -07:00
Steve Howell
61d88cfc13 node tests: Use template_dir() to walk templates. 2016-11-04 11:23:11 -07:00