Commit 0b1d5d91 authored by Jacob Thornton's avatar Jacob Thornton

revert all js stuff back to 1.4 :/

parent 4e6275d0
This diff is collapsed.
This diff is collapsed.
/* ========================================================== /* ==========================================================
* bootstrap-alerts.js v2.0.0 * bootstrap-alerts.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#alerts * http://twitter.github.com/bootstrap/javascript.html#alerts
* ========================================================== * ==========================================================
* Copyright 2011 Twitter, Inc. * Copyright 2011 Twitter, Inc.
...@@ -17,32 +17,108 @@ ...@@ -17,32 +17,108 @@
* limitations under the License. * limitations under the License.
* ========================================================== */ * ========================================================== */
(function( $ ){
!function( $ ){
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* ALERT CLASS DEFINITION /* ALERT CLASS DEFINITION
* ====================== */ * ====================== */
function close(e) { var Alert = function ( content, options ) {
var $element = $(this).parent('.alert-message') if (options == 'close') return this.close.call(content)
this.settings = $.extend({}, $.fn.alert.defaults, options)
this.$element = $(content)
.delegate(this.settings.selector, 'click', this.close)
}
Alert.prototype = {
close: function (e) {
var $element = $(this)
, className = 'alert-message'
$element = $element.hasClass(className) ? $element : $element.parent()
e && e.preventDefault()
$element.removeClass('in')
e && e.preventDefault() function removeElement () {
$element.removeClass('in') $element.remove()
}
function removeElement () { $.support.transition && $element.hasClass('fade') ?
$element.remove() $element.bind(transitionEnd, removeElement) :
removeElement()
} }
$.support.transition && $element.hasClass('fade') ?
$element.bind($.support.transition.end, removeElement) :
removeElement()
} }
/* ALERT PLUGIN DEFINITION /* ALERT PLUGIN DEFINITION
* ======================= */ * ======================= */
$(function () { $.fn.alert = function ( options ) {
$('body').delegate('[data-alert-dismiss]', 'click', close)
if ( options === true ) {
return this.data('alert')
}
return this.each(function () {
var $this = $(this)
, data
if ( typeof options == 'string' ) {
data = $this.data('alert')
if (typeof data == 'object') {
return data[options].call( $this )
}
}
$(this).data('alert', new Alert( this, options ))
})
}
$.fn.alert.defaults = {
selector: '.close'
}
$(document).ready(function () {
new Alert($('body'), {
selector: '.alert-message[data-alert] .close'
})
}) })
})( window.jQuery || window.ender ) }( window.jQuery || window.ender );
\ No newline at end of file \ No newline at end of file
/* ============================================================
* bootstrap-buttons.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( $ ){
"use strict"
function setState(el, state) {
var d = 'disabled'
, $el = $(el)
, data = $el.data()
state = state + 'Text'
data.resetText || $el.data('resetText', $el.html())
$el.html( data[state] || $.fn.button.defaults[state] )
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}
function toggle(el) {
$(el).toggleClass('active')
}
$.fn.button = function(options) {
return this.each(function () {
if (options == 'toggle') {
return toggle(this)
}
options && setState(this, options)
})
}
$.fn.button.defaults = {
loadingText: 'loading...'
}
$(function () {
$('body').delegate('.btn[data-toggle]', 'click', function () {
$(this).button('toggle')
})
})
}( window.jQuery || window.ender );
\ No newline at end of file
/* ============================================================ /* ============================================================
* bootstrap-dropdown.js v2.0.0 * bootstrap-dropdown.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#dropdown * http://twitter.github.com/bootstrap/javascript.html#dropdown
* ============================================================ * ============================================================
* Copyright 2011 Twitter, Inc. * Copyright 2011 Twitter, Inc.
...@@ -18,25 +18,38 @@ ...@@ -18,25 +18,38 @@
* ============================================================ */ * ============================================================ */
(function( $ ){ !function( $ ){
"use strict"
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS /* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */ * =================================== */
var selector = '[data-dropdown]'
var d = 'a.menu, .dropdown-toggle'
function clearMenus() { function clearMenus() {
$(selector).parent('li').removeClass('open') $(d).parent('li').removeClass('open')
} }
$(function () { $(function () {
$('html').bind("click", clearMenus) $('html').bind("click", clearMenus)
$('body').delegate(selector, 'click', function (e) { $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
}) })
})( window.jQuery || window.ender ) }( window.jQuery || window.ender );
\ No newline at end of file \ No newline at end of file
/* ========================================================= /* =========================================================
* bootstrap-modal.js v2.0.0 * bootstrap-modal.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#modal * http://twitter.github.com/bootstrap/javascript.html#modal
* ========================================================= * =========================================================
* Copyright 2011 Twitter, Inc. * Copyright 2011 Twitter, Inc.
...@@ -20,13 +20,44 @@ ...@@ -20,13 +20,44 @@
!function( $ ){ !function( $ ){
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* MODAL PUBLIC CLASS DEFINITION /* MODAL PUBLIC CLASS DEFINITION
* ============================= */ * ============================= */
var Modal = function ( content, options ) { var Modal = function ( content, options ) {
this.settings = $.extend({}, $.fn.modal.defaults, options) this.settings = $.extend({}, $.fn.modal.defaults, options)
this.$element = $(content) this.$element = $(content)
.delegate('[data-modal-dismiss]', 'click', $.proxy(this.hide, this)) .delegate('.close', 'click.modal', $.proxy(this.hide, this))
if ( this.settings.show ) { if ( this.settings.show ) {
this.show() this.show()
...@@ -47,7 +78,24 @@ ...@@ -47,7 +78,24 @@
this.$element.trigger('show') this.$element.trigger('show')
escape.call(this) escape.call(this)
backdrop.call(this) backdrop.call(this, function () {
var transition = $.support.transition && that.$element.hasClass('fade')
that.$element
.appendTo(document.body)
.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in')
transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown')
})
return this return this
} }
...@@ -68,17 +116,9 @@ ...@@ -68,17 +116,9 @@
.trigger('hide') .trigger('hide')
.removeClass('in') .removeClass('in')
function removeElement () {
that.$element
.hide()
.trigger('hidden')
backdrop.call(that)
}
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
this.$element.one($.support.transition.end, removeElement) : hideWithTransition.call(this) :
removeElement() hideModal.call(this)
return this return this
} }
...@@ -89,11 +129,31 @@ ...@@ -89,11 +129,31 @@
/* MODAL PRIVATE METHODS /* MODAL PRIVATE METHODS
* ===================== */ * ===================== */
function backdrop () { function hideWithTransition() {
// firefox drops transitionEnd events :{o
var that = this var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : '' , timeout = setTimeout(function () {
, callback = $.proxy(show, this) that.$element.unbind(transitionEnd)
hideModal.call(that)
}, 500)
this.$element.one(transitionEnd, function () {
clearTimeout(timeout)
hideModal.call(that)
})
}
function hideModal (that) {
this.$element
.hide()
.trigger('hidden')
backdrop.call(this)
}
function backdrop ( callback ) {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if ( this.isShown && this.settings.backdrop ) { if ( this.isShown && this.settings.backdrop ) {
var doAnimate = $.support.transition && animate var doAnimate = $.support.transition && animate
...@@ -111,43 +171,24 @@ ...@@ -111,43 +171,24 @@
this.$backdrop.addClass('in') this.$backdrop.addClass('in')
doAnimate ? doAnimate ?
this.$backdrop.one($.support.transition.end, callback) : this.$backdrop.one(transitionEnd, callback) :
callback() callback()
} else if ( !this.isShown && this.$backdrop ) { } else if ( !this.isShown && this.$backdrop ) {
this.$backdrop.removeClass('in') this.$backdrop.removeClass('in')
function removeElement() {
that.$backdrop.remove()
that.$backdrop = null
}
$.support.transition && this.$element.hasClass('fade')? $.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, removeElement) : this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) :
removeElement() removeBackdrop.call(this)
} else if ( callback ) { } else if ( callback ) {
callback() callback()
} }
} }
function show() { function removeBackdrop() {
var transition = $.support.transition && that.$element.hasClass('fade') this.$backdrop.remove()
, that = this this.$backdrop = null
this.$element
.appendTo(document.body)
.show()
if (transition) {
this.$element[0].offsetWidth // force reflow
}
this.$element
.addClass('in')
transition ?
this.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
this.$element.trigger('shown')
} }
function escape() { function escape() {
...@@ -205,10 +246,10 @@ ...@@ -205,10 +246,10 @@
} }
/* MODAL DATA-IMPLEMENTATION /* MODAL DATA- IMPLEMENTATION
* ========================= */ * ========================== */
$(function () { $(document).ready(function () {
$('body').delegate('[data-controls-modal]', 'click', function (e) { $('body').delegate('[data-controls-modal]', 'click', function (e) {
e.preventDefault() e.preventDefault()
var $this = $(this).data('show', true) var $this = $(this).data('show', true)
......
/* =========================================================== /* ===========================================================
* bootstrap-popover.js v2.0.0 * bootstrap-popover.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#popover * http://twitter.github.com/bootstrap/javascript.html#popover
* =========================================================== * ===========================================================
* Copyright 2011 Twitter, Inc. * Copyright 2011 Twitter, Inc.
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ) { !function( $ ) {
"use strict"
var Popover = function ( element, options ) { var Popover = function ( element, options ) {
this.$element = $(element) this.$element = $(element)
this.options = options this.options = options
...@@ -35,33 +37,39 @@ ...@@ -35,33 +37,39 @@
setContent: function () { setContent: function () {
var $tip = this.tip() var $tip = this.tip()
$tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle()) $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
$tip.find('.content p')[this.options.html ? 'html' : 'text'](this.getContent()) $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
$tip[0].className = 'popover' $tip[0].className = 'popover'
} }
, hasContent: function () {
return this.getTitle() || this.getContent()
}
, getContent: function () { , getContent: function () {
var content var content
, $e = this.$element , $e = this.$element
, o = this.options , o = this.options
if (typeof this.options.content == 'string') { if (typeof this.options.content == 'string') {
content = $e.attr(o.content) content = $e.attr(this.options.content)
} else if (typeof this.options.content == 'function') { } else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0]) content = this.options.content.call(this.$element[0])
} }
return content return content
} }
, tip: function() { , tip: function() {
if (!this.$tip) { if (!this.$tip) {
this.$tip = $('<div class="popover" />') this.$tip = $('<div class="popover" />')
.html('<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>') .html(this.options.template)
} }
return this.$tip return this.$tip
} }
}) })
/* POPOVER PLUGIN DEFINITION /* POPOVER PLUGIN DEFINITION
* ======================= */ * ======================= */
...@@ -71,6 +79,12 @@ ...@@ -71,6 +79,12 @@
return this return this
} }
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'}) $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right'
, content: 'data-content'
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
})
$.fn.twipsy.rejectAttrOptions.push( 'content' )
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
/* ======================================================== /* ========================================================
* bootstrap-tabs.js v2.0.0 * bootstrap-tabs.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#tabs * http://twitter.github.com/bootstrap/javascript.html#tabs
* ======================================================== * ========================================================
* Copyright 2011 Twitter, Inc. * Copyright 2011 Twitter, Inc.
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
!function( $ ){ !function( $ ){
"use strict"
function activate ( element, container ) { function activate ( element, container ) {
container container
.find('> .active') .find('> .active')
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
, $ul = $this.closest('ul:not(.dropdown-menu)') , $ul = $this.closest('ul:not(.dropdown-menu)')
, href = $this.attr('href') , href = $this.attr('href')
, previous , previous
, $href
if ( /^#\w+/.test(href) ) { if ( /^#\w+/.test(href) ) {
e.preventDefault() e.preventDefault()
...@@ -64,8 +67,14 @@ ...@@ -64,8 +67,14 @@
/* TABS/PILLS PLUGIN DEFINITION /* TABS/PILLS PLUGIN DEFINITION
* ============================ */ * ============================ */
$(function () { $.fn.tabs = $.fn.pills = function ( selector ) {
$('body').delegate('ul[data-tabs] > li > a, ul[data-pills] > li > a', 'click', tab) return this.each(function () {
$(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
})
}
$(document).ready(function () {
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
}) })
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
/* ========================================================== /* ==========================================================
* bootstrap-twipsy.js v2.0.0 * bootstrap-twipsy.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#twipsy * http://twitter.github.com/bootstrap/javascript.html#twipsy
* Adapted from the original jQuery.tipsy by Jason Frame * Adapted from the original jQuery.tipsy by Jason Frame
* ========================================================== * ==========================================================
...@@ -21,6 +21,37 @@ ...@@ -21,6 +21,37 @@
!function( $ ) { !function( $ ) {
"use strict"
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */
var transitionEnd
$(document).ready(function () {
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* TWIPSY PUBLIC CLASS DEFINITION /* TWIPSY PUBLIC CLASS DEFINITION
* ============================== */ * ============================== */
...@@ -41,7 +72,7 @@ ...@@ -41,7 +72,7 @@
, $tip , $tip
, tp , tp
if (this.getTitle() && this.enabled) { if (this.hasContent() && this.enabled) {
$tip = this.tip() $tip = this.tip()
this.setContent() this.setContent()
...@@ -61,7 +92,8 @@ ...@@ -61,7 +92,8 @@
actualWidth = $tip[0].offsetWidth actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight actualHeight = $tip[0].offsetHeight
placement = _.maybeCall(this.options.placement, this.$element[0])
placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
switch (placement) { switch (placement) {
case 'below': case 'below':
...@@ -102,7 +134,7 @@ ...@@ -102,7 +134,7 @@
} }
$.support.transition && this.$tip.hasClass('fade') ? $.support.transition && this.$tip.hasClass('fade') ?
$tip.bind($.support.transition.end, removeElement) : $tip.bind(transitionEnd, removeElement) :
removeElement() removeElement()
} }
...@@ -113,6 +145,10 @@ ...@@ -113,6 +145,10 @@
} }
} }
, hasContent: function () {
return this.getTitle()
}
, getTitle: function() { , getTitle: function() {
var title var title
, $e = this.$element , $e = this.$element
...@@ -132,10 +168,7 @@ ...@@ -132,10 +168,7 @@
} }
, tip: function() { , tip: function() {
if (!this.$tip) { return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template)
this.$tip = $('<div class="twipsy" />').html('<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>')
}
return this.$tip
} }
, validate: function() { , validate: function() {
...@@ -158,21 +191,20 @@ ...@@ -158,21 +191,20 @@
this.enabled = !this.enabled this.enabled = !this.enabled
} }
, toggle: function () {
this[this.tip().hasClass('in') ? 'hide' : 'show']()
}
} }
/* TWIPSY PRIVATE METHODS /* TWIPSY PRIVATE METHODS
* ====================== */ * ====================== */
var _ = { function maybeCall ( thing, ctx, args ) {
return typeof thing == 'function' ? thing.apply(ctx, args) : thing
maybeCall: function ( thing, ctx ) {
return (typeof thing == 'function') ? (thing.call(ctx)) : thing
}
} }
/* TWIPSY PLUGIN DEFINITION /* TWIPSY PLUGIN DEFINITION
* ======================== */ * ======================== */
...@@ -269,10 +301,21 @@ ...@@ -269,10 +301,21 @@
, offset: 0 , offset: 0
, title: 'title' , title: 'title'
, trigger: 'hover' , trigger: 'hover'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
} }
$.fn.twipsy.rejectAttrOptions = [ 'title' ]
$.fn.twipsy.elementOptions = function(ele, options) { $.fn.twipsy.elementOptions = function(ele, options) {
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options var data = $(ele).data()
, rejects = $.fn.twipsy.rejectAttrOptions
, i = rejects.length
while (i--) {
delete data[rejects[i]]
}
return $.extend({}, options, data)
} }
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment