Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
ba4206b6
Commit
ba4206b6
authored
Feb 08, 2014
by
Zlatan Vasović
Committed by
Chris Rebert
Feb 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use different coding style for Gruntfile
Fixes #12657
parent
9afead3f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
28 deletions
+46
-28
CONTRIBUTING.md
CONTRIBUTING.md
+1
-1
Gruntfile.js
Gruntfile.js
+1
-1
grunt/.jshintrc
grunt/.jshintrc
+16
-0
grunt/bs-glyphicons-data-generator.js
grunt/bs-glyphicons-data-generator.js
+13
-11
grunt/bs-lessdoc-parser.js
grunt/bs-lessdoc-parser.js
+1
-0
grunt/bs-raw-files-generator.js
grunt/bs-raw-files-generator.js
+13
-14
grunt/shrinkwrap.js
grunt/shrinkwrap.js
+1
-1
No files found.
CONTRIBUTING.md
View file @
ba4206b6
...
@@ -178,7 +178,7 @@ license your work under the terms of the [MIT License](LICENSE.md).
...
@@ -178,7 +178,7 @@ license your work under the terms of the [MIT License](LICENSE.md).
### JS
### JS
-
No semicolons
-
No semicolons
(in client-side JS)
-
2 spaces (no tabs)
-
2 spaces (no tabs)
-
strict mode
-
strict mode
-
"Attractive"
-
"Attractive"
...
...
Gruntfile.js
View file @
ba4206b6
...
@@ -45,7 +45,7 @@ module.exports = function (grunt) {
...
@@ -45,7 +45,7 @@ module.exports = function (grunt) {
},
},
grunt
:
{
grunt
:
{
options
:
{
options
:
{
node
:
true
jshintrc
:
'
grunt/.jshintrc
'
},
},
src
:
[
'
Gruntfile.js
'
,
'
grunt/*.js
'
]
src
:
[
'
Gruntfile.js
'
,
'
grunt/*.js
'
]
},
},
...
...
grunt/.jshintrc
0 → 100644
View file @
ba4206b6
{
"asi": false,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"newcap": true,
"noarg": true,
"nonbsp": true,
"quotmark": "single",
"undef": true,
"strict": true,
"trailing": true,
"node" : true
}
grunt/bs-glyphicons-data-generator.js
View file @
ba4206b6
...
@@ -4,29 +4,31 @@
...
@@ -4,29 +4,31 @@
* Copyright 2014 Twitter, Inc.
* Copyright 2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
*/
'
use strict
'
;
var
fs
=
require
(
'
fs
'
)
var
fs
=
require
(
'
fs
'
)
;
module
.
exports
=
function
generateGlyphiconsData
()
{
module
.
exports
=
function
generateGlyphiconsData
()
{
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// buffer
// buffer
var
glyphiconsFile
=
fs
.
readFileSync
(
'
less/glyphicons.less
'
,
'
utf8
'
)
var
glyphiconsFile
=
fs
.
readFileSync
(
'
less/glyphicons.less
'
,
'
utf8
'
)
;
var
glpyhiconsLines
=
glyphiconsFile
.
split
(
'
\n
'
)
var
glpyhiconsLines
=
glyphiconsFile
.
split
(
'
\n
'
)
;
// Use any line that starts with ".glyphicon-" and capture the class name
// Use any line that starts with ".glyphicon-" and capture the class name
var
iconClassName
=
/^
\.(
glyphicon-
[^\s]
+
)
/
var
iconClassName
=
/^
\.(
glyphicon-
[^\s]
+
)
/
;
var
glyphiconsData
=
'
# This file is generated via Grunt task. **Do not edit directly.**
\n
'
+
var
glyphiconsData
=
'
# This file is generated via Grunt task. **Do not edit directly.**
\n
'
+
'
# See the
\'
build-glyphicons-data
\'
task in Gruntfile.js.
\n\n
'
;
'
# See the
\'
build-glyphicons-data
\'
task in Gruntfile.js.
\n\n
'
;
for
(
var
i
=
0
,
len
=
glpyhiconsLines
.
length
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
,
len
=
glpyhiconsLines
.
length
;
i
<
len
;
i
++
)
{
var
match
=
glpyhiconsLines
[
i
].
match
(
iconClassName
)
var
match
=
glpyhiconsLines
[
i
].
match
(
iconClassName
)
;
if
(
match
!=
null
)
{
if
(
match
!=
=
null
)
{
glyphiconsData
+=
'
-
'
+
match
[
1
]
+
'
\n
'
glyphiconsData
+=
'
-
'
+
match
[
1
]
+
'
\n
'
;
}
}
}
}
// Create the `_data` directory if it doesn't already exist
// Create the `_data` directory if it doesn't already exist
if
(
!
fs
.
existsSync
(
'
docs/_data
'
))
fs
.
mkdirSync
(
'
docs/_data
'
)
if
(
!
fs
.
existsSync
(
'
docs/_data
'
))
{
fs
.
mkdirSync
(
'
docs/_data
'
);
}
fs
.
writeFileSync
(
'
docs/_data/glyphicons.yml
'
,
glyphiconsData
)
fs
.
writeFileSync
(
'
docs/_data/glyphicons.yml
'
,
glyphiconsData
)
;
}
}
;
grunt/bs-lessdoc-parser.js
View file @
ba4206b6
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
* Copyright 2014 Twitter, Inc.
* Copyright 2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
*/
'
use strict
'
;
var
markdown
=
require
(
'
markdown
'
).
markdown
;
var
markdown
=
require
(
'
markdown
'
).
markdown
;
...
...
grunt/bs-raw-files-generator.js
View file @
ba4206b6
/* global btoa: true */
/* global btoa: true */
/*!
/*!
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer
* http://getbootstrap.com
* http://getbootstrap.com
* Copyright 2014 Twitter, Inc.
* Copyright 2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
*/
'
use strict
'
;
var
btoa
=
require
(
'
btoa
'
)
var
btoa
=
require
(
'
btoa
'
)
;
var
fs
=
require
(
'
fs
'
)
var
fs
=
require
(
'
fs
'
)
;
function
getFiles
(
type
)
{
function
getFiles
(
type
)
{
var
files
=
{}
var
files
=
{}
;
fs
.
readdirSync
(
type
)
fs
.
readdirSync
(
type
)
.
filter
(
function
(
path
)
{
.
filter
(
function
(
path
)
{
return
type
==
'
fonts
'
?
true
:
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
)
return
type
==
=
'
fonts
'
?
true
:
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
);
})
})
.
forEach
(
function
(
path
)
{
.
forEach
(
function
(
path
)
{
var
fullPath
=
type
+
'
/
'
+
path
var
fullPath
=
type
+
'
/
'
+
path
;
return
files
[
path
]
=
(
type
==
'
fonts
'
?
btoa
(
fs
.
readFileSync
(
fullPath
))
:
fs
.
readFileSync
(
fullPath
,
'
utf8
'
))
files
[
path
]
=
(
type
===
'
fonts
'
?
btoa
(
fs
.
readFileSync
(
fullPath
))
:
fs
.
readFileSync
(
fullPath
,
'
utf8
'
));
})
})
;
return
'
var __
'
+
type
+
'
=
'
+
JSON
.
stringify
(
files
)
+
'
\n
'
return
'
var __
'
+
type
+
'
=
'
+
JSON
.
stringify
(
files
)
+
'
\n
'
;
}
}
module
.
exports
=
function
generateRawFilesJs
(
banner
)
{
module
.
exports
=
function
generateRawFilesJs
(
banner
)
{
if
(
!
banner
)
{
if
(
!
banner
)
{
banner
=
''
banner
=
''
;
}
}
var
files
=
banner
+
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
getFiles
(
'
fonts
'
)
var
files
=
banner
+
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
getFiles
(
'
fonts
'
)
;
fs
.
writeFileSync
(
'
docs/assets/js/raw-files.min.js
'
,
files
)
fs
.
writeFileSync
(
'
docs/assets/js/raw-files.min.js
'
,
files
)
;
}
}
;
grunt/shrinkwrap.js
View file @
ba4206b6
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
This Grunt task updates the npm-shrinkwrap.canonical.json file that's used as the key for Bootstrap's npm packages cache.
This Grunt task updates the npm-shrinkwrap.canonical.json file that's used as the key for Bootstrap's npm packages cache.
This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
*/
*/
'
use strict
'
;
var
canonicallyJsonStringify
=
require
(
'
canonical-json
'
);
var
canonicallyJsonStringify
=
require
(
'
canonical-json
'
);
var
NON_CANONICAL_FILE
=
'
npm-shrinkwrap.json
'
;
var
NON_CANONICAL_FILE
=
'
npm-shrinkwrap.json
'
;
var
DEST_FILE
=
'
test-infra/npm-shrinkwrap.canonical.json
'
;
var
DEST_FILE
=
'
test-infra/npm-shrinkwrap.canonical.json
'
;
...
...
Write
Preview
Markdown
is supported
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