| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | javascript |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
At the admin header issue for D7, sun suggests adding in a standard cookie handling library to Drupal instead of one-off implementations of cookie parsing in modules. In case of admin header it would be the remembering of the collapsed state of the lower shortcut bar. I've reworked the admin header code to use the jquery.cookies.js library, and it is pretty easily done. So I'd suggest adding this library in.
Attached is a core-targetted version of the latest version. That is:
- I've added the name of the library and the version to the top comment. It was not in the downloadable one.
- I've added // $Id$ on the top for CVS versioning.
Suggested to commit to misc/, not in patch form, since it is just a single new file.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| jquery.cookies.js.txt | 5.21 KB | Ignored: Check issue status. | None | None |
Comments
#1
@sun's suggestion is at http://drupal.org/node/484820#comment-1739548 on #484820: Initial D7UX admin header
#2
Note that there are many cookie libraries, with http://plugins.jquery.com/project/Cookie and http://plugins.jquery.com/project/Cookies being two prominent ones. This suggestion is for the later, but the former can be more lightweight and has less features. For the header shortcut bar, the only requirement is to be able to read and write cookies, so either works. If we go with the smaller one (Cookie), then we'd even want to minify it, since it comes in its full source form, which is inconsistent with how we include other libraries.
#3
Since we added jQuery UI to core, and various of the jQuery UI libraries implement optional support for http://plugins.jquery.com/project/cookie, that is the plugin we want to add.
@see http://docs.jquery.com/UI/API/1.7/Tabs
@see http://code.google.com/p/jquery-ui/source/browse/trunk/ui/ui.tabs.js
#4
Ok, makes total sense, agreed.
#5
Minified jquery cookie 1.0 (from http://plugins.jquery.com/files/jquery.cookie.js.txt), added $Id$ tag and version information.
#6
#7
Committed to CVS HEAD. Thanks.
#8
#9
crossposted?
#10
Automatically closed -- issue fixed for 2 weeks with no activity.
#11
The mod_security Apache module seems to be incompatible with the jquery.cookie.js filename as it is. Opened #522646: jquery.cookie.js incompatible with Apache mod_security by default with more backround info, so we can resolve this.
#12
This idea was already in progress with an in-depth discussion at #305221: Add a small cookie handling functions to drupal.js. Marking as duplicate.
#13
Hum, this one had code committed, so why set as duplicate?