filesbox/web/dist/design/designstatic/common/js/shareMobileCommon.js

2 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
if(location.pathname&&location.pathname.indexOf(".shtml")>-1){let r=function(){for(var o=localStorage.comWapStyle.split("{")||[],e=0,t=0,a=0,c=o.length;a<c;a++){var s=o[a];if(s.indexOf(".comHead .showSet")>-1){var i=o[a+1];e=parseFloat((i.split("height:")[1]+"").trim())+"rem"}if(s.indexOf(".comFoot .showSet")>-1){var i=o[a+1];t=parseFloat((i.split("height:")[1]+"").trim())+"rem"}}var p=setInterval(function(){var l=$(".comHead"),h=$(".comHead .showSet"),n=$(".comFoot"),m=$(".comFoot .showSet");if(l&&n&&(window.secondShareHtmlSuccess=!0,clearInterval(p)),l&&localStorage.comWapHead){l.css("opacity",1);var S=localStorage.comWapHead;l.height(e),h.height(e),h.html(S)}if(n&&localStorage.comWapFoot){var d=localStorage.comWapFoot;n.height(t),m.height(t),m.html(d)}},10)};var renderCommonContent=r;$("#secoundStyle").html(".comHead{opacity: 0;}"),window.secondShareHtml=!0,window.secondShareHtmlSuccess=!1,localStorage.comWapHead&&localStorage.comWapFoot&&localStorage.comWapStyle?r():$.ajax({type:"get",url:"/api/disk/getUsingDesign?clientType=2",contentType:"application/json",dataType:"json",success:function(o){if(o.success&&o.data&&o.data.setting){var e=o.data,t=JSON.parse(e.setting),a=t.cssText.replace(/\<style\>/,"");a=a.replace(/\<\/style\>/,"");var c=window.localStorage;c.comWapStyle=a,c.comWapHead=e.head,c.comWapFoot=e.foot,r()}},error:function(o){console.log(o.message)}})}