Download & Extend

Add jquery cookie library

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.

AttachmentSizeStatusTest resultOperations
jquery.cookies.js.txt5.21 KBIgnored: Check issue status.NoneNone

Comments

#1

#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

Status:active» needs work

Ok, makes total sense, agreed.

#5

Status:needs work» needs review

Minified jquery cookie 1.0 (from http://plugins.jquery.com/files/jquery.cookie.js.txt), added $Id$ tag and version information.

AttachmentSizeStatusTest resultOperations
507072-jquery-cookie.patch1.33 KBIdleUnable to apply patch 507072-jquery-cookie.patchView details

#6

Title:Add jquery.cookies.js library» Add jquery cookie library

#7

Title:Add jquery cookie library» Add jquery.cookies.js library
Status:needs review» fixed

Committed to CVS HEAD. Thanks.

#8

Title:Add jquery.cookies.js library» Add jquery cookie library
Status:fixed» needs review

#9

Status:needs review» fixed

crossposted?

#10

Status:fixed» closed (fixed)

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

Status:closed (fixed)» closed (duplicate)

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

Status:closed (duplicate)» closed (fixed)

Hum, this one had code committed, so why set as duplicate?