Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
ee2df11e
Commit
ee2df11e
authored
10 years ago
by
XhmikosR
Browse files
Options
Download
Plain Diff
Merge pull request #13091 from twbs/unused-js
Remove unused javascript
parents
de86b36b
2f0f8ec6
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
dist/js/bootstrap.js
+2
-2
dist/js/bootstrap.js
dist/js/bootstrap.min.js
+1
-1
dist/js/bootstrap.min.js
docs/assets/js/_src/application.js
+1
-4
docs/assets/js/_src/application.js
docs/assets/js/_src/customizer.js
+3
-2
docs/assets/js/_src/customizer.js
docs/assets/js/customize.min.js
+1
-1
docs/assets/js/customize.min.js
docs/assets/js/docs.min.js
+1
-1
docs/assets/js/docs.min.js
docs/dist/js/bootstrap.min.js
+1
-1
docs/dist/js/bootstrap.min.js
grunt/.jshintrc
+2
-1
grunt/.jshintrc
js/.jshintrc
+1
-0
js/.jshintrc
js/scrollspy.js
+2
-1
js/scrollspy.js
js/tests/unit/affix.js
+3
-3
js/tests/unit/affix.js
js/tests/unit/button.js
+0
-1
js/tests/unit/button.js
js/tests/unit/collapse.js
+8
-8
js/tests/unit/collapse.js
js/tests/unit/scrollspy.js
+1
-1
js/tests/unit/scrollspy.js
js/tests/unit/tooltip.js
+10
-10
js/tests/unit/tooltip.js
js/tooltip.js
+0
-1
js/tooltip.js
with
37 additions
and
38 deletions
+37
-38
dist/js/bootstrap.js
+
2
-
2
View file @
ee2df11e
...
...
@@ -1243,7 +1243,6 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
}
Tooltip
.
prototype
.
applyPlacement
=
function
(
offset
,
placement
)
{
var
replace
var
$tip
=
this
.
tip
()
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
...
...
@@ -1626,7 +1625,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
this
.
targets
=
$
([])
var
self
=
this
var
$targets
=
this
.
$body
this
.
$body
.
find
(
this
.
selector
)
.
map
(
function
()
{
var
$el
=
$
(
this
)
...
...
This diff is collapsed.
Click to expand it.
dist/js/bootstrap.min.js
+
1
-
1
View file @
ee2df11e
This diff is collapsed.
Click to expand it.
docs/assets/js/_src/application.js
+
1
-
4
View file @
ee2df11e
...
...
@@ -31,11 +31,8 @@
var
$window
=
$
(
window
)
var
$body
=
$
(
document
.
body
)
var
navHeight
=
$
(
'
.navbar
'
).
outerHeight
(
true
)
+
10
$body
.
scrollspy
({
target
:
'
.bs-docs-sidebar
'
,
// offset: navHeight
target
:
'
.bs-docs-sidebar
'
})
$window
.
on
(
'
load
'
,
function
()
{
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/_src/customizer.js
+
3
-
2
View file @
ee2df11e
...
...
@@ -231,7 +231,9 @@ window.onload = function () { // wait for load in a dumb way because B-0
paths
:
[
'
variables.less
'
,
'
mixins.less
'
],
optimization
:
0
,
filename
:
baseFilename
+
'
.css
'
}).
parse
(
lessSource
,
function
(
err
,
tree
)
{
})
parser
.
parse
(
lessSource
,
function
(
err
,
tree
)
{
if
(
err
)
{
return
showError
(
'
<strong>Ruh roh!</strong> Could not parse less files.
'
,
err
)
}
...
...
@@ -331,7 +333,6 @@ window.onload = function () { // wait for load in a dumb way because B-0
})
var
$compileBtn
=
$
(
'
#btn-compile
'
)
var
$downloadBtn
=
$
(
'
#btn-download
'
)
$compileBtn
.
on
(
'
click
'
,
function
(
e
)
{
var
configData
=
getCustomizerData
()
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/customize.min.js
+
1
-
1
View file @
ee2df11e
...
...
@@ -52,4 +52,4 @@ var __js={"affix.js":"/* =======================================================
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
window.onload=function(){function a(a,b){throw $('<div id="bsCustomizerAlert" class="bs-customizer-alert"><div class="container"><a href="#bsCustomizerAlert" data-dismiss="alert" class="close pull-right">×</a><p class="bs-customizer-alert-text"><span class="glyphicon glyphicon-warning-sign"></span>'+a+"</p>"+(b.extract?'<pre class="bs-customizer-alert-extract">'+b.extract.join("\n")+"</pre>":"")+"</div></div>").appendTo("body").alert(),b}function b(a,b){var c=$('<div class="bs-callout bs-callout-danger"><h4>Attention!</h4><p>'+a+"</p></div>");b?c.appendTo(".bs-docs-container"):c.insertAfter(".bs-customize-download")}function c(a){a=a.replace(/[*+?^$.\[\]{}()|\\\/]/g,"\\$&");var b=location.search.match(new RegExp("[?&]"+a+"=([^&]+)(&|$)"));return b&&decodeURIComponent(b[1].replace(/\+/g," "))}function d(b,c){var d={description:"Bootstrap Customizer Config","public":!0,files:{"config.json":{content:b}}};$.ajax({url:"https://api.github.com/gists",type:"POST",dataType:"json",data:JSON.stringify(d)}).success(function(a){var b=window.location.protocol+"//"+window.location.host,d=b+window.location.pathname+"?id="+a.id;history.replaceState(!1,document.title,d),c(a.html_url,d)}).error(function(b){try{a("<strong>Ruh roh!</strong> Could not save gist file, configuration not saved.",b)}catch(d){}c("<none>","<none>")})}function e(){var a={};$("#less-variables-section input").each(function(){$(this).val()&&(a[$(this).prev().text()]=$(this).val())});var b={vars:a,css:$("#less-section input:checked").map(function(){return this.value}).toArray(),js:$("#plugin-section input:checked").map(function(){return this.value}).toArray()};if(!$.isEmptyObject(b.vars)||b.css.length||b.js.length)return b}function f(){var b=c("id");b&&$.ajax({url:"https://api.github.com/gists/"+b,type:"GET",dataType:"json"}).success(function(a){var b=JSON.parse(a.files["config.json"].content);if(b.js&&$("#plugin-section input").each(function(){$(this).prop("checked",~$.inArray(this.value,b.js))}),b.css&&$("#less-section input").each(function(){$(this).prop("checked",~$.inArray(this.value,b.css))}),b.vars)for(var c in b.vars)$('input[data-var="'+c+'"]').val(b.vars[c])}).error(function(b){a("Error fetching bootstrap config file",b)})}function g(b,c,d,e,f){if(!b&&!c)return a("<strong>Ruh roh!</strong> No Bootstrap files selected.",new Error("no Bootstrap"));var g=new JSZip;if(b){var h=g.folder("css");for(var i in b)h.file(i,b[i])}if(c){var j=g.folder("js");for(var k in c)j.file(k,c[k])}if(d){var l=g.folder("fonts");for(var m in d)l.file(m,d[m],{base64:!0})}e&&g.file("config.json",e);var n=g.generate({type:"blob"});f(n)}function h(a){var b="";for(var c in a)b+=c+": "+a[c]+";\n";return b+"\n\n"}function i(){var a=$('#less-section [value="glyphicons.less"]:checked');return a.length?__fonts:void 0}function j(a){var b=/^@import \"(.*?)\";$/,c=__less[a].split("\n"),d=[];return $.each(c,function(a,c){var e=b.exec(c);if(e){var f=e[1],g=j(f);$.each(g,function(a,b){-1===$.inArray(b,d)&&d.push(b)}),d.push(f)}}),d}function k(a,b,c){var d=__less[a],e=j(a);return $.each(e,function(a,e){var f=b[e];(f||null==f)&&(d+=__less[e]),"variables.less"===e&&c&&(d+=h(c))}),d=d.replace(/@import[^\n]*/gi,"")}function l(b,c,d){new less.Parser({paths:["variables.less","mixins.less"],optimization:0,filename:c+".css"}).parse(b,function(b,e){return b?a("<strong>Ruh roh!</strong> Could not parse less files.",b):(d[c+".css"]=o+e.toCSS(),void(d[c+".min.css"]=o+e.toCSS({compress:!0})))})}function m(b){var c=!1,d={};if($("#less-section input").each(function(){var a=$(this),b=a.is(":checked");d[a.val()]=b,c=c||b}),!c)return!1;var e={},f={};$("#less-variables-section input").each(function(){$(this).val()&&(f[$(this).prev().text()]=$(this).val())});var g=b+k("bootstrap.less",d,f),h=b+k("theme.less",d,f);try{l(g,"bootstrap",e),l(h,"bootstrap-theme",e)}catch(i){return a("<strong>Ruh roh!</strong> Could not parse less files.",i)}return e}function n(a){var b=$("#plugin-section input:checked");if(!b.length)return!1;var c=b.map(function(){return __js[this.value]}).toArray().join("\n");return{"bootstrap.js":a+c,"bootstrap.min.js":a+o+uglify(c)}}var o="/*!\n * Bootstrap v3.1.1 (http://getbootstrap.com)\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n",p=$("#less-section input"),q=$("#plugin-section input"),r=$("#less-variables-section input");$("#less-section .toggle").on("click",function(a){a.preventDefault(),p.prop("checked",!p.is(":checked"))}),$("#plugin-section .toggle").on("click",function(a){a.preventDefault(),q.prop("checked",!q.is(":checked"))}),$("#less-variables-section .toggle").on("click",function(a){a.preventDefault(),r.val("")}),$("[data-dependencies]").on("click",function(){if($(this).is(":checked")){var a=this.getAttribute("data-dependencies");if(a){a=a.split(",");for(var b=0;b<a.length;b++){var c=$('[value="'+a[b]+'"]');c&&c.prop("checked",!0)}}}}),$("[data-dependents]").on("click",function(){if(!$(this).is(":checked")){var a=this.getAttribute("data-dependents");if(a){a=a.split(",");for(var b=0;b<a.length;b++){var c=$('[value="'+a[b]+'"]');c&&c.prop("checked",!1)}}}});{var s=$("#btn-compile");$("#btn-download")}s.on("click",function(a){var b=e(),c=JSON.stringify(b,null,2);a.preventDefault(),s.attr("disabled","disabled"),d(c,function(a,d){b.customizerUrl=d,c=JSON.stringify(b,null,2);var e="/*!\n * Generated using the Bootstrap Customizer ("+d+")\n * Config saved to config.json and "+a+"\n */\n";g(m(e),n(e),i(),c,function(a){s.removeAttr("disabled"),saveAs(a,"bootstrap.zip")})})}),function(){function a(){$(".bs-docs-section, .bs-docs-sidebar").css("display","none"),b('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second to <a href="http://browsehappy.com/">upgrade to a more modern browser</a> (other than Safari).',!0)}var c=window.webkitURL||window.URL,d=new Blob(["<svg xmlns='http://www.w3.org/2000/svg'></svg>"],{type:"image/svg+xml;charset=utf-8"}),e=c.createObjectURL(d);null===/^blob:/.exec(e)?a():$("<img>").on("load",function(){s.prop("disabled",!1)}).on("error",a).attr("src",e)}(),f()};
\ No newline at end of file
window.onload=function(){function a(a,b){throw $('<div id="bsCustomizerAlert" class="bs-customizer-alert"><div class="container"><a href="#bsCustomizerAlert" data-dismiss="alert" class="close pull-right">×</a><p class="bs-customizer-alert-text"><span class="glyphicon glyphicon-warning-sign"></span>'+a+"</p>"+(b.extract?'<pre class="bs-customizer-alert-extract">'+b.extract.join("\n")+"</pre>":"")+"</div></div>").appendTo("body").alert(),b}function b(a,b){var c=$('<div class="bs-callout bs-callout-danger"><h4>Attention!</h4><p>'+a+"</p></div>");b?c.appendTo(".bs-docs-container"):c.insertAfter(".bs-customize-download")}function c(a){a=a.replace(/[*+?^$.\[\]{}()|\\\/]/g,"\\$&");var b=location.search.match(new RegExp("[?&]"+a+"=([^&]+)(&|$)"));return b&&decodeURIComponent(b[1].replace(/\+/g," "))}function d(b,c){var d={description:"Bootstrap Customizer Config","public":!0,files:{"config.json":{content:b}}};$.ajax({url:"https://api.github.com/gists",type:"POST",dataType:"json",data:JSON.stringify(d)}).success(function(a){var b=window.location.protocol+"//"+window.location.host,d=b+window.location.pathname+"?id="+a.id;history.replaceState(!1,document.title,d),c(a.html_url,d)}).error(function(b){try{a("<strong>Ruh roh!</strong> Could not save gist file, configuration not saved.",b)}catch(d){}c("<none>","<none>")})}function e(){var a={};$("#less-variables-section input").each(function(){$(this).val()&&(a[$(this).prev().text()]=$(this).val())});var b={vars:a,css:$("#less-section input:checked").map(function(){return this.value}).toArray(),js:$("#plugin-section input:checked").map(function(){return this.value}).toArray()};if(!$.isEmptyObject(b.vars)||b.css.length||b.js.length)return b}function f(){var b=c("id");b&&$.ajax({url:"https://api.github.com/gists/"+b,type:"GET",dataType:"json"}).success(function(a){var b=JSON.parse(a.files["config.json"].content);if(b.js&&$("#plugin-section input").each(function(){$(this).prop("checked",~$.inArray(this.value,b.js))}),b.css&&$("#less-section input").each(function(){$(this).prop("checked",~$.inArray(this.value,b.css))}),b.vars)for(var c in b.vars)$('input[data-var="'+c+'"]').val(b.vars[c])}).error(function(b){a("Error fetching bootstrap config file",b)})}function g(b,c,d,e,f){if(!b&&!c)return a("<strong>Ruh roh!</strong> No Bootstrap files selected.",new Error("no Bootstrap"));var g=new JSZip;if(b){var h=g.folder("css");for(var i in b)h.file(i,b[i])}if(c){var j=g.folder("js");for(var k in c)j.file(k,c[k])}if(d){var l=g.folder("fonts");for(var m in d)l.file(m,d[m],{base64:!0})}e&&g.file("config.json",e);var n=g.generate({type:"blob"});f(n)}function h(a){var b="";for(var c in a)b+=c+": "+a[c]+";\n";return b+"\n\n"}function i(){var a=$('#less-section [value="glyphicons.less"]:checked');return a.length?__fonts:void 0}function j(a){var b=/^@import \"(.*?)\";$/,c=__less[a].split("\n"),d=[];return $.each(c,function(a,c){var e=b.exec(c);if(e){var f=e[1],g=j(f);$.each(g,function(a,b){-1===$.inArray(b,d)&&d.push(b)}),d.push(f)}}),d}function k(a,b,c){var d=__less[a],e=j(a);return $.each(e,function(a,e){var f=b[e];(f||null==f)&&(d+=__less[e]),"variables.less"===e&&c&&(d+=h(c))}),d=d.replace(/@import[^\n]*/gi,"")}function l(b,c,d){var e=new less.Parser({paths:["variables.less","mixins.less"],optimization:0,filename:c+".css"});e.parse(b,function(b,e){return b?a("<strong>Ruh roh!</strong> Could not parse less files.",b):(d[c+".css"]=o+e.toCSS(),void(d[c+".min.css"]=o+e.toCSS({compress:!0})))})}function m(b){var c=!1,d={};if($("#less-section input").each(function(){var a=$(this),b=a.is(":checked");d[a.val()]=b,c=c||b}),!c)return!1;var e={},f={};$("#less-variables-section input").each(function(){$(this).val()&&(f[$(this).prev().text()]=$(this).val())});var g=b+k("bootstrap.less",d,f),h=b+k("theme.less",d,f);try{l(g,"bootstrap",e),l(h,"bootstrap-theme",e)}catch(i){return a("<strong>Ruh roh!</strong> Could not parse less files.",i)}return e}function n(a){var b=$("#plugin-section input:checked");if(!b.length)return!1;var c=b.map(function(){return __js[this.value]}).toArray().join("\n");return{"bootstrap.js":a+c,"bootstrap.min.js":a+o+uglify(c)}}var o="/*!\n * Bootstrap v3.1.1 (http://getbootstrap.com)\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n",p=$("#less-section input"),q=$("#plugin-section input"),r=$("#less-variables-section input");$("#less-section .toggle").on("click",function(a){a.preventDefault(),p.prop("checked",!p.is(":checked"))}),$("#plugin-section .toggle").on("click",function(a){a.preventDefault(),q.prop("checked",!q.is(":checked"))}),$("#less-variables-section .toggle").on("click",function(a){a.preventDefault(),r.val("")}),$("[data-dependencies]").on("click",function(){if($(this).is(":checked")){var a=this.getAttribute("data-dependencies");if(a){a=a.split(",");for(var b=0;b<a.length;b++){var c=$('[value="'+a[b]+'"]');c&&c.prop("checked",!0)}}}}),$("[data-dependents]").on("click",function(){if(!$(this).is(":checked")){var a=this.getAttribute("data-dependents");if(a){a=a.split(",");for(var b=0;b<a.length;b++){var c=$('[value="'+a[b]+'"]');c&&c.prop("checked",!1)}}}});var s=$("#btn-compile");s.on("click",function(a){var b=e(),c=JSON.stringify(b,null,2);a.preventDefault(),s.attr("disabled","disabled"),d(c,function(a,d){b.customizerUrl=d,c=JSON.stringify(b,null,2);var e="/*!\n * Generated using the Bootstrap Customizer ("+d+")\n * Config saved to config.json and "+a+"\n */\n";g(m(e),n(e),i(),c,function(a){s.removeAttr("disabled"),saveAs(a,"bootstrap.zip")})})}),function(){function a(){$(".bs-docs-section, .bs-docs-sidebar").css("display","none"),b('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second to <a href="http://browsehappy.com/">upgrade to a more modern browser</a> (other than Safari).',!0)}var c=window.webkitURL||window.URL,d=new Blob(["<svg xmlns='http://www.w3.org/2000/svg'></svg>"],{type:"image/svg+xml;charset=utf-8"}),e=c.createObjectURL(d);null===/^blob:/.exec(e)?a():$("<img>").on("load",function(){s.prop("disabled",!1)}).on("error",a).attr("src",e)}(),f()};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/assets/js/docs.min.js
+
1
-
1
View file @
ee2df11e
...
...
@@ -13,4 +13,4 @@ var Holder=Holder||{};!function(a,b){function c(a,b,c){b=parseInt(b,10),a=parseI
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
!
function
(
a
){
a
(
function
(){
if
(
navigator
.
userAgent
.
match
(
/IEMobile
\/
10
\.
0/
)){
var
b
=
document
.
createElement
(
"
style
"
);
b
.
appendChild
(
document
.
createTextNode
(
"
@-ms-viewport{width:auto!important}
"
)),
document
.
querySelector
(
"
head
"
).
appendChild
(
b
)}{
var
c
=
a
(
window
),
d
=
a
(
document
.
body
);
a
(
"
.navbar
"
).
outerHeight
(
!
0
)
+
10
}
d
.
scrollspy
({
target
:
"
.bs-docs-sidebar
"
}),
c
.
on
(
"
load
"
,
function
(){
d
.
scrollspy
(
"
refresh
"
)}),
a
(
"
.bs-docs-container [href=#]
"
).
click
(
function
(
a
){
a
.
preventDefault
()}),
setTimeout
(
function
(){
var
b
=
a
(
"
.bs-docs-sidebar
"
);
b
.
affix
({
offset
:{
top
:
function
(){
var
c
=
b
.
offset
().
top
,
d
=
parseInt
(
b
.
children
(
0
).
css
(
"
margin-top
"
),
10
),
e
=
a
(
"
.bs-docs-nav
"
).
height
();
return
this
.
top
=
c
-
e
-
d
},
bottom
:
function
(){
return
this
.
bottom
=
a
(
"
.bs-docs-footer
"
).
outerHeight
(
!
0
)}}})},
100
),
setTimeout
(
function
(){
a
(
"
.bs-top
"
).
affix
()},
100
),
a
(
"
.tooltip-demo
"
).
tooltip
({
selector
:
"
[data-toggle=tooltip]
"
,
container
:
"
body
"
}),
a
(
"
.tooltip-test
"
).
tooltip
(),
a
(
"
.popover-test
"
).
popover
(),
a
(
"
.bs-docs-navbar
"
).
tooltip
({
selector
:
"
a[data-toggle=tooltip]
"
,
container
:
"
.bs-docs-navbar .nav
"
}),
a
(
"
.bs-docs-popover
"
).
popover
(),
a
(
"
.bs-docs-popover-dismiss
"
).
popover
({
trigger
:
"
focus
"
}),
a
(
"
#loading-example-btn
"
).
click
(
function
(){
var
b
=
a
(
this
);
b
.
button
(
"
loading
"
),
setTimeout
(
function
(){
b
.
button
(
"
reset
"
)},
3
e3
)})})}(
jQuery
);
\ No newline at end of file
!
function
(
a
){
a
(
function
(){
if
(
navigator
.
userAgent
.
match
(
/IEMobile
\/
10
\.
0/
)){
var
b
=
document
.
createElement
(
"
style
"
);
b
.
appendChild
(
document
.
createTextNode
(
"
@-ms-viewport{width:auto!important}
"
)),
document
.
querySelector
(
"
head
"
).
appendChild
(
b
)}
var
c
=
a
(
window
),
d
=
a
(
document
.
body
);
d
.
scrollspy
({
target
:
"
.bs-docs-sidebar
"
}),
c
.
on
(
"
load
"
,
function
(){
d
.
scrollspy
(
"
refresh
"
)}),
a
(
"
.bs-docs-container [href=#]
"
).
click
(
function
(
a
){
a
.
preventDefault
()}),
setTimeout
(
function
(){
var
b
=
a
(
"
.bs-docs-sidebar
"
);
b
.
affix
({
offset
:{
top
:
function
(){
var
c
=
b
.
offset
().
top
,
d
=
parseInt
(
b
.
children
(
0
).
css
(
"
margin-top
"
),
10
),
e
=
a
(
"
.bs-docs-nav
"
).
height
();
return
this
.
top
=
c
-
e
-
d
},
bottom
:
function
(){
return
this
.
bottom
=
a
(
"
.bs-docs-footer
"
).
outerHeight
(
!
0
)}}})},
100
),
setTimeout
(
function
(){
a
(
"
.bs-top
"
).
affix
()},
100
),
a
(
"
.tooltip-demo
"
).
tooltip
({
selector
:
"
[data-toggle=tooltip]
"
,
container
:
"
body
"
}),
a
(
"
.tooltip-test
"
).
tooltip
(),
a
(
"
.popover-test
"
).
popover
(),
a
(
"
.bs-docs-navbar
"
).
tooltip
({
selector
:
"
a[data-toggle=tooltip]
"
,
container
:
"
.bs-docs-navbar .nav
"
}),
a
(
"
.bs-docs-popover
"
).
popover
(),
a
(
"
.bs-docs-popover-dismiss
"
).
popover
({
trigger
:
"
focus
"
}),
a
(
"
#loading-example-btn
"
).
click
(
function
(){
var
b
=
a
(
this
);
b
.
button
(
"
loading
"
),
setTimeout
(
function
(){
b
.
button
(
"
reset
"
)},
3
e3
)})})}(
jQuery
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/dist/js/bootstrap.min.js
+
1
-
1
View file @
ee2df11e
This diff is collapsed.
Click to expand it.
grunt/.jshintrc
+
2
-
1
View file @
ee2df11e
...
...
@@ -6,5 +6,6 @@
"node" : true,
"nonbsp": true,
"strict": true,
"undef" : true
"undef" : true,
"unused": true
}
This diff is collapsed.
Click to expand it.
js/.jshintrc
+
1
-
0
View file @
ee2df11e
...
...
@@ -8,5 +8,6 @@
"eqnull" : true,
"expr" : true,
"laxbreak" : true,
"unused" : true,
"validthis": true
}
This diff is collapsed.
Click to expand it.
js/scrollspy.js
+
2
-
1
View file @
ee2df11e
...
...
@@ -43,7 +43,8 @@
this
.
targets
=
$
([])
var
self
=
this
var
$targets
=
this
.
$body
this
.
$body
.
find
(
this
.
selector
)
.
map
(
function
()
{
var
$el
=
$
(
this
)
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/affix.js
+
3
-
3
View file @
ee2df11e
...
...
@@ -28,14 +28,14 @@ $(function () {
var
template
=
$
(
'
<div id="affixTarget"><ul><li>Please affix</li><li>And unaffix</li></ul></div><div id="affixAfter" style="height: 20000px; display:block;"></div>
'
)
template
.
appendTo
(
'
body
'
)
var
affixer
=
$
(
'
#affixTarget
'
).
affix
({
$
(
'
#affixTarget
'
).
affix
({
offset
:
$
(
'
#affixTarget ul
'
).
position
()
})
$
(
'
#affixTarget
'
)
.
on
(
'
affix.bs.affix
'
,
function
(
e
)
{
.
on
(
'
affix.bs.affix
'
,
function
()
{
ok
(
true
,
'
affix event triggered
'
)
}).
on
(
'
affixed.bs.affix
'
,
function
(
e
)
{
}).
on
(
'
affixed.bs.affix
'
,
function
()
{
ok
(
true
,
'
affixed event triggered
'
)
$
(
'
#affixTarget
'
).
remove
()
$
(
'
#affixAfter
'
).
remove
()
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/button.js
+
0
-
1
View file @
ee2df11e
...
...
@@ -98,7 +98,6 @@ $(function () {
var
btn1
=
$
(
group
.
children
()[
0
])
var
btn2
=
$
(
group
.
children
()[
1
])
var
btn3
=
$
(
group
.
children
()[
2
])
group
.
appendTo
(
$
(
'
#qunit-fixture
'
))
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/collapse.js
+
8
-
8
View file @
ee2df11e
...
...
@@ -64,7 +64,7 @@ $(function () {
var
target
=
$
(
'
<a data-toggle="collapse" href="#test1"></a>
'
)
.
appendTo
(
$
(
'
#qunit-fixture
'
))
var
collapsible
=
$
(
'
<div id="test1"></div>
'
)
$
(
'
<div id="test1"></div>
'
)
.
appendTo
(
$
(
'
#qunit-fixture
'
))
.
on
(
'
show.bs.collapse
'
,
function
()
{
ok
(
!
target
.
hasClass
(
'
collapsed
'
))
...
...
@@ -81,7 +81,7 @@ $(function () {
var
target
=
$
(
'
<a data-toggle="collapse" href="#test1"></a>
'
)
.
appendTo
(
$
(
'
#qunit-fixture
'
))
var
collapsible
=
$
(
'
<div id="test1" class="in"></div>
'
)
$
(
'
<div id="test1" class="in"></div>
'
)
.
appendTo
(
$
(
'
#qunit-fixture
'
))
.
on
(
'
hide.bs.collapse
'
,
function
()
{
ok
(
target
.
hasClass
(
'
collapsed
'
))
...
...
@@ -101,19 +101,19 @@ $(function () {
var
target1
=
$
(
'
<a data-toggle="collapse" href="#body1" data-parent="#accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
0
))
var
collapsible1
=
$
(
'
<div id="body1" class="in"></div>
'
)
$
(
'
<div id="body1" class="in"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
0
))
var
target2
=
$
(
'
<a class="collapsed" data-toggle="collapse" href="#body2" data-parent="#accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
1
))
var
collapsible2
=
$
(
'
<div id="body2"></div>
'
)
$
(
'
<div id="body2"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
1
))
var
target3
=
$
(
'
<a class="collapsed" data-toggle="collapse" href="#body3" data-parent="#accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
2
))
var
collapsible3
=
$
(
'
<div id="body3"></div>
'
)
$
(
'
<div id="body3"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
2
))
.
on
(
'
show.bs.collapse
'
,
function
()
{
ok
(
target1
.
hasClass
(
'
collapsed
'
))
...
...
@@ -136,19 +136,19 @@ $(function () {
var
target1
=
$
(
'
<a data-toggle="collapse" href="#body1" data-parent=".accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
0
))
var
collapsible1
=
$
(
'
<div id="body1" class="in"></div>
'
)
$
(
'
<div id="body1" class="in"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
0
))
var
target2
=
$
(
'
<a class="collapsed" data-toggle="collapse" href="#body2" data-parent=".accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
1
))
var
collapsible2
=
$
(
'
<div id="body2"></div>
'
)
$
(
'
<div id="body2"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
1
))
var
target3
=
$
(
'
<a class="collapsed" data-toggle="collapse" href="#body3" data-parent=".accordion"></a>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
2
))
var
collapsible3
=
$
(
'
<div id="body3"></div>
'
)
$
(
'
<div id="body3"></div>
'
)
.
appendTo
(
accordion
.
find
(
'
.accordion-group
'
).
eq
(
2
))
.
on
(
'
show.bs.collapse
'
,
function
()
{
ok
(
target1
.
hasClass
(
'
collapsed
'
))
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/scrollspy.js
+
1
-
1
View file @
ee2df11e
...
...
@@ -18,7 +18,6 @@ $(function () {
test
(
'
should switch active class on scroll
'
,
function
()
{
var
sectionHTML
=
'
<div id="masthead"></div>
'
,
$section
=
$
(
sectionHTML
).
append
(
'
#qunit-fixture
'
),
topbarHTML
=
'
<div class="topbar">
'
+
'
<div class="topbar-inner">
'
+
'
<div class="container">
'
+
...
...
@@ -30,6 +29,7 @@ $(function () {
'
</div>
'
,
$topbar
=
$
(
topbarHTML
).
scrollspy
()
$
(
sectionHTML
).
append
(
'
#qunit-fixture
'
)
ok
(
$topbar
.
find
(
'
.active
'
,
true
))
})
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/tooltip.js
+
10
-
10
View file @
ee2df11e
...
...
@@ -68,7 +68,7 @@ $(function () {
test
(
'
should fire show event
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
show.bs.tooltip
'
,
function
()
{
ok
(
true
,
'
show was called
'
)
start
()
...
...
@@ -78,7 +78,7 @@ $(function () {
test
(
'
should fire shown event
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
shown.bs.tooltip
'
,
function
()
{
ok
(
true
,
'
shown was called
'
)
start
()
...
...
@@ -88,7 +88,7 @@ $(function () {
test
(
'
should not fire shown event when default prevented
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
show.bs.tooltip
'
,
function
(
e
)
{
e
.
preventDefault
()
ok
(
true
,
'
show was called
'
)
...
...
@@ -102,7 +102,7 @@ $(function () {
test
(
'
should fire hide event
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
shown.bs.tooltip
'
,
function
()
{
$
(
this
).
tooltip
(
'
hide
'
)
})
...
...
@@ -115,7 +115,7 @@ $(function () {
test
(
'
should fire hidden event
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
shown.bs.tooltip
'
,
function
()
{
$
(
this
).
tooltip
(
'
hide
'
)
})
...
...
@@ -128,7 +128,7 @@ $(function () {
test
(
'
should not fire hidden event when default prevented
'
,
function
()
{
stop
()
var
tooltip
=
$
(
'
<div title="tooltip title"></div>
'
)
$
(
'
<div title="tooltip title"></div>
'
)
.
on
(
'
shown.bs.tooltip
'
,
function
()
{
$
(
this
).
tooltip
(
'
hide
'
)
})
...
...
@@ -272,14 +272,14 @@ $(function () {
test
(
'
should show tooltip with delegate selector on click
'
,
function
()
{
var
div
=
$
(
'
<div><a href="#" rel="tooltip" title="Another tooltip"></a></div>
'
)
var
tooltip
=
div
.
appendTo
(
'
#qunit-fixture
'
)
div
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
selector
:
'
a[rel=tooltip]
'
,
trigger
:
'
click
'
})
div
.
find
(
'
a
'
).
trigger
(
'
click
'
)
ok
(
$
(
'
.tooltip
'
).
is
(
'
.fade.in
'
),
'
tooltip is faded in
'
)
})
test
(
'
should show tooltip when toggle is called
'
,
function
()
{
var
tooltip
=
$
(
'
<a href="#" rel="tooltip" title="tooltip on toggle"></a>
'
)
$
(
'
<a href="#" rel="tooltip" title="tooltip on toggle"></a>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
tooltip
({
trigger
:
'
manual
'
})
.
tooltip
(
'
toggle
'
)
...
...
@@ -298,8 +298,8 @@ $(function () {
test
(
'
should place tooltip inside window
'
,
function
()
{
var
container
=
$
(
'
<div />
'
).
appendTo
(
'
body
'
)
.
css
({
position
:
'
absolute
'
,
width
:
200
,
height
:
200
,
bottom
:
0
,
left
:
0
})
,
tooltip
=
$
(
'
<a href="#" title="Very very very very very very very very long tooltip">Hover me</a>
'
)
.
css
({
position
:
'
absolute
'
,
width
:
200
,
height
:
200
,
bottom
:
0
,
left
:
0
})
$
(
'
<a href="#" title="Very very very very very very very very long tooltip">Hover me</a>
'
)
.
css
({
position
:
'
absolute
'
,
top
:
0
,
left
:
0
})
.
appendTo
(
container
)
.
tooltip
({
placement
:
'
top
'
,
animate
:
false
})
...
...
This diff is collapsed.
Click to expand it.
js/tooltip.js
+
0
-
1
View file @
ee2df11e
...
...
@@ -195,7 +195,6 @@
}
Tooltip
.
prototype
.
applyPlacement
=
function
(
offset
,
placement
)
{
var
replace
var
$tip
=
this
.
tip
()
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment