initial file dump with some early modifications
This commit is contained in:
62
js/app.js
Normal file
62
js/app.js
Normal file
@ -0,0 +1,62 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
/* Use this js doc for all application specific JS */
|
||||
|
||||
/* TABS --------------------------------- */
|
||||
/* Remove if you don't need :) */
|
||||
|
||||
var tabs = $('dl.tabs');
|
||||
tabsContent = $('ul.tabs-content')
|
||||
|
||||
tabs.each(function(i) {
|
||||
//Get all tabs
|
||||
var tab = $(this).children('dd').children('a');
|
||||
tab.click(function(e) {
|
||||
|
||||
//Get Location of tab's content
|
||||
var contentLocation = $(this).attr("href")
|
||||
contentLocation = contentLocation + "Tab";
|
||||
|
||||
//Let go if not a hashed one
|
||||
if(contentLocation.charAt(0)=="#") {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
//Make Tab Active
|
||||
tab.removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
//Show Tab Content
|
||||
$(contentLocation).parent('.tabs-content').children('li').css({"display":"none"});
|
||||
$(contentLocation).css({"display":"block"});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* PLACEHOLDER FOR FORMS ------------- */
|
||||
/* Remove if you don't need :) */
|
||||
|
||||
$('[placeholder]').focus(function() {
|
||||
var input = $(this);
|
||||
if (input.val() == input.attr('placeholder')) {
|
||||
input.val('');
|
||||
input.removeClass('placeholder');
|
||||
}
|
||||
}).blur(function() {
|
||||
var input = $(this);
|
||||
if (input.val() == '' || input.val() == input.attr('placeholder')) {
|
||||
input.addClass('placeholder');
|
||||
input.val(input.attr('placeholder'));
|
||||
}
|
||||
}).blur();
|
||||
$('[placeholder]').parents('form').submit(function() {
|
||||
$(this).find('[placeholder]').each(function() {
|
||||
var input = $(this);
|
||||
if (input.val() == input.attr('placeholder')) {
|
||||
input.val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
162
js/customforms.jquery.js
Normal file
162
js/customforms.jquery.js
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
* jQuery Custom Forms Plugin 1.0
|
||||
* www.ZURB.com
|
||||
* Copyright 2010, ZURB
|
||||
* Free to use under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
function appendCustomMarkup(type) {
|
||||
$('form.custom input:' + type).each(function () {
|
||||
var $span = $('<span class="custom ' + type + '"></span>');
|
||||
if ($(this).next('span.custom.' + type).length === 0) {
|
||||
if (this.checked) {
|
||||
$span.addClass('checked');
|
||||
}
|
||||
$(this)
|
||||
.hide()
|
||||
.after($span);
|
||||
}
|
||||
});
|
||||
}
|
||||
appendCustomMarkup('checkbox');
|
||||
appendCustomMarkup('radio');
|
||||
|
||||
$('form.custom select').each(function () {
|
||||
var $this = $(this),
|
||||
$customSelect = $this.next('div.custom.dropdown'),
|
||||
$options = $this.find('option'),
|
||||
maxWidth = 0,
|
||||
$li;
|
||||
|
||||
if ($customSelect.length === 0) {
|
||||
$customSelect = $('<div class="custom dropdown"><a href="#" class="selector"></a><ul></ul></div>"');
|
||||
$options.each(function () {
|
||||
$li = $('<li>' + $(this).html() + '</li>');
|
||||
$customSelect.find('ul').append($li);
|
||||
});
|
||||
$customSelect.prepend('<a href="#" class="current">' + $options.first().html() + '</a>');
|
||||
|
||||
$this.after($customSelect);
|
||||
$this.hide();
|
||||
}
|
||||
|
||||
$options.each(function (index) {
|
||||
if (this.selected) {
|
||||
$customSelect.find('li').eq(index).addClass('selected');
|
||||
$customSelect.find('.current').html($(this).html());
|
||||
}
|
||||
});
|
||||
|
||||
$customSelect.find('li').each(function () {
|
||||
$customSelect.addClass('open');
|
||||
if ($(this).outerWidth() > maxWidth) {
|
||||
maxWidth = $(this).outerWidth();
|
||||
}
|
||||
$customSelect.removeClass('open');
|
||||
});
|
||||
$customSelect.css('width', maxWidth + 18 + 'px');
|
||||
$customSelect.find('ul').css('width', maxWidth + 16 + 'px');
|
||||
});
|
||||
});
|
||||
|
||||
(function ($) {
|
||||
|
||||
function toggleCheckbox($element) {
|
||||
var $input = $element.prev(),
|
||||
input = $input[0];
|
||||
|
||||
input.checked = ((input.checked) ? false : true);
|
||||
$element.toggleClass('checked');
|
||||
}
|
||||
|
||||
function toggleRadio($element) {
|
||||
var $input = $element.prev(),
|
||||
input = $input[0];
|
||||
|
||||
$('input:radio[name=' + $input.attr('name') + ']').each(function () {
|
||||
$(this).next().removeClass('checked');
|
||||
});
|
||||
input.checked = ((input.checked) ? false : true);
|
||||
$element.toggleClass('checked');
|
||||
}
|
||||
|
||||
$('form.custom span.custom.checkbox').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
toggleCheckbox($(this));
|
||||
});
|
||||
|
||||
$('form.custom span.custom.radio').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
toggleRadio($(this));
|
||||
});
|
||||
|
||||
$('form.custom label').live('click', function (event) {
|
||||
var $associatedElement = $('#' + $(this).attr('for')),
|
||||
$customCheckbox,
|
||||
$customRadio;
|
||||
if ($associatedElement.length !== 0) {
|
||||
if ($associatedElement.attr('type') === 'checkbox') {
|
||||
event.preventDefault();
|
||||
$customCheckbox = $(this).find('span.custom.checkbox');
|
||||
toggleCheckbox($customCheckbox);
|
||||
} else if ($associatedElement.attr('type') === 'radio') {
|
||||
event.preventDefault();
|
||||
$customRadio = $(this).find('span.custom.radio');
|
||||
toggleRadio($customRadio);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector').live('click', function (event) {
|
||||
var $this = $(this),
|
||||
$dropdown = $this.closest('div.custom.dropdown');
|
||||
|
||||
event.preventDefault();
|
||||
$dropdown.toggleClass('open');
|
||||
|
||||
if ($dropdown.hasClass('open')) {
|
||||
$(document).bind('click.customdropdown', function (event) {
|
||||
$dropdown.removeClass('open');
|
||||
$(document).unbind('.customdropdown');
|
||||
});
|
||||
} else {
|
||||
$(document).unbind('.customdropdown');
|
||||
}
|
||||
});
|
||||
|
||||
$('form.custom div.custom.dropdown li').live('click', function (event) {
|
||||
var $this = $(this),
|
||||
$customDropdown = $this.closest('div.custom.dropdown'),
|
||||
$select = $customDropdown.prev(),
|
||||
selectedIndex = 0;
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$this
|
||||
.closest('ul')
|
||||
.find('li')
|
||||
.removeClass('selected');
|
||||
$this.addClass('selected');
|
||||
|
||||
$customDropdown
|
||||
.removeClass('open')
|
||||
.find('a.current')
|
||||
.html($this.html());
|
||||
|
||||
$this.closest('ul').find('li').each(function (index) {
|
||||
if ($this[0] == this) {
|
||||
selectedIndex = index;
|
||||
}
|
||||
|
||||
});
|
||||
$select[0].selectedIndex = selectedIndex;
|
||||
});
|
||||
})(jQuery);
|
58
js/forms.jquery.js
Normal file
58
js/forms.jquery.js
Normal file
@ -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);
|
16
js/jquery-1.5.1.min.js
vendored
Normal file
16
js/jquery-1.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
js/modernizr-1.7.min.js
vendored
Normal file
2
js/modernizr-1.7.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user