From 5f3421c8cf49a262e5587d7bbc3db529a08ada43 Mon Sep 17 00:00:00 2001 From: muzi_ys <1099438829@qq.com> Date: Thu, 7 Jan 2021 21:33:18 +0800 Subject: [PATCH] update --- js/mac.js | 214 +++++++++++++++++++++++++------------------------- js/mac.min.js | 2 +- 2 files changed, 108 insertions(+), 108 deletions(-) diff --git a/js/mac.js b/js/mac.js index 4535051..a933162 100644 --- a/js/mac.js +++ b/js/mac.js @@ -27,7 +27,7 @@ window.Win10 = { track: function(element, cb) { this.iframes.push(new this.Iframe(element, cb)); if (!this.interval) { - var _this = this; + let _this = this; this.interval = setInterval(function() { _this.checkClick(); }, this.resolution); @@ -35,9 +35,9 @@ window.Win10 = { }, checkClick: function() { if (document.activeElement) { - var activeElement = document.activeElement; - for (var i in this.iframes) { - var eid = undefined; + let activeElement = document.activeElement; + for (let i in this.iframes) { + let eid = undefined; if ((eid = this.iframes[i].element.id) && !document.getElementById(eid)) { delete this.iframes[i]; continue; @@ -60,27 +60,27 @@ window.Win10 = { if (this._countTask <= 0) { return; } //防止除以0 - var btns = $("#win10_btn_group_middle>.btn"); + let btns = $("#win10_btn_group_middle>.btn"); btns.css('width', ('calc(' + (1 / this._countTask * 100) + '% - 1px )')) }, _handleReady: [], _hideShortcut: function() { - var that = $("#win10 #win10-shortcuts .shortcut"); + let that = $("#win10 #win10-shortcuts .shortcut"); that.removeClass('animated flipInX'); that.addClass('animated flipOutX'); }, _showShortcut: function() { - var that = $("#win10 #win10-shortcuts .shortcut"); + let that = $("#win10 #win10-shortcuts .shortcut"); that.removeClass('animated flipOutX'); that.addClass('animated flipInX'); }, _checkBgUrls: function() { - var loaders = $('#win10>.img-loader'); - var flag = false; + let loaders = $('#win10>.img-loader'); + let flag = false; if (Win10.isSmallScreen()) { if (Win10._bgs.mobile) { loaders.each(function() { - var loader = $(this); + let loader = $(this); if (loader.attr('src') === Win10._bgs.mobile && loader.hasClass('loaded')) { Win10._setBackgroundImg(Win10._bgs.mobile); flag = true; @@ -88,7 +88,7 @@ window.Win10 = { }); if (!flag) { //没找到加载完毕的图片 - var img = $(''); + let img = $(''); $('#win10').append(img); Win10._onImgComplete(img[0], function() { img.addClass('loaded'); @@ -99,7 +99,7 @@ window.Win10 = { } else { if (Win10._bgs.main) { loaders.each(function() { - var loader = $(this); + let loader = $(this); if (loader.attr('src') === Win10._bgs.main && loader.hasClass('loaded')) { Win10._setBackgroundImg(Win10._bgs.main); flag = true; @@ -107,7 +107,7 @@ window.Win10 = { }); if (!flag) { //没找到加载完毕的图片 - var img = $(''); + let img = $(''); $('#win10').append(img); Win10._onImgComplete(img[0], function() { img.addClass('loaded'); @@ -123,15 +123,15 @@ window.Win10 = { }, _startAnimate: function() { setInterval(function() { - var classes_lenth = Win10._animated_classes.length; - var animated_liveness = Win10._animated_liveness; + let classes_lenth = Win10._animated_classes.length; + let animated_liveness = Win10._animated_liveness; if (animated_liveness === 0 || classes_lenth === 0 || !$("#win10-menu").hasClass('opened')) { return; } $('#win10-menu>.blocks>.menu_group>.block').each(function() { if (!$(this).hasClass('onAnimate') && Math.random() <= animated_liveness) { - var that = $(this); - var class_animate = Win10._animated_classes[Math.floor((Math.random() * classes_lenth))]; + let that = $(this); + let class_animate = Win10._animated_classes[Math.floor((Math.random() * classes_lenth))]; that.addClass('onAnimate'); setTimeout(function() { that.addClass(class_animate); @@ -148,7 +148,7 @@ window.Win10 = { if (!img) { return; } - var timer = setInterval(function() { + let timer = setInterval(function() { if (img.complete) { callback(img); clearInterval(timer); @@ -163,7 +163,7 @@ window.Win10 = { layero = this.getLayeroByIndex(layero); } //置顶窗口 - var max_zindex = 0; + let max_zindex = 0; $(".win10-open-iframe").each(function() { z = parseInt($(this).css('z-index')); $(this).css('z-index', z - 1); @@ -174,13 +174,13 @@ window.Win10 = { layero.css('z-index', max_zindex + 1); }, _checkTop: function() { - var max_index = 0, + let max_index = 0, max_z = 0, btn = null; $("#win10_btn_group_middle .btn.show").each(function() { - var index = $(this).attr('index'); - var layero = Win10.getLayeroByIndex(index); - var z = layero.css('z-index'); + let index = $(this).attr('index'); + let layero = Win10.getLayeroByIndex(index); + let z = layero.css('z-index'); if (z > max_z) { max_index = index; max_z = z; @@ -199,11 +199,11 @@ window.Win10 = { if (menu === true) { return; } - var dom = $("
"); + let dom = $("
"); $('#win10').append(dom); - var ul = dom.find('ul'); - for (var i = 0; i < menu.length; i++) { - var item = menu[i]; + let ul = dom.find('ul'); + for (let i = 0; i < menu.length; i++) { + let item = menu[i]; if (item === '|') { ul.append($('
')); continue; @@ -213,7 +213,7 @@ window.Win10 = { continue; } if (typeof(item) === 'object') { - var sub = $('
  • ' + item[0] + '
  • '); + let sub = $('
  • ' + item[0] + '
  • '); ul.append(sub); sub.click(trigger, item[1]); @@ -242,11 +242,11 @@ window.Win10 = { }, _fixWindowsHeightAndWidth: function() { //此处代码修正全屏切换引起的子窗体尺寸超出屏幕 - var opens = $('.win10-open-iframe'); - var clientHeight = document.body.clientHeight; + let opens = $('.win10-open-iframe'); + let clientHeight = document.body.clientHeight; opens.each(function() { - var layero_opened = $(this); - var height = layero_opened.css('height'); + let layero_opened = $(this); + let height = layero_opened.css('height'); height = parseInt(height.replace('px', '')); if (height + 30 >= clientHeight) { layero_opened.css('height', clientHeight - 30); @@ -271,10 +271,10 @@ window.Win10 = { //>> 判断url地址是否为空 如果为空 不予处理 if ($this.data('url') !== "") { //>> 获取弹窗标题 - var title = $this.data('title') || '', + let title = $this.data('title') || '', areaAndOffset, icon; //>> 判断是否有标题图片 - var bg = $this.data('icon-bg') ? $this.data('icon-bg') : ''; + let bg = $this.data('icon-bg') ? $this.data('icon-bg') : ''; if ($this.data('icon-image')) { //>> 加入到标题中 icon = ''; @@ -321,7 +321,7 @@ window.Win10 = { Win10.commandCenterClose(); }); $('#win10').on('click', ".notice .btn_close_msg", function() { - var msg = $(this).parents('.notice'); + let msg = $(this).parents('.notice'); $(msg).addClass('animated slideOutRight'); setTimeout(function() { msg.remove() @@ -340,7 +340,7 @@ window.Win10 = { } }); $('#win10_btn_command_center_clean_all').click(function() { - var msgs = $('#win10_command_center .msg'); + let msgs = $('#win10_command_center .msg'); msgs.addClass('animated slideOutRight'); setTimeout(function() { msgs.remove() @@ -358,10 +358,10 @@ window.Win10 = { return; } Win10._switchMenuTooHurry = true; - var class_name = 'win10-menu-hidden'; - var list = $("#win10-menu>.list"); - var blocks = $("#win10-menu>.blocks"); - var toggleSlide = function(obj) { + let class_name = 'win10-menu-hidden'; + let list = $("#win10-menu>.list"); + let blocks = $("#win10-menu>.blocks"); + let toggleSlide = function(obj) { if (obj.hasClass(class_name)) { obj.addClass('animated slideInLeft'); obj.removeClass('animated slideOutLeft'); @@ -384,21 +384,21 @@ window.Win10 = { $("#win10 .desktop").click(); }); $(document).on('click', '.win10-btn-refresh', function() { - var index = $(this).attr('index'); - var iframe = Win10.getLayeroByIndex(index).find('iframe'); + let index = $(this).attr('index'); + let iframe = Win10.getLayeroByIndex(index).find('iframe'); iframe.attr('src', iframe.attr('src')); }); $(document).on('mousedown', '.win10-open-iframe', function() { - var layero = $(this); + let layero = $(this); Win10._settop(layero); Win10._checkTop(); }); $('#win10_btn_group_middle').on('click', '.btn_close', function() { - var index = $(this).parent().attr('index'); + let index = $(this).parent().attr('index'); Win10._closeWin(index); }); $('#win10-menu .list').on('click', '.item', function() { - var e = $(this); + let e = $(this); if (e.hasClass('has-sub-down')) { $('#win10-menu .list .item.has-sub-up').toggleClass('has-sub-down').toggleClass('has-sub-up'); $("#win10-menu .list .sub-item").slideUp(); @@ -413,12 +413,12 @@ window.Win10 = { }); setInterval(function() { //重新写mac时间 - var myDate = Win10.getLunarObj(); + let myDate = Win10.getLunarObj(); $("#win10_btn_time").html(myDate.weekDay + myDate.hour + ':' + myDate.minute); }, 1000); //离开前警告 document.body.onbeforeunload = function(event) { - var rel = Win10.lang('系统可能不会保存您所做的更改', 'The system may not save the changes you have made.'); + let rel = Win10.lang('系统可能不会保存您所做的更改', 'The system may not save the changes you have made.'); if (!window.event) { event.returnValue = rel; } else { @@ -459,9 +459,9 @@ window.Win10 = { Win10.setContextMenu('#win10', true); Win10.setContextMenu('#win10>.desktop', [ [' 收藏本页', function() { - var url = window.location; - var title = document.title; - var ua = navigator.userAgent.toLowerCase(); + let url = window.location; + let title = document.title; + let ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("360se") > -1) { layer.alert(Win10.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!', 'Your browser does not support, please press Ctrl+D to manual collection!')); @@ -506,7 +506,7 @@ window.Win10 = { //处理消息图标闪烁 setInterval(function() { - var btn = $("#win10-msg-nof.on-new-msg"); + let btn = $("#win10-msg-nof.on-new-msg"); if (btn.length > 0) { btn.toggleClass('fa-commenting-o'); } @@ -567,7 +567,7 @@ window.Win10 = { }, getLunarObj: function() { //农历年信息 - var lunarInfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, + let lunarInfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, @@ -583,13 +583,13 @@ window.Win10 = { 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0 ]; - var Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"]; - var Gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"]; - var Zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]; + let Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"]; + let Gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"]; + let Zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]; //==== 传回农历 y年的总天数 function lYearDays(y) { - var i, sum = 348 + let i, sum = 348 for (i = 0x8000; i > 0x8; i >>= 1) sum += (lunarInfo[y - 1900] & i) ? 1 : 0 return (sum + leapDays(y)) } @@ -615,10 +615,10 @@ window.Win10 = { //==== 算出农历, 传入日期物件, 传回农历日期物件 // 该物件属性有 .year .month .day .isLeap .yearCyl .dayCyl .monCyl function lunar(objDate) { - var i, leap = 0, + let i, leap = 0, temp = 0 - var baseDate = new Date(1900, 0, 31) - var offset = (objDate - baseDate) / 86400000 + let baseDate = new Date(1900, 0, 31) + let offset = (objDate - baseDate) / 86400000 this.dayCyl = offset + 40 this.monCyl = 14 @@ -678,13 +678,13 @@ window.Win10 = { //获取农历(月)中文格式 function get_lunarmonth(month) { - var fm = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "腊月"]; + let fm = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "腊月"]; return fm[month - 1]; } //获取农历(日)中文格式 function get_lunarday(day) { - var fd = ["十", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"]; + let fd = ["十", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"]; if (day <= 10) { return "初" + fd[day]; } else if (day < 20) { @@ -700,7 +700,7 @@ window.Win10 = { //获取干支 function get_ganzhi(year) { - var num = year - 1900 + 36; + let num = year - 1900 + 36; return (Gan[num % 10] + Zhi[num % 12]); } @@ -711,19 +711,19 @@ window.Win10 = { //获取周 function get_weekday(date) { - var values = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; + let values = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; return values[date.getDay()]; } //获取星期 function get_week(date) { - var values = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; + let values = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; return values[date.getDay()]; } //获取分钟 function get_min(date) { - var mins = date.getMinutes(); + let mins = date.getMinutes(); if (mins < 10) { mins = '0' + mins } @@ -732,7 +732,7 @@ window.Win10 = { //获取小时 function get_hour(date) { - var hour = date.getHours(); + let hour = date.getHours(); if (hour < 6) { hours = '凌晨' + hour; } else if (hour < 9) { @@ -753,8 +753,8 @@ window.Win10 = { return hours; } - var viewdate = {}; - var date = new Date(); + let viewdate = {}; + let date = new Date(); //秒 viewdate.second = date.getSeconds(); @@ -775,11 +775,11 @@ window.Win10 = { //年份(2位) viewdate.year = date.getYear(); //农历信息 - var lunar_obj = new lunar(date); + let lunar_obj = new lunar(date); //农历中文月 viewdate.lunarmonth = get_lunarmonth(lunar_obj.month); //农历中文日 - var lunar_day = Math.floor(lunar_obj.day); + let lunar_day = Math.floor(lunar_obj.day); viewdate.lunarday = get_lunarday(lunar_day); //农历年月日 viewdate.lunar = lunar_obj.year + "-" + lunar_obj.month + "-" + lunar_day; @@ -792,11 +792,11 @@ window.Win10 = { }, //消息中心渲染 renderCommand: function(today = null) { - var active = $("#win10_command_center .command-body.today").hasClass('active'); + let active = $("#win10_command_center .command-body.today").hasClass('active'); if (!active) { if (!today) { - var lunarDate = Win10.getLunarObj(); - var today = '
    ' + + let lunarDate = Win10.getLunarObj(); + let today = '
    ' + '
    ' + lunarDate.month + '月' + lunarDate.day + '日 ' + lunarDate.week + '
    ' + '
    ' + lunarDate.ganzhi + '年' + lunarDate.lunarmonth + @@ -841,15 +841,15 @@ window.Win10 = { renderShortcuts: function() { if (!this.isSmallScreen()) { //大屏执行pc的布局也就是竖排靠右对齐,小屏幕执行移动端也就是横向排列 - var h = parseInt(($("#win10 #win10-shortcuts")[0].offsetHeight - 90) / 100); - var w = 0; + let h = parseInt(($("#win10 #win10-shortcuts")[0].offsetHeight - 90) / 100); + let w = 0; //计算一列最大几个图标,公式是(桌面图标界面的大小 - 顶部状态栏和底部dock栏的尺寸)/单个图标高度所占的尺寸 - var x = 0, + let x = 0, y = 0; $("#win10 #win10-shortcuts .shortcut").each(function() { $(this).css({ - left: x * 82 + 10, - // left:0, + right: x * 82 + 10, + left: 'auto', top: y * 100 + 10, }); y++; @@ -860,8 +860,8 @@ window.Win10 = { }); } else { //小屏幕执行横屏 - var w = parseInt(($("#win10 #win10-shortcuts")[0].offsetWidth - 10) / 82); - var x = 0, + let w = parseInt(($("#win10 #win10-shortcuts")[0].offsetWidth - 10) / 82); + let x = 0, y = 0; $("#win10 #win10-shortcuts .shortcut").each(function() { $(this).css({ @@ -879,11 +879,11 @@ window.Win10 = { }, //渲染DOCK renderDocks: function() { - var cell_width = 60; - var width = document.body.clientWidth; - var docks = $("#footer .dock li"); - var max_num = parseInt(width / cell_width) - 1; - for (var i = 0; i < docks.length; i++) { + let cell_width = 60; + let width = document.body.clientWidth; + let docks = $("#footer .dock li"); + let max_num = parseInt(width / cell_width) - 1; + for (let i = 0; i < docks.length; i++) { if (i > max_num) { docks.eq(i).css('display', 'none'); } else { @@ -914,7 +914,7 @@ window.Win10 = { }, newMsg: function(title, content, handle_click, app_name = '提示消息', app_icon = '', is_del = true) { - var msg = '
    ' + + let msg = '
    ' + '
    ' + '' + app_icon + '' + '' + app_name + ''; @@ -927,7 +927,7 @@ window.Win10 = { '
    ' + title + '
    ' + '
    ' + content + '
    ' + '
    '; - var e = $(msg); + let e = $(msg); $("#win10_command_center .msgs").prepend(e); e.find('.content:first,.title:first').click(function() { if (handle_click) { @@ -949,11 +949,11 @@ window.Win10 = { if (!size) { size = 768 } - var width = document.body.clientWidth; + let width = document.body.clientWidth; return width < size; }, enableFullScreen: function() { - var docElm = document.documentElement; + let docElm = document.documentElement; //W3C if (docElm.requestFullscreen) { docElm.requestFullscreen(); @@ -994,7 +994,7 @@ window.Win10 = { openUrl: function(url, icon, title, areaAndOffset) { //只打开一个应用 /* - var ifr=document.getElementsByTagName("iframe"); + let ifr=document.getElementsByTagName("iframe"); for(i=0;i
    ' + + let btn = $('
    ' + icon + '
    '); - var layero_opened = Win10.getLayeroByIndex(index); + let layero_opened = Win10.getLayeroByIndex(index); layero_opened.css('z-index', Win10._countTask + 813); Win10._settop(layero_opened); //重新定义菜单布局 @@ -1082,7 +1082,7 @@ window.Win10 = { }) layero_opened.find('.layui-layer-setwin .layui-layer-max').click(function() { setTimeout(function() { - var height = layero_opened.css('height'); + let height = layero_opened.css('height'); height = parseInt(height.replace('px', '')); if (height >= document.body.clientHeight) { layero_opened.css('height', height - 25); @@ -1094,11 +1094,11 @@ window.Win10 = { }); $("#win10_btn_group_middle").append(btn); btn.click(function() { - var index = $(this).attr('index'); - var layero = Win10.getLayeroByIndex(index); - var settop = function() { + let index = $(this).attr('index'); + let layero = Win10.getLayeroByIndex(index); + let settop = function() { //置顶窗口 - var max_zindex = 0; + let max_zindex = 0; $(".win10-open-iframe").each(function() { z = parseInt($(this).css('z-index')); $(this).css('z-index', z - 1); @@ -1207,8 +1207,8 @@ window.Win10 = { }, hideWins: function() { $('#win10_btn_group_middle>.btn.show').each(function() { - var index = $(this).attr('index'); - var layero = Win10.getLayeroByIndex(index); + let index = $(this).attr('index'); + let layero = Win10.getLayeroByIndex(index); $(this).removeClass('show'); $(this).removeClass('active'); layero.hide(); @@ -1216,8 +1216,8 @@ window.Win10 = { }, showWins: function() { $('#win10_btn_group_middle>.btn').each(function() { - var index = $(this).attr('index'); - var layero = Win10.getLayeroByIndex(index); + let index = $(this).attr('index'); + let layero = Win10.getLayeroByIndex(index); $(this).addClass('show'); layero.show(); }); @@ -1234,8 +1234,8 @@ window.Win10 = { $(function() { Win10._init(); - for (var i in Win10._handleReady) { - var handle = Win10._handleReady[i]; + for (let i in Win10._handleReady) { + let handle = Win10._handleReady[i]; handle(); } }); diff --git a/js/mac.min.js b/js/mac.min.js index 4af41ea..e49d8e0 100644 --- a/js/mac.min.js +++ b/js/mac.min.js @@ -1 +1 @@ -window.Win10={_version:"v1.1.2.4",_debug:!0,_bgs:{main:"",mobile:""},_wallpaperBlur:!0,_countTask:0,_newMsgCount:0,_animated_classes:[],_animated_liveness:0,_switchMenuTooHurry:!1,_lang:"unknown",_iframeOnClick:{resolution:200,iframes:[],interval:null,Iframe:function(){this.element=arguments[0],this.cb=arguments[1],this.hasTracked=!1},track:function(element,cb){if(this.iframes.push(new this.Iframe(element,cb)),!this.interval){var _this=this;this.interval=setInterval((function(){_this.checkClick()}),this.resolution)}},checkClick:function(){if(document.activeElement){var activeElement=document.activeElement;for(var i in this.iframes){var eid=void 0;!(eid=this.iframes[i].element.id)||document.getElementById(eid)?activeElement===this.iframes[i].element?!1===this.iframes[i].hasTracked&&(this.iframes[i].cb.apply(window,[]),this.iframes[i].hasTracked=!0):this.iframes[i].hasTracked=!1:delete this.iframes[i]}}}},_iframe_click_lock_children:{},_renderBar:function(){var btns;this._countTask<=0||$("#win10_btn_group_middle>.btn").css("width","calc("+1/this._countTask*100+"% - 1px )")},_handleReady:[],_hideShortcut:function(){var that=$("#win10 #win10-shortcuts .shortcut");that.removeClass("animated flipInX"),that.addClass("animated flipOutX")},_showShortcut:function(){var that=$("#win10 #win10-shortcuts .shortcut");that.removeClass("animated flipOutX"),that.addClass("animated flipInX")},_checkBgUrls:function(){var loaders=$("#win10>.img-loader"),flag=!1;if(Win10.isSmallScreen()){if(Win10._bgs.mobile&&(loaders.each((function(){var loader=$(this);loader.attr("src")===Win10._bgs.mobile&&loader.hasClass("loaded")&&(Win10._setBackgroundImg(Win10._bgs.mobile),flag=!0)})),!flag)){var img=$('');$("#win10").append(img),Win10._onImgComplete(img[0],(function(){img.addClass("loaded"),Win10._setBackgroundImg(Win10._bgs.mobile)}))}}else if(Win10._bgs.main&&(loaders.each((function(){var loader=$(this);loader.attr("src")===Win10._bgs.main&&loader.hasClass("loaded")&&(Win10._setBackgroundImg(Win10._bgs.main),flag=!0)})),!flag)){var img=$('');$("#win10").append(img),Win10._onImgComplete(img[0],(function(){img.addClass("loaded"),Win10._setBackgroundImg(Win10._bgs.main)}))}Win10._wallpaperBlur&&$(".background").addClass("blur")},_startAnimate:function(){setInterval((function(){var classes_lenth=Win10._animated_classes.length,animated_liveness=Win10._animated_liveness;0!==animated_liveness&&0!==classes_lenth&&$("#win10-menu").hasClass("opened")&&$("#win10-menu>.blocks>.menu_group>.block").each((function(){if(!$(this).hasClass("onAnimate")&&Math.random()<=animated_liveness){var that=$(this),class_animate=Win10._animated_classes[Math.floor(Math.random()*classes_lenth)];that.addClass("onAnimate"),setTimeout((function(){that.addClass(class_animate),setTimeout((function(){that.removeClass("onAnimate"),that.removeClass(class_animate)}),3e3)}),2*Math.random()*1e3)}}))}),1e3)},_onImgComplete:function(img,callback){if(img)var timer=setInterval((function(){img.complete&&(callback(img),clearInterval(timer))}),50)},_setBackgroundImg:function(img){$("#win10 .background").css("background-image","url("+img+")")},_settop:function(layero){isNaN(layero)||(layero=this.getLayeroByIndex(layero));var max_zindex=0;$(".win10-open-iframe").each((function(){z=parseInt($(this).css("z-index")),$(this).css("z-index",z-1),z>max_zindex&&(max_zindex=z)})),layero.css("z-index",max_zindex+1)},_checkTop:function(){var max_index=0,max_z=0,btn=null;$("#win10_btn_group_middle .btn.show").each((function(){var index=$(this).attr("index"),layero,z=Win10.getLayeroByIndex(index).css("z-index");z>max_z&&(max_index=index,max_z=z,btn=$(this))})),this._settop(max_index),$("#win10_btn_group_middle .btn").removeClass("active"),btn&&btn.addClass("active")},_renderContextMenu:function(x,y,menu,trigger){if(this._removeContextMenu(),!0!==menu){var dom=$("
      ");$("#win10").append(dom);for(var ul=dom.find("ul"),i=0;i"+item[0]+"");ul.append(sub),sub.click(trigger,item[1])}}else ul.append($("
    • "+item+"
    • "));else ul.append($("
      "))}x+150>document.body.clientWidth&&(x-=150),y+dom.height()>document.body.clientHeight&&(y-=dom.height()),dom.css({top:y,left:x})}},_removeContextMenu:function(){$(".win10-context-menu").remove()},_closeWin:function(index){$("#win10_"+index).remove(),layer.close(index),Win10._checkTop(),Win10._countTask--},_fixWindowsHeightAndWidth:function(){var opens=$(".win10-open-iframe"),clientHeight=document.body.clientHeight;opens.each((function(){var layero_opened=$(this),height=layero_opened.css("height");(height=parseInt(height.replace("px","")))+30>=clientHeight&&(layero_opened.css("height",clientHeight-30),layero_opened.find(".layui-layer-content").css("height",clientHeight-62),layero_opened.find(".layui-layer-content iframe").css("height",clientHeight-62))}))},_bind_open_windows:function(){$("#win10").on("click",".win10-open-window",(function(){if($this=$(this),""!==$this.data("url")){var title=$this.data("title")||"",areaAndOffset,icon,bg=$this.data("icon-bg")?$this.data("icon-bg"):"";$this.data("icon-image")&&(icon=''),$this.data("icon-font")&&(icon=''),title||1!==$this.children(".icon").length||1!==$this.children(".title").length||(title=$this.children(".title").html(),icon||(icon=$this.children(".icon").prop("outerHTML"))),$this.data("area-offset")&&(areaAndOffset=$this.data("area-offset"),-1!==areaAndOffset.indexOf(",")&&(areaAndOffset=eval(areaAndOffset))),Win10.openUrl($this.data("url"),icon,title,areaAndOffset)}}))},_init:function(){this._lang=(navigator.language||navigator.browserLanguage).toLowerCase(),$("#win10_btn_win").click((function(){Win10.commandCenterClose(),Win10.menuToggle()})),$("#win10_btn_command").click((function(){Win10.renderCommand(),Win10.menuClose(),Win10.commandCenterToggle()})),$("#win10 .desktop").click((function(){Win10.menuClose(),Win10.commandCenterClose()})),$("#win10").on("click",".notice .btn_close_msg",(function(){var msg=$(this).parents(".notice");$(msg).addClass("animated slideOutRight"),setTimeout((function(){msg.remove()}),500)})),$("#win10_command_center").on("click",".command-header div",(function(){$(this).hasClass("active")||($(this).hasClass("tab-today")?($(this).parent().siblings(".msgs").hide().siblings(".today").show(),$(this).addClass("active").siblings("div").removeClass("active")):($(this).parent().siblings(".today").hide().siblings(".msgs").show(),$(this).addClass("active").siblings("div").removeClass("active")))})),$("#win10_btn_command_center_clean_all").click((function(){var msgs=$("#win10_command_center .msg");msgs.addClass("animated slideOutRight"),setTimeout((function(){msgs.remove()}),1500),setTimeout((function(){Win10.commandCenterClose()}),1e3)})),$("#win10_btn_show_desktop").click((function(){$("#win10 .desktop").click(),Win10.hideWins()})),$("#win10-menu-switcher").click((function(){if(!Win10._switchMenuTooHurry){Win10._switchMenuTooHurry=!0;var class_name="win10-menu-hidden",list=$("#win10-menu>.list"),blocks=$("#win10-menu>.blocks"),toggleSlide=function(obj){obj.hasClass(class_name)?(obj.addClass("animated slideInLeft"),obj.removeClass("animated slideOutLeft"),obj.removeClass(class_name)):(setTimeout((function(){obj.addClass(class_name)}),450),obj.addClass("animated slideOutLeft"),obj.removeClass("animated slideInLeft"))};toggleSlide(list),toggleSlide(blocks),setTimeout((function(){Win10._switchMenuTooHurry=!1}),520)}})),$("#win10_btn_group_middle").click((function(){$("#win10 .desktop").click()})),$(document).on("click",".win10-btn-refresh",(function(){var index=$(this).attr("index"),iframe=Win10.getLayeroByIndex(index).find("iframe");iframe.attr("src",iframe.attr("src"))})),$(document).on("mousedown",".win10-open-iframe",(function(){var layero=$(this);Win10._settop(layero),Win10._checkTop()})),$("#win10_btn_group_middle").on("click",".btn_close",(function(){var index=$(this).parent().attr("index");Win10._closeWin(index)})),$("#win10-menu .list").on("click",".item",(function(){var e=$(this);for(e.hasClass("has-sub-down")&&($("#win10-menu .list .item.has-sub-up").toggleClass("has-sub-down").toggleClass("has-sub-up"),$("#win10-menu .list .sub-item").slideUp()),e.next().hasClass("sub-item")&&e.toggleClass("has-sub-down").toggleClass("has-sub-up");e.next().hasClass("sub-item");)e.next().slideToggle(),e=e.next()})),setInterval((function(){var myDate=Win10.getLunarObj();$("#win10_btn_time").html(myDate.weekDay+myDate.hour+":"+myDate.minute)}),1e3),document.body.onbeforeunload=function(event){var rel=Win10.lang("系统可能不会保存您所做的更改","The system may not save the changes you have made.");window.event?window.event.returnValue=rel:event.returnValue=rel},Win10.buildList(),Win10._startAnimate(),Win10.renderShortcuts(),$("#win10-shortcuts").removeClass("shortcuts-hidden"),Win10._showShortcut(),Win10.renderDocks(),$(window).resize((function(){Win10.renderShortcuts(),Win10._checkBgUrls(),Win10.isSmallScreen()||Win10._fixWindowsHeightAndWidth(),Win10.renderDocks()})),setTimeout((function(){console.log(Win10.lang("本页由Win10-UI强力驱动\n更多信息:http://win10ui.yuri2.cn \nWin10-UI,轻松打造别具一格的后台界面 ","The page is strongly driven by Win10-UI.\nFor more info: http://win10ui.yuri2.cn.\n Win10-UI, easy to create a unique background interface."))}),2e3),$(document).click((function(event){event.button||Win10._removeContextMenu()})),$(document).on("contextmenu",".win10-context-menu",(function(e){e.preventDefault(),e.stopPropagation()})),Win10.setContextMenu("#win10",!0),Win10.setContextMenu("#win10>.desktop",[[' 收藏本页',function(){var url=window.location,title=document.title,ua=navigator.userAgent.toLowerCase();if(ua.indexOf("360se")>-1)layer.alert(Win10.lang("您的浏览器不支持,请按 Ctrl+D 手动收藏!","Your browser does not support, please press Ctrl+D to manual collection!"));else if(ua.indexOf("msie 8")>-1)window.external.AddToFavoritesBar(url,title);else if(document.all)try{window.external.addFavorite(url,title)}catch(e){layer.alert(Win10.lang("您的浏览器不支持,请按 Ctrl+D 手动收藏!","Your browser does not support, please press Ctrl+D to manual collection!"))}else window.sidebar?window.sidebar.addPanel(title,url,""):layer.alert(Win10.lang("您的浏览器不支持,请按 Ctrl+D 手动收藏!","Your browser does not support, please press Ctrl+D to manual collection!"))}],[' '+Win10.lang("进入全屏","Enable Full Screen"),function(){Win10.enableFullScreen()}],[' '+Win10.lang("退出全屏","Disable Full Screen"),function(){Win10.disableFullScreen()}],"|",[' '+Win10.lang("关于","About Us"),function(){Win10.aboutUs()}]]),Win10.setContextMenu("#win10_btn_group_middle",[[' '+Win10.lang("全部显示","Show All Windows"),function(){Win10.showWins()}],[' '+Win10.lang("全部隐藏","Hide All Windows"),function(){Win10.hideWins()}],[' '+Win10.lang("全部关闭","Close All Windows"),function(){Win10.closeAll()}]]),setInterval((function(){var btn=$("#win10-msg-nof.on-new-msg");btn.length>0&&btn.toggleClass("fa-commenting-o")}),600),$("body").keyup((function(e){if(e.ctrlKey)switch(e.keyCode){case 37:$("#win10_btn_win").click();break;case 38:Win10.showWins();break;case 39:$("#win10_btn_command").click();break;case 40:Win10.hideWins()}})),$("#win10-desktop-scene").length<1&&($("#win10-shortcuts").css({position:"absolute",left:0,top:30,"z-index":100}),$("#win10 .desktop").append("
      ")),Win10._bind_open_windows()},setBgUrl:function(bgs){this._bgs=bgs,this._checkBgUrls()},setBg:function(bgs){this._bgs=bgs,this._checkBgUrls()},menuClose:function(){$("#win10-menu").removeClass("opened"),$("#win10-menu").addClass("hidden"),this._showShortcut(),$(".win10-open-iframe").removeClass("hide")},getLunarObj:function(){var lunarInfo=[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448],Animals=["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],Gan=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Zhi=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"];function lYearDays(y){var i,sum=348;for(i=32768;i>8;i>>=1)sum+=lunarInfo[y-1900]&i?1:0;return sum+leapDays(y)}function leapDays(y){return leapMonth(y)?65536&lunarInfo[y-1900]?30:29:0}function leapMonth(y){return 15&lunarInfo[y-1900]}function monthDays(y,m){return lunarInfo[y-1900]&65536>>m?30:29}function lunar(objDate){var i,leap=0,temp=0,baseDate,offset=(objDate-new Date(1900,0,31))/864e5;for(this.dayCyl=offset+40,this.monCyl=14,i=1900;i<2050&&offset>0;i++)offset-=temp=lYearDays(i),this.monCyl+=12;for(offset<0&&(offset+=temp,i--,this.monCyl-=12),this.year=i,this.yearCyl=i-1864,leap=leapMonth(i),this.isLeap=!1,i=1;i<13&&offset>0;i++)leap>0&&i==leap+1&&!1===this.isLeap?(--i,this.isLeap=!0,temp=leapDays(this.year)):temp=monthDays(this.year,i),!0===this.isLeap&&i==leap+1&&(this.isLeap=!1),offset-=temp,!1===this.isLeap&&this.monCyl++;0==offset&&leap>0&&i==leap+1&&(this.isLeap?this.isLeap=!1:(this.isLeap=!0,--i,--this.monCyl)),offset<0&&(offset+=temp,--i,--this.monCyl),this.month=i,this.day=offset+1}function get_lunarmonth(month){var fm;return["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","腊月"][month-1]}function get_lunarday(day){var fd=["十","一","二","三","四","五","六","七","八","九","十"];return day<=10?"初"+fd[day]:day<20?"十"+fd[day-10]:20==day?"二十":day<30?"廿"+fd[day-20]:"三"+fd[day-30]}function get_ganzhi(year){var num=year-1900+36;return Gan[num%10]+Zhi[num%12]}function get_animal(year){return Animals[(year-4)%12]}function get_weekday(date){var values;return["周日","周一","周二","周三","周四","周五","周六"][date.getDay()]}function get_week(date){var values;return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][date.getDay()]}function get_min(date){var mins=date.getMinutes();return mins<10&&(mins="0"+mins),mins}function get_hour(date){var hour=date.getHours();return hours=hour<6?"凌晨"+hour:hour<9?"早上"+hour:hour<12?"上午"+hour:hour<14?"中午"+(hour-12):hour<17?"下午"+(hour-12):hour<19?"傍晚"+(hour-12):hour<22?"晚上"+(hour-12):"深夜"+(hour-12),hours}var viewdate={},date=new Date;viewdate.second=date.getSeconds(),viewdate.minute=get_min(date),viewdate.hour=get_hour(date),viewdate.day=date.getDate(),viewdate.week=get_week(date),viewdate.weekDay=get_weekday(date),viewdate.month=date.getMonth()+1,viewdate.fullYear=date.getFullYear(),viewdate.year=date.getYear();var lunar_obj=new lunar(date);viewdate.lunarmonth=get_lunarmonth(lunar_obj.month);var lunar_day=Math.floor(lunar_obj.day);return viewdate.lunarday=get_lunarday(lunar_day),viewdate.lunar=lunar_obj.year+"-"+lunar_obj.month+"-"+lunar_day,viewdate.ganzhi=get_ganzhi(lunar_obj.year),viewdate.animal=get_animal(lunar_obj.year),viewdate},renderCommand:function(today=null){var active;if(!$("#win10_command_center .command-body.today").hasClass("active")){if(!today){var lunarDate=Win10.getLunarObj(),today='
      '+lunarDate.month+"月"+lunarDate.day+"日 "+lunarDate.week+'
      '+lunarDate.ganzhi+"年"+lunarDate.lunarmonth+lunarDate.lunarday+"
      ";today+='
      天气
      '}$("#win10_command_center .command-body.today").html(today).addClass("active")}},menuOpen:function(){$("#win10-menu").addClass("opened"),$("#win10-menu").removeClass("hidden"),$(".win10-open-iframe").addClass("hide")},menuToggle:function(){$("#win10-menu").hasClass("opened")?this.menuClose():this.menuOpen()},commandCenterClose:function(){$("#win10_command_center").addClass("hidden_right"),this._showShortcut(),$(".win10-open-iframe").removeClass("hide")},commandCenterOpen:function(){$("#win10_command_center").removeClass("hidden_right"),$(".win10-open-iframe").addClass("hide"),$("#win10-msg-nof").removeClass("on-new-msg fa-commenting-o")},renderShortcuts:function(){if(this.isSmallScreen()){var w=parseInt(($("#win10 #win10-shortcuts")[0].offsetWidth-10)/82),x=0,y=0;$("#win10 #win10-shortcuts .shortcut").each((function(){$(this).css({left:82*x+10,right:0,top:100*y+10}),++x>=w&&(x=0,y++)}))}else{var h=parseInt(($("#win10 #win10-shortcuts")[0].offsetHeight-90)/100),w=0,x=0,y=0;$("#win10 #win10-shortcuts .shortcut").each((function(){$(this).css({left:82*x+10,top:100*y+10}),++y>=h&&(y=0,x++)}))}},renderDocks:function(){for(var cell_width=60,width=document.body.clientWidth,docks=$("#footer .dock li"),max_num=parseInt(width/60)-1,i=0;imax_num?docks.eq(i).css("display","none"):docks.eq(i).css("display","list-item");this.isSmallScreen()?$("#footer .dock li a img").hover((function(){$(this).parent("a").prev().css("display","none")})):$("#footer .dock li a img").hover((function(){$(this).parent("a").prev().css("display","flex")}),(function(){$(this).parent("a").prev().css("display","none")}))},commandCenterToggle:function(){$("#win10_command_center").hasClass("hidden_right")?this.commandCenterOpen():this.commandCenterClose()},newMsg:function(title,content,handle_click,app_name="提示消息",app_icon='',is_del=!0){var msg='
      '+app_icon+''+app_name+"";is_del&&(msg+=''),msg+='
      '+title+'
      '+content+"
      ";var e=$(msg);$("#win10_command_center .msgs").prepend(e),e.find(".content:first,.title:first").click((function(){handle_click&&handle_click(e)})),layer.tips(Win10.lang("新消息:","New message:")+title,"#win10_btn_command",{tips:[1,"rgba(0, 0, 0, 0.7)"],time:3e3}),$("#win10_command_center").hasClass("hidden_right")&&$("#win10-msg-nof").addClass("on-new-msg")},getLayeroByIndex:function(index){return $("#layui-layer"+index)},isSmallScreen:function(size){var width;return size||(size=768),document.body.clientWidth12)return layer.msg("您打开的太多了,歇会儿吧~"),!1;var preg,area,offset;if(this._countTask++,url||(url="404"),url=url.replace(/(^\s*)|(\s*$)/g,""),/^(https?:\/\/|\.\.?\/|\/\/?)/.test(url)||(url="http://"+url),url||(url="//yuri2.cn"),title||(title=url),this.isSmallScreen()||"max"===areaAndOffset)area=["100%",document.body.clientHeight-24+"px"],offset=["24px","0"];else if("object"==typeof areaAndOffset)area=areaAndOffset[0],offset=areaAndOffset[1];else{var topset,leftset;area=["80%","80%"],topset=((topset=parseInt($(window).height()))-.8*topset)/2-31,leftset=((leftset=parseInt($(window).width()))-.8*leftset)/2-120,offset=[Math.round(this._countTask%10*20+topset)+"px",Math.round(this._countTask%10*20+100+leftset)+"px"]}var index=layer.open({type:2,shadeClose:!0,shade:!1,maxmin:!0,title:icon+title,content:url,area:area,offset:offset,isOutAnim:!1,skin:"win10-open-iframe",cancel:function(index,layero){$("#win10_"+index).remove(),Win10._checkTop(),Win10._countTask--},min:function(layero){return layero.hide(),$("#win10_"+index).removeClass("show"),Win10._checkTop(),!1},full:function(layero){layero.find(".layui-layer-min").css("display","inline-block"),layero_opened.css("top",24)}});$("#win10_btn_group_middle .btn.active").removeClass("active");var btn=$('
      '+icon+"
      "),layero_opened=Win10.getLayeroByIndex(index);return layero_opened.css("z-index",Win10._countTask+813),Win10._settop(layero_opened),layero_opened.find(".layui-layer-setwin").prepend(''),layero_opened.find(".layui-layer-setwin>a").each((function(){$(this).prependTo(layero_opened.find(".layui-layer-setwin"))})),layero_opened.find(".layui-layer-setwin .layui-layer-max").click((function(){setTimeout((function(){var height=layero_opened.css("height");(height=parseInt(height.replace("px","")))>=document.body.clientHeight&&(layero_opened.css("height",height-25),layero_opened.find(".layui-layer-content").css("height",height-55),layero_opened.find(".layui-layer-content iframe").css("height",height-55))}),300)})),$("#win10_btn_group_middle").append(btn),btn.click((function(){var index=$(this).attr("index"),layero=Win10.getLayeroByIndex(index),settop=function(){var max_zindex=0;$(".win10-open-iframe").each((function(){z=parseInt($(this).css("z-index")),$(this).css("z-index",z-1),z>max_zindex&&(max_zindex=z)})),layero.css("z-index",max_zindex+1)};$(this).hasClass("show")?$(this).hasClass("active")?($(this).removeClass("active"),$(this).removeClass("show"),Win10._checkTop(),layero.hide()):($("#win10_btn_group_middle .btn.active").removeClass("active"),$(this).addClass("active"),Win10._settop(layero)):($(this).addClass("show"),$("#win10_btn_group_middle .btn.active").removeClass("active"),$(this).addClass("active"),Win10._settop(layero),layero.show())})),Win10._iframeOnClick.track(layero_opened.find("iframe:first")[0],(function(){0===Object.getOwnPropertyNames(Win10._iframe_click_lock_children).length?(Win10._settop(layero_opened),Win10._checkTop()):console.log("click locked")})),this.menuClose(),this.commandCenterClose(),index},closeAll:function(){$(".win10-open-iframe").remove(),$("#win10_btn_group_middle").html(""),Win10._countTask=0},setAnimated:function(animated_classes,animated_liveness){this._animated_classes=animated_classes,this._animated_liveness=animated_liveness},exit:function(){layer.confirm(Win10.lang("确认要关闭本页吗?","Are you sure you want to close this page?"),{icon:3,title:Win10.lang("提示","Prompt")},(function(index){document.body.onbeforeunload=function(){},window.location.href="about:blank",window.close(),layer.close(index),layer.alert(Win10.lang("哎呀,好像失败了呢。","Ops...There seems to be a little problem."),{skin:"layui-layer-lan",closeBtn:0})}))},lang:function(cn,en){return"zh-cn"===this._lang||"zh-tw"===this._lang?cn:en},aboutUs:function(){layer.open({type:1,closeBtn:1,anim:2,skin:"win10-open-iframe",title:"MAC-UI "+this._version,shadeClose:!0,area:["320px","200px"],content:'

      支持组件:layer、jquery、animated.css、font-awesome

      木子的忧伤、尤里2号©版权所有

      作者邮箱:1099438829@qq.com

      '})},setContextMenu:function(jq_dom,menu){"string"==typeof jq_dom&&(jq_dom=$(jq_dom)),jq_dom.unbind("contextmenu"),jq_dom.on("contextmenu",(function(e){menu&&(Win10._renderContextMenu(e.clientX,e.clientY,menu,this),e.cancelable&&(e.defaultPrevented||e.preventDefault()),e.stopPropagation())}))},hideWins:function(){$("#win10_btn_group_middle>.btn.show").each((function(){var index=$(this).attr("index"),layero=Win10.getLayeroByIndex(index);$(this).removeClass("show"),$(this).removeClass("active"),layero.hide()}))},showWins:function(){$("#win10_btn_group_middle>.btn").each((function(){var index=$(this).attr("index"),layero=Win10.getLayeroByIndex(index);$(this).addClass("show"),layero.show()})),Win10._checkTop()},getDesktopScene:function(){return $("#win10-desktop-scene")},onReady:function(handle){Win10._handleReady.push(handle)}},$((function(){for(var i in Win10._init(),Win10._handleReady){var handle;(0,Win10._handleReady[i])()}})); \ No newline at end of file +window.Win10={_version:"v1.1.2.4",_debug:!0,_bgs:{main:"",mobile:""},_wallpaperBlur:!0,_countTask:0,_newMsgCount:0,_animated_classes:[],_animated_liveness:0,_switchMenuTooHurry:!1,_lang:"unknown",_iframeOnClick:{resolution:200,iframes:[],interval:null,Iframe:function(){this.element=arguments[0],this.cb=arguments[1],this.hasTracked=!1},track:function(a,b){if(this.iframes.push(new this.Iframe(a,b)),!this.interval){let a=this;this.interval=setInterval(function(){a.checkClick()},this.resolution)}},checkClick:function(){if(document.activeElement){let a=document.activeElement;for(let b in this.iframes){let c;if((c=this.iframes[b].element.id)&&!document.getElementById(c)){delete this.iframes[b];continue}a===this.iframes[b].element?!1===this.iframes[b].hasTracked&&(this.iframes[b].cb.apply(window,[]),this.iframes[b].hasTracked=!0):this.iframes[b].hasTracked=!1}}}},_iframe_click_lock_children:{},_renderBar:function(){if(!(0>=this._countTask)){let a=$("#win10_btn_group_middle>.btn");a.css("width","calc("+100*(1/this._countTask)+"% - 1px )")}},_handleReady:[],_hideShortcut:function(){let a=$("#win10 #win10-shortcuts .shortcut");a.removeClass("animated flipInX"),a.addClass("animated flipOutX")},_showShortcut:function(){let a=$("#win10 #win10-shortcuts .shortcut");a.removeClass("animated flipOutX"),a.addClass("animated flipInX")},_checkBgUrls:function(){let a=$("#win10>.img-loader"),b=!1;if(Win10.isSmallScreen()){if(Win10._bgs.mobile&&(a.each(function(){let a=$(this);a.attr("src")===Win10._bgs.mobile&&a.hasClass("loaded")&&(Win10._setBackgroundImg(Win10._bgs.mobile),b=!0)}),!b)){let a=$("");$("#win10").append(a),Win10._onImgComplete(a[0],function(){a.addClass("loaded"),Win10._setBackgroundImg(Win10._bgs.mobile)})}}else if(Win10._bgs.main&&(a.each(function(){let a=$(this);a.attr("src")===Win10._bgs.main&&a.hasClass("loaded")&&(Win10._setBackgroundImg(Win10._bgs.main),b=!0)}),!b)){let a=$("");$("#win10").append(a),Win10._onImgComplete(a[0],function(){a.addClass("loaded"),Win10._setBackgroundImg(Win10._bgs.main)})}Win10._wallpaperBlur&&$(".background").addClass("blur")},_startAnimate:function(){setInterval(function(){let a=Win10._animated_classes.length,b=Win10._animated_liveness;0!==b&&0!==a&&$("#win10-menu").hasClass("opened")&&$("#win10-menu>.blocks>.menu_group>.block").each(function(){if(!$(this).hasClass("onAnimate")&&Math.random()<=b){let b=$(this),c=Win10._animated_classes[Math.floor(Math.random()*a)];b.addClass("onAnimate"),setTimeout(function(){b.addClass(c),setTimeout(function(){b.removeClass("onAnimate"),b.removeClass(c)},3e3)},1e3*(2*Math.random()))}})},1e3)},_onImgComplete:function(a,b){if(!a)return;let c=setInterval(function(){a.complete&&(b(a),clearInterval(c))},50)},_setBackgroundImg:function(a){$("#win10 .background").css("background-image","url("+a+")")},_settop:function(a){isNaN(a)||(a=this.getLayeroByIndex(a));let b=0;$(".win10-open-iframe").each(function(){z=parseInt($(this).css("z-index")),$(this).css("z-index",z-1),z>b&&(b=z)}),a.css("z-index",b+1)},_checkTop:function(){let a=0,b=0,c=null;$("#win10_btn_group_middle .btn.show").each(function(){let d=$(this).attr("index"),e=Win10.getLayeroByIndex(d),f=e.css("z-index");f>b&&(a=d,b=f,c=$(this))}),this._settop(a),$("#win10_btn_group_middle .btn").removeClass("active"),c&&c.addClass("active")},_renderContextMenu:function(a,b,c,d){if(this._removeContextMenu(),!0!==c){let e=$("
        ");$("#win10").append(e);let f=e.find("ul");for(let a,b=0;b"));continue}if("string"==typeof a){f.append($("
      • "+a+"
      • "));continue}if("object"==typeof a){let b=$("
      • "+a[0]+"
      • ");f.append(b),b.click(d,a[1])}}a+150>document.body.clientWidth&&(a-=150),b+e.height()>document.body.clientHeight&&(b-=e.height()),e.css({top:b,left:a})}},_removeContextMenu:function(){$(".win10-context-menu").remove()},_closeWin:function(a){$("#win10_"+a).remove(),layer.close(a),Win10._checkTop(),Win10._countTask--},_fixWindowsHeightAndWidth:function(){let a=$(".win10-open-iframe"),b=document.body.clientHeight;a.each(function(){let a=$(this),c=a.css("height");c=parseInt(c.replace("px","")),c+30>=b&&(a.css("height",b-30),a.find(".layui-layer-content").css("height",b-62),a.find(".layui-layer-content iframe").css("height",b-62))})},_bind_open_windows:function(){$("#win10").on("click",".win10-open-window",function(){if($this=$(this),""!==$this.data("url")){let areaAndOffset,icon,title=$this.data("title")||"",bg=$this.data("icon-bg")?$this.data("icon-bg"):"";$this.data("icon-image")&&(icon=""),$this.data("icon-font")&&(icon=""),title||1!==$this.children(".icon").length||1!==$this.children(".title").length||(title=$this.children(".title").html(),!icon&&(icon=$this.children(".icon").prop("outerHTML"))),$this.data("area-offset")&&(areaAndOffset=$this.data("area-offset"),-1!==areaAndOffset.indexOf(",")&&(areaAndOffset=eval(areaAndOffset))),Win10.openUrl($this.data("url"),icon,title,areaAndOffset)}})},_init:function(){this._lang=(navigator.language||navigator.browserLanguage).toLowerCase(),$("#win10_btn_win").click(function(){Win10.commandCenterClose(),Win10.menuToggle()}),$("#win10_btn_command").click(function(){Win10.renderCommand(),Win10.menuClose(),Win10.commandCenterToggle()}),$("#win10 .desktop").click(function(){Win10.menuClose(),Win10.commandCenterClose()}),$("#win10").on("click",".notice .btn_close_msg",function(){let a=$(this).parents(".notice");$(a).addClass("animated slideOutRight"),setTimeout(function(){a.remove()},500)}),$("#win10_command_center").on("click",".command-header div",function(){$(this).hasClass("active")||($(this).hasClass("tab-today")?($(this).parent().siblings(".msgs").hide().siblings(".today").show(),$(this).addClass("active").siblings("div").removeClass("active")):($(this).parent().siblings(".today").hide().siblings(".msgs").show(),$(this).addClass("active").siblings("div").removeClass("active")))}),$("#win10_btn_command_center_clean_all").click(function(){let a=$("#win10_command_center .msg");a.addClass("animated slideOutRight"),setTimeout(function(){a.remove()},1500),setTimeout(function(){Win10.commandCenterClose()},1e3)}),$("#win10_btn_show_desktop").click(function(){$("#win10 .desktop").click(),Win10.hideWins()}),$("#win10-menu-switcher").click(function(){if(Win10._switchMenuTooHurry)return;Win10._switchMenuTooHurry=!0;let a="win10-menu-hidden",b=$("#win10-menu>.list"),c=$("#win10-menu>.blocks"),d=function(b){b.hasClass(a)?(b.addClass("animated slideInLeft"),b.removeClass("animated slideOutLeft"),b.removeClass(a)):(setTimeout(function(){b.addClass(a)},450),b.addClass("animated slideOutLeft"),b.removeClass("animated slideInLeft"))};d(b),d(c),setTimeout(function(){Win10._switchMenuTooHurry=!1},520)}),$("#win10_btn_group_middle").click(function(){$("#win10 .desktop").click()}),$(document).on("click",".win10-btn-refresh",function(){let a=$(this).attr("index"),b=Win10.getLayeroByIndex(a).find("iframe");b.attr("src",b.attr("src"))}),$(document).on("mousedown",".win10-open-iframe",function(){let a=$(this);Win10._settop(a),Win10._checkTop()}),$("#win10_btn_group_middle").on("click",".btn_close",function(){let a=$(this).parent().attr("index");Win10._closeWin(a)}),$("#win10-menu .list").on("click",".item",function(){let a=$(this);for(a.hasClass("has-sub-down")&&($("#win10-menu .list .item.has-sub-up").toggleClass("has-sub-down").toggleClass("has-sub-up"),$("#win10-menu .list .sub-item").slideUp()),a.next().hasClass("sub-item")&&a.toggleClass("has-sub-down").toggleClass("has-sub-up");a.next().hasClass("sub-item");)a.next().slideToggle(),a=a.next()}),setInterval(function(){let a=Win10.getLunarObj();$("#win10_btn_time").html(a.weekDay+a.hour+":"+a.minute)},1e3),document.body.onbeforeunload=function(a){let b=Win10.lang("\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539","The system may not save the changes you have made.");window.event?window.event.returnValue=b:a.returnValue=b},Win10.buildList(),Win10._startAnimate(),Win10.renderShortcuts(),$("#win10-shortcuts").removeClass("shortcuts-hidden"),Win10._showShortcut(),Win10.renderDocks(),$(window).resize(function(){Win10.renderShortcuts(),Win10._checkBgUrls(),Win10.isSmallScreen()||Win10._fixWindowsHeightAndWidth(),Win10.renderDocks()}),setTimeout(function(){console.log(Win10.lang("\u672C\u9875\u7531Win10-UI\u5F3A\u529B\u9A71\u52A8\n\u66F4\u591A\u4FE1\u606F\uFF1Ahttp://win10ui.yuri2.cn \nWin10-UI,\u8F7B\u677E\u6253\u9020\u522B\u5177\u4E00\u683C\u7684\u540E\u53F0\u754C\u9762 ","The page is strongly driven by Win10-UI.\nFor more info: http://win10ui.yuri2.cn.\n Win10-UI, easy to create a unique background interface."))},2e3),$(document).click(function(a){a.button||Win10._removeContextMenu()}),$(document).on("contextmenu",".win10-context-menu",function(a){a.preventDefault(),a.stopPropagation()}),Win10.setContextMenu("#win10",!0),Win10.setContextMenu("#win10>.desktop",[[" \u6536\u85CF\u672C\u9875",function(){let a=window.location,b=document.title,c=navigator.userAgent.toLowerCase();if(-1 "+Win10.lang("\u8FDB\u5165\u5168\u5C4F","Enable Full Screen"),function(){Win10.enableFullScreen()}],[" "+Win10.lang("\u9000\u51FA\u5168\u5C4F","Disable Full Screen"),function(){Win10.disableFullScreen()}],"|",[" "+Win10.lang("\u5173\u4E8E","About Us"),function(){Win10.aboutUs()}]]),Win10.setContextMenu("#win10_btn_group_middle",[[" "+Win10.lang("\u5168\u90E8\u663E\u793A","Show All Windows"),function(){Win10.showWins()}],[" "+Win10.lang("\u5168\u90E8\u9690\u85CF","Hide All Windows"),function(){Win10.hideWins()}],[" "+Win10.lang("\u5168\u90E8\u5173\u95ED","Close All Windows"),function(){Win10.closeAll()}]]),setInterval(function(){let a=$("#win10-msg-nof.on-new-msg");0$("#win10-desktop-scene").length&&($("#win10-shortcuts").css({position:"absolute",left:0,top:30,"z-index":100}),$("#win10 .desktop").append("
        ")),Win10._bind_open_windows()},setBgUrl:function(a){this._bgs=a,this._checkBgUrls()},setBg:function(a){this._bgs=a,this._checkBgUrls()},menuClose:function(){$("#win10-menu").removeClass("opened"),$("#win10-menu").addClass("hidden"),this._showShortcut(),$(".win10-open-iframe").removeClass("hide")},getLunarObj:function(){function a(a){let c,d=348;for(c=32768;8>=1)d+=e[a-1900]&c?1:0;return d+b(a)}function b(a){return c(a)?65536&e[a-1900]?30:29:0}function c(a){return 15&e[a-1900]}function d(a,b){return e[a-1900]&65536>>b?30:29}let e=[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448],f=["\u9F20","\u725B","\u864E","\u5154","\u9F99","\u86C7","\u9A6C","\u7F8A","\u7334","\u9E21","\u72D7","\u732A"],g=["\u7532","\u4E59","\u4E19","\u4E01","\u620A","\u5DF1","\u5E9A","\u8F9B","\u58EC","\u7678"],h=["\u5B50","\u4E11","\u5BC5","\u536F","\u8FB0","\u5DF3","\u5348","\u672A","\u7533","\u9149","\u620C","\u4EA5"],i={},j=new Date;i.second=j.getSeconds(),i.minute=function(a){let b=a.getMinutes();return 10>b&&(b="0"+b),b}(j),i.hour=function(a){let b=a.getHours();return hours=6>b?"\u51CC\u6668"+b:9>b?"\u65E9\u4E0A"+b:12>b?"\u4E0A\u5348"+b:14>b?"\u4E2D\u5348"+(b-12):17>b?"\u4E0B\u5348"+(b-12):19>b?"\u508D\u665A"+(b-12):22>b?"\u665A\u4E0A"+(b-12):"\u6DF1\u591C"+(b-12),hours}(j),i.day=j.getDate(),i.week=function(a){return["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"][a.getDay()]}(j),i.weekDay=function(a){return["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"][a.getDay()]}(j),i.month=j.getMonth()+1,i.fullYear=j.getFullYear(),i.year=j.getYear();let k=new function(e){let f,g=0,h=0,j=new Date(1900,0,31),k=(e-j)/864e5;for(this.dayCyl=k+40,this.monCyl=14,f=1900;2050>f&&0k&&(k+=h,f--,this.monCyl-=12),this.year=f,this.yearCyl=f-1864,g=c(f),this.isLeap=!1,f=1;13>f&&0k&&(k+=h,--f,--this.monCyl),this.month=f,this.day=k+1}(j);i.lunarmonth=function(a){return["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u814A\u6708"][a-1]}(k.month);let l=Math.floor(k.day);return i.lunarday=function(a){let b=["\u5341","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341"];return 10>=a?"\u521D"+b[a]:20>a?"\u5341"+b[a-10]:20==a?"\u4E8C\u5341":30>a?"\u5EFF"+b[a-20]:"\u4E09"+b[a-30]}(l),i.lunar=k.year+"-"+k.month+"-"+l,i.ganzhi=function(a){let b=a-1900+36;return g[b%10]+h[b%12]}(k.year),i.animal=function(a){return f[(a-4)%12]}(k.year),i},renderCommand:function(a=null){let b=$("#win10_command_center .command-body.today").hasClass("active");if(!b){if(!a){let a=Win10.getLunarObj(),b="
        "+a.month+"\u6708"+a.day+"\u65E5 "+a.week+"
        "+a.ganzhi+"\u5E74"+a.lunarmonth+a.lunarday+"
        ";b+="
        \u5929\u6C14
        "}$("#win10_command_center .command-body.today").html(a).addClass("active")}},menuOpen:function(){$("#win10-menu").addClass("opened"),$("#win10-menu").removeClass("hidden"),$(".win10-open-iframe").addClass("hide")},menuToggle:function(){$("#win10-menu").hasClass("opened")?this.menuClose():this.menuOpen()},commandCenterClose:function(){$("#win10_command_center").addClass("hidden_right"),this._showShortcut(),$(".win10-open-iframe").removeClass("hide")},commandCenterOpen:function(){$("#win10_command_center").removeClass("hidden_right"),$(".win10-open-iframe").addClass("hide"),$("#win10-msg-nof").removeClass("on-new-msg fa-commenting-o")},renderShortcuts:function(){if(!this.isSmallScreen()){let a=parseInt(($("#win10 #win10-shortcuts")[0].offsetHeight-90)/100),b=0,c=0;$("#win10 #win10-shortcuts .shortcut").each(function(){$(this).css({right:82*b+10,left:"auto",top:100*c+10}),c++,c>=a&&(c=0,b++)})}else{let a=parseInt(($("#win10 #win10-shortcuts")[0].offsetWidth-10)/82),b=0,c=0;$("#win10 #win10-shortcuts .shortcut").each(function(){$(this).css({left:82*b+10,right:0,top:100*c+10}),b++,b>=a&&(b=0,c++)})}},renderDocks:function(){let a=document.body.clientWidth,b=$("#footer .dock li"),c=parseInt(a/60)-1;for(let a=0;ac?b.eq(a).css("display","none"):b.eq(a).css("display","list-item");this.isSmallScreen()?$("#footer .dock li a img").hover(function(){$(this).parent("a").prev().css("display","none")}):$("#footer .dock li a img").hover(function(){$(this).parent("a").prev().css("display","flex")},function(){$(this).parent("a").prev().css("display","none")})},commandCenterToggle:function(){$("#win10_command_center").hasClass("hidden_right")?this.commandCenterOpen():this.commandCenterClose()},newMsg:function(a,b,c,d="\u63D0\u793A\u6D88\u606F",f="",g=!0){let h="
        "+f+""+d+"";g&&(h+=""),h+="
        "+a+"
        "+b+"
        ";let i=$(h);$("#win10_command_center .msgs").prepend(i),i.find(".content:first,.title:first").click(function(){c&&c(i)}),layer.tips(Win10.lang("\u65B0\u6D88\u606F:","New message:")+a,"#win10_btn_command",{tips:[1,"rgba(0, 0, 0, 0.7)"],time:3e3}),$("#win10_command_center").hasClass("hidden_right")&&$("#win10-msg-nof").addClass("on-new-msg")},getLayeroByIndex:function(a){return $("#layui-layer"+a)},isSmallScreen:function(a){a||(a=768);let b=document.body.clientWidth;return b
        "+b+"
        "),j=Win10.getLayeroByIndex(h);return j.css("z-index",Win10._countTask+813),Win10._settop(j),j.find(".layui-layer-setwin").prepend(""),j.find(".layui-layer-setwin>a").each(function(){$(this).prependTo(j.find(".layui-layer-setwin"))}),j.find(".layui-layer-setwin .layui-layer-max").click(function(){setTimeout(function(){let a=j.css("height");a=parseInt(a.replace("px","")),a>=document.body.clientHeight&&(j.css("height",a-25),j.find(".layui-layer-content").css("height",a-55),j.find(".layui-layer-content iframe").css("height",a-55))},300)}),$("#win10_btn_group_middle").append(i),i.click(function(){let a=$(this).attr("index"),b=Win10.getLayeroByIndex(a);$(this).hasClass("show")?$(this).hasClass("active")?($(this).removeClass("active"),$(this).removeClass("show"),Win10._checkTop(),b.hide()):($("#win10_btn_group_middle .btn.active").removeClass("active"),$(this).addClass("active"),Win10._settop(b)):($(this).addClass("show"),$("#win10_btn_group_middle .btn.active").removeClass("active"),$(this).addClass("active"),Win10._settop(b),b.show())}),Win10._iframeOnClick.track(j.find("iframe:first")[0],function(){0===Object.getOwnPropertyNames(Win10._iframe_click_lock_children).length?(Win10._settop(j),Win10._checkTop()):console.log("click locked")}),this.menuClose(),this.commandCenterClose(),h},closeAll:function(){$(".win10-open-iframe").remove(),$("#win10_btn_group_middle").html(""),Win10._countTask=0},setAnimated:function(a,b){this._animated_classes=a,this._animated_liveness=b},exit:function(){layer.confirm(Win10.lang("\u786E\u8BA4\u8981\u5173\u95ED\u672C\u9875\u5417?","Are you sure you want to close this page?"),{icon:3,title:Win10.lang("\u63D0\u793A","Prompt")},function(a){document.body.onbeforeunload=function(){},window.location.href="about:blank",window.close(),layer.close(a),layer.alert(Win10.lang("\u54CE\u5440,\u597D\u50CF\u5931\u8D25\u4E86\u5462\u3002","Ops...There seems to be a little problem."),{skin:"layui-layer-lan",closeBtn:0})})},lang:function(a,b){return"zh-cn"===this._lang||"zh-tw"===this._lang?a:b},aboutUs:function(){layer.open({type:1,closeBtn:1,anim:2,skin:"win10-open-iframe",title:"MAC-UI "+this._version,shadeClose:!0,area:["320px","200px"],content:"

        \u652F\u6301\u7EC4\u4EF6:layer\u3001jquery\u3001animated.css\u3001font-awesome

        \u6728\u5B50\u7684\u5FE7\u4F24\u3001\u5C24\u91CC2\u53F7\xA9\u7248\u6743\u6240\u6709

        \u4F5C\u8005\u90AE\u7BB1:1099438829@qq.com

        "})},setContextMenu:function(a,b){"string"==typeof a&&(a=$(a)),a.unbind("contextmenu"),a.on("contextmenu",function(a){b&&(Win10._renderContextMenu(a.clientX,a.clientY,b,this),a.cancelable&&!a.defaultPrevented&&a.preventDefault(),a.stopPropagation())})},hideWins:function(){$("#win10_btn_group_middle>.btn.show").each(function(){let a=$(this).attr("index"),b=Win10.getLayeroByIndex(a);$(this).removeClass("show"),$(this).removeClass("active"),b.hide()})},showWins:function(){$("#win10_btn_group_middle>.btn").each(function(){let a=$(this).attr("index"),b=Win10.getLayeroByIndex(a);$(this).addClass("show"),b.show()}),Win10._checkTop()},getDesktopScene:function(){return $("#win10-desktop-scene")},onReady:function(a){Win10._handleReady.push(a)}},$(function(){for(let a in Win10._init(),Win10._handleReady){let b=Win10._handleReady[a];b()}}); \ No newline at end of file