From 9158cad360aff474ca232bee50c83996ee345f87 Mon Sep 17 00:00:00 2001 From: anhnhu Date: Thu, 7 Mar 2024 12:47:36 +0700 Subject: [PATCH] #: update send action ga --- docs/assets/js-code/helpers.js | 508 ++++++++-------- docs/assets/js/frontend.js | 508 ++++++++-------- docs/assets/js/frontend.min.js | 2 +- docs/assets/js/sourcemap/frontend.min.js.map | 2 +- docs/brandingkit.html | 203 ++++--- docs/download.html | 361 ++++++------ docs/index.html | 200 ++++--- docs/security.html | 581 ++++++++++--------- docs/zh/brandingkit.html | 69 ++- docs/zh/download.html | 219 +++---- docs/zh/index.html | 126 ++-- docs/zh/security.html | 228 ++++---- 12 files changed, 1631 insertions(+), 1376 deletions(-) diff --git a/docs/assets/js-code/helpers.js b/docs/assets/js-code/helpers.js index a4a3214..fd867cf 100644 --- a/docs/assets/js-code/helpers.js +++ b/docs/assets/js-code/helpers.js @@ -1,254 +1,258 @@ ( - function( window, $ ) { - 'use strict'; - window.subwallet = window.subwallet || {}; - - const isEmptyObject = ( obj ) => { - for ( const name in obj ) { - return false; - } - - return true; - }; - - /** - * Add a URL parameter (or changing it if it already exists) - * @param {string} url - This is typically document.location.search - * @param {string} key - The key to set - * @param {string} val - Value - */ - var addUrlParam = function( url, key, val ) { - key = encodeURI( key ); - val = encodeURI( val ); - - var re = new RegExp( "([?&])" + key + "=.*?(&|$)", "i" ); - var separator = url.indexOf( '?' ) !== - 1 ? "&" : "?"; - - // Update value if key exist. - if ( url.match( re ) ) { - url = url.replace( re, '$1' + key + "=" + val + '$2' ); - } else { - url += separator + key + '=' + val; - } - - return url; - }; - - const getUrlParamsAsObject = function( query ) { - var params = {}; - - if ( - 1 === query.indexOf( '?' ) ) { - return params; - } - - query = query.substring( query.indexOf( '?' ) + 1 ); - - var re = /([^&=]+)=?([^&]*)/g; - var decodeRE = /\+/g; - - var decode = function( str ) { - return decodeURIComponent( str.replace( decodeRE, " " ) ); - }; - - var e; - while ( e = re.exec( query ) ) { - var k = decode( e[ 1 ] ), v = decode( e[ 2 ] ); - if ( k.substring( k.length - 2 ) === '[]' ) { - k = k.substring( 0, k.length - 2 ); - ( - params[ k ] || ( - params[ k ] = [] - ) - ).push( v ); - } - else { - params[ k ] = v; - } - } - - var assign = function( obj, keyPath, value ) { - var lastKeyIndex = keyPath.length - 1; - for ( var i = 0; i < lastKeyIndex; ++ i ) { - var key = keyPath[ i ]; - if ( ! ( - key in obj - ) ) { - obj[ key ] = {} - } - obj = obj[ key ]; - } - obj[ keyPath[ lastKeyIndex ] ] = value; - } - - for ( var prop in params ) { - var structure = prop.split( '[' ); - if ( structure.length > 1 ) { - var levels = []; - structure.forEach( function( item, i ) { - var key = item.replace( /[?[\]\\ ]/g, '' ); - levels.push( key ); - } ); - assign( params, levels, params[ prop ] ); - delete( - params[ prop ] - ); - } - } - return params; - }; - - const getScrollbarWidth = function() { - // Creating invisible container. - const outer = document.createElement( 'div' ); - outer.style.visibility = 'hidden'; - outer.style.overflow = 'scroll'; // forcing scrollbar to appear. - outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps. - document.body.appendChild( outer ); - - // Creating inner element and placing it in the container. - const inner = document.createElement( 'div' ); - outer.appendChild( inner ); - - // Calculating difference between container's full width and the child width. - const scrollbarWidth = ( - outer.offsetWidth - inner.offsetWidth - ); - - // Removing temporary elements from the DOM. - outer.parentNode.removeChild( outer ); - - return scrollbarWidth; - - }; - - const setBodyOverflow = function() { - $( 'body' ).css( { - 'overflow': 'hidden', - 'paddingRight': this.getScrollbarWidth() + 'px' - } ); - }; - - const unsetBodyOverflow = function() { - $( 'body' ).css( { - 'overflow': 'visible', - 'paddingRight': 0 - } ); - }; - - const setBodyHandling = function() { - $( 'body' ).removeClass( 'completed' ).addClass( 'handling' ); - }; - - const setBodyCompleted = function() { - $( 'body' ).removeClass( 'handling' ).addClass( 'completed' ); - }; - - const setElementHandling = function( $element ) { - $element.addClass( 'updating-icon' ); - }; - - const unsetElementHandling = function( $element ) { - $element.removeClass( 'updating-icon' ); - }; - - const getStyle = ( el, style ) => { - if ( window.getComputedStyle ) { - return style ? document.defaultView.getComputedStyle( el, null ).getPropertyValue( style ) : document.defaultView.getComputedStyle( el, null ); - } - else if ( el.currentStyle ) { - return style ? el.currentStyle[ style.replace( /-\w/g, ( s ) => { - return s.toUpperCase().replace( '-', '' ); - } ) ] : el.currentStyle; - } - }; - - const setCookie = function( cname, cvalue, exdays ) { - var d = new Date(); - d.setTime( d.getTime() + ( - exdays * 24 * 60 * 60 * 1000 - ) ); - var expires = 'expires=' + d.toUTCString(); - document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; - }; - - const getCookie = function( cname ) { - var name = cname + '='; - var ca = document.cookie.split( ';' ); - for ( var i = 0; i < ca.length; i ++ ) { - var c = ca[ i ]; - while ( c.charAt( 0 ) == ' ' ) { - c = c.substring( 1 ); - } - if ( c.indexOf( name ) == 0 ) { - return c.substring( name.length, c.length ); - } - } - return ''; - }; - - const isHandheld = function() { - let check = false; - ( - function( a ) { - if ( /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( a.substr( 0, 4 ) ) ) { - check = true; - } - } - )( navigator.userAgent || navigator.vendor || window.opera ); - return check; - }; - - const isValidSelector = function( selector ) { - if ( selector.match( /^([.#])(.+)/ ) ) { - return true; - } - - return false; - }; - - const copyToClipboard = function( text ) { - if ( window.clipboardData && window.clipboardData.setData ) { - // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. - return window.clipboardData.setData( "Text", text ); - - } - else if ( document.queryCommandSupported && document.queryCommandSupported( "copy" ) ) { - var textarea = document.createElement( "textarea" ); - textarea.textContent = text; - textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. - document.body.appendChild( textarea ); - textarea.select(); - try { - return document.execCommand( "copy" ); // Security exception may be thrown by some browsers. - } - catch ( ex ) { - console.warn( "Copy to clipboard failed.", ex ); - return prompt( "Copy to clipboard: Ctrl+C, Enter", text ); - } - finally { - document.body.removeChild( textarea ); - } - } - }; - - subwallet.Helpers = { - isEmptyObject, - isValidSelector, - isHandheld, - addUrlParam, - getUrlParamsAsObject, - getScrollbarWidth, - setBodyOverflow, - unsetBodyOverflow, - setBodyHandling, - setBodyCompleted, - setElementHandling, - unsetElementHandling, - getStyle, - setCookie, - getCookie, - copyToClipboard, - } - - }( window, jQuery ) + function (window, $) { + 'use strict'; + window.subwallet = window.subwallet || {}; + + const isEmptyObject = (obj) => { + for (const name in obj) { + return false; + } + + return true; + }; + + const sendEventGa = (category, link=null) => { + console.log('sendEventGa', category) + gtag('event', category); + if (link) { + window.location.href = link; + } + } + + /** + * Add a URL parameter (or changing it if it already exists) + * @param {string} url - This is typically document.location.search + * @param {string} key - The key to set + * @param {string} val - Value + */ + var addUrlParam = function (url, key, val) { + key = encodeURI(key); + val = encodeURI(val); + + var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); + var separator = url.indexOf('?') !== -1 ? "&" : "?"; + + // Update value if key exist. + if (url.match(re)) { + url = url.replace(re, '$1' + key + "=" + val + '$2'); + } else { + url += separator + key + '=' + val; + } + + return url; + }; + + const getUrlParamsAsObject = function (query) { + var params = {}; + + if (-1 === query.indexOf('?')) { + return params; + } + + query = query.substring(query.indexOf('?') + 1); + + var re = /([^&=]+)=?([^&]*)/g; + var decodeRE = /\+/g; + + var decode = function (str) { + return decodeURIComponent(str.replace(decodeRE, " ")); + }; + + var e; + while (e = re.exec(query)) { + var k = decode(e[1]), v = decode(e[2]); + if (k.substring(k.length - 2) === '[]') { + k = k.substring(0, k.length - 2); + ( + params[k] || ( + params[k] = [] + ) + ).push(v); + } else { + params[k] = v; + } + } + + var assign = function (obj, keyPath, value) { + var lastKeyIndex = keyPath.length - 1; + for (var i = 0; i < lastKeyIndex; ++i) { + var key = keyPath[i]; + if (!( + key in obj + )) { + obj[key] = {} + } + obj = obj[key]; + } + obj[keyPath[lastKeyIndex]] = value; + } + + for (var prop in params) { + var structure = prop.split('['); + if (structure.length > 1) { + var levels = []; + structure.forEach(function (item, i) { + var key = item.replace(/[?[\]\\ ]/g, ''); + levels.push(key); + }); + assign(params, levels, params[prop]); + delete ( + params[prop] + ); + } + } + return params; + }; + + const getScrollbarWidth = function () { + // Creating invisible container. + const outer = document.createElement('div'); + outer.style.visibility = 'hidden'; + outer.style.overflow = 'scroll'; // forcing scrollbar to appear. + outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps. + document.body.appendChild(outer); + + // Creating inner element and placing it in the container. + const inner = document.createElement('div'); + outer.appendChild(inner); + + // Calculating difference between container's full width and the child width. + const scrollbarWidth = ( + outer.offsetWidth - inner.offsetWidth + ); + + // Removing temporary elements from the DOM. + outer.parentNode.removeChild(outer); + + return scrollbarWidth; + + }; + + const setBodyOverflow = function () { + $('body').css({ + 'overflow': 'hidden', + 'paddingRight': this.getScrollbarWidth() + 'px' + }); + }; + + const unsetBodyOverflow = function () { + $('body').css({ + 'overflow': 'visible', + 'paddingRight': 0 + }); + }; + + const setBodyHandling = function () { + $('body').removeClass('completed').addClass('handling'); + }; + + const setBodyCompleted = function () { + $('body').removeClass('handling').addClass('completed'); + }; + + const setElementHandling = function ($element) { + $element.addClass('updating-icon'); + }; + + const unsetElementHandling = function ($element) { + $element.removeClass('updating-icon'); + }; + + const getStyle = (el, style) => { + if (window.getComputedStyle) { + return style ? document.defaultView.getComputedStyle(el, null).getPropertyValue(style) : document.defaultView.getComputedStyle(el, null); + } else if (el.currentStyle) { + return style ? el.currentStyle[style.replace(/-\w/g, (s) => { + return s.toUpperCase().replace('-', ''); + })] : el.currentStyle; + } + }; + + const setCookie = function (cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + ( + exdays * 24 * 60 * 60 * 1000 + )); + var expires = 'expires=' + d.toUTCString(); + document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; + }; + + const getCookie = function (cname) { + var name = cname + '='; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ''; + }; + + const isHandheld = function () { + let check = false; + ( + function (a) { + if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) { + check = true; + } + } + )(navigator.userAgent || navigator.vendor || window.opera); + return check; + }; + + const isValidSelector = function (selector) { + if (selector.match(/^([.#])(.+)/)) { + return true; + } + + return false; + }; + + const copyToClipboard = function (text) { + if (window.clipboardData && window.clipboardData.setData) { + // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. + return window.clipboardData.setData("Text", text); + + } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { + var textarea = document.createElement("textarea"); + textarea.textContent = text; + textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. + document.body.appendChild(textarea); + textarea.select(); + try { + return document.execCommand("copy"); // Security exception may be thrown by some browsers. + } catch (ex) { + console.warn("Copy to clipboard failed.", ex); + return prompt("Copy to clipboard: Ctrl+C, Enter", text); + } finally { + document.body.removeChild(textarea); + } + } + }; + + subwallet.Helpers = { + sendEventGa, + isEmptyObject, + isValidSelector, + isHandheld, + addUrlParam, + getUrlParamsAsObject, + getScrollbarWidth, + setBodyOverflow, + unsetBodyOverflow, + setBodyHandling, + setBodyCompleted, + setElementHandling, + unsetElementHandling, + getStyle, + setCookie, + getCookie, + copyToClipboard, + } + + }(window, jQuery) ); diff --git a/docs/assets/js/frontend.js b/docs/assets/js/frontend.js index b29f593..c0e0f4e 100644 --- a/docs/assets/js/frontend.js +++ b/docs/assets/js/frontend.js @@ -1,256 +1,260 @@ ( - function( window, $ ) { - 'use strict'; - window.subwallet = window.subwallet || {}; - - const isEmptyObject = ( obj ) => { - for ( const name in obj ) { - return false; - } - - return true; - }; - - /** - * Add a URL parameter (or changing it if it already exists) - * @param {string} url - This is typically document.location.search - * @param {string} key - The key to set - * @param {string} val - Value - */ - var addUrlParam = function( url, key, val ) { - key = encodeURI( key ); - val = encodeURI( val ); - - var re = new RegExp( "([?&])" + key + "=.*?(&|$)", "i" ); - var separator = url.indexOf( '?' ) !== - 1 ? "&" : "?"; - - // Update value if key exist. - if ( url.match( re ) ) { - url = url.replace( re, '$1' + key + "=" + val + '$2' ); - } else { - url += separator + key + '=' + val; - } - - return url; - }; - - const getUrlParamsAsObject = function( query ) { - var params = {}; - - if ( - 1 === query.indexOf( '?' ) ) { - return params; - } - - query = query.substring( query.indexOf( '?' ) + 1 ); - - var re = /([^&=]+)=?([^&]*)/g; - var decodeRE = /\+/g; - - var decode = function( str ) { - return decodeURIComponent( str.replace( decodeRE, " " ) ); - }; - - var e; - while ( e = re.exec( query ) ) { - var k = decode( e[ 1 ] ), v = decode( e[ 2 ] ); - if ( k.substring( k.length - 2 ) === '[]' ) { - k = k.substring( 0, k.length - 2 ); - ( - params[ k ] || ( - params[ k ] = [] - ) - ).push( v ); - } - else { - params[ k ] = v; - } - } - - var assign = function( obj, keyPath, value ) { - var lastKeyIndex = keyPath.length - 1; - for ( var i = 0; i < lastKeyIndex; ++ i ) { - var key = keyPath[ i ]; - if ( ! ( - key in obj - ) ) { - obj[ key ] = {} - } - obj = obj[ key ]; - } - obj[ keyPath[ lastKeyIndex ] ] = value; - } - - for ( var prop in params ) { - var structure = prop.split( '[' ); - if ( structure.length > 1 ) { - var levels = []; - structure.forEach( function( item, i ) { - var key = item.replace( /[?[\]\\ ]/g, '' ); - levels.push( key ); - } ); - assign( params, levels, params[ prop ] ); - delete( - params[ prop ] - ); - } - } - return params; - }; - - const getScrollbarWidth = function() { - // Creating invisible container. - const outer = document.createElement( 'div' ); - outer.style.visibility = 'hidden'; - outer.style.overflow = 'scroll'; // forcing scrollbar to appear. - outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps. - document.body.appendChild( outer ); - - // Creating inner element and placing it in the container. - const inner = document.createElement( 'div' ); - outer.appendChild( inner ); - - // Calculating difference between container's full width and the child width. - const scrollbarWidth = ( - outer.offsetWidth - inner.offsetWidth - ); - - // Removing temporary elements from the DOM. - outer.parentNode.removeChild( outer ); - - return scrollbarWidth; - - }; - - const setBodyOverflow = function() { - $( 'body' ).css( { - 'overflow': 'hidden', - 'paddingRight': this.getScrollbarWidth() + 'px' - } ); - }; - - const unsetBodyOverflow = function() { - $( 'body' ).css( { - 'overflow': 'visible', - 'paddingRight': 0 - } ); - }; - - const setBodyHandling = function() { - $( 'body' ).removeClass( 'completed' ).addClass( 'handling' ); - }; - - const setBodyCompleted = function() { - $( 'body' ).removeClass( 'handling' ).addClass( 'completed' ); - }; - - const setElementHandling = function( $element ) { - $element.addClass( 'updating-icon' ); - }; - - const unsetElementHandling = function( $element ) { - $element.removeClass( 'updating-icon' ); - }; - - const getStyle = ( el, style ) => { - if ( window.getComputedStyle ) { - return style ? document.defaultView.getComputedStyle( el, null ).getPropertyValue( style ) : document.defaultView.getComputedStyle( el, null ); - } - else if ( el.currentStyle ) { - return style ? el.currentStyle[ style.replace( /-\w/g, ( s ) => { - return s.toUpperCase().replace( '-', '' ); - } ) ] : el.currentStyle; - } - }; - - const setCookie = function( cname, cvalue, exdays ) { - var d = new Date(); - d.setTime( d.getTime() + ( - exdays * 24 * 60 * 60 * 1000 - ) ); - var expires = 'expires=' + d.toUTCString(); - document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; - }; - - const getCookie = function( cname ) { - var name = cname + '='; - var ca = document.cookie.split( ';' ); - for ( var i = 0; i < ca.length; i ++ ) { - var c = ca[ i ]; - while ( c.charAt( 0 ) == ' ' ) { - c = c.substring( 1 ); - } - if ( c.indexOf( name ) == 0 ) { - return c.substring( name.length, c.length ); - } - } - return ''; - }; - - const isHandheld = function() { - let check = false; - ( - function( a ) { - if ( /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( a.substr( 0, 4 ) ) ) { - check = true; - } - } - )( navigator.userAgent || navigator.vendor || window.opera ); - return check; - }; - - const isValidSelector = function( selector ) { - if ( selector.match( /^([.#])(.+)/ ) ) { - return true; - } - - return false; - }; - - const copyToClipboard = function( text ) { - if ( window.clipboardData && window.clipboardData.setData ) { - // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. - return window.clipboardData.setData( "Text", text ); - - } - else if ( document.queryCommandSupported && document.queryCommandSupported( "copy" ) ) { - var textarea = document.createElement( "textarea" ); - textarea.textContent = text; - textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. - document.body.appendChild( textarea ); - textarea.select(); - try { - return document.execCommand( "copy" ); // Security exception may be thrown by some browsers. - } - catch ( ex ) { - console.warn( "Copy to clipboard failed.", ex ); - return prompt( "Copy to clipboard: Ctrl+C, Enter", text ); - } - finally { - document.body.removeChild( textarea ); - } - } - }; - - subwallet.Helpers = { - isEmptyObject, - isValidSelector, - isHandheld, - addUrlParam, - getUrlParamsAsObject, - getScrollbarWidth, - setBodyOverflow, - unsetBodyOverflow, - setBodyHandling, - setBodyCompleted, - setElementHandling, - unsetElementHandling, - getStyle, - setCookie, - getCookie, - copyToClipboard, - } - - }( window, jQuery ) + function (window, $) { + 'use strict'; + window.subwallet = window.subwallet || {}; + + const isEmptyObject = (obj) => { + for (const name in obj) { + return false; + } + + return true; + }; + + const sendEventGa = (category, link=null) => { + console.log('sendEventGa', category) + gtag('event', category); + if (link) { + window.location.href = link; + } + } + + /** + * Add a URL parameter (or changing it if it already exists) + * @param {string} url - This is typically document.location.search + * @param {string} key - The key to set + * @param {string} val - Value + */ + var addUrlParam = function (url, key, val) { + key = encodeURI(key); + val = encodeURI(val); + + var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); + var separator = url.indexOf('?') !== -1 ? "&" : "?"; + + // Update value if key exist. + if (url.match(re)) { + url = url.replace(re, '$1' + key + "=" + val + '$2'); + } else { + url += separator + key + '=' + val; + } + + return url; + }; + + const getUrlParamsAsObject = function (query) { + var params = {}; + + if (-1 === query.indexOf('?')) { + return params; + } + + query = query.substring(query.indexOf('?') + 1); + + var re = /([^&=]+)=?([^&]*)/g; + var decodeRE = /\+/g; + + var decode = function (str) { + return decodeURIComponent(str.replace(decodeRE, " ")); + }; + + var e; + while (e = re.exec(query)) { + var k = decode(e[1]), v = decode(e[2]); + if (k.substring(k.length - 2) === '[]') { + k = k.substring(0, k.length - 2); + ( + params[k] || ( + params[k] = [] + ) + ).push(v); + } else { + params[k] = v; + } + } + + var assign = function (obj, keyPath, value) { + var lastKeyIndex = keyPath.length - 1; + for (var i = 0; i < lastKeyIndex; ++i) { + var key = keyPath[i]; + if (!( + key in obj + )) { + obj[key] = {} + } + obj = obj[key]; + } + obj[keyPath[lastKeyIndex]] = value; + } + + for (var prop in params) { + var structure = prop.split('['); + if (structure.length > 1) { + var levels = []; + structure.forEach(function (item, i) { + var key = item.replace(/[?[\]\\ ]/g, ''); + levels.push(key); + }); + assign(params, levels, params[prop]); + delete ( + params[prop] + ); + } + } + return params; + }; + + const getScrollbarWidth = function () { + // Creating invisible container. + const outer = document.createElement('div'); + outer.style.visibility = 'hidden'; + outer.style.overflow = 'scroll'; // forcing scrollbar to appear. + outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps. + document.body.appendChild(outer); + + // Creating inner element and placing it in the container. + const inner = document.createElement('div'); + outer.appendChild(inner); + + // Calculating difference between container's full width and the child width. + const scrollbarWidth = ( + outer.offsetWidth - inner.offsetWidth + ); + + // Removing temporary elements from the DOM. + outer.parentNode.removeChild(outer); + + return scrollbarWidth; + + }; + + const setBodyOverflow = function () { + $('body').css({ + 'overflow': 'hidden', + 'paddingRight': this.getScrollbarWidth() + 'px' + }); + }; + + const unsetBodyOverflow = function () { + $('body').css({ + 'overflow': 'visible', + 'paddingRight': 0 + }); + }; + + const setBodyHandling = function () { + $('body').removeClass('completed').addClass('handling'); + }; + + const setBodyCompleted = function () { + $('body').removeClass('handling').addClass('completed'); + }; + + const setElementHandling = function ($element) { + $element.addClass('updating-icon'); + }; + + const unsetElementHandling = function ($element) { + $element.removeClass('updating-icon'); + }; + + const getStyle = (el, style) => { + if (window.getComputedStyle) { + return style ? document.defaultView.getComputedStyle(el, null).getPropertyValue(style) : document.defaultView.getComputedStyle(el, null); + } else if (el.currentStyle) { + return style ? el.currentStyle[style.replace(/-\w/g, (s) => { + return s.toUpperCase().replace('-', ''); + })] : el.currentStyle; + } + }; + + const setCookie = function (cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + ( + exdays * 24 * 60 * 60 * 1000 + )); + var expires = 'expires=' + d.toUTCString(); + document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; + }; + + const getCookie = function (cname) { + var name = cname + '='; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') { + c = c.substring(1); + } + if (c.indexOf(name) == 0) { + return c.substring(name.length, c.length); + } + } + return ''; + }; + + const isHandheld = function () { + let check = false; + ( + function (a) { + if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) { + check = true; + } + } + )(navigator.userAgent || navigator.vendor || window.opera); + return check; + }; + + const isValidSelector = function (selector) { + if (selector.match(/^([.#])(.+)/)) { + return true; + } + + return false; + }; + + const copyToClipboard = function (text) { + if (window.clipboardData && window.clipboardData.setData) { + // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. + return window.clipboardData.setData("Text", text); + + } else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { + var textarea = document.createElement("textarea"); + textarea.textContent = text; + textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. + document.body.appendChild(textarea); + textarea.select(); + try { + return document.execCommand("copy"); // Security exception may be thrown by some browsers. + } catch (ex) { + console.warn("Copy to clipboard failed.", ex); + return prompt("Copy to clipboard: Ctrl+C, Enter", text); + } finally { + document.body.removeChild(textarea); + } + } + }; + + subwallet.Helpers = { + sendEventGa, + isEmptyObject, + isValidSelector, + isHandheld, + addUrlParam, + getUrlParamsAsObject, + getScrollbarWidth, + setBodyOverflow, + unsetBodyOverflow, + setBodyHandling, + setBodyCompleted, + setElementHandling, + unsetElementHandling, + getStyle, + setCookie, + getCookie, + copyToClipboard, + } + + }(window, jQuery) ); ( diff --git a/docs/assets/js/frontend.min.js b/docs/assets/js/frontend.min.js index efe2c2c..79fff1a 100644 --- a/docs/assets/js/frontend.min.js +++ b/docs/assets/js/frontend.min.js @@ -1 +1 @@ -!function(o,e){"use strict";o.subwallet=o.subwallet||{};subwallet.Helpers={isEmptyObject:e=>{for(const t in e)return!1;return!0},isValidSelector:function(e){return!!e.match(/^([.#])(.+)/)},isHandheld:function(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||o.opera,e=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))?!0:e},addUrlParam:function(e,t,o){t=encodeURI(t),o=encodeURI(o);var n=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e=e.replace(n,"$1"+t+"="+o+"$2"):e+=i+t+"="+o,e},getUrlParamsAsObject:function(e){var t={};if(-1!==e.indexOf("?")){e=e.substring(e.indexOf("?")+1);for(var o=/([^&=]+)=?([^&]*)/g,n=/\+/g,i=function(e){return decodeURIComponent(e.replace(n," "))};r=o.exec(e);){var a=i(r[1]),r=i(r[2]);"[]"===a.substring(a.length-2)?(t[a=a.substring(0,a.length-2)]||(t[a]=[])).push(r):t[a]=r}for(var l in t){var d=l.split("[");if(1o.getComputedStyle?t?document.defaultView.getComputedStyle(e,null).getPropertyValue(t):document.defaultView.getComputedStyle(e,null):e.currentStyle?t?e.currentStyle[t.replace(/-\w/g,e=>e.toUpperCase().replace("-",""))]:e.currentStyle:void 0,setCookie:function(e,t,o){var n=new Date,o=(n.setTime(n.getTime()+24*o*60*60*1e3),"expires="+n.toUTCString());document.cookie=e+"="+t+"; "+o+"; path=/"},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n{for(const t in e)return!1;return!0},isValidSelector:function(e){return!!e.match(/^([.#])(.+)/)},isHandheld:function(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||o.opera,e=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))?!0:e},addUrlParam:function(e,t,o){t=encodeURI(t),o=encodeURI(o);var n=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e=e.replace(n,"$1"+t+"="+o+"$2"):e+=i+t+"="+o,e},getUrlParamsAsObject:function(e){var t={};if(-1!==e.indexOf("?")){e=e.substring(e.indexOf("?")+1);for(var o=/([^&=]+)=?([^&]*)/g,n=/\+/g,i=function(e){return decodeURIComponent(e.replace(n," "))};r=o.exec(e);){var a=i(r[1]),r=i(r[2]);"[]"===a.substring(a.length-2)?(t[a=a.substring(0,a.length-2)]||(t[a]=[])).push(r):t[a]=r}for(var l in t){var d=l.split("[");if(1o.getComputedStyle?t?document.defaultView.getComputedStyle(e,null).getPropertyValue(t):document.defaultView.getComputedStyle(e,null):e.currentStyle?t?e.currentStyle[t.replace(/-\w/g,e=>e.toUpperCase().replace("-",""))]:e.currentStyle:void 0,setCookie:function(e,t,o){var n=new Date,o=(n.setTime(n.getTime()+24*o*60*60*1e3),"expires="+n.toUTCString());document.cookie=e+"="+t+"; "+o+"; path=/"},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n {\n\t\t\tfor ( const name in obj ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n\t\t/**\n\t\t * Add a URL parameter (or changing it if it already exists)\n\t\t * @param {string} url - This is typically document.location.search\n\t\t * @param {string} key - The key to set\n\t\t * @param {string} val - Value\n\t\t */\n\t\tvar addUrlParam = function( url, key, val ) {\n\t\t\tkey = encodeURI( key );\n\t\t\tval = encodeURI( val );\n\n\t\t\tvar re = new RegExp( \"([?&])\" + key + \"=.*?(&|$)\", \"i\" );\n\t\t\tvar separator = url.indexOf( '?' ) !== - 1 ? \"&\" : \"?\";\n\n\t\t\t// Update value if key exist.\n\t\t\tif ( url.match( re ) ) {\n\t\t\t\turl = url.replace( re, '$1' + key + \"=\" + val + '$2' );\n\t\t\t} else {\n\t\t\t\turl += separator + key + '=' + val;\n\t\t\t}\n\n\t\t\treturn url;\n\t\t};\n\n\t\tconst getUrlParamsAsObject = function( query ) {\n\t\t\tvar params = {};\n\n\t\t\tif ( - 1 === query.indexOf( '?' ) ) {\n\t\t\t\treturn params;\n\t\t\t}\n\n\t\t\tquery = query.substring( query.indexOf( '?' ) + 1 );\n\n\t\t\tvar re = /([^&=]+)=?([^&]*)/g;\n\t\t\tvar decodeRE = /\\+/g;\n\n\t\t\tvar decode = function( str ) {\n\t\t\t\treturn decodeURIComponent( str.replace( decodeRE, \" \" ) );\n\t\t\t};\n\n\t\t\tvar e;\n\t\t\twhile ( e = re.exec( query ) ) {\n\t\t\t\tvar k = decode( e[ 1 ] ), v = decode( e[ 2 ] );\n\t\t\t\tif ( k.substring( k.length - 2 ) === '[]' ) {\n\t\t\t\t\tk = k.substring( 0, k.length - 2 );\n\t\t\t\t\t(\n\t\t\t\t\t\tparams[ k ] || (\n\t\t\t\t\t\t\tparams[ k ] = []\n\t\t\t\t\t\t)\n\t\t\t\t\t).push( v );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tparams[ k ] = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar assign = function( obj, keyPath, value ) {\n\t\t\t\tvar lastKeyIndex = keyPath.length - 1;\n\t\t\t\tfor ( var i = 0; i < lastKeyIndex; ++ i ) {\n\t\t\t\t\tvar key = keyPath[ i ];\n\t\t\t\t\tif ( ! (\n\t\t\t\t\t\tkey in obj\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tobj[ key ] = {}\n\t\t\t\t\t}\n\t\t\t\t\tobj = obj[ key ];\n\t\t\t\t}\n\t\t\t\tobj[ keyPath[ lastKeyIndex ] ] = value;\n\t\t\t}\n\n\t\t\tfor ( var prop in params ) {\n\t\t\t\tvar structure = prop.split( '[' );\n\t\t\t\tif ( structure.length > 1 ) {\n\t\t\t\t\tvar levels = [];\n\t\t\t\t\tstructure.forEach( function( item, i ) {\n\t\t\t\t\t\tvar key = item.replace( /[?[\\]\\\\ ]/g, '' );\n\t\t\t\t\t\tlevels.push( key );\n\t\t\t\t\t} );\n\t\t\t\t\tassign( params, levels, params[ prop ] );\n\t\t\t\t\tdelete(\n\t\t\t\t\t\tparams[ prop ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn params;\n\t\t};\n\n\t\tconst getScrollbarWidth = function() {\n\t\t\t// Creating invisible container.\n\t\t\tconst outer = document.createElement( 'div' );\n\t\t\touter.style.visibility = 'hidden';\n\t\t\touter.style.overflow = 'scroll'; // forcing scrollbar to appear.\n\t\t\touter.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps.\n\t\t\tdocument.body.appendChild( outer );\n\n\t\t\t// Creating inner element and placing it in the container.\n\t\t\tconst inner = document.createElement( 'div' );\n\t\t\touter.appendChild( inner );\n\n\t\t\t// Calculating difference between container's full width and the child width.\n\t\t\tconst scrollbarWidth = (\n\t\t\t\touter.offsetWidth - inner.offsetWidth\n\t\t\t);\n\n\t\t\t// Removing temporary elements from the DOM.\n\t\t\touter.parentNode.removeChild( outer );\n\n\t\t\treturn scrollbarWidth;\n\n\t\t};\n\n\t\tconst setBodyOverflow = function() {\n\t\t\t$( 'body' ).css( {\n\t\t\t\t'overflow': 'hidden',\n\t\t\t\t'paddingRight': this.getScrollbarWidth() + 'px'\n\t\t\t} );\n\t\t};\n\n\t\tconst unsetBodyOverflow = function() {\n\t\t\t$( 'body' ).css( {\n\t\t\t\t'overflow': 'visible',\n\t\t\t\t'paddingRight': 0\n\t\t\t} );\n\t\t};\n\n\t\tconst setBodyHandling = function() {\n\t\t\t$( 'body' ).removeClass( 'completed' ).addClass( 'handling' );\n\t\t};\n\n\t\tconst setBodyCompleted = function() {\n\t\t\t$( 'body' ).removeClass( 'handling' ).addClass( 'completed' );\n\t\t};\n\n\t\tconst setElementHandling = function( $element ) {\n\t\t\t$element.addClass( 'updating-icon' );\n\t\t};\n\n\t\tconst unsetElementHandling = function( $element ) {\n\t\t\t$element.removeClass( 'updating-icon' );\n\t\t};\n\n\t\tconst getStyle = ( el, style ) => {\n\t\t\tif ( window.getComputedStyle ) {\n\t\t\t\treturn style ? document.defaultView.getComputedStyle( el, null ).getPropertyValue( style ) : document.defaultView.getComputedStyle( el, null );\n\t\t\t}\n\t\t\telse if ( el.currentStyle ) {\n\t\t\t\treturn style ? el.currentStyle[ style.replace( /-\\w/g, ( s ) => {\n\t\t\t\t\treturn s.toUpperCase().replace( '-', '' );\n\t\t\t\t} ) ] : el.currentStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst setCookie = function( cname, cvalue, exdays ) {\n\t\t\tvar d = new Date();\n\t\t\td.setTime( d.getTime() + (\n\t\t\t\texdays * 24 * 60 * 60 * 1000\n\t\t\t) );\n\t\t\tvar expires = 'expires=' + d.toUTCString();\n\t\t\tdocument.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/';\n\t\t};\n\n\t\tconst getCookie = function( cname ) {\n\t\t\tvar name = cname + '=';\n\t\t\tvar ca = document.cookie.split( ';' );\n\t\t\tfor ( var i = 0; i < ca.length; i ++ ) {\n\t\t\t\tvar c = ca[ i ];\n\t\t\t\twhile ( c.charAt( 0 ) == ' ' ) {\n\t\t\t\t\tc = c.substring( 1 );\n\t\t\t\t}\n\t\t\t\tif ( c.indexOf( name ) == 0 ) {\n\t\t\t\t\treturn c.substring( name.length, c.length );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn '';\n\t\t};\n\n\t\tconst isHandheld = function() {\n\t\t\tlet check = false;\n\t\t\t(\n\t\t\t\tfunction( a ) {\n\t\t\t\t\tif ( /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test( a.substr( 0, 4 ) ) ) {\n\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)( navigator.userAgent || navigator.vendor || window.opera );\n\t\t\treturn check;\n\t\t};\n\n\t\tconst isValidSelector = function( selector ) {\n\t\t\tif ( selector.match( /^([.#])(.+)/ ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tconst copyToClipboard = function( text ) {\n\t\t\tif ( window.clipboardData && window.clipboardData.setData ) {\n\t\t\t\t// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.\n\t\t\t\treturn window.clipboardData.setData( \"Text\", text );\n\n\t\t\t}\n\t\t\telse if ( document.queryCommandSupported && document.queryCommandSupported( \"copy\" ) ) {\n\t\t\t\tvar textarea = document.createElement( \"textarea\" );\n\t\t\t\ttextarea.textContent = text;\n\t\t\t\ttextarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in Microsoft Edge.\n\t\t\t\tdocument.body.appendChild( textarea );\n\t\t\t\ttextarea.select();\n\t\t\t\ttry {\n\t\t\t\t\treturn document.execCommand( \"copy\" ); // Security exception may be thrown by some browsers.\n\t\t\t\t}\n\t\t\t\tcatch ( ex ) {\n\t\t\t\t\tconsole.warn( \"Copy to clipboard failed.\", ex );\n\t\t\t\t\treturn prompt( \"Copy to clipboard: Ctrl+C, Enter\", text );\n\t\t\t\t}\n\t\t\t\tfinally {\n\t\t\t\t\tdocument.body.removeChild( textarea );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tsubwallet.Helpers = {\n\t\t\tisEmptyObject,\n\t\t\tisValidSelector,\n\t\t\tisHandheld,\n\t\t\taddUrlParam,\n\t\t\tgetUrlParamsAsObject,\n\t\t\tgetScrollbarWidth,\n\t\t\tsetBodyOverflow,\n\t\t\tunsetBodyOverflow,\n\t\t\tsetBodyHandling,\n\t\t\tsetBodyCompleted,\n\t\t\tsetElementHandling,\n\t\t\tunsetElementHandling,\n\t\t\tgetStyle,\n\t\t\tsetCookie,\n\t\t\tgetCookie,\n\t\t\tcopyToClipboard,\n\t\t}\n\n\t}( window, jQuery )\n);\n","(\n function ($) {\n 'use strict';\n\n var Helpers = subwallet.Helpers,\n $window = $(window),\n $header = $('#header');\n\n $window.on('scroll', function () {\n var currentST = $(this).scrollTop();\n\n if (currentST > 0) {\n $header.addClass('header-pinned');\n } else {\n $header.removeClass('header-pinned');\n }\n });\n\n $(document).ready(function () {\n scrollTo();\n //initVideoPopups();\n initSliders();\n initGrids();\n redirectLanguage();\n });\n\n function redirectLanguage() {\n var language = navigator.language || navigator.userLanguage;\n const params = window.location.search;\n if (params.indexOf('lang') > -1) {\n return;\n }\n let pathName = window.location.pathname;\n const languages = ['/zh/'];\n\t\t\tlet isChangeToLanguageDefault = false;\n for (const item of languages) {\n if (pathName.indexOf(item) > -1){\n pathName = pathName.replace(item, '');\n\t\t\t\t\tisChangeToLanguageDefault = true;\n }\n }\n const country = language.split('-')[0] ?? 'en';\n\n const LANGUAGE_SUPPORT_MAP = {\n 'zh': 'zh',\n 'en': 'en',\n }\n if (LANGUAGE_SUPPORT_MAP[country]) {\n let value = LANGUAGE_SUPPORT_MAP[country];\n if (pathName.indexOf(value) === -1) {\n if (isChangeToLanguageDefault && value === 'en'){\n\t\t\t\t\t\twindow.location.href = window.location.origin + '/' + pathName;\n\t\t\t\t\t}\n\t\t\t\t\tif (value !== 'en' && !isChangeToLanguageDefault){\n\t\t\t\t\t\twindow.location.href = window.location.origin + '/' + value + pathName;\n\t\t\t\t\t}\n }\n }\n }\n\n $(window).on('load', function () {\n initSectionEffectSnow();\n });\n\n if (typeof AOS !== 'undefined') {\n AOS.init({\n duration: 1000,\n delay: 200,\n once: true,\n });\n }\n var $switcher = $('.language-switcher');\n\n $switcher.on('click', '.current-lang', function (evt) {\n evt.preventDefault();\n\n $switcher.addClass('show');\n });\n\n $(document).on('click', function (e) {\n if ($(e.target).closest($switcher).length == 0) {\n $switcher.removeClass('show');\n }\n });\n\n function scrollTo() {\n $(document.body).on('click', '.scroll-to', function (evt) {\n evt.preventDefault();\n const target = $(this).attr('href');\n const offsetTop = $(target).offset().top;\n\n window.scroll({\n top: offsetTop - 30,\n left: 0,\n behavior: 'smooth'\n })\n })\n }\n\n function initVideoPopups() {\n if ($.fn.lightGallery) {\n var options = {\n selector: '.video-link',\n fullScreen: false,\n zoom: false,\n getCaptionFromTitleOrAlt: false,\n counter: false\n };\n\n $('.video-popup').each(function () {\n $(this).lightGallery(options);\n });\n }\n }\n\n function initSliders() {\n $('.tm-swiper').each(function () {\n $(this).subwalletSwiper();\n });\n }\n\n function initGrids() {\n if ($.fn.subwalletGridLayout()) {\n $('.block-grid').subwalletGridLayout();\n }\n }\n\n function initSectionEffectSnow() {\n if (!$.firefly) {\n return;\n }\n\n $('.section-effect-snow').each(function () {\n var $thisSection = $(this);\n\n var total = $thisSection.data('firefly-total') ? $thisSection.data('firefly-total') : 50;\n\n var minPixel = Helpers.isHandheld() ? 2 : 3;\n var maxPixel = Helpers.isHandheld() ? 3 : 4;\n\n var settings = {\n color: 'rgba(255,255,255,0.3)',\n minPixel: minPixel,\n maxPixel: maxPixel,\n total: total,\n on: $thisSection,\n zIndex: 0,\n };\n\n $.firefly(settings);\n });\n }\n\n }(jQuery)\n);\n"]} \ No newline at end of file +{"version":3,"sources":["helpers.js","frontend.js"],"names":["window","$","subwallet","Helpers","isEmptyObject","name","obj","isValidSelector","selector","match","isHandheld","let","check","a","navigator","userAgent","vendor","opera","test","substr","addUrlParam","url","key","val","encodeURI","re","RegExp","separator","indexOf","replace","getUrlParamsAsObject","query","params","substring","decodeRE","decode","str","decodeURIComponent","e","exec","k","v","length","push","prop","structure","split","levels","forEach","item","i","lastKeyIndex","keyPath","value","getScrollbarWidth","outer","document","createElement","inner","style","visibility","overflow","msOverflowStyle","body","appendChild","scrollbarWidth","offsetWidth","parentNode","removeChild","setBodyOverflow","css","paddingRight","this","unsetBodyOverflow","setBodyHandling","removeClass","addClass","setBodyCompleted","setElementHandling","$element","unsetElementHandling","getStyle","el","getComputedStyle","defaultView","getPropertyValue","currentStyle","s","toUpperCase","setCookie","cname","cvalue","exdays","d","Date","expires","setTime","getTime","toUTCString","cookie","getCookie","ca","c","charAt","copyToClipboard","text","clipboardData","setData","queryCommandSupported","textarea","textContent","position","select","execCommand","ex","console","warn","prompt","jQuery","$window","$header","on","scrollTop","ready","evt","preventDefault","target","attr","offsetTop","offset","top","scroll","left","behavior","each","subwalletSwiper","fn","subwalletGridLayout","language","userLanguage","location","search","pathName","pathname","isChangeToLanguageDefault","country","LANGUAGE_SUPPORT_MAP","zh","en","href","origin","firefly","$thisSection","total","data","minPixel","maxPixel","color","zIndex","AOS","init","duration","delay","once","$switcher","closest"],"mappings":"AAAA,CACA,SAAAA,EAAAC,GACA,aACAD,EAAAE,UAAAF,EAAAE,WAAA,GAsOAA,UAAAC,QAAA,CACAC,cArOA,I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AAA,EAEAuC,EAAAxF,SAAA,MAAA,CACA,CAAA,EAEA3E,EAAAuD,QAAA,EAAAiE,GAAA,QAAA,SAAAnF,GACA,GAAArC,EAAAqC,EAAAwF,MAAA,EAAAuC,QAAAD,CAAA,EAAA1H,QACA0H,EAAAzF,YAAA,MAAA,CAEA,CAAA,CAsEA,EAAA2C,MACA","file":"../frontend.min.js","sourcesContent":["(\n\tfunction( window, $ ) {\n\t\t'use strict';\n\t\twindow.subwallet = window.subwallet || {};\n\n\t\tconst isEmptyObject = ( obj ) => {\n\t\t\tfor ( const name in obj ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n\t\t/**\n\t\t * Add a URL parameter (or changing it if it already exists)\n\t\t * @param {string} url - This is typically document.location.search\n\t\t * @param {string} key - The key to set\n\t\t * @param {string} val - Value\n\t\t */\n\t\tvar addUrlParam = function( url, key, val ) {\n\t\t\tkey = encodeURI( key );\n\t\t\tval = encodeURI( val );\n\n\t\t\tvar re = new RegExp( \"([?&])\" + key + \"=.*?(&|$)\", \"i\" );\n\t\t\tvar separator = url.indexOf( '?' ) !== - 1 ? \"&\" : \"?\";\n\n\t\t\t// Update value if key exist.\n\t\t\tif ( url.match( re ) ) {\n\t\t\t\turl = url.replace( re, '$1' + key + \"=\" + val + '$2' );\n\t\t\t} else {\n\t\t\t\turl += separator + key + '=' + val;\n\t\t\t}\n\n\t\t\treturn url;\n\t\t};\n\n\t\tconst getUrlParamsAsObject = function( query ) {\n\t\t\tvar params = {};\n\n\t\t\tif ( - 1 === query.indexOf( '?' ) ) {\n\t\t\t\treturn params;\n\t\t\t}\n\n\t\t\tquery = query.substring( query.indexOf( '?' ) + 1 );\n\n\t\t\tvar re = /([^&=]+)=?([^&]*)/g;\n\t\t\tvar decodeRE = /\\+/g;\n\n\t\t\tvar decode = function( str ) {\n\t\t\t\treturn decodeURIComponent( str.replace( decodeRE, \" \" ) );\n\t\t\t};\n\n\t\t\tvar e;\n\t\t\twhile ( e = re.exec( query ) ) {\n\t\t\t\tvar k = decode( e[ 1 ] ), v = decode( e[ 2 ] );\n\t\t\t\tif ( k.substring( k.length - 2 ) === '[]' ) {\n\t\t\t\t\tk = k.substring( 0, k.length - 2 );\n\t\t\t\t\t(\n\t\t\t\t\t\tparams[ k ] || (\n\t\t\t\t\t\t\tparams[ k ] = []\n\t\t\t\t\t\t)\n\t\t\t\t\t).push( v );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tparams[ k ] = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar assign = function( obj, keyPath, value ) {\n\t\t\t\tvar lastKeyIndex = keyPath.length - 1;\n\t\t\t\tfor ( var i = 0; i < lastKeyIndex; ++ i ) {\n\t\t\t\t\tvar key = keyPath[ i ];\n\t\t\t\t\tif ( ! (\n\t\t\t\t\t\tkey in obj\n\t\t\t\t\t) ) {\n\t\t\t\t\t\tobj[ key ] = {}\n\t\t\t\t\t}\n\t\t\t\t\tobj = obj[ key ];\n\t\t\t\t}\n\t\t\t\tobj[ keyPath[ lastKeyIndex ] ] = value;\n\t\t\t}\n\n\t\t\tfor ( var prop in params ) {\n\t\t\t\tvar structure = prop.split( '[' );\n\t\t\t\tif ( structure.length > 1 ) {\n\t\t\t\t\tvar levels = [];\n\t\t\t\t\tstructure.forEach( function( item, i ) {\n\t\t\t\t\t\tvar key = item.replace( /[?[\\]\\\\ ]/g, '' );\n\t\t\t\t\t\tlevels.push( key );\n\t\t\t\t\t} );\n\t\t\t\t\tassign( params, levels, params[ prop ] );\n\t\t\t\t\tdelete(\n\t\t\t\t\t\tparams[ prop ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn params;\n\t\t};\n\n\t\tconst getScrollbarWidth = function() {\n\t\t\t// Creating invisible container.\n\t\t\tconst outer = document.createElement( 'div' );\n\t\t\touter.style.visibility = 'hidden';\n\t\t\touter.style.overflow = 'scroll'; // forcing scrollbar to appear.\n\t\t\touter.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps.\n\t\t\tdocument.body.appendChild( outer );\n\n\t\t\t// Creating inner element and placing it in the container.\n\t\t\tconst inner = document.createElement( 'div' );\n\t\t\touter.appendChild( inner );\n\n\t\t\t// Calculating difference between container's full width and the child width.\n\t\t\tconst scrollbarWidth = (\n\t\t\t\touter.offsetWidth - inner.offsetWidth\n\t\t\t);\n\n\t\t\t// Removing temporary elements from the DOM.\n\t\t\touter.parentNode.removeChild( outer );\n\n\t\t\treturn scrollbarWidth;\n\n\t\t};\n\n\t\tconst setBodyOverflow = function() {\n\t\t\t$( 'body' ).css( {\n\t\t\t\t'overflow': 'hidden',\n\t\t\t\t'paddingRight': this.getScrollbarWidth() + 'px'\n\t\t\t} );\n\t\t};\n\n\t\tconst unsetBodyOverflow = function() {\n\t\t\t$( 'body' ).css( {\n\t\t\t\t'overflow': 'visible',\n\t\t\t\t'paddingRight': 0\n\t\t\t} );\n\t\t};\n\n\t\tconst setBodyHandling = function() {\n\t\t\t$( 'body' ).removeClass( 'completed' ).addClass( 'handling' );\n\t\t};\n\n\t\tconst setBodyCompleted = function() {\n\t\t\t$( 'body' ).removeClass( 'handling' ).addClass( 'completed' );\n\t\t};\n\n\t\tconst setElementHandling = function( $element ) {\n\t\t\t$element.addClass( 'updating-icon' );\n\t\t};\n\n\t\tconst unsetElementHandling = function( $element ) {\n\t\t\t$element.removeClass( 'updating-icon' );\n\t\t};\n\n\t\tconst getStyle = ( el, style ) => {\n\t\t\tif ( window.getComputedStyle ) {\n\t\t\t\treturn style ? document.defaultView.getComputedStyle( el, null ).getPropertyValue( style ) : document.defaultView.getComputedStyle( el, null );\n\t\t\t}\n\t\t\telse if ( el.currentStyle ) {\n\t\t\t\treturn style ? el.currentStyle[ style.replace( /-\\w/g, ( s ) => {\n\t\t\t\t\treturn s.toUpperCase().replace( '-', '' );\n\t\t\t\t} ) ] : el.currentStyle;\n\t\t\t}\n\t\t};\n\n\t\tconst setCookie = function( cname, cvalue, exdays ) {\n\t\t\tvar d = new Date();\n\t\t\td.setTime( d.getTime() + (\n\t\t\t\texdays * 24 * 60 * 60 * 1000\n\t\t\t) );\n\t\t\tvar expires = 'expires=' + d.toUTCString();\n\t\t\tdocument.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/';\n\t\t};\n\n\t\tconst getCookie = function( cname ) {\n\t\t\tvar name = cname + '=';\n\t\t\tvar ca = document.cookie.split( ';' );\n\t\t\tfor ( var i = 0; i < ca.length; i ++ ) {\n\t\t\t\tvar c = ca[ i ];\n\t\t\t\twhile ( c.charAt( 0 ) == ' ' ) {\n\t\t\t\t\tc = c.substring( 1 );\n\t\t\t\t}\n\t\t\t\tif ( c.indexOf( name ) == 0 ) {\n\t\t\t\t\treturn c.substring( name.length, c.length );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn '';\n\t\t};\n\n\t\tconst isHandheld = function() {\n\t\t\tlet check = false;\n\t\t\t(\n\t\t\t\tfunction( a ) {\n\t\t\t\t\tif ( /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test( a ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test( a.substr( 0, 4 ) ) ) {\n\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)( navigator.userAgent || navigator.vendor || window.opera );\n\t\t\treturn check;\n\t\t};\n\n\t\tconst isValidSelector = function( selector ) {\n\t\t\tif ( selector.match( /^([.#])(.+)/ ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tconst copyToClipboard = function( text ) {\n\t\t\tif ( window.clipboardData && window.clipboardData.setData ) {\n\t\t\t\t// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.\n\t\t\t\treturn window.clipboardData.setData( \"Text\", text );\n\n\t\t\t}\n\t\t\telse if ( document.queryCommandSupported && document.queryCommandSupported( \"copy\" ) ) {\n\t\t\t\tvar textarea = document.createElement( \"textarea\" );\n\t\t\t\ttextarea.textContent = text;\n\t\t\t\ttextarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in Microsoft Edge.\n\t\t\t\tdocument.body.appendChild( textarea );\n\t\t\t\ttextarea.select();\n\t\t\t\ttry {\n\t\t\t\t\treturn document.execCommand( \"copy\" ); // Security exception may be thrown by some browsers.\n\t\t\t\t}\n\t\t\t\tcatch ( ex ) {\n\t\t\t\t\tconsole.warn( \"Copy to clipboard failed.\", ex );\n\t\t\t\t\treturn prompt( \"Copy to clipboard: Ctrl+C, Enter\", text );\n\t\t\t\t}\n\t\t\t\tfinally {\n\t\t\t\t\tdocument.body.removeChild( textarea );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tsubwallet.Helpers = {\n\t\t\tisEmptyObject,\n\t\t\tisValidSelector,\n\t\t\tisHandheld,\n\t\t\taddUrlParam,\n\t\t\tgetUrlParamsAsObject,\n\t\t\tgetScrollbarWidth,\n\t\t\tsetBodyOverflow,\n\t\t\tunsetBodyOverflow,\n\t\t\tsetBodyHandling,\n\t\t\tsetBodyCompleted,\n\t\t\tsetElementHandling,\n\t\t\tunsetElementHandling,\n\t\t\tgetStyle,\n\t\t\tsetCookie,\n\t\t\tgetCookie,\n\t\t\tcopyToClipboard,\n\t\t}\n\n\t}( window, jQuery )\n);\n","(\n function ($) {\n 'use strict';\n\n var Helpers = subwallet.Helpers,\n $window = $(window),\n $header = $('#header');\n\n $window.on('scroll', function () {\n var currentST = $(this).scrollTop();\n\n if (currentST > 0) {\n $header.addClass('header-pinned');\n } else {\n $header.removeClass('header-pinned');\n }\n });\n\n $(document).ready(function () {\n scrollTo();\n //initVideoPopups();\n initSliders();\n initGrids();\n redirectLanguage();\n });\n\n function redirectLanguage() {\n var language = navigator.language || navigator.userLanguage;\n const params = window.location.search;\n if (params.indexOf('lang') > -1) {\n return;\n }\n let pathName = window.location.pathname;\n const languages = ['/zh/'];\n\t\t\tlet isChangeToLanguageDefault = false;\n for (const item of languages) {\n if (pathName.indexOf(item) > -1){\n pathName = pathName.replace(item, '');\n\t\t\t\t\tisChangeToLanguageDefault = true;\n }\n }\n const country = language.split('-')[0] ?? 'en';\n\n const LANGUAGE_SUPPORT_MAP = {\n 'zh': 'zh',\n 'en': 'en',\n }\n if (LANGUAGE_SUPPORT_MAP[country]) {\n let value = LANGUAGE_SUPPORT_MAP[country];\n if (pathName.indexOf(value) === -1) {\n if (isChangeToLanguageDefault && value === 'en'){\n\t\t\t\t\t\twindow.location.href = window.location.origin + '/' + pathName;\n\t\t\t\t\t}\n\t\t\t\t\tif (value !== 'en' && !isChangeToLanguageDefault){\n\t\t\t\t\t\twindow.location.href = window.location.origin + '/' + value + pathName;\n\t\t\t\t\t}\n }\n }\n }\n\n $(window).on('load', function () {\n initSectionEffectSnow();\n });\n\n if (typeof AOS !== 'undefined') {\n AOS.init({\n duration: 1000,\n delay: 200,\n once: true,\n });\n }\n var $switcher = $('.language-switcher');\n\n $switcher.on('click', '.current-lang', function (evt) {\n evt.preventDefault();\n\n $switcher.addClass('show');\n });\n\n $(document).on('click', function (e) {\n if ($(e.target).closest($switcher).length == 0) {\n $switcher.removeClass('show');\n }\n });\n\n function scrollTo() {\n $(document.body).on('click', '.scroll-to', function (evt) {\n evt.preventDefault();\n const target = $(this).attr('href');\n const offsetTop = $(target).offset().top;\n\n window.scroll({\n top: offsetTop - 30,\n left: 0,\n behavior: 'smooth'\n })\n })\n }\n\n function initVideoPopups() {\n if ($.fn.lightGallery) {\n var options = {\n selector: '.video-link',\n fullScreen: false,\n zoom: false,\n getCaptionFromTitleOrAlt: false,\n counter: false\n };\n\n $('.video-popup').each(function () {\n $(this).lightGallery(options);\n });\n }\n }\n\n function initSliders() {\n $('.tm-swiper').each(function () {\n $(this).subwalletSwiper();\n });\n }\n\n function initGrids() {\n if ($.fn.subwalletGridLayout()) {\n $('.block-grid').subwalletGridLayout();\n }\n }\n\n function initSectionEffectSnow() {\n if (!$.firefly) {\n return;\n }\n\n $('.section-effect-snow').each(function () {\n var $thisSection = $(this);\n\n var total = $thisSection.data('firefly-total') ? $thisSection.data('firefly-total') : 50;\n\n var minPixel = Helpers.isHandheld() ? 2 : 3;\n var maxPixel = Helpers.isHandheld() ? 3 : 4;\n\n var settings = {\n color: 'rgba(255,255,255,0.3)',\n minPixel: minPixel,\n maxPixel: maxPixel,\n total: total,\n on: $thisSection,\n zIndex: 0,\n };\n\n $.firefly(settings);\n });\n }\n\n }(jQuery)\n);\n"]} diff --git a/docs/brandingkit.html b/docs/brandingkit.html index 526bd28..0622750 100644 --- a/docs/brandingkit.html +++ b/docs/brandingkit.html @@ -95,22 +95,24 @@