Initial commit

This commit is contained in:
2020-01-04 20:41:09 +01:00
commit 150d0179fc
1328 changed files with 186900 additions and 0 deletions

View File

@@ -0,0 +1,177 @@
jQuery( document ).ready( function () {
/**
* Search
*/
var hideSearchForm = function() {
jQuery( '#masthead .search-form-top' ).removeClass( 'show' );
};
// For Search Icon Toggle effect added at the top.
jQuery( '.search-top' ).click(
function () {
jQuery( this ).next( '#masthead .search-form-top' ).toggleClass( 'show' );
// Focus after some time to fix conflict with toggleClass.
setTimeout(
function () {
jQuery( '#masthead .search-form-top input' ).focus();
},
200
);
// For esc key press.
jQuery( document ).on(
'keyup',
function ( e ) {
// On esc key press.
if ( 27 === e.keyCode ) {
// If search box is opened.
if ( jQuery( '#masthead .search-form-top' ).hasClass( 'show' ) ) {
hideSearchForm();
}
}
}
);
jQuery( document ).on(
'click.outEvent',
function ( e ) {
if ( e.target.closest( '.top-search-wrap' ) ) {
return;
}
hideSearchForm();
// Unbind current click event.
jQuery( document ).off( 'click.outEvent' );
}
);
}
);
jQuery( '#scroll-up' ).hide();
jQuery( function () {
jQuery( window ).scroll( function () {
if ( jQuery( this ).scrollTop() > 1000 ) {
jQuery( '#scroll-up' ).fadeIn();
} else {
jQuery( '#scroll-up' ).fadeOut();
}
} );
jQuery( 'a#scroll-up' ).click( function () {
jQuery( 'body,html' ).animate( {
scrollTop : 0
}, 800 );
return false;
} );
} );
jQuery( '.better-responsive-menu #site-navigation .menu-item-has-children' ).append( '<span class="sub-toggle"> <i class="fa fa-caret-down"></i> </span>' );
jQuery( '.better-responsive-menu #site-navigation .sub-toggle' ).click( function () {
jQuery( this ).parent( '.menu-item-has-children' ).children( 'ul.sub-menu' ).first().slideToggle( '1000' );
jQuery( this ).children( '.fa-caret-right' ).first().toggleClass( 'fa-caret-down' );
jQuery( this ).toggleClass( 'active' );
} );
jQuery( document ).on( 'click', '#site-navigation ul li.menu-item-has-children > a', function ( event ) {
var menuClass = jQuery( this ).parent( '.menu-item-has-children' );
if ( ! menuClass.hasClass( 'focus' ) && jQuery( window ).width() <= 768 ) {
menuClass.addClass( 'focus' );
event.preventDefault();
menuClass.children( '.sub-menu' ).css( {
'display' : 'block'
} );
}
} );
/**
* Scrollbar on fixed responsive menu
*/
jQuery( window ).load( function () {
if ( window.matchMedia( "(max-width: 768px)" ).matches && jQuery( '#masthead .sticky-wrapper' ).length >= 1 ) {
var screenHeight = jQuery( window ).height();
var availableMenuHeight = screenHeight - 43;
var menu = jQuery( '#site-navigation' ).find( 'ul' ).first();
menu.css( 'max-height', availableMenuHeight )
menu.addClass( 'menu-scrollbar' );
}
} );
// Featured Image Popup Setting.
if ( typeof jQuery.fn.magnificPopup !== 'undefined' ) {
jQuery( '.image-popup' ).magnificPopup( { type : 'image' } );
}
// Fitvids setting.
if ( typeof jQuery.fn.fitVids !== 'undefined' ) {
jQuery( '.fitvids-video' ).fitVids();
}
// Settings of the ticker.
if ( typeof jQuery.fn.newsTicker !== 'undefined' ) {
jQuery( '.newsticker' ).newsTicker( {
row_height : 20,
max_rows : 1,
speed : 1000,
direction : 'down',
duration : 4000,
autostart : 1,
pauseOnHover : 1
} );
}
// Settings of the sticky menu.
if ( typeof jQuery.fn.sticky !== 'undefined' ) {
var wpAdminBar = jQuery( '#wpadminbar' );
if ( wpAdminBar.length ) {
jQuery( '#site-navigation' ).sticky( {
topSpacing : wpAdminBar.height(),
zIndex : 999
} );
} else {
jQuery( '#site-navigation' ).sticky( {
topSpacing : 0,
zIndex : 999
} );
}
}
// BxSlider JS Settings.
if ( typeof jQuery.fn.bxSlider !== 'undefined' ) {
jQuery( '.widget_slider_area_rotate' ).bxSlider( {
mode : 'horizontal',
speed : 1500,
auto : true,
pause : 5000,
adaptiveHeight : true,
nextText : '',
prevText : '',
nextSelector : '.slide-next',
prevSelector : '.slide-prev',
pager : false,
tickerHover : true
} );
jQuery( '.blog .gallery-images, .archive .gallery-images, .search .gallery-images, .single-post .gallery-images' ).bxSlider( {
mode : 'fade',
speed : 1500,
auto : true,
pause : 3000,
adaptiveHeight : true,
nextText : '',
prevText : '',
nextSelector : '.slide-next',
prevSelector : '.slide-prev',
pager : false
} );
}
} );

141
colormag/js/customizer.js Normal file
View File

@@ -0,0 +1,141 @@
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function ( $ ) {
// Site title
wp.customize( 'blogname', function ( value ) {
value.bind( function ( to ) {
$( '#site-title a' ).text( to );
} );
} );
// Site description.
wp.customize( 'blogdescription', function ( value ) {
value.bind( function ( to ) {
$( '#site-description' ).text( to );
} );
} );
// Site Layout Option
wp.customize( 'colormag_site_layout', function ( value ) {
value.bind( function ( layout ) {
var site_layout = layout;
if ( site_layout === 'wide_layout' ) {
$( 'body' ).addClass( 'wide' );
} else if ( site_layout === 'boxed_layout' ) {
$( 'body' ).removeClass( 'wide' );
}
}
);
} );
// Primary Color Option
wp.customize( 'colormag_primary_color', function ( value ) {
value.bind( function ( primaryColor ) {
// Store internal style for primary color
var primaryColorStyle = '<style id="colormag-internal-primary-color">' +
'.colormag-button,blockquote,button,input[type=reset],input[type=button],input[type=submit], ' +
'#masthead.colormag-header-clean #site-navigation.main-small-navigation .menu-toggle{background-color:' + primaryColor + '}' +
'#site-title a,.next a:hover,.previous a:hover,.social-links i.fa:hover,a, ' +
'#masthead.colormag-header-clean .social-links li:hover i.fa, ' +
'#masthead.colormag-header-classic .social-links li:hover i.fa, ' +
'#masthead.colormag-header-clean .breaking-news .newsticker a:hover, ' +
'#masthead.colormag-header-classic .breaking-news .newsticker a:hover, ' +
'#masthead.colormag-header-classic #site-navigation .fa.search-top:hover, ' +
'#masthead.colormag-header-classic #site-navigation .random-post a:hover .fa-random, ' +
'.better-responsive-menu #masthead .main-small-navigation li:hover > .sub-toggle i, ' +
'.better-responsive-menu #masthead .main-small-navigation .sub-toggle.active .fa {color:' + primaryColor + '}' +
'.fa.search-top:hover, ' +
'#masthead.colormag-header-classic #site-navigation.main-small-navigation .menu-toggle {background-color:' + primaryColor + '}' +
'#site-navigation{border-top:4px solid ' + primaryColor + '}' +
'.home-icon.front_page_on,.main-navigation a:hover,.main-navigation ul li ul li a:hover,' +
'.main-navigation ul li ul li:hover>a, ' +
'.main-navigation ul li.current-menu-ancestor>a,.main-navigation ul li.current-menu-item ul li a:hover, ' +
'.main-navigation ul li.current-menu-item>a,.main-navigation ul li.current_page_ancestor>a, ' +
'.main-navigation ul li.current_page_item>a, ' +
'.main-navigation ul li:hover>a,.main-small-navigation li a:hover,.site-header .menu-toggle:hover,' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li:hover > a, ' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-ancestor > a, ' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-item > a, ' +
'#masthead .main-small-navigation li:hover > a, ' +
'#masthead .main-small-navigation li.current-page-ancestor > a, ' +
'#masthead .main-small-navigation li.current-menu-ancestor > a, ' +
'#masthead .main-small-navigation li.current-page-item > a, ' +
'#masthead .main-small-navigation li.current-menu-item > a {background-color:' + primaryColor + '}' +
'.main-small-navigation .current-menu-item>a,' +
'.main-small-navigation .current_page_item>a {background:' + primaryColor + '}' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li:hover, ' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-ancestor, ' +
'#masthead.colormag-header-classic .main-navigation ul ul.sub-menu li.current-menu-item, ' +
'#masthead.colormag-header-classic #site-navigation.main-small-navigation .menu-toggle, ' +
'#masthead.colormag-header-classic #site-navigation .menu-toggle:hover, ' +
'#masthead.colormag-header-classic .main-navigation ul > li:hover > a, ' +
'#masthead.colormag-header-classic .main-navigation ul > li.current-menu-item > a, ' +
'#masthead.colormag-header-classic .main-navigation ul > li.current-menu-ancestor > a, ' +
'#masthead.colormag-header-classic .main-navigation ul li.focus > a {border-color:' + primaryColor + ' }' +
'.promo-button-area a:hover{border:2px solid ' + primaryColor + ';' + 'background-color:' + primaryColor + '}' +
'#content .wp-pagenavi .current,#content .wp-pagenavi a:hover,.format-link .entry-content a,' +
'.pagination span{background-color:' + primaryColor + '}' +
'.pagination a span:hover{color:' + primaryColor + ';' + 'border-color:' + primaryColor + '}' +
'#content .comments-area a.comment-edit-link:hover,#content .comments-area a.comment-permalink:hover,' +
'#content .comments-area article header cite a:hover,.comments-area .comment-author-link a:hover{color:' + primaryColor + '}' +
'.comments-area .comment-author-link span{background-color:' + primaryColor + '}' +
'.comment .comment-reply-link:hover,.nav-next a,.nav-previous a{color:' + primaryColor + '}' +
'#secondary .widget-title{border-bottom:2px solid ' + primaryColor + '}' +
'#secondary .widget-title span{background-color:' + primaryColor + '}' +
'.footer-widgets-area .widget-title{border-bottom:2px solid ' + primaryColor + '}' +
'.footer-widgets-area .widget-title span,.colormag-footer--classic .footer-widgets-area .widget-title span::before{background-color:' + primaryColor + '}' +
'.footer-widgets-area a:hover{color:' + primaryColor + '}' +
'.advertisement_above_footer .widget-title{border-bottom:2px solid ' + primaryColor + '}' +
'.advertisement_above_footer .widget-title span{background-color:' + primaryColor + '}' +
'a#scroll-up i{color:' + primaryColor + '}' +
'.page-header .page-title{border-bottom:2px solid ' + primaryColor + '}' +
'#content .post .article-content .above-entry-meta .cat-links a,.page-header .page-title span{background-color:' + primaryColor + '}' +
'#content .post .article-content .entry-title a:hover,.entry-meta .byline i,.entry-meta .cat-links i,.entry-meta a,.post .entry-title a:hover,.search .entry-title a:hover{color:' + primaryColor + '}' +
'.entry-meta .post-format i{background-color:' + primaryColor + '}' +
'.entry-meta .comments-link a:hover,.entry-meta .edit-link a:hover,.entry-meta .posted-on a:hover,.entry-meta .tag-links a:hover,.single #content .tags a:hover{color:' + primaryColor + '}' +
'.more-link,.no-post-thumbnail{background-color:' + primaryColor + '}' +
'.post-box .entry-meta .cat-links a:hover,.post-box .entry-meta .posted-on a:hover,.post.post-box .entry-title a:hover{color:' + primaryColor + '}' +
'.widget_featured_slider .slide-content .above-entry-meta .cat-links a{background-color:' + primaryColor + '}' +
'.widget_featured_slider .slide-content .below-entry-meta .byline a:hover,.widget_featured_slider .slide-content .below-entry-meta .comments a:hover,.widget_featured_slider .slide-content .below-entry-meta .posted-on a:hover,.widget_featured_slider .slide-content .entry-title a:hover{color:' + primaryColor + '}' +
'.widget_highlighted_posts .article-content .above-entry-meta .cat-links a{background-color:' + primaryColor + '}' +
'.byline a:hover,.comments a:hover,.edit-link a:hover,.posted-on a:hover,.tag-links a:hover,.widget_highlighted_posts .article-content .below-entry-meta .byline a:hover,.widget_highlighted_posts .article-content .below-entry-meta .comments a:hover,.widget_highlighted_posts .article-content .below-entry-meta .posted-on a:hover,.widget_highlighted_posts .article-content .entry-title a:hover{color:' + primaryColor + '}' +
'.widget_featured_posts .article-content .above-entry-meta .cat-links a{background-color:' + primaryColor + '}' +
'.widget_featured_posts .article-content .entry-title a:hover{color:' + primaryColor + '}' +
'.widget_featured_posts .widget-title{border-bottom:2px solid ' + primaryColor + '}' +
'.widget_featured_posts .widget-title span{background-color:' + primaryColor + '}' +
'.related-posts-main-title .fa,.single-related-posts .article-content .entry-title a:hover{color:' + primaryColor + '}' +
'@media (max-width: 768px) {.better-responsive-menu .sub-toggle{background-color:' + primaryColor + '}}' +
'.elementor .tg-module-wrapper .module-title{border-bottom:1px solid ' + primaryColor + '}' +
'.elementor .tg-module-wrapper .module-title span,.elementor .tg-module-wrapper .tg-post-category{background-color:' + primaryColor + '}' +
'.elementor .tg-module-wrapper .tg-module-meta .tg-module-comments a:hover,.elementor .tg-module-wrapper .tg-module-meta .tg-post-auther-name a:hover,.elementor .tg-module-wrapper .tg-module-meta .tg-post-date a:hover,.elementor .tg-module-wrapper .tg-module-title:hover a,.elementor .tg-module-wrapper.tg-module-grid .tg_module_grid .tg-module-info .tg-module-meta a:hover{color:' + primaryColor + '}' + '.widget_slider_area .widget-title,.widget_beside_slider .widget-title { border-bottom:2px solid ' + primaryColor + '}' + '.widget_slider_area .widget-title span,.widget_beside_slider .widget-title span { background-color:' + primaryColor + '}' +
'</style>';
// Remove previously create internal style and add new one.
$( 'head #colormag-internal-primary-color' ).remove();
$( 'head' ).append( primaryColorStyle );
} );
} );
// Footer Main Area Display Type
wp.customize( 'colormag_main_footer_layout_display_type', function ( value ) {
value.bind( function ( layout ) {
var display_type = layout;
if ( display_type === 'type_two' ) {
$( '#colophon' ).removeClass( 'colormag-footer--classic-bordered' ).addClass( 'colormag-footer--classic' );
} else if ( display_type === 'type_one' ) {
$( '#colophon' ).removeClass( 'colormag-footer--classic colormag-footer--classic-bordered' );
}
}
);
} );
} )( jQuery );

View File

@@ -0,0 +1,87 @@
/*jshint browser:true */
/*!
* FitVids 1.1
*
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
;(function( $ ){
'use strict';
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null,
ignore: null
};
if(!document.getElementById('fit-vids-style')) {
// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
var head = document.head || document.getElementsByTagName('head')[0];
var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
var div = document.createElement("div");
div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
head.appendChild(div.childNodes[1]);
}
if ( options ) {
$.extend( settings, options );
}
return this.each(function(){
var selectors = [
'iframe[src*="player.vimeo.com"]',
'iframe[src*="youtube.com"]',
'iframe[src*="youtube-nocookie.com"]',
'iframe[src*="kickstarter.com"][src*="video.html"]',
'object',
'embed'
];
if (settings.customSelector) {
selectors.push(settings.customSelector);
}
var ignoreList = '.fitvidsignore';
if(settings.ignore) {
ignoreList = ignoreList + ', ' + settings.ignore;
}
var $allVideos = $(this).find(selectors.join(','));
$allVideos = $allVideos.not('object object'); // SwfObj conflict patch
$allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
$allVideos.each(function(){
var $this = $(this);
if($this.parents(ignoreList).length > 0) {
return; // Disable FitVids on this video.
}
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
{
$this.attr('height', 9);
$this.attr('width', 16);
}
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
aspectRatio = height / width;
if(!$this.attr('name')){
var videoName = 'fitvid' + $.fn.fitVids._count;
$this.attr('name', videoName);
$.fn.fitVids._count++;
}
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
$this.removeAttr('height').removeAttr('width');
});
});
};
// Internal counter for unique video names.
$.fn.fitVids._count = 0;
// Works with either jQuery or Zepto
})( window.jQuery || window.Zepto );

326
colormag/js/html5shiv.js vendored Normal file
View File

@@ -0,0 +1,326 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document|DocumentFragment} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));

4
colormag/js/html5shiv.min.js vendored Normal file
View File

@@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);

View File

@@ -0,0 +1,54 @@
jQuery( document ).ready( function ( $ ) {
var file_frame;
$( document.body ).on( 'click', '.custom_media_upload', function ( event ) {
var $el = $( this );
var file_target_input = $el.parent().find( '.custom_media_input' );
var file_target_preview = $el.parent().find( '.custom_media_preview' );
event.preventDefault();
// Create the media frame.
file_frame = wp.media.frames.media_file = wp.media( {
// Set the title of the modal.
title : $el.data( 'choose' ),
button : {
text : $el.data( 'update' )
},
states : [
new wp.media.controller.Library( {
title : $el.data( 'choose' ),
library : wp.media.query( { type : 'image' } )
} )
]
} );
// When an image is selected, run a callback.
file_frame.on( 'select', function () {
// Get the attachment from the modal frame.
var attachment = file_frame.state().get( 'selection' ).first().toJSON();
// Initialize input and preview change.
file_target_input.val( attachment.url ).change();
file_target_preview.css( { display : 'none' } ).find( 'img' ).remove();
file_target_preview.css( { display : 'block' } ).append( '<img src="' + attachment.url + '" style="max-width:100%">' );
} );
// Finally, open the modal.
file_frame.open();
} );
// Media Uploader Preview
$( 'input.custom_media_input' ).each( function () {
var preview_image = $( this ).val(),
preview_target = $( this ).siblings( '.custom_media_preview' );
// Initialize image previews.
if ( preview_image !== '' ) {
preview_target.find( 'img.custom_media_preview_default' ).remove();
preview_target.css( { display : 'block' } ).append( '<img src="' + preview_image + '" style="max-width:100%">' );
}
} );
} );

File diff suppressed because it is too large Load Diff

1
colormag/js/jquery.bxslider.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,351 @@
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1042;
overflow: hidden;
position: fixed;
background: #0b0b0b;
opacity: 0.8; }
.mfp-wrap {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1043;
position: fixed;
outline: none !important;
-webkit-backface-visibility: hidden; }
.mfp-container {
text-align: center;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
padding: 0 8px;
box-sizing: border-box; }
.mfp-container:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle; }
.mfp-align-top .mfp-container:before {
display: none; }
.mfp-content {
position: relative;
display: inline-block;
vertical-align: middle;
margin: 0 auto;
text-align: left;
z-index: 1045; }
.mfp-inline-holder .mfp-content,
.mfp-ajax-holder .mfp-content {
width: 100%;
cursor: auto; }
.mfp-ajax-cur {
cursor: progress; }
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
cursor: -moz-zoom-out;
cursor: -webkit-zoom-out;
cursor: zoom-out; }
.mfp-zoom {
cursor: pointer;
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in; }
.mfp-auto-cursor .mfp-content {
cursor: auto; }
.mfp-close,
.mfp-arrow,
.mfp-preloader,
.mfp-counter {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none; }
.mfp-loading.mfp-figure {
display: none; }
.mfp-hide {
display: none !important; }
.mfp-preloader {
color: #CCC;
position: absolute;
top: 50%;
width: auto;
text-align: center;
margin-top: -0.8em;
left: 8px;
right: 8px;
z-index: 1044; }
.mfp-preloader a {
color: #CCC; }
.mfp-preloader a:hover {
color: #FFF; }
.mfp-s-ready .mfp-preloader {
display: none; }
.mfp-s-error .mfp-content {
display: none; }
button.mfp-close,
button.mfp-arrow {
overflow: visible;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
display: block;
outline: none;
padding: 0;
z-index: 1046;
box-shadow: none;
touch-action: manipulation; }
button::-moz-focus-inner {
padding: 0;
border: 0; }
.mfp-close {
width: 44px;
height: 44px;
line-height: 44px;
position: absolute;
right: 0;
top: 0;
text-decoration: none;
text-align: center;
opacity: 0.65;
padding: 0 0 18px 10px;
color: #FFF;
font-style: normal;
font-size: 28px;
font-family: Arial, Baskerville, monospace; }
.mfp-close:hover,
.mfp-close:focus {
opacity: 1; }
.mfp-close:active {
top: 1px; }
.mfp-close-btn-in .mfp-close {
color: #333; }
.mfp-image-holder .mfp-close,
.mfp-iframe-holder .mfp-close {
color: #FFF;
right: -6px;
text-align: right;
padding-right: 6px;
width: 100%; }
.mfp-counter {
position: absolute;
top: 0;
right: 0;
color: #CCC;
font-size: 12px;
line-height: 18px;
white-space: nowrap; }
.mfp-arrow {
position: absolute;
opacity: 0.65;
margin: 0;
top: 50%;
margin-top: -55px;
padding: 0;
width: 90px;
height: 110px;
-webkit-tap-highlight-color: transparent; }
.mfp-arrow:active {
margin-top: -54px; }
.mfp-arrow:hover,
.mfp-arrow:focus {
opacity: 1; }
.mfp-arrow:before,
.mfp-arrow:after {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
left: 0;
top: 0;
margin-top: 35px;
margin-left: 35px;
border: medium inset transparent; }
.mfp-arrow:after {
border-top-width: 13px;
border-bottom-width: 13px;
top: 8px; }
.mfp-arrow:before {
border-top-width: 21px;
border-bottom-width: 21px;
opacity: 0.7; }
.mfp-arrow-left {
left: 0; }
.mfp-arrow-left:after {
border-right: 17px solid #FFF;
margin-left: 31px; }
.mfp-arrow-left:before {
margin-left: 25px;
border-right: 27px solid #3F3F3F; }
.mfp-arrow-right {
right: 0; }
.mfp-arrow-right:after {
border-left: 17px solid #FFF;
margin-left: 39px; }
.mfp-arrow-right:before {
border-left: 27px solid #3F3F3F; }
.mfp-iframe-holder {
padding-top: 40px;
padding-bottom: 40px; }
.mfp-iframe-holder .mfp-content {
line-height: 0;
width: 100%;
max-width: 900px; }
.mfp-iframe-holder .mfp-close {
top: -40px; }
.mfp-iframe-scaler {
width: 100%;
height: 0;
overflow: hidden;
padding-top: 56.25%; }
.mfp-iframe-scaler iframe {
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
background: #000; }
/* Main image in popup */
img.mfp-img {
width: auto;
max-width: 100%;
height: auto;
display: block;
line-height: 0;
box-sizing: border-box;
padding: 40px 0 40px;
margin: 0 auto; }
/* The shadow behind the image */
.mfp-figure {
line-height: 0; }
.mfp-figure:after {
content: '';
position: absolute;
left: 0;
top: 40px;
bottom: 40px;
display: block;
right: 0;
width: auto;
height: auto;
z-index: -1;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
background: #444; }
.mfp-figure small {
color: #BDBDBD;
display: block;
font-size: 12px;
line-height: 14px; }
.mfp-figure figure {
margin: 0; }
.mfp-bottom-bar {
margin-top: -36px;
position: absolute;
top: 100%;
left: 0;
width: 100%;
cursor: auto; }
.mfp-title {
text-align: left;
line-height: 18px;
color: #F3F3F3;
word-wrap: break-word;
padding-right: 36px; }
.mfp-image-holder .mfp-content {
max-width: 100%; }
.mfp-gallery .mfp-image-holder .mfp-figure {
cursor: pointer; }
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
/**
* Remove all paddings around the image on small screen
*/
.mfp-img-mobile .mfp-image-holder {
padding-left: 0;
padding-right: 0; }
.mfp-img-mobile img.mfp-img {
padding: 0; }
.mfp-img-mobile .mfp-figure:after {
top: 0;
bottom: 0; }
.mfp-img-mobile .mfp-figure small {
display: inline;
margin-left: 5px; }
.mfp-img-mobile .mfp-bottom-bar {
background: rgba(0, 0, 0, 0.6);
bottom: 0;
margin: 0;
top: auto;
padding: 3px 5px;
position: fixed;
box-sizing: border-box; }
.mfp-img-mobile .mfp-bottom-bar:empty {
padding: 0; }
.mfp-img-mobile .mfp-counter {
right: 5px;
top: 3px; }
.mfp-img-mobile .mfp-close {
top: 0;
right: 0;
width: 35px;
height: 35px;
line-height: 35px;
background: rgba(0, 0, 0, 0.6);
position: fixed;
text-align: center;
padding: 0; } }
@media all and (max-width: 900px) {
.mfp-arrow {
-webkit-transform: scale(0.75);
transform: scale(0.75); }
.mfp-arrow-left {
-webkit-transform-origin: 0;
transform-origin: 0; }
.mfp-arrow-right {
-webkit-transform-origin: 100%;
transform-origin: 100%; }
.mfp-container {
padding-left: 6px;
padding-right: 6px; } }

104
colormag/js/navigation.js Normal file
View File

@@ -0,0 +1,104 @@
/**
* navigation.js
*
* Handles toggling the navigation menu for small screens.
*/
( function () {
var container, button, menu, links, i, len;
container = document.getElementById( 'site-navigation' );
if ( ! container ) {
return;
}
button = container.getElementsByClassName( 'menu-toggle' )[ 0 ];
if ( 'undefined' === typeof button ) {
return;
}
menu = container.getElementsByTagName( 'ul' )[ 0 ];
// Hide menu toggle button if menu is empty and return early.
if ( 'undefined' === typeof menu ) {
button.style.display = 'none';
return;
}
menu.setAttribute( 'aria-expanded', 'false' );
if ( - 1 === menu.className.indexOf( 'nav-menu' ) ) {
menu.className += 'nav-menu';
}
button.onclick = function () {
if ( - 1 !== container.className.indexOf( 'main-small-navigation' ) ) {
container.className = container.className.replace( 'main-small-navigation', 'main-navigation' );
button.setAttribute( 'aria-expanded', 'false' );
menu.setAttribute( 'aria-expanded', 'false' );
} else {
container.className = container.className.replace( 'main-navigation', 'main-small-navigation' );
button.setAttribute( 'aria-expanded', 'true' );
menu.setAttribute( 'aria-expanded', 'true' );
}
};
// Get all the link elements within the menu.
links = menu.getElementsByTagName( 'a' );
// Each time a menu link is focused or blurred, toggle focus.
for ( i = 0, len = links.length; i < len; i ++ ) {
links[ i ].addEventListener( 'focus', toggleFocus, true );
links[ i ].addEventListener( 'blur', toggleFocus, true );
}
/**
* Sets or removes .focus class on an element.
*/
function toggleFocus() {
var self = this;
// Move up through the ancestors of the current link until we hit .nav-menu.
while ( - 1 === self.className.indexOf( 'nav-menu' ) ) {
// On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) {
if ( - 1 !== self.className.indexOf( 'focus' ) ) {
self.className = self.className.replace( ' focus', '' );
} else {
self.className += ' focus';
}
}
self = self.parentElement;
}
}
/**
* Toggles `focus` class to allow submenu access on tablets.
*/
( function ( container ) {
var touchStartFn, i,
parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
if ( 'ontouchstart' in window && window.matchMedia( '(min-width: 768px)' ).matches ) {
touchStartFn = function ( e ) {
var menuItem = this.parentNode, i;
if ( ! menuItem.classList.contains( 'focus' ) ) {
e.preventDefault();
for ( i = 0; i < menuItem.parentNode.children.length; ++ i ) {
if ( menuItem === menuItem.parentNode.children[ i ] ) {
continue;
}
menuItem.parentNode.children[ i ].classList.remove( 'focus' );
}
menuItem.classList.add( 'focus' );
} else {
menuItem.classList.remove( 'focus' );
}
};
for ( i = 0; i < parentLink.length; ++ i ) {
parentLink[ i ].addEventListener( 'touchstart', touchStartFn, false );
}
}
}( container ) );
} )();

View File

@@ -0,0 +1,248 @@
/*
_____ _____ _____ _______
/\ \ /\ \ /\ \ /::\ \
/::\ \ /::\ \ /::\ \ /::::\ \
/::::\ \ \:::\ \ /::::\ \ /::::::\ \
/::::::\ \ \:::\ \ /::::::\ \ /::::::::\ \
/:::/\:::\ \ \:::\ \ /:::/\:::\ \ /:::/~~\:::\ \
/:::/__\:::\ \ \:::\ \ /:::/__\:::\ \ /:::/ \:::\ \
/::::\ \:::\ \ /::::\ \ \:::\ \:::\ \:::/ / \:::\ \
/::::::\ \:::\ \__ /::::::\ \_\:::\ \:::\ \:/____/ \:::\____\
/:::/\:::\ \:::\____\ \ /:::/\:::\ \ \:::\ \:::\ \ | |:::| |
/:::/ \:::\ \:::| | \/:::/ \:::\____\ \:::\ \:::\____\___| |:::|____|
\::/ |::::\ /:::|____| /:::/ \::/ / \:::\ \::/ / _\___/:::/ /
\/____|:::::\/:::/ /\/:::/ / \/____/\ \:::\ \/____/:\ |::| /:::/ /
|:::::::::/ /:::::/ / \:::\ \:::\ \ \:::\|::|/:::/ /
|::|\::::/ /\::::/____/ \:::\ \:::\____\ \::::::::::/ /
|::| \::/____/ \:::\ \ \:::\ /:::/ / \::::::::/ /
|::| ~| \:::\ \ \:::\/:::/ / \::::::/ /
|::| | \:::\ \ \::::::/ / \::::/____/
\::| | \:::\____\ \::::/ / |::| |
\:| | \::/ / \::/ / |::|____|
\|___| \/____/ \/____/ ~~
____.________ _____ .___ .___
| |\_____ \ __ __ ___________ ___.__. / _ \ __| _/__ _______ ____ ____ ____ __| _/
| | / / \ \| | \_/ __ \_ __ < | | / /_\ \ / __ |\ \/ /\__ \ / \_/ ___\/ __ \ / __ |
/\__| |/ \_/. \ | /\ ___/| | \/\___ | / | \/ /_/ | \ / / __ \| | \ \__\ ___// /_/ |
\________|\_____\ \_/____/ \___ >__| / ____| \____|__ /\____ | \_/ (____ /___| /\___ >___ >____ |
\__> \/ \/ \/ \/ \/ \/ \/ \/ \/
_______ ___________.__ __
\ \ ______ _ ________ \__ ___/|__| ____ | | __ ___________
______ / | \_/ __ \ \/ \/ / ___/ | | | |/ ___\| |/ // __ \_ __ \ ______
/_____/ / | \ ___/\ /\___ \ | | | \ \___| <\ ___/| | \/ /_____/
\____|__ /\___ >\/\_//____ > |____| |__|\___ >__|_ \\___ >__|
\/ \/ \/ \/ \/ \/
==============================================================================================================
JQuery Advanced News Ticker 1.0.11 (20/02/14)
created by risq
website (docs & demos) : http://risq.github.io/jquery-advanced-news-ticker/
==============================================================================================================
*/
;
(function($, window, document, undefined) {
'use strict';
var pluginName = 'newsTicker',
defaults = {
row_height: 20,
max_rows: 3,
speed: 400,
duration: 2500,
direction: 'up',
autostart: 1,
pauseOnHover: 1,
nextButton: null,
prevButton: null,
startButton: null,
stopButton: null,
hasMoved: function() {},
movingUp: function() {},
movingDown: function() {},
start: function() {},
stop: function() {},
pause: function() {},
unpause: function() {}
};
function Plugin(element, options) {
this.element = element;
this.$el = $(element);
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this._name = pluginName;
this.moveInterval;
this.state = 0;
this.paused = 0;
this.moving = 0;
if (this.$el.is('ul, ol')) {
this.init();
}
}
Plugin.prototype = {
init: function() {
this.$el.height(this.options.row_height * this.options.max_rows)
.css({overflow : 'hidden'});
this.checkSpeed();
if(this.options.nextButton && typeof(this.options.nextButton[0]) !== 'undefined')
this.options.nextButton.click(function(e) {
this.moveNext();
this.resetInterval();
}.bind(this));
if(this.options.prevButton && typeof(this.options.prevButton[0]) !== 'undefined')
this.options.prevButton.click(function(e) {
this.movePrev();
this.resetInterval();
}.bind(this));
if(this.options.stopButton && typeof(this.options.stopButton[0]) !== 'undefined')
this.options.stopButton.click(function(e) {
this.stop()
}.bind(this));
if(this.options.startButton && typeof(this.options.startButton[0]) !== 'undefined')
this.options.startButton.click(function(e) {
this.start()
}.bind(this));
if(this.options.pauseOnHover) {
this.$el.hover(function() {
if (this.state)
this.pause();
}.bind(this), function() {
if (this.state)
this.unpause();
}.bind(this));
}
if(this.options.autostart)
this.start();
},
start: function() {
if (!this.state) {
this.state = 1;
this.resetInterval();
this.options.start();
}
},
stop: function() {
if (this.state) {
clearInterval(this.moveInterval);
this.state = 0;
this.options.stop();
}
},
resetInterval: function() {
if (this.state) {
clearInterval(this.moveInterval);
this.moveInterval = setInterval(function() {this.move()}.bind(this), this.options.duration);
}
},
move: function() {
if (!this.paused) this.moveNext();
},
moveNext: function() {
if (this.options.direction === 'down')
this.moveDown();
else if (this.options.direction === 'up')
this.moveUp();
},
movePrev: function() {
if (this.options.direction === 'down')
this.moveUp();
else if (this.options.direction === 'up')
this.moveDown();
},
pause: function() {
if (!this.paused) this.paused = 1;
this.options.pause();
},
unpause: function() {
if (this.paused) this.paused = 0;
this.options.unpause();
},
moveDown: function() {
if (!this.moving) {
this.moving = 1;
this.options.movingDown();
this.$el.children('li:last').detach().prependTo(this.$el).css('marginTop', '-' + this.options.row_height + 'px')
.animate({marginTop: '0px'}, this.options.speed, function(){
this.moving = 0;
this.options.hasMoved();
}.bind(this));
}
},
moveUp: function() {
if (!this.moving) {
this.moving = 1;
this.options.movingUp();
var element = this.$el.children('li:first');
element.animate({marginTop: '-' + this.options.row_height + 'px'}, this.options.speed,
function(){
element.detach().css('marginTop', '0').appendTo(this.$el);
this.moving = 0;
this.options.hasMoved();
}.bind(this));
}
},
updateOption: function(option, value) {
if (typeof(this.options[option]) !== 'undefined'){
this.options[option] = value;
if (option == 'duration' || option == 'speed'){
this.checkSpeed();
this.resetInterval();
}
}
},
add: function(content){
this.$el.append($('<li>').html(content));
},
getState: function() {
if (paused) return 2 // 2 = paused
else return this.state;// 0 = stopped, 1 = started
},
checkSpeed: function() {
if (this.options.duration < (this.options.speed + 25))
this.options.speed = this.options.duration - 25;
},
destroy: function() {
this._destroy(); // or this.delete; depends on jQuery version
}
};
$.fn[pluginName] = function(option) {
var args = arguments;
return this.each(function() {
var $this = $(this),
data = $.data(this, 'plugin_' + pluginName),
options = typeof option === 'object' && option;
if (!data) {
$this.data('plugin_' + pluginName, (data = new Plugin(this, options)));
}
// if first argument is a string, call silimarly named function
if (typeof option === 'string') {
data[option].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
})(jQuery, window, document);

View File

@@ -0,0 +1,12 @@
/*
JQuery Advanced News Ticker 1.0.11 (20/02/14)
created by risq
website (docs & demos) : http://risq.github.io/jquery-advanced-news-ticker/
*/
(function(b,k,l,m){function g(a,f){this.element=a;this.$el=b(a);this.options=b.extend({},c,f);this._defaults=c;this._name=d;this.moveInterval;this.moving=this.paused=this.state=0;(this.$el.is("ul")||this.$el.is("ol"))&&this.init()}var d="newsTicker",c={row_height:20,max_rows:3,speed:400,duration:2500,direction:"up",autostart:1,pauseOnHover:1,nextButton:null,prevButton:null,startButton:null,stopButton:null,hasMoved:function(){},movingUp:function(){},movingDown:function(){},start:function(){},stop:function(){},
pause:function(){},unpause:function(){}};g.prototype={init:function(){this.$el.height(this.options.row_height*this.options.max_rows).css({overflow:"hidden"});this.checkSpeed();this.options.nextButton&&"undefined"!==typeof this.options.nextButton[0]&&this.options.nextButton.click(function(a){this.moveNext();this.resetInterval()}.bind(this));this.options.prevButton&&"undefined"!==typeof this.options.prevButton[0]&&this.options.prevButton.click(function(a){this.movePrev();this.resetInterval()}.bind(this));
this.options.stopButton&&"undefined"!==typeof this.options.stopButton[0]&&this.options.stopButton.click(function(a){this.stop()}.bind(this));this.options.startButton&&"undefined"!==typeof this.options.startButton[0]&&this.options.startButton.click(function(a){this.start()}.bind(this));this.options.pauseOnHover&&this.$el.hover(function(){this.state&&this.pause()}.bind(this),function(){this.state&&this.unpause()}.bind(this));this.options.autostart&&this.start()},start:function(){this.state||(this.state=
1,this.resetInterval(),this.options.start())},stop:function(){this.state&&(clearInterval(this.moveInterval),this.state=0,this.options.stop())},resetInterval:function(){this.state&&(clearInterval(this.moveInterval),this.moveInterval=setInterval(function(){this.move()}.bind(this),this.options.duration))},move:function(){this.paused||this.moveNext()},moveNext:function(){"down"===this.options.direction?this.moveDown():"up"===this.options.direction&&this.moveUp()},movePrev:function(){"down"===this.options.direction?
this.moveUp():"up"===this.options.direction&&this.moveDown()},pause:function(){this.paused||(this.paused=1);this.options.pause()},unpause:function(){this.paused&&(this.paused=0);this.options.unpause()},moveDown:function(){this.moving||(this.moving=1,this.options.movingDown(),this.$el.children("li:last").detach().prependTo(this.$el).css("marginTop","-"+this.options.row_height+"px").animate({marginTop:"0px"},this.options.speed,function(){this.moving=0;this.options.hasMoved()}.bind(this)))},moveUp:function(){if(!this.moving){this.moving=
1;this.options.movingUp();var a=this.$el.children("li:first");a.animate({marginTop:"-"+this.options.row_height+"px"},this.options.speed,function(){a.detach().css("marginTop","0").appendTo(this.$el);this.moving=0;this.options.hasMoved()}.bind(this))}},updateOption:function(a,b){"undefined"!==typeof this.options[a]&&(this.options[a]=b,"duration"==a||"speed"==a)&&(this.checkSpeed(),this.resetInterval())},add:function(a){this.$el.append(b("<li>").html(a))},getState:function(){return paused?2:this.state},
checkSpeed:function(){this.options.duration<this.options.speed+25&&(this.options.speed=this.options.duration-25)},destroy:function(){this._destroy()}};b.fn[d]=function(a){var f=arguments;return this.each(function(){var c=b(this),e=b.data(this,"plugin_"+d),h="object"===typeof a&&a;e||c.data("plugin_"+d,e=new g(this,h));"string"===typeof a&&e[a].apply(e,Array.prototype.slice.call(f,1))})}})(jQuery,window,document);

View File

@@ -0,0 +1,31 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
} )();

View File

@@ -0,0 +1,287 @@
// Sticky Plugin v1.0.4 for jQuery
// =============
// Author: Anthony Garand
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
// Improvements by Leonardo C. Daronco (daronco)
// Created: 02/14/2011
// Date: 07/20/2015
// Website: http://stickyjs.com/
// Description: Makes an element on the page stick on the screen as you scroll
// It will only set the 'top' and 'position' of your element, you
// might need to adjust the width in some cases.
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var slice = Array.prototype.slice; // save ref to original slice()
var splice = Array.prototype.splice; // save ref to original slice()
var defaults = {
topSpacing: 0,
bottomSpacing: 0,
className: 'is-sticky',
wrapperClassName: 'sticky-wrapper',
center: false,
getWidthFrom: '',
widthFromWrapper: true, // works only when .getWidthFrom is empty
responsiveWidth: false,
zIndex: 'auto'
},
$window = $(window),
$document = $(document),
sticked = [],
windowHeight = $window.height(),
scroller = function() {
var scrollTop = $window.scrollTop(),
documentHeight = $document.height(),
dwh = documentHeight - windowHeight,
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
for (var i = 0, l = sticked.length; i < l; i++) {
var s = sticked[i],
elementTop = s.stickyWrapper.offset().top,
etse = elementTop - s.topSpacing - extra;
//update height in case of dynamic content
s.stickyWrapper.css('height', s.stickyElement.outerHeight());
if (scrollTop <= etse) {
if (s.currentTop !== null) {
s.stickyElement
.css({
'width': '',
'position': '',
'top': '',
'z-index': ''
});
s.stickyElement.parent().removeClass(s.className);
s.stickyElement.trigger('sticky-end', [s]);
s.currentTop = null;
}
}
else {
var newTop = documentHeight - s.stickyElement.outerHeight()
- s.topSpacing - s.bottomSpacing - scrollTop - extra;
if (newTop < 0) {
newTop = newTop + s.topSpacing;
} else {
newTop = s.topSpacing;
}
if (s.currentTop !== newTop) {
var newWidth;
if (s.getWidthFrom) {
newWidth = $(s.getWidthFrom).width() || null;
} else if (s.widthFromWrapper) {
newWidth = s.stickyWrapper.width();
}
if (newWidth == null) {
newWidth = s.stickyElement.width();
}
s.stickyElement
.css('width', newWidth)
.css('position', 'fixed')
.css('top', newTop)
.css('z-index', s.zIndex);
s.stickyElement.parent().addClass(s.className);
if (s.currentTop === null) {
s.stickyElement.trigger('sticky-start', [s]);
} else {
// sticky is started but it have to be repositioned
s.stickyElement.trigger('sticky-update', [s]);
}
if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
// just reached bottom || just started to stick but bottom is already reached
s.stickyElement.trigger('sticky-bottom-reached', [s]);
} else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
// sticky is started && sticked at topSpacing && overflowing from top just finished
s.stickyElement.trigger('sticky-bottom-unreached', [s]);
}
s.currentTop = newTop;
}
// Check if sticky has reached end of container and stop sticking
var stickyWrapperContainer = s.stickyWrapper.parent();
var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing);
if( unstick ) {
s.stickyElement
.css('position', 'absolute')
.css('top', '')
.css('bottom', 0)
.css('z-index', '');
} else {
s.stickyElement
.css('position', 'fixed')
.css('top', newTop)
.css('bottom', '')
.css('z-index', s.zIndex);
}
}
}
},
resizer = function() {
windowHeight = $window.height();
for (var i = 0, l = sticked.length; i < l; i++) {
var s = sticked[i];
var newWidth = null;
if (s.getWidthFrom) {
if (s.responsiveWidth) {
newWidth = $(s.getWidthFrom).width();
}
} else if(s.widthFromWrapper) {
newWidth = s.stickyWrapper.width();
}
if (newWidth != null) {
s.stickyElement.css('width', newWidth);
}
}
},
methods = {
init: function(options) {
return this.each(function() {
var o = $.extend({}, defaults, options);
var stickyElement = $(this);
var stickyId = stickyElement.attr('id');
var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
var wrapper = $('<div></div>')
.attr('id', wrapperId)
.addClass(o.wrapperClassName);
stickyElement.wrapAll(function() {
if ($(this).parent("#" + wrapperId).length == 0) {
return wrapper;
}
});
var stickyWrapper = stickyElement.parent();
if (o.center) {
stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
}
if (stickyElement.css("float") === "right") {
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
}
o.stickyElement = stickyElement;
o.stickyWrapper = stickyWrapper;
o.currentTop = null;
sticked.push(o);
methods.setWrapperHeight(this);
methods.setupChangeListeners(this);
});
},
setWrapperHeight: function(stickyElement) {
var element = $(stickyElement);
var stickyWrapper = element.parent();
if (stickyWrapper) {
stickyWrapper.css('height', element.outerHeight());
}
},
setupChangeListeners: function(stickyElement) {
if (window.MutationObserver) {
var mutationObserver = new window.MutationObserver(function(mutations) {
if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) {
methods.setWrapperHeight(stickyElement);
}
});
mutationObserver.observe(stickyElement, {subtree: true, childList: true});
} else {
if (window.addEventListener) {
stickyElement.addEventListener('DOMNodeInserted', function() {
methods.setWrapperHeight(stickyElement);
}, false);
stickyElement.addEventListener('DOMNodeRemoved', function() {
methods.setWrapperHeight(stickyElement);
}, false);
} else if (window.attachEvent) {
stickyElement.attachEvent('onDOMNodeInserted', function() {
methods.setWrapperHeight(stickyElement);
});
stickyElement.attachEvent('onDOMNodeRemoved', function() {
methods.setWrapperHeight(stickyElement);
});
}
}
},
update: scroller,
unstick: function(options) {
return this.each(function() {
var that = this;
var unstickyElement = $(that);
var removeIdx = -1;
var i = sticked.length;
while (i-- > 0) {
if (sticked[i].stickyElement.get(0) === that) {
splice.call(sticked,i,1);
removeIdx = i;
}
}
if(removeIdx !== -1) {
unstickyElement.unwrap();
unstickyElement
.css({
'width': '',
'position': '',
'top': '',
'float': '',
'z-index': ''
})
;
}
});
}
};
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
if (window.addEventListener) {
window.addEventListener('scroll', scroller, false);
window.addEventListener('resize', resizer, false);
} else if (window.attachEvent) {
window.attachEvent('onscroll', scroller);
window.attachEvent('onresize', resizer);
}
$.fn.sticky = function(method) {
if (methods[method]) {
return methods[method].apply(this, slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return methods.init.apply( this, arguments );
} else {
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}
};
$.fn.unstick = function(method) {
if (methods[method]) {
return methods[method].apply(this, slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return methods.unstick.apply( this, arguments );
} else {
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}
};
$(function() {
setTimeout(scroller, 0);
});
}));