Author: marrs Date: Wed Feb 8 21:39:28 2012 New Revision: 1242114 URL: http://svn.apache.org/viewvc?rev=1242114&view=rev Log: Moved to Bootstrap 2.0 Added: ace/site/trunk/content/img/ ace/site/trunk/content/img/glyphicons-halflings-white.png (with props) ace/site/trunk/content/img/glyphicons-halflings.png (with props) ace/site/trunk/content/js/bootstrap-alert.js ace/site/trunk/content/js/bootstrap-button.js ace/site/trunk/content/js/bootstrap-carousel.js ace/site/trunk/content/js/bootstrap-collapse.js ace/site/trunk/content/js/bootstrap-tab.js ace/site/trunk/content/js/bootstrap-tooltip.js ace/site/trunk/content/js/bootstrap-transition.js ace/site/trunk/content/js/bootstrap-typeahead.js ace/site/trunk/content/lib/accordion.less ace/site/trunk/content/lib/alerts.less ace/site/trunk/content/lib/breadcrumbs.less ace/site/trunk/content/lib/button-groups.less ace/site/trunk/content/lib/buttons.less ace/site/trunk/content/lib/carousel.less ace/site/trunk/content/lib/close.less ace/site/trunk/content/lib/code.less ace/site/trunk/content/lib/component-animations.less ace/site/trunk/content/lib/dropdowns.less ace/site/trunk/content/lib/grid.less ace/site/trunk/content/lib/hero-unit.less ace/site/trunk/content/lib/labels.less ace/site/trunk/content/lib/layouts.less ace/site/trunk/content/lib/modals.less ace/site/trunk/content/lib/navbar.less ace/site/trunk/content/lib/navs.less ace/site/trunk/content/lib/pager.less ace/site/trunk/content/lib/pagination.less ace/site/trunk/content/lib/popovers.less ace/site/trunk/content/lib/print.less ace/site/trunk/content/lib/progress-bars.less ace/site/trunk/content/lib/responsive.less ace/site/trunk/content/lib/sprites.less ace/site/trunk/content/lib/thumbnails.less ace/site/trunk/content/lib/tooltip.less ace/site/trunk/content/lib/utilities.less ace/site/trunk/content/lib/wells.less Modified: ace/site/trunk/content/css/prettify.css ace/site/trunk/content/js/bootstrap-dropdown.js ace/site/trunk/content/js/bootstrap-modal.js ace/site/trunk/content/js/bootstrap-popover.js ace/site/trunk/content/js/bootstrap-scrollspy.js ace/site/trunk/content/lib/bootstrap.less ace/site/trunk/content/lib/forms.less ace/site/trunk/content/lib/mixins.less ace/site/trunk/content/lib/patterns.less ace/site/trunk/content/lib/reset.less ace/site/trunk/content/lib/scaffolding.less ace/site/trunk/content/lib/tables.less ace/site/trunk/content/lib/type.less ace/site/trunk/content/lib/variables.less Modified: ace/site/trunk/content/css/prettify.css URL: http://svn.apache.org/viewvc/ace/site/trunk/content/css/prettify.css?rev=1242114&r1=1242113&r2=1242114&view=diff ============================================================================== --- ace/site/trunk/content/css/prettify.css (original) +++ ace/site/trunk/content/css/prettify.css Wed Feb 8 21:39:28 2012 @@ -2,93 +2,29 @@ .lit { color: #195f91; } .pun, .opn, .clo { color: #93a1a1; } .fun { color: #dc322f; } -.str, .atv { color: #268bd2; } -.kwd, .tag { color: #195f91; } -.typ, .atn, .dec, .var { color: #CB4B16; } -.pln { color: #93a1a1; } +.str, .atv { color: #D14; } +.kwd, .linenums .tag { color: #1e347b; } +.typ, .atn, .dec, .var { color: teal; } +.pln { color: #48484c; } + .prettyprint { - background-color: #fefbf3; - padding: 9px; - border: 1px solid rgba(0,0,0,.2); - -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1); - -moz-box-shadow: 0 1px 2px rgba(0,0,0,.1); - box-shadow: 0 1px 2px rgba(0,0,0,.1); + padding: 8px; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +.prettyprint.linenums { + -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { - margin: 0 0 0 40px; -} -/* IE indents via margin-left */ + margin: 0 0 0 33px; /* IE indents via margin-left */ +} ol.linenums li { - padding: 0 5px; - color: rgba(0,0,0,.15); - line-height: 20px; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; -} -/* Alternate shading for lines */ -li.L1, li.L3, li.L5, li.L7, li.L9 { } - -/* -$base03: #002b36; -$base02: #073642; -$base01: #586e75; -$base00: #657b83; -$base0: #839496; -$base1: #93a1a1; -$base2: #eee8d5; -$base3: #fdf6e3; -$yellow: #b58900; -$orange: #cb4b16; -$red: #dc322f; -$magenta: #d33682; -$violet: #6c71c4; -$blue: #268bd2; -$cyan: #2aa198; -$green: #859900; -*/ - - -/* -#1d1f21 Background -#282a2e Current Line -#373b41 Selection -#c5c8c6 Foreground -#969896 Comment -#cc6666 Red -#de935f Orange -#f0c674 Yellow -#b5bd68 Green -#8abeb7 Aqua -#81a2be Blue -#b294bb Purple -*/ - - -/* DARK THEME */ -/* ---------- */ - -.prettyprint-dark { - background-color: #1d1f21; - border: 0; - padding: 10px; -} -.prettyprint-dark .linenums li { - color: #444; -} -.prettyprint-dark .linenums li:hover { - background-color: #282a2e; -} -/* tags in html */ -.prettyprint-dark .kwd, -.prettyprint-dark .tag { color: #cc6666; } -/* html attr */ -.prettyprint-dark .typ, -.prettyprint-dark .atn, -.prettyprint-dark .dec, -.prettyprint-dark .var { color: #de935f; } -/* html attr values */ -.prettyprint-dark .str, -.prettyprint-dark .atv { color: #b5bd68; } + padding-left: 12px; + color: #bebec5; + line-height: 18px; + text-shadow: 0 1px 0 #fff; +} \ No newline at end of file Added: ace/site/trunk/content/img/glyphicons-halflings-white.png URL: http://svn.apache.org/viewvc/ace/site/trunk/content/img/glyphicons-halflings-white.png?rev=1242114&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/site/trunk/content/img/glyphicons-halflings-white.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/site/trunk/content/img/glyphicons-halflings.png URL: http://svn.apache.org/viewvc/ace/site/trunk/content/img/glyphicons-halflings.png?rev=1242114&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/site/trunk/content/img/glyphicons-halflings.png ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/site/trunk/content/js/bootstrap-alert.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-alert.js?rev=1242114&view=auto ============================================================================== --- ace/site/trunk/content/js/bootstrap-alert.js (added) +++ ace/site/trunk/content/js/bootstrap-alert.js Wed Feb 8 21:39:28 2012 @@ -0,0 +1,91 @@ +/* ========================================================== + * bootstrap-alert.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 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" + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function ( el ) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype = { + + constructor: Alert + + , close: function ( e ) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.trigger('close') + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.removeClass('in') + + function removeElement() { + $parent.remove() + $parent.trigger('closed') + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + $.fn.alert = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT DATA-API + * ============== */ + + $(function () { + $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) + }) + +}( window.jQuery ) Added: ace/site/trunk/content/js/bootstrap-button.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-button.js?rev=1242114&view=auto ============================================================================== --- ace/site/trunk/content/js/bootstrap-button.js (added) +++ ace/site/trunk/content/js/bootstrap-button.js Wed Feb 8 21:39:28 2012 @@ -0,0 +1,98 @@ +/* ============================================================ + * bootstrap-button.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 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" + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function ( element, options ) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype = { + + constructor: Button + + , setState: function ( state ) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + , toggle: function () { + var $parent = this.$element.parent('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + $.fn.button = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON DATA-API + * =============== */ + + $(function () { + $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { + $(e.target).button('toggle') + }) + }) + +}( window.jQuery ) Added: ace/site/trunk/content/js/bootstrap-carousel.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-carousel.js?rev=1242114&view=auto ============================================================================== --- ace/site/trunk/content/js/bootstrap-carousel.js (added) +++ ace/site/trunk/content/js/bootstrap-carousel.js Wed Feb 8 21:39:28 2012 @@ -0,0 +1,154 @@ +/* ========================================================== + * bootstrap-carousel.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 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" + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.carousel.defaults, options) + this.options.slide && this.slide(this.options.slide) + } + + Carousel.prototype = { + + cycle: function () { + this.interval = setInterval($.proxy(this.next, this), this.options.interval) + return this + } + + , to: function (pos) { + var $active = this.$element.find('.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this + + if (pos > (children.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) + } + + , pause: function () { + clearInterval(this.interval) + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + if (!$.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger('slide') + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } else { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.trigger('slide') + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + $.fn.carousel = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = typeof option == 'object' && option + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (typeof option == 'string' || (option = options.slide)) data[option]() + else data.cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL DATA-API + * ================= */ + + $(function () { + $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + }) + +}( window.jQuery ) Added: ace/site/trunk/content/js/bootstrap-collapse.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-collapse.js?rev=1242114&view=auto ============================================================================== --- ace/site/trunk/content/js/bootstrap-collapse.js (added) +++ ace/site/trunk/content/js/bootstrap-collapse.js Wed Feb 8 21:39:28 2012 @@ -0,0 +1,136 @@ +/* ============================================================= + * bootstrap-collapse.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 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" + + var Collapse = function ( element, options ) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options["parent"]) { + this.$parent = $(this.options["parent"]) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension = this.dimension() + , scroll = $.camelCase(['scroll', dimension].join('-')) + , actives = this.$parent && this.$parent.find('.in') + , hasData + + if (actives && actives.length) { + hasData = actives.data('collapse') + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', 'show', 'shown') + this.$element[dimension](this.$element[0][scroll]) + + } + + , hide: function () { + var dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', 'hide', 'hidden') + this.$element[dimension](0) + } + + , reset: function ( size ) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element.addClass('collapse') + } + + , transition: function ( method, startEvent, completeEvent ) { + var that = this + , complete = function () { + if (startEvent == 'show') that.reset() + that.$element.trigger(completeEvent) + } + + this.$element + .trigger(startEvent) + [method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + /* COLLAPSIBLE PLUGIN DEFINITION + * ============================== */ + + $.fn.collapse = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSIBLE DATA-API + * ==================== */ + + $(function () { + $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $(target).collapse(option) + }) + }) + +}( window.jQuery ) Modified: ace/site/trunk/content/js/bootstrap-dropdown.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-dropdown.js?rev=1242114&r1=1242113&r2=1242114&view=diff ============================================================================== --- ace/site/trunk/content/js/bootstrap-dropdown.js (original) +++ ace/site/trunk/content/js/bootstrap-dropdown.js Wed Feb 8 21:39:28 2012 @@ -1,8 +1,8 @@ /* ============================================================ - * bootstrap-dropdown.js v1.4.0 - * http://twitter.github.com/bootstrap/javascript.html#dropdown + * bootstrap-dropdown.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ - * Copyright 2011 Twitter, Inc. + * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,34 +22,71 @@ "use strict" + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle="dropdown"]' + , Dropdown = function ( element ) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function ( e ) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + , isActive + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + isActive = $parent.hasClass('open') + + clearMenus() + !isActive && $parent.toggleClass('open') + + return false + } + + } + + function clearMenus() { + $(toggle).parent().removeClass('open') + } + + /* DROPDOWN PLUGIN DEFINITION * ========================== */ - $.fn.dropdown = function ( selector ) { + $.fn.dropdown = function ( option ) { 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 - }) + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) }) } - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ + $.fn.dropdown.Constructor = Dropdown - var d = 'a.menu, .dropdown-toggle' - function clearMenus() { - $(d).parent('li').removeClass('open') - } + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ $(function () { - $('html').bind("click", clearMenus) - $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' ) + $('html').on('click.dropdown.data-api', clearMenus) + $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) }) -}( window.jQuery || window.ender ); +}( window.jQuery ) Modified: ace/site/trunk/content/js/bootstrap-modal.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-modal.js?rev=1242114&r1=1242113&r2=1242114&view=diff ============================================================================== --- ace/site/trunk/content/js/bootstrap-modal.js (original) +++ ace/site/trunk/content/js/bootstrap-modal.js Wed Feb 8 21:39:28 2012 @@ -1,8 +1,8 @@ /* ========================================================= - * bootstrap-modal.js v1.4.0 - * http://twitter.github.com/bootstrap/javascript.html#modal + * bootstrap-modal.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= - * Copyright 2011 Twitter, Inc. + * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,58 +22,30 @@ "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 CLASS DEFINITION + * ====================== */ var Modal = function ( content, options ) { - this.settings = $.extend({}, $.fn.modal.defaults, options) + this.options = $.extend({}, $.fn.modal.defaults, options) this.$element = $(content) - .delegate('.close', 'click.modal', $.proxy(this.hide, this)) - - if ( this.settings.show ) { - this.show() - } - - return this + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) } Modal.prototype = { - toggle: function () { + constructor: Modal + + , toggle: function () { return this[!this.isShown ? 'show' : 'hide']() } , show: function () { var that = this + + if (this.isShown) return + + $('body').addClass('modal-open') + this.isShown = true this.$element.trigger('show') @@ -81,8 +53,9 @@ backdrop.call(this, function () { var transition = $.support.transition && that.$element.hasClass('fade') + !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position + that.$element - .appendTo(document.body) .show() if (transition) { @@ -92,24 +65,22 @@ that.$element.addClass('in') transition ? - that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : + that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.trigger('shown') }) - - return this } - , hide: function (e) { + , hide: function ( e ) { e && e.preventDefault() - if ( !this.isShown ) { - return this - } + if (!this.isShown) return var that = this this.isShown = false + $('body').removeClass('modal-open') + escape.call(this) this.$element @@ -119,8 +90,6 @@ $.support.transition && this.$element.hasClass('fade') ? hideWithTransition.call(this) : hideModal.call(this) - - return this } } @@ -130,20 +99,19 @@ * ===================== */ function hideWithTransition() { - // firefox drops transitionEnd events :{o var that = this , timeout = setTimeout(function () { - that.$element.unbind(transitionEnd) + that.$element.off($.support.transition.end) hideModal.call(that) }, 500) - this.$element.one(transitionEnd, function () { + this.$element.one($.support.transition.end, function () { clearTimeout(timeout) hideModal.call(that) }) } - function hideModal (that) { + function hideModal( that ) { this.$element .hide() .trigger('hidden') @@ -151,38 +119,37 @@ backdrop.call(this) } - function backdrop ( callback ) { + function backdrop( callback ) { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' - if ( this.isShown && this.settings.backdrop ) { + + if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $('
') .appendTo(document.body) - if ( this.settings.backdrop != 'static' ) { + if (this.options.backdrop != 'static') { this.$backdrop.click($.proxy(this.hide, this)) } - if ( doAnimate ) { - this.$backdrop[0].offsetWidth // force reflow - } + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow this.$backdrop.addClass('in') doAnimate ? - this.$backdrop.one(transitionEnd, callback) : + this.$backdrop.one($.support.transition.end, callback) : callback() - } else if ( !this.isShown && this.$backdrop ) { + } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) : + this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : removeBackdrop.call(this) - } else if ( callback ) { - callback() + } else if (callback) { + callback() } } @@ -193,14 +160,12 @@ function escape() { var that = this - if ( this.isShown && this.settings.keyboard ) { - $(document).bind('keyup.modal', function ( e ) { - if ( e.which == 27 ) { - that.hide() - } + if (this.isShown && this.options.keyboard) { + $(document).on('keyup.dismiss.modal', function ( e ) { + e.which == 27 && that.hide() }) - } else if ( !this.isShown ) { - $(document).unbind('keyup.modal') + } else if (!this.isShown) { + $(document).off('keyup.dismiss.modal') } } @@ -208,53 +173,37 @@ /* MODAL PLUGIN DEFINITION * ======================= */ - $.fn.modal = function ( options ) { - var modal = this.data('modal') - - if (!modal) { - - if (typeof options == 'string') { - options = { - show: /show|toggle/.test(options) - } - } - - return this.each(function () { - $(this).data('modal', new Modal(this, options)) - }) - } - - if ( options === true ) { - return modal - } - - if ( typeof options == 'string' ) { - modal[options]() - } else if ( modal ) { - modal.toggle() - } - - return this + $.fn.modal = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('modal') + , options = typeof option == 'object' && option + if (!data) $this.data('modal', (data = new Modal(this, options))) + if (typeof option == 'string') data[option]() + else data.show() + }) } - $.fn.modal.Modal = Modal - $.fn.modal.defaults = { - backdrop: false - , keyboard: false - , show: false + backdrop: true + , keyboard: true } + $.fn.modal.Constructor = Modal + + + /* MODAL DATA-API + * ============== */ - /* MODAL DATA- IMPLEMENTATION - * ========================== */ + $(function () { + $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data()) - $(document).ready(function () { - $('body').delegate('[data-controls-modal]', 'click', function (e) { e.preventDefault() - var $this = $(this).data('show', true) - $('#' + $this.attr('data-controls-modal')).modal( $this.data() ) + $target.modal(option) }) }) -}( window.jQuery || window.ender ); +}( window.jQuery ) Modified: ace/site/trunk/content/js/bootstrap-popover.js URL: http://svn.apache.org/viewvc/ace/site/trunk/content/js/bootstrap-popover.js?rev=1242114&r1=1242113&r2=1242114&view=diff ============================================================================== --- ace/site/trunk/content/js/bootstrap-popover.js (original) +++ ace/site/trunk/content/js/bootstrap-popover.js Wed Feb 8 21:39:28 2012 @@ -1,8 +1,8 @@ /* =========================================================== - * bootstrap-popover.js v1.4.0 - * http://twitter.github.com/bootstrap/javascript.html#popover + * bootstrap-popover.js v2.0.0 + * http://twitter.github.com/bootstrap/javascript.html#popovers * =========================================================== - * Copyright 2011 Twitter, Inc. + * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,22 +23,25 @@ "use strict" var Popover = function ( element, options ) { - this.$element = $(element) - this.options = options - this.enabled = true - this.fixTitle() + this.init('popover', element, options) } - /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js - ========================================= */ + /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js + ========================================== */ - Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, { + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { - setContent: function () { + constructor: Popover + + , setContent: function () { var $tip = this.tip() - $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle()) - $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent()) - $tip[0].className = 'popover' + , title = this.getTitle() + , content = this.getContent() + + $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) + $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) + + $tip.removeClass('fade top bottom left right in') } , hasContent: function () { @@ -47,22 +50,20 @@ , getContent: function () { var content - , $e = this.$element - , o = this.options + , $e = this.$element + , o = this.options - if (typeof this.options.content == 'string') { - content = $e.attr(this.options.content) - } else if (typeof this.options.content == 'function') { - content = this.options.content.call(this.$element[0]) - } + content = $e.attr('data-content') + || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) + + content = content.toString().replace(/(^\s*|\s*$)/, "") return content } , tip: function() { if (!this.$tip) { - this.$tip = $('') - .html(this.options.template) + this.$tip = $(this.options.template) } return this.$tip } @@ -73,18 +74,22 @@ /* POPOVER PLUGIN DEFINITION * ======================= */ - $.fn.popover = function (options) { - if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options) - $.fn.twipsy.initWith.call(this, options, Popover, 'popover') - return this + $.fn.popover = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('popover') + , options = typeof option == 'object' && option + if (!data) $this.data('popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) } - $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { + $.fn.popover.Constructor = Popover + + $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { placement: 'right' - , content: 'data-content' - , template: ' and elements
+// --------------------------------------------------------
+
+// Inline and block code styles
+code,
+pre {
+ padding: 0 3px 2px;
+ #font > #family > .monospace;
+ font-size: @baseFontSize - 1;
+ color: @grayDark;
+ .border-radius(3px);
+}
+code {
+ padding: 3px 4px;
+ color: #d14;
+ background-color: #f7f7f9;
+ border: 1px solid #e1e1e8;
+}
+pre {
+ display: block;
+ padding: (@baseLineHeight - 1) / 2;
+ margin: 0 0 @baseLineHeight / 2;
+ font-size: 12px;
+ line-height: @baseLineHeight;
+ background-color: #f5f5f5;
+ border: 1px solid #ccc; // fallback for IE7-8
+ border: 1px solid rgba(0,0,0,.15);
+ .border-radius(4px);
+ white-space: pre;
+ white-space: pre-wrap;
+ word-break: break-all;
+
+ // Make prettyprint styles more spaced out for readability
+ &.prettyprint {
+ margin-bottom: @baseLineHeight;
+ }
+
+ // Account for some code outputs that place code tags in pre tags
+ code {
+ padding: 0;
+ background-color: transparent;
+ }
+}
Added: ace/site/trunk/content/lib/component-animations.less
URL: http://svn.apache.org/viewvc/ace/site/trunk/content/lib/component-animations.less?rev=1242114&view=auto
==============================================================================
--- ace/site/trunk/content/lib/component-animations.less (added)
+++ ace/site/trunk/content/lib/component-animations.less Wed Feb 8 21:39:28 2012
@@ -0,0 +1,18 @@
+// COMPONENT ANIMATIONS
+// --------------------
+
+.fade {
+ .transition(opacity .15s linear);
+ opacity: 0;
+ &.in {
+ opacity: 1;
+ }
+}
+
+.collapse {
+ .transition(height .35s ease);
+ position:relative;
+ overflow:hidden;
+ height: 0;
+ &.in { height: auto; }
+}
Added: ace/site/trunk/content/lib/dropdowns.less
URL: http://svn.apache.org/viewvc/ace/site/trunk/content/lib/dropdowns.less?rev=1242114&view=auto
==============================================================================
--- ace/site/trunk/content/lib/dropdowns.less (added)
+++ ace/site/trunk/content/lib/dropdowns.less Wed Feb 8 21:39:28 2012
@@ -0,0 +1,131 @@
+// DROPDOWN MENUS
+// --------------
+
+// Use the .menu class on any
element within the topbar or ul.tabs and you'll get some superfancy dropdowns
+.dropdown {
+ position: relative;
+}
+.dropdown-toggle {
+ // The caret makes the toggle a bit too tall in IE7
+ *margin-bottom: -3px;
+}
+.dropdown-toggle:active,
+.open .dropdown-toggle {
+ outline: 0;
+}
+// Dropdown arrow/caret
+.caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ text-indent: -99999px;
+ // IE7 won't do the border trick if there's a text indent, but it doesn't
+ // do the content that text-indent is hiding, either, so we're ok.
+ *text-indent: 0;
+ vertical-align: top;
+ border-left: 4px solid transparent;
+ border-right: 4px solid transparent;
+ border-top: 4px solid @black;
+ .opacity(30);
+ content: "\2193";
+}
+.dropdown .caret {
+ margin-top: 8px;
+ margin-left: 2px;
+}
+.dropdown:hover .caret,
+.open.dropdown .caret {
+ .opacity(100);
+}
+// The dropdown menu (ul)
+.dropdown-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: @zindexDropdown;
+ float: left;
+ display: none; // none by default, but block on "open" of the menu
+ min-width: 160px;
+ max-width: 220px;
+ _width: 160px;
+ padding: 4px 0;
+ margin: 0; // override default ul
+ list-style: none;
+ background-color: @white;
+ border-color: #ccc;
+ border-color: rgba(0,0,0,.2);
+ border-style: solid;
+ border-width: 1px;
+ .border-radius(0 0 5px 5px);
+ .box-shadow(0 5px 10px rgba(0,0,0,.2));
+ -webkit-background-clip: padding-box;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ *border-right-width: 2px;
+ *border-bottom-width: 2px;
+
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
+ &.bottom-up {
+ top: auto;
+ bottom: 100%;
+ margin-bottom: 2px;
+ }
+
+ // Dividers (basically an hr) within the dropdown
+ .divider {
+ height: 1px;
+ margin: 5px 1px;
+ overflow: hidden;
+ background-color: #e5e5e5;
+ border-bottom: 1px solid @white;
+
+ // IE7 needs a set width since we gave a height. Restricting just
+ // to IE7 to keep the 1px left/right space in other browsers.
+ // It is unclear where IE is getting the extra space that we need
+ // to negative-margin away, but so it goes.
+ *width: 100%;
+ *margin: -5px 0 5px;
+ }
+
+ // Links within the dropdown menu
+ a {
+ display: block;
+ padding: 3px 15px;
+ clear: both;
+ font-weight: normal;
+ line-height: 18px;
+ color: @gray;
+ white-space: nowrap;
+ }
+}
+
+// Hover state
+.dropdown-menu li > a:hover,
+.dropdown-menu .active > a,
+.dropdown-menu .active > a:hover {
+ color: @white;
+ text-decoration: none;
+ background-color: @linkColor;
+}
+
+// Open state for the dropdown
+.dropdown.open {
+ // IE7's z-index only goes to the nearest positioned ancestor, which would
+ // make the menu appear below buttons that appeared later on the page
+ *z-index: @zindexDropdown;
+
+ .dropdown-toggle {
+ color: @white;
+ background: #ccc;
+ background: rgba(0,0,0,.3);
+ }
+ .dropdown-menu {
+ display: block;
+ }
+}
+
+// Typeahead
+.typeahead {
+ margin-top: 2px; // give it some space to breathe
+ .border-radius(4px);
+}