diff --git a/.gitignore b/.gitignore index e106f359..66f097c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.env.testing /.phpstorm.meta.php /vendor /node_modules diff --git a/app/Helpers/macros.php b/app/Helpers/macros.php index 6a449318..87f6a6ec 100644 --- a/app/Helpers/macros.php +++ b/app/Helpers/macros.php @@ -41,7 +41,7 @@ Form::macro('styledFile', function ($name, $multiple = false) { $out = '
- + Browse… diff --git a/app/Http/Controllers/OrganiserDashboardController.php b/app/Http/Controllers/OrganiserDashboardController.php index 3a4a1faa..6851274d 100644 --- a/app/Http/Controllers/OrganiserDashboardController.php +++ b/app/Http/Controllers/OrganiserDashboardController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Organiser; use Carbon\Carbon; +use DB; class OrganiserDashboardController extends MyBaseController { @@ -17,7 +18,6 @@ class OrganiserDashboardController extends MyBaseController { $organiser = Organiser::scope()->findOrFail($organiser_id); $upcoming_events = $organiser->events()->where('end_date', '>=', Carbon::now())->get(); - $data = [ 'organiser' => $organiser, 'upcoming_events' => $upcoming_events, diff --git a/app/Models/Country.php b/app/Models/Country.php new file mode 100644 index 00000000..a03247a4 --- /dev/null +++ b/app/Models/Country.php @@ -0,0 +1,8 @@ +save(); } + /** * Update the amount of views a ticket has earned. diff --git a/app/Models/Organiser.php b/app/Models/Organiser.php index d8ff9786..e34c05d8 100644 --- a/app/Models/Organiser.php +++ b/app/Models/Organiser.php @@ -49,6 +49,16 @@ class Organiser extends MyBaseModel return $this->hasManyThrough('\App\Models\Attendee', '\App\Models\Event'); } + /** + * Get the orders related to an organiser + * + * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough + */ + public function orders() + { + return $this->hasManyThrough('\App\Models\Order', '\App\Models\Event'); + } + /** * Get the full logo path of the organizer. * diff --git a/bower.json b/bower.json index 43b0d135..6c86ad74 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { - "name": "Attendize - Ticket Selling & Event Management", + "name": "attendize-event-ticketing", "version": "1.0.0", "authors": [ "daveearley " @@ -27,7 +27,7 @@ "fontawesome": "~4.2.0", "simplemde": "~1.8.1", "bootstrap-touchspin": "~3.0.1", - "jquery-minicolors": "~2.2.3" + "jquery-minicolors": "^2.2.4" }, "resolutions": { "jquery": ">=1.5", diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index 2dca9f36..98ad829c 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -44,7 +44,7 @@ $factory->define(App\Models\Timezone::class, function (Faker\Generator $faker) { }); -$factory->define(App\Models\Timezone::class, function (Faker\Generator $faker) { +$factory->define(App\Models\DateFormat::class, function (Faker\Generator $faker) { return [ 'format' => "Y-m-d", 'picker_format' => "Y-m-d", @@ -81,9 +81,9 @@ $factory->define(App\Models\Account::class, function (Faker\Generator $faker) { 'last_name' => $faker->lastName, 'email' => $faker->email, 'timezone_id' => factory(App\Models\Timezone::class)->create()->id, - 'date_format_id' => factory(App\Models\Timezone::class)->create()->id, + 'date_format_id' => factory(App\Models\DateFormat::class)->create()->id, 'datetime_format_id' => factory(App\Models\DateTimeFormat::class)->create()->id, - 'currency_id' => factory()->create()->id, + 'currency_id' => factory(App\Models\Currency::class)->create()->id, 'name' => $faker->name, 'last_ip' => "127.0.0.1", 'last_login_date' => Carbon::now()->subDays(2), @@ -92,7 +92,7 @@ $factory->define(App\Models\Account::class, function (Faker\Generator $faker) { 'city' => $faker->city, 'state' => $faker->stateAbbr, 'postal_code' => $faker->postcode, - 'country_id' => factory(App\Models\Country::class)->create()->id, +// 'country_id' => factory(App\Models\Country::class)->create()->id, 'email_footer' => 'Email footer text', 'is_active' => false, 'is_banned' => false, @@ -101,14 +101,13 @@ $factory->define(App\Models\Account::class, function (Faker\Generator $faker) { 'stripe_refresh_token' => str_random(10), 'stripe_secret_key' => str_random(10), 'stripe_publishable_key' => str_random(10), - 'stripe_raw_data' => $faker->text, ]; }); $factory->define(App\Models\User::class, function (Faker\Generator $faker) { return [ - 'account_id' => $faker->randomDigit, + 'account_id' => factory(App\Models\Account::class)->create()->id, 'first_name' => $faker->firstName, 'last_name' => $faker->lastName, 'phone' => $faker->phoneNumber, @@ -270,7 +269,7 @@ $factory->define(App\Models\Attendee::class, function (Faker\Generator $faker) { ]; }); -$faker->define(App\Models\Message::class, function (Faker\Generator $faker) { +$factory->define(App\Models\Message::class, function (Faker\Generator $faker) { return [ 'message' => $faker->text, 'subject' => $faker->text, @@ -279,7 +278,7 @@ $faker->define(App\Models\Message::class, function (Faker\Generator $faker) { ]; }); -$faker->define(App\Models\EventImage::class, function (Faker\Generator $faker) { +$factory->define(App\Models\EventImage::class, function (Faker\Generator $faker) { return [ 'image_path' => $faker->imageUrl(), 'event_id' => factory(App\Models\Event::class)->create()->id, diff --git a/phpunit.xml b/phpunit.xml index 08522be9..f1bd8182 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -18,5 +18,8 @@ + + + diff --git a/public/assets/images/LOGO-NO-TEXT-300x300.png b/public/assets/images/LOGO-NO-TEXT-300x300.png deleted file mode 100644 index e9b0ac3f..00000000 Binary files a/public/assets/images/LOGO-NO-TEXT-300x300.png and /dev/null differ diff --git a/public/assets/images/background.png b/public/assets/images/background.png new file mode 100644 index 00000000..c8d6a9d5 Binary files /dev/null and b/public/assets/images/background.png differ diff --git a/public/assets/images/logo-100x100-darkBg.png b/public/assets/images/logo-100x100-darkBg.png deleted file mode 100644 index 61d168e6..00000000 Binary files a/public/assets/images/logo-100x100-darkBg.png and /dev/null differ diff --git a/public/assets/images/logo-100x100-lightBg.png b/public/assets/images/logo-100x100-lightBg.png deleted file mode 100644 index 98160ba9..00000000 Binary files a/public/assets/images/logo-100x100-lightBg.png and /dev/null differ diff --git a/public/assets/images/logo-300x150-darkBg.png b/public/assets/images/logo-300x150-darkBg.png deleted file mode 100644 index 805ec486..00000000 Binary files a/public/assets/images/logo-300x150-darkBg.png and /dev/null differ diff --git a/public/assets/images/logo-300x300.png b/public/assets/images/logo-300x300.png deleted file mode 100644 index 5eb9ae5a..00000000 Binary files a/public/assets/images/logo-300x300.png and /dev/null differ diff --git a/public/assets/images/logo-dark.png b/public/assets/images/logo-dark.png new file mode 100644 index 00000000..982b994c Binary files /dev/null and b/public/assets/images/logo-dark.png differ diff --git a/public/assets/images/logo-email.png b/public/assets/images/logo-email.png deleted file mode 100644 index 9ca696f0..00000000 Binary files a/public/assets/images/logo-email.png and /dev/null differ diff --git a/public/assets/images/logo-light.png b/public/assets/images/logo-light.png new file mode 100644 index 00000000..4f88330f Binary files /dev/null and b/public/assets/images/logo-light.png differ diff --git a/public/assets/images/logo-white-50.png b/public/assets/images/logo-white-50.png deleted file mode 100644 index 7d81bcc4..00000000 Binary files a/public/assets/images/logo-white-50.png and /dev/null differ diff --git a/public/assets/images/logo-white-65.png b/public/assets/images/logo-white-65.png deleted file mode 100644 index ae238e64..00000000 Binary files a/public/assets/images/logo-white-65.png and /dev/null differ diff --git a/public/assets/images/logo.svg b/public/assets/images/logo.svg deleted file mode 100644 index 4b95869c..00000000 --- a/public/assets/images/logo.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/images/logo_ai.svg b/public/assets/images/logo_ai.svg deleted file mode 100644 index c62fdd46..00000000 --- a/public/assets/images/logo_ai.svg +++ /dev/null @@ -1,152 +0,0 @@ - - - - diff --git a/public/assets/images/splash.jpg b/public/assets/images/splash.jpg deleted file mode 100644 index 682a1624..00000000 Binary files a/public/assets/images/splash.jpg and /dev/null differ diff --git a/public/assets/images/touch/apple-touch-icon-114x114.png b/public/assets/images/touch/apple-touch-icon-114x114.png index 6500f89c..e8b9b30d 100644 Binary files a/public/assets/images/touch/apple-touch-icon-114x114.png and b/public/assets/images/touch/apple-touch-icon-114x114.png differ diff --git a/public/assets/images/touch/apple-touch-icon-120x120.png b/public/assets/images/touch/apple-touch-icon-120x120.png index 1bfc5cb6..5effe8ff 100644 Binary files a/public/assets/images/touch/apple-touch-icon-120x120.png and b/public/assets/images/touch/apple-touch-icon-120x120.png differ diff --git a/public/assets/images/touch/apple-touch-icon-144x144.png b/public/assets/images/touch/apple-touch-icon-144x144.png index 0d4fb5f3..75bda82c 100644 Binary files a/public/assets/images/touch/apple-touch-icon-144x144.png and b/public/assets/images/touch/apple-touch-icon-144x144.png differ diff --git a/public/assets/images/touch/apple-touch-icon-152x152.png b/public/assets/images/touch/apple-touch-icon-152x152.png index 14a70418..943b37da 100644 Binary files a/public/assets/images/touch/apple-touch-icon-152x152.png and b/public/assets/images/touch/apple-touch-icon-152x152.png differ diff --git a/public/assets/images/touch/apple-touch-icon-180x180.png b/public/assets/images/touch/apple-touch-icon-180x180.png deleted file mode 100644 index f2b698b8..00000000 Binary files a/public/assets/images/touch/apple-touch-icon-180x180.png and /dev/null differ diff --git a/public/assets/images/touch/apple-touch-icon-57x57.png b/public/assets/images/touch/apple-touch-icon-57x57.png index 18640d55..53cf4690 100644 Binary files a/public/assets/images/touch/apple-touch-icon-57x57.png and b/public/assets/images/touch/apple-touch-icon-57x57.png differ diff --git a/public/assets/images/touch/apple-touch-icon-60x60.png b/public/assets/images/touch/apple-touch-icon-60x60.png index 1ac344d2..0c017c42 100644 Binary files a/public/assets/images/touch/apple-touch-icon-60x60.png and b/public/assets/images/touch/apple-touch-icon-60x60.png differ diff --git a/public/assets/images/touch/apple-touch-icon-72x72.png b/public/assets/images/touch/apple-touch-icon-72x72.png index 631a99a1..e46754dd 100644 Binary files a/public/assets/images/touch/apple-touch-icon-72x72.png and b/public/assets/images/touch/apple-touch-icon-72x72.png differ diff --git a/public/assets/images/touch/apple-touch-icon-76x76.png b/public/assets/images/touch/apple-touch-icon-76x76.png index 5bc14ab7..3b8745c1 100644 Binary files a/public/assets/images/touch/apple-touch-icon-76x76.png and b/public/assets/images/touch/apple-touch-icon-76x76.png differ diff --git a/public/assets/images/touch/apple-touch-icon-precomposed.png b/public/assets/images/touch/apple-touch-icon-precomposed.png deleted file mode 100644 index 036b4578..00000000 Binary files a/public/assets/images/touch/apple-touch-icon-precomposed.png and /dev/null differ diff --git a/public/assets/images/touch/apple-touch-icon.png b/public/assets/images/touch/apple-touch-icon.png deleted file mode 100644 index f2b698b8..00000000 Binary files a/public/assets/images/touch/apple-touch-icon.png and /dev/null differ diff --git a/public/assets/images/touch/code.txt b/public/assets/images/touch/code.txt new file mode 100644 index 00000000..9940c02e --- /dev/null +++ b/public/assets/images/touch/code.txt @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/images/touch/favicon-128.png b/public/assets/images/touch/favicon-128.png new file mode 100644 index 00000000..95093ecb Binary files /dev/null and b/public/assets/images/touch/favicon-128.png differ diff --git a/public/assets/images/touch/favicon-160x160.png b/public/assets/images/touch/favicon-160x160.png deleted file mode 100644 index 9ba968e5..00000000 Binary files a/public/assets/images/touch/favicon-160x160.png and /dev/null differ diff --git a/public/assets/images/touch/favicon-16x16.png b/public/assets/images/touch/favicon-16x16.png index cdb11868..eddfc16d 100644 Binary files a/public/assets/images/touch/favicon-16x16.png and b/public/assets/images/touch/favicon-16x16.png differ diff --git a/public/assets/images/touch/favicon-192x192.png b/public/assets/images/touch/favicon-192x192.png deleted file mode 100644 index 791baea8..00000000 Binary files a/public/assets/images/touch/favicon-192x192.png and /dev/null differ diff --git a/public/assets/images/touch/favicon-196x196.png b/public/assets/images/touch/favicon-196x196.png new file mode 100644 index 00000000..37ac5fe3 Binary files /dev/null and b/public/assets/images/touch/favicon-196x196.png differ diff --git a/public/assets/images/touch/favicon-32x32.png b/public/assets/images/touch/favicon-32x32.png index 731ebb13..7f49ec12 100644 Binary files a/public/assets/images/touch/favicon-32x32.png and b/public/assets/images/touch/favicon-32x32.png differ diff --git a/public/assets/images/touch/favicon-96x96.png b/public/assets/images/touch/favicon-96x96.png index 9c191c6f..006058cf 100644 Binary files a/public/assets/images/touch/favicon-96x96.png and b/public/assets/images/touch/favicon-96x96.png differ diff --git a/public/assets/images/touch/favicon.ico b/public/assets/images/touch/favicon.ico index 2b8458be..60f4e9d3 100644 Binary files a/public/assets/images/touch/favicon.ico and b/public/assets/images/touch/favicon.ico differ diff --git a/public/assets/images/touch/mstile-144x144.png b/public/assets/images/touch/mstile-144x144.png index 608cd869..75bda82c 100644 Binary files a/public/assets/images/touch/mstile-144x144.png and b/public/assets/images/touch/mstile-144x144.png differ diff --git a/public/assets/images/touch/mstile-150x150.png b/public/assets/images/touch/mstile-150x150.png index 13b38ebb..6daea67a 100644 Binary files a/public/assets/images/touch/mstile-150x150.png and b/public/assets/images/touch/mstile-150x150.png differ diff --git a/public/assets/images/touch/mstile-310x150.png b/public/assets/images/touch/mstile-310x150.png index 29c1477d..267c646a 100644 Binary files a/public/assets/images/touch/mstile-310x150.png and b/public/assets/images/touch/mstile-310x150.png differ diff --git a/public/assets/images/touch/mstile-310x310.png b/public/assets/images/touch/mstile-310x310.png index 15db45d0..6efd7035 100644 Binary files a/public/assets/images/touch/mstile-310x310.png and b/public/assets/images/touch/mstile-310x310.png differ diff --git a/public/assets/images/touch/mstile-70x70.png b/public/assets/images/touch/mstile-70x70.png index 4b3419c8..95093ecb 100644 Binary files a/public/assets/images/touch/mstile-70x70.png and b/public/assets/images/touch/mstile-70x70.png differ diff --git a/public/assets/javascript/backend.js b/public/assets/javascript/backend.js index 4933dc88..fb39532e 100644 --- a/public/assets/javascript/backend.js +++ b/public/assets/javascript/backend.js @@ -1404,29 +1404,25 @@ window.Modernizr = (function( window, document, undefined ) { return Modernizr; })(this, this.document); -;if (!jQuery) { throw new Error("Bootstrap requires jQuery") } +;/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } /* ======================================================================== - * Bootstrap: transition.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#transitions + * Bootstrap: transition.js v3.2.0 + * http://getbootstrap.com/javascript/#transitions * ======================================================================== - * 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. - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ @@ -1435,10 +1431,10 @@ window.Modernizr = (function( window, document, undefined ) { var el = document.createElement('bootstrap') var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd' - , 'MozTransition' : 'transitionend' - , 'OTransition' : 'oTransitionEnd otransitionend' - , 'transition' : 'transitionend' + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' } for (var name in transEndEventNames) { @@ -1446,12 +1442,15 @@ window.Modernizr = (function( window, document, undefined ) { return { end: transEndEventNames[name] } } } + + return false // explicit for ie8 ( ._.) } // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this @@ -1459,31 +1458,31 @@ window.Modernizr = (function( window, document, undefined ) { $(function () { $.support.transition = transitionEnd() + + if (!$.support.transition) return + + $.event.special.bsTransitionEnd = { + bindType: $.support.transition.end, + delegateType: $.support.transition.end, + handle: function (e) { + if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) + } + } }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: alert.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#alerts + * Bootstrap: alert.js v3.2.0 + * http://getbootstrap.com/javascript/#alerts * ======================================================================== - * 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. - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // ALERT CLASS DEFINITION // ====================== @@ -1493,6 +1492,8 @@ window.Modernizr = (function( window, document, undefined ) { $(el).on('click', dismiss, this.close) } + Alert.VERSION = '3.2.0' + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -1517,12 +1518,13 @@ window.Modernizr = (function( window, document, undefined ) { $parent.removeClass('in') function removeElement() { - $parent.trigger('closed.bs.alert').remove() + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent - .one($.support.transition.end, removeElement) + .one('bsTransitionEnd', removeElement) .emulateTransitionEnd(150) : removeElement() } @@ -1531,9 +1533,7 @@ window.Modernizr = (function( window, document, undefined ) { // ALERT PLUGIN DEFINITION // ======================= - var old = $.fn.alert - - $.fn.alert = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') @@ -1543,6 +1543,9 @@ window.Modernizr = (function( window, document, undefined ) { }) } + var old = $.fn.alert + + $.fn.alert = Plugin $.fn.alert.Constructor = Alert @@ -1560,38 +1563,31 @@ window.Modernizr = (function( window, document, undefined ) { $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: button.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#buttons + * Bootstrap: button.js v3.2.0 + * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * 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. - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ============================== var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false } + Button.VERSION = '3.2.0' + Button.DEFAULTS = { loadingText: 'loading...' } @@ -1604,38 +1600,43 @@ window.Modernizr = (function( window, document, undefined ) { state = state + 'Text' - if (!data.resetText) $el.data('resetText', $el[val]()) + if (data.resetText == null) $el.data('resetText', $el[val]()) - $el[val](data[state] || this.options[state]) + $el[val](data[state] == null ? this.options[state] : data[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) + setTimeout($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) } Button.prototype.toggle = function () { + var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { var $input = this.$element.find('input') - .prop('checked', !this.$element.hasClass('active')) - .trigger('change') - if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') } - this.$element.toggleClass('active') + if (changed) this.$element.toggleClass('active') } // BUTTON PLUGIN DEFINITION // ======================== - var old = $.fn.button - - $.fn.button = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') @@ -1648,6 +1649,9 @@ window.Modernizr = (function( window, document, undefined ) { }) } + var old = $.fn.button + + $.fn.button = Plugin $.fn.button.Constructor = Button @@ -1663,42 +1667,32 @@ window.Modernizr = (function( window, document, undefined ) { // BUTTON DATA-API // =============== - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') + Plugin.call($btn, 'toggle') e.preventDefault() }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: carousel.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#carousel + * Bootstrap: carousel.js v3.2.0 + * http://getbootstrap.com/javascript/#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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // CAROUSEL CLASS DEFINITION // ========================= var Carousel = function (element, options) { - this.$element = $(element) + this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this)) this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.paused = @@ -1708,17 +1702,29 @@ window.Modernizr = (function( window, document, undefined ) { this.$items = null this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } + Carousel.VERSION = '3.2.0' + Carousel.DEFAULTS = { - interval: 5000 - , pause: 'hover' - , wrap: true + interval: 5000, + pause: 'hover', + wrap: true } - Carousel.prototype.cycle = function (e) { + Carousel.prototype.keydown = function (e) { + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return + } + + e.preventDefault() + } + + Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) @@ -1730,20 +1736,18 @@ window.Modernizr = (function( window, document, undefined ) { return this } - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - - return this.$items.index(this.$active) + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) } Carousel.prototype.to = function (pos) { var that = this - var activeIndex = this.getActiveIndex() + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) @@ -1752,7 +1756,7 @@ window.Modernizr = (function( window, document, undefined ) { Carousel.prototype.pause = function (e) { e || (this.paused = true) - if (this.$element.find('.next, .prev').length && $.support.transition.end) { + if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) } @@ -1785,44 +1789,47 @@ window.Modernizr = (function( window, document, undefined ) { $next = this.$element.find('.item')[fallback]() } + if ($next.hasClass('active')) return (this.sliding = false) + + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return + this.sliding = true isCycling && this.pause() - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - - if ($next.hasClass('active')) return - if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') } + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active - .one($.support.transition.end, function () { + .one('bsTransitionEnd', function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) }) - .emulateTransitionEnd(600) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger('slid') + this.$element.trigger(slidEvent) } isCycling && this.cycle() @@ -1834,9 +1841,7 @@ window.Modernizr = (function( window, document, undefined ) { // CAROUSEL PLUGIN DEFINITION // ========================== - var old = $.fn.carousel - - $.fn.carousel = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') @@ -1850,6 +1855,9 @@ window.Modernizr = (function( window, document, undefined ) { }) } + var old = $.fn.carousel + + $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel @@ -1866,15 +1874,17 @@ window.Modernizr = (function( window, document, undefined ) { // ================= $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false - $target.carousel(options) + Plugin.call($target, options) - if (slideIndex = $this.attr('data-slide-to')) { + if (slideIndex) { $target.data('bs.carousel').to(slideIndex) } @@ -1884,33 +1894,23 @@ window.Modernizr = (function( window, document, undefined ) { $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) - $carousel.carousel($carousel.data()) + Plugin.call($carousel, $carousel.data()) }) }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: collapse.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#collapse + * Bootstrap: collapse.js v3.2.0 + * http://getbootstrap.com/javascript/#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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION // ================================ @@ -1924,6 +1924,8 @@ window.Modernizr = (function( window, document, undefined ) { if (this.options.toggle) this.toggle() } + Collapse.VERSION = '3.2.0' + Collapse.DEFAULTS = { toggle: true } @@ -1945,7 +1947,7 @@ window.Modernizr = (function( window, document, undefined ) { if (actives && actives.length) { var hasData = actives.data('bs.collapse') if (hasData && hasData.transitioning) return - actives.collapse('hide') + Plugin.call(actives, 'hide') hasData || actives.data('bs.collapse', null) } @@ -1953,18 +1955,17 @@ window.Modernizr = (function( window, document, undefined ) { this.$element .removeClass('collapse') - .addClass('collapsing') - [dimension](0) + .addClass('collapsing')[dimension](0) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') - .addClass('in') - [dimension]('auto') + .addClass('collapse in')[dimension]('') this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') + this.$element + .trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) @@ -1972,9 +1973,8 @@ window.Modernizr = (function( window, document, undefined ) { var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -1986,9 +1986,7 @@ window.Modernizr = (function( window, document, undefined ) { var dimension = this.dimension() - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight + this.$element[dimension](this.$element[dimension]())[0].offsetHeight this.$element .addClass('collapsing') @@ -2009,7 +2007,7 @@ window.Modernizr = (function( window, document, undefined ) { this.$element [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) + .one('bsTransitionEnd', $.proxy(complete, this)) .emulateTransitionEnd(350) } @@ -2021,19 +2019,21 @@ window.Modernizr = (function( window, document, undefined ) { // COLLAPSE PLUGIN DEFINITION // ========================== - var old = $.fn.collapse - - $.fn.collapse = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + if (!data && options.toggle && option == 'show') option = !option if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } + var old = $.fn.collapse + + $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse @@ -2049,11 +2049,12 @@ window.Modernizr = (function( window, document, undefined ) { // COLLAPSE DATA-API // ================= - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var href + var $this = $(this) var target = $this.attr('data-target') || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() @@ -2061,46 +2062,38 @@ window.Modernizr = (function( window, document, undefined ) { var $parent = parent && $(parent) if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') } - $target.collapse(option) + Plugin.call($target, option) }) -}(window.jQuery); +}(jQuery); /* ======================================================================== - * Bootstrap: dropdown.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#dropdowns + * Bootstrap: dropdown.js v3.2.0 + * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== - * 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. + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -+function ($) { "use strict"; ++function ($) { + 'use strict'; // DROPDOWN CLASS DEFINITION // ========================= var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' + var toggle = '[data-toggle="dropdown"]' var Dropdown = function (element) { - var $el = $(element).on('click.bs.dropdown', this.toggle) + $(element).on('click.bs.dropdown', this.toggle) } + Dropdown.VERSION = '3.2.0' + Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -2113,19 +2106,20 @@ window.Modernizr = (function( window, document, undefined ) { if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we we use a backdrop because click events don't delegate + // if mobile we use a backdrop because click events don't delegate $('