Skip to content

Commit

Permalink
ZK-4969: dropupload supports accept file type
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsonChan committed Sep 11, 2023
1 parent 1d12dfb commit c885ded
Show file tree
Hide file tree
Showing 37 changed files with 174 additions and 92 deletions.
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ZK 10.0.0
ZK-5119: Integrate Font Awesome 6 free icons
ZK-5541: Move widget restriction check to Client MVVM
ZK-5354: Update animation implementation to avoid iframe reloading
ZK-4969: dropupload supports accept file type

* Bugs
ZK-5089: AfterSizeEvent doesn't return a correct size of a Window component
Expand Down
16 changes: 16 additions & 0 deletions zktest/src/main/webapp/test2/F100-ZK-4969.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
F100-ZK-4969.zul
Purpose:
Description:
History:
Thu Sep 07 18:24:03 CST 2023, Created by jamson
Copyright (C) 2023 Potix Corporation. All Rights Reserved.
-->
<zk>
<dropupload accept=".sh,.png"/>
</zk>
1 change: 1 addition & 0 deletions zktest/src/main/webapp/test2/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3781,6 +3781,7 @@ F86-ZK-4235.zul=A,E,datefmt,library-property
##manually##F100-ZK-5119-2.zul=A,E,FontAwesome6,fa6
##zats##F100-ZK-5354.zul=A,E,Iframe,Animation,reload
##zats##F100-ZK-5354-2.zul=A,E,Ckeditor,Animation,reload
##manually##F100-ZK-4969.zul=A,E,Dropupload,accept,type

# Complex Test Case
#
Expand Down
1 change: 1 addition & 0 deletions zul/src/main/java/org/zkoss/zul/impl/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public static final String outLocaleJavaScript() {
addLocaleJS(sb, "PDFVIEWER_TOGGLE_FULLSCREEN", MZul.PDFVIEWER_TOGGLE_FULLSCREEN);

addLocaleJS(sb, "UPLOAD_ERROR_EXCEED_MAXSIZE", MZul.UPLOAD_ERROR_EXCEED_MAXSIZE);
addLocaleJS(sb, "UPLOAD_ERROR_UNACCEPTED_FILE_TYPE", MZul.UPLOAD_ERROR_UNACCEPTED_FILE_TYPE);

addLocaleJS(sb, "COLORBOX_PALETTE_BUTTON_LABEL", MZul.COLORBOX_PALETTE_BUTTON_LABEL);
addLocaleJS(sb, "COLORBOX_PICKER_BUTTON_LABEL", MZul.COLORBOX_PICKER_BUTTON_LABEL);
Expand Down
1 change: 1 addition & 0 deletions zul/src/main/java/org/zkoss/zul/mesg/MZul.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public interface MZul extends org.zkoss.mesg.MessageConst {
static final int UPLOAD_SUBMIT = 0x2103 + MESSAGE_ID;
static final int UPLOAD_BROWSE = 0x2104 + MESSAGE_ID;
static final int UPLOAD_ERROR_EXCEED_MAXSIZE = 0x2105 + MESSAGE_ID;
static final int UPLOAD_ERROR_UNACCEPTED_FILE_TYPE = 0x2106 + MESSAGE_ID;
static final int OK = 0x2200 + MESSAGE_ID;
static final int CANCEL = 0x2201 + MESSAGE_ID;
static final int YES = 0x2220 + MESSAGE_ID;
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul.properties
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Too many characters are entered. At most {0} characters are allowed.
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
96 changes: 49 additions & 47 deletions zul/src/main/resources/metainfo/mesg/msgzul_bg.properties
Original file line number Diff line number Diff line change
@@ -1,112 +1,114 @@
#"charset=utf-8"
#Tranlated by Boril Yonchev (yonchev@gmail.com) 15 June 2010
#Copyright (C) 2005,2006 Potix Corporation

#
# Validation #
#
#-=EMPTY_NOT_ALLOWED
2000=Трябва да зададете стойност
2000=Трябва да зададете стойност
#-=NO_POSITIVE_NEGATIVE_ZERO
2001=Числото може да бъде само положително
2001=Числото може да бъде само положително
#-=NO_POSITIVE_NEGATIVE
2002=Може да приема само стойност 0
2002=Може да приема само стойност 0
#-=NO_POSITIVE_ZERO
2003=Числото може да бъде само отрицателно
2003=Числото може да бъде само отрицателно
#-=NO_POSITIVE
2004=Числото може да бъде само отрицателно и нула
2004=Числото може да бъде само отрицателно и нула
#-=NO_NEGATIVE_ZERO
2005=Числото може да бъде само положително
2005=Числото може да бъде само положително
#-=NO_NEGATIVE
2006=Числото може да бъде само положително и нула
2006=Числото може да бъде само положително и нула
#-=NO_ZERO
2007=Числото не може да бъде нула
2007=Числото не може да бъде нула

#-=NO_FUTURE_PAST_TODAY
2011=Може да бъде само празно
2011=Може да бъде само празно
#-=NO_FUTURE_PAST
2012=Приема само нула
2012=Приема само нула
#-=NO_FUTURE_TODAY
2013=Датата може да бъде само от минал период
2013=Датата може да бъде само от минал период
#-=NO_FUTURE
2014=Приема само дати, които не са от бъдещ период
2014=Приема само дати, които не са от бъдещ период
#-=NO_PAST_TODAY
2015=Датата може да бъде само от бъдещ период
2015=Датата може да бъде само от бъдещ период
#-=NO_PAST
2016=Приема само дати, които не са от минал период
2016=Приема само дати, които не са от минал период
#-=NO_TODAY
2017=Приема само днешна дата
2017=Приема само днешна дата
#-=VALUE_NOT_MATCHED
2018=Трябва да посочите една от стойностите в падащия списък.
2018=Трябва да посочите една от стойностите в падащия списък.

#-=INTEGER_REQUIRED
2040=Трябва да бъде цяло число, по-голямо от {0}.
2040=Трябва да бъде цяло число, по-голямо от {0}.
#-=NUMBER_REQUIRED
2041=Трябва да бъде число, по-голямо от {0}.
2041=Трябва да бъде число, по-голямо от {0}.
#-=DATE_REQUIRED
2042={
Датата трябва да е след {0}.
Формата е: {1}.
Датата трябва да е след {0}.
Формата е: {1}.
}
#-=OUT_OF_RANGE
2043={
Извън обхвата ({0}).
Извън обхвата ({0}).
}
#-=STRING_TOO_LONG
2044={
Прекалено много символи. Трябва да бъдат до {0}.
Прекалено много символи. Трябва да бъдат до {0}.
}

#-=ILLEGAL_VALUE
2050=Неправилна стойност
2050=Неправилна стойност

#
# Fileupload #
#
#-=UPLOAD_TITLE
2100=Зареждане на файл
2100=Зареждане на файл
#-=UPLOAD_MESSAGE
2101=Изберете файла от вашета система
2101=Изберете файла от вашета система
#-=UPLOAD_CANCEL
2102=Прекъсни
2102=Прекъсни
#-=UPLOAD_SUBMIT
2103=Зареди
2103=Зареди
#-=UPLOAD_BROWSE
2104=Избери...
2104=Избери...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
#
#-=OK
2200=OK
#-=CANCEL
2201=Прекъсни
2201=Прекъсни
#-=YES
2220=Да
2220=Да
#-=NO
2221=Не
2221=Не
#-=RETRY
2230=Повтори
2230=Повтори
#-=ABORT
2231=Откажи
2231=Откажи
#-=IGNORE
2232=Игнорирай
2232=Игнорирай
#-=RELOAD
2233=Презареди
2233=Презареди

#
# Paging #
#
#-=FIRST
2300=Първа
2300=Първа
#-=LAST
2301=Последна
2301=Последна
#-=PREV
2302=Предишна
2302=Предишна
#-=NEXT
2303=Следваща
2303=Следваща
#-=CURRENT
2304=Current
#-=CURRENT_DESCRIPTION {0}:current, {1}:total
Expand All @@ -118,21 +120,21 @@
# Common #
#
#-=PLEASE_WAIT
2400=Зарежда се...
2400=Зарежда се...

#
# Grid #
#
#-=GRID_GROUP
2500=Групиране
2500=Групиране
#-=GRID_OTHER
2501=Други
2501=Други
#-=GRID_ASC
2502=Възходящо сортиране
2502=Възходящо сортиране
#-=GRID_DESC
2503=Низходящо сортиране
2503=Низходящо сортиране
#-=GRID_COLUMNS
2504=Колони
2504=Колони
#-=GRID_UNGROUP
2505=Ungroup

Expand Down Expand Up @@ -168,7 +170,7 @@
# Calendar #
#
#-=CALENDAR_TODAY
2801=Днес
2801=Днес

#
# Pdfviewer #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Heu introduït massa caràcters. El màxim permès és {0}.
2104=Explora...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=La sol·licitud ha estat rebutjada perquè la mida del fitxer ({0}) supera el màxim configurat ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Příliš mnoho znakům maximum je {0} znaků
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ For mange tegn er indtastet. Maksimalt {0} tegn er tilladt.
2104=Gennemse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Zu viele Zeichen eingeben. Maximal {0} Zeichen sind zulässig.
2104=Durchsuchen...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=Upload fehlgeschlagen: Dateigröße ({0}) übersteigt das erlaubte Limit ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Too many characters are entered. At most {0} characters are allowed.
2104=Explorer...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Trop de caractères sont saisis. {0} caractère(s) sont autorisé(s) au maximum.
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=la requete à été refusée car sa taille ({0}) dépasse le maximum configuré ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_hu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Túl hosszú szöveg! Csak {0} vagy kevesebb karakter engedélyezett.
2104=Tallózás...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_id.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Terlalu banyak karakter yang dimasukkan. Paling banyak {0} karater yang diijinka
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Troppi caratteri. Sono consentiti al massimo {0} caratteri.
2104=Browse...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=The request was rejected because the file size ({0}) exceeds the configured maximum ({1})
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
2 changes: 2 additions & 0 deletions zul/src/main/resources/metainfo/mesg/msgzul_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
2104=參照...
#-=UPLOAD_ERROR_EXCEED_MAXSIZE Auto:{0},{1} Byte:{2},{3} KB:{4},{5} MB:{6},{7}
2105=このリクエストが拒否されました。ファイルサイズ({0})が最大値({1})を越えています。
#-=UPLOAD_ERROR_UNACCEPTED_FILE_TYPE
2106=The request was rejected because the file type is unacceptable

#
# Messagebox #
Expand Down
Loading

0 comments on commit c885ded

Please sign in to comment.