Skip to content

Create the functionality to add laws to a portfolio #30

Closed

Description

@waldoj

Let people maintain a sort of a shopping cart of laws (and chapters, titles, etc?).

  • create JavaScript functions to add, remove, and display the status of an individual law in local storage
  • create a JavaScript function to list every law in local storage
  • implement the add/remove/status functionality on the law page
  • create a new page to list every law in local storage
  • devise a name for this feature
  • display the menu item for this new page only if the user has 1+ laws in local storage

Activity

  1. waldoj commented on Aug 29, 2013

    @waldoj
    MemberAuthor

    Use local storage for this and skip all the PHP.

  2. waldoj commented on Sep 5, 2013

    @waldoj
    MemberAuthor

    This can be done with jQuery. When triggered by a user action, execute localStorage.setItem(this.law,'saved') or localStorage.removeItem(this.law), or something like that. Each law's page can reflect whether or not the law has been saved by the person, and then the portfolio page can just iterate through all of the laws in the user's portfolio and display the list.

  3. waldoj commented on Sep 15, 2013

    @waldoj
    MemberAuthor

    It really would be helpful if, at the time that this function was triggered, we also made a call to the server to simply report that somebody (anonymously) has added this law to their portfolio. If we can know that an individual is tracking a particular collection of laws, then we can know that those laws are in some way related. That's really useful. It's great to do this client-side, but don't lose the really useful data that comes of having some knowledge about who's tracking what.

  4. krusynth commented on Nov 5, 2014

    @krusynth
    Member

    Propose moving Milestone to Future.

  5. waldoj commented on Nov 5, 2014

    @waldoj
    MemberAuthor

    I don't want to let this go. At a minimum, I want to add the functionality without server-side tracking. At that point, it's just a handful of lines of JavaScript and a bit of CSS. It might not even need its own page—it could just be an overlay.

  6. krusynth commented on Nov 5, 2014

    @krusynth
    Member

    Keep in mind something like this needs a lot of UX to be done right. It's not just an add-to-cart, it's also remove-from-cart, organize-my-cart, etc - and all of that needs to be designed.

    And of course the legalese at the bottom has to get an update because of cookie Local Storage use (privacy policy), and on any european installations we'll need a theme with a popup to tell them cookies local storage is in use. Disregard, localStorage has pretty decent browser support. Disregard my disregarding, the laws that cover cookie usage also cover localStorage. Huh.

  7. waldoj commented on Nov 5, 2014

    @waldoj
    MemberAuthor

    Nah, no need for cookies—it's all in local storage. And I'm not worried about Europe—I don't have the faintest idea of how their legal codes work, but it's way out of the scope of this project now. And I don't see any need for organizing as a 1.0 feature. Really, it's just add and remove, and remove can just be a toggled display on the law page (e.g., "Add" becomes "Remove").

    Ain't no harm in trying. I'll enjoy it.

  8. krusynth commented on Nov 5, 2014

    @krusynth
    Member

    Ok, but please at least try to get a few minutes of @boboroshi 's time on this. ;) Modals suck.

  9. krusynth commented on Nov 5, 2014

    @krusynth
    Member

    The legalese will need to be updated though. If we're putting anything on user's computers, we need some sort of privacy policy by default. Our localities won't be cool with it otherwise. (To be fair, we probably need one for Google Analytics as well though. Oops.)

  10. waldoj commented on Nov 5, 2014

    @waldoj
    MemberAuthor

    The legalese is really just isn't our problem. It's up to everybody installing this to determine what laws matter in their state and locality and provide the appropriate TOS, privacy policy, etc. Just as with WordPress, Drupal, etc.

    As people who also implement this software, legalese is our problem, but that's wearing a different hat. :)

  11. krusynth commented on Nov 5, 2014

    @krusynth
    Member

    My hat is very complicated and dapper. 🎩

  12. krusynth commented on Nov 6, 2014

    @krusynth
    Member

    @waldoj Not to beat a dead horse here, but what's the point of this feature? How is it not just duplicating the native bookmarks in-browser? Or is this for offline reading?

  13. waldoj commented on Nov 6, 2014

    @waldoj
    MemberAuthor

    This has been an often-requested feature. People researching laws often find multiple relevant ones, and they want to mark the ones that seem relevant, as they go. Like a shopping cart, but for laws. This is especially for citizens who are doing their own legal research, not attorneys or lawmakers (that's who keeps requesting this).

  14. krusynth commented on Nov 6, 2014

    @krusynth
    Member

    Do they not know how to bookmark things? ¯(°_o)/¯

  15. waldoj commented on Nov 6, 2014

    @waldoj
    MemberAuthor

    Almost nobody bookmarks things, and those who do regard it not as a place for temporary collections (ie, "laws that might potentially be the one I'm looking for over ten minutes of research") but instead permanent ("now that I've signed up for online banking, I should bookmark the site"). Bookmark management is built to encourage this behavior.

  16. krusynth commented on May 13, 2015

    @krusynth
    Member

    I'm reading more on localstorage and it sounds like it's just as impermanent as cookies:

    I can't speak for other platforms, but on my 4.1 Android device, I'm using localStorage to store some data locally with jQuery Mobile, and I've found that Android will clear my cache every week or so without my knowledge.

    http://stackoverflow.com/questions/7750857/how-permanent-is-local-storage-on-android-and-ios

    I'm not sure this is a good way to implement this feature if it's so ephemeral. Cookies have similar problems - we can try and make them "permanent", but it's not going to stick. We really will have to document this if we're going to do it, because it's going to be losing people's data constantly.

  17. waldoj commented on May 13, 2015

    @waldoj
    MemberAuthor

    Yup. If people delete their local storage (not something people generally do accidentally) then, yes, they will lose their local storage. Short of an entire login and password system, there is nothing that will survive people deleting their cookies or their local storage. :) I bet we could set an expiry date of 30 days, and it would still work great for just about everybody. The traffic patterns that I see are people engaging in short bursts of research—anywhere from an hour to a week—and then they don't come back.

  18. added a commit that references this issue on Jan 18, 2017
    d0496cb
  19. krusynth commented on Jan 18, 2017

    @krusynth
    Member

    screen shot 2017-01-18 at 2 43 31 pm
    screen shot 2017-01-18 at 2 43 46 pm

  20. waldoj commented on Jan 18, 2017

    @waldoj
    MemberAuthor

    Oooh, very nice! The pinned metaphor works well, too.

  21. added 2 commits that reference this issue on Apr 7, 2017
    571a53c
    cdbc2e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions