Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22395740
file.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
file.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FileContainer
}
from
"../fields/file"
;
import
{
FormDataValue
}
from
"../form"
;
import
{
SimpleInput
}
from
"./simple-input"
;
export
class
File
extends
SimpleInput
<
FileContainer
>
{
getType
()
{
return
"file"
;
}
async
preInput
(
ctx
:
Context
,
data
:
Record
<
string
,
FormDataValue
>
)
{
const
{
parsed
}
=
await
this
.
field
.
getValue
(
ctx
,
data
);
return
/* HTML */
`
${
parsed
.
old
?
.
filename
||
""
}
<input
type="hidden"
name="
${
this
.
field
.
name
}
[old][id]"
value="
${
parsed
.
old
?
.
id
||
""
}
"
/>
<input
type="hidden"
name="
${
this
.
field
.
name
}
[old][filename]"
value="
${
parsed
.
old
?
.
filename
||
""
}
"
/>`
;
}
async
getInputAttributes
(
ctx
:
Context
,
data
:
Record
<
string
,
FormDataValue
>
,
field_prefix
:
string
,
form_id
:
string
)
{
const
original
=
await
super
.
getInputAttributes
(
ctx
,
data
,
field_prefix
,
form_id
);
const
{
parsed
}
=
await
this
.
field
.
getValue
(
ctx
,
data
);
return
{
...
original
,
name
:
this
.
field
.
name
+
"[new]"
,
required
:
original
.
required
&&
!
parsed
.
old
,
value
:
false
,
onchange
:
(
original
.
onchange
||
""
)
+
";"
+
"filename = this.value.split('\\\\').slice(-1)[0]; this.parentElement.style.setProperty('--filename', '\\'Wybrany plik: ' + filename + '\\'')"
,
};
}
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 16:28 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1200645
Default Alt Text
file.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline