Skip to content

Commit

Permalink
Merge branch 'master' into feature/easily_replace_sidebar_navigation
Browse files Browse the repository at this point in the history
Conflicts:
	app/views/layouts/rails_admin/application.html.haml
  • Loading branch information
Jordan Maguire committed Mar 28, 2015
2 parents 3edefff + 5667603 commit a6558ec
Show file tree
Hide file tree
Showing 226 changed files with 10,750 additions and 7,062 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ inherit_from: .rubocop_todo.yml

AllCops:
Exclude:
- 'spec/dummy_app/bin/**/*'
- 'spec/dummy_app/db/schema.rb'
- 'spec/dummy_app/tmp/**/*'
- 'vendor/bundle/**/*'

Metrics/AbcSize:
Max: 69.98 # TODO: Lower to 15

Metrics/BlockNesting:
Max: 3

Expand Down
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2
- rbx-2
- ruby-head

Expand All @@ -32,18 +33,18 @@ sudo: false

matrix:
include:
- rvm: 2.1
env: RAILS_VERSION=4.2 CI_ORM=active_record CI_DB_ADAPTER=sqlite3
- rvm: 2.1
env: RAILS_VERSION=4.2 CI_ORM=mongoid
- rvm: 2.1
env: CI_ORM=active_record CI_DB_ADAPTER=mysql2
- rvm: 2.1
env: CI_ORM=active_record CI_DB_ADAPTER=postgresql CI_DB_USERNAME=postgres
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.0 CI_ORM=active_record CI_DB_ADAPTER=sqlite3
- rvm: 2.1
- rvm: 2.2
env: RAILS_VERSION=4.0 CI_ORM=mongoid
- rvm: 2.2
env: RAILS_VERSION=4.1 CI_ORM=active_record CI_DB_ADAPTER=sqlite3
- rvm: 2.2
env: RAILS_VERSION=4.1 CI_ORM=mongoid
- rvm: 2.2
env: CI_ORM=active_record CI_DB_ADAPTER=mysql2
- rvm: 2.2
env: CI_ORM=active_record CI_DB_ADAPTER=postgresql CI_DB_USERNAME=postgres
- rvm: jruby-19mode
env: CI_ORM=mongoid
- rvm: jruby-19mode
Expand Down
13 changes: 7 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
source 'https://rubygems.org'

case ENV['RAILS_VERSION']
when '4.2'
gem 'rails', '~> 4.2.0.beta1'
gem 'sass-rails', '~> 5.0.0.beta1'
gem 'devise', github: 'plataformatec/devise', branch: 'lm-rails-4-2'
when '4.0'
gem 'rails', '~> 4.0.0'
gem 'devise', '>= 3.2'
else
gem 'test-unit'
when '4.1'
gem 'rails', '~> 4.1.0'
gem 'devise', '>= 3.2'
else
gem 'rails', '~> 4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'devise', '>= 3.4'
end

case ENV['CI_ORM']
Expand Down Expand Up @@ -57,7 +58,7 @@ group :test do
gem 'capybara', '>= 2.1'
gem 'carrierwave', '>= 0.8'
gem 'coveralls'
gem 'database_cleaner', '>= 1.2'
gem 'database_cleaner', ['>= 1.2', '!= 1.4.0']
gem 'dragonfly', '~> 1.0'
gem 'factory_girl', '>= 4.2'
gem 'generator_spec', '>= 0.8'
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ This library aims to support and is [tested against][travis] the following Ruby

* Ruby 1.9.3
* Ruby 2.0.0
* Ruby 2.1.1
* Ruby 2.1
* Ruby 2.2
* [Rubinius][]
* [JRuby][]

Expand Down
173 changes: 99 additions & 74 deletions app/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,117 +1,142 @@
/* ==========================================================
* bootstrap-affix.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html#affix
* ==========================================================
* 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"; // jshint ;_;


/* AFFIX CLASS DEFINITION
* ====================== */
/* ========================================================================
* Bootstrap: affix.js v3.2.0
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */


+function ($) {
'use strict';

// AFFIX CLASS DEFINITION
// ======================

var Affix = function (element, options) {
this.options = $.extend({}, $.fn.affix.defaults, options)
this.$window = $(window)
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
this.$element = $(element)
this.options = $.extend({}, Affix.DEFAULTS, options)

this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))

this.$element = $(element)
this.affixed =
this.unpin =
this.pinnedOffset = null

this.checkPosition()
}

Affix.VERSION = '3.2.0'

Affix.RESET = 'affix affix-top affix-bottom'

Affix.DEFAULTS = {
offset: 0,
target: window
}

Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}

Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}

Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return

var scrollHeight = $(document).height()
, scrollTop = this.$window.scrollTop()
, position = this.$element.offset()
, offset = this.options.offset
, offsetBottom = offset.bottom
, offsetTop = offset.top
, reset = 'affix affix-top affix-bottom'
, affix

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top()
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()

affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
'top' : false
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)

var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false

if (this.affixed === affix) return
if (this.unpin != null) this.$element.css('top', '')

this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')

this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
}
this.$element.trigger(e)

if (e.isDefaultPrevented()) return

/* AFFIX PLUGIN DEFINITION
* ======================= */
this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger($.Event(affixType.replace('affix', 'affixed')))

if (affix == 'bottom') {
this.$element.offset({
top: scrollHeight - this.$element.height() - offsetBottom
})
}
}

var old = $.fn.affix

$.fn.affix = function (option) {
// AFFIX PLUGIN DEFINITION
// =======================

function Plugin(option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('affix')
, options = typeof option == 'object' && option
if (!data) $this.data('affix', (data = new Affix(this, options)))
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option

if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}

$.fn.affix.Constructor = Affix
var old = $.fn.affix

$.fn.affix.defaults = {
offset: 0
}
$.fn.affix = Plugin
$.fn.affix.Constructor = Affix


/* AFFIX NO CONFLICT
* ================= */
// AFFIX NO CONFLICT
// =================

$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}


/* AFFIX DATA-API
* ============== */
// AFFIX DATA-API
// ==============

$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
, data = $spy.data()
var data = $spy.data()

data.offset = data.offset || {}

data.offsetBottom && (data.offset.bottom = data.offsetBottom)
data.offsetTop && (data.offset.top = data.offsetTop)
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
if (data.offsetTop) data.offset.top = data.offsetTop

$spy.affix(data)
Plugin.call($spy, data)
})
})


}(window.jQuery);
}(jQuery);
Loading

0 comments on commit a6558ec

Please sign in to comment.