From 269687d8a0f3dc84d0bb659a7a1c7bfae2b66e70 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 25 Jul 2024 00:59:37 +0800 Subject: [PATCH] bugfix --- 3parties/fingerprintjs-4.0.min.js | 12 ++++++ bricks/build.sh | 3 +- bricks/line.js | 64 +++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 3parties/fingerprintjs-4.0.min.js create mode 100644 bricks/line.js diff --git a/3parties/fingerprintjs-4.0.min.js b/3parties/fingerprintjs-4.0.min.js new file mode 100644 index 0000000..4d3471d --- /dev/null +++ b/3parties/fingerprintjs-4.0.min.js @@ -0,0 +1,12 @@ +/** + * FingerprintJS v4.4.3 - Copyright (c) FingerprintJS, Inc, 2024 (https://fingerprint.com) + * + * Licensed under Business Source License 1.1 https://mariadb.com/bsl11/ + * Licensor: FingerprintJS, Inc. + * Licensed Work: FingerprintJS browser fingerprinting library + * Additional Use Grant: None + * Change Date: Four years from first release for the specific version. + * Change License: MIT, text at https://opensource.org/license/mit/ with the following copyright notice: + * Copyright 2015-present FingerprintJS, Inc. + */ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).FingerprintJS={})}(this,(function(e){"use strict";var n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=i+o?(i=c,[4,new Promise((function(e){var n=new MessageChannel;n.port1.onmessage=function(){return e()},n.port2.postMessage(null)}))]):[3,3]):[3,4];case 2:r.sent(),r.label=3;case 3:return++a,[3,1];case 4:return[2,t]}}))}))}function l(e){return e.then(void 0,(function(){})),e}function s(e){return parseInt(e)}function d(e){return parseFloat(e)}function f(e,n){return"number"==typeof e&&isNaN(e)?n:e}function m(e){return e.reduce((function(e,n){return e+(n?1:0)}),0)}function v(e,n){if(void 0===n&&(n=1),Math.abs(n)>=1)return Math.round(e/n)*n;var t=1/n;return Math.round(e*t)/t}function h(e,n){var t=e[0]>>>16,r=65535&e[0],o=e[1]>>>16,i=65535&e[1],a=n[0]>>>16,c=65535&n[0],u=n[1]>>>16,l=0,s=0,d=0,f=0;d+=(f+=i+(65535&n[1]))>>>16,f&=65535,s+=(d+=o+u)>>>16,d&=65535,l+=(s+=r+c)>>>16,s&=65535,l+=t+a,l&=65535,e[0]=l<<16|s,e[1]=d<<16|f}function p(e,n){var t=e[0]>>>16,r=65535&e[0],o=e[1]>>>16,i=65535&e[1],a=n[0]>>>16,c=65535&n[0],u=n[1]>>>16,l=65535&n[1],s=0,d=0,f=0,m=0;f+=(m+=i*l)>>>16,m&=65535,d+=(f+=o*l)>>>16,f&=65535,d+=(f+=i*u)>>>16,f&=65535,s+=(d+=r*l)>>>16,d&=65535,s+=(d+=o*u)>>>16,d&=65535,s+=(d+=i*c)>>>16,d&=65535,s+=t*l+r*u+o*c+i*a,s&=65535,e[0]=s<<16|d,e[1]=f<<16|m}function b(e,n){var t=e[0];32===(n%=64)?(e[0]=e[1],e[1]=t):n<32?(e[0]=t<>>32-n,e[1]=e[1]<>>32-n):(n-=32,e[0]=e[1]<>>32-n,e[1]=t<>>32-n)}function y(e,n){0!==(n%=64)&&(n<32?(e[0]=e[1]>>>32-n,e[1]=e[1]<>>1];g(e,n),p(e,w),n[1]=e[0]>>>1,g(e,n),p(e,L),n[1]=e[0]>>>1,g(e,n)}var V=[2277735313,289559509],S=[1291169091,658871167],W=[0,5],x=[0,1390208809],Z=[0,944331445];function M(e,n){var t=function(e){for(var n=new Uint8Array(e.length),t=0;t127)return(new TextEncoder).encode(e);n[t]=r}return n}(e);n=n||0;var r,o=[0,t.length],i=o[1]%16,a=o[1]-i,c=[0,n],u=[0,n],l=[0,0],s=[0,0];for(r=0;r>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)+("00000000"+(u[0]>>>0).toString(16)).slice(-8)+("00000000"+(u[1]>>>0).toString(16)).slice(-8)}function F(e){return"function"!=typeof e}function R(e,n,o,i){var a=Object.keys(e).filter((function(e){return!function(e,n){for(var t=0,r=e.length;t=4}function I(){var e=window,n=navigator;return m(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in n,"msSaveBlob"in n])>=3&&!G()}function Y(){var e=window,n=navigator;return m(["webkitPersistentStorage"in n,"webkitTemporaryStorage"in n,0===n.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function j(){var e=window,n=navigator;return m(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===n.vendor.indexOf("Apple"),"getStorageUpdates"in n,"WebKitMediaKeys"in e])>=4}function X(){var e=window,n=e.HTMLElement,t=e.Document;return m(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),n&&!("autocapitalize"in n.prototype),t&&"pointerLockElement"in t.prototype])>=4}function C(){var e,n=window;return e=n.print,!!/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))&&m(["[object WebPageNamespace]"===String(n.browser),"MicrodataExtractor"in n])>=1}function P(){var e,n,t=window;return m(["buildID"in navigator,"MozAppearance"in(null!==(n=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==n?n:{}),"onmozfullscreenchange"in t,"mozInnerScreenX"in t,"CSSMozDocumentRule"in t,"CanvasCaptureMediaStream"in t])>=4}function E(){var e=window,n=navigator,t=e.CSS,r=e.HTMLButtonElement;return m([!("getStorageUpdates"in n),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,t.supports("font-size-adjust: ex-height 0.5"),t.supports("text-transform: full-width")])>=4}function H(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function A(){var e=Y(),n=P(),t=window,r=navigator,o="connection";return e?m([!("SharedWorker"in t),r[o]&&"ontypechange"in r[o],!("sinkId"in new window.Audio)])>=2:!!n&&m(["onorientationchange"in t,"orientation"in t,/android/i.test(navigator.appVersion)])>=2}function N(){var e=window,n=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!n)return-2;if(j()&&!X()&&!function(){var e=window;return m(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var t=new n(1,5e3,44100),r=t.createOscillator();r.type="triangle",r.frequency.value=1e4;var o=t.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(t.destination),r.start(0);var i=function(e){var n=3,t=500,r=500,o=5e3,i=function(){};return[new Promise((function(c,u){var s=!1,d=0,f=0;e.oncomplete=function(e){return c(e.renderedBuffer)};var m=function(){setTimeout((function(){return u(J("timeout"))}),Math.min(r,f+o-Date.now()))},v=function(){try{var r=e.startRendering();switch(a(r)&&l(r),e.state){case"running":f=Date.now(),s&&m();break;case"suspended":document.hidden||d++,s&&d>=n?u(J("suspended")):setTimeout(v,t)}}catch(o){u(o)}};v(),i=function(){s||(s=!0,f>0&&m())}})),i]}(t),c=i[0],u=i[1],s=l(c.then((function(e){return function(e){for(var n=0,t=0;t.6*t.length}))).sort(),[2,i]}var c}))}))},fontPreferences:function(){return function(e,n){void 0===n&&(n=4e3);return T((function(t,r){var i=r.document,a=i.body,c=a.style;c.width="".concat(n,"px"),c.webkitTextSizeAdjust=c.textSizeAdjust="none",Y()?a.style.zoom="".concat(1/r.devicePixelRatio):j()&&(a.style.zoom="reset");var u=i.createElement("div");return u.textContent=o([],Array(n/20<<0),!0).map((function(){return"word"})).join(" "),a.appendChild(u),e(i,a)}),'')}((function(e,n){for(var t={},r={},o=0,i=Object.keys(fe);o=3||t.push(n.languages);else if("string"==typeof n.languages){var o=n.languages;o&&t.push(o.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return f(d(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(j()&&E()&&C()))return Q()},hardwareConcurrency:function(){return f(s(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,n=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(n){var t=(new n).resolvedOptions().timeZone;if(t)return t}var r,o=(r=(new Date).getFullYear(),-Math.max(d(new Date(r,0,1).getTimezoneOffset()),d(new Date(r,6,1).getTimezoneOffset())));return"UTC".concat(o>=0?"+":"").concat(o)},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!G()&&!I())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&j()&&!X()?function(){if("iPad"===navigator.platform)return!0;var e=screen,n=e.width/e.height;return m(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,n>.65&&n<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var n=[],t=0;t ../dist/bricks.js # uglifyjs --compress --mangle -- ../dist/bricks.js > ../dist/bricks.min.js diff --git a/bricks/line.js b/bricks/line.js new file mode 100644 index 0000000..0cd8edd --- /dev/null +++ b/bricks/line.js @@ -0,0 +1,64 @@ +var bricks = window.bricks || {}; + +bricks.ChartLine = class extend bricks.VBox { + constructor(opts){ + super(opts); + this.build_title_widget(); + this.build_description_widget(); + this.build_toolbar_widget(); + this.nameField = opts.nameField || 'name'; + this.valueField = opts.valueField || 'value'; + this.chart = new bricks.Filler(); + this.add_widget(this.chart); + schedule_once(this.build_chart, 0.1); + } + async build_chart(){ + if (this.user_data){ + this.build_line(this.user_data); + } else if (this.data_url){ + await this.build_line_using_url(); + } + } + build_line(data){ + var n_data = []; + var v_data = []; + data.forEach(d => { + n_data.push(d[this.nameField]); + v_data.push(d[this.valueField]); + }); + var e = this.chart.dom_element; + this.chartOBj = echarts.init(e); + var opts = { + xAxis:{ + type:'category', + data: n_value + }, + yAxis:{ + type: 'value' + }, + series:[ + { + data:v_data, + type:'line' + } + ] + } + this.chartObj.setOption(opts); + } + async build_line_using_url(params){ + if (!params) params = {}; + var _params = bricks.extend({}, this.data_params); + _params = bricks.extend(_params, params); + var method = this.method || 'GET'; + var jc = bricks.HttpJson(); + d = jc.httpcall(this.data_url, { + method:method, + params:_params + }); + if (d){ + await this.build_line(d); + } + } +} + +bricks.Factory.register('ChartLine', bricks.ChartLine);