FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptButtons/tasks/content.js at master · mfeckie/JavaScriptButtons · GitHub
mfeckie
/
JavaScriptButtons
Public
forked from
jbillimoria/JavaScriptButtons
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptButtons
/
tasks
/
content.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (29 loc) · 1.07 KB
Breadcrumbs
JavaScriptButtons
/
tasks
/
content.js
Copy path
File metadata and controls
44 lines (29 loc) · 1.07 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict'
;
module
.
exports
=
function
content
(
grunt
)
{
var
src
=
'dist/button.js'
;
function
processContent
(
str
)
{
var
bundles
=
grunt
.
file
.
expand
(
'locales/**/*.properties'
)
,
content
=
{
}
,
props
,
locale
;
bundles
.
forEach
(
function
(
bundle
)
{
locale
=
bundle
.
split
(
/
l
o
c
a
l
e
s
\/
(
[
A
-
Z
]
{
2
}
)
\/
(
[
a
-
z
]
{
2
}
)
\/
/
)
;
locale
=
locale
[
2
]
+
'_'
+
locale
[
1
]
;
content
[
locale
]
=
{
}
;
props
=
grunt
.
file
.
read
(
bundle
)
;
props
=
props
.
split
(
/
\n
/
)
;
props
.
forEach
(
function
(
line
)
{
var
pair
=
line
.
split
(
/
=
(
.
+
)
/
)
;
if
(
pair
[
0
]
)
{
content
[
locale
]
[
pair
[
0
]
]
=
pair
[
1
]
;
}
}
)
;
}
)
;
str
=
str
.
replace
(
'\'$STRINGS$\''
,
JSON
.
stringify
(
content
)
)
;
return
str
;
}
grunt
.
registerTask
(
'content'
,
'Grabs localized content and injects it into the JavaScript'
,
function
(
)
{
var
out
=
grunt
.
file
.
read
(
src
)
;
out
=
processContent
(
out
)
;
grunt
.
file
.
write
(
src
,
out
)
;
}
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL