Skip to content
Snippets Groups Projects
Commit e8e9af0d authored by Michael Lee's avatar Michael Lee
Browse files

Initial commit

parents
Branches main
Tags v1.0.0
No related merge requests found
Showing
with 1071 additions and 0 deletions
File added
File added
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var bs = require('browser-sync').create();
var plumber = require('gulp-plumber');
gulp.task('browser-sync', ['sass'], function() {
bs.init({
proxy: "http://modularstorage.test/finder"
});
});
gulp.task('sass', function () {
return gulp.src('sass/*.scss')
.pipe(plumber())
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 4 versions'],
cascade: false
}))
.pipe(gulp.dest('css'))
.pipe(bs.stream());
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch("sass/*.scss", ['sass']);
// gulp.watch("**/*.php").on('change', bs.reload);
gulp.watch("**/*.css").on(['add', 'change'], bs.reload);
});
gulp.task('default', ['sass', 'watch']);
\ No newline at end of file
images/bg-hero-home-t.jpg

23.8 KiB

<?xml version="1.0" encoding="UTF-8"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46 (44423) - http://www.bohemiancoding.com/sketch -->
<title>caret-left-circle</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="caret-left-circle">
<circle id="Oval" fill-opacity="0.5" fill="#000000" cx="17.5" cy="17.5" r="17.5"></circle>
<polygon id="Triangle" fill="#FFFFFF" transform="translate(16.000000, 17.500000) scale(-1, 1) translate(-16.000000, -17.500000) " points="20.5 17.5 11.5 26 11.5 9"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46 (44423) - http://www.bohemiancoding.com/sketch -->
<title>caret-right-circle</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="caret-right-circle">
<circle id="Oval" fill-opacity="0.5" fill="#000000" cx="17.5" cy="17.5" r="17.5"></circle>
<polygon id="Triangle" fill="#FFFFFF" points="23.5 17.5 14.5 26 14.5 9"></polygon>
</g>
</g>
</svg>
\ No newline at end of file
images/cwd_utilities/modal_close_hd.png

642 B

<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 43.1 (39012) - http://www.bohemiancoding.com/sketch -->
<title>spinner</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M13.75,7 C13.75,7.91667125 13.5716164,8.7916625 13.2148438,9.625 C12.8580711,10.4583375 12.3789093,11.1757782 11.7773438,11.7773438 C11.1757782,12.3789093 10.4583375,12.8580711 9.625,13.2148438 C8.7916625,13.5716164 7.91667125,13.75 7,13.75 C6.08332875,13.75 5.2083375,13.5716164 4.375,13.2148438 C3.5416625,12.8580711 2.82422176,12.3789093 2.22265625,11.7773438 C1.62109074,11.1757782 1.14192887,10.4583375 0.78515625,9.625 C0.428383633,8.7916625 0.25,7.91667125 0.25,7 C0.25,5.89061945 0.502601641,4.85286941 1.0078125,3.88671875 C1.51302336,2.92056809 2.20312062,2.12500313 3.078125,1.5 C3.95312938,0.874996875 4.92707797,0.481771641 6,0.3203125 L6,2.1015625 C4.84895258,2.33593867 3.89453504,2.91145375 3.13671875,3.828125 C2.37890246,4.74479625 2,5.80207734 2,7 C2,7.67708672 2.13281117,8.32421566 2.3984375,8.94140625 C2.66406383,9.55859684 3.01952902,10.0898415 3.46484375,10.5351562 C3.91015848,10.980471 4.44140316,11.3359362 5.05859375,11.6015625 C5.67578434,11.8671888 6.32291328,12 7,12 C7.67708672,12 8.32421566,11.8671888 8.94140625,11.6015625 C9.55859684,11.3359362 10.0898415,10.980471 10.5351562,10.5351562 C10.980471,10.0898415 11.3359362,9.55859684 11.6015625,8.94140625 C11.8671888,8.32421566 12,7.67708672 12,7 C12,5.80207734 11.6210975,4.74479625 10.8632812,3.828125 C10.105465,2.91145375 9.15104742,2.33593867 8,2.1015625 L8,0.3203125 C9.07292203,0.481771641 10.0468706,0.874996875 10.921875,1.5 C11.7968794,2.12500313 12.4869766,2.92056809 12.9921875,3.88671875 C13.4973984,4.85286941 13.75,5.89061945 13.75,7 Z" id="spinner" fill="#FFFFFF"></path>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
/*
* jQuery throttle / debounce - v1.1 - 3/7/2010
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
\ No newline at end of file
/**
* jquery.detectSwipe v2.1.3
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch, iPad and Android
* http://github.com/marcandre/detect_swipe
* Based on touchwipe by Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function($) {
$.detectSwipe = {
version: '2.1.2',
enabled: 'ontouchstart' in document.documentElement,
preventDefault: true,
threshold: 20
};
var startX,
startY,
isMoving = false;
function onTouchEnd() {
this.removeEventListener('touchmove', onTouchMove);
this.removeEventListener('touchend', onTouchEnd);
isMoving = false;
}
function onTouchMove(e) {
if ($.detectSwipe.preventDefault) { e.preventDefault(); }
if(isMoving) {
var x = e.touches[0].pageX;
var y = e.touches[0].pageY;
var dx = startX - x;
var dy = startY - y;
var dir;
var ratio = window.devicePixelRatio || 1;
if(Math.abs(dx) * ratio >= $.detectSwipe.threshold) {
dir = dx > 0 ? 'left' : 'right'
}
else if(Math.abs(dy) * ratio >= $.detectSwipe.threshold) {
dir = dy > 0 ? 'up' : 'down'
}
if(dir) {
onTouchEnd.call(this);
$(this).trigger('swipe', dir).trigger('swipe' + dir);
}
}
}
function onTouchStart(e) {
if (e.touches.length == 1) {
startX = e.touches[0].pageX;
startY = e.touches[0].pageY;
isMoving = true;
this.addEventListener('touchmove', onTouchMove, false);
this.addEventListener('touchend', onTouchEnd, false);
}
}
function setup() {
this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
}
function teardown() {
this.removeEventListener('touchstart', onTouchStart);
}
$.event.special.swipe = { setup: setup };
$.each(['left', 'up', 'down', 'right'], function () {
$.event.special['swipe' + this] = { setup: function(){
$(this).on('swipe', $.noop);
} };
});
}));
/* CWD Image Gallery (ama39, last update: 8/10/17)
- Supports two interface modes:
- 1. Thumbnail Grid with Modal ("Grid mode") - a collection of clickable thumbnails which launch full-sized images in a modal popup (requires cwd_popups.js)
- -- Grid mode doesn't technically require this JavaScript file (all functionality is handled by the "gallery" scripting in cwd_popups.js).
- -- However, a quick check is performed below that will ensure that any missing attributes are added (which is helpful in Drupal, for example, where the markup is being generated dynamically)
- 2. Viewer with Thumbnails ("Viewer mode") - an inline slide viewer with scrolling thumbnail strip
-
- Set up and activate a gallery by including the "cwd-gallery" class on its container and following the markup guide in the "Scripted Components" documentation.
- Include the "viewer" class to activate Viewer mode or the "grid" class for Grid mode.
- Accessibility Notes:
- -- The Image Gallery is keyboard and screen reader accessible, allowing users to browse gallery content with minimal UI-manipulation.
- -- Be sure to follow the markup guide in the "Scripted Components" documentation carefully and include alt text as well as captions if applicable.
- -- Note that links do not have "aria-haspopup" set to true, and have an unusual role of "img" applied. This is part of the accessibility strategy. See the documentation for more details.
- -- Also see "cwd_popups.js" for accessibility information related to the modal popup.
- Future Plans:
- -- Smarter preloading (maybe asynchronous preloading that loads images when their thumbnail is visible on screen instead of all images at once?)
------------------------------------------------------------------------- */
// defaults
var slide_ratio = 0.667; // ratio of height to width (height is ~67% of width)
// globals
var gallery_count = 0;
jQuery(document).ready(function($) {
// Thumbnail Grid with Modal
$('.cwd-gallery.grid').each(function() {
gallery_count++;
// add .popup class to thumbnails if missing
$(this).find('.thumbnails a').addClass('popup');
// add a data-gallery attribute if missing
$(this).find('.thumbnails a').each(function() {
if ( !$(this).attr('data-gallery') ) {
$(this).attr('data-gallery','image-gallery-'+gallery_count);
}
});
});
// Viewer with Thumbnails
$('.cwd-gallery.viewer').each(function() {
var gallery = $(this);
var slide = $(this).find('.slide');
var thumbnails = $(this).find('.thumbnails');
var image_count = $(this).find('.thumbnails .col').length;
$(slide).append('<p class="caption"></p><div class="gallery-nav"><div class="next-prev"><a class="prev" href="#"><span class="hidden">Previous Item</span></a><a class="next" href="#"><span class="hidden">Next Item</span></a></div></div>');
// configure thumbnail buttons
$(this).find('.thumbnails a').click(function(e) {
e.preventDefault();
var native_width = parseInt($(this).attr('data-native-width'));
var native_height = parseInt($(this).attr('data-native-height'));
// detect images that are too tall for the viewer's ratio (e.g., square images, portrait images)
if (native_height / native_width > slide_ratio) {
$(slide).addClass('portrait');
}
else {
$(slide).removeClass('portrait');
}
// display image and caption
$(slide).attr('style','background-image:url('+$(this).attr('href')+');');
$(slide).find('.caption').text($(this).attr('data-title'));
// thumbnail states
$(gallery).find('.thumbnails a').removeClass('active');
$(this).addClass('active');
// autoscroll the thumbnail band if needed to make the active thumbnail fully visible
var thumb_position = parseInt($(this).parent().position().left);
var thumb_width = $(this).width();
var band_width = $(thumbnails).width();
var band_scroll = $(thumbnails).scrollLeft();
var grid_size = $(this).width() + parseInt($(this).parent().css('padding-left')) + parseInt($(this).parent().css('padding-right'));
if ( thumb_position - (grid_size/2) < 0 ) {
// needs a scroll on the left
$(thumbnails).stop().animate({
scrollLeft: band_scroll + thumb_position - (grid_size/2)
}, 300, 'easeOutQuad');
}
else if ( thumb_position + (grid_size*1.5) > band_width ) {
// needs a scroll on the right
$(thumbnails).stop().animate({
scrollLeft: thumb_position + band_scroll + (grid_size*1.5) - band_width
}, 300, 'easeOutQuad');
}
// hide the faded edge effect when the first or last thumbnail is active
if ( $(this).parent(':first-child').length > 0 ) {
$(gallery).find('.thumbnails-band').addClass('hide-before');
$(gallery).find('.thumbnails-band').removeClass('hide-after');
}
else if ( $(this).parent(':last-child').length > 0 ) {
$(gallery).find('.thumbnails-band').addClass('hide-after');
$(gallery).find('.thumbnails-band').removeClass('hide-before');
}
else {
$(gallery).find('.thumbnails-band').removeClass('hide-after hide-before');
}
}).focus(function() {
$(this).trigger('click');
});
// nav buttons (Next and Previous)
$(slide).find('.next-prev a').click(function(e) {
e.preventDefault();
e.stopPropagation();
var gallery_current_image = $(thumbnails).find('.col .active').parent().index();
if ($(this).hasClass('prev')) { // left button
var next_image = gallery_current_image - 1;
if (next_image < 0) {
next_image = image_count - 1;
}
$(thumbnails).find('.col a').eq(next_image).trigger('click');
}
else { // right button
var next_image = gallery_current_image + 1;
if (next_image > image_count-1) {
next_image = 0;
}
$(thumbnails).find('.col a').eq(next_image).trigger('click');
}
});
});
// Window Load ------------------------------------------------------------
$(window).on("load", function() {
$('.cwd-gallery.viewer').each(function() {
$(this).find('.thumbnails a').each(function(i) {
// preload images
// TODO: some kind of smarter, asynchronous preloading?
var img = new Image();
var button = $(this);
img.onload = function() {
$(button).attr('data-native-width',this.width);
$(button).attr('data-native-height',this.height);
// activate first slide
if (i == 0) {
$(button).trigger('click');
}
};
img.src = $(this).attr('href');
});
});
});
});
This diff is collapsed.
/* !! CUSTOMIZED for Data Storage Tool (ama39, 10/18/17) */
/* CWD Scrolling Tables (ama39, last update: 10/18/17)
-
- Accessibility Notes:
- --
- Future Plans:
- --
------------------------------------------------------------------------- */
// defaults (Not Yet Implemented)
var max_height = 'auto'; // Sets a maximum height for the table. If table data extends beyond this height, the table will scroll vertically, independently of the page.
var cell_width = 200; // Sets a minimum width (in pixels) to be reserved for each table cell.
var sticky_col = true; // If a table scrolls vertically, its header row will "stick" to the top as data cells slide underneath.
var sticky_row = true; // If a table scrolls horizontally, its header column will "stick" to the left as data cells slide underneath.
// globals
var table_count = 0;
/* !! CUSTOMIZED for Data Storage Tool (ama39, 10/18/17) */
/* CWD Scrolling Tables (ama39, last update: 10/18/17)
-
- Accessibility Notes:
- --
- Future Plans:
- --
------------------------------------------------------------------------- */
// defaults (Not Yet Implemented)
var max_height = 'auto'; // Sets a maximum height for the table. If table data extends beyond this height, the table will scroll vertically, independently of the page.
var cell_width = 200; // Sets a minimum width (in pixels) to be reserved for each table cell.
var sticky_col = true; // If a table scrolls vertically, its header row will "stick" to the top as data cells slide underneath.
var sticky_row = true; // If a table scrolls horizontally, its header column will "stick" to the left as data cells slide underneath.
// globals
var table_count = 0;
jQuery(document).ready(function($) {
function tables(refresh) {
// refresh mode
var refresh = false || refresh;
// Set-up markup
$('table.scrolling').each(function() {
// add wrappers
if ( !refresh ) {
table_count++;
$(this).wrap('<div class="cwd-scrolling-table"><div class="scrolling-outer"></div></div>');
$('#container34').show(); // needed for height calculations
}
var table_wrapper = $(this).parents('.cwd-scrolling-table').first();
if ( refresh ) {
$(table_wrapper).find('.floating-col-header').remove();
}
// append floating headers
if ( !refresh ) {
$(table_wrapper).append('<div class="floating-row-header" aria-hidden="true"></div>');
}
$(table_wrapper).find('.scrolling-outer').first().append('<div class="floating-col-header" aria-hidden="true"></div>')
//$(table_wrapper).children('.scrolling-outer').css('max-height','220px');
// clone headers
var col_headers = $(table_wrapper).find('.floating-col-header').first();
var row_headers = $(table_wrapper).children('.floating-row-header').first();
$(row_headers).css('top',$(this).find('thead').outerHeight()+'px');
$(this).find('tbody th').each(function(i) {
if ( !refresh ) {
$(row_headers).append('<div>'+$(this).html()+'</div>');
}
$(row_headers).children().eq(i).outerHeight($(this).outerHeight()).css({
'padding-top': $(this).css('padding-top'),
'padding-right': $(this).css('padding-right'),
'padding-bottom': $(this).css('padding-bottom'),
'padding-left': $(this).css('padding-left'),
'line-height': $(this).css('line-height')
});
});
$(this).find('thead th, thead td').each(function(i) {
$(col_headers).append('<div>'+$(this).html()+'</div>');
$(col_headers).children().eq(i).outerWidth($(this).outerWidth()).css({
'padding-top': $(this).css('padding-top'),
'padding-right': $(this).css('padding-right'),
'padding-bottom': $(this).css('padding-bottom'),
'padding-left': $(this).css('padding-left'),
'line-height': $(this).css('line-height'),
'min-width': $(this).outerWidth(),
'display': $(this).css('display')
});
});
if ($(this).find('thead th:visible, thead td:visible').length <= 1) {
$(col_headers).hide();
$(row_headers).hide();
}
else {
$(col_headers).show();
$(row_headers).show();
}
if ( refresh ) {
$(col_headers).addClass('scroll-active');
}
// scroll events
//if ( !refresh ) {
$(window).scroll($.debounce( 0, true, function(){
$(col_headers).addClass('scroll-active');
}));
$(window).scroll($.debounce( 300, function(){
$(col_headers).css('top','0');
if ($(col_headers).offset()) {
if ($(window).scrollTop() >= $(col_headers).offset().top + $(col_headers).height()) {
$(col_headers).css('top',($(window).scrollTop() - $(col_headers).offset().top)+'px').removeClass('scroll-active');
}
}
}));
//}
if ( !refresh ) {
$('#container34').hide();
}
// TODO: add options via data attributes ---------- >
/* e.g.,
if ( !$(this).attr('data-cell-width') ) {
}
*/
});
}
/* Data Storage Tool: Delay table init until the table is rendered by app.js */
//nst37 - Commented this code in order to make the table rows align when coming in from a URL with services as parameters.
/*
var tables_ran_once = false;
$('#comparisonchart').on('DOMSubtreeModified', function(){
if (!tables_ran_once) {
tables();
tables_ran_once = true;
}
});
*/
tables(true);
$(document).on('change', '.cardcheckbox, .manualcheckbox, .facet', $.debounce( 50, function(){
tables(true);
}));
$(document).on('click', '.chart-select-all, .chart-select-none, .btn-select-all, .btn-select-none, .btn-clear-filters', $.debounce( 50, function(){
tables(true);
}));
$(window).resize($.debounce( 50, function(){
tables(true);
}));
});
jQuery(document).ready(function($) {
function tables(refresh) {
// refresh mode
var refresh = false || refresh;
// Set-up markup
$('table.scrolling').each(function() {
// add wrappers
if ( !refresh ) {
table_count++;
$(this).wrap('<div class="cwd-scrolling-table"><div class="scrolling-outer"></div></div>');
$('#container34').show(); // needed for height calculations
}
var table_wrapper = $(this).parents('.cwd-scrolling-table').first();
if ( refresh ) {
$(table_wrapper).find('.floating-col-header').remove();
}
// append floating headers
if ( !refresh ) {
$(table_wrapper).append('<div class="floating-row-header" aria-hidden="true"></div>');
}
$(table_wrapper).find('.scrolling-outer').first().append('<div class="floating-col-header" aria-hidden="true"></div>')
//$(table_wrapper).children('.scrolling-outer').css('max-height','220px');
// clone headers
var col_headers = $(table_wrapper).find('.floating-col-header').first();
var row_headers = $(table_wrapper).children('.floating-row-header').first();
$(row_headers).css('top',$(this).find('thead').outerHeight()+'px');
$(this).find('tbody th').each(function(i) {
if ( !refresh ) {
$(row_headers).append('<div>'+$(this).html()+'</div>');
}
$(row_headers).children().eq(i).outerHeight($(this).outerHeight()).css({
'padding-top': $(this).css('padding-top'),
'padding-right': $(this).css('padding-right'),
'padding-bottom': $(this).css('padding-bottom'),
'padding-left': $(this).css('padding-left'),
'line-height': $(this).css('line-height')
});
});
$(this).find('thead th, thead td').each(function(i) {
$(col_headers).append('<div>'+$(this).html()+'</div>');
$(col_headers).children().eq(i).outerWidth($(this).outerWidth()).css({
'padding-top': $(this).css('padding-top'),
'padding-right': $(this).css('padding-right'),
'padding-bottom': $(this).css('padding-bottom'),
'padding-left': $(this).css('padding-left'),
'line-height': $(this).css('line-height'),
'min-width': $(this).outerWidth(),
'display': $(this).css('display')
});
});
if ($(this).find('thead th:visible, thead td:visible').length <= 1) {
$(col_headers).hide();
$(row_headers).hide();
}
else {
$(col_headers).show();
$(row_headers).show();
}
if ( refresh ) {
$(col_headers).addClass('scroll-active');
}
// scroll events
//if ( !refresh ) {
$(window).scroll($.debounce( 0, true, function(){
$(col_headers).addClass('scroll-active');
}));
$(window).scroll($.debounce( 300, function(){
$(col_headers).css('top','0');
if ($(col_headers).offset()) {
if ($(window).scrollTop() >= $(col_headers).offset().top + $(col_headers).height()) {
$(col_headers).css('top',($(window).scrollTop() - $(col_headers).offset().top)+'px').removeClass('scroll-active');
}
}
}));
//}
if ( !refresh ) {
$('#container34').hide();
}
// TODO: add options via data attributes ---------- >
/* e.g.,
if ( !$(this).attr('data-cell-width') ) {
}
*/
});
}
/* Data Storage Tool: Delay table init until the table is rendered by app.js */
//nst37 - Commented this code in order to make the table rows align when coming in from a URL with services as parameters. */
var tables_ran_once = false;
$('#comparisonchart').on('DOMSubtreeModified', function(){
if (!tables_ran_once) {
tables();
tables_ran_once = true;
}
});
tables(true);
$(document).on('change', '.cardcheckbox, .manualcheckbox, .facet', $.debounce( 50, function(){
tables(true);
}));
$(document).on('click', '.chart-select-all, .chart-select-none, .btn-select-all, .btn-select-none, .btn-clear-filters', $.debounce( 50, function(){
tables(true);
}));
$(window).resize($.debounce( 50, function(){
tables(true);
}));
});
/* CWD Utilities (ama39, last update: 1/23/18)
- 1. Main Navigation (script support for dropdown menus and mobile)
- 2. Empty Sidebar Helper (clears whitespace from empty sidebar regions to allow use of the :empty pseudo class in CSS)
------------------------------------------------------------------------- */
var mobile_breakpoint = 991; // viewport pixel width at which mobile nav appears (should match the media query in the project's css)
var mobile_expander_breakpoint = 767; // viewport pixel width at which mobile expanders appear (e.g., section nav)
if (!Date.now){Date.now = function now(){return new Date().getTime();};} // legacy Date method shim
var msie = document.documentMode;
(function ($, root, undefined) { $(function () { 'use strict';
// Window Size Tracking
function resizeChecks() {
// Mobile Nav
if ($(window).width() <= mobile_breakpoint) {
$('body').addClass('mobile'); // mobile nav breakpoint
}
else {
$('body').removeClass('mobile');
$('#main-navigation li.parent').removeClass('open');
$('#main-navigation, #mobile-nav-dimmer').removeAttr('style');
}
// Mobile Expanders
if ($(window).width() > mobile_expander_breakpoint) {
$('.mobile-expander-heading').each(function() {
if ( !$(this).hasClass('unit-nav') ) {
$(this).removeClass('open');
}
else if ( $(window).width() > mobile_breakpoint ) {
$(this).removeClass('open');
$('.dropdown-menu .open').removeClass('open');
}
})
}
}
$(window).resize(resizeChecks);
resizeChecks();
// 1. Main Navigation -----------------------------------------------------
var mousedown = false; // extra control variable for precise click and focus event interaction
// Utility Navigation (appended for mobile)
if ($('#utility-navigation li').length > 0) {
$('#main-navigation ul').first().append('<li class="parent mobile-nav-only"><a class="more-links-button" href="#">More...</a><ul class="list-menu links vertical children more-links"></ul>');
$('#utility-navigation li').each(function() {
$('#main-navigation .more-links').append($(this).clone().addClass('mobile-nav-only'));
});
$('.more-links-button').click(function(e) {
e.preventDefault();
}).mousedown(function(e) {
mousedown = true;
$(this).find('.fa').trigger('mousedown');
});
}
// Dropdown Menus
$('li.menu-item-has-children').addClass('parent'); // WordPress Support
$('.dropdown-menu li.parent').parent().removeClass('menu').addClass('links list-menu');
$('.dropdown-menu li.parent > a').wrapInner('<span></span>').append('<span class="fa fa-caret-down"></span>'); // wrap text in a span and add dropdown caret icons
$('.dropdown-menu li.parent li.parent > a .fa').removeClass('fa-caret-down').addClass('fa-caret-right'); // change sub-dropdown caret icons
$('.dropdown-menu li.parent > ul').each(function(){
$(this).removeClass('menu').addClass('list-menu links vertical children');
if ( !$('body').hasClass('mobile') ) {
$(this).css('min-width',$(this).parent('li').width()+'px' ); // smart min-width to prevent dropdown from being narrower than its parent
}
});
$('.dropdown-menu li.parent li.parent > ul').removeAttr('style'); // reset min-width to allow smaller submenus
$('.dropdown-menu li.parent').hover(function(){
if ( !$('body').hasClass('mobile') ) {
// horizontal edge-detection
var submenu_offset = $(this).children('ul').offset();
if ( submenu_offset.left + $(this).children('ul').width() > $(window).width() ) {
$(this).children('ul').addClass('flip');
}
}
}, function() {
if ( !$('body').hasClass('mobile') ) {
$(this).children('ul').removeClass('flip');
}
});
$('.dropdown-menu li.parent a').focus(function() {
if ( !$('body').hasClass('mobile') ) {
// horizontal edge-detection
var submenu_offset = $(this).closest('.parent').children('ul').offset();
if ( submenu_offset.left + $(this).closest('.parent').children('ul').width() > $(window).width() ) {
$(this).closest('.parent').children('ul').addClass('flip');
}
}
if (!mousedown) {
$(this).parents('.parent').addClass('open');
$(this).closest('.mobile-expander').children('.mobile-expander-heading').addClass('open');
}
mousedown = false;
}).blur(function() {
if ( !$('body').hasClass('mobile') ) {
$(this).parents('.parent').removeClass('open');
$(this).closest('.mobile-expander').children('.mobile-expander-heading').removeClass('open');
}
});
// Mobile Navigation
$('.dropdown-menu li.parent > a .fa').click(function(e) {
e.preventDefault();
e.stopPropagation();
}).mousedown(function(e) {
e.stopPropagation();
mousedown = true;
if ( $('body').hasClass('mobile') ) {
$(this).closest('.parent').toggleClass('open');
}
});
var main_nav_focus_target = $('#mobile-home');
$('#mobile-nav').click(function(e) {
e.preventDefault();
$('.dropdown-menu li.parent').removeClass('open');
$('#main-navigation, #mobile-nav-dimmer').fadeIn(100,function() {
$(main_nav_focus_target).focus();
});
});
$('#mobile-home').after('<a id="mobile-close" href="#"><span class="sr-only">Close Menu</span></a>');
$('#mobile-close').click(function(e) {
e.preventDefault();
$('#main-navigation, #mobile-nav-dimmer').fadeOut(100,function() {
$('#main-navigation li.parent').removeClass('open');
$('#mobile-nav').focus();
});
});
$('#main-navigation').before('<div id="mobile-nav-dimmer"></div>');
$('#mobile-nav-dimmer').click(function(e) {
$('#mobile-close').trigger('click');
});
// 2. Empty Sidebar Helper ------------------------------------------------
$('.secondary').each(function() {
if (msie != 8 && msie != 7) {
if ( !$(this).html().trim() ) {
$(this).empty();
}
}
});
// 5. Mobile Expander -----------------------------------------------------
$('.mobile-expander').each(function() {
$(this).prepend('<a href="#" aria-hidden="true" class="mobile-expander-heading mobile-only"><span class="zmdi zmdi-menu"></span>More in this Section</a>');
//if ($(this).children('h1, h2, h3, h4, h5, h6').length > 0) {
var expand_header = $(this).children('.mobile-expander-heading').first();
$(expand_header).nextAll().wrapAll('<div class="mobile" />');
$(expand_header).click(function(e) {
e.preventDefault();
if ($(window).width() <= mobile_expander_breakpoint) {
$(this).toggleClass('open');
}
});
$(expand_header).next('.mobile').find('a').focus(function() {
$(this).parents('.mobile').prev('.mobile-expander-heading').addClass('open');
}); // TODO: focus and mouse event reconciliation for full keyboard support
//}
});
// 6. Mobile Table Helper -------------------------------------------------
$('.mobile-scroll').each(function() {
$(this).wrap('<div class="table-scroller" />');
if ( $(this).hasClass('large') ) {
$(this).parent().addClass('large');
}
});
$('.table-scroller').append('<div class="table-fader" />').bind('scroll touchmove', function() {
$(this).find('.table-fader').remove(); // hide fader DIV on user interaction
});
});})(jQuery, this);
/*global jQuery, window */
(function ($, window) {
'use strict';
var templateMap = {},
instance = null,
options = {
// Should an error be thrown if an attempt is made to render a non-existent template. If false, the
// operation will fail silently.
warnOnMissingTemplates: false,
// Should an error be thrown if an attempt is made to overwrite a template which has already been added.
// If true the original template will be overwritten with the new value.
allowOverwrite: true,
// The 'type' attribute which you use to denoate a Mustache Template in the DOM; eg:
// `<script type="text/html" id="my-template"></script>`
domTemplateType: 'text/html',
// Specifies the `dataType` attribute used when external templates are loaded.
externalTemplateDataType: 'text'
};
function getMustache() {
// Lazily retrieve Mustache from the window global if it hasn't been defined by
// the User.
if (instance === null) {
instance = window.Mustache;
if (instance === void 0) {
$.error("Failed to locate Mustache instance, are you sure it has been loaded?");
}
}
return instance;
}
/**
* @return {boolean} if the supplied templateName has been added.
*/
function has(templateName) {
return templateMap[templateName] !== void 0;
}
/**
* Registers a template so that it can be used by $.Mustache.
*
* @param templateName A name which uniquely identifies this template.
* @param templateHtml The HTML which makes us the template; this will be rendered by Mustache when render()
* is invoked.
* @throws If options.allowOverwrite is false and the templateName has already been registered.
*/
function add(templateName, templateHtml) {
if (!options.allowOverwrite && has(templateName)) {
$.error('TemplateName: ' + templateName + ' is already mapped.');
return;
}
templateMap[templateName] = $.trim(templateHtml);
}
/**
* Adds one or more tempaltes from the DOM using either the supplied templateElementIds or by retrieving all script
* tags of the 'domTemplateType'. Templates added in this fashion will be registered with their elementId value.
*
* @param [...templateElementIds] List of element id's present on the DOM which contain templates to be added;
* if none are supplied all script tags that are of the same type as the
* `options.domTemplateType` configuration value will be added.
*/
function addFromDom() {
var templateElementIds;
// If no args are supplied, all script blocks will be read from the document.
if (arguments.length === 0) {
templateElementIds = $('script[type="' + options.domTemplateType + '"]').map(function () {
return this.id;
});
}
else {
templateElementIds = $.makeArray(arguments);
}
$.each(templateElementIds, function() {
var templateElement = document.getElementById(this);
if (templateElement === null) {
$.error('No such elementId: #' + this);
}
else {
add(this, $(templateElement).html());
}
});
}
/**
* Removes a template, the contents of the removed Template will be returned.
*
* @param templateName The name of the previously registered Mustache template that you wish to remove.
* @returns String which represents the raw content of the template.
*/
function remove(templateName) {
var result = templateMap[templateName];
delete templateMap[templateName];
return result;
}
/**
* Removes all templates and tells Mustache to flush its cache.
*/
function clear() {
templateMap = {};
getMustache().clearCache();
}
/**
* Renders a previously added Mustache template using the supplied templateData object. Note if the supplied
* templateName doesn't exist an empty String will be returned.
*/
function render(templateName, templateData) {
if (!has(templateName)) {
if (options.warnOnMissingTemplates) {
$.error('No template registered for: ' + templateName);
}
return '';
}
return getMustache().to_html(templateMap[templateName], templateData, templateMap);
}
/**
* Loads the external Mustache templates located at the supplied URL and registers them for later use. This method
* returns a jQuery Promise and also support an `onComplete` callback.
*
* @param url URL of the external Mustache template file to load.
* @param onComplete Optional callback function which will be invoked when the templates from the supplied URL
* have been loaded and are ready for use.
* @returns jQuery deferred promise which will complete when the templates have been loaded and are
* ready for use.
*/
function load(url, onComplete) {
return $.ajax({
url: url,
dataType: options.externalTemplateDataType
}).done(function (templates) {
$(templates).filter('script').each(function (i, el) {
add(el.id, $(el).html());
});
if ($.isFunction(onComplete)) {
onComplete();
}
});
}
/**
* Returns an Array of templateNames which have been registered and can be retrieved via
* $.Mustache.render() or $(element).mustache().
*/
function templates() {
return $.map(templateMap, function (value, key) {
return key;
});
}
// Expose the public methods on jQuery.Mustache
$.Mustache = {
options: options,
load: load,
has: has,
add: add,
addFromDom: addFromDom,
remove: remove,
clear: clear,
render: render,
templates: templates,
instance: instance
};
/**
* Renders one or more viewModels into the current jQuery element.
*
* @param templateName The name of the Mustache template you wish to render, Note that the
* template must have been previously loaded and / or added.
* @param templateData One or more JavaScript objects which will be used to render the Mustache
* template.
* @param options.method jQuery method to use when rendering, defaults to 'append'.
*/
$.fn.mustache = function (templateName, templateData, options) {
var settings = $.extend({
method: 'append'
}, options);
var renderTemplate = function (obj, viewModel) {
$(obj)[settings.method](render(templateName, viewModel));
};
return this.each(function () {
var element = this;
// Render a collection of viewModels.
if ($.isArray(templateData)) {
$.each(templateData, function () {
renderTemplate(element, this);
});
}
// Render a single viewModel.
else {
renderTemplate(element, templateData);
}
});
};
}(jQuery, window));
\ No newline at end of file
This diff is collapsed.
@mixin button-tint($color) {
background-color: white;
border-radius: 2px;
border: 2px solid lighten($color, 10);
padding: 7px 30px;
color: $color;
&:hover, &:focus {
background-color: lighten($color, 50);
border-color: $color;
color: darken($color, 10);
}
&:active, &:active:hover, &:active:focus {
background-color: $color;
border-color: $color;
color: white;
}
}
.btn-primary {
@include button-tint($modularstorage-color-c);
}
.btn-secondary {
@include button-tint($modularstorage-color-a);
}
\ No newline at end of file
This diff is collapsed.
/*# sourceMappingURL=variables.css.map */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment