Compare commits

...

10 Commits

Author SHA1 Message Date
Arnold Daniels
d5d4c5bd62 Build Bootstrap v3.1.1 2014-03-28 03:46:35 +01:00
Arnold Daniels
626d773366 stop propagation for file input, input element. Fixes #182 2014-03-28 03:25:36 +01:00
Arnold Daniels
a8a87b1958 Use var files instead of setting e.target.files for file input. Fixes #163 (thanks to @ducman) 2014-03-28 02:50:53 +01:00
Arnold Daniels
3769a8a8fc Don't transform .btn-file > input for Firefox and do set width and height to 100%. Fixes #157 2014-03-28 02:39:14 +01:00
Arnold Daniels
1640650604 Only preview gif, png and jpeg images. Fixes #181 2014-03-28 01:04:48 +01:00
Arnold Daniels
4c53740597 Merge origin/master 2014-03-28 00:24:56 +01:00
Arnold Daniels
ca1145ca0b Don't trigger rowlink initiasation when a element within .rowlink-skip is clicked. Fixes #162 2014-03-28 00:22:10 +01:00
Arnold Daniels
d87bea51c2 Added docs task to gruntfile 2014-03-27 22:40:54 +01:00
Arnold Daniels
e9a6df2cbd Merge pull request #206 from wardley/master
allow vertical scroll for navmenu-fixed-left.
2014-03-27 11:32:22 +01:00
Wardley Pogijanto
90b09cb3f8 allow vertical scroll for navmenu-fixed-left.
[jasny/boostrap#202]
2014-03-27 14:01:13 +11:00
18 changed files with 150 additions and 89 deletions

View File

@@ -371,6 +371,9 @@ module.exports = function (grunt) {
// Default task.
grunt.registerTask('default', ['dist', 'build-customizer']);
// Documentation task.
grunt.registerTask('docs', ['jekyll', 'dist-docs']);
// Version numbering task.
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
// This can be overzealous, so its changes should always be manually reviewed!
@@ -385,6 +388,6 @@ module.exports = function (grunt) {
});
// Task for updating the npm packages used by the Travis build.
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', 'update-shrinkwrap']);
grunt.registerTask('update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
};

View File

@@ -19,13 +19,13 @@ exclude:
- "vendor"
# Custom vars
current_version: 3.1.0
current_version: 3.1.1
repo: https://github.com/jasny/bootstrap
download:
source: https://github.com/jasny/bootstrap/archive/v3.1.0.zip
dist: https://github.com/jasny/bootstrap/releases/download/v3.1.0/jasny-bootstrap-3.1.0-dist.zip
source: https://github.com/jasny/bootstrap/archive/v3.1.1.zip
dist: https://github.com/jasny/bootstrap/releases/download/v3.1.1/jasny-bootstrap-3.1.1-dist.zip
cdn:
css: //cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.0/css/jasny-bootstrap.min.css
js: //cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.0/js/jasny-bootstrap.min.js
css: //cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.1/css/jasny-bootstrap.min.css
js: //cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.1/js/jasny-bootstrap.min.js

View File

@@ -1,6 +1,6 @@
{
"name": "jasny-bootstrap",
"version": "3.1.0",
"version": "3.1.1",
"main": [
"./dist/css/jasny-bootstrap.css",
"./dist/js/jasny-bootstrap.js"

View File

@@ -1,12 +1,15 @@
/*!
* Jasny Bootstrap v3.1.0 (http://jasny.github.io/bootstrap)
* Jasny Bootstrap v3.1.1 (http://jasny.github.io/bootstrap)
* Copyright 2012-2014 Arnold Daniels
* Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
*/
.container-smooth {
max-width: 1170px;
}
@media (min-width: 1px) {
.container-smooth {
max-width: 1170px;
width: auto;
}
}
.btn-labeled {
@@ -151,12 +154,17 @@
border-radius: 0;
}
.navmenu-fixed-left,
.navbar-offcanvas {
.navbar-offcanvas.navmenu-fixed-left {
right: auto;
bottom: 0;
left: 0;
overflow-y: auto;
border-width: 0 1px 0 0;
}
.navmenu-fixed-right {
.navmenu-fixed-right,
.navbar-offcanvas {
right: 0;
left: auto;
border-width: 0 0 0 1px;
}
.navmenu-nav {
@@ -515,16 +523,23 @@
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
margin: 0;
font-size: 23px;
cursor: pointer;
filter: alpha(opacity=0);
opacity: 0;
transform: translate(-300px, 0) scale(4);
-webkit-transform: translate(-300px, 0) scale(4);
transform: translate(-300px, 0) scale(4);
direction: ltr;
}
@-moz-document url-prefix() {
.btn-file > input {
transform: none;
}
}
.fileinput {
display: inline-block;
margin-bottom: 9px;
@@ -565,13 +580,20 @@
.form-control .fileinput-filename {
vertical-align: bottom;
}
.fileinput.input-group {
display: table;
}
.fileinput-new.input-group .btn-file,
.fileinput-new .input-group .btn-file {
border-radius: 0 4px 4px 0;
}
.fileinput-new.input-group .btn-file.btn-xs,
.fileinput-new .input-group .btn-file.btn-xs,
.fileinput-new.input-group .btn-file.btn-sm,
.fileinput-new .input-group .btn-file.btn-sm {
border-radius: 0 3px 3px 0;
}
.fileinput-new.input-group .btn-file.btn-lg,
.fileinput-new .input-group .btn-file.btn-lg {
border-radius: 0 6px 6px 0;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
/*!
* Jasny Bootstrap v3.1.0 (http://jasny.github.io/bootstrap)
* Jasny Bootstrap v3.1.1 (http://jasny.github.io/bootstrap)
* Copyright 2012-2014 Arnold Daniels
* Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
*/
@@ -7,10 +7,8 @@
if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScript requires jQuery') }
/* ========================================================================
* Bootstrap: offcanvas.js v3.1.0
* Bootstrap: offcanvas.js v3.1.1
* http://jasny.github.io/bootstrap/javascript/#offcanvas
*
* Based on Boostrap collapse.js by Twitter, Inc.
* ========================================================================
* Copyright 2013-2014 Arnold Daniels
*
@@ -36,6 +34,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
this.$element = $(element)
this.options = $.extend({}, OffCanvas.DEFAULTS, options)
this.state = null
this.placement = null
if (this.options.recalc) {
this.calcClone()
@@ -50,13 +49,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
OffCanvas.DEFAULTS = {
toggle: true,
placement: 'left',
placement: 'auto',
autohide: true,
recalc: true
recalc: true,
disableScrolling: true
}
OffCanvas.prototype.offset = function () {
switch (this.options.placement) {
switch (this.placement) {
case 'left':
case 'right': return this.$element.outerWidth()
case 'top':
@@ -65,26 +65,31 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}
OffCanvas.prototype.calcPlacement = function () {
var horizontal = $(window).width() / this.$element.width(),
vertical = $(window).height() / this.$element.height()
if (this.options.placement !== 'auto') {
this.placement = this.options.placement
return
}
if (!this.$element.hasClass('in')) {
this.$element.css('visiblity', 'hidden !important').addClass('in')
}
var horizontal = $(window).width() / this.$element.width()
var vertical = $(window).height() / this.$element.height()
var element = this.$element
function ab(a, b) {
if (element.css(b) === 'auto') return a
if (element.css(a) === 'auto') return b
var size_a = parseInt(element.css(a), 10),
size_b = parseInt(element.css(b), 10)
var size_a = parseInt(element.css(a), 10)
var size_b = parseInt(element.css(b), 10)
return size_a > size_b ? b : a
}
this.options.placement = horizontal > vertical ? ab('left', 'right') : ab('top', 'bottom')
this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom')
if (this.$element.css('visibility') === 'hidden !important') {
this.$element.removeClass('in').css('visiblity', '')
}
@@ -114,12 +119,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
// Use jQuery animation if CSS transitions aren't supported
if (!$.support.transition) {
var anim = {}
anim[this.options.placement] = "+=" + offset
anim[this.placement] = "+=" + offset
return elements.animate(anim, 350, callback)
}
var placement = this.options.placement,
opposite = this.opposite(placement)
var placement = this.placement
var opposite = this.opposite(placement)
elements.each(function() {
if ($(this).css(placement) !== 'auto')
@@ -136,7 +141,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
OffCanvas.prototype.disableScrolling = function() {
var bodyWidth = $('body').width()
var prop = 'padding-' + this.opposite(this.options.placement)
var prop = 'padding-' + this.opposite(this.placement)
if ($('body').data('offcanvas-style') === undefined) $('body').data('offcanvas-style', $('body').attr('style'))
@@ -158,17 +163,22 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
if (this.options.placement === 'auto') this.calcPlacement()
this.state = 'sliding'
this.state = 'slide-in'
this.calcPlacement();
var elements = this.getCanvasElements()
var offset = this.offset(),
placement = this.options.placement,
opposite = this.opposite(placement)
var placement = this.placement
var opposite = this.opposite(placement)
var offset = this.offset()
if (elements.index(this.$element) !== -1) {
$(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '')
this.$element.css(placement, -1 * offset)
this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code
}
elements.addClass('canvas-sliding').each(function() {
$(this).data('offcanvas-style', $(this).attr('style') || '')
if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '')
if ($(this).css('position') === 'static') $(this).css('position', 'relative')
if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') &&
($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) {
@@ -176,11 +186,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}
})
if (elements.index(this.$element) !== -1) this.$element.css(placement, -1 * offset)
this.disableScrolling()
if (this.options.disableScrolling) this.disableScrolling()
var complete = function () {
if (this.state != 'slide-in') return
this.state = 'slid'
elements.removeClass('canvas-sliding').addClass('canvas-slid')
@@ -200,18 +210,22 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
this.state = 'sliding'
this.state = 'slide-out'
var elements = $('.canvas-slid')
var placement = this.placement
var offset = -1 * this.offset()
var complete = function () {
if (this.state != 'slide-out') return
this.state = null
this.placement = null
this.$element.removeClass('in')
elements.removeClass('canvas-sliding')
elements.add('body').each(function() {
elements.add(this.$element).add('body').each(function() {
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
})
@@ -226,7 +240,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}
OffCanvas.prototype.toggle = function () {
if (this.state === 'sliding') return
if (this.state === 'slide-in' || this.state === 'slide-out') return
this[this.state === 'slid' ? 'hide' : 'show']()
}
@@ -238,17 +252,18 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}
OffCanvas.prototype.recalc = function () {
if (this.state() !== 'slid' || this.$calcClone.css('display') === 'none') return
if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return
var offset = -1 * this.offset()
this.state = null
this.placement = null
var elements = this.getCanvasElements()
var placement = this.options.placement
this.getCanvasElements().each(function() {
$(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset)
}).removeClass('canvas-slid')
this.$element.removeClass('in')
$('body').css('overflow', '')
this.$element.css(placement, '').removeClass('in canvas-slid')
elements.removeClass('canvas-slid')
elements.add(this.$element).add('body').each(function() {
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
})
}
OffCanvas.prototype.autohide = function (e) {
@@ -264,10 +279,10 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.offcanvas')
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option == 'object' && option)
var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option)
if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options)))
if (typeof option == 'string') data[option]()
if (typeof option === 'string') data[option]()
})
}
@@ -304,7 +319,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}(window.jQuery);
/* ============================================================
* Bootstrap: rowlink.js v3.1.0
* Bootstrap: rowlink.js v3.1.1
* http://jasny.github.io/bootstrap/javascript/#rowlink
* ============================================================
* Copyright 2012-2014 Arnold Daniels
@@ -380,6 +395,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
// ==================
$(document).on('click.bs.rowlink.data-api', '[data-link="row"]', function (e) {
if ($(e.target).closest('.rowlink-skip')) return
var $this = $(this)
if ($this.data('rowlink')) return
$this.rowlink($this.data())
@@ -750,7 +767,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
}(window.jQuery);
/* ===========================================================
* Bootstrap: fileinput.js v3.1.0
* Bootstrap: fileinput.js v3.1.1
* http://jasny.github.com/bootstrap/javascript/#fileinput
* ===========================================================
* Copyright 2012-2014 Arnold Daniels
@@ -811,24 +828,30 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
},
Fileinput.prototype.change = function(e) {
if (e.target.files === undefined) e.target.files = e.target && e.target.value ? [ {name: e.target.value.replace(/^.+\\/, '')} ] : []
if (e.target.files.length === 0) return
var files = e.target.files === undefined ? (e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '')}] : []) : e.target.files
e.stopPropagation()
if (files.length === 0) {
this.clear()
return
}
this.$hidden.val('')
this.$hidden.attr('name', '')
this.$input.attr('name', this.name)
var file = e.target.files[0]
var file = files[0]
if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match('image.*') : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") {
if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") {
var reader = new FileReader()
var preview = this.$preview
var element = this.$element
reader.onload = function(re) {
var $img = $('<img>') // .attr('src', re.target.result)
var $img = $('<img>')
$img[0].src = re.target.result
e.target.files[0].result = re.target.result
files[0].result = re.target.result
element.find('.fileinput-filename').text(file.name)
@@ -838,7 +861,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr
preview.html($img)
element.addClass('fileinput-exists').removeClass('fileinput-new')
element.trigger('change.bs.fileinput', e.target.files)
element.trigger('change.bs.fileinput', files)
}
reader.readAsDataURL(file)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -60,9 +60,11 @@
},
Fileinput.prototype.change = function(e) {
if (e.target.files === undefined) e.target.files = e.target && e.target.value ? [ {name: e.target.value.replace(/^.+\\/, '')} ] : []
var files = e.target.files === undefined ? (e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '')}] : []) : e.target.files
e.stopPropagation()
if (e.target.files.length === 0) {
if (files.length === 0) {
this.clear()
return
}
@@ -71,17 +73,17 @@
this.$hidden.attr('name', '')
this.$input.attr('name', this.name)
var file = e.target.files[0]
var file = files[0]
if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match('image.*') : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") {
if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") {
var reader = new FileReader()
var preview = this.$preview
var element = this.$element
reader.onload = function(re) {
var $img = $('<img>') // .attr('src', re.target.result)
var $img = $('<img>')
$img[0].src = re.target.result
e.target.files[0].result = re.target.result
files[0].result = re.target.result
element.find('.fileinput-filename').text(file.name)
@@ -91,7 +93,7 @@
preview.html($img)
element.addClass('fileinput-exists').removeClass('fileinput-new')
element.trigger('change.bs.fileinput', e.target.files)
element.trigger('change.bs.fileinput', files)
}
reader.readAsDataURL(file)

View File

@@ -1,5 +1,5 @@
/* ============================================================
* Bootstrap: rowlink.js v3.1.0
* Bootstrap: rowlink.js v3.1.1
* http://jasny.github.io/bootstrap/javascript/#rowlink
* ============================================================
* Copyright 2012-2014 Arnold Daniels
@@ -75,6 +75,8 @@
// ==================
$(document).on('click.bs.rowlink.data-api', '[data-link="row"]', function (e) {
if ($(e.target).closest('.rowlink-skip')) return
var $this = $(this)
if ($this.data('rowlink')) return
$this.rowlink($this.data())

View File

@@ -17,11 +17,18 @@
-webkit-transform: translate(-300px, 0) scale(4);
font-size: 23px;
height: 100%;
width: 100%;
direction: ltr;
cursor: pointer;
}
}
@-moz-document url-prefix() {
.btn-file > input {
transform: none;
}
}
.fileinput {
margin-bottom: 9px;
display: inline-block;

View File

@@ -30,6 +30,8 @@
left: 0;
right: auto;
border-width: 0 1px 0 0;
bottom: 0;
overflow-y: auto;
}
.navmenu-fixed-right,
.navbar-offcanvas {

File diff suppressed because one or more lines are too long