github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 494
    • 78
  • Source
  • Commits
  • Network (78)
  • Graphs
  • Tree: 2f11730

click here to add a description

click here to add a homepage

  • Switch Branches (7)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
  • Switch Tags (17)
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Externals: updated jquery.cookie plugin to 
http://github.com/carhartl/jquery-cookie commit 
6818b83dff89e9cac9e95acd9d78bf0179777e3d
rdworth (author)
Wed Feb 24 10:46:56 -0800 2010
commit  2f11730a5258092872f1
tree    ac9c8bbde94e608d5c5a
parent  a5eab4cc38c73c3c54b9
D external/jquery.cookie-r6165.js 97 •••••
A external/jquery.cookie.js 89 •••••
M tests/unit/all.html 2 ••
M tests/unit/all_2.html 2 ••
M tests/unit/defaults.html 2 ••
M tests/unit/index.html 2 ••
M tests/unit/tabs/tabs.html 2 ••
Txt external/jquery.cookie-r6165.js
  • View file @ 2f11730
... ...
@@ -1,97 +0,0 @@
1  
-/**
2  
- * Cookie plugin
3  
- *
4  
- * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5  
- * Dual licensed under the MIT and GPL licenses:
6  
- * http://www.opensource.org/licenses/mit-license.php
7  
- * http://www.gnu.org/licenses/gpl.html
8  
- *
9  
- */
10  
-
11  
-/**
12  
- * Create a cookie with the given name and value and other optional parameters.
13  
- *
14  
- * @example $.cookie('the_cookie', 'the_value');
15  
- * @desc Set the value of a cookie.
16  
- * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
17  
- * @desc Create a cookie with all available options.
18  
- * @example $.cookie('the_cookie', 'the_value');
19  
- * @desc Create a session cookie.
20  
- * @example $.cookie('the_cookie', null);
21  
- * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
22  
- *       used when the cookie was set.
23  
- *
24  
- * @param String name The name of the cookie.
25  
- * @param String value The value of the cookie.
26  
- * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
27  
- * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
28  
- *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
29  
- *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
30  
- *                             when the the browser exits.
31  
- * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
32  
- * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
33  
- * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
34  
- *                        require a secure protocol (like HTTPS).
35  
- * @type undefined
36  
- *
37  
- * @name $.cookie
38  
- * @cat Plugins/Cookie
39  
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
40  
- */
41  
-
42  
-/**
43  
- * Get the value of a cookie with the given name.
44  
- *
45  
- * @example $.cookie('the_cookie');
46  
- * @desc Get the value of a cookie.
47  
- *
48  
- * @param String name The name of the cookie.
49  
- * @return The value of the cookie.
50  
- * @type String
51  
- *
52  
- * @name $.cookie
53  
- * @cat Plugins/Cookie
54  
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
55  
- */
56  
-jQuery.cookie = function(name, value, options) {
57  
-    if (typeof value != 'undefined') { // name and value given, set cookie
58  
-        options = options || {};
59  
-        if (value === null) {
60  
-            value = '';
61  
-            options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
62  
-            options.expires = -1;
63  
-        }
64  
-        var expires = '';
65  
-        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
66  
-            var date;
67  
-            if (typeof options.expires == 'number') {
68  
-                date = new Date();
69  
-                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
70  
-            } else {
71  
-                date = options.expires;
72  
-            }
73  
-            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
74  
-        }
75  
-        // NOTE Needed to parenthesize options.path and options.domain
76  
-        // in the following expressions, otherwise they evaluate to undefined
77  
-        // in the packed version for some reason...
78  
-        var path = options.path ? '; path=' + (options.path) : '';
79  
-        var domain = options.domain ? '; domain=' + (options.domain) : '';
80  
-        var secure = options.secure ? '; secure' : '';
81  
-        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
82  
-    } else { // only name given, get cookie
83  
-        var cookieValue = null;
84  
-        if (document.cookie && document.cookie != '') {
85  
-            var cookies = document.cookie.split(';');
86  
-            for (var i = 0; i < cookies.length; i++) {
87  
-                var cookie = jQuery.trim(cookies[i]);
88  
-                // Does this cookie string begin with the name we want?
89  
-                if (cookie.substring(0, name.length + 1) == (name + '=')) {
90  
-                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
91  
-                    break;
92  
-                }
93  
-            }
94  
-        }
95  
-        return cookieValue;
96  
-    }
97  
-};
98 0
\ No newline at end of file
Txt external/jquery.cookie.js
  • View file @ 2f11730
... ...
@@ -0,0 +1,89 @@
  1
+/*jslint browser: true */ /*global jQuery: true */
  2
+
  3
+/**
  4
+ * jQuery Cookie plugin
  5
+ *
  6
+ * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
  7
+ * Dual licensed under the MIT and GPL licenses:
  8
+ * http://www.opensource.org/licenses/mit-license.php
  9
+ * http://www.gnu.org/licenses/gpl.html
  10
+ *
  11
+ */
  12
+
  13
+// TODO JsDoc
  14
+
  15
+/**
  16
+ * Create a cookie with the given key and value and other optional parameters.
  17
+ *
  18
+ * @example $.cookie('the_cookie', 'the_value');
  19
+ * @desc Set the value of a cookie.
  20
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
  21
+ * @desc Create a cookie with all available options.
  22
+ * @example $.cookie('the_cookie', 'the_value');
  23
+ * @desc Create a session cookie.
  24
+ * @example $.cookie('the_cookie', null);
  25
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
  26
+ *       used when the cookie was set.
  27
+ *
  28
+ * @param String key The key of the cookie.
  29
+ * @param String value The value of the cookie.
  30
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
  31
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
  32
+ *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
  33
+ *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
  34
+ *                             when the the browser exits.
  35
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
  36
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
  37
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
  38
+ *                        require a secure protocol (like HTTPS).
  39
+ * @type undefined
  40
+ *
  41
+ * @name $.cookie
  42
+ * @cat Plugins/Cookie
  43
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
  44
+ */
  45
+
  46
+/**
  47
+ * Get the value of a cookie with the given key.
  48
+ *
  49
+ * @example $.cookie('the_cookie');
  50
+ * @desc Get the value of a cookie.
  51
+ *
  52
+ * @param String key The key of the cookie.
  53
+ * @return The value of the cookie.
  54
+ * @type String
  55
+ *
  56
+ * @name $.cookie
  57
+ * @cat Plugins/Cookie
  58
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
  59
+ */
  60
+jQuery.cookie = function (key, value, options) {
  61
+
  62
+    // key and value given, set cookie...
  63
+    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
  64
+        options = jQuery.extend({}, options);
  65
+
  66
+        if (value === null) {
  67
+            options.expires = -1;
  68
+        }
  69
+
  70
+        if (typeof options.expires === 'number') {
  71
+            var days = options.expires, t = options.expires = new Date();
  72
+            t.setDate(t.getDate() + days);
  73
+        }
  74
+
  75
+        return (document.cookie = [
  76
+            encodeURIComponent(key), '=',
  77
+            options.raw ? String(value) : encodeURIComponent(String(value)),
  78
+            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
  79
+            options.path ? '; path=' + options.path : '',
  80
+            options.domain ? '; domain=' + options.domain : '',
  81
+            options.secure ? '; secure' : ''
  82
+        ].join(''));
  83
+    }
  84
+
  85
+    // key and possibly options given, get cookie...
  86
+    options = value || {};
  87
+    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
  88
+    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
  89
+};
Txt tests/unit/all.html
  • View file @ 2f11730
... ...
@@ -21,7 +21,7 @@
21 21
   <script type="text/javascript" src="../../ui/jquery.ui.tabs.js"></script>
22 22
 
23 23
   <script type="text/javascript" src="../../external/testrunner-r6588.js"></script>
24  
-  <script type="text/javascript" src="../../external/jquery.cookie-r6165.js"></script>
  24
+  <script type="text/javascript" src="../../external/jquery.cookie.js"></script>
25 25
   <script type="text/javascript" src="../jquery.simulate.js"></script>
26 26
   <script type="text/javascript" src="testsuite.js"></script>
27 27
 
Txt tests/unit/all_2.html
  • View file @ 2f11730
... ...
@@ -54,7 +54,7 @@
54 54
   <script type="text/javascript" src="../../ui/jquery.ui.tabs.js"></script>
55 55
 
56 56
   <script type="text/javascript" src="../../external/testrunner-r6588.js"></script>
57  
-  <script type="text/javascript" src="../../external/jquery.cookie-r6165.js"></script>
  57
+  <script type="text/javascript" src="../../external/jquery.cookie.js"></script>
58 58
   <script type="text/javascript" src="../jquery.simulate.js"></script>
59 59
 
60 60
   <style type="text/css">
Txt tests/unit/defaults.html
  • View file @ 2f11730
... ...
@@ -21,7 +21,7 @@
21 21
   <link   type="text/css"       href="testsuite.css" rel="stylesheet" />
22 22
   <script type="text/javascript" src="testsuite.js"></script>
23 23
   <script type="text/javascript" src="../../external/testrunner-r6588.js"></script>
24  
-  <script type="text/javascript" src="../../external/jquery.cookie-r6165.js"></script>
  24
+  <script type="text/javascript" src="../../external/jquery.cookie.js"></script>
25 25
   <script type="text/javascript" src="../jquery.simulate.js"></script>
26 26
 
27 27
   <script type="text/javascript" src="draggable/draggable_defaults.js"></script>
Txt tests/unit/index.html
  • View file @ 2f11730
... ...
@@ -24,7 +24,7 @@
24 24
   <script type="text/javascript" src="../../ui/jquery.ui.sortable.js"></script>
25 25
   <script type="text/javascript" src="../../ui/jquery.ui.tabs.js"></script>
26 26
 
27  
-  <script type="text/javascript" src="../../external/jquery.cookie-r6165.js"></script>
  27
+  <script type="text/javascript" src="../../external/jquery.cookie.js"></script>
28 28
   <script type="text/javascript" src="../jquery.simulate.js"></script>
29 29
 
30 30
 </head>
Txt tests/unit/tabs/tabs.html
  • View file @ 2f11730
... ...
@@ -10,7 +10,7 @@
10 10
 
11 11
   <link   type="text/css"       href="../testsuite.css" rel="stylesheet" />
12 12
   <script type="text/javascript" src="../../../external/testrunner-r6588.js"></script>
13  
-  <script type="text/javascript" src="../../../external/jquery.cookie-r6165.js"></script>
  13
+  <script type="text/javascript" src="../../../external/jquery.cookie.js"></script>
14 14
   <script type="text/javascript" src="../../jquery.simulate.js"></script>
15 15
   <script type="text/javascript" src="../testsuite.js"></script>
16 16
 

0 notes on commit 2f11730

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server