1. 22 Oct, 2015 4 commits
  2. 21 Oct, 2015 30 commits
    • Nick Stenning's avatar
      Merge pull request #2629 from hypothesis/angular-1.4 · b6f14aea
      Nick Stenning authored
      Upgrade to Angular 1.4.7
      b6f14aea
    • Sean Hammond's avatar
      Rename "public" -> "shared" · 7b6c8560
      Sean Hammond authored
      Rename permissions.public() -> permissions.shared() and
      permissions.isPublic() -> permissions.isShared().
      
      This is more consistent with language used elsewhere in the code, now
      that we have groups.
      7b6c8560
    • Sean Hammond's avatar
      Set group and visibility of reply to that of parent · 6fe1e357
      Sean Hammond authored
      Set the group and visibility of replies to that of their parents, when
      replies are first created.
      
      Also prevent the visibility setting of a reply from overwriting the
      cached-in-local-storage visibility level. This prevents the following
      problem:
      
      - I'm annotating publicly (my cached-in-local-storage visibility
        setting is public)
      - I reply to a private annotation
      - The visibility of my reply is set to that of its parent, private
      - This visibility is then cached in local storage
      - I make a new top-level annotation, and now it's defaulting to private
        instead of public, even though the user never did anything to change
        the visibility from public to private, it was done automatically
        because they replied to a private annotation.
      
      Obviously changing the mode from private to public when replying to a
      public annotation was also possible.
      
      This means that if the user _does_ change the visibility of a reply, we
      _don't_ cache that either:
      
      - I'm annotating publicly (my cached-in-local-storage visibility
        setting is public)
      - I reply to a public annotation
      - The visibility of my reply is set to that of its parent, public
      - This visibility is not cached in local storage because it's a reply
        (and the value cached in the local storage is already the same anyway)
      - I then deliberately change the visibility of my reply from public to
        private
      - Again this visibility is not cached in local storage because it's a reply
      - The next time I make a new top-level annotation, it will still be
        defaulting to public, will not have changed to private mode
      6fe1e357
    • Robert Knight's avatar
      Fix test for clearing response errors when form value changes · dbac8b0d
      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.
      dbac8b0d
    • Nick Stenning's avatar
      Set CSRF token for session headers explicitly · 1abbf605
      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.
      1abbf605
    • Robert Knight's avatar
      Fix markdown editor under Angular 1.4 · 6338b75e
      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.
      6338b75e
    • Nick Stenning's avatar
      Don't mix-and-match Angular and native Promises · 5812fc46
      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.
      5812fc46
    • Nick Stenning's avatar
      Strip internal properties before sending data to the server · f2c25e3b
      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.
      f2c25e3b
    • Nick Stenning's avatar
      701b393c
    • Nick Stenning's avatar
      Remove unneeded ui-bootstrap shim · c85685e9
      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.
      c85685e9
    • Nick Stenning's avatar
      Upgrade angular-toastr to v1.5.0 · a47bcb6a
      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.
      a47bcb6a
    • Nick Stenning's avatar
      Upgrade Angular to v1.4.7 · 4bb09771
      Nick Stenning authored
      4bb09771
    • Nick Stenning's avatar
      Merge pull request #2643 from hypothesis/t91-sort_dropdown_move_to_top_bar · 2f101ab2
      Nick Stenning authored
      Move sort dropdown to top bar
      2f101ab2
    • Robert Knight's avatar
      Adjust the font size of all top bar text · a7275737
      Robert Knight authored
      Use 14px for all top bar menu item text
      for consistency.
      
      T-91
      a7275737
    • Robert Knight's avatar
      Update filter icon · 09b7b6a6
      Robert Knight authored
      Update to the latest version of the sort/filter toolbar
      icon from the Trello card.
      
      T-91
      09b7b6a6
    • Robert Knight's avatar
      Improve display of dropdown menu for non-groups users · a5f24abc
      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
      a5f24abc
    • Robert Knight's avatar
      Add API comments for dropdown menu directive · 7a0bca59
      Robert Knight authored
      T-91
      7a0bca59
    • Robert Knight's avatar
      Use BEM naming consistently for dropdown menu elements · f0aaf620
      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.
      f0aaf620
    • Robert Knight's avatar
      Correct spacing between sort dropdown radio and labels · 8175c629
      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.
      8175c629
    • Robert Knight's avatar
    • Robert Knight's avatar
      d41ba362
    • Robert Knight's avatar
      Move sort control into top bar · 0c72b7f0
      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
      0c72b7f0
    • Nick Stenning's avatar
      Center and adjust padding on form-flash · 58b87a2b
      Nick Stenning authored
      58b87a2b
    • Robert Knight's avatar
      Merge pull request #2636 from hypothesis/replace-profile-form · 4c0cdba3
      Robert Knight authored
      Replace client-side profile form
      4c0cdba3
    • Nick Stenning's avatar
      Add confirmation messages to profile forms · 7d30a9ea
      Nick Stenning authored
      Flash confirmation messages when profile forms are successfully
      submitted.
      7d30a9ea
    • Nick Stenning's avatar
      Remove client-side profile forms · df2d8ebb
      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.
      df2d8ebb
    • Nick Stenning's avatar
      Add profile and notifications forms · 197868e3
      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.
      197868e3
    • Nick Stenning's avatar
      Merge pull request #2635 from hypothesis/remove-get-by-userid · 17954cf0
      Nick Stenning authored
      Remove get_by_userid()
      17954cf0
    • Nick Stenning's avatar
      Merge pull request #2639 from robertknight/extension_build_type_indicator · 39b53e3a
      Nick Stenning authored
      Extension build type indicator
      39b53e3a
    • Sean Hammond's avatar
      Merge pull request #2647 from hypothesis/fix-changing-size-socketlist · fbdca150
      Sean Hammond authored
      Iterate over a copy of the open websockets list
      fbdca150
  3. 20 Oct, 2015 4 commits
  4. 19 Oct, 2015 2 commits