1 Star 0 Fork 0

junphine/webos

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.html 6.23 KB
一键复制 编辑 原始数据 按行查看 历史
junphine 提交于 2022-03-18 11:35 . webos+im
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible"content="IE=8,chrome=1">
<script type="text/javascript" src="misc/jquery.min.js"></script>
<!--
<script type="text/javascript" src="/group/1/misc/jquery.js"></script>
-->
<script type="text/javascript" src="resources/plugin/jQuery.Cookies.2.2.0.min.js"></script>
<script type="text/javascript" src="resources/plugin/myLib.js"></script>
<script type="text/javascript" charset="utf-8" id="__jPushLoadTemplateScript">
jQuery.browser={};
(function(){
jQuery.browser.msie=false;
jQuery.browser.version=0;
if(navigator.userAgent.match(/MSIE ([0-9]+)./)){
jQuery.browser.msie=true;
jQuery.browser.version=RegExp.$1;
}
})();
/*
* index.html
* date:2012.4.3 10:23
* jPush!模版程序,基于XML和后台通讯,前台JS和模版完全独立,可以加载多套模版程序。
*
* 2012.11.26 14:29 我把对你的思念写到源代码里,因为我想像光的速度一样立刻飞到你身边。
*/
jPush = {
loadingArray: 3,
loadingData: {
main: { now: 0, all: 0, percentage: 0 },
template: { now: 0, all: 0, percentage: 0 },
templateData: { now: 0, all: 0, percentage: 0 }
},
data: {
Config: {},
ServiceFile: [],
XmlDoc: {},
XmlHttp: {},
XmlConfig: {},
XmlService: {}
},
init: function () {
this.loadConfig();
this.loadFileNum();
this.loadService(0);
},
loadFileNum: function () {
this.loadingData.main.all = this.data.ServiceFile.length;
},
loadingSuccess: function (type) {
++this.loadingData[type].now;
this.loadingData[type].percentage = this.loadingData[type].now / this.loadingData[type].all * 100 / this.loadingArray;
this.loadingBar();
if (type == 'templateData' && this.loadingData[type].now == this.loadingData[type].all) {
$('#__jPushLoadTemplate').fadeOut(800, function () {
$(this).remove();
$('#__jPushLoadTemplateSytle').remove();
$('#__jPushLoadTemplateScript').remove();
});
}
},
loadingBar: function () {
var percentage = 0;
for (var val in this.loadingData) {
percentage += this.loadingData[val].percentage;
}
percentage = parseInt(percentage);
if (percentage > 100) {
percentage = 100;
}
document.getElementById('__jPushLoadTemplateLoadingBarTL').innerHTML = percentage + '%';
document.getElementById('__jPushLoadTemplateLoadingBarMK').style.width = percentage + '%';
},
loadConfig: function () {
if (window.XMLHttpRequest) {
this.data.XmlHttp = new XMLHttpRequest();
} else {
this.data.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
this.data.XmlHttp.open("GET", 'jPushConfig.xml', false);
this.data.XmlHttp.send();
this.data.XmlDoc = this.data.XmlHttp.responseXML.getElementsByTagName('jPushConfig')[0];
this.data.XmlConfig = this.data.XmlDoc.getElementsByTagName('config')[0].getElementsByTagName('add');
this.data.XmlService = this.data.XmlDoc.getElementsByTagName('service')[0].getElementsByTagName('add');
for (var i = 0; i < this.data.XmlConfig.length; i++) {
this.data.Config[this.data.XmlConfig[i].getAttribute("key")] = this.data.XmlConfig[i].getAttribute("value");
}
for (var i = 0; i < this.data.XmlService.length; i++) {
this.data.ServiceFile.push(this.data.XmlService[i].getAttribute("value"));
}
},
loadService: function (num) {
if (num >= this.data.ServiceFile.length) {
jPushTemplate.load();
return;
}
var script = this.appendScript(this.data.ServiceFile[num]);
this.ready(script, function () {
jPush.loadingSuccess('main');
jPush.loadService(++num);
});
},
load: function () {
this.init();
},
appendScript: function (src) {
var tag = document.createElement('script');
var head = document.getElementsByTagName("head")[0] || document.documentElement;
tag.src = src;
tag.type = 'text/javascript';
tag.setAttribute('charset', "utf-8");
var script = head.insertBefore(tag, head.firstChild);
return script;
},
ready: function (script, callback) {
if (window.ActiveXObject) {
script.onreadystatechange = function () {
if (this.readyState === "loaded" || this.readyState === "complete") {
callback();
}
}
} else {
script.onload = function () {
if (!this.readyState) {
callback();
}
}
}
}
}
window.onload = function () {
jPush.load();
}
</script>
<style type="text/css" id="__jPushLoadTemplateSytle">
html,body{height:100%;margin:0;overflow:hidden;}
#__jPushBlog{position:fixed;top:5px;right:10px;}
#__jPushBlog a{color:#fff;}
#__jPushLoadTemplate{width:100%;height:100%;background:#b4d9f1;position:absolute;top:0;left:0;z-index:9999;font-size:12px;color:#fff;}
#__jPushLoadTemplate tr td{text-align:center;vertical-align:middle;}
#__jPushLoadTemplateLoadingBarBG{width:100px;height:2px;display:inline-block;border:solid 1px #fff;position:relative;left:-20px;}
#__jPushLoadTemplateLoadingBarMK{width:0;height:2px;background:#ff7200;position:absolute;top:0;left:0;}
#__jPushLoadTemplateLoadingBarTL{position:absolute;top:-6px;left:110px;width:100px;text-align:left;}
#__jPushLoadTemplateLoadingBarLG{width:260px;height:442px;background:url(resources/static/image/logo.png) no-repeat;position:absolute;top:-251px;left:-120px;}
</style>
</head>
<body>
<table id="__jPushLoadTemplate">
<tr>
<td>
<div id="__jPushBlog"><a href="http://www.3600.me/" title="我们的博客" rel="我们的博客">MyBlog</a></div>
<div id="__jPushLoadTemplateLoadingBarBG">
<div id="__jPushLoadTemplateLoadingBarLG"></div>
<div id="__jPushLoadTemplateLoadingBarTL">0%</div>
<div id="__jPushLoadTemplateLoadingBarMK"></div>
</div>
</td>
</tr>
</table>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/junphine/webos.git
[email protected]:junphine/webos.git
junphine
webos
webos
master

搜索帮助