mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
remove inside support from tooltip + fix tooltip svg support + change makefile to rely on local npm install
This commit is contained in:
parent
529ecc5a77
commit
5bd8cdca91
20
Makefile
20
Makefile
@ -18,8 +18,8 @@ build:
|
|||||||
@jshint js/*.js --config js/.jshintrc
|
@jshint js/*.js --config js/.jshintrc
|
||||||
@jshint js/tests/unit/*.js --config js/.jshintrc
|
@jshint js/tests/unit/*.js --config js/.jshintrc
|
||||||
@echo "Running JSHint on javascript... ${CHECK} Done"
|
@echo "Running JSHint on javascript... ${CHECK} Done"
|
||||||
@recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
|
@./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
|
||||||
@recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
|
@./node_modules/.bin/recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
|
||||||
@echo "Compiling LESS with Recess... ${CHECK} Done"
|
@echo "Compiling LESS with Recess... ${CHECK} Done"
|
||||||
@node docs/build
|
@node docs/build
|
||||||
@cp img/* docs/assets/img/
|
@cp img/* docs/assets/img/
|
||||||
@ -27,7 +27,7 @@ build:
|
|||||||
@cp js/tests/vendor/jquery.js docs/assets/js/
|
@cp js/tests/vendor/jquery.js docs/assets/js/
|
||||||
@echo "Compiling documentation... ${CHECK} Done"
|
@echo "Compiling documentation... ${CHECK} Done"
|
||||||
@cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js
|
@cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js
|
||||||
@uglifyjs docs/assets/js/bootstrap.js -nc > docs/assets/js/bootstrap.min.tmp.js
|
@./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js
|
||||||
@echo "/**\n* Bootstrap.js v2.2.3 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
|
@echo "/**\n* Bootstrap.js v2.2.3 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
|
||||||
@cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
|
@cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
|
||||||
@rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js
|
@rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js
|
||||||
@ -43,8 +43,8 @@ build:
|
|||||||
#
|
#
|
||||||
|
|
||||||
test:
|
test:
|
||||||
jshint js/*.js --config js/.jshintrc
|
./node_modules/.bin/jshint js/*.js --config js/.jshintrc
|
||||||
jshint js/tests/unit/*.js --config js/.jshintrc
|
./node_modules/.bin/jshint js/tests/unit/*.js --config js/.jshintrc
|
||||||
node js/tests/server.js &
|
node js/tests/server.js &
|
||||||
phantomjs js/tests/phantom.js "http://localhost:3000/js/tests"
|
phantomjs js/tests/phantom.js "http://localhost:3000/js/tests"
|
||||||
kill -9 `cat js/tests/pid.txt`
|
kill -9 `cat js/tests/pid.txt`
|
||||||
@ -67,12 +67,12 @@ bootstrap:
|
|||||||
mkdir -p bootstrap/css
|
mkdir -p bootstrap/css
|
||||||
mkdir -p bootstrap/js
|
mkdir -p bootstrap/js
|
||||||
cp img/* bootstrap/img/
|
cp img/* bootstrap/img/
|
||||||
recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
|
./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
|
||||||
recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
|
./node_modules/.bin/recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
|
||||||
recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
|
./node_modules/.bin/recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
|
||||||
recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
|
./node_modules/.bin/recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
|
||||||
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js
|
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js
|
||||||
uglifyjs bootstrap/js/bootstrap.js -nc > bootstrap/js/bootstrap.min.tmp.js
|
./node_modules/.bin/uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
||||||
echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
||||||
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
|
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
|
||||||
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
|
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
|
||||||
|
18
docs/assets/js/bootstrap-tooltip.js
vendored
18
docs/assets/js/bootstrap-tooltip.js
vendored
@ -97,7 +97,6 @@
|
|||||||
|
|
||||||
, show: function () {
|
, show: function () {
|
||||||
var $tip
|
var $tip
|
||||||
, inside
|
|
||||||
, pos
|
, pos
|
||||||
, actualWidth
|
, actualWidth
|
||||||
, actualHeight
|
, actualHeight
|
||||||
@ -116,19 +115,17 @@
|
|||||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
this.options.placement
|
this.options.placement
|
||||||
|
|
||||||
inside = /in/.test(placement)
|
|
||||||
|
|
||||||
$tip
|
$tip
|
||||||
.detach()
|
.detach()
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
.insertAfter(this.$element)
|
.insertAfter(this.$element)
|
||||||
|
|
||||||
pos = this.getPosition(inside)
|
pos = this.getPosition()
|
||||||
|
|
||||||
actualWidth = $tip[0].offsetWidth
|
actualWidth = $tip[0].offsetWidth
|
||||||
actualHeight = $tip[0].offsetHeight
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
switch (inside ? placement.split(' ')[1] : placement) {
|
switch (placement) {
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||||
break
|
break
|
||||||
@ -193,11 +190,12 @@
|
|||||||
return this.getTitle()
|
return this.getTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
, getPosition: function (inside) {
|
, getPosition: function () {
|
||||||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
var el = this.$element[0]
|
||||||
width: this.$element[0].offsetWidth
|
return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
||||||
, height: this.$element[0].offsetHeight
|
width: el.offsetWidth
|
||||||
})
|
, height: el.offsetHeight
|
||||||
|
}, this.$element.offset())
|
||||||
}
|
}
|
||||||
|
|
||||||
, getTitle: function () {
|
, getTitle: function () {
|
||||||
|
18
docs/assets/js/bootstrap.js
vendored
18
docs/assets/js/bootstrap.js
vendored
@ -1113,7 +1113,6 @@
|
|||||||
|
|
||||||
, show: function () {
|
, show: function () {
|
||||||
var $tip
|
var $tip
|
||||||
, inside
|
|
||||||
, pos
|
, pos
|
||||||
, actualWidth
|
, actualWidth
|
||||||
, actualHeight
|
, actualHeight
|
||||||
@ -1132,19 +1131,17 @@
|
|||||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
this.options.placement
|
this.options.placement
|
||||||
|
|
||||||
inside = /in/.test(placement)
|
|
||||||
|
|
||||||
$tip
|
$tip
|
||||||
.detach()
|
.detach()
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
.insertAfter(this.$element)
|
.insertAfter(this.$element)
|
||||||
|
|
||||||
pos = this.getPosition(inside)
|
pos = this.getPosition()
|
||||||
|
|
||||||
actualWidth = $tip[0].offsetWidth
|
actualWidth = $tip[0].offsetWidth
|
||||||
actualHeight = $tip[0].offsetHeight
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
switch (inside ? placement.split(' ')[1] : placement) {
|
switch (placement) {
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||||
break
|
break
|
||||||
@ -1209,11 +1206,12 @@
|
|||||||
return this.getTitle()
|
return this.getTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
, getPosition: function (inside) {
|
, getPosition: function () {
|
||||||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
var el = this.$element[0]
|
||||||
width: this.$element[0].offsetWidth
|
return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
||||||
, height: this.$element[0].offsetHeight
|
width: el.offsetWidth
|
||||||
})
|
, height: el.offsetHeight
|
||||||
|
}, this.$element.offset())
|
||||||
}
|
}
|
||||||
|
|
||||||
, getTitle: function () {
|
, getTitle: function () {
|
||||||
|
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
18
js/bootstrap-tooltip.js
vendored
18
js/bootstrap-tooltip.js
vendored
@ -97,7 +97,6 @@
|
|||||||
|
|
||||||
, show: function () {
|
, show: function () {
|
||||||
var $tip
|
var $tip
|
||||||
, inside
|
|
||||||
, pos
|
, pos
|
||||||
, actualWidth
|
, actualWidth
|
||||||
, actualHeight
|
, actualHeight
|
||||||
@ -116,19 +115,17 @@
|
|||||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
this.options.placement
|
this.options.placement
|
||||||
|
|
||||||
inside = /in/.test(placement)
|
|
||||||
|
|
||||||
$tip
|
$tip
|
||||||
.detach()
|
.detach()
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
.insertAfter(this.$element)
|
.insertAfter(this.$element)
|
||||||
|
|
||||||
pos = this.getPosition(inside)
|
pos = this.getPosition()
|
||||||
|
|
||||||
actualWidth = $tip[0].offsetWidth
|
actualWidth = $tip[0].offsetWidth
|
||||||
actualHeight = $tip[0].offsetHeight
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
switch (inside ? placement.split(' ')[1] : placement) {
|
switch (placement) {
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||||
break
|
break
|
||||||
@ -193,11 +190,12 @@
|
|||||||
return this.getTitle()
|
return this.getTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
, getPosition: function (inside) {
|
, getPosition: function () {
|
||||||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
var el = this.$element[0]
|
||||||
width: this.$element[0].offsetWidth
|
return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : {
|
||||||
, height: this.$element[0].offsetHeight
|
width: el.offsetWidth
|
||||||
})
|
, height: el.offsetHeight
|
||||||
|
}, this.$element.offset())
|
||||||
}
|
}
|
||||||
|
|
||||||
, getTitle: function () {
|
, getTitle: function () {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
, "devDependencies": {
|
, "devDependencies": {
|
||||||
"uglify-js": "1.2.6"
|
"uglify-js": "1.3.4"
|
||||||
, "jshint": "0.6.1"
|
, "jshint": "0.6.1"
|
||||||
, "recess": "1.0.3"
|
, "recess": "1.0.3"
|
||||||
, "connect": "2.1.3"
|
, "connect": "2.1.3"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user