mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
Add js-cookie library
This commit is contained in:
parent
cb66b4e5df
commit
71e5bdb354
6 changed files with 178 additions and 12 deletions
|
|
@ -92,6 +92,7 @@
|
|||
window.XE = {
|
||||
loaded_popup_menus : [],
|
||||
addedDocument : [],
|
||||
cookie : window.Cookies,
|
||||
URI : window.URI,
|
||||
URITemplate : window.URITemplate,
|
||||
SecondLevelDomains : window.SecondLevelDomains,
|
||||
|
|
@ -673,9 +674,7 @@ function doChangeLangType(obj) {
|
|||
location.href = location.href.setQuery('l', '');
|
||||
}
|
||||
function setLangType(lang_type) {
|
||||
var expire = new Date();
|
||||
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
|
||||
setCookie('lang_type', lang_type, expire, '/');
|
||||
XE.cookie.set("lang_type", lang_type, { path: "/", expires: 3650 });
|
||||
}
|
||||
|
||||
/* 미리보기 */
|
||||
|
|
@ -1051,18 +1050,16 @@ function getOuterHTML(obj) {
|
|||
return jQuery(obj).html().trim();
|
||||
}
|
||||
|
||||
function setCookie(name, value, expire, path) {
|
||||
var s_cookie = name + "=" + escape(value) +
|
||||
((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
|
||||
"; path=" + ((!path) ? "/" : path) +
|
||||
((cookies_ssl) ? ";secure" : "");
|
||||
|
||||
document.cookie = s_cookie;
|
||||
function setCookie(name, value, expires, path) {
|
||||
XE.cookie.set(name, value, {
|
||||
expires: expires ? expires : 0,
|
||||
path: path ? path : "/",
|
||||
secure: cookies_ssl ? true : false
|
||||
});
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var match = document.cookie.match(new RegExp(name+'=(.*?)(?:;|$)'));
|
||||
if(match) return unescape(match[1]);
|
||||
return XE.cookie.get(name);
|
||||
}
|
||||
|
||||
function is_def(v) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue