Skip to content

Commit

Permalink
Update with Foundation 4.0.9, add image and caption classes
Browse files Browse the repository at this point in the history
  • Loading branch information
milohuang committed Mar 21, 2013
1 parent e41b74c commit 4e3a8dd
Show file tree
Hide file tree
Showing 25 changed files with 3,401 additions and 1,529 deletions.
1,133 changes: 825 additions & 308 deletions css/app.css

Large diffs are not rendered by default.

1,053 changes: 731 additions & 322 deletions css/foundation.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/foundation.min.css

Large diffs are not rendered by default.

186 changes: 107 additions & 79 deletions css/normalize.css

Large diffs are not rendered by default.

1,172 changes: 862 additions & 310 deletions css/style.css

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions js/foundation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/foundation/foundation.alerts.js
Expand Up @@ -47,4 +47,4 @@
$(this.scope).off('.fndtn.alerts');
}
};
}(Foundation.zj, this, this.document));
}(Foundation.zj, this, this.document));
2 changes: 2 additions & 0 deletions js/foundation/foundation.clearing.js
Expand Up @@ -101,6 +101,7 @@

$(this.scope)
.on('touchstart.fndtn.clearing', '.visible-img', function(e) {
if (!e.touches) { e = e.originalEvent; }
var data = {
start_page_x: e.touches[0].pageX,
start_page_y: e.touches[0].pageY,
Expand All @@ -113,6 +114,7 @@
e.stopPropagation();
})
.on('touchmove.fndtn.clearing', '.visible-img', function(e) {
if (!e.touches) { e = e.originalEvent; }
// Ignore pinch/zoom events
if(e.touches.length > 1 || e.scale && e.scale !== 1) return;

Expand Down
2 changes: 1 addition & 1 deletion js/foundation/foundation.cookie.js
Expand Up @@ -71,4 +71,4 @@
return false;
};

})(Foundation.zj, document);
})(Foundation.zj, document);
28 changes: 18 additions & 10 deletions js/foundation/foundation.dropdown.js
Expand Up @@ -6,7 +6,7 @@
Foundation.libs.dropdown = {
name : 'dropdown',

version : '4.0.0',
version : '4.0.9',

settings : {
activeClass: 'open'
Expand Down Expand Up @@ -49,10 +49,6 @@
}
});

$('[data-dropdown-content]').on('click.fndtn.dropdown', function (e) {
e.stopPropagation();
});

$(window).on('resize.fndtn.dropdown', self.throttle(function () {
self.resize.call(self);
}, 50)).trigger('resize');
Expand All @@ -63,7 +59,7 @@
toggle : function (target, resize) {
var dropdown = $('#' + target.data('dropdown'));

$('[data-dropdown-content]').not(dropdown).css('left', '-99999px');
$('[data-dropdown-content]').not(dropdown).css('left', '-99999px').removeClass(this.settings.activeClass);

if (dropdown.hasClass(this.settings.activeClass)) {
dropdown
Expand All @@ -86,21 +82,33 @@
},

css : function (dropdown, target) {
var offset = target.offset();
if (dropdown.parent()[0] === $('body')[0]) {
var position = target.offset();
} else {
var position = target.position();
}

if (this.small()) {
dropdown.css({
position : 'absolute',
width: '95%',
left: '2.5%',
'max-width': 'none',
top: offset.top + this.outerHeight(target),
top: position.top + this.outerHeight(target)
});
} else {
if ($(window).width() > this.outerWidth(dropdown) + target.offset().left) {
var left = position.left;
} else {
if (!dropdown.hasClass('right')) {
dropdown.addClass('right');
}
var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target));
}
dropdown.attr('style', '').css({
position : 'absolute',
top: offset.top + this.outerHeight(target),
left: offset.left
top: position.top + this.outerHeight(target),
left: left
});
}

Expand Down
24 changes: 8 additions & 16 deletions js/foundation/foundation.forms.js
Expand Up @@ -6,7 +6,7 @@
Foundation.libs.forms = {
name : 'forms',

version : '4.0.0',
version : '4.0.4',

settings : {
disable_class: 'no-custom'
Expand All @@ -33,28 +33,18 @@
},

assemble : function () {
$('form.custom input[type="radio"]').not('[data-customforms="disabled"]')
$('form.custom input[type="radio"]', $(this.scope)).not('[data-customforms="disabled"]')
.each(this.append_custom_markup);
$('form.custom input[type="checkbox"]').not('[data-customforms="disabled"]')
$('form.custom input[type="checkbox"]', $(this.scope)).not('[data-customforms="disabled"]')
.each(this.append_custom_markup);
$('form.custom select').not('[data-customforms="disabled"]')
$('form.custom select', $(this.scope)).not('[data-customforms="disabled"]')
.each(this.append_custom_select);
},

events : function () {
var self = this;

$(this.scope)
.on('click.fndtn.forms', 'form.custom span.custom.checkbox', function (e) {
e.preventDefault();
e.stopPropagation();
self.toggle_checkbox($(this));
})
.on('click.fndtn.forms', 'form.custom span.custom.radio', function (e) {
e.preventDefault();
e.stopPropagation();
self.toggle_radio($(this));
})
.on('change.fndtn.forms', 'form.custom select:not([data-customforms="disabled"])', function (e) {
self.refresh_custom_select($(this));
})
Expand All @@ -66,6 +56,7 @@
if ($associatedElement.attr('type') === 'checkbox') {
e.preventDefault();
$customCheckbox = $(this).find('span.custom.checkbox');

//the checkbox might be outside after the label
if ($customCheckbox.length == 0) {
$customCheckbox = $(this).next('span.custom.checkbox');
Expand Down Expand Up @@ -177,6 +168,7 @@
$selector = $customSelect.find( ".selector" ),
$options = $this.find( 'option' ),
$selectedOption = $options.filter( ':selected' ),
copyClasses = $this.attr('class') ? $this.attr('class').split(' ') : [],
maxWidth = 0,
liHtml = '',
$listItems,
Expand All @@ -190,7 +182,7 @@
$this.hasClass( 'large' ) ? 'large' :
$this.hasClass( 'expand' ) ? 'expand' : '';

$customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>');
$customSelect = $('<div class="' + ['custom', 'dropdown', customSelectSize ].concat(copyClasses).filter(function(item, idx,arr){ if(item == '') return false; return arr.indexOf(item) == idx; }).join( ' ' ) + '"><a href="#" class="selector"></a><ul /></div>');
$selector = $customSelect.find(".selector");
$customList = $customSelect.find("ul");
liHtml = $options.map(function() { return "<li>" + $( this ).html() + "</li>"; } ).get().join( '' );
Expand Down Expand Up @@ -400,4 +392,4 @@
$(this.scope).off('.fndtn.forms');
}
};
}(Foundation.zj, this, this.document));
}(Foundation.zj, this, this.document));
45 changes: 22 additions & 23 deletions js/foundation/foundation.joyride.js
Expand Up @@ -102,20 +102,14 @@
int_settings_count = integer_settings.length;

if (!this.settings.init) this.init();
$.extend(true, this.settings, this.data_options($this));


// non configureable settings
this.settings.$content_el = $this;
this.settings.body_offset = $(this.settings.tipContainer).position();
this.settings.$tip_content = this.settings.$content_el.find('> li');
this.settings.paused = false;
this.settings.attempts = 0;

// Make sure that settings parsed from data_options are integers where necessary
for (var i = int_settings_count - 1; i >= 0; i--) {
this.settings[integer_settings[i]] = parseInt(this.settings[integer_settings[i]], 10);
}

this.settings.tipLocationPatterns = {
top: ['bottom'],
bottom: [], // bottom should not need to be repositioned
Expand All @@ -130,9 +124,14 @@

// generate the tips and insert into dom.
if (!this.settings.cookieMonster || this.settings.cookieMonster && $.cookie(this.settings.cookieName) === null) {

this.settings.$tip_content.each(function (index) {
self.create({$li : $(this), index : index});
var $this = $(this);
$.extend(true, self.settings, self.data_options($this));
// Make sure that settings parsed from data_options are integers where necessary
for (var i = int_settings_count - 1; i >= 0; i--) {
self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10);
}
self.create({$li : $this, index : index});
});

// show first tip
Expand Down Expand Up @@ -191,7 +190,6 @@
},

create : function (opts) {
// backwards compatability with data-text attribute
var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
tipClass = opts.$li.attr('class'),
$tip_content = $(this.tip_template({
Expand Down Expand Up @@ -222,8 +220,7 @@

if (this.settings.$li.length && this.settings.$target.length > 0) {

this.settings.tipSettings = $.extend(true,
this.settings, this.data_options(this.settings.$li));
this.settings.tipSettings = $.extend(this.settings, this.data_options(this.settings.$li));

this.settings.timer = parseInt(this.settings.timer, 10);

Expand Down Expand Up @@ -334,6 +331,7 @@

set_next_tip : function () {
this.settings.$next_tip = $(".joyride-tip-guide[data-index='" + this.settings.$li.index() + "']");
this.settings.$next_tip.data('closed', '');
},

set_target : function () {
Expand Down Expand Up @@ -485,9 +483,7 @@
}

} else if (this.settings.$li.length) {

this.pos_modal($nub);

}

if (toggle) {
Expand All @@ -499,15 +495,16 @@
pos_modal : function ($nub) {
this.center();
$nub.hide();
if (!this.settings.$next_tip.data('closed')) {
if ($('.joyride-modal-bg').length < 1) {
$('body').append('<div class="joyride-modal-bg">').show();
}

if ($('.joyride-modal-bg').length < 1) {
$('body').append('<div class="joyride-modal-bg">').show();
}

if (/pop/i.test(this.settings.tipAnimation)) {
$('.joyride-modal-bg').show();
} else {
$('.joyride-modal-bg').fadeIn(this.settings.tipAnimationFadeSpeed);
if (/pop/i.test(this.settings.tipAnimation)) {
$('.joyride-modal-bg').show();
} else {
$('.joyride-modal-bg').fadeIn(this.settings.tipAnimationFadeSpeed);
}
}
},

Expand Down Expand Up @@ -590,6 +587,8 @@
clearTimeout(this.settings.automate);
}

this.settings.$next_tip.data('closed', true);

$('.joyride-modal-bg').hide();
this.settings.$current_tip.hide();
this.settings.postStepCallback(this.settings.$li.index(), this.settings.$current_tip);
Expand All @@ -610,4 +609,4 @@
this.settings = {};
}
};
}(Foundation.zj, this, this.document));
}(Foundation.zj, this, this.document));

0 comments on commit 4e3a8dd

Please sign in to comment.