1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 13:29:06 +02:00

a bunch javascript junk

This commit is contained in:
fat
2013-05-16 11:06:30 -07:00
parent 509f2244da
commit 14651035de
137 changed files with 24057 additions and 1221 deletions

View File

@@ -1,8 +1,8 @@
/* ==========================================================
* bootstrap-alert.js v3.0.0
* alert.js v3.0.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,45 +18,41 @@
* ========================================================== */
!function ($) {
!function ($) { "use strict";
"use strict"; // jshint ;_;
/* ALERT CLASS DEFINITION
* ====================== */
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
, Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.prototype.close = function (e) {
var $this = $(this)
, selector = $this.attr('data-target')
, $parent
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
$parent = $(selector)
var $parent = $(selector)
e && e.preventDefault()
if (e) e.preventDefault()
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
if (!$parent.length) {
$parent = $this.hasClass('alert') ? $this : $this.parent()
}
$parent.trigger(e = $.Event('close'))
$parent.trigger(e = $.Event('bs-close'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
$parent
.trigger('closed')
.remove()
$parent.trigger('bs-closed').remove()
}
$.support.transition && $parent.hasClass('fade') ?
@@ -65,16 +61,17 @@
}
/* ALERT PLUGIN DEFINITION
* ======================= */
// ALERT PLUGIN DEFINITION
// =======================
var old = $.fn.alert
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
if (!data) $this.data('alert', (data = new Alert(this)))
var data = $this.data('bs-alert')
if (!data) $this.data('bs-alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
@@ -91,9 +88,9 @@
}
/* ALERT DATA-API
* ============== */
// ALERT DATA-API
// ============== */
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
$(document).on('click.bs-alert.bs-data-api', dismiss, Alert.prototype.close)
}(window.jQuery);