Page Menu
Home
desp's stash
Search
Configure Global Search
Log In
Files
F765439
main.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
main.js
View Options
AOS
.
init
();
//initialize tooltips
$
(
'[data-toggle="tooltip"]'
).
tooltip
({
offset
:
'0, 20%'
});
$
(
'#discord'
).
bind
(
'click touchend'
,
function
()
{
if
(
navigator
.
clipboard
.
writeText
(
"despawningbone#4078"
))
{
$
(
this
).
tooltip
(
'hide'
);
$
(
'#discord'
).
attr
(
'data-original-title'
,
"(copied!)"
);
setTimeout
(()
=>
$
(
'#discord'
).
attr
(
'data-original-title'
,
"despawningbone#4078"
),
400
);
$
(
this
).
tooltip
(
'show'
);
}
});
//relative data-target patch for accordions, and also to add .show back into the button
$
(
'body'
).
on
(
'click'
,
'[data-toggle=collapse]'
,
function
(
e
)
{
var
$parent
=
$
(
this
).
parents
(
'.ctf-info'
);
$parent
.
find
(
'.ctf-table'
).
collapse
(
'toggle'
);
$parent
.
toggleClass
(
'show'
)
});
//ctf diary comment popup dynamically load content
//TODO allow use of url#data-comment to load modal
$
(
'.ctf-table tbody tr'
).
on
(
'click'
,
function
(){
href
=
$
(
this
).
attr
(
'href'
);
//if full writeup is available, redirect
if
(
href
)
{
window
.
location
=
href
;
}
else
{
//else open comment popup
href
=
$
(
this
).
attr
(
'data-comment'
);
//set comment title to chall name
$
(
'#commentTitle'
).
text
(
'Comments - '
+
this
.
firstElementChild
.
textContent
)
//only load if attr is found, which means a comment should be found
if
(
href
)
{
console
.
log
(
'ctf/'
+
href
+
'.html'
)
$
(
'.ctf-comment'
).
load
(
'ctf/'
+
href
+
'.html'
,
function
(
res
,
status
,
xhr
){
if
(
status
!==
"error"
)
//only show if we can load it, otherwise treat as no comment
$
(
'#comment'
).
modal
({
show
:
true
});
});
}
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 29, 9:13 AM (1 d, 15 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a8/00/a0908ba04f6064604becd18030fd
Attached To
rWEB Web Portfolio
Event Timeline
Log In to Comment