windy
8 years ago
22 changed files with 264 additions and 232 deletions
@ -1,98 +0,0 @@
|
||||
/* |
||||
* 前端缓存 |
||||
*/ |
||||
window.localStorage || (window.localStorage = { |
||||
items: {}, |
||||
setItem: function (k, v) { |
||||
BI.Cache.addCookie(k, v); |
||||
}, |
||||
getItem: function (k) { |
||||
return BI.Cache.getCookie(k); |
||||
}, |
||||
removeItem: function (k) { |
||||
BI.Cache.deleteCookie(k); |
||||
}, |
||||
key: function () { |
||||
|
||||
}, |
||||
clear: function () { |
||||
this.items = {}; |
||||
} |
||||
}); |
||||
BI.Cache = { |
||||
_prefix: "bi", |
||||
setUsername: function (username) { |
||||
localStorage.setItem(BI.Cache._prefix + ".username", (username + "" || "").toUpperCase()); |
||||
}, |
||||
getUsername: function () { |
||||
return localStorage.getItem(BI.Cache._prefix + ".username") || ""; |
||||
}, |
||||
_getKeyPrefix: function () { |
||||
return BI.Cache.getUsername() + "." + BI.Cache._prefix + "."; |
||||
}, |
||||
_generateKey: function (key) { |
||||
return BI.Cache._getKeyPrefix() + (key || ""); |
||||
}, |
||||
getItem: function (key) { |
||||
return localStorage.getItem(BI.Cache._generateKey(key)); |
||||
}, |
||||
setItem: function (key, value) { |
||||
localStorage.setItem(BI.Cache._generateKey(key), value); |
||||
}, |
||||
removeItem: function (key) { |
||||
localStorage.removeItem(BI.Cache._generateKey(key)); |
||||
}, |
||||
clear: function () { |
||||
for (var i = localStorage.length; i >= 0; i--) { |
||||
var key = localStorage.key(i); |
||||
if (key) { |
||||
if (key.indexOf(BI.Cache._getKeyPrefix()) === 0) { |
||||
localStorage.removeItem(key); |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
keys: function () { |
||||
var result = []; |
||||
for (var i = localStorage.length; i >= 0; i--) { |
||||
var key = localStorage.key(i); |
||||
if (key) { |
||||
var prefix = BI.Cache._getKeyPrefix(); |
||||
if (key.indexOf(prefix) === 0) { |
||||
result[result.length] = key.substring(prefix.length); |
||||
} |
||||
} |
||||
} |
||||
return result; |
||||
}, |
||||
|
||||
addCookie: function (name, value, path, expiresHours) { |
||||
var cookieString = name + "=" + escape(value); |
||||
// 判断是否设置过期时间
|
||||
if (expiresHours && expiresHours > 0) { |
||||
var date = new Date(); |
||||
date.setTime(date.getTime() + expiresHours * 3600 * 1000); |
||||
cookieString = cookieString + "; expires=" + date.toGMTString(); |
||||
} |
||||
if (path) { |
||||
cookieString = cookieString + "; path=" + path; |
||||
} |
||||
document.cookie = cookieString; |
||||
}, |
||||
getCookie: function (name) { |
||||
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); |
||||
if (arr = document.cookie.match(reg)) |
||||
return unescape(arr[2]); |
||||
else |
||||
return null; |
||||
}, |
||||
deleteCookie: function (name, path) { |
||||
var date = new Date(); |
||||
date.setTime(date.getTime() - 10000); |
||||
var cookieString = name + "=v; expires=" + date.toGMTString(); |
||||
if (path) { |
||||
cookieString = cookieString + "; path=" + path; |
||||
} |
||||
document.cookie = cookieString; |
||||
} |
||||
}; |
@ -0,0 +1,31 @@
|
||||
/****添加计算宽度的--运算符直接需要space****/ |
||||
/****** common color(常用颜色,可用于普遍场景) *****/ |
||||
/**** custom color(自定义颜色,用于特定场景) ****/ |
||||
.bi-bubble-combo .bubble-combo-triangle-left { |
||||
width: 0; |
||||
height: 0; |
||||
border-top: 6px solid transparent; |
||||
border-left: 6px solid #009de3; |
||||
border-bottom: 6px solid transparent; |
||||
} |
||||
.bi-bubble-combo .bubble-combo-triangle-right { |
||||
width: 0; |
||||
height: 0; |
||||
border-top: 6px solid transparent; |
||||
border-right: 6px solid #009de3; |
||||
border-bottom: 6px solid transparent; |
||||
} |
||||
.bi-bubble-combo .bubble-combo-triangle-top { |
||||
width: 0; |
||||
height: 0; |
||||
border-left: 6px solid transparent; |
||||
border-right: 6px solid transparent; |
||||
border-top: 6px solid #009de3; |
||||
} |
||||
.bi-bubble-combo .bubble-combo-triangle-bottom { |
||||
width: 0; |
||||
height: 0; |
||||
border-left: 6px solid transparent; |
||||
border-right: 6px solid transparent; |
||||
border-bottom: 6px solid #009de3; |
||||
} |
Loading…
Reference in new issue