efront 3.33.2 → 3.34.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.
Files changed (58) hide show
  1. package/apps/kugou/icons/kugo.ico +0 -0
  2. package/apps/kugou/icons/kuwo.png +0 -0
  3. package/apps/kugou/index.html +1 -1
  4. package/apps/kugou/main.js +4 -0
  5. package/apps/kugou/search/search.html +3 -4
  6. package/apps/kugou/search/search.js +37 -5
  7. package/apps/kugou/search/search.less +3 -0
  8. package/coms/basic/cookie.js +17 -15
  9. package/coms/basic/cross_.js +31 -26
  10. package/coms/kugou/api.js +15 -1
  11. package/coms/kugou/buildList.html +1 -1
  12. package/coms/kugou/buildList.js +2 -2
  13. package/coms/kugou/buildScroll.js +1 -1
  14. package/coms/kugou/getSandbox.js +1 -1
  15. package/coms/kugou/krc.js +8 -4
  16. package/coms/kugou/musicList.js +37 -2
  17. package/coms/kugou/page.js +6 -6
  18. package/coms/kugou/playList.html +1 -1
  19. package/coms/kugou/playList.js +0 -1
  20. package/coms/kugou/playList.less +9 -2
  21. package/coms/kugou/player.js +42 -30
  22. package/coms/kugou/song.html +8 -3
  23. package/coms/kugou/song.js +26 -3
  24. package/coms/kugou/song.less +72 -16
  25. package/coms/reptile/colored_console.js +1 -1
  26. package/coms/reptile/cross.js +6 -2
  27. package/coms/zimoli/Canvas.js +7 -7
  28. package/coms/zimoli/anchor.js +2 -2
  29. package/coms/zimoli/anniu.js +6 -6
  30. package/coms/zimoli/button.js +9 -6
  31. package/coms/zimoli/cloneVisible.js +2 -3
  32. package/coms/zimoli/createElement.js +1 -1
  33. package/coms/zimoli/cross.js +12 -0
  34. package/coms/zimoli/data.js +1 -1
  35. package/coms/zimoli/dateslider.js +8 -8
  36. package/coms/zimoli/download.js +1 -1
  37. package/coms/zimoli/editor.js +2 -2
  38. package/coms/zimoli/gallery.js +2 -2
  39. package/coms/zimoli/gallery.less +1 -1
  40. package/coms/zimoli/getGenerator.js +1 -6
  41. package/coms/zimoli/group.js +2 -2
  42. package/coms/zimoli/hline.js +1 -1
  43. package/coms/zimoli/icon.js +3 -3
  44. package/coms/zimoli/input.js +2 -2
  45. package/coms/zimoli/label.js +3 -3
  46. package/coms/zimoli/list.js +17 -28
  47. package/coms/zimoli/mask.js +2 -2
  48. package/coms/zimoli/option.js +7 -7
  49. package/coms/zimoli/render.js +1 -0
  50. package/coms/zimoli/selectDate.js +2 -2
  51. package/coms/zimoli/space.js +1 -1
  52. package/coms/zimoli/swap.js +1 -1
  53. package/coms/zimoli/titlebar.js +4 -4
  54. package/coms/zimoli/vbox.js +1 -1
  55. package/coms/zimoli/video.js +1 -1
  56. package/coms/zimoli/zimoli.js +1 -1
  57. package/package.json +1 -1
  58. package/public/efront.js +1 -1
@@ -3,8 +3,27 @@ var playState = kugou$playState;
3
3
  var playModes = kugou$playModes;
4
4
  var playModeData = data.getInstance("play-mode");
5
5
  var playList = kugou$playList();
6
- var getMusicInfo = function (hash) {
7
- return data.from("song-info", { hash });
6
+ var patchMusicInfo = async function (info) {
7
+ var res = null;
8
+ switch (info.type) {
9
+ case "kuwo":
10
+ res = await data.from("play-url", info);
11
+ info.avatar = info.pic;
12
+ info.singerName = info.singername;
13
+ info.songName = info.songname;
14
+ break;
15
+ case "kugo":
16
+ default:
17
+ res = await data.from("song-info", info);
18
+ if (res.fail_process === 12) res.priced = true;
19
+ if (res.imgUrl) {
20
+ res.avatar = res.imgUrl.replace(/\{size\}/ig, 200);
21
+ }
22
+ break;
23
+ }
24
+ Object.assign(info, res);
25
+ if (info.avatar) info.avatarUrl = `url('${info.avatar}')`;
26
+ return info;
8
27
  };
9
28
  var getLrc = function () {
10
29
  return `https://m.kugou.com/app/i/krc.php?cmd=100&keyword=%E9%99%88%E6%98%9F%E3%80%81%E5%BC%A0%E7%BF%94%E8%BD%A9%20-%20%E5%86%B3%E4%B8%8D%E5%9B%9E%E5%A4%B4&hash=77AFF2715498A86AA28AC2DAA29C3FEB&timelength=280000&d=0.2984004589282503`;
@@ -18,7 +37,7 @@ on("keydown")(window, function (event) {
18
37
  var { target } = event;
19
38
  if (/^(input|select|textarea)$/i.test(target.tagName)) return;
20
39
  var $scope = player.$scope;
21
- if (!$scope.audio && !kugou$musicList.active_hash) return;
40
+ if (!$scope.audio && !kugou$musicList.getActived()) return;
22
41
  switch (event.keyCode || event.which) {
23
42
  case 32:
24
43
  if (event.repeat) break;
@@ -69,7 +88,6 @@ var filterTime = function (a, t) {
69
88
  }
70
89
  return res.map(fixTime).join(":");
71
90
  };
72
-
73
91
  var backer = document.createElement("back");
74
92
  onremove(backer, function () {
75
93
  $scope.page = false;
@@ -131,7 +149,8 @@ var $scope = {
131
149
  rootElements.unmount(backer);
132
150
  }
133
151
  },
134
- pause() {
152
+ pause(inc) {
153
+ if (inc !== false) ++this.playid;
135
154
  $scope.playing = false;
136
155
  let _audio = $scope.audio;
137
156
  ns.disable();
@@ -181,22 +200,22 @@ var $scope = {
181
200
  }
182
201
  },
183
202
  playid: 0,
184
- play(hash = musicList.active_hash) {
203
+ play(music = musicList.getActived()) {
204
+ var playid = ++this.playid;
185
205
  render.refresh();
186
- var isPlayback = typeof hash === "number";
206
+ var isPlayback = typeof music === "number";
187
207
  if (isPlayback) {
188
- if (hash < 0) {
189
- hash = hash + musicList.length;
208
+ if (music < 0) {
209
+ music = music + musicList.length;
190
210
  }
191
211
  if (!musicList.length) return;
192
- if (hash >= musicList.length) {
193
- hash = hash % musicList.length;
212
+ if (music >= musicList.length) {
213
+ music = music % musicList.length;
194
214
  }
195
- hash = musicList[hash];
196
- if (!hash) return;
197
- hash = hash.hash;
215
+ music = musicList[music];
216
+ if (!music) return;
198
217
  }
199
- if (hash === musicList.active_hash && $scope.audio) {
218
+ if (musicList.isActived(music) && $scope.audio) {
200
219
  if ($scope.playing) return $scope.pause();
201
220
  $scope.playing = true;
202
221
  let _audio = $scope.audio;
@@ -206,15 +225,13 @@ var $scope = {
206
225
  }
207
226
  return;
208
227
  }
209
- if (!isPlayback) for (var cx = musicList.length - 1; cx >= 0; cx--) {
210
- if (musicList[cx].hash === hash) musicList.splice(cx, 1);
211
- }
228
+ if (!isPlayback) musicList.remove(music);
212
229
 
213
- $scope.pause();
230
+ $scope.pause(false);
214
231
 
215
232
  /**
216
233
  * ios 只能由用户创建audio,所以请在用户触发的事件中调用play方法
217
- */
234
+ */
218
235
  $scope.playing = false;
219
236
  /**
220
237
  * @type {HTMLAudioElement}
@@ -245,17 +262,14 @@ var $scope = {
245
262
  _audio.autostart = true;
246
263
  return alert("暂不支持在您的浏览器中播放!");
247
264
  }
248
- musicList.active_hash = hash;
265
+ musicList.setActive(music);
249
266
  $scope.playing = true;
250
267
  playState.width = 0;
251
- getMusicInfo(hash).loading_promise.then((response) => {
268
+ patchMusicInfo(music).then((response) => {
269
+ if (playid !== this.playid) return;
252
270
  if (!this.playing) return;
253
- if (hash !== musicList.active_hash) return;
254
- if (response.imgUrl) {
255
- response.avatar = response.imgUrl.replace(/\{size\}/ig, 200);
256
- response.avatarUrl = `url('${response.avatar}')`;
257
- }
258
- var index = kugou$musicList.map(a => a.hash).indexOf(hash);
271
+ if (!musicList.isActived(music)) return;
272
+ var index = kugou$musicList.indexOf(music);
259
273
  var distlist = kugou$musicList.slice(0);
260
274
  distlist.forEach(function (info) {
261
275
  delete info.activate;
@@ -267,9 +281,7 @@ var $scope = {
267
281
  $scope.index = 0;
268
282
  distlist.unshift(response);
269
283
  }
270
- response.hash = hash;
271
284
  response.activate = true;
272
- distlist.active_hash = hash;
273
285
  extend($scope.info, response);
274
286
  cast($scope.krcpad, response);
275
287
  _audio.onerror = e => {
@@ -1,8 +1,13 @@
1
1
  <bg></bg>
2
2
  <png class="logo" ng-if="song.imgurl" ng-src=song.imgurl></png>
3
- <div class="singer" ng-if="song.singer" ng-model=song.singerMarked></div>
4
- <div class="song" ng-model=song.songMarked></div>
3
+ <div class="singer" ng-if="song.singer" ng-html=song.singerMarked></div>
4
+ <div class="song" style:="{whiteSpace:song.items?'normal':'nowrap'}">
5
+ <span ng-html=song.songMarked></span>
6
+ <span class="types" -if="song.items" refresh>
7
+ <i type_="s.type" ng-class="{actived:musicList.isActived(s)}" priced_="!!s.priced" @click="event.stopPropagation(),play(s)" -repeat="s in song.items"></i>
8
+ </span>
9
+ </div>
5
10
  <div class="filterTime(song.timeLength)"></div>
6
- <div refresh class="play-state" ng-if="song.hash===musicList.active_hash" ng-class={error:playState.error}>
11
+ <div refresh class="play-state" -if="isActived()" ng-class={error:playState.error}>
7
12
  <div ng-style="{width:playState.width}"></div>
8
13
  </div>
@@ -1,18 +1,33 @@
1
+ function dplay() {
2
+ this.firstChild.$scope.play();
3
+ }
1
4
  function main(elem) {
2
5
  elem = elem || document.createElement("song");
3
- elem.renderid = 9;
4
6
  var $scope = {
5
7
  filterTime,
6
8
  png: img,
7
9
  bg,
10
+ play(s) {
11
+ if (!s) s = this.song.items ? this.song.items[0] : this.song;
12
+ dispatch(elem, 'play', s);
13
+ },
14
+ isActived() {
15
+ if (this.song.items) {
16
+ for (var s of this.song.items) {
17
+ if (this.musicList.isActived(s)) return true;
18
+ }
19
+ return false;
20
+ }
21
+ return this.musicList.isActived(this.song);
22
+ },
8
23
  playState: kugou$playState,
9
24
  song: {},
10
25
  musicList: kugou$musicList,
11
26
  };
12
27
  care(elem, function (item) {
13
28
  if (!elem.innerHTML) elem.innerHTML = song;
14
- var songName = String(item.name || item.songName || item.songname_original || '');
15
- var singerName = String(item.singer || item.singerName || item.singername || '');
29
+ var songName = String(item.songname || item.song || item.songName || item.songname_original || item.name || '');
30
+ var singerName = String(item.singername || item.singer || item.singerName || '');
16
31
  if (~songName.indexOf(singerName)) {
17
32
  if (/\s*\-\s*/.test(songName)) {
18
33
  singerName = songName.replace(/^([\s\S]*?)\s*\-\s*[\s\S]*$/, '$1');
@@ -23,10 +38,18 @@ function main(elem) {
23
38
  hash: item.hash || item.hashid,
24
39
  imgurl: item.imgurl,
25
40
  singer: singerName,
41
+ items: item instanceof Array ? item : null,
26
42
  songMarked: mark(songName, elem.mark),
27
43
  singerMarked: mark(singerName, elem.mark)
28
44
  };
45
+ if ($scope.song.items) {
46
+ attr(elem, 'group', true);
47
+ }
48
+ else {
49
+ attr(elem, 'group', null);
50
+ }
29
51
  render(elem.children, $scope, 0);
30
52
  });
53
+ onclick(elem, dplay);
31
54
  return block(elem);
32
55
  }
@@ -1,7 +1,7 @@
1
1
  & {
2
- height: 52px;
2
+ height: auto;
3
3
  line-height: 40px;
4
- padding: 10px;
4
+ padding: 10px 10px 0 10px;
5
5
  font-size: 16px;
6
6
  white-space: nowrap;
7
7
  overflow: hidden;
@@ -23,7 +23,7 @@
23
23
  >.logo {
24
24
  height: 40px;
25
25
  width: 40px;
26
- margin: -6px -4px;
26
+ margin: -4px -2px;
27
27
 
28
28
  &+.singer+.song,
29
29
  &+.song {
@@ -39,16 +39,19 @@
39
39
  }
40
40
 
41
41
  }
42
- &.imgonly{
42
+
43
+ &.imgonly {
43
44
  padding: 0;
44
45
  line-height: 0;
45
46
  font-size: 0;
46
47
  padding-bottom: 76%;
47
48
  height: auto;
48
- >:not(png){
49
+
50
+ >:not(png) {
49
51
  display: none;
50
52
  }
51
- >.logo{
53
+
54
+ >.logo {
52
55
  position: absolute;
53
56
  height: 100%;
54
57
  width: 100%;
@@ -56,11 +59,62 @@
56
59
  }
57
60
  }
58
61
 
62
+ .types {
63
+ display: inline-block;
64
+ padding: 0 6px;
65
+ margin: 0 -6px;
66
+
67
+ >i {
68
+ display: inline-block;
69
+ width: 1em;
70
+ height: 1em;
71
+ background-size: contain;
72
+ background-repeat: no-repeat;
73
+ background-position: center;
74
+ margin-right: 6px;
75
+ z-index: 1;
76
+ cursor: pointer;
77
+ vertical-align: middle;
78
+ position: relative;
79
+ font-style: normal;
80
+
81
+ &[priced] {
82
+ filter: grayscale(.9);
83
+ }
84
+
85
+ &.actived {
86
+ outline-offset: 2px;
87
+ outline: 1px solid;
88
+ }
89
+
90
+ }
91
+
92
+ [type=kugo] {
93
+ background-image: url("icons/kugo.ico");
94
+ }
95
+
96
+ [type=kuwo] {
97
+ background-image: url("icons/kuwo.png");
98
+ }
99
+ }
100
+
101
+ &[group]>.song {
102
+ white-space: normal;
103
+ }
104
+
59
105
  >.song {
60
- line-height: 30px;
106
+ line-height: 28px;
107
+ padding-top: 2px;
108
+ padding-bottom: 12px;
61
109
  width: 100%;
62
- overflow: hidden;
63
- text-overflow: ellipsis;
110
+
111
+ >span {
112
+ margin-right: 6px;
113
+ vertical-align: top;
114
+ display: inline-block;
115
+ overflow: hidden;
116
+ text-overflow: ellipsis;
117
+ }
64
118
  }
65
119
 
66
120
  b {
@@ -72,8 +126,8 @@ b {
72
126
 
73
127
  >.singer {
74
128
  position: absolute;
75
- left: 6px;
76
- top: 4px;
129
+ left: 8px;
130
+ top: 6px;
77
131
  // right: 10px;
78
132
  text-align: center;
79
133
  line-height: 12px;
@@ -81,18 +135,20 @@ b {
81
135
  color: #fff9;
82
136
 
83
137
  &+.song {
84
- padding-top: 8px;
138
+ padding-top: 12px;
139
+ padding-bottom: 6px;
85
140
  }
86
141
  }
87
- png{
142
+
143
+ png {
88
144
  filter: brightness(.7) contrast(.9);
89
145
  }
90
146
 
91
147
  >.play-state {
92
148
  position: absolute;
93
- bottom: 2px;
94
- right: 4px;
95
- left: 4px;
149
+ bottom: 0;
150
+ right: 2px;
151
+ left: 2px;
96
152
  display: block;
97
153
  background: #2c7bb522;
98
154
  height: 2px;
@@ -188,7 +188,7 @@ var format = function (arg, deep = 0) {
188
188
  return `<cyan>[循环点 *${ci + 1}]</cyan>`;
189
189
  }
190
190
  if (arg instanceof Error) {
191
- if (deep === 1) return String(arg.message);
191
+ if (deep > 1) return String(arg.message);
192
192
  return String(arg.stack || arg.message);
193
193
  }
194
194
  if (arg instanceof Buffer || arg instanceof ArrayBuffer || arg instanceof SharedArrayBuffer) {
@@ -1,4 +1,4 @@
1
- return cross_.bind(function (callback, onerror) {
1
+ var cross = cross_.bind(function (callback, onerror) {
2
2
  var response, responseObject, responseType = "", decoder, error;
3
3
  var xhr = {
4
4
  status: 0,
@@ -115,4 +115,8 @@ return cross_.bind(function (callback, onerror) {
115
115
  },
116
116
  };
117
117
  return xhr;
118
- }, null, undefined);
118
+ }, null, undefined);
119
+ cross.hostCookie = function (xhr) {
120
+ if (xhr.cookie) return xhr.cookie;
121
+ return xhr.cookie = cookie.new();
122
+ };
@@ -1,18 +1,18 @@
1
- var b = createElement("div");
1
+ var b = document.createElement("div");
2
2
  css(b, "position:absolute;");
3
3
  css(b, {
4
4
  height: 1 + 'px',
5
5
  width: 1 + "px"
6
6
  });
7
7
  var Canvas = function (width, height) {
8
- var canvas = createElement(div);
8
+ var canvas = document.createElement("div");
9
9
  css(canvas, `width:${width * renderPixelRatio}pt;height:${height * renderPixelRatio}pt;position:relative;overflow:hidden;`);
10
- var _canvas = createElement(div);
10
+ var _canvas = document.createElement("div");
11
11
  css(_canvas, `top:50%;left:50%;margin:-${height / 2}px -${width / 2}px;height:${height}px;width:${width}px;position:absolute;overflow:hidden;-webkit-transform:scale(${renderPixelRatio / .75});`);
12
12
  var points = [], context = [];
13
13
  for (var cx = 0; cx < width; cx++) {
14
14
  for (var cy = 0; cy < height; cy++) {
15
- var point = createElement(b);
15
+ var point = b.cloneNode();
16
16
  var style = point.style;
17
17
 
18
18
  style.left = cx + "px";
@@ -26,8 +26,8 @@ var Canvas = function (width, height) {
26
26
  appendChild(canvas, _canvas);
27
27
  return canvas;
28
28
  };
29
- Canvas.prototype={
30
- getContext(){
31
-
29
+ Canvas.prototype = {
30
+ getContext() {
31
+
32
32
  }
33
33
  };
@@ -1,7 +1,7 @@
1
- var a = createElement("a");
1
+ var a = document.createElement("a");
2
2
  attr(a, 'href', "");
3
3
  function anchor(label, href) {
4
- var element = createElement(a);
4
+ var element = a.cloneNode();
5
5
  attr(element, "href", label);
6
6
  if (isString(label)) {
7
7
  text(element, label);
@@ -4,20 +4,20 @@
4
4
  */
5
5
 
6
6
  var userAgent = navigator.userAgent;
7
- var anu = createElement("input");
7
+ var anu = document.createElement("input");
8
8
  if (!/Safari/.test(userAgent) || /Edge/.test(userAgent)) {
9
9
  anu.type = "button";
10
10
  }
11
11
  css(anu, "position:absolute;left:0;right:0;top:0;bottom:0;width:100%;height:100%;cursor:default;box-sizing:border-box;border:none;ime-mode:disabled;");
12
- if("ontouchstart" in window){
13
- anu.disabled=true;
14
- if(/android\s+[1-2]\.|MicroMessenger/i.test(userAgent)){
15
- anu.style.display="none";
12
+ if ("ontouchstart" in window) {
13
+ anu.disabled = true;
14
+ if (/android\s+[1-2]\.|MicroMessenger/i.test(userAgent)) {
15
+ anu.style.display = "none";
16
16
  }
17
17
  }
18
18
  setOpacity(anu, 0);
19
19
 
20
20
  function anniu() {
21
- var anniu = createElement(anu);
21
+ var anniu = anu.cloneNode();
22
22
  return anniu;
23
23
  }
@@ -1,5 +1,5 @@
1
- var _label = createElement("span");
2
- var track = createElement(div);
1
+ var _label = document.createElement("span");
2
+ var track = document.createElement("div");
3
3
  var onmouseenter = on("mouseenter");
4
4
  track.className = "track";
5
5
  _label.className = "label";
@@ -73,7 +73,7 @@ var touchstart = function () {
73
73
  active.call(this);
74
74
  };
75
75
  function button(texter, type) {
76
- var tracker = createElement(track);
76
+ var tracker = track.cloneNode();
77
77
  var _texter;
78
78
  if (isNode(texter)) {
79
79
  _texter = texter;
@@ -81,7 +81,7 @@ function button(texter, type) {
81
81
  var button = _texter;
82
82
  if (button.childNodes.length) {
83
83
  if (button.childNodes.length === 1 && button.childNodes[0].nodeType !== 1) {
84
- _texter = createElement(_label);
84
+ _texter = _label.cloneNode();
85
85
  _texter.appendChild(button.childNodes[0]);
86
86
  button.appendChild(_texter);
87
87
  }
@@ -91,7 +91,7 @@ function button(texter, type) {
91
91
  }
92
92
  }
93
93
  } else {
94
- _texter = createElement(_label);
94
+ _texter = _label.cloneNode();
95
95
  if (isString(texter)) {
96
96
  if (!type) {
97
97
  texter = texter.replace(/#\w*/, function (w) {
@@ -105,7 +105,10 @@ function button(texter, type) {
105
105
  html(_texter, texter);
106
106
  }
107
107
  }
108
- button = button || createElement(btn, tracker, _texter);
108
+ if (!button) {
109
+ button = btn.cloneNode();
110
+ appendChild(button, tracker, texter);
111
+ }
109
112
  bindAccesskey(button);
110
113
  onremove(button, resetall);
111
114
  onmouseenter(button, hover);
@@ -1,5 +1,5 @@
1
- var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace".split(",");
2
- var cloneProperties2 = "position,backdropFilter,filter,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,textOverflow,wordBreak,webkitLineClamp,webkitBoxOrient,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");
1
+ var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace,lineHeight".split(",");// text-node
2
+ var cloneProperties2 = "position,backdropFilter,filter,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,textOverflow,wordBreak,webkitLineClamp,webkitBoxOrient,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");// element
3
3
  var pushProperty = function (key, props) {
4
4
  props.split(",").forEach(k => {
5
5
  cloneProperties2.push(key + k);
@@ -148,7 +148,6 @@ var cloneVisible = function (td) {
148
148
  var { left, top, width, height } = getScreenPosition(copy);
149
149
  var style = getComputedStyle(copy);
150
150
  copyStyle(style, copy.style, cloneProperties);
151
- copy.style.lineHeight = height + "px";
152
151
  parentNode.insertBefore(td, copy);
153
152
  parentNode.removeChild(copy);
154
153
  result.appendChild(copy);
@@ -55,7 +55,7 @@ var prototype = {
55
55
  return this;
56
56
  }
57
57
  }
58
-
58
+ console.error("createElement将会在未来的版本中移除!");
59
59
  function createElement(name) {
60
60
  var node = isNode(name) ? name.cloneNode() : isFunction(name) ? name() : document.createElement(name);
61
61
  if (name.className) addClass(node, name.className);
@@ -56,4 +56,16 @@ cross.setHost = function (host) {
56
56
  host = (/^https/.test(location_href) ? "https://" : "http://") + host;
57
57
  cross_.setHost(host);
58
58
  };
59
+ cross.hostCookie = function () {
60
+ return cookie;
61
+ };
62
+ cross.getCookies = function (dp) {
63
+ return cookie.getCookies(dp)
64
+ };
65
+ cross.addCookie = function (cookie_text, dp) {
66
+ return cookie.addCookie(cookie_text, dp);
67
+ };
68
+ cross.delCookies = function (dp) {
69
+ return cookie.delCookies(dp);
70
+ };
59
71
  if (cross_host) cross.setHost(cross_host);
@@ -484,7 +484,7 @@ var privates = {
484
484
  },
485
485
  repare(api, params) {
486
486
  var { required, autotrim, prepared } = api;
487
- if (!required.length && !prepared.length) return params;
487
+ if (!required.length && !prepared.length && !autotrim) return params;
488
488
  var params1 = {};
489
489
  required.forEach(k => {
490
490
  var v = seekResponse(params, required[k]);
@@ -1,23 +1,23 @@
1
- var _outterbox = createElement(div);
1
+ var _outterbox = document.createElement("div");
2
2
  css(_outterbox, "border-radius:2px;box-shadow:0 1px 24px -3px rgba(0,0,0,0.18);width:312px;height:210px;background-color:#fff;");
3
- var _slider = createElement(div);
3
+ var _slider = document.createElement("div");
4
4
  css(_slider, "float:left;width:33.3333%;");
5
- var _line = createElement(div);
5
+ var _line = document.createElement("div");
6
6
  css(_line, "height:46px;line-height:46px;text-align:center;");
7
- var _innerbox = createElement(div);
7
+ var _innerbox = document.createElement("div");
8
8
  css(_innerbox, "margin:0;");
9
9
  var lineHeight = "ontouchstart" in window ? 46 : 36;
10
10
  var createLine = function (startSlice, endSlice) {
11
11
  var result = [];
12
12
  for (var cx = startSlice, dx = endSlice; cx < dx; cx++) {
13
- var line = createElement(_line);
13
+ var line = _line.cloneNode();
14
14
  text(line, cx);
15
15
  result.push(line);
16
16
  }
17
17
  return result;
18
18
  }
19
19
  function createBox(from, to) {
20
- var slider = createElement(_slider);
20
+ var slider = _slider.cloneNode();
21
21
  slider.Height = function () {
22
22
  return Math.abs(from - to + 1) * lineHeight;
23
23
  };
@@ -49,13 +49,13 @@ function createBox(from, to) {
49
49
  }
50
50
  return top;
51
51
  }
52
- var item_box = createElement(_innerbox);
52
+ var item_box = _innerbox.cloneNode();
53
53
  appendChild(slider, item_box);
54
54
  vbox(slider);
55
55
  return slider;
56
56
  }
57
57
  function dateslider(from_date, to_date) {
58
- var outterbox = createElement(_outterbox);
58
+ var outterbox = _outterbox.cloneNode();
59
59
  var now = new Date;
60
60
  var currentYear = now.getFullYear();
61
61
  var currentMonth = now.getMonth() + 1;
@@ -1,5 +1,5 @@
1
1
  function download(dataurl, filename, mime = "text/plain") {
2
- var a = createElement("a");
2
+ var a = document.createElement("a");
3
3
  a.href = "data:" + mime + ";base64," + btoa(dataurl);
4
4
  a.target = '_blank';
5
5
  a.download = filename;
@@ -1,4 +1,4 @@
1
- var _editor = div();
1
+ var _editor = document.createElement("div");
2
2
  var template = `
3
3
  <div class=input></div>
4
4
  <textarea class=insert></textarea>
@@ -35,7 +35,7 @@ var getScrollTops = function (element) {
35
35
  }
36
36
 
37
37
  function editor() {
38
- var edit = createElement(_editor);
38
+ var edit = _editor.cloneNode();
39
39
  browserClass && addClass(edit, browserClass);
40
40
  var focusClass = "focus";
41
41
  edit.innerHTML = template;
@@ -102,8 +102,8 @@ function main() {
102
102
  [].forEach.call(arguments, function (arg) {
103
103
  if (isNode(arg)) {
104
104
  element = arg;
105
- } else if (isFinite(arg)) {
106
- minWidth = arg;
105
+ } else if (isFinite(arg) && arg > 0) {
106
+ minWidth = +arg;
107
107
  }
108
108
  });
109
109
  if ("$src" in element) {
@@ -4,7 +4,7 @@
4
4
  position: relative;
5
5
  height: 100%;
6
6
 
7
- >div {
7
+ >.list {
8
8
  vertical-align: top;
9
9
  display: inline-block;
10
10
  position: relative;