This commit is contained in:
libccy 2017-04-14 13:17:15 +08:00
parent a36d11024c
commit 9721baac23
1 changed files with 30 additions and 21 deletions

View File

@ -5347,6 +5347,27 @@
window.isNonameServer=window.location.href.slice(index+18); window.isNonameServer=window.location.href.slice(index+18);
window.indexedDB=null; window.indexedDB=null;
} }
var htmlbg=localStorage.getItem(lib.configprefix+'background');
if(htmlbg){
if(htmlbg[0]=='['){
try{
htmlbg=JSON.parse(htmlbg).randomGet();
if(htmlbg.indexOf('custom_')==0){
throw('err');
}
_status.htmlbg=htmlbg;
}
catch(e){
htmlbg=null;
}
}
if(htmlbg){
document.documentElement.style.backgroundImage='url("'+lib.assetURL+'image/background/'+htmlbg+'.jpg")';
document.documentElement.style.backgroundSize='cover';
document.documentElement.style.backgroundPosition='50% 50%';
}
}
// index=localStorage.getItem(lib.configprefix+'asserver'); // index=localStorage.getItem(lib.configprefix+'asserver');
// if(index){ // if(index){
// window.isNonameServer=index; // window.isNonameServer=index;
@ -5830,22 +5851,10 @@
lib.assetURL=noname_inited; lib.assetURL=noname_inited;
} }
ui.css={default:lib.init.css(lib.assetURL+'layout/default','layout')}; ui.css={
var htmlbg=localStorage.getItem(lib.configprefix+'background'); menu:lib.init.css(lib.assetURL+'layout/default','menu'),
if(htmlbg){ default:lib.init.css(lib.assetURL+'layout/default','layout')
if(htmlbg[0]=='['){ };
htmlbg=JSON.parse(htmlbg).randomGet();
_status.htmlbg=htmlbg;
if(htmlbg.indexOf('custom_')==0){
htmlbg=null;
}
}
if(htmlbg){
document.documentElement.style.backgroundImage='url("'+lib.assetURL+'image/background/'+htmlbg+'.jpg")';
document.documentElement.style.backgroundSize='cover';
document.documentElement.style.backgroundPosition='50% 50%';
}
}
if(lib.device){ if(lib.device){
lib.init.cordovaReady=function(){ lib.init.cordovaReady=function(){
@ -6466,7 +6475,7 @@
lib.init.background(); lib.init.background();
} }
delete _status.htmlbg; delete _status.htmlbg;
var styleToLoad=7; var styleToLoad=6;
var styleLoaded=function(){ var styleLoaded=function(){
styleToLoad--; styleToLoad--;
if(styleToLoad==0){ if(styleToLoad==0){
@ -6498,7 +6507,6 @@
} }
} }
}; };
lib.init.css(lib.assetURL+'layout/default','menu',styleLoaded);
if(lib.config.layout!='default'){ if(lib.config.layout!='default'){
ui.css.layout=lib.init.css(lib.assetURL+'layout/'+layout,'layout',styleLoaded); ui.css.layout=lib.init.css(lib.assetURL+'layout/'+layout,'layout',styleLoaded);
} }
@ -6733,11 +6741,11 @@
ui.background.style.filter='blur(8px)'; ui.background.style.filter='blur(8px)';
ui.background.style.webkitFilter='blur(8px)'; ui.background.style.webkitFilter='blur(8px)';
ui.background.style.transform='scale(1.05)'; ui.background.style.transform='scale(1.05)';
}
} }
document.documentElement.style.backgroundImage=''; document.documentElement.style.backgroundImage='';
document.documentElement.style.backgroundSize=''; document.documentElement.style.backgroundSize='';
document.documentElement.style.backgroundPosition=''; document.documentElement.style.backgroundPosition='';
}
document.body.insertBefore(ui.background,document.body.firstChild); document.body.insertBefore(ui.background,document.body.firstChild);
document.body.onresize=ui.updatex; document.body.onresize=ui.updatex;
if(lib.config.touchscreen){ if(lib.config.touchscreen){
@ -27782,6 +27790,7 @@
else{ else{
for(var i in data.config){ for(var i in data.config){
game.putDB('config',i,data.config[i]); game.putDB('config',i,data.config[i]);
lib.config[i]=data.config[i];
} }
for(var i in data.data){ for(var i in data.data){
game.putDB('data',i,data.data[i]); game.putDB('data',i,data.data[i]);