添加一些html相关dart

This commit is contained in:
shenjack 2024-03-04 22:52:37 +08:00
parent 0f4b32738d
commit fb848c6e77
Signed by: shenjack
GPG Key ID: 7B1134A979775551
3 changed files with 812 additions and 121 deletions

View File

@ -817,7 +817,7 @@
}
},
H = {
hN: function hN() { },
Js_Const: function hN() { },
jb(a) {
return new H.dn(a)
},
@ -935,7 +935,7 @@
},
lr(a) {
var s, r, q, p
if (a instanceof P.m) return H.U(H.Z(a), null)
if (a instanceof P.Object) return H.U(H.Z(a), null)
if (J.aA(a) === C.R || t.cC.b(a)) {
s = C.q(a)
r = s !== "Object" && s !== ""
@ -1516,24 +1516,24 @@
}
},
l1(a, b, c) {
var s, r, q, p, o, n = $.iL
var s, r, var_q, p, o, n = $.iL
if (n == null) n = $.iL = H.em("interceptor")
s = $.bC
if (s == null) s = $.bC = H.em("receiver")
r = b.length
q = c || r >= 28
if (q) return H.l0(r, c, a, b)
var_q = c || r >= 28
if (var_q) return H.l0(r, c, a, b)
if (r === 1) {
q = "return function(){return this." + n + "." + H.d(a) + "(this." + s + ");"
var_q = "return function(){return this." + n + "." + H.d(a) + "(this." + s + ");"
p = $.aa
$.aa = p + 1
return new Function(q + H.d(p) + "}")()
return new Function(var_q + H.d(p) + "}")()
}
o = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, r - 1).join(",")
q = "return function(" + o + "){return this." + n + "." + H.d(a) + "(this." + s + ", " + o + ");"
var_q = "return function(" + o + "){return this." + n + "." + H.d(a) + "(this." + s + ", " + o + ");"
p = $.aa
$.aa = p + 1
return new Function(q + H.d(p) + "}")()
return new Function(var_q + H.d(p) + "}")()
},
i6(a) {
return H.l2(a)
@ -2135,7 +2135,7 @@
},
Z(a) {
var s
if (a instanceof P.m) {
if (a instanceof P.Object) {
s = a.$ti
return s != null ? s : H.i3(a)
}
@ -2252,7 +2252,7 @@
var s, r = this
if (a == null) return H.hb(r)
s = r.r
if (a instanceof P.m) return !!a[s]
if (a instanceof P.Object) return !!a[s]
return !!J.aA(a)[s]
},
mF(a) {
@ -2261,7 +2261,7 @@
if (typeof a != "object") return !1
if (Array.isArray(a)) return !0
s = r.r
if (a instanceof P.m) return !!a[s]
if (a instanceof P.Object) return !!a[s]
return !!J.aA(a)[s]
},
p6(a) {
@ -2312,28 +2312,28 @@
return false;
throw H.b(H.Q(object, "bool"))
},
oR(a) {
as_bool_s(a) {
if (!0 === a) return !0
if (!1 === a) return !1
if (a == null) return a
throw H.b(H.Q(a, "bool"))
},
oQ(a) {
as_bool_q(a) {
if (!0 === a) return !0
if (!1 === a) return !1
if (a == null) return a
throw H.b(H.Q(a, "bool?"))
},
oS(a) {
as_double(a) {
if (typeof a == "number") return a
throw H.b(H.Q(a, "double"))
},
oU(a) {
as_double_s(a) {
if (typeof a == "number") return a
if (a == null) return a
throw H.b(H.Q(a, "double"))
},
oT(a) {
as_double_q(a) {
if (typeof a == "number") return a
if (a == null) return a
throw H.b(H.Q(a, "double?"))
@ -3334,7 +3334,7 @@
if (typeof a == "function") return J.ad.prototype
return a
}
if (a instanceof P.m) return a
if (a instanceof P.Object) return a
return J.hl(a)
},
t(a) {
@ -3345,7 +3345,7 @@
if (typeof a == "function") return J.ad.prototype
return a
}
if (a instanceof P.m) return a
if (a instanceof P.Object) return a
return J.hl(a)
},
al(a) {
@ -3355,26 +3355,26 @@
if (typeof a == "function") return J.ad.prototype
return a
}
if (a instanceof P.m) return a
if (a instanceof P.Object) return a
return J.hl(a)
},
nb(a) {
if (typeof a == "number") return J.aJ.prototype
if (a == null) return a
if (!(a instanceof P.m)) return J.av.prototype
if (!(a instanceof P.Object)) return J.av.prototype
return a
},
nc(a) {
if (typeof a == "number") return J.aJ.prototype
if (typeof a == "string") return J.ar.prototype
if (a == null) return a
if (!(a instanceof P.m)) return J.av.prototype
if (!(a instanceof P.Object)) return J.av.prototype
return a
},
a2(a) {
if (typeof a == "string") return J.ar.prototype
if (a == null) return a
if (!(a instanceof P.m)) return J.av.prototype
if (!(a instanceof P.Object)) return J.av.prototype
return a
},
aB(a) {
@ -3383,7 +3383,7 @@
if (typeof a == "function") return J.ad.prototype
return a
}
if (a instanceof P.m) return a
if (a instanceof P.Object) return a
return J.hl(a)
},
eb(a, b) {
@ -3502,7 +3502,7 @@
ef(a) {
return J.a2(a).dF(a)
},
I: function I() { },
Interceptor: function I() { },
cW: function cW() { },
bQ: function bQ() { },
as: function as() { },
@ -3515,7 +3515,7 @@
eE: function eE(a) {
this.$ti = a
},
bB: function bB(a, b) {
ArrayIterator: function ArrayIterator(a, b) {
var _ = this
_.a = a
_.b = b
@ -5095,7 +5095,7 @@
r: function r() { },
cV: function cV() { },
u: function u() { },
m: function m() { },
Object: function m() { },
dZ: function dZ() { },
bh: function bh(a) {
this.a = a
@ -5176,13 +5176,13 @@
}
return s
},
hZ(a) {
if (a == null || typeof a == "string" || typeof a == "number" || typeof a == "boolean") return a
else if (a instanceof Object && H.jR(a)) return a
else if (a instanceof Object && t.f.b(a)) return a
else if (a instanceof Date) return P.iR(a.getTime(), !1)
else if (a.constructor === $.iw()) return a.o
else return P.jJ(a)
hZ(object) {
if (object == null || typeof object == "string" || typeof object == "number" || typeof object == "boolean") return object
else if (object instanceof Object && H.jR(object)) return object
else if (object instanceof Object && t.f.b(object)) return object
else if (object instanceof Date) return P.iR(object.getTime(), !1)
else if (object.constructor === $.iw()) return object.o
else return P.jJ(object)
},
jJ(a) {
if (typeof a == "function") return P.i1(a, $.hB(), new P.hf())
@ -5664,8 +5664,8 @@
var w = [B, C, D, E, F, G, H, J, K, M, N, O, P, Q, S, T, V, W, X, Y]
hunkHelpers.setFunctionNamesIfNecessary(w)
var $ = {}
H.hN.prototype = {}
J.I.prototype = {
H.Js_Const.prototype = {}
J.Interceptor.prototype = {
a_(a, b) {
return a === b
},
@ -5816,7 +5816,7 @@
return this.al(a, !0)
},
gB(a) {
return new J.bB(a, a.length)
return new J.ArrayIterator(a, a.length)
},
gF(a) {
return H.di(a)
@ -5842,7 +5842,7 @@
$ii: 1
}
J.eE.prototype = {}
J.bB.prototype = {
J.ArrayIterator.prototype = {
gt() {
return this.d
},
@ -7876,7 +7876,7 @@
s = s.gB(s)
} else {
s = s.ag()
s = new J.bB(s, s.length)
s = new J.ArrayIterator(s, s.length)
}
return s
},
@ -8506,13 +8506,13 @@
P.cV.prototype = {}
P.u.prototype = {
gF(a) {
return P.m.prototype.gF.call(this, this)
return P.Object.prototype.gF.call(this, this)
},
j(a) {
return "null"
}
}
P.m.prototype = {
P.Object.prototype = {
$im: 1,
a_(a, b) {
return this === b
@ -10703,7 +10703,7 @@
}
Y.dm.prototype = {};
(function aliases() {
var s = J.I.prototype
var s = J.Interceptor.prototype
s.bN = s.j
s.bM = s.aq
s = J.as.prototype
@ -10712,7 +10712,7 @@
s.bS = s.bL
s = P.r.prototype
s.bO = s.as
s = P.m.prototype
s = P.Object.prototype
s.bT = s.j
s = W.o.prototype
s.at = s.U
@ -10763,9 +10763,9 @@
var s = hunkHelpers.mixin,
r = hunkHelpers.inherit,
q = hunkHelpers.inheritMany
r(P.m, null)
q(P.m, [H.hN, J.I, J.bB, P.n, P.cg, H.aG, P.r, H.a5, P.cV, H.bJ, H.dC, H.bi, P.bV, H.bD, H.eD, H.fc, H.eY, H.bI, H.cp, H.fM, P.bb, H.eI, H.d1, H.b8, H.ch, H.dH, H.dv, H.fT, H.a1, H.dP, H.e2, P.fY, P.dI, P.cE, P.dL, P.bs, P.v, P.dJ, P.c6, P.dt, P.du, P.dX, P.h5, P.cu, P.fL, P.dS, P.k, P.e4, P.c4, P.cK, P.fr, P.fq, P.h2, P.h1, P.b2, P.b3, P.df, P.c5, P.fw, P.ey, P.u, P.dZ, P.bh, W.ep, W.hL, W.bt, W.bM, W.c0, W.co, W.e0, W.bK, W.fs, W.fQ, W.e5, P.fU, P.fk, P.W, P.eX, P.fJ, O.b6, O.eA, O.cS, O.ei, O.ej, O.en, O.el, O.fb, O.f5, Y.ag, N.cP, N.f0, S.dd, G.cY, G.d3, G.cH, Q.dV, V.dk, V.eC, D.f2, D.f1, Y.dm])
q(J.I, [J.cW, J.bQ, J.as, J.p, J.aJ, J.ar, H.bX, H.A, W.cQ, W.aE, W.eo, W.dM, W.er, W.es, W.c, W.bL, W.d4, W.dT, W.dW, W.e6, P.bR])
r(P.Object, null)
q(P.Object, [H.Js_Const, J.Interceptor, J.ArrayIterator, P.n, P.cg, H.aG, P.r, H.a5, P.cV, H.bJ, H.dC, H.bi, P.bV, H.bD, H.eD, H.fc, H.eY, H.bI, H.cp, H.fM, P.bb, H.eI, H.d1, H.b8, H.ch, H.dH, H.dv, H.fT, H.a1, H.dP, H.e2, P.fY, P.dI, P.cE, P.dL, P.bs, P.v, P.dJ, P.c6, P.dt, P.du, P.dX, P.h5, P.cu, P.fL, P.dS, P.k, P.e4, P.c4, P.cK, P.fr, P.fq, P.h2, P.h1, P.b2, P.b3, P.df, P.c5, P.fw, P.ey, P.u, P.dZ, P.bh, W.ep, W.hL, W.bt, W.bM, W.c0, W.co, W.e0, W.bK, W.fs, W.fQ, W.e5, P.fU, P.fk, P.W, P.eX, P.fJ, O.b6, O.eA, O.cS, O.ei, O.ej, O.en, O.el, O.fb, O.f5, Y.ag, N.cP, N.f0, S.dd, G.cY, G.d3, G.cH, Q.dV, V.dk, V.eC, D.f2, D.f1, Y.dm])
q(J.Interceptor, [J.cW, J.bQ, J.as, J.p, J.aJ, J.ar, H.bX, H.A, W.cQ, W.aE, W.eo, W.dM, W.er, W.es, W.c, W.bL, W.d4, W.dT, W.dW, W.e6, P.bR])
q(J.as, [J.dh, J.av, J.ad])
r(J.eE, J.p)
q(J.aJ, [J.bP, J.cX])
@ -10973,7 +10973,7 @@
C.o = W.aF.prototype
C.d = W.b1.prototype
C.v = W.aH.prototype
C.R = J.I.prototype
C.R = J.Interceptor.prototype
C.c = J.p.prototype
C.a = J.bP.prototype
C.j = J.aJ.prototype
@ -11658,17 +11658,17 @@
v.dispatchPropertyName = v.getIsolateTag("dispatch_record")
}()
hunkHelpers.setOrUpdateInterceptorsByTag({
DOMError: J.I,
DOMImplementation: J.I,
MediaError: J.I,
Navigator: J.I,
NavigatorConcurrentHardware: J.I,
NavigatorUserMediaError: J.I,
OverconstrainedError: J.I,
PositionError: J.I,
GeolocationPositionError: J.I,
Range: J.I,
SQLError: J.I,
DOMError: J.Interceptor,
DOMImplementation: J.Interceptor,
MediaError: J.Interceptor,
Navigator: J.Interceptor,
NavigatorConcurrentHardware: J.Interceptor,
NavigatorUserMediaError: J.Interceptor,
OverconstrainedError: J.Interceptor,
PositionError: J.Interceptor,
GeolocationPositionError: J.Interceptor,
Range: J.Interceptor,
SQLError: J.Interceptor,
ArrayBuffer: H.bX,
DataView: H.A,
ArrayBufferView: H.A,
@ -12287,9 +12287,8 @@
for (var r = 0; r < s.length; ++r) s[r].addEventListener("load", onLoad, false)
})(function (a) {
v.currentScript = a
var s = E.main_program
if (typeof dartMainRunner === "function") dartMainRunner(s, [])
else s([])
var main_func = E.main_program
main_func()
})
})()
//# sourceMappingURL=index.dart.js.map

787
out.js

File diff suppressed because one or more lines are too long

View File

@ -3,20 +3,29 @@ import 'dart:js' as Js;
import 'dart:html';
void main() {
// Find an element by id (an-id).
Element idElement = querySelector('#an-id')!;
// Find an element by class (a-class).
Element classElement = querySelector('.a-class')!;
// Find all elements by tag (<div>).
List<Element> divElements = querySelectorAll('div');
print("Hello, World!");
var a = "Hello, World!";
for (var i = 0; i < 10; i++) {
a += " " + i.toString();
}
var b = 12242424242424;
int b = 124242424;
for (var i = 0; i < 10; i++) {
b += b*i;
b += b * i;
}
// js sleep
Future.delayed(Duration(milliseconds:1000)).then((value){
print("延时1秒执行 then ");
print(value);
});
Future.delayed(Duration(milliseconds: 1000)).then((value) {
print("延时1秒执行 then ");
print(value);
});
var closuer = () {
print("closuer");