Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vildravn
today-in-wow-widget
Commits
a92f815c
Commit
a92f815c
authored
Dec 16, 2020
by
Vildravn
Browse files
Affix fix, remove logs
parent
2579ef69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Today in WoW.js
View file @
a92f815c
...
...
@@ -64,7 +64,6 @@ const slBosses = {
// -----------------------------
let
REGION
=
args
.
widgetParameter
||
'
EU
'
;
REGION
=
(
REGION
.
toUpperCase
()
==
'
US
'
?
'
US
'
:
'
EU
'
);
log
(
REGION
);
const
cheerio
=
importModule
(
'
cheerio
'
);
let
$
=
undefined
;
...
...
@@ -103,7 +102,7 @@ async function createWidget(size) {
let
whData
=
await
fetchData
(
"
https://www.wowhead.com
"
,
"
loadString
"
);
$
=
cheerio
.
load
(
whData
);
let
data
=
undefined
;
let
data
=
null
;
whData
=
undefined
;
delete
(
whData
);
...
...
@@ -128,7 +127,6 @@ async function createWidget(size) {
await
buildAffixDisplay
(
rightColumn
,
data
);
rightColumn
.
addSpacer
(
20
);
data
=
await
parseTextGroup
(
`#
${
REGION
}
-group-epiceliteworldsl`
,
`.tiw-region[data-region="
${
REGION
}
"]`
);
log
(
data
);
const
bossLink
=
(
data
?
slBosses
[
data
[
0
]]
:
null
);
await
buildTextDisplay
(
rightColumn
,
"
world boss
"
,
data
,
bossLink
);
...
...
@@ -154,10 +152,12 @@ async function createWidget(size) {
async
function
buildAffixDisplay
(
parent
,
affixes
)
{
const
levels
=
[
"
2+
"
,
"
4+
"
,
"
7+
"
,
"
10+
"
];
for
(
let
i
=
0
;
i
<
affixes
.
length
;
i
++
)
{
let
affix
=
affixes
[
i
];
if
(
affixes
)
{
for
(
let
i
=
0
;
i
<
affixes
.
length
;
i
++
)
{
let
affix
=
affixes
[
i
];
affix
.
text
=
levels
[
i
];
affix
.
text
=
levels
[
i
];
}
}
await
buildImageDisplay
(
parent
,
"
mythic+ affixes
"
,
affixes
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment