Files
BlueLotus_XSSReceiver/static/js/getTheme.js
firesun aaa17b1691 Version 2.0
实现基本功能
实现了基本界面admin.php
支持查看各种信息,支持自动base64解码

todolist
keepsession
认证
完全启用CSP
我的js
js模板

为实现一些jqxgrid无法实现的功能改动了jqx库,详见diff文件夹
2015-10-27 12:26:59 +08:00

55 lines
1.5 KiB
JavaScript

function getTheme() {
var theme = "office";
var url = "../css/jqx."+theme+".css";
if (document.createStyleSheet != undefined) {
var hasStyle = false;
$.each(document.styleSheets, function (index, value) {
if (value.href != undefined && value.href.indexOf(theme) != -1) {
hasStyle = true;
return false;
}
});
if (!hasStyle) {
document.createStyleSheet(url);
}
}
else {
var hasStyle = false;
if (document.styleSheets) {
$.each(document.styleSheets, function (index, value) {
if (value.href != undefined && value.href.indexOf(theme) != -1) {
hasStyle = true;
return false;
}
});
}
if (!hasStyle) {
var link = $('<link rel="stylesheet" href="' + url + '" media="screen" />');
link[0].onload = function () {
if ($.jqx && $.jqx.ready) {
$.jqx.ready();
};
}
$(document).find('head').append(link);
}
}
$.jqx = $.jqx || {};
$.jqx.theme = theme;
return theme;
};
var theme = '';
try
{
if (jQuery) {
theme = getTheme();
}
else {
$(document).ready(function () {
theme = getThemegetThemegetThemegetThemegetThemegetTheme();
});
}
}
catch (error) {
var er = error;
}