Skip to content

Commit

Permalink
Updated version of the TXP Minima theme
Browse files Browse the repository at this point in the history
This replaces the original TXP Minima theme. Based on Foundation, it is
responsive and requires no Textpattern forms.
  • Loading branch information
Jonathan Stubbs authored and Jonathan Stubbs committed Feb 17, 2013
0 parents commit 4925350
Show file tree
Hide file tree
Showing 26 changed files with 3,226 additions and 0 deletions.
Binary file added images/foundation/orbit/bullets.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/left-arrow-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/left-arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/mask-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/pause-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/right-arrow-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/right-arrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/rotator-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/foundation/orbit/timer-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions javascripts/app.js
@@ -0,0 +1,117 @@
jQuery(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('dd.active'),
contentLocation = $tab.children('a').attr("href") + 'Tab';

// Strip off the current url that IE adds
contentLocation = contentLocation.replace(/^.+#/, '#');

// Strip off the current url that IE adds
contentLocation = contentLocation.replace(/^.+#/, '#');

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

//Show Tab Content
$(contentLocation).closest('.tabs-content').children('li').hide();
$(contentLocation).css('display', 'block');
}

$('dl.tabs dd a').on('click.fndtn', function (event) {
activateTab($(this).parent('dd'));
});

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

/* 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();

/* TOOLTIPS ------------ */
$(this).tooltips();

/* 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 lockNavBar = false;
/* Windows Phone, sadly, does not register touch events :( */
if (Modernizr.touch || navigator.userAgent.match(/Windows Phone/i)) {
$('.nav-bar a.flyout-toggle').on('click.fndtn touchstart.fndtn', function(e) {
e.preventDefault();
var flyout = $(this).siblings('.flyout').first();
if (lockNavBar === false) {
$('.nav-bar .flyout').not(flyout).slideUp(500);
flyout.slideToggle(500, function(){
lockNavBar = false;
});
}
lockNavBar = true;
});
$('.nav-bar>li.has-flyout').addClass('is-touch');
} else {
$('.nav-bar>li.has-flyout').hover(function() {
$(this).children('.flyout').show();
}, function() {
$(this).children('.flyout').hide();
});
}

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

/* SPLIT BUTTONS/DROPDOWNS */
$('.button.dropdown > ul').addClass('no-hover');

$('.button.dropdown').on('click.fndtn touchstart.fndtn', function (e) {
e.stopPropagation();
});
$('.button.dropdown.split span').on('click.fndtn touchstart.fndtn', function (e) {
e.preventDefault();
$('.button.dropdown').not($(this).parent()).children('ul').removeClass('show-dropdown');
$(this).siblings('ul').toggleClass('show-dropdown');
});
$('.button.dropdown').not('.split').on('click.fndtn touchstart.fndtn', function (e) {
e.preventDefault();
$('.button.dropdown').not(this).children('ul').removeClass('show-dropdown');
$(this).children('ul').toggleClass('show-dropdown');
});
$('body, html').on('click.fndtn touchstart.fndtn', function () {
$('.button.dropdown ul').removeClass('show-dropdown');
});

// Positioning the Flyout List
var normalButtonHeight = $('.button.dropdown:not(.large):not(.small):not(.tiny)').outerHeight() - 1,
largeButtonHeight = $('.button.large.dropdown').outerHeight() - 1,
smallButtonHeight = $('.button.small.dropdown').outerHeight() - 1,
tinyButtonHeight = $('.button.tiny.dropdown').outerHeight() - 1;

$('.button.dropdown:not(.large):not(.small):not(.tiny) > ul').css('top', normalButtonHeight);
$('.button.dropdown.large > ul').css('top', largeButtonHeight);
$('.button.dropdown.small > ul').css('top', smallButtonHeight);
$('.button.dropdown.tiny > ul').css('top', tinyButtonHeight);

});
258 changes: 258 additions & 0 deletions javascripts/jquery.customforms.js
@@ -0,0 +1,258 @@
/*
* 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.foundation = jQuery.foundation || {};
jQuery.foundation.customForms = jQuery.foundation.customForms || {};

jQuery(document).ready(function ($) {

function appendCustomMarkup(type) {
$('form.custom input:' + type).each(function () {

var $this = $(this).hide(),
$span = $this.next('span.custom.' + type);

if ($span.length === 0) {
$span = $('<span class="custom ' + type + '"></span>').insertAfter($this);
}

$span.toggleClass('checked', $this.is(':checked'));
$span.toggleClass('disabled', $this.is(':disabled'));
});
}

function appendCustomSelect(sel) {
var $this = $(sel),
$customSelect = $this.next('div.custom.dropdown'),
$options = $this.find('option'),
maxWidth = 0,
$li;

if ($this.hasClass('no-custom')) { return; }
if ($customSelect.length === 0) {
$customSelectSize = '';
if ($(sel).hasClass('small')) {
$customSelectSize = 'small';
} else if ($(sel).hasClass('medium')) {
$customSelectSize = 'medium';
} else if ($(sel).hasClass('large')) {
$customSelectSize = 'large';
} else if ($(sel).hasClass('expand')) {
$customSelectSize = 'expand';
}
$customSelect = $('<div class="custom dropdown ' + $customSelectSize + '"><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();

} else {
// refresh the ul with options from the select in case the supplied markup doesn't match
$customSelect.find('ul').html('');
$options.each(function () {
$li = $('<li>' + $(this).html() + '</li>');
$customSelect.find('ul').append($li);
});
}

$customSelect.toggleClass('disabled', $this.is(':disabled'));

$options.each(function (index) {
if (this.selected) {
$customSelect.find('li').eq(index).addClass('selected');
$customSelect.find('.current').html($(this).html());
}
});

$customSelect.css('width', 'inherit');
$customSelect.find('ul').css('width', 'inherit');

$customSelect.find('li').each(function () {
$customSelect.addClass('open');
if ($(this).outerWidth() > maxWidth) {
maxWidth = $(this).outerWidth();
}
$customSelect.removeClass('open');
});

if (!$customSelect.is('.small, .medium, .large, .expand')) {
$customSelect.css('width', maxWidth + 18 + 'px');
$customSelect.find('ul').css('width', maxWidth + 16 + 'px');
}

}

$.foundation.customForms.appendCustomMarkup = function () {
appendCustomMarkup('checkbox');
appendCustomMarkup('radio');

$('form.custom select').each(function () {
appendCustomSelect(this);
});
};

$.foundation.customForms.appendCustomMarkup();
});

(function ($) {

function refreshCustomSelect($select) {
var maxWidth = 0,
$customSelect = $select.next();
$options = $select.find('option');
$customSelect.find('ul').html('');

$options.each(function () {
$li = $('<li>' + $(this).html() + '</li>');
$customSelect.find('ul').append($li);
});

// re-populate
$options.each(function (index) {
if (this.selected) {
$customSelect.find('li').eq(index).addClass('selected');
$customSelect.find('.current').html($(this).html());
}
});

// fix width
$customSelect.removeAttr('style')
.find('ul').removeAttr('style');
$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 toggleCheckbox($element) {
var $input = $element.prev(),
input = $input[0];

if (false == $input.is(':disabled')) {
input.checked = ((input.checked) ? false : true);
$element.toggleClass('checked');

$input.trigger('change');
}
}

function toggleRadio($element) {
var $input = $element.prev(),
input = $input[0];

if (false == $input.is(':disabled')) {
$('input:radio[name="' + $input.attr('name') + '"]').each(function () {
$(this).next().removeClass('checked');
});
input.checked = ((input.checked) ? false : true);
$element.toggleClass('checked');

$input.trigger('change');
}
}

$('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 select').live('change', function (event) {
refreshCustomSelect($(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'),
$select = $dropdown.prev();

event.preventDefault();
$('div.dropdown').removeClass('open');

if (false == $select.is(':disabled')) {
$dropdown.toggleClass('open');

if ($dropdown.hasClass('open')) {
$(document).bind('click.customdropdown', function (event) {
$dropdown.removeClass('open');
$(document).unbind('.customdropdown');
});
} else {
$(document).unbind('.customdropdown');
}
return false;
}
});

$('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();
$('div.dropdown').removeClass('open');

$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;

$select.trigger('change');
});
})(jQuery);
4 changes: 4 additions & 0 deletions javascripts/jquery.min.js

Large diffs are not rendered by default.

0 comments on commit 4925350

Please sign in to comment.