Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bromcom VLE to ICS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
Bromcom VLE to ICS
Commits
71697ebe
Commit
71697ebe
authored
Feb 4, 2024
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parent
19b39523
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bvletools.user.js
+69
-0
69 additions, 0 deletions
bvletools.user.js
with
69 additions
and
0 deletions
bvletools.user.js
0 → 100644
+
69
−
0
View file @
71697ebe
// ==UserScript==
// @name Bromcom VLE Tools
// @namespace http://radialbog9.uk/
// @version 2024-02-04
// @description Bromcom VLE dashboard widget
// @author Radialbog9
// @match https://vle.bromcomcloud.com/Home/Dashboard
// @downloadURL https://git.rb9.xyz/TheJoeCoder/bromcom-vle-to-ics/-/raw/main/bvletools.user.js
// @updateURL https://git.rb9.xyz/TheJoeCoder/bromcom-vle-to-ics/-/raw/main/bvletools.user.js
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @require https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js
// @grant none
// ==/UserScript==
/*
<div class="grid-stack-item ui-draggable ui-resizable ui-resizable-autohide ui-resizable-disabled" id="gs_RB9Buttons" data-color="danger" data-gs-id="gs_RB9Buttons" data-gs-x="8" data-gs-y="2" data-gs-width="4" data-gs-height="2" data-gs-no-resize="yes">
<div class="panel panel-danger shadow grid-stack-item-content ui-draggable-handle">
<div class="panel-heading">
<table>
<tbody>
<tr class="tableheader">
<td><i style="font-size:35px; padding-right:5px; padding-left:5px" class="fa fa fa-wrench "></i></td>
<td>
<h3 class="panel-title">Toolkit</h3><h5 class="panelSubTitle">Utilities Toolkit</h5>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</div>
<div id="content_RB9Buttons" style="display:block; width: 100%;padding:0px;" class="ifNoDataInWidget">
<span class="txtalignCenter"><a id="rb9ButtonGetTTWeek">Get Timetable (This Week)</a></span>
</div>
</div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 90; display: none;"></div>
</div>
*/
(
function
()
{
'
use strict
'
;
function
formatDate
(
date
)
{
var
d
=
new
Date
(
date
),
month
=
''
+
(
d
.
getMonth
()
+
1
),
day
=
''
+
d
.
getDate
(),
year
=
d
.
getFullYear
();
if
(
month
.
length
<
2
)
{
month
=
'
0
'
+
month
;}
if
(
day
.
length
<
2
)
{
day
=
'
0
'
+
day
;}
return
[
year
,
month
,
day
].
join
(
'
-
'
);
}
addEventListener
(
"
load
"
,
(
e
)
=>
{
$
(
"
#widgetsDahsboard .grid-stack
"
).
append
(
"
\r\n
<div class=
\"
grid-stack-item ui-draggable ui-resizable ui-resizable-autohide ui-resizable-disabled
\"
id=
\"
gs_RB9Buttons
\"
data-color=
\"
danger
\"
data-gs-id=
\"
gs_RB9Buttons
\"
data-gs-x=
\"
8
\"
data-gs-y=
\"
2
\"
data-gs-width=
\"
4
\"
data-gs-height=
\"
2
\"
data-gs-no-resize=
\"
yes
\"
>
\r\n
<div class=
\"
panel panel-danger shadow grid-stack-item-content ui-draggable-handle
\"
>
\r\n
<div class=
\"
panel-heading
\"
>
\r\n
<table>
\r\n
<tbody>
\r\n
<tr class=
\"
tableheader
\"
>
\r\n
<td><i style=
\"
font-size:35px; padding-right:5px; padding-left:5px
\"
class=
\"
fa fa fa-wrench
\"
><
\
/i><
\
/td>
\r\n
<td>
\r\n
<h3 class=
\"
panel-title
\"
>Toolkit<
\
/h3><h5 class=
\"
panelSubTitle
\"
>Utilities Toolkit<
\
/h5>
\r\n
<
\
/td>
\r\n
<
\
/tr>
\r\n
<tr><
\
/tr>
\r\n
<
\
/tbody>
\r\n
<
\
/table>
\r\n
<
\
/div>
\r\n
<div id=
\"
content_RB9Buttons
\"
style=
\"
display:block; width: 100%;padding:0px;
\"
class=
\"
ifNoDataInWidget
\"
>
\r\n
<span class=
\"
txtalignCenter
\"
><a id=
\"
rb9ButtonGetTTWeek
\"
>Get Timetable (This Week)<
\
/a><
\
/span>
\r\n
<
\
/div>
\r\n
<
\
/div><div class=
\"
ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se
\"
style=
\"
z-index: 90; display: none;
\"
><
\
/div>
\r\n
<
\
/div>
"
);
$
(
"
#rb9ButtonGetTTWeek
"
).
on
(
"
click
"
,
()
=>
{
var
now
=
new
Date
();
var
today
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
now
.
getDate
());
var
lastSunday
=
new
Date
(
today
.
setDate
(
today
.
getDate
()
-
today
.
getDay
()));
var
nextSaturday
=
new
Date
(
lastSunday
).
setDate
(
lastSunday
.
getDate
()
+
7
);
var
url
=
"
https://vle.bromcomcloud.com/Timetable/GetTimeTable?WeekStartDate=
"
+
formatDate
(
lastSunday
)
+
"
&weekEndDate=
"
+
formatDate
(
nextSaturday
)
+
"
&type=1&id=0
"
;
$
.
ajax
({
url
:
url
,
method
:
"
POST
"
,
dataType
:
"
json
"
})
.
done
((
data
)
=>
{
var
data_str
=
JSON
.
stringify
(
data
);
console
.
log
(
data_str
);
navigator
.
clipboard
.
writeText
(
data_str
);
alert
(
"
Copied to Clipboard.
"
);
});
});
});
})();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment