FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptButtons/tasks/css.js at master · DarcyGeorge/JavaScriptButtons · GitHub
DarcyGeorge
JavaScriptButtons
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptButtons
/
tasks
/
css.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (16 loc) · 545 Bytes
Breadcrumbs
JavaScriptButtons
/
tasks
/
css.js
Copy path
File metadata and controls
27 lines (16 loc) · 545 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict'
;
function
trim
(
str
)
{
return
str
.
replace
(
/
(
^
\s
+
|
\s
+
$
)
/
g
,
''
)
.
replace
(
/
(
\r
\n
|
\n
|
\r
)
/
g
,
''
)
;
}
module
.
exports
=
function
css
(
grunt
)
{
var
src
=
'dist/button.js'
;
function
processCss
(
str
)
{
var
styles
=
trim
(
grunt
.
file
.
read
(
'src/theme/css/index.css'
)
)
;
return
str
.
replace
(
'$STYLES$'
,
styles
)
;
}
grunt
.
registerTask
(
'css'
,
'Injects css into the JavaScript'
,
function
(
)
{
var
out
=
grunt
.
file
.
read
(
src
)
;
out
=
processCss
(
out
)
;
grunt
.
file
.
write
(
src
,
out
)
;
}
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL