(function ($){ 'use strict'; var wnmCookies={ setCookie: function setCookie(key, value, time, path){ var expires=new Date(); expires.setTime(expires.getTime() + time); var pathValue=''; if(typeof path!=='undefined'){ pathValue='path=' + path + ';'; } document.cookie=key + '=' + value + ';' + pathValue + 'expires=' + expires.toUTCString(); }, getCookie: function getCookie(key){ var keyValue=document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)'); return keyValue ? keyValue[2]:null; }}; document.addEventListener("DOMContentLoaded", function(event){ wp_night_mode_default(); wp_night_mode_element_to_button(); wp_night_mode_button_click(); wp_night_mode_load_cookie(); }); function wp_night_mode_default(){ if('1'===wpnmObject.default&&null===wnmCookies.getCookie('wpNightMode')){ wnmCookies.setCookie('wpNightMode', 'true', 2628000000, '/'); }} function wp_night_mode_turn_on_time(){ var server_time=wpnmObject.server_time; var turn_on_time=wpnmObject.turn_on_time; var turn_off_time=wpnmObject.turn_off_time; if(server_time >=turn_on_time&&server_time <=turn_off_time){ wnmCookies.setCookie('wpNightMode', 'true', 2628000000, '/'); }} function wp_night_mode_element_to_button(){ var buttonHtml=''; var buttonClass=document.querySelectorAll('.wp-night-mode'); buttonHtml=wpnmObject.button_html; for (var i=0; i < buttonClass.length; i++){ buttonClass[i].innerHTML=buttonHtml; }} function wp_night_mode_button_click(){ var nightModeButton=document.querySelectorAll('.wpnm-button'); for (var i=0; i < nightModeButton.length; i++){ nightModeButton.item(i).onclick=function (event){ event.preventDefault(); document.body.classList.toggle('wp-night-mode-on'); for (var i=0; i < nightModeButton.length; i++){ nightModeButton[i].classList.toggle('active'); } if(this.classList.contains('active')){ wnmCookies.setCookie('wpNightMode', 'true', 2628000000, '/'); }else{ wnmCookies.setCookie('wpNightMode', 'false', 2628000000, '/'); }};}} function wp_night_mode_load_cookie(){ var nightModeButton=document.querySelectorAll('.wpnm-button'); if('true'===wnmCookies.getCookie('wpNightMode')){ document.body.classList.add('wp-night-mode-on'); for (var i=0; i < nightModeButton.length; i++){ nightModeButton[i].classList.add('active'); }}else{ document.body.classList.remove('wp-night-mode-on'); for (var i=0; i < nightModeButton.length; i++){ nightModeButton[i].classList.remove('active'); }} }})(jQuery); !function(a,b){a(function(){"use strict";function a(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function c(a,b){var c,d,e=a.length;if(!e||!b)return!1;for(c=b.toLowerCase(),d=0;d=0&&(c=c.substring(0,j)+"([\\w._\\+]+)"+c.substring(j+5)),b[e]=new RegExp(c,"i");k.props[a]=b}d(k.oss),d(k.phones),d(k.tablets),d(k.uas),d(k.utils),k.oss0={WindowsPhoneOS:k.oss.WindowsPhoneOS,WindowsMobileOS:k.oss.WindowsMobileOS}}(),g.findMatch=function(a,b){for(var c in a)if(i.call(a,c)&&a[c].test(b))return c;return null},g.findMatches=function(a,b){var c=[];for(var d in a)i.call(a,d)&&a[d].test(b)&&c.push(d);return c},g.getVersionStr=function(a,b){var c,d,e,f,h=g.mobileDetectRules.props;if(i.call(h,a))for(c=h[a],e=c.length,d=0;d1&&(a=b[0]+".",b.shift(),a+=b.join("")),Number(a)},g.isMobileFallback=function(a){return g.detectMobileBrowsers.fullPattern.test(a)||g.detectMobileBrowsers.shortPattern.test(a.substr(0,4))},g.isTabletFallback=function(a){return g.detectMobileBrowsers.tabletPattern.test(a)},g.prepareDetectionCache=function(a,c,d){if(a.mobile===b){var e,h,i;return(h=g.findMatch(g.mobileDetectRules.tablets,c))?(a.mobile=a.tablet=h,void(a.phone=null)):(e=g.findMatch(g.mobileDetectRules.phones,c))?(a.mobile=a.phone=e,void(a.tablet=null)):void(g.isMobileFallback(c)?(i=f.isPhoneSized(d),i===b?(a.mobile=g.FALLBACK_MOBILE,a.tablet=a.phone=null):i?(a.mobile=a.phone=g.FALLBACK_PHONE,a.tablet=null):(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null)):g.isTabletFallback(c)?(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null):a.mobile=a.tablet=a.phone=null)}},g.mobileGrade=function(a){var b=null!==a.mobile();return a.os("iOS")&&a.version("iPad")>=4.3||a.os("iOS")&&a.version("iPhone")>=3.1||a.os("iOS")&&a.version("iPod")>=3.1||a.version("Android")>2.1&&a.is("Webkit")||a.version("Windows Phone OS")>=7||a.is("BlackBerry")&&a.version("BlackBerry")>=6||a.match("Playbook.*Tablet")||a.version("webOS")>=1.4&&a.match("Palm|Pre|Pixi")||a.match("hp.*TouchPad")||a.is("Firefox")&&a.version("Firefox")>=12||a.is("Chrome")&&a.is("AndroidOS")&&a.version("Android")>=4||a.is("Skyfire")&&a.version("Skyfire")>=4.1&&a.is("AndroidOS")&&a.version("Android")>=2.3||a.is("Opera")&&a.version("Opera Mobi")>11&&a.is("AndroidOS")||a.is("MeeGoOS")||a.is("Tizen")||a.is("Dolfin")&&a.version("Bada")>=2||(a.is("UC Browser")||a.is("Dolfin"))&&a.version("Android")>=2.3||a.match("Kindle Fire")||a.is("Kindle")&&a.version("Kindle")>=3||a.is("AndroidOS")&&a.is("NookTablet")||a.version("Chrome")>=11&&!b||a.version("Safari")>=5&&!b||a.version("Firefox")>=4&&!b||a.version("MSIE")>=7&&!b||a.version("Opera")>=10&&!b?"A":a.os("iOS")&&a.version("iPad")<4.3||a.os("iOS")&&a.version("iPhone")<3.1||a.os("iOS")&&a.version("iPod")<3.1||a.is("Blackberry")&&a.version("BlackBerry")>=5&&a.version("BlackBerry")<6||a.version("Opera Mini")>=5&&a.version("Opera Mini")<=6.5&&(a.version("Android")>=2.3||a.is("iOS"))||a.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||a.version("Opera Mobi")>=11&&a.is("SymbianOS")?"B":(a.version("BlackBerry")<5||a.match("MSIEMobile|Windows CE.*Mobile")||a.version("Windows Mobile")<=5.2,"C")},g.detectOS=function(a){return g.findMatch(g.mobileDetectRules.oss0,a)||g.findMatch(g.mobileDetectRules.oss,a)},g.getDeviceSmallerSide=function(){return window.screen.width