- 21 Oct, 2015 27 commits
-
-
Robert Knight authored
In Angular 1.4.x, calling ngModelController.$setViewValue() does not trigger parsing and validation if the current view value is the same as the previous view value.
-
Nick Stenning authored
angular/angular.js@5da1256fc2812d5b28fb0af0de81256054856369 made it impossible for `transformRequest` functions to modify request headers, so instead we maintain a global header map which is updated when the session is updated.
-
Robert Knight authored
The read-only state was not being passed correctly from the annotation viewer to the markdown editor, possibly due to the use of the 'ng-readonly' which in turn set the 'readonly' attribute that the 'markdown' directive tried to read. This converts the markdown editor to use the preferred style of an element directive plus a 'read-only' attr.
-
Nick Stenning authored
Well this was fun to debug. Not. So, it seems that in 1.4 (as opposed to 1.2) Angular Promises are special, and don't play well with native browser Promises. In particular, Angular promises don't resolve until a digest cycle, which means that while this test will pass: it('should resolve', function (done) { var resolved = false; $timeout(function () { resolved = true; }); .then(function () { assert.isTrue(resolved); }) .then(done, done); $timeout.flush(); // <- this triggers a digest cycle }); This one will not -- Mocha will time it out, because the digest cycle triggered by `$timeout.flush()` occurs before the fulfillment handlers (with the assertions and the call to `done`) are registered: it('should resolve', function (done) { var resolved = false; var wait = $timeout(function () { resolved = true; }); $timeout.flush(); wait.then(function () { assert.isTrue(resolved); }) .then(done, done); }); If that were the whole story, I would be merely mildly displeased. But it's not... The return value of a call to `.then(onFulfilled, onRejected)` is a promise of the return value of the `onFulfilled` callback, which is what makes Promises chainable. If `onFulfilled` returns a promise, then that is (or should be) the promise returned by `.then(...)`. Unfortunately, if we actually do this: it('should resolve', function (done) { $timeout(function () { return Promise.resolve('abc'); }) .then(function (val) { assert.equal(val, 'abc'); }) .then(done, done); $timeout.flush(); // <- this triggers a digest cycle }); Then again, Mocha will time out on this test. This is probably because the returned Promise resolves on runtime `nextTick`, which is *after* the call to `$timeout.flush()`, which means it's after the relevant part of the digest cycle which processes the fulfillment handlers for the Angular-style promise. ARGH, Angular. Argh.
-
Nick Stenning authored
Since angular/angular.js@c054288c9722875e3595e6e6162193e0fb67a251, `angular.toJson` only strips properties beginning with `$$`, and not `$`. We set properties on annotations (such as `$orphan`) so need to reimplement the earlier behaviour. I've also taken this opportunity to translate the store service to JavaScript.
-
Nick Stenning authored
-
Nick Stenning authored
This shim was used to facilitate the use of a newer version of the 'ui.bootstrap' module with an older version of Angular. Upgrading to Angular 1.4 renders it surplus to requirements.
-
Nick Stenning authored
Upgrades angular-toastr to a version compatible with Angular 1.4. We now use the version of angular-toastr from NPM, rather than our own vendored copy.
-
Nick Stenning authored
-
Nick Stenning authored
Move sort dropdown to top bar
-
Robert Knight authored
Use 14px for all top bar menu item text for consistency. T-91
-
Robert Knight authored
Update to the latest version of the sort/filter toolbar icon from the Trello card. T-91
-
Robert Knight authored
Align the dropdown menu's top arrow with the bottom arrow of the menu. As the styling of the dropdown was adjusted for its new home in the top bar, it became wider and the previous alignment of the menu resulted in it disappearing off the left edge of the sidebar. T-91
-
Robert Knight authored
T-91
-
Robert Knight authored
Dropdown menus were using BEM element naming in some places and tag name selectors in others. This updates the styling to use BEM element naming consistently.
-
Robert Knight authored
Remove the padding from the links in the dropdown menus and apply it to the row itself instead. This makes it easier to keep consistent spacing with different menu item contents in the dropdowns.
-
Robert Knight authored
T-91
-
Robert Knight authored
T-91
-
Robert Knight authored
When the 'Groups' feature is enabled, move the sort menu into a dropdrown triggered via a button in the top bar. T-91
-
Nick Stenning authored
-
Robert Knight authored
Replace client-side profile form
-
Nick Stenning authored
Flash confirmation messages when profile forms are successfully submitted.
-
Nick Stenning authored
Remove the client-side profile forms which are now implemented on the server. This actually removes a couple of dependencies which we can also remove. In particular the "tabbable" directive from angular-bootstrap is no longer needed.
-
Nick Stenning authored
Add server-rendered profile update and notifications settings forms. Unlike the previous changes I've made to form-handling, these are not straightforward translations of the forms that existed in the sidebar, for a couple of different reasons: - The profile update form no longer has a delete account button. The delete account functionality doesn't really do anything: it sets a random password and logs the user out. We haven't removed any of their personally identifying information, and we can't even tell by looking at the database who has attempted to delete their account. We've agreed to remove this button until such time as we can implement the feature properly. In its place is a paragraph inviting users who wish to delete their accounts to email support. - The wording and layout of the notifications update form has been tweaked to read more clearly.
-
Nick Stenning authored
Remove get_by_userid()
-
Nick Stenning authored
Extension build type indicator
-
Sean Hammond authored
Iterate over a copy of the open websockets list
-
- 20 Oct, 2015 4 commits
-
-
Nick Stenning authored
Extract sort dropdown into own component
-
Nick Stenning authored
Extension badge refactor
-
Robert Knight authored
Extract the sort dropdown into a reusable component and add tests. T-91
-
Robert Knight authored
Make BrowserAction actually stateless - its responsibility is just to map the logical H state of a tab (active/inactive/errored, annotation count) to the badge state. * Convert the per-tab state stored in TabState from a string into an object so that we can store additional state, starting with the badge count. * Move the function for fetching the badge's annotation count and updating the H tab state into TabState. This decouples the presentation of the badge from the logic of making network requests and updating the model.
-
- 19 Oct, 2015 8 commits
-
-
Nick Stenning authored
Update npm / python modules before running tests
-
Nick Stenning authored
Fix an issue where clicking the search icon would submit the form
-
Robert Knight authored
Make settings loader CSP-compatible
-
Nick Stenning authored
I forgot about CSP! We disallow inline scripts in the Chrome extension, so 18c47ba broke the extension. This commit replaces an inline script with some JSON data, parsed by the settings factory.
-
Robert Knight authored
Clicking the search icon should only focus the search field, not submit the search. This addresses the issue mentioned at https://github.com/hypothesis/h/pull/2622#issuecomment-148808509
-
Nick Stenning authored
New design for top bar
-
Nick Stenning authored
Add userid_domain config setting
-
Nick Stenning authored
Fix group link not being focused in dropdown menu if group hash IDs started with a number
-
- 16 Oct, 2015 1 commit
-
-
Robert Knight authored
The hash ID was not quoted when constructing the selector used to find the group's link field in order to focus it, resulting in an error depending on the chars in the hash ID.
-