When a user flags something simultaneously write the entity and flag to localstorage. Flags in localstorage will allow for offline retrieval of flagged content. For example, for a conference having wifi/connectivity issues having the flags stored locally could mean that the user could see their favorited sessions without needing a connection (assuming rest of site handled offline appropriately).

Could provide optional sync from server and update server features.

I'm willing to begin working on this.

Comments

quicksketch’s picture

Sounds interesting but not really something that should be in Flag core, IMO. I don't think Flag should really be getting into caching pages or entities, though using local storage as a complement to cookies to keep track of flagged content could be interesting and more secure than sending cookies back and forth all the time.

coltrane’s picture

Flag wouldn't be caching the whole page, just some properties of certain entities. This could be rendered a couple ways on a page, depending on how content is shown.

On a listing of content JS could read flagged entity ids from localstorage and mark the corresponding content so.

If it's a specialized list of already flagged content then more details would need to be stored in localstorage to render that list. For example a page of flagged content could only show that content from localstorage if its all stored there, id's title, url etc.

quicksketch’s picture

On a listing of content JS could read flagged entity ids from localstorage and mark the corresponding content so.

This sounds like what we're doing already with cookies and anonymous user flagging. Already we're rending all flags in the "unflagged" state, then iterating over all flagged content stored in cookies and toggling all the links to their flagged state.

I'm still pretty skeptical of this feature request, it sounds interesting but so far it's a lot of hand-waving and not a lot of concrete suggestion.

coltrane’s picture

"a lot of hand-waving and not a lot of concrete suggestion"

Haha, fair enough. I certainly wasn't requesting that you work on this for me, but "testing the waters" so-to-speak.

joachim’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

Upping the version.

ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 is EOL. No more new features will be added.