Skip to content

Commit 2d278ba

Browse files
committed
regen
1 parent 181cf47 commit 2d278ba

10 files changed

Lines changed: 62 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Logs
22

3+
## v0.5.2
4+
5+
- fix bug: loader isn't shown when loading.
6+
- add `end` and `reset` selector for uploadr viewer widget
7+
8+
39
## v0.5.1
410

511
- tweak file list style

LICENSE

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2019, Kirby T. Wu
3+
Copyright (c) 2020-2025 zbryikt
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,15 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
22-
23-
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ You can also use them along with ldcvmgr:
152152
- `fetch` - force fetching new content.
153153
- `reset` - reset viewer content
154154
- `on(name, cb)` - listen to `name` event with `cb` callback. Following events are available:
155-
- `file:chosen`: when an item is chosen. `cb` called with `{url}` object as parameter.
155+
- `file:chosen`: when an item (or a list of items) is chosen.
156+
- `cb` called with an object (or a list of such object) with following fields:
157+
- `url`: file url
158+
- `size`: file size
159+
- `name`: file name
160+
- `lastModified`: file last modified time
156161
- `fetch:fetched`: when fetching new items. list of items passed as parameter.
157162
- `fetch:end`: when there is no new item available.
158163
- `fetch:empty`: when list is empty.
@@ -299,7 +304,9 @@ Here is for uploader:
299304
and here is for viewer:
300305

301306
- `file`: same with uploadr, along with the selector under `file`.
302-
- `load`: a DOM element triggering additional load when clicking.
307+
- `load`: a DOM element triggering additional load when clicking. Hidden when no more content to load.
308+
- `end`: a DOM element to show when there's no more content to load.
309+
- `reset`: a DOM element to trigger list reset. Also, only show when there's no more content to load.
303310
- `loader`: a `running` class will be added to element(s) with this name.
304311

305312

index.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,18 @@
100100
background: rgba(0,128,255,0.5);
101101
transition: width 0.15s ease-in-out;
102102
}
103-
.uploadr-load {
103+
.uploadr-load,
104+
.uploadr-end,
105+
.uploadr-reset {
104106
user-select: none;
105107
height: fit-content;
106108
width: 100%;
107109
max-width: 100%;
108110
margin: 0.5em 0;
109111
}
112+
.uploadr-end {
113+
cursor: default;
114+
}
110115
.uploadr-list-file {
111116
flex-direction: column;
112117
}
@@ -130,7 +135,9 @@
130135
.uploadr-list-file .uploadr-item-ctrl .uploadr-item-ctrl-info {
131136
width: 100%;
132137
}
133-
.uploadr-list-file .uploadr-load {
138+
.uploadr-list-file .uploadr-load,
139+
.uploadr-list-file .uploadr-end,
140+
.uploadr-list-file .uploadr-reset {
134141
margin: 0;
135142
justify-content: center;
136143
}

index.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
"Upload": "Upload",
4040
"Clear": "Clear",
4141
"Close": "Close",
42-
"Load More": "Load More"
42+
"Load More": "Load More",
43+
"End of List": "End of List",
44+
"Reload": "Reload"
4345
},
4446
"zh-TW": {
4547
"Drag & drop": "拖拉檔案",
@@ -51,7 +53,9 @@
5153
"Upload": "上傳",
5254
"Clear": "清除",
5355
"Close": "關閉",
54-
"Load More": "載入更多"
56+
"Load More": "載入更多",
57+
"End of List": "列表結尾",
58+
"Reload": "重新載入"
5559
}
5660
}
5761
};
@@ -404,6 +408,9 @@
404408
click: {
405409
load: function(){
406410
return this$.fetch();
411+
},
412+
reset: function(){
413+
return this$.reset();
407414
}
408415
}
409416
},
@@ -424,6 +431,16 @@
424431
node = arg$.node;
425432
return node.classList.toggle('d-none', !this$._.page.fetchable());
426433
},
434+
end: function(arg$){
435+
var node;
436+
node = arg$.node;
437+
return node.classList.toggle('d-none', !!this$._.page.fetchable());
438+
},
439+
reset: function(arg$){
440+
var node;
441+
node = arg$.node;
442+
return node.classList.toggle('d-none', !!this$._.page.fetchable());
443+
},
427444
file: {
428445
list: function(){
429446
return this$._.files || [];
@@ -555,9 +572,11 @@
555572
return this._.page.fetch();
556573
},
557574
reset: function(){
558-
this._.page.reset();
559-
this._.files = [];
560-
return this._.view.render();
575+
var this$ = this;
576+
return this._.page.reset().then(function(){
577+
this$._.files = [];
578+
return this$._.view.render();
579+
});
561580
},
562581
i18n: function(lng){
563582
var this$ = this;

index.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)