@litejs/ui 24.5.0 → 24.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/css/base.css +0 -1
- package/css/grid.css +13 -0
- package/css/spacing-4.css +22 -22
- package/el/Pie.tpl +1 -1
- package/el/Slider.tpl +1 -1
- package/el/crop.ui +4 -3
- package/el/dialog.ui +14 -31
- package/el/material.tpl +6 -5
- package/load.js +19 -23
- package/package.json +4 -4
- package/{shim/index.js → shim.js} +31 -30
- package/{index.js → ui.js} +694 -456
- package/binding/sticky.js +0 -15
- package/binding/topfloat.js +0 -36
package/README.md
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
|
|
2
|
-
[3]: https://
|
|
2
|
+
[3]: https://packagephobia.now.sh/badge?p=@litejs/ui
|
|
3
3
|
[4]: https://packagephobia.now.sh/result?p=@litejs/ui
|
|
4
4
|
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
|
|
5
5
|
[6]: https://www.buymeacoffee.com/lauriro
|
|
6
|
-
[wiki]: https://github.com/litejs/ui/wiki
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
LiteJS UI – [![Size][3]][4] [![Buy Me A Tea][5]][6]
|
|
10
9
|
=========
|
|
11
10
|
|
|
12
|
-
LiteJS UI is an old-school framework for
|
|
11
|
+
LiteJS UI is an old-school framework for high-quality web UIs,
|
|
12
|
+
used on heavy-traffic websites since 2006.
|
|
13
13
|
|
|
14
|
-
- Dependency-free, weighs around
|
|
14
|
+
- Dependency-free, weighs around 25kB (+8kB polyfills for old browsers).
|
|
15
15
|
- Written in ES5, compatible with all browsers (including IE5.5).
|
|
16
|
-
- No transpiling/compiling/bundling headache,
|
|
16
|
+
- No transpiling/compiling/bundling headache, just write a working code.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
For usage instructions, see [Quick-Start](https://github.com/litejs/litejs/wiki/Quick-Start) guide
|
|
19
|
+
and [wiki](https://github.com/litejs/ui/wiki).
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## Contributing
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Follow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),
|
|
25
|
+
run tests `npm install; npm test`.
|
|
26
|
+
|
|
27
|
+
> Copyright (c) 2006-2024 Lauri Rooden <lauri@rooden.ee>
|
|
24
28
|
[MIT License](https://litejs.com/MIT-LICENSE.txt) |
|
|
25
29
|
[GitHub repo](https://github.com/litejs/ui) |
|
|
26
30
|
[npm package](https://npmjs.org/package/@litejs/ui) |
|
package/css/base.css
CHANGED
package/css/grid.css
CHANGED
|
@@ -54,6 +54,19 @@ Expects box-sizing: border-box;
|
|
|
54
54
|
.h1 , .md .md-h1 , .lg .md-h1 , .lg .lg-h1 { height: 8.3333%; }
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
.l12, .md .md-l12, .lg .md-l12, .lg .lg-l12 { left: 100%; }
|
|
58
|
+
.l11, .md .md-l11, .lg .md-l11, .lg .lg-l11 { left: 91.6667%; }
|
|
59
|
+
.l10, .md .md-l10, .lg .md-l10, .lg .lg-l10 { left: 83.3333%; }
|
|
60
|
+
.l9, .md .md-l9, .lg .md-l9, .lg .lg-l9 { left: 75%; }
|
|
61
|
+
.l8, .md .md-l8, .lg .md-l8, .lg .lg-l8 { left: 66.6667%; }
|
|
62
|
+
.l7, .md .md-l7, .lg .md-l7, .lg .lg-l7 { left: 58.3333%; }
|
|
63
|
+
.l6, .md .md-l6, .lg .md-l6, .lg .lg-l6 { left: 50%; }
|
|
64
|
+
.l5, .md .md-l5, .lg .md-l5, .lg .lg-l5 { left: 41.6667%; }
|
|
65
|
+
.l4, .md .md-l4, .lg .md-l4, .lg .lg-l4 { left: 33.3333%; }
|
|
66
|
+
.l3, .md .md-l3, .lg .md-l3, .lg .lg-l3 { left: 25%; }
|
|
67
|
+
.l2, .md .md-l2, .lg .md-l2, .lg .lg-l2 { left: 16.6667%; }
|
|
68
|
+
.l1, .md .md-l1, .lg .md-l1, .lg .lg-l1 { left: 8.3333%; }
|
|
69
|
+
|
|
57
70
|
/*
|
|
58
71
|
.col:first-child:nth-last-child(2), .col:first-child:nth-last-child(2) ~ .col {
|
|
59
72
|
width: 50%;
|
package/css/spacing-4.css
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
|
|
2
|
-
.p0,
|
|
3
|
-
.
|
|
4
|
-
.
|
|
5
|
-
.
|
|
6
|
-
.
|
|
2
|
+
.p0, .p01, .p02, .p03, .p04 { padding-top: 0; padding-bottom: 0; }
|
|
3
|
+
.p10, .p1, .p12, .p13, .p14 { padding-top: 4px; padding-bottom: 4px; }
|
|
4
|
+
.p20, .p21, .p2, .p23, .p24 { padding-top: 8px; padding-bottom: 8px; }
|
|
5
|
+
.p30, .p31, .p32, .p3, .p34 { padding-top: 12px; padding-bottom: 12px; }
|
|
6
|
+
.p40, .p41, .p42, .p43, .p4 { padding-top: 16px; padding-bottom: 16px; }
|
|
7
7
|
|
|
8
|
-
.p0,
|
|
9
|
-
.
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
8
|
+
.p0, .p10, .p20, .p30, .p40 { padding-left: 0; padding-right: 0; }
|
|
9
|
+
.p01, .p1, .p21, .p31, .p41 { padding-left: 4px; padding-right: 4px; }
|
|
10
|
+
.p02, .p12, .p2, .p32, .p42 { padding-left: 8px; padding-right: 8px; }
|
|
11
|
+
.p03, .p13, .p23, .p3, .p43 { padding-left: 12px; padding-right: 12px; }
|
|
12
|
+
.p04, .p14, .p24, .p34, .p4 { padding-left: 16px; padding-right: 16px; }
|
|
13
13
|
|
|
14
|
-
.m0,
|
|
15
|
-
.
|
|
16
|
-
.
|
|
17
|
-
.
|
|
18
|
-
.
|
|
14
|
+
.m0, .m01, .m02, .m03, .m04 { margin-top: 0; margin-bottom: 0; }
|
|
15
|
+
.m10, .m1, .m12, .m13, .m14 { margin-top: 4px; margin-bottom: 4px; }
|
|
16
|
+
.m20, .m21, .m2, .m23, .m24 { margin-top: 8px; margin-bottom: 8px; }
|
|
17
|
+
.m30, .m31, .m32, .m3, .m34 { margin-top: 12px; margin-bottom: 12px; }
|
|
18
|
+
.m40, .m41, .m42, .m43, .m4 { margin-top: 16px; margin-bottom: 16px; }
|
|
19
19
|
|
|
20
|
-
.m0,
|
|
21
|
-
.
|
|
22
|
-
.
|
|
23
|
-
.
|
|
24
|
-
.
|
|
20
|
+
.m0, .m10, .m20, .m30, .m40 { margin-left: 0; margin-right: 0; }
|
|
21
|
+
.m01, .m1, .m21, .m31, .m41 { margin-left: 4px; margin-right: 4px; }
|
|
22
|
+
.m02, .m12, .m2, .m32, .m42 { margin-left: 8px; margin-right: 8px; }
|
|
23
|
+
.m03, .m13, .m23, .m3, .m43 { margin-left: 12px; margin-right: 12px; }
|
|
24
|
+
.m04, .m14, .m24, .m34, .m4 { margin-left: 16px; margin-right: 16px; }
|
|
25
25
|
|
|
26
26
|
.grid.p1, .grid.p1 > .row > .col, .grid.p1 > .col { padding: 2px; }
|
|
27
27
|
.grid.p2, .grid.p2 > .row > .col, .grid.p2 > .col { padding: 4px; }
|
|
28
28
|
.grid.p3, .grid.p3 > .row > .col, .grid.p3 > .col { padding: 6px; }
|
|
29
29
|
.grid.p4, .grid.p4 > .row > .col, .grid.p4 > .col { padding: 8px; }
|
|
30
|
-
.grid
|
|
30
|
+
.grid > .grid { padding: 0; }
|
|
31
31
|
|
|
32
32
|
.grid.b1, .grid.b1 > .row > .col, .grid.b1 > .col { border: 2px solid transparent; }
|
|
33
33
|
.grid.b2, .grid.b2 > .row > .col, .grid.b2 > .col { border: 4px solid transparent; }
|
|
34
34
|
.grid.b3, .grid.b3 > .row > .col, .grid.b3 > .col { border: 6px solid transparent; }
|
|
35
35
|
.grid.b4, .grid.b4 > .row > .col, .grid.b4 > .col { border: 8px solid transparent; }
|
|
36
|
-
.grid
|
|
36
|
+
.grid > .grid { border: none; }
|
|
37
37
|
|
package/el/Pie.tpl
CHANGED
package/el/Slider.tpl
CHANGED
package/el/crop.ui
CHANGED
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
|
|
27
27
|
%el Crop
|
|
28
28
|
.Crop
|
|
29
|
-
@pan function(e){
|
|
29
|
+
@pan function(e, touchEv, touchEl) {
|
|
30
|
+
El.css(touchEl, "top,left", [touchEv.topPos + "px", touchEv.leftPos + "px"],"img")
|
|
31
|
+
return El.stop(e)
|
|
32
|
+
}
|
|
30
33
|
@pinch function(zoom){
|
|
31
34
|
var imgWidth = $el.offsetWidth
|
|
32
35
|
scale(0,0)
|
|
33
|
-
El.on($el, "wheel", scale)
|
|
34
36
|
return scale
|
|
35
37
|
function scale(e, delta) {
|
|
36
|
-
console.log("pinch", arguments)
|
|
37
38
|
zoom += delta / 5
|
|
38
39
|
if (zoom < .5) zoom = .5
|
|
39
40
|
else if (zoom > 50) zoom = 50
|
package/el/dialog.ui
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
var sound, vibrate
|
|
69
69
|
, code = ""
|
|
70
|
-
, el = El("
|
|
70
|
+
, el = El("Dialog")
|
|
71
71
|
, scope = Object.assign(El.scope(el, el), opts)
|
|
72
72
|
, kbMap = {}
|
|
73
73
|
, body = document.body
|
|
@@ -81,9 +81,10 @@
|
|
|
81
81
|
if (a.key) kbMap[a.key] = resolve.bind(el, el, a.action)
|
|
82
82
|
}
|
|
83
83
|
El.cls(blurEl, "Modal--blur")
|
|
84
|
-
El
|
|
85
|
-
El.append(
|
|
86
|
-
El.
|
|
84
|
+
var mm = El("Modal")
|
|
85
|
+
El.append(mm, el)
|
|
86
|
+
El.append(body, mm)
|
|
87
|
+
El.render(mm)
|
|
87
88
|
if (scope.code) {
|
|
88
89
|
$$(".js-numpad", el).on("click", numpad)
|
|
89
90
|
kbMap.backspace = kbMap.del = kbMap.num = numpad
|
|
@@ -92,8 +93,8 @@
|
|
|
92
93
|
$$(".js-btn", el).on("click", resolve)
|
|
93
94
|
$ui.one("show", resolve)
|
|
94
95
|
if (scope.bgClose) El.on(el, "click", resolve)
|
|
95
|
-
El.on(el, "wheel",
|
|
96
|
-
El.on(el.lastChild, "click",
|
|
96
|
+
El.on(el, "wheel", El.stop)
|
|
97
|
+
El.on(el.lastChild, "click", El.stop)
|
|
97
98
|
if (scope.vibrate && navigator.vibrate) {
|
|
98
99
|
vibrate = navigator.vibrate(scope.vibrate)
|
|
99
100
|
}
|
|
@@ -119,7 +120,7 @@
|
|
|
119
120
|
inputMd: El.val($(".js-inputMd", el)),
|
|
120
121
|
select: El.val($(".js-select", el))
|
|
121
122
|
}
|
|
122
|
-
El.kill(
|
|
123
|
+
El.kill(mm, "transparent")
|
|
123
124
|
El.cls(blurEl, "Modal--blur", el = false)
|
|
124
125
|
if (action && next) {
|
|
125
126
|
if (typeof next === "function") next(action, result)
|
|
@@ -147,7 +148,7 @@
|
|
|
147
148
|
})
|
|
148
149
|
|
|
149
150
|
%el Dialog
|
|
150
|
-
.Dialog.grid.p2.anim
|
|
151
|
+
.Dialog.grid.p2.anim
|
|
151
152
|
.col.ts3 ;txt!_(title, map)
|
|
152
153
|
.col.js-body ;md!_(body, map)
|
|
153
154
|
.col
|
|
@@ -160,27 +161,9 @@
|
|
|
160
161
|
;class!"is-" + action.action, action.action
|
|
161
162
|
|
|
162
163
|
%el Modal
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.col>input.field.js-input
|
|
169
|
-
.row
|
|
170
|
-
;if: $d.inputMd!=null
|
|
171
|
-
.col
|
|
172
|
-
textarea.field.js-inputMd
|
|
173
|
-
@keyup [this.parentNode.nextSibling.nextSibling], "renderMd"
|
|
174
|
-
;val: inputMd
|
|
175
|
-
.col.ts3 Preview
|
|
176
|
-
.p4
|
|
177
|
-
;md: inputMd
|
|
178
|
-
.row
|
|
179
|
-
;if: select
|
|
180
|
-
.col
|
|
181
|
-
select.field.js-select
|
|
182
|
-
;list: select, [""]
|
|
183
|
-
option
|
|
184
|
-
;val:: item.id
|
|
185
|
-
;txt:: _(item.name)
|
|
164
|
+
.Modal.max.fix.anim
|
|
165
|
+
.Modal-bg.max.abs
|
|
166
|
+
.Modal-content.Modal--blur.grid.p2.anim
|
|
167
|
+
;cls!"Modal--blur",!1,1
|
|
168
|
+
%slot
|
|
186
169
|
|
package/el/material.tpl
CHANGED
|
@@ -197,6 +197,7 @@
|
|
|
197
197
|
!function($ui) {
|
|
198
198
|
var menuTarget, menuEl, tipTarget, tipEl, tick, wait
|
|
199
199
|
, ripple = El(".waves-ripple")
|
|
200
|
+
, html = document.documentElement
|
|
200
201
|
El.near = near
|
|
201
202
|
function near(source, target, x, y, margin) {
|
|
202
203
|
var rect = target.getBoundingClientRect()
|
|
@@ -242,7 +243,7 @@
|
|
|
242
243
|
left: (left < 0 ? 0 : left) + "px"
|
|
243
244
|
})
|
|
244
245
|
}
|
|
245
|
-
El.on(
|
|
246
|
+
El.on(html, "mouseover", onOver)
|
|
246
247
|
El.on(window, "focusin", onOver)
|
|
247
248
|
$ui.on("show", closeTooltip)
|
|
248
249
|
function onOver(e) {
|
|
@@ -301,7 +302,7 @@
|
|
|
301
302
|
$ui.on("ping", closeMenu)
|
|
302
303
|
$ui.on("closeMenu", closeMenu)
|
|
303
304
|
$ui.on("showMenu", function(e, target, menu, x, y, margin) {
|
|
304
|
-
|
|
305
|
+
El.stop(e)
|
|
305
306
|
var close = menuEl && menuTarget == target
|
|
306
307
|
closeMenu()
|
|
307
308
|
if (close) return
|
|
@@ -322,8 +323,8 @@
|
|
|
322
323
|
})
|
|
323
324
|
}
|
|
324
325
|
})
|
|
325
|
-
El.on(
|
|
326
|
-
El.on(
|
|
326
|
+
El.on(html, "click", closeMenu)
|
|
327
|
+
El.on(html, "pointerdown", pointerdown)
|
|
327
328
|
function pointerdown(e) {
|
|
328
329
|
var target = e.target
|
|
329
330
|
if (!El.hasClass(target, "waves") || target.disabled) return
|
|
@@ -346,7 +347,7 @@
|
|
|
346
347
|
end()
|
|
347
348
|
wait = 1
|
|
348
349
|
tick = setTimeout(end, 800)
|
|
349
|
-
El.one(
|
|
350
|
+
El.one(html, "pointerup", end)
|
|
350
351
|
ripple.offsetTop // force repaint
|
|
351
352
|
El.cls(ripple, "waves-ripple--play")
|
|
352
353
|
}
|
package/load.js
CHANGED
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
!function(window, Function) {
|
|
22
|
-
xhr.
|
|
23
|
-
|
|
22
|
+
var initTime = xhr._t = +new Date()
|
|
23
|
+
, rewrite = {
|
|
24
24
|
//!{loadRewrite}
|
|
25
25
|
}
|
|
26
26
|
// Move setTimeout from window.prototype to window object for future patching in IE9.
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
, setTimeout_ = window.setTimeout = setTimeout
|
|
28
|
+
/*** debug ***/
|
|
29
|
+
// Expose xhr._c for testing.
|
|
29
30
|
, loaded = xhr._c = {}
|
|
30
31
|
/*/
|
|
31
32
|
, loaded = {}
|
|
@@ -48,44 +49,40 @@
|
|
|
48
49
|
/*/
|
|
49
50
|
eval
|
|
50
51
|
/**/
|
|
52
|
+
, nop = Function()
|
|
51
53
|
|
|
52
54
|
/*** reuse ***/
|
|
53
55
|
// XHR memory leak mitigation
|
|
54
56
|
, xhrs = []
|
|
55
57
|
/**/
|
|
56
58
|
|
|
59
|
+
, unsentLog = xhr._l = []
|
|
57
60
|
/*** onerror ***/
|
|
58
61
|
, lastError
|
|
59
|
-
, unsentErrors = xhr._e = []
|
|
60
62
|
, onerror = window.onerror = function(message, file, line, col, error) {
|
|
61
63
|
// Do not send multiple copies of the same error.
|
|
62
64
|
// file = document.currentScript.src || import.meta.url
|
|
63
65
|
if (lastError !== (lastError =
|
|
64
66
|
[ file
|
|
65
67
|
, line
|
|
66
|
-
, col || (window.event ||
|
|
68
|
+
, col || (window.event || unsentLog).errorCharacter || "?"
|
|
67
69
|
, message
|
|
68
70
|
].join(":")
|
|
69
|
-
) &&
|
|
70
|
-
[ +new Date()
|
|
71
|
-
, lastError
|
|
72
|
-
, error && (error.stack || error.stacktrace) || "-"
|
|
73
|
-
, "" + location
|
|
74
|
-
]
|
|
75
|
-
)) setTimeout_(sendErrors, 307)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function sendErrors() {
|
|
79
|
-
if (xhr.err) {
|
|
80
|
-
xhr.err(unsentErrors)
|
|
81
|
-
} else {
|
|
82
|
-
setTimeout_(sendErrors, 1307)
|
|
83
|
-
}
|
|
71
|
+
)) log("e", lastError, (error && (error.stack || error.stacktrace) || "-") + "\n" + location)
|
|
84
72
|
}
|
|
85
73
|
/*/
|
|
86
74
|
, onerror = nop
|
|
87
75
|
/**/
|
|
88
76
|
|
|
77
|
+
xhr.log = log
|
|
78
|
+
function log(type, msg, extra) {
|
|
79
|
+
if (unsentLog.push([ new Date() - initTime, type, msg, extra ]) < 2) sendLog()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function sendLog() {
|
|
83
|
+
setTimeout_(xhr.sendLog || sendLog, 1307)
|
|
84
|
+
}
|
|
85
|
+
|
|
89
86
|
// next === true is for sync call
|
|
90
87
|
|
|
91
88
|
window.xhr = xhr
|
|
@@ -205,7 +202,7 @@
|
|
|
205
202
|
files[pos] = 0
|
|
206
203
|
} else {
|
|
207
204
|
try {
|
|
208
|
-
var execResult = (xhr[files[pos].replace(/[^?]+\.|\?.*/g, "")] || execScript)(res[pos])
|
|
205
|
+
var execResult = (xhr[files[pos].replace(/[^?]+\.|\?.*/g, "")] || execScript)(res[pos], files[pos])
|
|
209
206
|
if (execResult && execResult.then) {
|
|
210
207
|
res[pos] = 0
|
|
211
208
|
return execResult.then(function() {
|
|
@@ -240,6 +237,5 @@
|
|
|
240
237
|
])
|
|
241
238
|
/**/
|
|
242
239
|
|
|
243
|
-
function nop() {}
|
|
244
240
|
}(this, Function) // jshint ignore:line
|
|
245
241
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litejs/ui",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.11.0",
|
|
4
4
|
"description": "UI engine for LiteJS full-stack framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Lauri Rooden <lauri@rooden.ee>",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"homepage": "https://litejs.com",
|
|
14
14
|
"repository": "github:litejs/ui",
|
|
15
15
|
"bugs": "https://github.com/litejs/dev/issues",
|
|
16
|
-
"main": "
|
|
16
|
+
"main": "ui.js",
|
|
17
17
|
"files": [
|
|
18
18
|
"*.js",
|
|
19
19
|
"binding",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "lj test test/index.js --tz='Europe/Tallinn' --brief --sources=load.js,require.js,index.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@litejs/cli": "24.
|
|
30
|
-
"@litejs/dom": "
|
|
29
|
+
"@litejs/cli": "24.10.0",
|
|
30
|
+
"@litejs/dom": "24.8.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -38,8 +38,6 @@
|
|
|
38
38
|
, navigator = patch("navigator")
|
|
39
39
|
/*/
|
|
40
40
|
, document = window.document
|
|
41
|
-
, location = window.location
|
|
42
|
-
, navigator = window.navigator
|
|
43
41
|
, IS_NODE = false
|
|
44
42
|
/**/
|
|
45
43
|
, html = document.documentElement
|
|
@@ -68,6 +66,7 @@
|
|
|
68
66
|
"DOMMouseScroll" // older Firefox
|
|
69
67
|
)
|
|
70
68
|
, fixEv = Event.fixEv = {
|
|
69
|
+
pagehide: "onpagehide" in window ? UNDEF : "beforeunload",
|
|
71
70
|
wheel: wheelEv
|
|
72
71
|
}
|
|
73
72
|
, fixFn = Event.fixFn = {
|
|
@@ -121,8 +120,7 @@
|
|
|
121
120
|
if (!IS_NODE && !(onhashchange in window) || ie67) {
|
|
122
121
|
patch(onhashchange, null)
|
|
123
122
|
setInterval(function() {
|
|
124
|
-
|
|
125
|
-
if (lastHash !== cur && isFn(window[onhashchange])) {
|
|
123
|
+
if (lastHash !== (lastHash = location.href.split("#")[1]) && isFn(window[onhashchange])) {
|
|
126
124
|
window[onhashchange]()
|
|
127
125
|
}
|
|
128
126
|
}, 60)
|
|
@@ -202,33 +200,33 @@
|
|
|
202
200
|
try {
|
|
203
201
|
// FF4-beta with dom.storage.enabled=false throws for accessing windows.localStorage
|
|
204
202
|
// iOS5 private browsing throws for localStorage.setItem()
|
|
205
|
-
|
|
203
|
+
window[name += "Storage"].setItem(name, name)
|
|
204
|
+
return window[name].removeItem(name)
|
|
206
205
|
} catch(e){}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
/**/
|
|
206
|
+
|
|
207
|
+
// # IE5 128KB per document
|
|
208
|
+
//
|
|
209
|
+
// The `saveHistory` behavior persists data only for the current session,
|
|
210
|
+
// using one in-memory UserData store for the entire document.
|
|
211
|
+
// If two elements write the same attribute, the first is overwritten.
|
|
212
|
+
//
|
|
213
|
+
// The `userData` behavior persists data across sessions,
|
|
214
|
+
// using one UserData store for each object, saved in the cache.
|
|
215
|
+
// Saved UserData can be reloaded even if the document has been closed and reopened.
|
|
216
|
+
//
|
|
217
|
+
// An ID is required for userData and saveSnapshot behaviors
|
|
218
|
+
// and recommended for saveHistory and saveFavorite behaviors.
|
|
219
|
+
//
|
|
220
|
+
// https://msdn.microsoft.com/en-us/library/ms531348(v=vs.85).aspx
|
|
221
|
+
// if (el.addBehavior) {
|
|
222
|
+
// el.style.behavior = surviveReboot ? "url('#default#userData')" : "url('#default#saveHistory')"
|
|
223
|
+
// el.addBehavior("#default#" + (surviveReboot ? "userData" : "saveHistory"))
|
|
224
|
+
// if (surviveReboot) el.load("persist")
|
|
225
|
+
// value = el.getAttribute(key)
|
|
226
|
+
// save = function() {
|
|
227
|
+
// el.setAttribute(key, El.val(el))
|
|
228
|
+
// if (surviveReboot) el.save("persist")
|
|
229
|
+
// }
|
|
232
230
|
var data = {
|
|
233
231
|
setItem: function(id, val) {
|
|
234
232
|
return (data[id] = "" + val)
|
|
@@ -252,6 +250,8 @@
|
|
|
252
250
|
// IE8 has console, however, the console object does not exist if the console is not opened.
|
|
253
251
|
patch("console", {log: nop, error: nop})
|
|
254
252
|
|
|
253
|
+
patch("getComputedStyle", "return a.currentStyle")
|
|
254
|
+
|
|
255
255
|
/*** ie9 ***/
|
|
256
256
|
patch("matchMedia", "b=a||'all';return{media:b,matches:X?X.matchMedium(b):!1,addListener:Y}", 0, window.styleMedia || window.media, nop)
|
|
257
257
|
/**/
|
|
@@ -377,6 +377,7 @@
|
|
|
377
377
|
|
|
378
378
|
b += "if(a.call(b,t[i],i,t))"
|
|
379
379
|
patch("filter", b + "o.push(t[i])" + c)
|
|
380
|
+
patch("find", b + "return t[i]")
|
|
380
381
|
patch("some", b + "return!0;return!1")
|
|
381
382
|
|
|
382
383
|
patch("flat", "return a<1?S.call(t):(b=t.concat.apply([],t))&&a>1&&b.some(X)?b.flat(a-1):b", 0, isArray)
|