Skip to content

Commit

Permalink
Added in the Foundation files and responsive tables files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Smiley committed May 16, 2012
0 parents commit e14b2bd
Show file tree
Hide file tree
Showing 22 changed files with 2,795 additions and 0 deletions.
93 changes: 93 additions & 0 deletions javascripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
$(document).ready(function () {

/* Use this js doc for all application specific JS */

/* TABS --------------------------------- */
/* Remove if you don't need :) */

function activateTab($tab) {
var $activeTab = $tab.closest('dl').find('a.active'),
contentLocation = $tab.attr("href") + 'Tab';

//Make Tab Active
$activeTab.removeClass('active');
$tab.addClass('active');

//Show Tab Content
$(contentLocation).closest('.tabs-content').children('li').hide();
$(contentLocation).show();
}

$('dl.tabs').each(function () {
//Get all tabs
var tabs = $(this).children('dd').children('a');
tabs.click(function (e) {
activateTab($(this));
});
});

if (window.location.hash) {
activateTab($('a[href="' + window.location.hash + '"]'));
}

/* ALERT BOXES ------------ */
$(".alert-box").delegate("a.close", "click", function(event) {
event.preventDefault();
$(this).closest(".alert-box").fadeOut(function(event){
$(this).remove();
});
});


/* PLACEHOLDER FOR FORMS ------------- */
/* Remove this and jquery.placeholder.min.js if you don't need :) */

$('input, textarea').placeholder();



/* UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE6/7/8 SUPPORT AND ARE USING .block-grids */
// $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'left'});
// $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'left'});
// $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'left'});
// $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'left'});



/* DROPDOWN NAV ------------- */

var currentFoundationDropdown = null;
$('.nav-bar li a').each(function() {
$(this).data('clicks', 0);
});
$('.nav-bar li a').on('click', function(e) {
e.preventDefault();
if (currentFoundationDropdown !== $(this).index() || currentFoundationDropdown === null) {
$(this).data('clicks', 0);
currentFoundationDropdown = $(this).index();
}
$(this).data('clicks', ($(this).data('clicks') + 1));
var f = $(this).siblings('.flyout');
if (!f.is(':visible') && $(this).parent('.has-flyout').length > 1) {
$('.nav-bar li .flyout').hide();
f.show();
} else if (($(this).data('clicks') > 1) || ($(this).parent('.has-flyout').length < 1)) {
window.location = $(this).attr('href');
}
});
$('.nav-bar').on('click', function(e) {
e.stopPropagation();
if ($(e.target).parents().is('.flyout') || $(e.target).is('.flyout')) {
e.preventDefault();
}
});
// $('body').bind('touchend', function(e) {
// if (!$(e.target).parents().is('.nav-bar') || !$(e.target).is('.nav-bar')) {
// $('.nav-bar li .flyout').is(':visible').hide();
// }
// });

/* DISABLED BUTTONS ------------- */
/* Gives elements with a class of 'disabled' a return: false; */

});
86 changes: 86 additions & 0 deletions javascripts/app.js.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
$(document).ready(function () {

/* Use this js doc for all application specific JS */

/* TABS --------------------------------- */
/* Remove if you don't need :) */

function activateTab($tab) {
var $activeTab = $tab.closest('dl').find('a.active'),
contentLocation = $tab.attr("href") + 'Tab';

//Make Tab Active
$activeTab.removeClass('active');
$tab.addClass('active');

<<<<<<< HEAD
//Show Tab Content
$(contentLocation).closest('.tabs-content').children('li').hide();
=======
//Show Tab Content
$(contentLocation).closest('ul.tabs-content').find('> li').hide();
>>>>>>> bd561f03d730cf888789bb44e12c4e56c5f445ae
$(contentLocation).show();
}

$('dl.tabs').each(function () {
//Get all tabs
var tabs = $(this).children('dd').children('a');
tabs.click(function (e) {
activateTab($(this));
});
});

if (window.location.hash) {
activateTab($('a[href="' + window.location.hash + '"]'));
}


/* PLACEHOLDER FOR FORMS ------------- */
/* Remove this and jquery.placeholder.min.js if you don't need :) */

$('input, textarea').placeholder();

/* DROPDOWN NAV ------------- */
/*
$('.nav-bar li a, .nav-bar li a:after').each(function() {
$(this).data('clicks', 0);
});
$('.nav-bar li a, .nav-bar li a:after').bind('touchend click', function(e){
e.stopPropagation();
e.preventDefault();
var f = $(this).siblings('.flyout');
$(this).data('clicks', ($(this).data('clicks') + 1));
if (!f.is(':visible') && f.length > 0) {
$('.nav-bar li .flyout').hide();
f.show();
}
});
$('.nav-bar li a, .nav-bar li a:after').bind(' touchend click', function(e) {
e.stopPropagation();
e.preventDefault();
if ($(this).data('clicks') > 1) {
window.location = $(this).attr('href');
}
});
$('.nav-bar').bind('touchend click', function(e) {
e.stopPropagation();
if (!$(e.target).parents('.nav-bar li .flyout') || $(e.target) != $('.nav-bar li .flyout')) {
e.preventDefault();
}
});
$('body').bind('touchend', function(e) {
if (!$(e.target).parents('.nav-bar li .flyout') || $(e.target) != $('.nav-bar li .flyout')) {
$('.nav-bar li .flyout').hide();
}
});
*/

/* DISABLED BUTTONS ------------- */
/* Gives elements with a class of 'disabled' a return: false; */

<<<<<<< HEAD
});
=======
});
>>>>>>> bd561f03d730cf888789bb44e12c4e56c5f445ae
58 changes: 58 additions & 0 deletions javascripts/forms.jquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* jQuery.placeholder - Placeholder plugin for input fields
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2008/10/14
*
* @author Blair Mitchelmore
* @version 1.0.1
*
**/
new function($) {
$.fn.placeholder = function(settings) {
settings = settings || {};
var key = settings.dataKey || "placeholderValue";
var attr = settings.attr || "placeholder";
var className = settings.className || "placeholder";
var values = settings.values || [];
var block = settings.blockSubmit || false;
var blank = settings.blankSubmit || false;
var submit = settings.onSubmit || false;
var value = settings.value || "";
var position = settings.cursor_position || 0;


return this.filter(":input").each(function(index) {
$.data(this, key, values[index] || $(this).attr(attr));
}).each(function() {
if ($.trim($(this).val()) === "")
$(this).addClass(className).val($.data(this, key));
}).focus(function() {
if ($.trim($(this).val()) === $.data(this, key))
$(this).removeClass(className).val(value)
if ($.fn.setCursorPosition) {
$(this).setCursorPosition(position);
}
}).blur(function() {
if ($.trim($(this).val()) === value)
$(this).addClass(className).val($.data(this, key));
}).each(function(index, elem) {
if (block)
new function(e) {
$(e.form).submit(function() {
return $.trim($(e).val()) != $.data(e, key)
});
}(elem);
else if (blank)
new function(e) {
$(e.form).submit(function() {
if ($.trim($(e).val()) == $.data(e, key))
$(e).removeClass(className).val("");
return true;
});
}(elem);
else if (submit)
new function(e) { $(e.form).submit(submit); }(elem);
});
};
}(jQuery);
Loading

0 comments on commit e14b2bd

Please sign in to comment.