Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CssLsd
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Florent Berthaut
CssLsd
Commits
bc1f0d77
Commit
bc1f0d77
authored
3 years ago
by
RANWEZ Pierre
Browse files
Options
Downloads
Patches
Plain Diff
bug: bug bounty after refactor
parent
616b102c
No related branches found
No related tags found
1 merge request
!1
✨ feat: CSSLSD V2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
content.js
+7
-5
7 additions, 5 deletions
content.js
with
7 additions
and
5 deletions
content.js
+
7
−
5
View file @
bc1f0d77
...
...
@@ -17,7 +17,7 @@ var audioSample = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
function
parseCSS
(
cssObj
)
{
var
parser
=
new
CSSParser
();
var
sheet
=
parser
.
parse
(
cssObj
,
false
,
true
);
var
audioVars
=
[
'
loud
'
,
'
low
'
,
'
lomi
'
,
'
mid
'
,
'
mihi
'
,
'
hi
'
,
'
attack
'
];
var
audioVars
=
[
'
loud
'
,
'
low
'
,
'
lomi
'
,
'
mid
'
,
'
mihi
'
,
'
hi
'
,
'
attack
'
,
'
onset
'
];
var
midiVars
=
[
'
cc
'
,
'
note
'
];
chrome
.
runtime
.
sendMessage
({
type
:
'
updateUi
'
,
data
:
true
});
sheet
.
cssRules
.
forEach
(
element
=>
{
...
...
@@ -84,9 +84,9 @@ function templateToDict(string) {
});
}
else
{
if
(
string
.
includes
(
'
:
'
))
{
eventType
=
string
.
split
(
'
:
'
)[
0
];
eventName
=
string
.
split
(
'
:
'
)[
1
];
if
(
template
.
includes
(
'
:
'
))
{
eventType
=
template
.
split
(
'
:
'
)[
0
];
eventName
=
template
.
split
(
'
:
'
)[
1
];
}
else
{
eventType
=
eventString
;
...
...
@@ -102,6 +102,7 @@ function templateToDict(string) {
}
string
=
string
.
replace
(
'
[
'
+
template
+
'
]
'
,
''
);
}
console
.
log
(
returnValue
);
return
returnValue
;
}
...
...
@@ -458,7 +459,7 @@ function audioEvent() {
volume
=
meter
.
volume
*
1.4
;
value
=
value
.
replace
(
'
[
'
+
template
[
'
templateFull
'
]
+
'
]
'
,
(
meter
.
volume
*
1.4
<
1
?
parseInt
(
template
[
'
min
'
])
+
Math
.
round
((
template
[
'
max
'
]
-
template
[
'
min
'
])
*
volume
)
:
0
));
}
if
(
template
[
'
eventType
'
]
==
'
note
'
&&
template
[
'
eventName
'
]
==
note
)
{
if
(
template
[
'
eventType
'
]
==
'
onset
'
&&
template
[
'
eventName
'
]
==
note
Strings
[
note
%
12
]
)
{
eventIn
=
true
;
value
=
value
.
replace
(
'
[
'
+
template
[
'
templateFull
'
]
+
'
]
'
,
''
);
}
...
...
@@ -490,6 +491,7 @@ function onMessage({ type, data }) {
case
'
update
'
:
{
const
css
=
data
.
cssStr
;
audioEvents
=
[];
midiEvents
=
[];
parseCSS
(
css
)
break
;
}
...
...
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
register
or
sign in
to comment