kit_cms 2.3.20 → 2.3.22
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/kit/toolbar/smile.png +0 -0
- data/app/assets/images/kit/toolbar/wink.gif +0 -0
- data/app/assets/images/kit/toolbar/wink.png +0 -0
- data/app/assets/javascripts/codemirror/editor.js +55 -17
- data/app/assets/javascripts/codemirror/jquery.js +0 -1
- data/app/assets/javascripts/codemirror/ruby.js +196 -0
- data/app/assets/javascripts/jquery.js +3036 -2838
- data/app/assets/javascripts/kit/utilities.js +655 -586
- data/app/assets/stylesheets/codemirror/style.css +1 -1
- data/app/assets/stylesheets/codemirror/theme.css +23 -3
- data/app/assets/stylesheets/kit/calendar.css +6 -1
- data/app/assets/stylesheets/kit/cms/cms.css +36 -0
- data/app/assets/stylesheets/kit/forums.css +5 -1
- data/app/assets/stylesheets/kit/kit.css +3 -1
- data/app/controllers/account_controller.rb +306 -0
- data/app/controllers/ad_controller.rb +2 -0
- data/app/controllers/admin/ad_units_controller.rb +1 -1
- data/app/controllers/admin/ad_zones_controller.rb +15 -0
- data/app/controllers/admin/ads_controller.rb +5 -0
- data/app/controllers/admin/block_controller.rb +1 -65
- data/app/controllers/admin/blocks_controller.rb +2 -0
- data/app/controllers/admin/content_controller.rb +3 -1
- data/app/controllers/admin/dashboard_controller.rb +28 -4
- data/app/controllers/admin/dj_controller.rb +45 -0
- data/app/controllers/admin/help_controller.rb +1 -1
- data/app/controllers/admin/html_asset_controller.rb +0 -12
- data/app/controllers/admin/q_controller.rb +120 -0
- data/app/controllers/admin/user_controller.rb +4 -4
- data/app/controllers/api_controller.rb +34 -0
- data/app/controllers/calendar_controller.rb +1 -1
- data/app/controllers/form_controller.rb +3 -3
- data/app/controllers/forum_controller.rb +39 -29
- data/app/controllers/kit_controller.rb +42 -15
- data/app/controllers/pages_controller.rb +25 -5
- data/app/controllers/q_controller.rb +235 -0
- data/app/controllers/repo_controller.rb +7 -0
- data/app/controllers/user_controller.rb +14 -10
- data/app/controllers/utility_controller.rb +1 -1
- data/app/helpers/account_helper.rb +47 -0
- data/app/helpers/admin/layouts_helper.rb +8 -0
- data/app/helpers/admin/page_templates_helper.rb +8 -0
- data/app/helpers/ads_helper.rb +11 -12
- data/app/helpers/calendar_helper.rb +6 -2
- data/app/helpers/form_data_helper.rb +1 -1
- data/app/helpers/form_helper.rb +8 -0
- data/app/helpers/forum_helper.rb +5 -1
- data/app/helpers/kit_helper.rb +65 -35
- data/app/helpers/kit_modules_helper.rb +4 -0
- data/app/helpers/user_helper.rb +0 -28
- data/app/jobs/page_link_job.rb +34 -0
- data/app/jobs/queue_job.rb +134 -0
- data/app/mailers/notification.rb +10 -0
- data/app/mailers/queue_mailer.rb +13 -0
- data/app/models/ad.rb +6 -6
- data/app/models/ad_unit.rb +1 -1
- data/app/models/ad_zone.rb +4 -0
- data/app/models/block.rb +1 -1
- data/app/models/delayed_job.rb +3 -0
- data/app/models/form.rb +16 -4
- data/app/models/html_asset.rb +19 -4
- data/app/models/html_asset_usage.rb +3 -0
- data/app/models/html_assetable.rb +4 -0
- data/app/models/layout.rb +36 -6
- data/app/models/newsletter.rb +1 -1
- data/app/models/page.rb +36 -2
- data/app/models/page_link.rb +5 -0
- data/app/models/page_template.rb +22 -2
- data/app/models/preference.rb +1 -1
- data/app/models/q_event.rb +12 -0
- data/app/models/q_klass.rb +5 -0
- data/app/models/q_message.rb +9 -0
- data/app/models/q_publisher.rb +35 -0
- data/app/models/q_subscription.rb +7 -0
- data/app/models/q_user.rb +29 -0
- data/app/models/q_users_method.rb +6 -0
- data/app/models/q_users_publisher.rb +6 -0
- data/app/models/user.rb +127 -19
- data/app/models/user_login.rb +4 -0
- data/app/validators/email_validator.rb +14 -0
- data/app/views/account/_edit.html.haml +40 -0
- data/app/views/account/_edit_intro.html.haml +3 -0
- data/app/views/account/_forgotten.html.haml +20 -0
- data/app/views/account/_forgotten_intro.html.haml +5 -0
- data/app/views/account/_sign_in.html.haml +31 -0
- data/app/views/account/_sign_in_intro.html.haml +4 -0
- data/app/views/account/_sign_up.html.haml +51 -0
- data/app/views/account/_sign_up_intro.html.haml +4 -0
- data/app/views/account/edit.html.haml +1 -0
- data/app/views/account/forgotten.html.haml +1 -0
- data/app/views/account/sign_in.html.haml +2 -0
- data/app/views/account/sign_up.html.haml +1 -0
- data/app/views/ad/_buy.html.haml +2 -1
- data/app/views/admin/ad_zones/_form.html.haml +1 -1
- data/app/views/admin/ad_zones/show.html.haml +2 -0
- data/app/views/admin/blocks/_form.html.haml +11 -1
- data/app/views/admin/dashboard/broken_links.html.haml +9 -0
- data/app/views/admin/dashboard/system.html.haml +11 -0
- data/app/views/admin/dj/index.html.haml +43 -0
- data/app/views/admin/form/_form.html.haml +15 -10
- data/app/views/admin/group/index.html.haml +1 -1
- data/app/views/admin/help/edit.html.haml +1 -1
- data/app/views/admin/html_asset/show.html.haml +9 -2
- data/app/views/admin/layouts/show.html.haml +10 -16
- data/app/views/admin/page_templates/_form.html.haml +9 -17
- data/app/views/admin/page_templates/show.html.haml +5 -4
- data/app/views/admin/q/events.html.haml +26 -0
- data/app/views/admin/q/index.html.haml +28 -0
- data/app/views/admin/q/klasses.html.haml +61 -0
- data/app/views/admin/q/messages.html.haml +37 -0
- data/app/views/admin/q/show.html.haml +98 -0
- data/app/views/admin/q/subscriptions.html.haml +26 -0
- data/app/views/admin/q/users.html.haml +27 -0
- data/app/views/admin/snippet/edit.html.erb +1 -1
- data/app/views/admin/snippet/new.html.erb +1 -1
- data/app/views/admin/stylesheet/show.html.haml +1 -1
- data/app/views/admin/user/index.html.erb +15 -6
- data/app/views/admin/user/view.html.erb +5 -4
- data/app/views/admin/views/_form.html.haml +3 -3
- data/app/views/calendar/_buy_tickets.html.haml +1 -1
- data/app/views/calendar/_calendar_entry.html.haml +1 -1
- data/app/views/calendar/_month.html.haml +7 -7
- data/app/views/form/_show.html.haml +1 -1
- data/app/views/forum/_add_post.html.haml +7 -8
- data/app/views/forum/_mod_thread.js.erb +46 -6
- data/app/views/forum/_post_moderation.html.haml +2 -1
- data/app/views/forum/_post_preview.html.haml +1 -9
- data/app/views/forum/_post_scripts.js.erb +29 -5
- data/app/views/forum/fetch_raw.html.haml +1 -0
- data/app/views/forum/moderate.html.haml +1 -0
- data/app/views/forum/topic_index.html.haml +4 -0
- data/app/views/notification/{event.txt.erb → event.text.erb} +0 -0
- data/app/views/notification/forgotten_password.text.erb +2 -0
- data/app/views/pages/content_edit.html.haml +1 -1
- data/app/views/pages/info.html.erb +13 -2
- data/app/views/pages/links.html.haml +63 -0
- data/app/views/user/edit_profile.html.haml +1 -1
- data/app/views/utility/_cm_editor.html.erb +13 -10
- data/app/views/utility/_cm_toolbar_markdown.html.haml +8 -1
- data/app/views/utility/_menu.html.haml +4 -0
- data/app/views/utility/mercury_html.html.haml +1 -0
- data/config/initializers/elastic_search.rb +6 -3
- data/config/initializers/extend_controller.rb +3 -0
- data/config/initializers/string.rb +9 -6
- data/config/initializers/warden.rb +49 -0
- data/config/locales/en.yml +29 -1
- data/config/routes.rb +35 -2
- data/lib/kit_cms.rb +7 -2
- data/lib/tasks/kit.rake +90 -2
- metadata +139 -27
- data/app/controllers/user/confirmations_controller.rb +0 -11
- data/app/controllers/user/passwords_controller.rb +0 -13
- data/app/controllers/user/registrations_controller.rb +0 -110
- data/app/controllers/user/sessions_controller.rb +0 -33
- data/app/controllers/user/unlocks_controller.rb +0 -13
- data/app/views/devise/_links.erb +0 -25
- data/app/views/devise/confirmations/new.html.erb +0 -12
- data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/devise/passwords/edit.html.erb +0 -16
- data/app/views/devise/passwords/new.html.erb +0 -12
- data/app/views/devise/registrations/edit.html.erb +0 -28
- data/app/views/devise/registrations/new.html.erb +0 -18
- data/app/views/devise/sessions/new.html.erb +0 -18
- data/app/views/devise/shared/_links.erb +0 -25
- data/app/views/devise/unlocks/new.html.erb +0 -12
- data/app/views/pages/links.html.erb +0 -8
- data/app/views/user/shared/_links.erb +0 -25
- data/config/initializers/devise.rb +0 -196
- data/config/initializers/devise_extender.rb +0 -39
@@ -4662,668 +4662,737 @@ timezoneText: 'Time Zone'
|
|
4662
4662
|
}
|
4663
4663
|
});
|
4664
4664
|
|
4665
|
-
/*
|
4666
|
-
* jQuery Nivo Slider v3.1
|
4667
|
-
* http://nivo.dev7studios.com
|
4668
|
-
*
|
4669
|
-
* Copyright 2012, Dev7studios
|
4670
|
-
* Free to use and abuse under the MIT license.
|
4671
|
-
* http://www.opensource.org/licenses/mit-license.php
|
4672
|
-
*/
|
4673
|
-
|
4674
|
-
(function($) {
|
4675
|
-
var NivoSlider = function(element, options){
|
4676
|
-
// Defaults are below
|
4677
|
-
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
|
4678
|
-
|
4679
|
-
// Useful variables. Play carefully.
|
4680
|
-
var vars = {
|
4681
|
-
currentSlide: 0,
|
4682
|
-
currentImage: '',
|
4683
|
-
totalSlides: 0,
|
4684
|
-
running: false,
|
4685
|
-
paused: false,
|
4686
|
-
stop: false,
|
4687
|
-
controlNavEl: false
|
4688
|
-
};
|
4689
|
-
|
4690
|
-
// Get this slider
|
4691
|
-
var slider = $(element);
|
4692
|
-
slider.data('nivo:vars', vars).addClass('nivoSlider');
|
4693
|
-
|
4694
|
-
// Find our slider children
|
4695
|
-
var kids = slider.children();
|
4696
|
-
kids.each(function() {
|
4697
|
-
var child = $(this);
|
4698
|
-
var link = '';
|
4699
|
-
if(!child.is('img')){
|
4700
|
-
if(child.is('a')){
|
4701
|
-
child.addClass('nivo-imageLink');
|
4702
|
-
link = child;
|
4703
|
-
}
|
4704
|
-
child = child.find('img:first');
|
4705
|
-
}
|
4706
|
-
// Get img width & height
|
4707
|
-
var childWidth = (childWidth === 0) ? child.attr('width') : child.width(),
|
4708
|
-
childHeight = (childHeight === 0) ? child.attr('height') : child.height();
|
4709
|
-
|
4710
|
-
if(link !== ''){
|
4711
|
-
link.css('display','none');
|
4712
|
-
}
|
4713
|
-
child.css('display','none');
|
4714
|
-
vars.totalSlides++;
|
4715
|
-
});
|
4716
4665
|
|
4717
|
-
// If randomStart
|
4718
|
-
if(settings.randomStart){
|
4719
|
-
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
|
4720
|
-
}
|
4721
|
-
|
4722
|
-
// Set startSlide
|
4723
|
-
if(settings.startSlide > 0){
|
4724
|
-
if(settings.startSlide >= vars.totalSlides) { settings.startSlide = vars.totalSlides - 1; }
|
4725
|
-
vars.currentSlide = settings.startSlide;
|
4726
|
-
}
|
4727
4666
|
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
if($(kids[vars.currentSlide]).is('a')){
|
4737
|
-
$(kids[vars.currentSlide]).css('display','block');
|
4738
|
-
}
|
4667
|
+
/*
|
4668
|
+
* jQuery Nivo Slider v3.2
|
4669
|
+
* http://nivo.dev7studios.com
|
4670
|
+
*
|
4671
|
+
* Copyright 2012, Dev7studios
|
4672
|
+
* Free to use and abuse under the MIT license.
|
4673
|
+
* http://www.opensource.org/licenses/mit-license.php
|
4674
|
+
*/
|
4739
4675
|
|
4740
|
-
|
4741
|
-
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
|
4749
|
-
|
4750
|
-
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
|
4676
|
+
(function($) {
|
4677
|
+
var NivoSlider = function(element, options){
|
4678
|
+
// Defaults are below
|
4679
|
+
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
|
4680
|
+
|
4681
|
+
// Useful variables. Play carefully.
|
4682
|
+
var vars = {
|
4683
|
+
currentSlide: 0,
|
4684
|
+
currentImage: '',
|
4685
|
+
totalSlides: 0,
|
4686
|
+
running: false,
|
4687
|
+
paused: false,
|
4688
|
+
stop: false,
|
4689
|
+
controlNavEl: false
|
4690
|
+
};
|
4755
4691
|
|
4756
|
-
|
4757
|
-
|
4692
|
+
// Get this slider
|
4693
|
+
var slider = $(element);
|
4694
|
+
slider.data('nivo:vars', vars).addClass('nivoSlider');
|
4758
4695
|
|
4759
|
-
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
|
4764
|
-
|
4696
|
+
// Find our slider children
|
4697
|
+
var kids = slider.children();
|
4698
|
+
kids.each(function() {
|
4699
|
+
var child = $(this);
|
4700
|
+
var link = '';
|
4701
|
+
if(!child.is('img')){
|
4702
|
+
if(child.is('a')){
|
4703
|
+
child.addClass('nivo-imageLink');
|
4704
|
+
link = child;
|
4705
|
+
}
|
4706
|
+
child = child.find('img:first');
|
4707
|
+
}
|
4708
|
+
// Get img width & height
|
4709
|
+
var childWidth = (childWidth === 0) ? child.attr('width') : child.width(),
|
4710
|
+
childHeight = (childHeight === 0) ? child.attr('height') : child.height();
|
4765
4711
|
|
4766
|
-
|
4767
|
-
|
4768
|
-
|
4769
|
-
|
4770
|
-
|
4771
|
-
|
4772
|
-
|
4773
|
-
|
4712
|
+
if(link !== ''){
|
4713
|
+
link.css('display','none');
|
4714
|
+
}
|
4715
|
+
child.css('display','none');
|
4716
|
+
vars.totalSlides++;
|
4717
|
+
});
|
4718
|
+
|
4719
|
+
// If randomStart
|
4720
|
+
if(settings.randomStart){
|
4721
|
+
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
|
4722
|
+
}
|
4723
|
+
|
4724
|
+
// Set startSlide
|
4725
|
+
if(settings.startSlide > 0){
|
4726
|
+
if(settings.startSlide >= vars.totalSlides) { settings.startSlide = vars.totalSlides - 1; }
|
4727
|
+
vars.currentSlide = settings.startSlide;
|
4728
|
+
}
|
4729
|
+
|
4730
|
+
// Get initial image
|
4731
|
+
if($(kids[vars.currentSlide]).is('img')){
|
4732
|
+
vars.currentImage = $(kids[vars.currentSlide]);
|
4774
4733
|
} else {
|
4775
|
-
|
4734
|
+
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
|
4776
4735
|
}
|
4777
|
-
|
4778
|
-
|
4779
|
-
|
4780
|
-
|
4781
|
-
|
4782
|
-
|
4783
|
-
|
4784
|
-
|
4785
|
-
|
4786
|
-
|
4787
|
-
|
4788
|
-
|
4789
|
-
|
4790
|
-
|
4791
|
-
|
4792
|
-
|
4793
|
-
|
4794
|
-
|
4795
|
-
timer = '';
|
4796
|
-
vars.currentSlide -= 2;
|
4797
|
-
nivoRun(slider, kids, settings, 'prev');
|
4736
|
+
|
4737
|
+
// Show initial link
|
4738
|
+
if($(kids[vars.currentSlide]).is('a')){
|
4739
|
+
$(kids[vars.currentSlide]).css('display','block');
|
4740
|
+
}
|
4741
|
+
|
4742
|
+
// Set first background
|
4743
|
+
var sliderImg = $('<img/>').addClass('nivo-main-image');
|
4744
|
+
sliderImg.attr('src', vars.currentImage.attr('src')).show();
|
4745
|
+
slider.append(sliderImg);
|
4746
|
+
|
4747
|
+
// Detect Window Resize
|
4748
|
+
$(window).resize(function() {
|
4749
|
+
slider.children('img').width(slider.width());
|
4750
|
+
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4751
|
+
sliderImg.stop().height('auto');
|
4752
|
+
$('.nivo-slice').remove();
|
4753
|
+
$('.nivo-box').remove();
|
4798
4754
|
});
|
4799
4755
|
|
4800
|
-
|
4801
|
-
|
4802
|
-
|
4803
|
-
|
4804
|
-
|
4805
|
-
|
4806
|
-
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4811
|
-
|
4812
|
-
|
4813
|
-
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4756
|
+
//Create caption
|
4757
|
+
slider.append($('<div class="nivo-caption"></div>'));
|
4758
|
+
|
4759
|
+
// Process caption function
|
4760
|
+
var processCaption = function(settings){
|
4761
|
+
var nivoCaption = $('.nivo-caption', slider);
|
4762
|
+
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
|
4763
|
+
var title = vars.currentImage.attr('title');
|
4764
|
+
if(title.substr(0,1) == '#') title = $(title).html();
|
4765
|
+
|
4766
|
+
if(nivoCaption.css('display') == 'block'){
|
4767
|
+
setTimeout(function(){
|
4768
|
+
nivoCaption.html(title);
|
4769
|
+
}, settings.animSpeed);
|
4770
|
+
} else {
|
4771
|
+
nivoCaption.html(title);
|
4772
|
+
nivoCaption.stop().fadeIn(settings.animSpeed);
|
4773
|
+
}
|
4774
|
+
} else {
|
4775
|
+
nivoCaption.stop().fadeOut(settings.animSpeed);
|
4818
4776
|
}
|
4819
|
-
if(child.attr('data-thumb')) vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('data-thumb') +'" alt="" /></a>');
|
4820
|
-
} else {
|
4821
|
-
vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
|
4822
|
-
}
|
4823
4777
|
}
|
4824
|
-
|
4825
|
-
//
|
4826
|
-
|
4827
|
-
|
4828
|
-
|
4829
|
-
|
4830
|
-
|
4831
|
-
|
4832
|
-
|
4833
|
-
|
4834
|
-
|
4835
|
-
|
4778
|
+
|
4779
|
+
//Process initial caption
|
4780
|
+
processCaption(settings);
|
4781
|
+
|
4782
|
+
// In the words of Super Mario "let's a go!"
|
4783
|
+
var timer = 0;
|
4784
|
+
if(!settings.manualAdvance && kids.length > 1){
|
4785
|
+
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
4786
|
+
}
|
4787
|
+
|
4788
|
+
// Add Direction nav
|
4789
|
+
if(settings.directionNav){
|
4790
|
+
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>');
|
4791
|
+
|
4792
|
+
$(slider).on('click', 'a.nivo-prevNav', function(){
|
4793
|
+
if(vars.running) { return false; }
|
4794
|
+
clearInterval(timer);
|
4795
|
+
timer = '';
|
4796
|
+
vars.currentSlide -= 2;
|
4797
|
+
nivoRun(slider, kids, settings, 'prev');
|
4836
4798
|
});
|
4799
|
+
|
4800
|
+
$(slider).on('click', 'a.nivo-nextNav', function(){
|
4801
|
+
if(vars.running) { return false; }
|
4802
|
+
clearInterval(timer);
|
4803
|
+
timer = '';
|
4804
|
+
nivoRun(slider, kids, settings, 'next');
|
4805
|
+
});
|
4806
|
+
}
|
4807
|
+
|
4808
|
+
// Add Control nav
|
4809
|
+
if(settings.controlNav){
|
4810
|
+
vars.controlNavEl = $('<div class="nivo-controlNav"></div>');
|
4811
|
+
slider.after(vars.controlNavEl);
|
4812
|
+
for(var i = 0; i < kids.length; i++){
|
4813
|
+
if(settings.controlNavThumbs){
|
4814
|
+
vars.controlNavEl.addClass('nivo-thumbs-enabled');
|
4815
|
+
var child = kids.eq(i);
|
4816
|
+
if(!child.is('img')){
|
4817
|
+
child = child.find('img:first');
|
4818
|
+
}
|
4819
|
+
if(child.attr('data-thumb')) vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('data-thumb') +'" alt="" /></a>');
|
4820
|
+
} else {
|
4821
|
+
vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
|
4822
|
+
}
|
4837
4823
|
}
|
4838
4824
|
|
4839
|
-
//
|
4840
|
-
|
4841
|
-
|
4825
|
+
//Set initial active link
|
4826
|
+
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
|
4827
|
+
|
4828
|
+
$('a', vars.controlNavEl).bind('click', function(){
|
4829
|
+
if(vars.running) return false;
|
4830
|
+
if($(this).hasClass('active')) return false;
|
4831
|
+
clearInterval(timer);
|
4832
|
+
timer = '';
|
4833
|
+
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4834
|
+
vars.currentSlide = $(this).attr('rel') - 1;
|
4835
|
+
nivoRun(slider, kids, settings, 'control');
|
4836
|
+
});
|
4837
|
+
}
|
4838
|
+
|
4839
|
+
//For pauseOnHover setting
|
4840
|
+
if(settings.pauseOnHover){
|
4841
|
+
slider.hover(function(){
|
4842
4842
|
vars.paused = true;
|
4843
4843
|
clearInterval(timer);
|
4844
4844
|
timer = '';
|
4845
|
-
|
4845
|
+
}, function(){
|
4846
4846
|
vars.paused = false;
|
4847
4847
|
// Restart the timer
|
4848
4848
|
if(timer === '' && !settings.manualAdvance){
|
4849
|
-
|
4849
|
+
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
4850
4850
|
}
|
4851
|
-
|
4852
|
-
|
4853
|
-
|
4854
|
-
|
4855
|
-
|
4856
|
-
|
4857
|
-
|
4858
|
-
|
4859
|
-
|
4851
|
+
});
|
4852
|
+
}
|
4853
|
+
|
4854
|
+
// Event when Animation finishes
|
4855
|
+
slider.bind('nivo:animFinished', function(){
|
4856
|
+
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4857
|
+
vars.running = false;
|
4858
|
+
// Hide child links
|
4859
|
+
$(kids).each(function(){
|
4860
4860
|
if($(this).is('a')){
|
4861
|
-
|
4861
|
+
$(this).css('display','none');
|
4862
4862
|
}
|
4863
|
-
|
4864
|
-
|
4865
|
-
|
4863
|
+
});
|
4864
|
+
// Show current link
|
4865
|
+
if($(kids[vars.currentSlide]).is('a')){
|
4866
4866
|
$(kids[vars.currentSlide]).css('display','block');
|
4867
|
-
|
4868
|
-
|
4869
|
-
|
4867
|
+
}
|
4868
|
+
// Restart the timer
|
4869
|
+
if(timer === '' && !vars.paused && !settings.manualAdvance){
|
4870
4870
|
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
4871
|
-
|
4872
|
-
|
4873
|
-
|
4874
|
-
|
4875
|
-
|
4876
|
-
|
4877
|
-
|
4878
|
-
|
4879
|
-
|
4880
|
-
|
4881
|
-
|
4882
|
-
|
4871
|
+
}
|
4872
|
+
// Trigger the afterChange callback
|
4873
|
+
settings.afterChange.call(this);
|
4874
|
+
});
|
4875
|
+
|
4876
|
+
// Add slices for slice animations
|
4877
|
+
var createSlices = function(slider, settings, vars) {
|
4878
|
+
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
|
4879
|
+
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
|
4880
|
+
var sliceHeight = ($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().is('a')) ? $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().height() : $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height();
|
4881
|
+
|
4882
|
+
for(var i = 0; i < settings.slices; i++){
|
4883
4883
|
var sliceWidth = Math.round(slider.width()/settings.slices);
|
4884
|
-
|
4884
|
+
|
4885
4885
|
if(i === settings.slices-1){
|
4886
|
-
|
4887
|
-
|
4888
|
-
|
4889
|
-
|
4890
|
-
|
4891
|
-
|
4892
|
-
|
4893
|
-
|
4894
|
-
|
4886
|
+
slider.append(
|
4887
|
+
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
|
4888
|
+
left:(sliceWidth*i)+'px',
|
4889
|
+
width:(slider.width()-(sliceWidth*i))+'px',
|
4890
|
+
height:sliceHeight+'px',
|
4891
|
+
opacity:'0',
|
4892
|
+
overflow:'hidden'
|
4893
|
+
})
|
4894
|
+
);
|
4895
4895
|
} else {
|
4896
|
-
|
4897
|
-
|
4898
|
-
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4902
|
-
|
4903
|
-
|
4904
|
-
|
4896
|
+
slider.append(
|
4897
|
+
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
|
4898
|
+
left:(sliceWidth*i)+'px',
|
4899
|
+
width:sliceWidth+'px',
|
4900
|
+
height:sliceHeight+'px',
|
4901
|
+
opacity:'0',
|
4902
|
+
overflow:'hidden'
|
4903
|
+
})
|
4904
|
+
);
|
4905
4905
|
}
|
4906
|
-
|
4907
|
-
|
4908
|
-
|
4909
|
-
|
4906
|
+
}
|
4907
|
+
|
4908
|
+
$('.nivo-slice', slider).height(sliceHeight);
|
4909
|
+
sliderImg.stop().animate({
|
4910
4910
|
height: $(vars.currentImage).height()
|
4911
|
-
|
4912
|
-
|
4913
|
-
|
4914
|
-
|
4915
|
-
|
4916
|
-
|
4917
|
-
|
4918
|
-
|
4919
|
-
|
4920
|
-
|
4921
|
-
|
4922
|
-
|
4911
|
+
}, settings.animSpeed);
|
4912
|
+
};
|
4913
|
+
|
4914
|
+
// Add boxes for box animations
|
4915
|
+
var createBoxes = function(slider, settings, vars){
|
4916
|
+
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
|
4917
|
+
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
|
4918
|
+
var boxWidth = Math.round(slider.width()/settings.boxCols),
|
4919
|
+
boxHeight = Math.round($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height() / settings.boxRows);
|
4920
|
+
|
4921
|
+
|
4922
|
+
for(var rows = 0; rows < settings.boxRows; rows++){
|
4923
4923
|
for(var cols = 0; cols < settings.boxCols; cols++){
|
4924
|
-
|
4925
|
-
|
4926
|
-
|
4927
|
-
|
4928
|
-
|
4929
|
-
|
4930
|
-
|
4931
|
-
|
4932
|
-
|
4924
|
+
if(cols === settings.boxCols-1){
|
4925
|
+
slider.append(
|
4926
|
+
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
|
4927
|
+
opacity:0,
|
4928
|
+
left:(boxWidth*cols)+'px',
|
4929
|
+
top:(boxHeight*rows)+'px',
|
4930
|
+
width:(slider.width()-(boxWidth*cols))+'px'
|
4931
|
+
|
4932
|
+
})
|
4933
4933
|
);
|
4934
|
-
|
4935
|
-
|
4936
|
-
|
4937
|
-
|
4938
|
-
|
4939
|
-
|
4940
|
-
|
4941
|
-
|
4942
|
-
|
4934
|
+
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
|
4935
|
+
} else {
|
4936
|
+
slider.append(
|
4937
|
+
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
|
4938
|
+
opacity:0,
|
4939
|
+
left:(boxWidth*cols)+'px',
|
4940
|
+
top:(boxHeight*rows)+'px',
|
4941
|
+
width:boxWidth+'px'
|
4942
|
+
})
|
4943
4943
|
);
|
4944
|
-
|
4945
|
-
|
4944
|
+
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
|
4945
|
+
}
|
4946
4946
|
}
|
4947
|
-
|
4948
|
-
|
4949
|
-
|
4947
|
+
}
|
4948
|
+
|
4949
|
+
sliderImg.stop().animate({
|
4950
4950
|
height: $(vars.currentImage).height()
|
4951
|
-
|
4952
|
-
|
4953
|
-
|
4954
|
-
// Private run method
|
4955
|
-
var nivoRun = function(slider, kids, settings, nudge){
|
4956
|
-
// Get our vars
|
4957
|
-
var vars = slider.data('nivo:vars');
|
4951
|
+
}, settings.animSpeed);
|
4952
|
+
};
|
4958
4953
|
|
4959
|
-
|
4960
|
-
|
4954
|
+
// Private run method
|
4955
|
+
var nivoRun = function(slider, kids, settings, nudge){
|
4956
|
+
// Get our vars
|
4957
|
+
var vars = slider.data('nivo:vars');
|
4958
|
+
|
4959
|
+
// Trigger the lastSlide callback
|
4960
|
+
if(vars && (vars.currentSlide === vars.totalSlides - 1)){
|
4961
4961
|
settings.lastSlide.call(this);
|
4962
|
-
|
4963
|
-
|
4964
|
-
|
4965
|
-
|
4966
|
-
|
4967
|
-
|
4968
|
-
|
4969
|
-
|
4970
|
-
|
4971
|
-
|
4962
|
+
}
|
4963
|
+
|
4964
|
+
// Stop
|
4965
|
+
if((!vars || vars.stop) && !nudge) { return false; }
|
4966
|
+
|
4967
|
+
// Trigger the beforeChange callback
|
4968
|
+
settings.beforeChange.call(this);
|
4969
|
+
|
4970
|
+
// Set current background before change
|
4971
|
+
if(!nudge){
|
4972
4972
|
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4973
|
-
|
4973
|
+
} else {
|
4974
4974
|
if(nudge === 'prev'){
|
4975
|
-
|
4975
|
+
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4976
4976
|
}
|
4977
4977
|
if(nudge === 'next'){
|
4978
|
-
|
4978
|
+
sliderImg.attr('src', vars.currentImage.attr('src'));
|
4979
4979
|
}
|
4980
|
-
|
4981
|
-
|
4982
|
-
|
4983
|
-
|
4984
|
-
|
4980
|
+
}
|
4981
|
+
|
4982
|
+
vars.currentSlide++;
|
4983
|
+
// Trigger the slideshowEnd callback
|
4984
|
+
if(vars.currentSlide === vars.totalSlides){
|
4985
4985
|
vars.currentSlide = 0;
|
4986
4986
|
settings.slideshowEnd.call(this);
|
4987
|
-
|
4988
|
-
|
4989
|
-
|
4990
|
-
|
4987
|
+
}
|
4988
|
+
if(vars.currentSlide < 0) { vars.currentSlide = (vars.totalSlides - 1); }
|
4989
|
+
// Set vars.currentImage
|
4990
|
+
if($(kids[vars.currentSlide]).is('img')){
|
4991
4991
|
vars.currentImage = $(kids[vars.currentSlide]);
|
4992
|
-
|
4992
|
+
} else {
|
4993
4993
|
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
|
4994
|
-
|
4995
|
-
|
4996
|
-
|
4997
|
-
|
4994
|
+
}
|
4995
|
+
|
4996
|
+
// Set active links
|
4997
|
+
if(settings.controlNav){
|
4998
4998
|
$('a', vars.controlNavEl).removeClass('active');
|
4999
4999
|
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
|
5000
|
-
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
|
5026
|
-
|
5027
|
-
|
5028
|
-
|
5029
|
-
|
5030
|
-
|
5031
|
-
|
5032
|
-
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
|
5038
|
-
|
5039
|
-
|
5040
|
-
|
5041
|
-
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
|
5054
|
-
|
5000
|
+
}
|
5001
|
+
|
5002
|
+
// Process caption
|
5003
|
+
processCaption(settings);
|
5004
|
+
|
5005
|
+
// Remove any slices from last transition
|
5006
|
+
$('.nivo-slice', slider).remove();
|
5007
|
+
|
5008
|
+
// Remove any boxes from last transition
|
5009
|
+
$('.nivo-box', slider).remove();
|
5010
|
+
|
5011
|
+
var currentEffect = settings.effect,
|
5012
|
+
anims = '';
|
5013
|
+
|
5014
|
+
// Generate random effect
|
5015
|
+
if(settings.effect === 'random'){
|
5016
|
+
anims = new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade',
|
5017
|
+
'boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse');
|
5018
|
+
currentEffect = anims[Math.floor(Math.random()*(anims.length + 1))];
|
5019
|
+
if(currentEffect === undefined) { currentEffect = 'fade'; }
|
5020
|
+
}
|
5021
|
+
|
5022
|
+
// Run random effect from specified set (eg: effect:'fold,fade')
|
5023
|
+
if(settings.effect.indexOf(',') !== -1){
|
5024
|
+
anims = settings.effect.split(',');
|
5025
|
+
currentEffect = anims[Math.floor(Math.random()*(anims.length))];
|
5026
|
+
if(currentEffect === undefined) { currentEffect = 'fade'; }
|
5027
|
+
}
|
5028
|
+
|
5029
|
+
// Custom transition as defined by "data-transition" attribute
|
5030
|
+
if(vars.currentImage.attr('data-transition')){
|
5031
|
+
currentEffect = vars.currentImage.attr('data-transition');
|
5032
|
+
}
|
5033
|
+
|
5034
|
+
// Run effects
|
5035
|
+
vars.running = true;
|
5036
|
+
var timeBuff = 0,
|
5037
|
+
i = 0,
|
5038
|
+
slices = '',
|
5039
|
+
firstSlice = '',
|
5040
|
+
totalBoxes = '',
|
5041
|
+
boxes = '';
|
5042
|
+
|
5043
|
+
if(currentEffect === 'sliceDown' || currentEffect === 'sliceDownRight' || currentEffect === 'sliceDownLeft'){
|
5044
|
+
createSlices(slider, settings, vars);
|
5045
|
+
timeBuff = 0;
|
5046
|
+
i = 0;
|
5047
|
+
slices = $('.nivo-slice', slider);
|
5048
|
+
if(currentEffect === 'sliceDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
5049
|
+
|
5050
|
+
slices.each(function(){
|
5051
|
+
var slice = $(this);
|
5052
|
+
slice.css({ 'top': '0px' });
|
5053
|
+
if(i === settings.slices-1){
|
5054
|
+
setTimeout(function(){
|
5055
5055
|
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
5056
|
-
|
5057
|
-
|
5058
|
-
|
5056
|
+
}, (100 + timeBuff));
|
5057
|
+
} else {
|
5058
|
+
setTimeout(function(){
|
5059
5059
|
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
5060
|
-
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
|
5070
|
-
|
5071
|
-
|
5072
|
-
|
5073
|
-
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5060
|
+
}, (100 + timeBuff));
|
5061
|
+
}
|
5062
|
+
timeBuff += 50;
|
5063
|
+
i++;
|
5064
|
+
});
|
5065
|
+
} else if(currentEffect === 'sliceUp' || currentEffect === 'sliceUpRight' || currentEffect === 'sliceUpLeft'){
|
5066
|
+
createSlices(slider, settings, vars);
|
5067
|
+
timeBuff = 0;
|
5068
|
+
i = 0;
|
5069
|
+
slices = $('.nivo-slice', slider);
|
5070
|
+
if(currentEffect === 'sliceUpLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
5071
|
+
|
5072
|
+
slices.each(function(){
|
5073
|
+
var slice = $(this);
|
5074
|
+
slice.css({ 'bottom': '0px' });
|
5075
|
+
if(i === settings.slices-1){
|
5076
|
+
setTimeout(function(){
|
5077
5077
|
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
5078
|
-
|
5079
|
-
|
5080
|
-
|
5078
|
+
}, (100 + timeBuff));
|
5079
|
+
} else {
|
5080
|
+
setTimeout(function(){
|
5081
5081
|
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5082
|
+
}, (100 + timeBuff));
|
5083
|
+
}
|
5084
|
+
timeBuff += 50;
|
5085
|
+
i++;
|
5086
|
+
});
|
5087
|
+
} else if(currentEffect === 'sliceUpDown' || currentEffect === 'sliceUpDownRight' || currentEffect === 'sliceUpDownLeft'){
|
5088
|
+
createSlices(slider, settings, vars);
|
5089
|
+
timeBuff = 0;
|
5090
|
+
i = 0;
|
5091
|
+
var v = 0;
|
5092
|
+
slices = $('.nivo-slice', slider);
|
5093
|
+
if(currentEffect === 'sliceUpDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
5094
|
+
|
5095
|
+
slices.each(function(){
|
5096
|
+
var slice = $(this);
|
5097
|
+
if(i === 0){
|
5098
|
+
slice.css('top','0px');
|
5085
5099
|
i++;
|
5086
|
-
|
5087
|
-
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
5093
|
-
if(currentEffect === 'sliceUpDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
5094
|
-
|
5095
|
-
slices.each(function(){
|
5096
|
-
var slice = $(this);
|
5097
|
-
if(i === 0){
|
5098
|
-
slice.css('top','0px');
|
5099
|
-
i++;
|
5100
|
-
} else {
|
5101
|
-
slice.css('bottom','0px');
|
5102
|
-
i = 0;
|
5103
|
-
}
|
5104
|
-
|
5105
|
-
if(v === settings.slices-1){
|
5106
|
-
setTimeout(function(){
|
5100
|
+
} else {
|
5101
|
+
slice.css('bottom','0px');
|
5102
|
+
i = 0;
|
5103
|
+
}
|
5104
|
+
|
5105
|
+
if(v === settings.slices-1){
|
5106
|
+
setTimeout(function(){
|
5107
5107
|
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
5108
|
-
|
5109
|
-
|
5110
|
-
|
5108
|
+
}, (100 + timeBuff));
|
5109
|
+
} else {
|
5110
|
+
setTimeout(function(){
|
5111
5111
|
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5115
|
-
|
5116
|
-
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
|
5126
|
-
|
5127
|
-
|
5112
|
+
}, (100 + timeBuff));
|
5113
|
+
}
|
5114
|
+
timeBuff += 50;
|
5115
|
+
v++;
|
5116
|
+
});
|
5117
|
+
} else if(currentEffect === 'fold'){
|
5118
|
+
createSlices(slider, settings, vars);
|
5119
|
+
timeBuff = 0;
|
5120
|
+
i = 0;
|
5121
|
+
|
5122
|
+
$('.nivo-slice', slider).each(function(){
|
5123
|
+
var slice = $(this);
|
5124
|
+
var origWidth = slice.width();
|
5125
|
+
slice.css({ top:'0px', width:'0px' });
|
5126
|
+
if(i === settings.slices-1){
|
5127
|
+
setTimeout(function(){
|
5128
5128
|
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
5129
|
-
|
5130
|
-
|
5131
|
-
|
5129
|
+
}, (100 + timeBuff));
|
5130
|
+
} else {
|
5131
|
+
setTimeout(function(){
|
5132
5132
|
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
|
5133
|
-
|
5134
|
-
|
5135
|
-
|
5136
|
-
|
5137
|
-
|
5138
|
-
|
5139
|
-
|
5140
|
-
|
5141
|
-
|
5142
|
-
|
5143
|
-
|
5144
|
-
|
5145
|
-
|
5146
|
-
|
5147
|
-
|
5148
|
-
|
5149
|
-
|
5150
|
-
|
5151
|
-
|
5152
|
-
|
5153
|
-
|
5154
|
-
|
5155
|
-
|
5156
|
-
|
5157
|
-
|
5158
|
-
|
5159
|
-
|
5160
|
-
|
5161
|
-
|
5162
|
-
|
5163
|
-
|
5164
|
-
|
5165
|
-
|
5166
|
-
|
5167
|
-
|
5168
|
-
|
5169
|
-
|
5170
|
-
|
5171
|
-
|
5172
|
-
|
5173
|
-
|
5174
|
-
|
5175
|
-
|
5176
|
-
|
5177
|
-
|
5178
|
-
|
5179
|
-
|
5180
|
-
|
5181
|
-
|
5182
|
-
|
5183
|
-
|
5184
|
-
|
5185
|
-
|
5186
|
-
|
5187
|
-
|
5133
|
+
}, (100 + timeBuff));
|
5134
|
+
}
|
5135
|
+
timeBuff += 50;
|
5136
|
+
i++;
|
5137
|
+
});
|
5138
|
+
} else if(currentEffect === 'fade'){
|
5139
|
+
createSlices(slider, settings, vars);
|
5140
|
+
|
5141
|
+
firstSlice = $('.nivo-slice:first', slider);
|
5142
|
+
firstSlice.css({
|
5143
|
+
'width': slider.width() + 'px'
|
5144
|
+
});
|
5145
|
+
|
5146
|
+
firstSlice.animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
|
5147
|
+
} else if(currentEffect === 'slideInRight'){
|
5148
|
+
createSlices(slider, settings, vars);
|
5149
|
+
|
5150
|
+
firstSlice = $('.nivo-slice:first', slider);
|
5151
|
+
firstSlice.css({
|
5152
|
+
'width': '0px',
|
5153
|
+
'opacity': '1'
|
5154
|
+
});
|
5155
|
+
|
5156
|
+
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
|
5157
|
+
} else if(currentEffect === 'slideInLeft'){
|
5158
|
+
createSlices(slider, settings, vars);
|
5159
|
+
|
5160
|
+
firstSlice = $('.nivo-slice:first', slider);
|
5161
|
+
firstSlice.css({
|
5162
|
+
'width': '0px',
|
5163
|
+
'opacity': '1',
|
5164
|
+
'left': '',
|
5165
|
+
'right': '0px'
|
5166
|
+
});
|
5167
|
+
|
5168
|
+
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){
|
5169
|
+
// Reset positioning
|
5170
|
+
firstSlice.css({
|
5171
|
+
'left': '0px',
|
5172
|
+
'right': ''
|
5173
|
+
});
|
5174
|
+
slider.trigger('nivo:animFinished');
|
5175
|
+
});
|
5176
|
+
} else if(currentEffect === 'boxRandom'){
|
5177
|
+
createBoxes(slider, settings, vars);
|
5178
|
+
|
5179
|
+
totalBoxes = settings.boxCols * settings.boxRows;
|
5180
|
+
i = 0;
|
5181
|
+
timeBuff = 0;
|
5182
|
+
|
5183
|
+
boxes = shuffle($('.nivo-box', slider));
|
5184
|
+
boxes.each(function(){
|
5185
|
+
var box = $(this);
|
5186
|
+
if(i === totalBoxes-1){
|
5187
|
+
setTimeout(function(){
|
5188
5188
|
box.animate({ opacity:'1' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
5189
|
-
|
5190
|
-
|
5191
|
-
|
5189
|
+
}, (100 + timeBuff));
|
5190
|
+
} else {
|
5191
|
+
setTimeout(function(){
|
5192
5192
|
box.animate({ opacity:'1' }, settings.animSpeed);
|
5193
|
-
|
5194
|
-
|
5195
|
-
|
5196
|
-
|
5197
|
-
|
5198
|
-
|
5199
|
-
|
5200
|
-
|
5201
|
-
|
5202
|
-
|
5203
|
-
|
5204
|
-
|
5205
|
-
|
5206
|
-
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5221
|
-
|
5222
|
-
|
5223
|
-
|
5224
|
-
|
5225
|
-
|
5226
|
-
|
5227
|
-
|
5228
|
-
|
5193
|
+
}, (100 + timeBuff));
|
5194
|
+
}
|
5195
|
+
timeBuff += 20;
|
5196
|
+
i++;
|
5197
|
+
});
|
5198
|
+
} else if(currentEffect === 'boxRain' || currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
|
5199
|
+
createBoxes(slider, settings, vars);
|
5200
|
+
|
5201
|
+
totalBoxes = settings.boxCols * settings.boxRows;
|
5202
|
+
i = 0;
|
5203
|
+
timeBuff = 0;
|
5204
|
+
|
5205
|
+
// Split boxes into 2D array
|
5206
|
+
var rowIndex = 0;
|
5207
|
+
var colIndex = 0;
|
5208
|
+
var box2Darr = [];
|
5209
|
+
box2Darr[rowIndex] = [];
|
5210
|
+
boxes = $('.nivo-box', slider);
|
5211
|
+
if(currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrowReverse'){
|
5212
|
+
boxes = $('.nivo-box', slider)._reverse();
|
5213
|
+
}
|
5214
|
+
boxes.each(function(){
|
5215
|
+
box2Darr[rowIndex][colIndex] = $(this);
|
5216
|
+
colIndex++;
|
5217
|
+
if(colIndex === settings.boxCols){
|
5218
|
+
rowIndex++;
|
5219
|
+
colIndex = 0;
|
5220
|
+
box2Darr[rowIndex] = [];
|
5221
|
+
}
|
5222
|
+
});
|
5223
|
+
|
5224
|
+
// Run animation
|
5225
|
+
for(var cols = 0; cols < (settings.boxCols * 2); cols++){
|
5226
|
+
var prevCol = cols;
|
5227
|
+
for(var rows = 0; rows < settings.boxRows; rows++){
|
5228
|
+
if(prevCol >= 0 && prevCol < settings.boxCols){
|
5229
5229
|
/* Due to some weird JS bug with loop vars
|
5230
|
-
|
5231
|
-
|
5230
|
+
being used in setTimeout, this is wrapped
|
5231
|
+
with an anonymous function call */
|
5232
5232
|
(function(row, col, time, i, totalBoxes) {
|
5233
|
-
|
5234
|
-
|
5235
|
-
|
5236
|
-
|
5237
|
-
|
5238
|
-
|
5239
|
-
|
5240
|
-
|
5241
|
-
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5233
|
+
var box = $(box2Darr[row][col]);
|
5234
|
+
var w = box.width();
|
5235
|
+
var h = box.height();
|
5236
|
+
if(currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
|
5237
|
+
box.width(0).height(0);
|
5238
|
+
}
|
5239
|
+
if(i === totalBoxes-1){
|
5240
|
+
setTimeout(function(){
|
5241
|
+
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3, '', function(){ slider.trigger('nivo:animFinished'); });
|
5242
|
+
}, (100 + time));
|
5243
|
+
} else {
|
5244
|
+
setTimeout(function(){
|
5245
|
+
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3);
|
5246
|
+
}, (100 + time));
|
5247
|
+
}
|
5248
5248
|
})(rows, prevCol, timeBuff, i, totalBoxes);
|
5249
5249
|
i++;
|
5250
|
-
}
|
5251
|
-
prevCol--;
|
5252
5250
|
}
|
5253
|
-
|
5254
|
-
|
5255
|
-
|
5256
|
-
|
5257
|
-
|
5258
|
-
|
5259
|
-
|
5260
|
-
|
5261
|
-
|
5262
|
-
|
5263
|
-
|
5264
|
-
|
5265
|
-
|
5266
|
-
|
5267
|
-
|
5268
|
-
|
5269
|
-
|
5270
|
-
|
5271
|
-
|
5251
|
+
prevCol--;
|
5252
|
+
}
|
5253
|
+
timeBuff += 100;
|
5254
|
+
}
|
5255
|
+
}
|
5256
|
+
};
|
5257
|
+
|
5258
|
+
// Shuffle an array
|
5259
|
+
var shuffle = function(arr){
|
5260
|
+
for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i, 10), x = arr[--i], arr[i] = arr[j], arr[j] = x);
|
5261
|
+
return arr;
|
5262
|
+
};
|
5263
|
+
|
5264
|
+
// For debugging
|
5265
|
+
var trace = function(msg){
|
5266
|
+
if(this.console && typeof console.log !== 'undefined') { console.log(msg); }
|
5267
|
+
};
|
5268
|
+
|
5269
|
+
// Start / Stop
|
5270
|
+
this.stop = function(){
|
5271
|
+
if(!$(element).data('nivo:vars').stop){
|
5272
5272
|
$(element).data('nivo:vars').stop = true;
|
5273
5273
|
trace('Stop Slider');
|
5274
|
-
|
5275
|
-
|
5276
|
-
|
5277
|
-
|
5278
|
-
|
5274
|
+
}
|
5275
|
+
};
|
5276
|
+
|
5277
|
+
this.start = function(){
|
5278
|
+
if($(element).data('nivo:vars').stop){
|
5279
5279
|
$(element).data('nivo:vars').stop = false;
|
5280
5280
|
trace('Start Slider');
|
5281
|
-
|
5282
|
-
|
5283
|
-
|
5284
|
-
|
5285
|
-
|
5286
|
-
|
5287
|
-
|
5281
|
+
}
|
5282
|
+
};
|
5283
|
+
|
5284
|
+
// Trigger the afterLoad callback
|
5285
|
+
settings.afterLoad.call(this);
|
5286
|
+
|
5287
|
+
return this;
|
5288
5288
|
};
|
5289
|
-
|
5289
|
+
|
5290
5290
|
$.fn.nivoSlider = function(options) {
|
5291
|
-
|
5292
|
-
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5291
|
+
return this.each(function(key, value){
|
5292
|
+
var element = $(this);
|
5293
|
+
// Return early if this element already has a plugin instance
|
5294
|
+
if (element.data('nivoslider')) { return element.data('nivoslider'); }
|
5295
|
+
// Pass options to plugin constructor
|
5296
|
+
var nivoslider = new NivoSlider(this, options);
|
5297
|
+
// Store plugin object in this element's data
|
5298
|
+
element.data('nivoslider', nivoslider);
|
5299
|
+
});
|
5300
5300
|
};
|
5301
|
-
|
5301
|
+
|
5302
5302
|
//Default settings
|
5303
5303
|
$.fn.nivoSlider.defaults = {
|
5304
|
-
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5304
|
+
effect: 'random',
|
5305
|
+
slices: 15,
|
5306
|
+
boxCols: 8,
|
5307
|
+
boxRows: 4,
|
5308
|
+
animSpeed: 500,
|
5309
|
+
pauseTime: 3000,
|
5310
|
+
startSlide: 0,
|
5311
|
+
directionNav: true,
|
5312
|
+
controlNav: true,
|
5313
|
+
controlNavThumbs: false,
|
5314
|
+
pauseOnHover: true,
|
5315
|
+
manualAdvance: false,
|
5316
|
+
prevText: 'Prev',
|
5317
|
+
nextText: 'Next',
|
5318
|
+
randomStart: false,
|
5319
|
+
beforeChange: function(){},
|
5320
|
+
afterChange: function(){},
|
5321
|
+
slideshowEnd: function(){},
|
5322
|
+
lastSlide: function(){},
|
5323
|
+
afterLoad: function(){}
|
5324
5324
|
};
|
5325
5325
|
|
5326
5326
|
$.fn._reverse = [].reverse;
|
5327
|
+
|
5328
|
+
})(jQuery);
|
5327
5329
|
|
5328
|
-
|
5330
|
+
|
5331
|
+
/*!
|
5332
|
+
* Code comes from jQuery Migrate - v1.1.0 - 2013-01-31
|
5333
|
+
* https://github.com/jquery/jquery-migrate
|
5334
|
+
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
5335
|
+
*/
|
5336
|
+
|
5337
|
+
var matched, browser,
|
5338
|
+
oldInit = jQuery.fn.init,
|
5339
|
+
// Note this does NOT include the # XSS fix from 1.7!
|
5340
|
+
rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;
|
5341
|
+
|
5342
|
+
// $(html) "looks like html" rule change
|
5343
|
+
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
5344
|
+
var match;
|
5345
|
+
|
5346
|
+
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
5347
|
+
(match = rquickExpr.exec( selector )) && match[1] ) {
|
5348
|
+
// This is an HTML string according to the "old" rules; is it still?
|
5349
|
+
if ( selector.charAt( 0 ) !== "<" ) {
|
5350
|
+
migrateWarn("$(html) HTML strings must start with '<' character");
|
5351
|
+
}
|
5352
|
+
// Now process using loose rules; let pre-1.8 play too
|
5353
|
+
if ( context && context.context ) {
|
5354
|
+
// jQuery object as context; parseHTML expects a DOM object
|
5355
|
+
context = context.context;
|
5356
|
+
}
|
5357
|
+
if ( jQuery.parseHTML ) {
|
5358
|
+
return oldInit.call( this, jQuery.parseHTML( jQuery.trim(selector), context, true ),
|
5359
|
+
context, rootjQuery );
|
5360
|
+
}
|
5361
|
+
}
|
5362
|
+
return oldInit.apply( this, arguments );
|
5363
|
+
};
|
5364
|
+
jQuery.fn.init.prototype = jQuery.fn;
|
5365
|
+
|
5366
|
+
jQuery.uaMatch = function( ua ) {
|
5367
|
+
ua = ua.toLowerCase();
|
5368
|
+
|
5369
|
+
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
5370
|
+
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
5371
|
+
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
5372
|
+
/(msie) ([\w.]+)/.exec( ua ) ||
|
5373
|
+
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
5374
|
+
[];
|
5375
|
+
|
5376
|
+
return {
|
5377
|
+
browser: match[ 1 ] || "",
|
5378
|
+
version: match[ 2 ] || "0"
|
5379
|
+
};
|
5380
|
+
};
|
5381
|
+
|
5382
|
+
matched = jQuery.uaMatch( navigator.userAgent );
|
5383
|
+
browser = {};
|
5384
|
+
|
5385
|
+
if ( matched.browser ) {
|
5386
|
+
browser[ matched.browser ] = true;
|
5387
|
+
browser.version = matched.version;
|
5388
|
+
}
|
5389
|
+
|
5390
|
+
// Chrome is Webkit, but Webkit is also Safari.
|
5391
|
+
if ( browser.chrome ) {
|
5392
|
+
browser.webkit = true;
|
5393
|
+
} else if ( browser.webkit ) {
|
5394
|
+
browser.safari = true;
|
5395
|
+
}
|
5396
|
+
|
5397
|
+
jQuery.browser = browser;
|
5329
5398
|
|