-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot.js
66 lines (57 loc) · 2.05 KB
/
boot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
__CreateJSPath = function (js) {
var scripts = document.getElementsByTagName("script");
var path = "";
for (var i = 0, l = scripts.length; i < l; i++) {
var src = scripts[i].src;
if (src.indexOf(js) != -1) {
var ss = src.split(js);
path = ss[0];
break;
}
}
var href = location.href;
href = href.split("#")[0];
href = href.split("?")[0];
var ss = href.split("/");
ss.length = ss.length - 1;
href = ss.join("/");
if (path.indexOf("https:") == -1 && path.indexOf("http:") == -1 && path.indexOf("file:") == -1 && path.indexOf("\/") != 0) {
path = href + "/" + path;
}
return path;
}
var bootPATH = __CreateJSPath("boot.js");
//debugger
mini_debugger = true;
//miniui
document.write('<script src="' + bootPATH + 'jquery-1.6.2.min.js" type="text/javascript"></sc' + 'ript>');
document.write('<script src="' + bootPATH + 'miniui/miniui.js" type="text/javascript" ></sc' + 'ript>');
document.write('<link href="' + bootPATH + 'miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />');
document.write('<link href="' + bootPATH + 'miniui/themes/icons.css" rel="stylesheet" type="text/css" />');
//mode
var mode = getCookie("miniuiMode");
if (mode) {
document.write('<link href="' + bootPATH + 'miniui/themes/default/' + mode + '-mode.css" rel="stylesheet" type="text/css" />');
}
//skin
var skin = getCookie("miniuiSkin");
if (skin) {
document.write('<link href="' + bootPATH + 'miniui/themes/' + skin + '/skin.css" rel="stylesheet" type="text/css" />');
}
////////////////////////////////////////////////////////////////////////////////////////
function getCookie(sName) {
var aCookie = document.cookie.split("; ");
var lastMatch = null;
for (var i = 0; i < aCookie.length; i++) {
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0]) {
lastMatch = aCrumb;
}
}
if (lastMatch) {
var v = lastMatch[1];
if (v === undefined) return v;
return unescape(v);
}
return null;
}