Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22395746
kontakty.html
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
kontakty.html
View Options
<!DOCTYPE html>
<
html
>
<
head
>
<
script
src
=
"/jquery.js"
></
script
>
<
script
src
=
"/authorization.js"
></
script
>
<
meta
charset
=
"utf-8"
>
<
title
>
Lista kontaktów
</
title
>
<
link
rel
=
"stylesheet"
href
=
"/style.css"
>
<
meta
name
=
"viewport"
content
=
"width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"
>
</
head
>
<
body
>
<
a
href
=
"/"
>
Menu główne
</
a
>
<
center
><
h1
>
Lista kontaktów
</
h1
></
center
>
<
ul
id
=
"lista-kontaktow"
>
</
ul
>
<
input
type
=
"text"
placeholder
=
"Nazwa użytkownika"
id
=
"username"
>
<
input
type
=
"text"
placeholder
=
"Adres email"
id
=
"email"
>
<
button
id
=
"confirm"
onclick
=
"addNewContact()"
>
Dodaj
</
button
>
</
body
>
<
script
>
Auth
.
redirect_if_not_logged_in
();
function
readContactList
(){
$
(
"#lista-kontaktow"
).
html
(
""
);
$
.
get
(
"/api/v1/chat/contacts"
,
function
(
data
)
{
console
.
log
(
data
);
for
(
var
i
in
data
)
{
var
entry
=
data
[
i
];
var
node
=
$
(
"<li>"
+
entry
.
name
+
" <span class='email'>"
+
entry
.
email
+
"</span> <button onclick='deleteContact("
+
entry
.
id
+
")'>Usuń</button></li>"
);
$
(
"#lista-kontaktow"
).
append
(
node
);
}
});
}
function
addNewContact
(){
var
name
=
$
(
"#username"
).
val
();
var
email
=
$
(
"#email"
).
val
();
$
.
post
(
"/api/v1/chat/contacts"
,
{
name
:
name
,
email
:
email
},
function
()
{
console
.
log
(
"posted"
);
readContactList
();
});
}
function
deleteContact
(
contact_id
){
$
.
ajax
({
url
:
'/api/v1/chat/contacts'
,
data
:
{
id
:
parseInt
(
contact_id
)},
type
:
'DELETE'
,
success
:
function
(
result
)
{
readContactList
();
}
});
}
readContactList
();
</
script
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Fri, Nov 27, 16:28 (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1221571
Default Alt Text
kontakty.html (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline