Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
integration:foxycart:multiship_javascript_070 [2013/04/02 06:04] – [Data entry] adam | integration:foxycart:multiship_javascript_070 [2017/04/26 07:02] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
name : multiship_jquery_070+ #the name of the integration | name : multiship_jquery_070+ #the name of the integration | ||
description | description | ||
- | tags_tags | + | tags |
date_dt | date_dt | ||
version | version | ||
Line 107: | Line 107: | ||
jQuery.each(shipto, | jQuery.each(shipto, | ||
// alert(' | // alert(' | ||
- | if (val != ' | + | if (val != ' |
shipto_options += '< | shipto_options += '< | ||
// alert(' | // alert(' | ||
Line 119: | Line 119: | ||
shipto_options += '< | shipto_options += '< | ||
shipto_options += '< | shipto_options += '< | ||
- | shipto_options += '< | + | shipto_options += '< |
// Set the select boxes with the proper values | // Set the select boxes with the proper values | ||
Line 144: | Line 144: | ||
jQuery(' | jQuery(' | ||
} else { | } else { | ||
- | jQuery(' | + | jQuery(' |
} | } | ||
Line 180: | Line 180: | ||
jQuery.cookie(' | jQuery.cookie(' | ||
- | if ((shipto_new != ' | + | if ((shipto_new != ' |
jQuery.cookie(' | jQuery.cookie(' | ||
jQuery.cookie(' | jQuery.cookie(' | ||
Line 221: | Line 221: | ||
} | } | ||
// ============================================================================ | // ============================================================================ | ||
- | |||
- | |||
- | |||
// ============================================================================ | // ============================================================================ | ||
- | /** | + | /*! |
- | * Cookie | + | |
- | * | + | |
- | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) | + | |
- | | + | |
- | * http://www.opensource.org/licenses/mit-license.php | + | |
- | * http:// | + | |
* | * | ||
+ | * Copyright 2013 Klaus Hartl | ||
+ | * Released under the MIT license | ||
*/ | */ | ||
- | + | (function(d){" | |
- | /** | + | JSON.stringify(c):String(c);return document.cookie=[e.raw? |
- | * Create a cookie with the given name and value and other optional parameters. | + | d.cookie(a)?(d.cookie(a,"", |
- | * | + | |
- | * @example $.cookie(' | + | |
- | * @desc Set the value of a cookie. | + | |
- | * @example $.cookie(' | + | |
- | * @desc Create | + | |
- | * @example $.cookie(' | + | |
- | * @desc Create | + | |
- | * @example $.cookie(' | + | |
- | * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain | + | |
- | | + | |
- | * | + | |
- | * @param String name The name of the cookie. | + | |
- | * @param String value The value of the cookie. | + | |
- | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. | + | |
- | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. | + | |
- | * If a negative value is specified | + | |
- | * If set to null or omitted, the cookie will be a session cookie and will not be retained | + | |
- | * when the the browser exits. | + | |
- | * @option String path The value of the path atribute of the cookie | + | |
- | * @option String domain The value of the domain attribute of the cookie | + | |
- | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will | + | |
- | | + | |
- | * @type undefined | + | |
- | * | + | |
- | * @name $.cookie | + | |
- | * @cat Plugins/Cookie | + | |
- | * @author Klaus Hartl/klaus.hartl@stilbuero.de | + | |
- | */ | + | |
- | + | ||
- | /** | + | |
- | * Get the value of a cookie with the given name. | + | |
- | * | + | |
- | * @example $.cookie(' | + | |
- | * @desc Get the value of a cookie. | + | |
- | * | + | |
- | * @param String name The name of the cookie. | + | |
- | * @return The value of the cookie. | + | |
- | * @type String | + | |
- | * | + | |
- | * @name $.cookie | + | |
- | * @cat Plugins/Cookie | + | |
- | * @author Klaus Hartl/klaus.hartl@stilbuero.de | + | |
- | */ | + | |
- | jQuery.cookie = function(name, value, options) { | + | |
- | if (typeof value != ' | + | |
- | options | + | |
- | if (value === null) { | + | |
- | value = ''; | + | |
- | options.expires = -1; | + | |
- | } | + | |
- | var expires = '' | + | |
- | if (options.expires && | + | |
- | var date; | + | |
- | if (typeof options.expires == ' | + | |
- | date = new Date(); | + | |
- | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); | + | |
- | } else { | + | |
- | date = options.expires; | + | |
- | } | + | |
- | expires = '; | + | |
- | } | + | |
- | // CAUTION: Needed to parenthesize options.path and options.domain | + | |
- | // in the following expressions, otherwise they evaluate to undefined | + | |
- | // in the packed version for some reason... | + | |
- | var path = options.path ? '; path=' | + | |
- | var domain = options.domain ? '; domain=' | + | |
- | var secure = options.secure ? '; secure' | + | |
- | document.cookie = [name, ' | + | |
- | } else { // only name given, get cookie | + | |
- | var cookieValue | + | |
- | if (document.cookie && document.cookie != '' | + | |
- | var cookies | + | |
- | for (var i = 0; i < cookies.length; | + | |
- | var cookie | + | |
- | // Does this cookie string begin with the name we want? | + | |
- | if (cookie.substring(0, name.length + 1) == (name + '=')) { | + | |
- | cookieValue | + | |
- | break; | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | return cookieValue; | + | |
- | } | + | |
- | }; | + | |
</ | </ | ||
- |