filesbox/web/dist/design/designstatic/home/js/getPage.js

2 lines
2.0 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
(function(i,s){s.getPage=!0;var m={init:function(){var e=this;/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?(e.isSimplify=localStorage.appAdapt===!0||localStorage.appAdapt==="true"||e.getCookie("appAdapt"),e.isSimplify||e.mobile()):e.desktop()},desktop:function(){var e=this,o=window.localStorage,a=o.comStyle;a?(e.style="<style>"+a+"</style>",e.comHead=o.comHead,e.comFoot=o.comFoot,e.setHtml()):e.ajaxHtml(1)},mobile:function(){var e=this,o=window.localStorage,a=o.comWapStyle;window.__wxjs_environment!=="miniprogram"&&(a?(e.style="<style>"+a+"</style>",e.comHead=o.comWapHead,e.comFoot=o.comWapFoot,i(".head").addClass("comHead"),i(".foot").addClass("comFoot"),i(".content").css("height","auto"),e.setHtml()):e.ajaxHtml(2))},ajaxHtml:function(e){var o=this,a=o.getPar("targetServerNameForOverride")||o.getPar("host")?"&targetServerNameForOverride="+(o.getPar("targetServerNameForOverride")||o.getPar("host")):"";i.ajax({type:"get",url:"/api/disk/getUsingDesign?clientType="+e+a,contentType:"application/json",dataType:"json",success:function(r){if(r.success&&r.data&&r.data.setting){var t=r.data,n=JSON.parse(t.setting);o.style=n.cssText,o.comHead=t.head,o.comFoot=t.foot;var l=n.cssText.replace(/\<style\>/,"");l=l.replace(/\<\/style\>/,"");var c=window.localStorage;e==1?(c.comStyle=l,c.comHead=t.head,c.comFoot=t.foot):(c.comWapStyle=l,c.comWapHead='<div class="showSet">'+t.head+"</div>",c.comWapFoot='<div class="showSet">'+t.foot+"</div>"),o.init(),s.getWapRoom&&s.getWapRoom.footerNav()}},error:function(r){console.log(r.message)}})},setHtml:function(){var e=this;i("head").append(e.style),i(".head").html(e.comHead),i(".foot").html(e.comFoot)},getCookie:function(e){for(var o=document.cookie,a=o.split("; "),r=0;r<a.length;r++){var t=a[r].split("=");if(t[0]==e)return t[1]}return""},getPar:function(e,o){var a=o||document.location.href,r=a.indexOf(e+"=");if(r==-1)return"";var t=a.slice(e.length+r+1),n=t.indexOf("&");return n!=-1&&(t=t.slice(0,n)),t}};m.init()})(jQuery,window);