diff --git a/README.md b/README.md
index 1fe25597..a7e44327 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ This is an overview of the custom widgets, plugins and various features it inclu
- [Quick start](#quick-start)
- [Bugs and feature requests](#bugs-and-feature-requests)
+- [Quicklinks](#quicklinks)
- [Widgets](#widgets)
- [UW Blogroll](#uw-blogroll)
- [UW Campus Map](#uw-campus-map)
@@ -55,6 +56,23 @@ Download the [UW 2014 theme](https://github.com/uweb/uw-2014/archive/master.zip)
All bugs and feature requests can be issued at the [UW Web Team's GitHub account](https://github.com/uweb/uw-2014/issues) or emailed directly to the UW web team at [uweb@uw.edu](mailto:uweb@uw.edu).
+## Quicklinks ##
+
+Default quicklinks are provided in the theme if you would like them to be consistent with what is on the https://uw.edu website. To customize them, just create a menu in the **Quick Links** location. *Note: For multisites, Quick Links location will only appear on blog/site 1 and populate all other sites*.
+
+Links that have a class set containing an icon will appear at the top formatted as a larger link with an icon. Links without an icon will appear under the "Helpful Links" section.
+
+Icon class options:
+```
+icon-map
+icon-directories
+icon-calendar
+icon-libraries
+icon-medicine
+icon-myuw
+icon-uwtoday
+```
+
## Widgets ##
- - -
@@ -223,6 +241,26 @@ All bugs and feature requests can be issued at the [UW Web Team's GitHub account
[blogroll number=3 trim=true readmore='off']
```
+### Google Apps/Calendar shortcode ###
+
+> The `[googleapps]` shortcode has be deprecated. Please use the `[iframe]` shortcode instead.
+
+> To migrate from the `[googleapps]` calendar shortcode to the `[iframe]` shortcode, you will need to update as follows.
+
+> Your old Google Calendar `[googleapps]` shortcode looks like this:
+
+```
+ [googleapps domain="www" dir="calendar/embed" query="src=somenetid%40uw.edu&ctz=America%2FLos_Angeles" width="500" height="500"]
+
+```
+
+> Update it to:
+
+```
+ [iframe src="https://calendar.google.com/calendar/embed?src=somenetid%40uw.edu&ctz=America%2FLos_Angeles" height="500" width="500"]
+
+```
+
### iFrame ###
> Embed iframes into your post or page content without adjusting WordPress privileges.
@@ -353,18 +391,7 @@ Each tile is setup as a series of shortcodes wrapped in `[box]` shortcode.
### YouTube ###
-> Embed a YouTube video or playlist into your post content. You will need to obtain a [Youtube API key](https://developers.google.com/youtube/registering_an_application) to use this feature. You can acquire one from YouTube using your UW GSuite account or get in touch with us [uweb@uw.edu](mailto:uweb@uw.edu) for assistance.
-
-> Attributes:
-
-> - **type** : Pick whether to display a single video or playlist. Options: **single**, **playlist**. (_Default: None_)
-> - **id** : The youtube video or playlist id (_Default: None_)
-> - **max-results** (**OPTIONAL**): The maximum number of results to return for a playlist (_Default: None_)
-
-> Example:
-```
- [youtube type='playlist' id='PLgNkGpnjFWo9CN_HeVtujhMnUXK05iwgZ' max-results='10']
-```
+> This shortcode has been deprecated. To embed a youtube video, Simply copy and paste the YouTube video URL to embed videos and playlists.
### Slideshow ###
@@ -410,7 +437,7 @@ Each tile is setup as a series of shortcodes wrapped in `[box]` shortcode.
[section title='Example'] Section[/section]
[/accordion]
```
-
+> You can link to and automatically open individual sections of the accordion by adding them them the url. Example: http://www.washington.edu/about/#ACCORDION_ID will link to and open the accordion section. Note: you will need to retrieve the accordion section ID from the code as this is automatically generated and cannot be set.
### Custom Menu ###
> This shortcode pulls in a custom menu that can be created under _Dashboard > Appearance > Menus_. Icons can be added in the class field in the menu builder. View the [full set of icons](http://www.washington.edu/brand/web-2/html-web-components/web-icons/) for more information.
diff --git a/gruntfile.js b/gruntfile.js
index b8af8030..7351e1ba 100644
--- a/gruntfile.js
+++ b/gruntfile.js
@@ -23,7 +23,6 @@ module.exports = function(grunt) {
"js/uw.search.js",
"js/uw.quicklinks.js",
"js/uw.slideshow.js",
- "js/uw.youtube.js",
"js/uw.vimeo.js",
"js/uw.radio-checkbox.js",
"js/uw.dropdowns.js",
diff --git a/header.php b/header.php
index 33f9bf3b..a35fad9d 100644
--- a/header.php
+++ b/header.php
@@ -32,6 +32,8 @@
Skip to main content
+
+
diff --git a/js/libraries/imagesloaded.pkgd.js b/js/libraries/imagesloaded.pkgd.js
index 380c2ea8..9b75f616 100644
--- a/js/libraries/imagesloaded.pkgd.js
+++ b/js/libraries/imagesloaded.pkgd.js
@@ -1,893 +1,497 @@
/*!
- * imagesLoaded PACKAGED v3.1.8
+ * imagesLoaded PACKAGED v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
-
-/*!
- * EventEmitter v4.2.6 - git.io/ee
- * Oliver Caldwell
- * MIT license
- * @preserve
+/**
+ * EvEmitter v1.1.0
+ * Lil' event emitter
+ * MIT License
*/
-(function () {
-
-
- /**
- * Class for managing events.
- * Can be extended to provide event functionality in other classes.
- *
- * @class EventEmitter Manages event registering and emitting.
- */
- function EventEmitter() {}
-
- // Shortcuts to improve speed and size
- var proto = EventEmitter.prototype;
- var exports = this;
- var originalGlobalValue = exports.EventEmitter;
-
- /**
- * Finds the index of the listener for the event in it's storage array.
- *
- * @param {Function[]} listeners Array of listeners to search through.
- * @param {Function} listener Method to look for.
- * @return {Number} Index of the specified listener, -1 if not found
- * @api private
- */
- function indexOfListener(listeners, listener) {
- var i = listeners.length;
- while (i--) {
- if (listeners[i].listener === listener) {
- return i;
- }
- }
-
- return -1;
+/* jshint unused: true, undef: true, strict: true */
+
+( function( global, factory ) {
+ // universal module definition
+ /* jshint strict: false */ /* globals define, module, window */
+ if ( typeof define == 'function' && define.amd ) {
+ // AMD - RequireJS
+ define( 'ev-emitter/ev-emitter',factory );
+ } else if ( typeof module == 'object' && module.exports ) {
+ // CommonJS - Browserify, Webpack
+ module.exports = factory();
+ } else {
+ // Browser globals
+ global.EvEmitter = factory();
}
-
- /**
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
- *
- * @param {String} name The name of the target method.
- * @return {Function} The aliased method
- * @api private
- */
- function alias(name) {
- return function aliasClosure() {
- return this[name].apply(this, arguments);
- };
+
+ }( typeof window != 'undefined' ? window : this, function() {
+
+
+
+ function EvEmitter() {}
+
+ var proto = EvEmitter.prototype;
+
+ proto.on = function( eventName, listener ) {
+ if ( !eventName || !listener ) {
+ return;
}
-
- /**
- * Returns the listener array for the specified event.
- * Will initialise the event object and listener arrays if required.
- * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
- * Each property in the object response is an array of listener functions.
- *
- * @param {String|RegExp} evt Name of the event to return the listeners from.
- * @return {Function[]|Object} All listener functions for the event.
- */
- proto.getListeners = function getListeners(evt) {
- var events = this._getEvents();
- var response;
- var key;
-
- // Return a concatenated array of all matching events if
- // the selector is a regular expression.
- if (typeof evt === 'object') {
- response = {};
- for (key in events) {
- if (events.hasOwnProperty(key) && evt.test(key)) {
- response[key] = events[key];
- }
- }
- }
- else {
- response = events[evt] || (events[evt] = []);
- }
-
- return response;
- };
-
- /**
- * Takes a list of listener objects and flattens it into a list of listener functions.
- *
- * @param {Object[]} listeners Raw listener objects.
- * @return {Function[]} Just the listener functions.
- */
- proto.flattenListeners = function flattenListeners(listeners) {
- var flatListeners = [];
- var i;
-
- for (i = 0; i < listeners.length; i += 1) {
- flatListeners.push(listeners[i].listener);
- }
-
- return flatListeners;
- };
-
- /**
- * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
- *
- * @param {String|RegExp} evt Name of the event to return the listeners from.
- * @return {Object} All listener functions for an event in an object.
- */
- proto.getListenersAsObject = function getListenersAsObject(evt) {
- var listeners = this.getListeners(evt);
- var response;
-
- if (listeners instanceof Array) {
- response = {};
- response[evt] = listeners;
- }
-
- return response || listeners;
- };
-
- /**
- * Adds a listener function to the specified event.
- * The listener will not be added if it is a duplicate.
- * If the listener returns true then it will be removed after it is called.
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to attach the listener to.
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addListener = function addListener(evt, listener) {
- var listeners = this.getListenersAsObject(evt);
- var listenerIsWrapped = typeof listener === 'object';
- var key;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
- listeners[key].push(listenerIsWrapped ? listener : {
- listener: listener,
- once: false
- });
- }
- }
-
- return this;
- };
-
- /**
- * Alias of addListener
- */
- proto.on = alias('addListener');
-
- /**
- * Semi-alias of addListener. It will add a listener that will be
- * automatically removed after it's first execution.
- *
- * @param {String|RegExp} evt Name of the event to attach the listener to.
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addOnceListener = function addOnceListener(evt, listener) {
- return this.addListener(evt, {
- listener: listener,
- once: true
- });
- };
-
- /**
- * Alias of addOnceListener.
- */
- proto.once = alias('addOnceListener');
-
- /**
- * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
- * You need to tell it what event names should be matched by a regex.
- *
- * @param {String} evt Name of the event to create.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.defineEvent = function defineEvent(evt) {
- this.getListeners(evt);
- return this;
- };
-
- /**
- * Uses defineEvent to define multiple events.
- *
- * @param {String[]} evts An array of event names to define.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.defineEvents = function defineEvents(evts) {
- for (var i = 0; i < evts.length; i += 1) {
- this.defineEvent(evts[i]);
- }
- return this;
- };
-
- /**
- * Removes a listener function from the specified event.
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to remove the listener from.
- * @param {Function} listener Method to remove from the event.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeListener = function removeListener(evt, listener) {
- var listeners = this.getListenersAsObject(evt);
- var index;
- var key;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key)) {
- index = indexOfListener(listeners[key], listener);
-
- if (index !== -1) {
- listeners[key].splice(index, 1);
- }
- }
- }
-
- return this;
- };
-
- /**
- * Alias of removeListener
- */
- proto.off = alias('removeListener');
-
- /**
- * Adds listeners in bulk using the manipulateListeners method.
- * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
- * Yeah, this function does quite a bit. That's probably a bad thing.
- *
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to add.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addListeners = function addListeners(evt, listeners) {
- // Pass through to manipulateListeners
- return this.manipulateListeners(false, evt, listeners);
- };
-
- /**
- * Removes listeners in bulk using the manipulateListeners method.
- * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
- * You can also pass it an event name and an array of listeners to be removed.
- * You can also pass it a regular expression to remove the listeners from all events that match it.
- *
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeListeners = function removeListeners(evt, listeners) {
- // Pass through to manipulateListeners
- return this.manipulateListeners(true, evt, listeners);
- };
-
- /**
- * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
- * The first argument will determine if the listeners are removed (true) or added (false).
- * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
- * You can also pass it an event name and an array of listeners to be added/removed.
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
- *
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
- var i;
- var value;
- var single = remove ? this.removeListener : this.addListener;
- var multiple = remove ? this.removeListeners : this.addListeners;
-
- // If evt is an object then pass each of it's properties to this method
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
- for (i in evt) {
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
- // Pass the single listener straight through to the singular method
- if (typeof value === 'function') {
- single.call(this, i, value);
- }
- else {
- // Otherwise pass back to the multiple function
- multiple.call(this, i, value);
- }
- }
- }
- }
- else {
- // So evt must be a string
- // And listeners must be an array of listeners
- // Loop over it and pass each one to the multiple method
- i = listeners.length;
- while (i--) {
- single.call(this, evt, listeners[i]);
- }
- }
-
- return this;
- };
-
- /**
- * Removes all listeners from a specified event.
- * If you do not specify an event then all listeners will be removed.
- * That means every event will be emptied.
- * You can also pass a regex to remove all events that match it.
- *
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeEvent = function removeEvent(evt) {
- var type = typeof evt;
- var events = this._getEvents();
- var key;
-
- // Remove different things depending on the state of evt
- if (type === 'string') {
- // Remove all listeners for the specified event
- delete events[evt];
- }
- else if (type === 'object') {
- // Remove all events matching the regex.
- for (key in events) {
- if (events.hasOwnProperty(key) && evt.test(key)) {
- delete events[key];
- }
- }
- }
- else {
- // Remove all listeners in all events
- delete this._events;
- }
-
- return this;
- };
-
- /**
- * Alias of removeEvent.
- *
- * Added to mirror the node API.
- */
- proto.removeAllListeners = alias('removeEvent');
-
- /**
- * Emits an event of your choice.
- * When emitted, every listener attached to that event will be executed.
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
- * So they will not arrive within the array on the other side, they will be separate.
- * You can also pass a regular expression to emit to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.emitEvent = function emitEvent(evt, args) {
- var listeners = this.getListenersAsObject(evt);
- var listener;
- var i;
- var key;
- var response;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key)) {
- i = listeners[key].length;
-
- while (i--) {
- // If the listener returns true then it shall be removed from the event
- // The function is executed either with a basic call or an apply if there is an args array
- listener = listeners[key][i];
-
- if (listener.once === true) {
- this.removeListener(evt, listener.listener);
- }
-
- response = listener.listener.apply(this, args || []);
-
- if (response === this._getOnceReturnValue()) {
- this.removeListener(evt, listener.listener);
- }
- }
- }
- }
-
- return this;
- };
-
- /**
- * Alias of emitEvent
- */
- proto.trigger = alias('emitEvent');
-
- /**
- * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
- * @param {...*} Optional additional arguments to be passed to each listener.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.emit = function emit(evt) {
- var args = Array.prototype.slice.call(arguments, 1);
- return this.emitEvent(evt, args);
- };
-
- /**
- * Sets the current value to check against when executing listeners. If a
- * listeners return value matches the one set here then it will be removed
- * after execution. This value defaults to true.
- *
- * @param {*} value The new value to check for when executing listeners.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
- this._onceReturnValue = value;
- return this;
- };
-
- /**
- * Fetches the current value to check against when executing listeners. If
- * the listeners return value matches this one then it should be removed
- * automatically. It will return true by default.
- *
- * @return {*|Boolean} The current value to check for or the default, true.
- * @api private
- */
- proto._getOnceReturnValue = function _getOnceReturnValue() {
- if (this.hasOwnProperty('_onceReturnValue')) {
- return this._onceReturnValue;
- }
- else {
- return true;
- }
- };
-
- /**
- * Fetches the events object and creates one if required.
- *
- * @return {Object} The events storage object.
- * @api private
- */
- proto._getEvents = function _getEvents() {
- return this._events || (this._events = {});
- };
-
- /**
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
- *
- * @return {Function} Non conflicting EventEmitter class.
- */
- EventEmitter.noConflict = function noConflict() {
- exports.EventEmitter = originalGlobalValue;
- return EventEmitter;
- };
-
- // Expose the class either via AMD, CommonJS or the global object
- if (typeof define === 'function' && define.amd) {
- define('eventEmitter/EventEmitter',[],function () {
- return EventEmitter;
- });
- }
- else if (typeof module === 'object' && module.exports){
- module.exports = EventEmitter;
+ // set events hash
+ var events = this._events = this._events || {};
+ // set listeners array
+ var listeners = events[ eventName ] = events[ eventName ] || [];
+ // only add once
+ if ( listeners.indexOf( listener ) == -1 ) {
+ listeners.push( listener );
}
- else {
- this.EventEmitter = EventEmitter;
+
+ return this;
+ };
+
+ proto.once = function( eventName, listener ) {
+ if ( !eventName || !listener ) {
+ return;
}
-}.call(this));
-
-/*!
- * eventie v1.0.4
- * event binding helper
- * eventie.bind( elem, 'click', myFn )
- * eventie.unbind( elem, 'click', myFn )
- */
-
-/*jshint browser: true, undef: true, unused: true */
-/*global define: false */
-
-( function( window ) {
-
-
-
-var docElem = document.documentElement;
-
-var bind = function() {};
-
-function getIEEvent( obj ) {
- var event = window.event;
- // add event.target
- event.target = event.target || event.srcElement || obj;
- return event;
-}
-
-if ( docElem.addEventListener ) {
- bind = function( obj, type, fn ) {
- obj.addEventListener( type, fn, false );
+ // add event
+ this.on( eventName, listener );
+ // set once flag
+ // set onceEvents hash
+ var onceEvents = this._onceEvents = this._onceEvents || {};
+ // set onceListeners object
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
+ // set flag
+ onceListeners[ listener ] = true;
+
+ return this;
};
-} else if ( docElem.attachEvent ) {
- bind = function( obj, type, fn ) {
- obj[ type + fn ] = fn.handleEvent ?
- function() {
- var event = getIEEvent( obj );
- fn.handleEvent.call( fn, event );
- } :
- function() {
- var event = getIEEvent( obj );
- fn.call( obj, event );
- };
- obj.attachEvent( "on" + type, obj[ type + fn ] );
+
+ proto.off = function( eventName, listener ) {
+ var listeners = this._events && this._events[ eventName ];
+ if ( !listeners || !listeners.length ) {
+ return;
+ }
+ var index = listeners.indexOf( listener );
+ if ( index != -1 ) {
+ listeners.splice( index, 1 );
+ }
+
+ return this;
};
-}
-
-var unbind = function() {};
-
-if ( docElem.removeEventListener ) {
- unbind = function( obj, type, fn ) {
- obj.removeEventListener( type, fn, false );
+
+ proto.emitEvent = function( eventName, args ) {
+ var listeners = this._events && this._events[ eventName ];
+ if ( !listeners || !listeners.length ) {
+ return;
+ }
+ // copy over to avoid interference if .off() in listener
+ listeners = listeners.slice(0);
+ args = args || [];
+ // once stuff
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
+
+ for ( var i=0; i < listeners.length; i++ ) {
+ var listener = listeners[i]
+ var isOnce = onceListeners && onceListeners[ listener ];
+ if ( isOnce ) {
+ // remove listener
+ // remove before trigger to prevent recursion
+ this.off( eventName, listener );
+ // unset once flag
+ delete onceListeners[ listener ];
+ }
+ // trigger listener
+ listener.apply( this, args );
+ }
+
+ return this;
};
-} else if ( docElem.detachEvent ) {
- unbind = function( obj, type, fn ) {
- obj.detachEvent( "on" + type, obj[ type + fn ] );
- try {
- delete obj[ type + fn ];
- } catch ( err ) {
- // can't delete window object properties
- obj[ type + fn ] = undefined;
- }
+
+ proto.allOff = function() {
+ delete this._events;
+ delete this._onceEvents;
};
-}
-
-var eventie = {
- bind: bind,
- unbind: unbind
-};
-
-// transport
-if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( 'eventie/eventie',eventie );
-} else {
- // browser global
- window.eventie = eventie;
-}
-
-})( this );
-
-/*!
- * imagesLoaded v3.1.8
- * JavaScript is all like "You images are done yet or what?"
- * MIT License
- */
-
-( function( window, factory ) {
- // universal module definition
-
- /*global define: false, module: false, require: false */
-
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( [
- 'eventEmitter/EventEmitter',
- 'eventie/eventie'
- ], function( EventEmitter, eventie ) {
- return factory( window, EventEmitter, eventie );
- });
- } else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = factory(
- window,
- require('wolfy87-eventemitter'),
- require('eventie')
- );
- } else {
- // browser global
- window.imagesLoaded = factory(
- window,
- window.EventEmitter,
- window.eventie
- );
- }
-
-})( window,
-
-// -------------------------- factory -------------------------- //
-
-function factory( window, EventEmitter, eventie ) {
-
-
-
-var $ = window.jQuery;
-var console = window.console;
-var hasConsole = typeof console !== 'undefined';
-
-// -------------------------- helpers -------------------------- //
-
-// extend objects
-function extend( a, b ) {
- for ( var prop in b ) {
- a[ prop ] = b[ prop ];
+
+ return EvEmitter;
+
+ }));
+
+ /*!
+ * imagesLoaded v4.1.4
+ * JavaScript is all like "You images are done yet or what?"
+ * MIT License
+ */
+
+ ( function( window, factory ) { 'use strict';
+ // universal module definition
+
+ /*global define: false, module: false, require: false */
+
+ if ( typeof define == 'function' && define.amd ) {
+ // AMD
+ define( [
+ 'ev-emitter/ev-emitter'
+ ], function( EvEmitter ) {
+ return factory( window, EvEmitter );
+ });
+ } else if ( typeof module == 'object' && module.exports ) {
+ // CommonJS
+ module.exports = factory(
+ window,
+ require('ev-emitter')
+ );
+ } else {
+ // browser global
+ window.imagesLoaded = factory(
+ window,
+ window.EvEmitter
+ );
+ }
+
+ })( typeof window !== 'undefined' ? window : this,
+
+ // -------------------------- factory -------------------------- //
+
+ function factory( window, EvEmitter ) {
+
+
+
+ var $ = window.jQuery;
+ var console = window.console;
+
+ // -------------------------- helpers -------------------------- //
+
+ // extend objects
+ function extend( a, b ) {
+ for ( var prop in b ) {
+ a[ prop ] = b[ prop ];
+ }
+ return a;
}
- return a;
-}
-
-var objToString = Object.prototype.toString;
-function isArray( obj ) {
- return objToString.call( obj ) === '[object Array]';
-}
-
-// turn element or nodeList into an array
-function makeArray( obj ) {
- var ary = [];
- if ( isArray( obj ) ) {
- // use object if already an array
- ary = obj;
- } else if ( typeof obj.length === 'number' ) {
- // convert nodeList to array
- for ( var i=0, len = obj.length; i < len; i++ ) {
- ary.push( obj[i] );
- }
- } else {
- // array of single index
- ary.push( obj );
+
+ var arraySlice = Array.prototype.slice;
+
+ // turn element or nodeList into an array
+ function makeArray( obj ) {
+ if ( Array.isArray( obj ) ) {
+ // use object if already an array
+ return obj;
+ }
+
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
+ if ( isArrayLike ) {
+ // convert nodeList to array
+ return arraySlice.call( obj );
+ }
+
+ // array of single index
+ return [ obj ];
}
- return ary;
-}
-
+
// -------------------------- imagesLoaded -------------------------- //
-
+
/**
* @param {Array, Element, NodeList, String} elem
* @param {Object or Function} options - if function, use as callback
* @param {Function} onAlways - callback function
*/
function ImagesLoaded( elem, options, onAlways ) {
- // coerce ImagesLoaded() without new, to be new ImagesLoaded()
- if ( !( this instanceof ImagesLoaded ) ) {
- return new ImagesLoaded( elem, options );
- }
- // use elem as selector string
- if ( typeof elem === 'string' ) {
- elem = document.querySelectorAll( elem );
- }
-
- this.elements = makeArray( elem );
- this.options = extend( {}, this.options );
-
- if ( typeof options === 'function' ) {
- onAlways = options;
- } else {
- extend( this.options, options );
- }
-
- if ( onAlways ) {
- this.on( 'always', onAlways );
- }
-
- this.getImages();
-
- if ( $ ) {
- // add jQuery Deferred object
- this.jqDeferred = new $.Deferred();
- }
-
- // HACK check async to allow time to bind listeners
- var _this = this;
- setTimeout( function() {
- _this.check();
- });
+ // coerce ImagesLoaded() without new, to be new ImagesLoaded()
+ if ( !( this instanceof ImagesLoaded ) ) {
+ return new ImagesLoaded( elem, options, onAlways );
+ }
+ // use elem as selector string
+ var queryElem = elem;
+ if ( typeof elem == 'string' ) {
+ queryElem = document.querySelectorAll( elem );
+ }
+ // bail if bad element
+ if ( !queryElem ) {
+ console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );
+ return;
+ }
+
+ this.elements = makeArray( queryElem );
+ this.options = extend( {}, this.options );
+ // shift arguments if no options set
+ if ( typeof options == 'function' ) {
+ onAlways = options;
+ } else {
+ extend( this.options, options );
+ }
+
+ if ( onAlways ) {
+ this.on( 'always', onAlways );
+ }
+
+ this.getImages();
+
+ if ( $ ) {
+ // add jQuery Deferred object
+ this.jqDeferred = new $.Deferred();
+ }
+
+ // HACK check async to allow time to bind listeners
+ setTimeout( this.check.bind( this ) );
}
-
- ImagesLoaded.prototype = new EventEmitter();
-
+
+ ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
+
ImagesLoaded.prototype.options = {};
-
+
ImagesLoaded.prototype.getImages = function() {
- this.images = [];
-
- // filter & find items if we have an item selector
- for ( var i=0, len = this.elements.length; i < len; i++ ) {
- var elem = this.elements[i];
- // filter siblings
- if ( elem.nodeName === 'IMG' ) {
- this.addImage( elem );
- }
- // find children
- // no non-element nodes, #143
- var nodeType = elem.nodeType;
- if ( !nodeType || !( nodeType === 1 || nodeType === 9 || nodeType === 11 ) ) {
- continue;
- }
- var childElems = elem.querySelectorAll('img');
- // concat childElems to filterFound array
- for ( var j=0, jLen = childElems.length; j < jLen; j++ ) {
- var img = childElems[j];
- this.addImage( img );
- }
- }
+ this.images = [];
+
+ // filter & find items if we have an item selector
+ this.elements.forEach( this.addElementImages, this );
};
-
+
+ /**
+ * @param {Node} element
+ */
+ ImagesLoaded.prototype.addElementImages = function( elem ) {
+ // filter siblings
+ if ( elem.nodeName == 'IMG' ) {
+ this.addImage( elem );
+ }
+ // get background image on element
+ if ( this.options.background === true ) {
+ this.addElementBackgroundImages( elem );
+ }
+
+ // find children
+ // no non-element nodes, #143
+ var nodeType = elem.nodeType;
+ if ( !nodeType || !elementNodeTypes[ nodeType ] ) {
+ return;
+ }
+ var childImgs = elem.querySelectorAll('img');
+ // concat childElems to filterFound array
+ for ( var i=0; i < childImgs.length; i++ ) {
+ var img = childImgs[i];
+ this.addImage( img );
+ }
+
+ // get child background images
+ if ( typeof this.options.background == 'string' ) {
+ var children = elem.querySelectorAll( this.options.background );
+ for ( i=0; i < children.length; i++ ) {
+ var child = children[i];
+ this.addElementBackgroundImages( child );
+ }
+ }
+ };
+
+ var elementNodeTypes = {
+ 1: true,
+ 9: true,
+ 11: true
+ };
+
+ ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
+ var style = getComputedStyle( elem );
+ if ( !style ) {
+ // Firefox returns null if in a hidden iframe https://bugzil.la/548397
+ return;
+ }
+ // get url inside url("...")
+ var reURL = /url\((['"])?(.*?)\1\)/gi;
+ var matches = reURL.exec( style.backgroundImage );
+ while ( matches !== null ) {
+ var url = matches && matches[2];
+ if ( url ) {
+ this.addBackground( url, elem );
+ }
+ matches = reURL.exec( style.backgroundImage );
+ }
+ };
+
/**
* @param {Image} img
*/
ImagesLoaded.prototype.addImage = function( img ) {
- var loadingImage = new LoadingImage( img );
- this.images.push( loadingImage );
+ var loadingImage = new LoadingImage( img );
+ this.images.push( loadingImage );
};
-
+
+ ImagesLoaded.prototype.addBackground = function( url, elem ) {
+ var background = new Background( url, elem );
+ this.images.push( background );
+ };
+
ImagesLoaded.prototype.check = function() {
- var _this = this;
- var checkedCount = 0;
- var length = this.images.length;
- this.hasAnyBroken = false;
- // complete if no images
- if ( !length ) {
- this.complete();
- return;
- }
-
- function onConfirm( image, message ) {
- if ( _this.options.debug && hasConsole ) {
- console.log( 'confirm', image, message );
- }
-
- _this.progress( image );
- checkedCount++;
- if ( checkedCount === length ) {
- _this.complete();
- }
- return true; // bind once
- }
-
- for ( var i=0; i < length; i++ ) {
- var loadingImage = this.images[i];
- loadingImage.on( 'confirm', onConfirm );
- loadingImage.check();
- }
+ var _this = this;
+ this.progressedCount = 0;
+ this.hasAnyBroken = false;
+ // complete if no images
+ if ( !this.images.length ) {
+ this.complete();
+ return;
+ }
+
+ function onProgress( image, elem, message ) {
+ // HACK - Chrome triggers event before object properties have changed. #83
+ setTimeout( function() {
+ _this.progress( image, elem, message );
+ });
+ }
+
+ this.images.forEach( function( loadingImage ) {
+ loadingImage.once( 'progress', onProgress );
+ loadingImage.check();
+ });
};
-
- ImagesLoaded.prototype.progress = function( image ) {
- this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
- // HACK - Chrome triggers event before object properties have changed. #83
- var _this = this;
- setTimeout( function() {
- _this.emit( 'progress', _this, image );
- if ( _this.jqDeferred && _this.jqDeferred.notify ) {
- _this.jqDeferred.notify( _this, image );
- }
- });
+
+ ImagesLoaded.prototype.progress = function( image, elem, message ) {
+ this.progressedCount++;
+ this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
+ // progress event
+ this.emitEvent( 'progress', [ this, image, elem ] );
+ if ( this.jqDeferred && this.jqDeferred.notify ) {
+ this.jqDeferred.notify( this, image );
+ }
+ // check if completed
+ if ( this.progressedCount == this.images.length ) {
+ this.complete();
+ }
+
+ if ( this.options.debug && console ) {
+ console.log( 'progress: ' + message, image, elem );
+ }
};
-
+
ImagesLoaded.prototype.complete = function() {
- var eventName = this.hasAnyBroken ? 'fail' : 'done';
- this.isComplete = true;
- var _this = this;
- // HACK - another setTimeout so that confirm happens after progress
- setTimeout( function() {
- _this.emit( eventName, _this );
- _this.emit( 'always', _this );
- if ( _this.jqDeferred ) {
- var jqMethod = _this.hasAnyBroken ? 'reject' : 'resolve';
- _this.jqDeferred[ jqMethod ]( _this );
- }
- });
+ var eventName = this.hasAnyBroken ? 'fail' : 'done';
+ this.isComplete = true;
+ this.emitEvent( eventName, [ this ] );
+ this.emitEvent( 'always', [ this ] );
+ if ( this.jqDeferred ) {
+ var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
+ this.jqDeferred[ jqMethod ]( this );
+ }
};
-
- // -------------------------- jquery -------------------------- //
-
- if ( $ ) {
- $.fn.imagesLoaded = function( options, callback ) {
- var instance = new ImagesLoaded( this, options, callback );
- return instance.jqDeferred.promise( $(this) );
- };
- }
-
-
+
// -------------------------- -------------------------- //
-
+
function LoadingImage( img ) {
- this.img = img;
+ this.img = img;
}
-
- LoadingImage.prototype = new EventEmitter();
-
+
+ LoadingImage.prototype = Object.create( EvEmitter.prototype );
+
LoadingImage.prototype.check = function() {
- // first check cached any previous images that have same src
- var resource = cache[ this.img.src ] || new Resource( this.img.src );
- if ( resource.isConfirmed ) {
- this.confirm( resource.isLoaded, 'cached was confirmed' );
- return;
- }
-
- // If complete is true and browser supports natural sizes,
- // try to check for image status manually.
- if ( this.img.complete && this.img.naturalWidth !== undefined ) {
- // report based on naturalWidth
- this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
- return;
- }
-
- // If none of the checks above matched, simulate loading on detached element.
- var _this = this;
- resource.on( 'confirm', function( resrc, message ) {
- _this.confirm( resrc.isLoaded, message );
- return true;
- });
-
- resource.check();
+ // If complete is true and browser supports natural sizes,
+ // try to check for image status manually.
+ var isComplete = this.getIsImageComplete();
+ if ( isComplete ) {
+ // report based on naturalWidth
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
+ return;
+ }
+
+ // If none of the checks above matched, simulate loading on detached element.
+ this.proxyImage = new Image();
+ this.proxyImage.addEventListener( 'load', this );
+ this.proxyImage.addEventListener( 'error', this );
+ // bind to image as well for Firefox. #191
+ this.img.addEventListener( 'load', this );
+ this.img.addEventListener( 'error', this );
+ this.proxyImage.src = this.img.src;
};
-
- LoadingImage.prototype.confirm = function( isLoaded, message ) {
- this.isLoaded = isLoaded;
- this.emit( 'confirm', this, message );
+
+ LoadingImage.prototype.getIsImageComplete = function() {
+ // check for non-zero, non-undefined naturalWidth
+ // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
+ return this.img.complete && this.img.naturalWidth;
};
-
- // -------------------------- Resource -------------------------- //
-
- // Resource checks each src, only once
- // separate class from LoadingImage to prevent memory leaks. See #115
-
- var cache = {};
-
- function Resource( src ) {
- this.src = src;
- // add to cache
- cache[ src ] = this;
- }
-
- Resource.prototype = new EventEmitter();
-
- Resource.prototype.check = function() {
- // only trigger checking once
- if ( this.isChecked ) {
- return;
- }
- // simulate loading on detached element
- var proxyImage = new Image();
- eventie.bind( proxyImage, 'load', this );
- eventie.bind( proxyImage, 'error', this );
- proxyImage.src = this.src;
- // set flag
- this.isChecked = true;
+
+ LoadingImage.prototype.confirm = function( isLoaded, message ) {
+ this.isLoaded = isLoaded;
+ this.emitEvent( 'progress', [ this, this.img, message ] );
};
-
+
// ----- events ----- //
-
+
// trigger specified handler for event type
- Resource.prototype.handleEvent = function( event ) {
- var method = 'on' + event.type;
- if ( this[ method ] ) {
- this[ method ]( event );
- }
+ LoadingImage.prototype.handleEvent = function( event ) {
+ var method = 'on' + event.type;
+ if ( this[ method ] ) {
+ this[ method ]( event );
+ }
};
-
- Resource.prototype.onload = function( event ) {
- this.confirm( true, 'onload' );
- this.unbindProxyEvents( event );
+
+ LoadingImage.prototype.onload = function() {
+ this.confirm( true, 'onload' );
+ this.unbindEvents();
};
-
- Resource.prototype.onerror = function( event ) {
- this.confirm( false, 'onerror' );
- this.unbindProxyEvents( event );
+
+ LoadingImage.prototype.onerror = function() {
+ this.confirm( false, 'onerror' );
+ this.unbindEvents();
};
-
- // ----- confirm ----- //
-
- Resource.prototype.confirm = function( isLoaded, message ) {
- this.isConfirmed = true;
- this.isLoaded = isLoaded;
- this.emit( 'confirm', this, message );
+
+ LoadingImage.prototype.unbindEvents = function() {
+ this.proxyImage.removeEventListener( 'load', this );
+ this.proxyImage.removeEventListener( 'error', this );
+ this.img.removeEventListener( 'load', this );
+ this.img.removeEventListener( 'error', this );
};
-
- Resource.prototype.unbindProxyEvents = function( event ) {
- eventie.unbind( event.target, 'load', this );
- eventie.unbind( event.target, 'error', this );
+
+ // -------------------------- Background -------------------------- //
+
+ function Background( url, element ) {
+ this.url = url;
+ this.element = element;
+ this.img = new Image();
+ }
+
+ // inherit LoadingImage prototype
+ Background.prototype = Object.create( LoadingImage.prototype );
+
+ Background.prototype.check = function() {
+ this.img.addEventListener( 'load', this );
+ this.img.addEventListener( 'error', this );
+ this.img.src = this.url;
+ // check if image is already complete
+ var isComplete = this.getIsImageComplete();
+ if ( isComplete ) {
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
+ this.unbindEvents();
+ }
};
-
- // ----- ----- //
-
+
+ Background.prototype.unbindEvents = function() {
+ this.img.removeEventListener( 'load', this );
+ this.img.removeEventListener( 'error', this );
+ };
+
+ Background.prototype.confirm = function( isLoaded, message ) {
+ this.isLoaded = isLoaded;
+ this.emitEvent( 'progress', [ this, this.element, message ] );
+ };
+
+ // -------------------------- jQuery -------------------------- //
+
+ ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
+ jQuery = jQuery || window.jQuery;
+ if ( !jQuery ) {
+ return;
+ }
+ // set local variable
+ $ = jQuery;
+ // $().imagesLoaded()
+ $.fn.imagesLoaded = function( options, callback ) {
+ var instance = new ImagesLoaded( this, options, callback );
+ return instance.jqDeferred.promise( $(this) );
+ };
+ };
+ // try making plugin
+ ImagesLoaded.makeJQueryPlugin();
+
+ // -------------------------- -------------------------- //
+
return ImagesLoaded;
-
-});
+
+ });
+
\ No newline at end of file
diff --git a/js/site.dev.js b/js/site.dev.js
index a5986e78..17172536 100644
--- a/js/site.dev.js
+++ b/js/site.dev.js
@@ -2,8 +2,8 @@
// uw.edu/marketing/web/
// A UW JavaScript library that implements various web components to any site
// Includes hard dependencies jQuery (v2.1.1), Backbone (1.1.2), and Underscore (1.6.0)
-
-;(function () {
+(function($){
+
;/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
@@ -8501,899 +8501,502 @@ vjs.plugin = function(name, init){
vjs.Player.prototype[name] = init;
};
;/*!
- * imagesLoaded PACKAGED v3.1.8
+ * imagesLoaded PACKAGED v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
+/**
+ * EvEmitter v1.1.0
+ * Lil' event emitter
+ * MIT License
+ */
-/*!
- * EventEmitter v4.2.6 - git.io/ee
- * Oliver Caldwell
- * MIT license
- * @preserve
- */
-
-(function () {
-
-
- /**
- * Class for managing events.
- * Can be extended to provide event functionality in other classes.
- *
- * @class EventEmitter Manages event registering and emitting.
- */
- function EventEmitter() {}
-
- // Shortcuts to improve speed and size
- var proto = EventEmitter.prototype;
- var exports = this;
- var originalGlobalValue = exports.EventEmitter;
-
- /**
- * Finds the index of the listener for the event in it's storage array.
- *
- * @param {Function[]} listeners Array of listeners to search through.
- * @param {Function} listener Method to look for.
- * @return {Number} Index of the specified listener, -1 if not found
- * @api private
- */
- function indexOfListener(listeners, listener) {
- var i = listeners.length;
- while (i--) {
- if (listeners[i].listener === listener) {
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
- *
- * @param {String} name The name of the target method.
- * @return {Function} The aliased method
- * @api private
- */
- function alias(name) {
- return function aliasClosure() {
- return this[name].apply(this, arguments);
- };
+/* jshint unused: true, undef: true, strict: true */
+
+( function( global, factory ) {
+ // universal module definition
+ /* jshint strict: false */ /* globals define, module, window */
+ if ( typeof define == 'function' && define.amd ) {
+ // AMD - RequireJS
+ define( 'ev-emitter/ev-emitter',factory );
+ } else if ( typeof module == 'object' && module.exports ) {
+ // CommonJS - Browserify, Webpack
+ module.exports = factory();
+ } else {
+ // Browser globals
+ global.EvEmitter = factory();
}
-
- /**
- * Returns the listener array for the specified event.
- * Will initialise the event object and listener arrays if required.
- * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
- * Each property in the object response is an array of listener functions.
- *
- * @param {String|RegExp} evt Name of the event to return the listeners from.
- * @return {Function[]|Object} All listener functions for the event.
- */
- proto.getListeners = function getListeners(evt) {
- var events = this._getEvents();
- var response;
- var key;
-
- // Return a concatenated array of all matching events if
- // the selector is a regular expression.
- if (typeof evt === 'object') {
- response = {};
- for (key in events) {
- if (events.hasOwnProperty(key) && evt.test(key)) {
- response[key] = events[key];
- }
- }
- }
- else {
- response = events[evt] || (events[evt] = []);
- }
-
- return response;
- };
-
- /**
- * Takes a list of listener objects and flattens it into a list of listener functions.
- *
- * @param {Object[]} listeners Raw listener objects.
- * @return {Function[]} Just the listener functions.
- */
- proto.flattenListeners = function flattenListeners(listeners) {
- var flatListeners = [];
- var i;
-
- for (i = 0; i < listeners.length; i += 1) {
- flatListeners.push(listeners[i].listener);
- }
-
- return flatListeners;
- };
-
- /**
- * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
- *
- * @param {String|RegExp} evt Name of the event to return the listeners from.
- * @return {Object} All listener functions for an event in an object.
- */
- proto.getListenersAsObject = function getListenersAsObject(evt) {
- var listeners = this.getListeners(evt);
- var response;
-
- if (listeners instanceof Array) {
- response = {};
- response[evt] = listeners;
- }
-
- return response || listeners;
- };
-
- /**
- * Adds a listener function to the specified event.
- * The listener will not be added if it is a duplicate.
- * If the listener returns true then it will be removed after it is called.
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to attach the listener to.
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addListener = function addListener(evt, listener) {
- var listeners = this.getListenersAsObject(evt);
- var listenerIsWrapped = typeof listener === 'object';
- var key;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
- listeners[key].push(listenerIsWrapped ? listener : {
- listener: listener,
- once: false
- });
- }
- }
-
- return this;
- };
-
- /**
- * Alias of addListener
- */
- proto.on = alias('addListener');
-
- /**
- * Semi-alias of addListener. It will add a listener that will be
- * automatically removed after it's first execution.
- *
- * @param {String|RegExp} evt Name of the event to attach the listener to.
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addOnceListener = function addOnceListener(evt, listener) {
- return this.addListener(evt, {
- listener: listener,
- once: true
- });
- };
-
- /**
- * Alias of addOnceListener.
- */
- proto.once = alias('addOnceListener');
-
- /**
- * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
- * You need to tell it what event names should be matched by a regex.
- *
- * @param {String} evt Name of the event to create.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.defineEvent = function defineEvent(evt) {
- this.getListeners(evt);
- return this;
- };
-
- /**
- * Uses defineEvent to define multiple events.
- *
- * @param {String[]} evts An array of event names to define.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.defineEvents = function defineEvents(evts) {
- for (var i = 0; i < evts.length; i += 1) {
- this.defineEvent(evts[i]);
- }
- return this;
- };
-
- /**
- * Removes a listener function from the specified event.
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to remove the listener from.
- * @param {Function} listener Method to remove from the event.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeListener = function removeListener(evt, listener) {
- var listeners = this.getListenersAsObject(evt);
- var index;
- var key;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key)) {
- index = indexOfListener(listeners[key], listener);
-
- if (index !== -1) {
- listeners[key].splice(index, 1);
- }
- }
- }
-
- return this;
- };
-
- /**
- * Alias of removeListener
- */
- proto.off = alias('removeListener');
-
- /**
- * Adds listeners in bulk using the manipulateListeners method.
- * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
- * Yeah, this function does quite a bit. That's probably a bad thing.
- *
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to add.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.addListeners = function addListeners(evt, listeners) {
- // Pass through to manipulateListeners
- return this.manipulateListeners(false, evt, listeners);
- };
-
- /**
- * Removes listeners in bulk using the manipulateListeners method.
- * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
- * You can also pass it an event name and an array of listeners to be removed.
- * You can also pass it a regular expression to remove the listeners from all events that match it.
- *
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeListeners = function removeListeners(evt, listeners) {
- // Pass through to manipulateListeners
- return this.manipulateListeners(true, evt, listeners);
- };
-
- /**
- * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
- * The first argument will determine if the listeners are removed (true) or added (false).
- * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
- * You can also pass it an event name and an array of listeners to be added/removed.
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
- *
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
- var i;
- var value;
- var single = remove ? this.removeListener : this.addListener;
- var multiple = remove ? this.removeListeners : this.addListeners;
-
- // If evt is an object then pass each of it's properties to this method
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
- for (i in evt) {
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
- // Pass the single listener straight through to the singular method
- if (typeof value === 'function') {
- single.call(this, i, value);
- }
- else {
- // Otherwise pass back to the multiple function
- multiple.call(this, i, value);
- }
- }
- }
- }
- else {
- // So evt must be a string
- // And listeners must be an array of listeners
- // Loop over it and pass each one to the multiple method
- i = listeners.length;
- while (i--) {
- single.call(this, evt, listeners[i]);
- }
- }
-
- return this;
- };
-
- /**
- * Removes all listeners from a specified event.
- * If you do not specify an event then all listeners will be removed.
- * That means every event will be emptied.
- * You can also pass a regex to remove all events that match it.
- *
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.removeEvent = function removeEvent(evt) {
- var type = typeof evt;
- var events = this._getEvents();
- var key;
-
- // Remove different things depending on the state of evt
- if (type === 'string') {
- // Remove all listeners for the specified event
- delete events[evt];
- }
- else if (type === 'object') {
- // Remove all events matching the regex.
- for (key in events) {
- if (events.hasOwnProperty(key) && evt.test(key)) {
- delete events[key];
- }
- }
- }
- else {
- // Remove all listeners in all events
- delete this._events;
- }
-
- return this;
- };
-
- /**
- * Alias of removeEvent.
- *
- * Added to mirror the node API.
- */
- proto.removeAllListeners = alias('removeEvent');
-
- /**
- * Emits an event of your choice.
- * When emitted, every listener attached to that event will be executed.
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
- * So they will not arrive within the array on the other side, they will be separate.
- * You can also pass a regular expression to emit to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.emitEvent = function emitEvent(evt, args) {
- var listeners = this.getListenersAsObject(evt);
- var listener;
- var i;
- var key;
- var response;
-
- for (key in listeners) {
- if (listeners.hasOwnProperty(key)) {
- i = listeners[key].length;
-
- while (i--) {
- // If the listener returns true then it shall be removed from the event
- // The function is executed either with a basic call or an apply if there is an args array
- listener = listeners[key][i];
-
- if (listener.once === true) {
- this.removeListener(evt, listener.listener);
- }
-
- response = listener.listener.apply(this, args || []);
-
- if (response === this._getOnceReturnValue()) {
- this.removeListener(evt, listener.listener);
- }
- }
- }
- }
-
- return this;
- };
-
- /**
- * Alias of emitEvent
- */
- proto.trigger = alias('emitEvent');
-
- /**
- * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
- *
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
- * @param {...*} Optional additional arguments to be passed to each listener.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.emit = function emit(evt) {
- var args = Array.prototype.slice.call(arguments, 1);
- return this.emitEvent(evt, args);
- };
-
- /**
- * Sets the current value to check against when executing listeners. If a
- * listeners return value matches the one set here then it will be removed
- * after execution. This value defaults to true.
- *
- * @param {*} value The new value to check for when executing listeners.
- * @return {Object} Current instance of EventEmitter for chaining.
- */
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
- this._onceReturnValue = value;
- return this;
- };
-
- /**
- * Fetches the current value to check against when executing listeners. If
- * the listeners return value matches this one then it should be removed
- * automatically. It will return true by default.
- *
- * @return {*|Boolean} The current value to check for or the default, true.
- * @api private
- */
- proto._getOnceReturnValue = function _getOnceReturnValue() {
- if (this.hasOwnProperty('_onceReturnValue')) {
- return this._onceReturnValue;
- }
- else {
- return true;
- }
- };
-
- /**
- * Fetches the events object and creates one if required.
- *
- * @return {Object} The events storage object.
- * @api private
- */
- proto._getEvents = function _getEvents() {
- return this._events || (this._events = {});
- };
-
- /**
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
- *
- * @return {Function} Non conflicting EventEmitter class.
- */
- EventEmitter.noConflict = function noConflict() {
- exports.EventEmitter = originalGlobalValue;
- return EventEmitter;
- };
-
- // Expose the class either via AMD, CommonJS or the global object
- if (typeof define === 'function' && define.amd) {
- define('eventEmitter/EventEmitter',[],function () {
- return EventEmitter;
- });
+
+ }( typeof window != 'undefined' ? window : this, function() {
+
+
+
+ function EvEmitter() {}
+
+ var proto = EvEmitter.prototype;
+
+ proto.on = function( eventName, listener ) {
+ if ( !eventName || !listener ) {
+ return;
}
- else if (typeof module === 'object' && module.exports){
- module.exports = EventEmitter;
+ // set events hash
+ var events = this._events = this._events || {};
+ // set listeners array
+ var listeners = events[ eventName ] = events[ eventName ] || [];
+ // only add once
+ if ( listeners.indexOf( listener ) == -1 ) {
+ listeners.push( listener );
}
- else {
- this.EventEmitter = EventEmitter;
+
+ return this;
+ };
+
+ proto.once = function( eventName, listener ) {
+ if ( !eventName || !listener ) {
+ return;
}
-}.call(this));
-
-/*!
- * eventie v1.0.4
- * event binding helper
- * eventie.bind( elem, 'click', myFn )
- * eventie.unbind( elem, 'click', myFn )
- */
-
-/*jshint browser: true, undef: true, unused: true */
-/*global define: false */
-
-( function( window ) {
-
-
-
-var docElem = document.documentElement;
-
-var bind = function() {};
-
-function getIEEvent( obj ) {
- var event = window.event;
- // add event.target
- event.target = event.target || event.srcElement || obj;
- return event;
-}
-
-if ( docElem.addEventListener ) {
- bind = function( obj, type, fn ) {
- obj.addEventListener( type, fn, false );
+ // add event
+ this.on( eventName, listener );
+ // set once flag
+ // set onceEvents hash
+ var onceEvents = this._onceEvents = this._onceEvents || {};
+ // set onceListeners object
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
+ // set flag
+ onceListeners[ listener ] = true;
+
+ return this;
};
-} else if ( docElem.attachEvent ) {
- bind = function( obj, type, fn ) {
- obj[ type + fn ] = fn.handleEvent ?
- function() {
- var event = getIEEvent( obj );
- fn.handleEvent.call( fn, event );
- } :
- function() {
- var event = getIEEvent( obj );
- fn.call( obj, event );
- };
- obj.attachEvent( "on" + type, obj[ type + fn ] );
+
+ proto.off = function( eventName, listener ) {
+ var listeners = this._events && this._events[ eventName ];
+ if ( !listeners || !listeners.length ) {
+ return;
+ }
+ var index = listeners.indexOf( listener );
+ if ( index != -1 ) {
+ listeners.splice( index, 1 );
+ }
+
+ return this;
};
-}
-
-var unbind = function() {};
-
-if ( docElem.removeEventListener ) {
- unbind = function( obj, type, fn ) {
- obj.removeEventListener( type, fn, false );
+
+ proto.emitEvent = function( eventName, args ) {
+ var listeners = this._events && this._events[ eventName ];
+ if ( !listeners || !listeners.length ) {
+ return;
+ }
+ // copy over to avoid interference if .off() in listener
+ listeners = listeners.slice(0);
+ args = args || [];
+ // once stuff
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
+
+ for ( var i=0; i < listeners.length; i++ ) {
+ var listener = listeners[i]
+ var isOnce = onceListeners && onceListeners[ listener ];
+ if ( isOnce ) {
+ // remove listener
+ // remove before trigger to prevent recursion
+ this.off( eventName, listener );
+ // unset once flag
+ delete onceListeners[ listener ];
+ }
+ // trigger listener
+ listener.apply( this, args );
+ }
+
+ return this;
};
-} else if ( docElem.detachEvent ) {
- unbind = function( obj, type, fn ) {
- obj.detachEvent( "on" + type, obj[ type + fn ] );
- try {
- delete obj[ type + fn ];
- } catch ( err ) {
- // can't delete window object properties
- obj[ type + fn ] = undefined;
- }
+
+ proto.allOff = function() {
+ delete this._events;
+ delete this._onceEvents;
};
-}
-
-var eventie = {
- bind: bind,
- unbind: unbind
-};
-
-// transport
-if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( 'eventie/eventie',eventie );
-} else {
- // browser global
- window.eventie = eventie;
-}
-
-})( this );
-
-/*!
- * imagesLoaded v3.1.8
- * JavaScript is all like "You images are done yet or what?"
- * MIT License
- */
-
-( function( window, factory ) {
- // universal module definition
-
- /*global define: false, module: false, require: false */
-
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( [
- 'eventEmitter/EventEmitter',
- 'eventie/eventie'
- ], function( EventEmitter, eventie ) {
- return factory( window, EventEmitter, eventie );
- });
- } else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = factory(
- window,
- require('wolfy87-eventemitter'),
- require('eventie')
- );
- } else {
- // browser global
- window.imagesLoaded = factory(
- window,
- window.EventEmitter,
- window.eventie
- );
- }
-
-})( window,
-
-// -------------------------- factory -------------------------- //
-
-function factory( window, EventEmitter, eventie ) {
-
-
-
-var $ = window.jQuery;
-var console = window.console;
-var hasConsole = typeof console !== 'undefined';
-
-// -------------------------- helpers -------------------------- //
-
-// extend objects
-function extend( a, b ) {
- for ( var prop in b ) {
- a[ prop ] = b[ prop ];
+
+ return EvEmitter;
+
+ }));
+
+ /*!
+ * imagesLoaded v4.1.4
+ * JavaScript is all like "You images are done yet or what?"
+ * MIT License
+ */
+
+ ( function( window, factory ) { 'use strict';
+ // universal module definition
+
+ /*global define: false, module: false, require: false */
+
+ if ( typeof define == 'function' && define.amd ) {
+ // AMD
+ define( [
+ 'ev-emitter/ev-emitter'
+ ], function( EvEmitter ) {
+ return factory( window, EvEmitter );
+ });
+ } else if ( typeof module == 'object' && module.exports ) {
+ // CommonJS
+ module.exports = factory(
+ window,
+ require('ev-emitter')
+ );
+ } else {
+ // browser global
+ window.imagesLoaded = factory(
+ window,
+ window.EvEmitter
+ );
+ }
+
+ })( typeof window !== 'undefined' ? window : this,
+
+ // -------------------------- factory -------------------------- //
+
+ function factory( window, EvEmitter ) {
+
+
+
+ var $ = window.jQuery;
+ var console = window.console;
+
+ // -------------------------- helpers -------------------------- //
+
+ // extend objects
+ function extend( a, b ) {
+ for ( var prop in b ) {
+ a[ prop ] = b[ prop ];
+ }
+ return a;
}
- return a;
-}
-
-var objToString = Object.prototype.toString;
-function isArray( obj ) {
- return objToString.call( obj ) === '[object Array]';
-}
-
-// turn element or nodeList into an array
-function makeArray( obj ) {
- var ary = [];
- if ( isArray( obj ) ) {
- // use object if already an array
- ary = obj;
- } else if ( typeof obj.length === 'number' ) {
- // convert nodeList to array
- for ( var i=0, len = obj.length; i < len; i++ ) {
- ary.push( obj[i] );
- }
- } else {
- // array of single index
- ary.push( obj );
+
+ var arraySlice = Array.prototype.slice;
+
+ // turn element or nodeList into an array
+ function makeArray( obj ) {
+ if ( Array.isArray( obj ) ) {
+ // use object if already an array
+ return obj;
+ }
+
+ var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
+ if ( isArrayLike ) {
+ // convert nodeList to array
+ return arraySlice.call( obj );
+ }
+
+ // array of single index
+ return [ obj ];
}
- return ary;
-}
-
+
// -------------------------- imagesLoaded -------------------------- //
-
+
/**
* @param {Array, Element, NodeList, String} elem
* @param {Object or Function} options - if function, use as callback
* @param {Function} onAlways - callback function
*/
function ImagesLoaded( elem, options, onAlways ) {
- // coerce ImagesLoaded() without new, to be new ImagesLoaded()
- if ( !( this instanceof ImagesLoaded ) ) {
- return new ImagesLoaded( elem, options );
- }
- // use elem as selector string
- if ( typeof elem === 'string' ) {
- elem = document.querySelectorAll( elem );
- }
-
- this.elements = makeArray( elem );
- this.options = extend( {}, this.options );
-
- if ( typeof options === 'function' ) {
- onAlways = options;
- } else {
- extend( this.options, options );
- }
-
- if ( onAlways ) {
- this.on( 'always', onAlways );
- }
-
- this.getImages();
-
- if ( $ ) {
- // add jQuery Deferred object
- this.jqDeferred = new $.Deferred();
- }
-
- // HACK check async to allow time to bind listeners
- var _this = this;
- setTimeout( function() {
- _this.check();
- });
+ // coerce ImagesLoaded() without new, to be new ImagesLoaded()
+ if ( !( this instanceof ImagesLoaded ) ) {
+ return new ImagesLoaded( elem, options, onAlways );
+ }
+ // use elem as selector string
+ var queryElem = elem;
+ if ( typeof elem == 'string' ) {
+ queryElem = document.querySelectorAll( elem );
+ }
+ // bail if bad element
+ if ( !queryElem ) {
+ console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) );
+ return;
+ }
+
+ this.elements = makeArray( queryElem );
+ this.options = extend( {}, this.options );
+ // shift arguments if no options set
+ if ( typeof options == 'function' ) {
+ onAlways = options;
+ } else {
+ extend( this.options, options );
+ }
+
+ if ( onAlways ) {
+ this.on( 'always', onAlways );
+ }
+
+ this.getImages();
+
+ if ( $ ) {
+ // add jQuery Deferred object
+ this.jqDeferred = new $.Deferred();
+ }
+
+ // HACK check async to allow time to bind listeners
+ setTimeout( this.check.bind( this ) );
}
-
- ImagesLoaded.prototype = new EventEmitter();
-
+
+ ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
+
ImagesLoaded.prototype.options = {};
-
+
ImagesLoaded.prototype.getImages = function() {
- this.images = [];
-
- // filter & find items if we have an item selector
- for ( var i=0, len = this.elements.length; i < len; i++ ) {
- var elem = this.elements[i];
- // filter siblings
- if ( elem.nodeName === 'IMG' ) {
- this.addImage( elem );
- }
- // find children
- // no non-element nodes, #143
- var nodeType = elem.nodeType;
- if ( !nodeType || !( nodeType === 1 || nodeType === 9 || nodeType === 11 ) ) {
- continue;
- }
- var childElems = elem.querySelectorAll('img');
- // concat childElems to filterFound array
- for ( var j=0, jLen = childElems.length; j < jLen; j++ ) {
- var img = childElems[j];
- this.addImage( img );
- }
- }
+ this.images = [];
+
+ // filter & find items if we have an item selector
+ this.elements.forEach( this.addElementImages, this );
};
-
+
+ /**
+ * @param {Node} element
+ */
+ ImagesLoaded.prototype.addElementImages = function( elem ) {
+ // filter siblings
+ if ( elem.nodeName == 'IMG' ) {
+ this.addImage( elem );
+ }
+ // get background image on element
+ if ( this.options.background === true ) {
+ this.addElementBackgroundImages( elem );
+ }
+
+ // find children
+ // no non-element nodes, #143
+ var nodeType = elem.nodeType;
+ if ( !nodeType || !elementNodeTypes[ nodeType ] ) {
+ return;
+ }
+ var childImgs = elem.querySelectorAll('img');
+ // concat childElems to filterFound array
+ for ( var i=0; i < childImgs.length; i++ ) {
+ var img = childImgs[i];
+ this.addImage( img );
+ }
+
+ // get child background images
+ if ( typeof this.options.background == 'string' ) {
+ var children = elem.querySelectorAll( this.options.background );
+ for ( i=0; i < children.length; i++ ) {
+ var child = children[i];
+ this.addElementBackgroundImages( child );
+ }
+ }
+ };
+
+ var elementNodeTypes = {
+ 1: true,
+ 9: true,
+ 11: true
+ };
+
+ ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
+ var style = getComputedStyle( elem );
+ if ( !style ) {
+ // Firefox returns null if in a hidden iframe https://bugzil.la/548397
+ return;
+ }
+ // get url inside url("...")
+ var reURL = /url\((['"])?(.*?)\1\)/gi;
+ var matches = reURL.exec( style.backgroundImage );
+ while ( matches !== null ) {
+ var url = matches && matches[2];
+ if ( url ) {
+ this.addBackground( url, elem );
+ }
+ matches = reURL.exec( style.backgroundImage );
+ }
+ };
+
/**
* @param {Image} img
*/
ImagesLoaded.prototype.addImage = function( img ) {
- var loadingImage = new LoadingImage( img );
- this.images.push( loadingImage );
+ var loadingImage = new LoadingImage( img );
+ this.images.push( loadingImage );
};
-
+
+ ImagesLoaded.prototype.addBackground = function( url, elem ) {
+ var background = new Background( url, elem );
+ this.images.push( background );
+ };
+
ImagesLoaded.prototype.check = function() {
- var _this = this;
- var checkedCount = 0;
- var length = this.images.length;
- this.hasAnyBroken = false;
- // complete if no images
- if ( !length ) {
- this.complete();
- return;
- }
-
- function onConfirm( image, message ) {
- if ( _this.options.debug && hasConsole ) {
- console.log( 'confirm', image, message );
- }
-
- _this.progress( image );
- checkedCount++;
- if ( checkedCount === length ) {
- _this.complete();
- }
- return true; // bind once
- }
-
- for ( var i=0; i < length; i++ ) {
- var loadingImage = this.images[i];
- loadingImage.on( 'confirm', onConfirm );
- loadingImage.check();
- }
+ var _this = this;
+ this.progressedCount = 0;
+ this.hasAnyBroken = false;
+ // complete if no images
+ if ( !this.images.length ) {
+ this.complete();
+ return;
+ }
+
+ function onProgress( image, elem, message ) {
+ // HACK - Chrome triggers event before object properties have changed. #83
+ setTimeout( function() {
+ _this.progress( image, elem, message );
+ });
+ }
+
+ this.images.forEach( function( loadingImage ) {
+ loadingImage.once( 'progress', onProgress );
+ loadingImage.check();
+ });
};
-
- ImagesLoaded.prototype.progress = function( image ) {
- this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
- // HACK - Chrome triggers event before object properties have changed. #83
- var _this = this;
- setTimeout( function() {
- _this.emit( 'progress', _this, image );
- if ( _this.jqDeferred && _this.jqDeferred.notify ) {
- _this.jqDeferred.notify( _this, image );
- }
- });
+
+ ImagesLoaded.prototype.progress = function( image, elem, message ) {
+ this.progressedCount++;
+ this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
+ // progress event
+ this.emitEvent( 'progress', [ this, image, elem ] );
+ if ( this.jqDeferred && this.jqDeferred.notify ) {
+ this.jqDeferred.notify( this, image );
+ }
+ // check if completed
+ if ( this.progressedCount == this.images.length ) {
+ this.complete();
+ }
+
+ if ( this.options.debug && console ) {
+ console.log( 'progress: ' + message, image, elem );
+ }
};
-
+
ImagesLoaded.prototype.complete = function() {
- var eventName = this.hasAnyBroken ? 'fail' : 'done';
- this.isComplete = true;
- var _this = this;
- // HACK - another setTimeout so that confirm happens after progress
- setTimeout( function() {
- _this.emit( eventName, _this );
- _this.emit( 'always', _this );
- if ( _this.jqDeferred ) {
- var jqMethod = _this.hasAnyBroken ? 'reject' : 'resolve';
- _this.jqDeferred[ jqMethod ]( _this );
- }
- });
+ var eventName = this.hasAnyBroken ? 'fail' : 'done';
+ this.isComplete = true;
+ this.emitEvent( eventName, [ this ] );
+ this.emitEvent( 'always', [ this ] );
+ if ( this.jqDeferred ) {
+ var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
+ this.jqDeferred[ jqMethod ]( this );
+ }
};
-
- // -------------------------- jquery -------------------------- //
-
- if ( $ ) {
- $.fn.imagesLoaded = function( options, callback ) {
- var instance = new ImagesLoaded( this, options, callback );
- return instance.jqDeferred.promise( $(this) );
- };
- }
-
-
+
// -------------------------- -------------------------- //
-
+
function LoadingImage( img ) {
- this.img = img;
+ this.img = img;
}
-
- LoadingImage.prototype = new EventEmitter();
-
+
+ LoadingImage.prototype = Object.create( EvEmitter.prototype );
+
LoadingImage.prototype.check = function() {
- // first check cached any previous images that have same src
- var resource = cache[ this.img.src ] || new Resource( this.img.src );
- if ( resource.isConfirmed ) {
- this.confirm( resource.isLoaded, 'cached was confirmed' );
- return;
- }
-
- // If complete is true and browser supports natural sizes,
- // try to check for image status manually.
- if ( this.img.complete && this.img.naturalWidth !== undefined ) {
- // report based on naturalWidth
- this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
- return;
- }
-
- // If none of the checks above matched, simulate loading on detached element.
- var _this = this;
- resource.on( 'confirm', function( resrc, message ) {
- _this.confirm( resrc.isLoaded, message );
- return true;
- });
-
- resource.check();
+ // If complete is true and browser supports natural sizes,
+ // try to check for image status manually.
+ var isComplete = this.getIsImageComplete();
+ if ( isComplete ) {
+ // report based on naturalWidth
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
+ return;
+ }
+
+ // If none of the checks above matched, simulate loading on detached element.
+ this.proxyImage = new Image();
+ this.proxyImage.addEventListener( 'load', this );
+ this.proxyImage.addEventListener( 'error', this );
+ // bind to image as well for Firefox. #191
+ this.img.addEventListener( 'load', this );
+ this.img.addEventListener( 'error', this );
+ this.proxyImage.src = this.img.src;
};
-
- LoadingImage.prototype.confirm = function( isLoaded, message ) {
- this.isLoaded = isLoaded;
- this.emit( 'confirm', this, message );
+
+ LoadingImage.prototype.getIsImageComplete = function() {
+ // check for non-zero, non-undefined naturalWidth
+ // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
+ return this.img.complete && this.img.naturalWidth;
};
-
- // -------------------------- Resource -------------------------- //
-
- // Resource checks each src, only once
- // separate class from LoadingImage to prevent memory leaks. See #115
-
- var cache = {};
-
- function Resource( src ) {
- this.src = src;
- // add to cache
- cache[ src ] = this;
- }
-
- Resource.prototype = new EventEmitter();
-
- Resource.prototype.check = function() {
- // only trigger checking once
- if ( this.isChecked ) {
- return;
- }
- // simulate loading on detached element
- var proxyImage = new Image();
- eventie.bind( proxyImage, 'load', this );
- eventie.bind( proxyImage, 'error', this );
- proxyImage.src = this.src;
- // set flag
- this.isChecked = true;
+
+ LoadingImage.prototype.confirm = function( isLoaded, message ) {
+ this.isLoaded = isLoaded;
+ this.emitEvent( 'progress', [ this, this.img, message ] );
};
-
+
// ----- events ----- //
-
+
// trigger specified handler for event type
- Resource.prototype.handleEvent = function( event ) {
- var method = 'on' + event.type;
- if ( this[ method ] ) {
- this[ method ]( event );
- }
+ LoadingImage.prototype.handleEvent = function( event ) {
+ var method = 'on' + event.type;
+ if ( this[ method ] ) {
+ this[ method ]( event );
+ }
};
-
- Resource.prototype.onload = function( event ) {
- this.confirm( true, 'onload' );
- this.unbindProxyEvents( event );
+
+ LoadingImage.prototype.onload = function() {
+ this.confirm( true, 'onload' );
+ this.unbindEvents();
};
-
- Resource.prototype.onerror = function( event ) {
- this.confirm( false, 'onerror' );
- this.unbindProxyEvents( event );
+
+ LoadingImage.prototype.onerror = function() {
+ this.confirm( false, 'onerror' );
+ this.unbindEvents();
};
-
- // ----- confirm ----- //
-
- Resource.prototype.confirm = function( isLoaded, message ) {
- this.isConfirmed = true;
- this.isLoaded = isLoaded;
- this.emit( 'confirm', this, message );
+
+ LoadingImage.prototype.unbindEvents = function() {
+ this.proxyImage.removeEventListener( 'load', this );
+ this.proxyImage.removeEventListener( 'error', this );
+ this.img.removeEventListener( 'load', this );
+ this.img.removeEventListener( 'error', this );
};
-
- Resource.prototype.unbindProxyEvents = function( event ) {
- eventie.unbind( event.target, 'load', this );
- eventie.unbind( event.target, 'error', this );
+
+ // -------------------------- Background -------------------------- //
+
+ function Background( url, element ) {
+ this.url = url;
+ this.element = element;
+ this.img = new Image();
+ }
+
+ // inherit LoadingImage prototype
+ Background.prototype = Object.create( LoadingImage.prototype );
+
+ Background.prototype.check = function() {
+ this.img.addEventListener( 'load', this );
+ this.img.addEventListener( 'error', this );
+ this.img.src = this.url;
+ // check if image is already complete
+ var isComplete = this.getIsImageComplete();
+ if ( isComplete ) {
+ this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
+ this.unbindEvents();
+ }
};
-
- // ----- ----- //
-
+
+ Background.prototype.unbindEvents = function() {
+ this.img.removeEventListener( 'load', this );
+ this.img.removeEventListener( 'error', this );
+ };
+
+ Background.prototype.confirm = function( isLoaded, message ) {
+ this.isLoaded = isLoaded;
+ this.emitEvent( 'progress', [ this, this.element, message ] );
+ };
+
+ // -------------------------- jQuery -------------------------- //
+
+ ImagesLoaded.makeJQueryPlugin = function( jQuery ) {
+ jQuery = jQuery || window.jQuery;
+ if ( !jQuery ) {
+ return;
+ }
+ // set local variable
+ $ = jQuery;
+ // $().imagesLoaded()
+ $.fn.imagesLoaded = function( options, callback ) {
+ var instance = new ImagesLoaded( this, options, callback );
+ return instance.jqDeferred.promise( $(this) );
+ };
+ };
+ // try making plugin
+ ImagesLoaded.makeJQueryPlugin();
+
+ // -------------------------- -------------------------- //
+
return ImagesLoaded;
-
-});
-;
+
+ });
+ ;
jQuery(document).ready(function($) {
// gallery faded layer and container elements
@@ -10966,7 +10569,6 @@ UW.elements = {
slideshow : '.uw-slideshow',
social : '.uw-social',
vimeo : '.uw-vimeo',
- youtube : '.uw-youtube',
// customlink : '.uw-custom-link'
}
@@ -10995,7 +10597,6 @@ UW.wpinstance = function(){
UW.sources = {
// Note: style_dir is a variable created by the Wordpress' wp_localize_script in class.uw-scripts.php
- quicklinks : typeof(style_dir) !== 'undefined' ? style_dir + '/wp-admin/admin-ajax.php?action=quicklinks' : UW.getBaseUrl() + 'wp-admin/admin-ajax.php?action=quicklinks',
search : UW.getBaseUrl() + 'wp-admin/admin-ajax.php'
}
@@ -11010,7 +10611,7 @@ UW.initialize = function( $ )
// UW Utilities
UW.dropdowns = _.map( $( UW.elements.dropdowns ), function( element ) { return new UW.Dropdowns({ el : element }) } )
UW.mobilemenu = _.map( $( UW.elements.mobilemenu ), function( element ) { return new UW.MobileMenu({ el : element }) } )
- UW.quicklinks = _.map( $( UW.elements.quicklinks ), function( element ) { return new UW.QuickLinks( { el : element, url : UW.sources.quicklinks }) } )
+ UW.quicklinks = _.map( $( UW.elements.quicklinks ), function( element ) { return new UW.QuickLinks( { el : element }) } )
UW.search = _.map( $( UW.elements.search ), function( element ) { return new UW.Search( { el : element } ) } )
UW.images = _.map( $( UW.elements.images ), function( element ) { return new UW.Image({ el : element }) } )
@@ -11021,7 +10622,6 @@ UW.initialize = function( $ )
UW.slideshows = _.map( $( UW.elements.slideshow ), function( element ) { return new UW.Slideshow( { el : element }) } )
UW.social = _.map( $( UW.elements.social ), function( element ) { return new UW.Social({ el : element }) } )
UW.vimeo = _.map( $( UW.elements.vimeo ), function( element ) { return new UW.Vimeo({ el : element }) } )
- UW.youtube = _.map( $( UW.elements.youtube ), function( element ) { return new UW.YouTube.Collection({ el: element})})
// UW Components - These need to render after all other javascript elements are rendered on page
@@ -11326,70 +10926,25 @@ UW.Search = Backbone.View.extend({
UW.QuickLinks = Backbone.View.extend({
- DELAY : 500,
-
- settings : {},
-
- // todo: the default list and these elements could be put into the php templates
container: '#uw-container',
- template : '',
-
events: {
- 'click' : 'animate',
- 'touchstart' : 'animate',
- 'keyup' : 'animate',
- 'blur' : 'loop'
+ 'click' : 'animate',
+ 'touchstart' : 'animate',
+ 'keyup' : 'animate',
+ 'blur' : 'loop'
},
initialize: function ( options ) {
- _.bindAll( this, 'inner_keydown', 'render', 'renderDefault', 'animate', 'accessible', 'loop', 'transitionEnd' );
-
- this.options = _.extend( {}, this.settings , options )
-
- this.links = new UW.QuickLinks.Collection( this.options )
-
- this.links.on( 'sync', this.render )
-
- this.links.on( 'error', this.renderDefault )
-
- this.links.fetch()
- },
-
- renderDefault : function ()
- {
- this.defaultLinks = this.links.defaults
- this.render()
+ _.bindAll( this, 'inner_keydown', 'render', 'animate', 'accessible', 'loop', 'transitionEnd' );
+
+ this.render();
},
render : function( )
{
- this.defaultLinks = this.links.defaults
- this.quicklinks = $( _.template( this.template )({ links : this.links.toJSON().length == 0 ? this.defaultLinks : this.links.toJSON() }) );
- this.$container = $(this.container);
- this.$container.prepend( this.quicklinks );
+ this.quicklinks = $( '#quicklinks' );
+ this.$container = $( this.container );
this.$el.attr( 'aria-controls', 'quicklinks' ).attr( 'aria-owns', 'quicklinks' );
UW.$body.on( 'keydown', '#quicklinks a:first', this.inner_keydown );
UW.$body.on( 'keyup', '#quicklinks a', this.animate );
@@ -11455,78 +11010,6 @@ UW.QuickLinks = Backbone.View.extend({
}
}
-});
-
-UW.QuickLinks.Model = Backbone.Model.extend({});
-
-UW.QuickLinks.Collection = Backbone.Collection.extend({
-
- model: UW.QuickLinks.Model,
-
- initialize: function ( options )
- {
- this.url = options.url;
- this.url = options.url.replace("www.washington.edu/cms/", "www.washington.edu/");
- },
-
- defaults : [{
- "title": "MyUW",
- "url": "https:\/\/my.uw.edu",
- "classes": ["icon-myuw"]
- }, {
- "title": "Calendar",
- "url": "https:\/\/uw.edu\/calendar",
- "classes": ["icon-calendar"]
- }, {
- "title": "Directories",
- "url": "https:\/\/directory.uw.edu\/",
- "classes": ["icon-directories"]
- }, {
- "title": "Libraries",
- "url": "https:\/\/www.lib.washington.edu\/",
- "classes": ["icon-libraries"]
- }, {
- "title": "UW Medicine",
- "url": "https:\/\/www.uwmedicine.org",
- "classes": ['icon-medicine']
- }, {
- "title": "Maps",
- "url": "https:\/\/uw.edu\/maps",
- "classes": ["icon-maps"]
- }, {
- "title": "UW News",
- "url": "https:\/\/uw.edu\/news",
- "classes": ["icon-uwtoday"]
- }, {
- "title": "Computing\/IT",
- "url": "https:\/\/itconnect.uw.edu",
- "classes": false
- }, {
- "title": "Workday\/ISC",
- "url": "https:\/\/isc.uw.edu\/",
- "classes": false
- }, {
- "title": "Husky Card",
- "url": "https:\/\/hfs.uw.edu\/Husky-Card-Services\/",
- "classes": false
- }, {
- "title": "UW Bothell",
- "url": "https:\/\/www.uwb.edu\/",
- "classes": false
- }, {
- "title": "UW Tacoma",
- "url": "https:\/\/www.tacoma.uw.edu\/",
- "classes": false
- }, {
- "title": "UW Facebook",
- "url": "https:\/\/www.facebook.com\/UofWA",
- "classes": false
- }, {
- "title": "UW Twitter",
- "url": "https:\/\/twitter.com\/UW",
- "classes": false
- }]
-
});
;// ### UW Slideshow
@@ -11871,331 +11354,6 @@ UW.Slideshow = Backbone.View.extend({
})
-;// ### UW Youtube
-
-// This provides the structure and functionality of the UW Youtube player
-// For usage please refer to the [UW Web Youtube Player](http://uw.edu/brand/web/#youtube)
-// It can support a single youtube video or playlist embed
-// options include max results for playlists, modest youtube branding and default resolution
-// requires a unique id for each div.uw-youtube even if there is just one
-
-// Single:
-// Playlist:
-
-UW.YouTube = {};
-
-//the UW.YouTube.Collection object contains data in models that refer to youtube videos
-//(alone or in a playlist) and has a view that renders the proper player with the data
-UW.YouTube.Collection = Backbone.Collection.extend({
-
- // Initialize the player embeds
- // once the player type has been determined, get the associated data
- initialize: function (options) {
- _(this).bindAll('parse');
- this.el = options.el;
- this.$el = $(this.el);
- this.youtube_id = this.$el.data('uw-youtube');
- this.setup_for_type();
- this.make_view();
- this.fetch({success: this.view.onDataReady});
- },
-
- // See if the div.uw-youtube is a playlist or single video
- // setup the proper request and model type
- // setup some other relative parameters
- setup_for_type : function (youtube_id) {
- this.type = this.$el.data('uw-youtube-type');
- this.modest = this.$el.data('modest');
- this.resolution = this.$el.data('resolution');
- var youtubeApiKey = apiKey.network ? apiKey.network : apiKey.local;
- if (this.type == 'playlist'){
- this.max_results = 20;
- var max_results_temp = parseInt(this.$el.data('max-results'), 10);
- if (max_results_temp > 0) {
- this.max_results = max_results_temp;
- }
- this.model = UW.YouTube.PlaylistItem;
- this.url = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=' + this.youtube_id + '&key=' + youtubeApiKey + '&maxResults=' + this.max_results;
- }
- else if (this.type == 'single') {
- this.model = UW.YouTube.Video;
- this.url = 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id=' + this.youtube_id + '&key=' + youtubeApiKey;
- }
- },
-
- // organize useful information from the ajax request
- parse: function (response) {
- var type = this.type, youtube_id = this.youtube_id;
- return _(response.items).map(function (item) {
- if (type == 'single'){
- item.snippet.resourceId = {videoId: youtube_id};
- }
- return item.snippet;
- });
- },
-
- // make the view at the proper time
- make_view: function (type) {
- this.view = new UW.YouTube.CollectionView({collection: this});
- },
-
-});
-
-// The CollectionView builds the html for the player and the control structure for the vidoes
-UW.YouTube.CollectionView = Backbone.View.extend({
-
- // template that all videos get
- template : "
",
-
- // playist section html that only playlists get
- playlist_section : "
",
-
- //event handlers for the templated html
- events: {
- 'click button': 'preview_clicked'
- },
-
- // set up the view for this collection
- // add the youtube iframe api if necessary
- // add the templates
- initialize: function () {
- _(this).bindAll('onReady', 'onDataReady', 'onStateChange', 'preview_clicked', 'resized');
- this.player_ready = false;
- this.data_ready = false;
- this.wrap();
- this.add_iFrame_api();
- if (this.collection.type == 'playlist'){
- this.$el.addClass('playlist');
- this.add_playlist_section();
- this.scrollbar_visible = false;
- $(window).resize(this.resized);
- }
- },
-
- // a resize handler for playlists. Handles the edge case of when a container
- // is resized to be too small for the list and therefor requires a scrollbar
- // when none is present or vice versa
- resized: function() {
- var viewport_new_width = this.$vidSmall.find('.viewport').width();
- if (viewport_new_width != this.$viewport_width){
- this.$viewport_width = viewport_new_width;
- this.showTinyScrollbar();
- }
- },
-
- // wraps our collection in the main template and saves references to the container
- wrap: function () {
- this.collection.$el.wrap($(this.template));
- this.$el = this.collection.$el.parents('.nc-video-player'); //unattached jquery object won't wrap right if we add possible playlist section first
- this.el = this.$el[0];
- },
-
- // if we don't have a copy of the youtube iframe api yet. add it
- add_iFrame_api: function () {
- if (UW.$body.find('script#iFrame').length === 0){
- UW.$body.append('');
- this.add_iFrame_function();
- }
- },
-
- // at this point, all the collections should be created.
- // Each gets a uwplayer variable that is a YT.Player corresponding to the collection
- add_iFrame_function: function () {
- window.onYouTubeIframeAPIReady = function() {
- for (var i = 0, length = UW.youtube.length; i < length; i++){
- var collection = UW.youtube[i], player_vars = {};
- // if the collection desires no youtube branding, set these parameters
- if (collection.modest) {
- player_vars = {
- 'rel' : 0,
- 'controls' : 0,
- 'modestbranding': 1,
- }
- } else {
- player_vars = {
- 'rel' : 0,
- }
- }
- // if (collection.resolution !== 'undefined'){
- // player_vars.VQ = collection.resolution;
- // }
- //attach the YT.player to the relevant view, each view gets one
- collection.view.uwplayer = new YT.Player(collection.$el.attr('id'), {
- videoId: '',
- playerVars: player_vars,
- events: {
- //these events will call functions in the relevant view
- 'onReady': collection.view.onReady,
- 'onStateChange': collection.view.onStateChange
- }
- });
- }
- };
- },
-
- // This function is called if the collection is a playlist
- // adds the playlist section
- add_playlist_section : function () {
- this.$el.append(this.playlist_section);
- this.$vidSmall = this.$el.find('.vidSmall');
- this.$vidContent = this.$el.find('.vidContent');
- this.scrollbar_visible = false;
- },
-
- // this is the callback for when the youtube iframe api is ready to go
- // checks to see if the data is ready too
- onReady: function () {
- this.player_ready = true;
- this.check_all_ready();
- },
-
- // this is the callback for whne the data is loaded into the models
- // preps the playlist area if its a playlist
- // checks to see if the iframe api is ready
- onDataReady: function () {
- this.data_ready = true;
- if (this.collection.type == 'playlist'){
- this.$vidContent_width = this.collection.models.length * 135
- this.$vidContent.width(this.$vidContent_width + 'px');
- this.$viewport_width = this.$vidSmall.find('.viewport').width();
- this.showTinyScrollbar();
- }
- this.check_all_ready();
- },
-
- // this function shows the tiny scrollbar.
- showTinyScrollbar: function () {
- if (this.$vidContent_width > this.$viewport_width){
- if (!this.scrollbar_visible) {
- this.$vidSmall.find('.scrollbar').show();
- this.$vidSmall.tinyscrollbar({axis: 'x'});
- this.scrollbar_visible = true;
- }
- }
- else if (this.scrollbar_visible){
- this.$vidSmall.find('.scrollbar').removeAttr('style');
- this.scrollbar_visible = false;
- }
- },
-
- // this function checks the state of data/player to prevent a race case.
- // Both the data and the player must be ready to go. Then we play the correct video
- check_all_ready: function() {
- if (this.data_ready && this.player_ready){
- this.play(this.collection.models[0].get('resourceId').videoId);
- }
- },
-
- // when the player changes state, this is run.
- // Currently stuff only happens if this is a playlist
- // TODO: add a publicly visible event on video end for showcase pages
- onStateChange: function (event) {
- if (this.is_playlist) {
- //event.data is 0 when a video finishes playing. Find out what video we just finished, then play the next one or loop back to the beginning of the playlist
- if (event.data === 0) {
- var video = this.$vidContent.find('.vid-active').attr('id');
- var index = this.video_ids.indexOf(video);
- if (index < this.video_ids.length - 1) {
- this.play(this.video_ids[index + 1]);
- }
- else {
- this.play(this.video_ids[0]);
- }
- }
- }
- },
-
- // play the video id passed. If 'playnow' not passed, assume false.
- // If 'playnow' is true play the video, otherwise just cue it up
- play: function (id, playnow){
- playnow = playnow || false;
- if (playnow) {
- this.uwplayer.loadVideoById(id);
- this.$el.focus();
- }
- else {
- this.uwplayer.cueVideoById(id);
- }
- //If this is a playlist we must also manipulate the placeholder drawer. Move the selected video's placeholder to the front if we can, otherwise move the listas far as we can without creating whitespace. Then visually distinguish the selected video's placeholder
- if (this.collection.type == 'playlist') {
- this.$el.find('a.vid-active').removeClass('vid-active');
- var $small = $('#' + id);
- $small.addClass('vid-active');
- this.$el.attr('aria-label', 'video: ' + $small.data('title'));
- if (this.scrollbar_visible){
- var leftpos = $small.position().left;
- if (this.$vidContent_width - leftpos < this.$viewport_width){
- leftpos = this.$vidContent_width - this.$viewport_width;
- }
- this.$vidContent.animate({left: -leftpos}, 500);
- this.$vidSmall.data('plugin_tinyscrollbar').update(leftpos);
- }
- }
- },
-
- // this fires if a video preview in the playlist area is clicked
- preview_clicked: function (event) {
- this.play(event.currentTarget.id, true);
- }
-});
-
-
-// Video is a model for a single video
-UW.YouTube.Video = Backbone.Model.extend({
- initialize: function () {
- if (this.get('resourceId')){
- this.view = new UW.YouTube.VideoView({model: this});
- }
- }
-});
-
-// Video View is a view for single video. Currently does nothing
-UW.YouTube.VideoView = Backbone.View.extend({
- //template: underscore + html string here,
-
- initialize: function () {
- this.render();
- },
-
- render: function () {
- this.model.collection.view.$el.attr('aria-label', 'video: ' + this.model.get('title'));
- //var item = this.model.toJSON();
- //var small_vid = _.template(this.template, item);
- //this.model.collection.view.$vidSmall.append(small_vid);
- }
-});
-
-// PlaylistItem is the model for a video in a playlist
-UW.YouTube.PlaylistItem = Backbone.Model.extend({
-
- // if the video is a real video and not an error code, make a view
- initialize: function () {
- if (this.get('resourceId')){
- this.view = new UW.YouTube.PlaylistItemView({model:this});
- }
- },
-});
-
-// PlaylistItemView is the view for a playlist item
-UW.YouTube.PlaylistItemView = Backbone.View.extend({
-
- // this is the template for a playlist item preview
- // goes inside the playlist section
- template: "",
-
- // preps the $el and renders
- initialize: function () {
- this.$el = this.model.collection.view.$vidContent.find('ul');
- this.render();
- },
-
- // gets the data ready, templates it, then appends to the playlist section
- render: function () {
- var item = this.model.toJSON();
- var small_vid = _.template(this.template)( item );
- this.$el.append(small_vid);
- },
-});
;// ### UW Vimeo
// This function creates the UW Vimeo player
@@ -13302,4 +12460,4 @@ UW.Social = Backbone.View.extend({
jQuery(document).ready(function($) {
$("a.uw-custom-link").addClass("disable_a_href");
});
-;}).call(this)
+;})(jQuery);
diff --git a/js/site.js b/js/site.js
index c7f461bc..e542c2c9 100644
--- a/js/site.js
+++ b/js/site.js
@@ -1 +1 @@
-(function(){var kc;jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,t,s,i,n){return jQuery.easing[jQuery.easing.def](e,t,s,i,n)},easeInQuad:function(e,t,s,i,n){return i*(t/=n)*t+s},easeOutQuad:function(e,t,s,i,n){return-i*(t/=n)*(t-2)+s},easeInOutQuad:function(e,t,s,i,n){return(t/=n/2)<1?i/2*t*t+s:-i/2*(--t*(t-2)-1)+s},easeInCubic:function(e,t,s,i,n){return i*(t/=n)*t*t+s},easeOutCubic:function(e,t,s,i,n){return i*((t=t/n-1)*t*t+1)+s},easeInOutCubic:function(e,t,s,i,n){return(t/=n/2)<1?i/2*t*t*t+s:i/2*((t-=2)*t*t+2)+s},easeInQuart:function(e,t,s,i,n){return i*(t/=n)*t*t*t+s},easeOutQuart:function(e,t,s,i,n){return-i*((t=t/n-1)*t*t*t-1)+s},easeInOutQuart:function(e,t,s,i,n){return(t/=n/2)<1?i/2*t*t*t*t+s:-i/2*((t-=2)*t*t*t-2)+s},easeInQuint:function(e,t,s,i,n){return i*(t/=n)*t*t*t*t+s},easeOutQuint:function(e,t,s,i,n){return i*((t=t/n-1)*t*t*t*t+1)+s},easeInOutQuint:function(e,t,s,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+s:i/2*((t-=2)*t*t*t*t+2)+s},easeInSine:function(e,t,s,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+s},easeOutSine:function(e,t,s,i,n){return i*Math.sin(t/n*(Math.PI/2))+s},easeInOutSine:function(e,t,s,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+s},easeInExpo:function(e,t,s,i,n){return 0==t?s:i*Math.pow(2,10*(t/n-1))+s},easeOutExpo:function(e,t,s,i,n){return t==n?s+i:i*(1-Math.pow(2,-10*t/n))+s},easeInOutExpo:function(e,t,s,i,n){return 0==t?s:t==n?s+i:(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+s:i/2*(2-Math.pow(2,-10*--t))+s},easeInCirc:function(e,t,s,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+s},easeOutCirc:function(e,t,s,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+s},easeInOutCirc:function(e,t,s,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+s:i/2*(Math.sqrt(1-(t-=2)*t)+1)+s},easeInElastic:function(e,t,s,i,n){var o=1.70158,r=0,a=i;if(0==t)return s;if(1==(t/=n))return s+i;if(r=r||.3*n,ax'}).firstChild.href),e},vjs.parseUrl=function(e){var t,s,i,n,o;n=["protocol","hostname","port","pathname","search","hash","host"],(i=""===(s=vjs.createEl("a",{href:e})).host&&"file:"!==s.protocol)&&((t=vjs.createEl("div")).innerHTML='',s=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),o={};for(var r=0;r'+this.defaultValue+""},t),vjs.Component.prototype.createEl.call(this,"div",t)},vjs.Menu=vjs.Component.extend(),vjs.Menu.prototype.addItem=function(e){this.addChild(e),e.on("click",vjs.bind(this,function(){this.unlockShowing()}))},vjs.Menu.prototype.createEl=function(){var e=this.options().contentElType||"ul";this.contentEl_=vjs.createEl(e,{className:"vjs-menu-content"});var t=vjs.Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),vjs.on(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t},vjs.MenuItem=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.selected(t.selected)}}),vjs.MenuItem.prototype.createEl=function(e,t){return vjs.Button.prototype.createEl.call(this,"li",vjs.obj.merge({className:"vjs-menu-item",innerHTML:this.options_.label},t))},vjs.MenuItem.prototype.onClick=function(){this.selected(!0)},vjs.MenuItem.prototype.selected=function(e){e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-selected",!0)):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-selected",!1))},vjs.MenuButton=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.menu=this.createMenu(),this.addChild(this.menu),this.items&&0===this.items.length&&this.hide(),this.on("keyup",this.onKeyPress),this.el_.setAttribute("aria-haspopup",!0),this.el_.setAttribute("role","button")}}),vjs.MenuButton.prototype.buttonPressed_=!1,vjs.MenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_);if(this.options().title&&e.contentEl().appendChild(vjs.createEl("li",{className:"vjs-menu-title",innerHTML:vjs.capitalize(this.options().title),tabindex:-1})),this.items=this.createItems(),this.items)for(var t=0;tStream Type LIVE',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.PlayToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),e.on("play",vjs.bind(this,this.onPlay)),e.on("pause",vjs.bind(this,this.onPause))}}),vjs.PlayToggle.prototype.buttonText="Play",vjs.PlayToggle.prototype.buildCSSClass=function(){return"vjs-play-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.PlayToggle.prototype.onClick=function(){this.player_.paused()?this.player_.play():this.player_.pause()},vjs.PlayToggle.prototype.onPlay=function(){vjs.removeClass(this.el_,"vjs-paused"),vjs.addClass(this.el_,"vjs-playing"),this.el_.children[0].children[0].innerHTML="Pause"},vjs.PlayToggle.prototype.onPause=function(){vjs.removeClass(this.el_,"vjs-playing"),vjs.addClass(this.el_,"vjs-paused"),this.el_.children[0].children[0].innerHTML="Play"},vjs.CurrentTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),e.on("timeupdate",vjs.bind(this,this.updateContent))}}),vjs.CurrentTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-current-time-display",innerHTML:'Current Time 0:00',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.CurrentTimeDisplay.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.contentEl_.innerHTML='Current Time '+vjs.formatTime(e,this.player_.duration())},vjs.DurationDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),e.on("timeupdate",vjs.bind(this,this.updateContent))}}),vjs.DurationDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-duration-display",innerHTML:'Duration Time 0:00',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.DurationDisplay.prototype.updateContent=function(){var e=this.player_.duration();e&&(this.contentEl_.innerHTML='Duration Time '+vjs.formatTime(e))},vjs.TimeDivider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.TimeDivider.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-time-divider",innerHTML:"
\t\t\t\t\t\t\t\t\t\t\t\t\t').prependTo(i)}},testCommentsOpened:function(e){1==parseInt(e,10)?(j(".jp-carousel-buttons").fadeIn("fast"),commentForm.fadeIn("fast")):(j(".jp-carousel-buttons").fadeOut("fast"),commentForm.fadeOut("fast"))},getComments:function(e){return!1},postCommentError:function(e){"object"!=typeof e&&(e={}),e.field&&void 0!==e.field&&e.error&&void 0!==e.error&&(j("#jp-carousel-comment-post-results").slideUp("fast").html(''+e.error+"").slideDown("fast"),j("#jp-carousel-comment-form-spinner").spin(!1))},setCommentIframeSrc:function(e){var t=j("#jp-carousel-comment-iframe");t&&t.length&&(t.attr("src",t.attr("src").replace(/(postid=)\d+/,"$1"+e)),t.attr("src",t.attr("src").replace(/(%23.+)?$/,"%23jp-carousel-"+e)))},clearCommentTextAreaValue:function(){var e=j("#jp-carousel-comment-form-comment-field");e&&e.val("")},nextSlide:function(){var e=this.jp_carousel("slides"),t=this.jp_carousel("selectedSlide");return 0==t.length||2e.data("thumb-size").width?t.attr("src",t.closest(".jp-carousel-slide").data("src")):t.attr("src",e.data("preview-image")),t.data("loaded",1))}};j.fn.jp_carousel=function(e){return s[e]?s[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void j.error("Method "+e+" does not exist on jQuery.jp_carousel"):s.open.apply(this,arguments)},j(document.body).on("click","div.gallery,div.tiled-gallery",function(e){j(this).jp_carousel("testForData",e.currentTarget)&&(j(e.target).parent().hasClass("gallery-caption")||(e.preventDefault(),j(this).jp_carousel("open",{start_index:j(this).find(".gallery-item, .tiled-gallery-item").index(j(e.target).parents(".gallery-item, .tiled-gallery-item"))})))}),j(window).on("hashchange",function(){if(window.location.hash&&window.location.hash.match(/jp-carousel-(\d+)/)&&window.location.hash!=y){y=window.location.hash;var e=j("div.gallery, div.tiled-gallery"),s=-1,i=window.location.hash.match(/jp-carousel-(\d+)/);j(this).jp_carousel("testForData",e)&&(i=parseInt(i[1],10),e.find("img").each(function(e,t){if(i&&j(t).data("attachment-id")==i)return s=e,!1}),-1!=s&&e.jp_carousel("openOrSelectSlide",s))}}),window.location.hash&&j(window).trigger("hashchange")}),mx=jQuery,mx.fn.touchwipe=function(e){var c={min_move_x:20,min_move_y:20,wipeLeft:function(e){},wipeRight:function(e){},wipeUp:function(e){},wipeDown:function(e){},preventDefaultEvents:!0};return e&&mx.extend(c,e),this.each(function(){var o,r,a=!1;function l(){this.removeEventListener("touchmove",t),o=null,a=!1}function t(e){if(c.preventDefaultEvents&&e.preventDefault(),a){var t=e.touches[0].pageX,s=e.touches[0].pageY,i=o-t,n=r-s;Math.abs(i)>=c.min_move_x?(l(),0=c.min_move_y&&(l(),0o[0]&&(o[1]+1>o[0]&&s.push("-"),s.push(c(o[1])));return s.push("]"),s.join("")}function t(e){for(var t=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),s=t.length,i=[],n=0,o=0;n/,q])):t.push(["com",/^#[^\n\r]*/,q,"#"])),e.cStyleComments&&(s.push(["com",/^\/\/[^\n\r]*/,q]),s.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q])),e.regexLiterals&&s.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]),(i=e.types)&&s.push(["typ",i]),(e=(""+e.keywords).replace(/^ | $/g,"")).length&&s.push(["kwd",RegExp("^(?:"+e.replace(/[\s,]+/g,"|")+")\\b"),q]),t.push(["pln",/^\s+/,q," \r\n\t "]),s.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]),Ix(t,s)}function Kx(e,t){function n(e){switch(e.nodeType){case 1:if(r.test(e.className))break;if("BR"===e.nodeName)o(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)n(e);break;case 3:case 4:if(c){var t=e.nodeValue,s=t.match(a);if(s){var i=t.substring(0,s.index);e.nodeValue=i,(t=t.substring(s.index+s[0].length))&&e.parentNode.insertBefore(l.createTextNode(t),e.nextSibling),o(e),i||e.parentNode.removeChild(e)}}}}function o(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;var t;for(e=function e(t,s){var i=s?t.cloneNode(!1):t;if(n=t.parentNode){var n=e(n,1),o=t.nextSibling;n.appendChild(i);for(var r=o;r;r=o)o=r.nextSibling,n.appendChild(r)}return i}(e.nextSibling,0);(t=e.parentNode)&&1===t.nodeType;)e=t;i.push(e)}var s,r=/(?:^|\s)nocode(?:\s|$)/,a=/\r\n?|\n/,l=e.ownerDocument;e.currentStyle?s=e.currentStyle.whiteSpace:window.getComputedStyle&&(s=l.defaultView.getComputedStyle(e,q).getPropertyValue("white-space"));var c=s&&"pre"===s.substring(0,3);for(s=l.createElement("LI");e.firstChild;)s.appendChild(e.firstChild);for(var i=[s],u=0;u]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^');
- this.add_iFrame_function();
- }
- },
-
- // at this point, all the collections should be created.
- // Each gets a uwplayer variable that is a YT.Player corresponding to the collection
- add_iFrame_function: function () {
- window.onYouTubeIframeAPIReady = function() {
- for (var i = 0, length = UW.youtube.length; i < length; i++){
- var collection = UW.youtube[i], player_vars = {};
- // if the collection desires no youtube branding, set these parameters
- if (collection.modest) {
- player_vars = {
- 'rel' : 0,
- 'controls' : 0,
- 'modestbranding': 1,
- }
- } else {
- player_vars = {
- 'rel' : 0,
- }
- }
- // if (collection.resolution !== 'undefined'){
- // player_vars.VQ = collection.resolution;
- // }
- //attach the YT.player to the relevant view, each view gets one
- collection.view.uwplayer = new YT.Player(collection.$el.attr('id'), {
- videoId: '',
- playerVars: player_vars,
- events: {
- //these events will call functions in the relevant view
- 'onReady': collection.view.onReady,
- 'onStateChange': collection.view.onStateChange
- }
- });
- }
- };
- },
-
- // This function is called if the collection is a playlist
- // adds the playlist section
- add_playlist_section : function () {
- this.$el.append(this.playlist_section);
- this.$vidSmall = this.$el.find('.vidSmall');
- this.$vidContent = this.$el.find('.vidContent');
- this.scrollbar_visible = false;
- },
-
- // this is the callback for when the youtube iframe api is ready to go
- // checks to see if the data is ready too
- onReady: function () {
- this.player_ready = true;
- this.check_all_ready();
- },
-
- // this is the callback for whne the data is loaded into the models
- // preps the playlist area if its a playlist
- // checks to see if the iframe api is ready
- onDataReady: function () {
- this.data_ready = true;
- if (this.collection.type == 'playlist'){
- this.$vidContent_width = this.collection.models.length * 135
- this.$vidContent.width(this.$vidContent_width + 'px');
- this.$viewport_width = this.$vidSmall.find('.viewport').width();
- this.showTinyScrollbar();
- }
- this.check_all_ready();
- },
-
- // this function shows the tiny scrollbar.
- showTinyScrollbar: function () {
- if (this.$vidContent_width > this.$viewport_width){
- if (!this.scrollbar_visible) {
- this.$vidSmall.find('.scrollbar').show();
- this.$vidSmall.tinyscrollbar({axis: 'x'});
- this.scrollbar_visible = true;
- }
- }
- else if (this.scrollbar_visible){
- this.$vidSmall.find('.scrollbar').removeAttr('style');
- this.scrollbar_visible = false;
- }
- },
-
- // this function checks the state of data/player to prevent a race case.
- // Both the data and the player must be ready to go. Then we play the correct video
- check_all_ready: function() {
- if (this.data_ready && this.player_ready){
- this.play(this.collection.models[0].get('resourceId').videoId);
- }
- },
-
- // when the player changes state, this is run.
- // Currently stuff only happens if this is a playlist
- // TODO: add a publicly visible event on video end for showcase pages
- onStateChange: function (event) {
- if (this.is_playlist) {
- //event.data is 0 when a video finishes playing. Find out what video we just finished, then play the next one or loop back to the beginning of the playlist
- if (event.data === 0) {
- var video = this.$vidContent.find('.vid-active').attr('id');
- var index = this.video_ids.indexOf(video);
- if (index < this.video_ids.length - 1) {
- this.play(this.video_ids[index + 1]);
- }
- else {
- this.play(this.video_ids[0]);
- }
- }
- }
- },
-
- // play the video id passed. If 'playnow' not passed, assume false.
- // If 'playnow' is true play the video, otherwise just cue it up
- play: function (id, playnow){
- playnow = playnow || false;
- if (playnow) {
- this.uwplayer.loadVideoById(id);
- this.$el.focus();
- }
- else {
- this.uwplayer.cueVideoById(id);
- }
- //If this is a playlist we must also manipulate the placeholder drawer. Move the selected video's placeholder to the front if we can, otherwise move the listas far as we can without creating whitespace. Then visually distinguish the selected video's placeholder
- if (this.collection.type == 'playlist') {
- this.$el.find('a.vid-active').removeClass('vid-active');
- var $small = $('#' + id);
- $small.addClass('vid-active');
- this.$el.attr('aria-label', 'video: ' + $small.data('title'));
- if (this.scrollbar_visible){
- var leftpos = $small.position().left;
- if (this.$vidContent_width - leftpos < this.$viewport_width){
- leftpos = this.$vidContent_width - this.$viewport_width;
- }
- this.$vidContent.animate({left: -leftpos}, 500);
- this.$vidSmall.data('plugin_tinyscrollbar').update(leftpos);
- }
- }
- },
-
- // this fires if a video preview in the playlist area is clicked
- preview_clicked: function (event) {
- this.play(event.currentTarget.id, true);
- }
-});
-
-
-// Video is a model for a single video
-UW.YouTube.Video = Backbone.Model.extend({
- initialize: function () {
- if (this.get('resourceId')){
- this.view = new UW.YouTube.VideoView({model: this});
- }
- }
-});
-
-// Video View is a view for single video. Currently does nothing
-UW.YouTube.VideoView = Backbone.View.extend({
- //template: underscore + html string here,
-
- initialize: function () {
- this.render();
- },
-
- render: function () {
- this.model.collection.view.$el.attr('aria-label', 'video: ' + this.model.get('title'));
- //var item = this.model.toJSON();
- //var small_vid = _.template(this.template, item);
- //this.model.collection.view.$vidSmall.append(small_vid);
- }
-});
-
-// PlaylistItem is the model for a video in a playlist
-UW.YouTube.PlaylistItem = Backbone.Model.extend({
-
- // if the video is a real video and not an error code, make a view
- initialize: function () {
- if (this.get('resourceId')){
- this.view = new UW.YouTube.PlaylistItemView({model:this});
- }
- },
-});
-
-// PlaylistItemView is the view for a playlist item
-UW.YouTube.PlaylistItemView = Backbone.View.extend({
-
- // this is the template for a playlist item preview
- // goes inside the playlist section
- template: "",
-
- // preps the $el and renders
- initialize: function () {
- this.$el = this.model.collection.view.$vidContent.find('ul');
- this.render();
- },
-
- // gets the data ready, templates it, then appends to the playlist section
- render: function () {
- var item = this.model.toJSON();
- var small_vid = _.template(this.template)( item );
- this.$el.append(small_vid);
- },
-});
diff --git a/less/style.less b/less/style.less
index 3a1f0c0d..9f107686 100644
--- a/less/style.less
+++ b/less/style.less
@@ -54,7 +54,6 @@ GitHub Theme URI: https://github.com/uweb/uw-2014
@import "less/uw.boxes.less";
@import "less/uw.tables.less";
@import "less/uw.player.less";
-@import "less/uw.youtube.less";
@import "less/uw.blogroll.less";
@import "less/uw.custom-link.less";
diff --git a/less/uw.breadcrumbs.less b/less/uw.breadcrumbs.less
index 0c05b8a5..9c0ae881 100644
--- a/less/uw.breadcrumbs.less
+++ b/less/uw.breadcrumbs.less
@@ -20,6 +20,8 @@
width: 25px;
padding: 5px 0 5px 0;
margin-right: 25px;
+ transition: none;
+ margin-bottom: 0;
&:before {
right: -18px;
}
@@ -28,6 +30,7 @@
&:hover {
border-bottom: 1px solid @darkgold;
margin-bottom: -1px;
+ transition: none;
}
}
&:after {
diff --git a/less/uw.select.less b/less/uw.select.less
index 176949f9..b74501ab 100644
--- a/less/uw.select.less
+++ b/less/uw.select.less
@@ -9,7 +9,7 @@ ul.uw-select {
&.open {
background-color: #F7F7F7;
outline: 1px solid #F7F7F7;
- overflow: scroll;
+ overflow: auto;
height: 355px;
outline: 1px solid #C4C4C4;
z-index:9999;
diff --git a/menu-quicklinks.php b/menu-quicklinks.php
new file mode 100644
index 00000000..bbb833f3
--- /dev/null
+++ b/menu-quicklinks.php
@@ -0,0 +1,27 @@
+
diff --git a/setup/class.accordion-shortcode.php b/setup/class.accordion-shortcode.php
index d398b3a8..2061721f 100644
--- a/setup/class.accordion-shortcode.php
+++ b/setup/class.accordion-shortcode.php
@@ -34,9 +34,14 @@ function accordion_handler( $atts, $content )
if ( empty( $content ) )
return 'No content inside the accordion element. Make sure your close your accordion element. Required stucture: [accordion][section]content[/section][/accordion]';
-
+
+
+ $parent = get_template();
+ $parent_version = wp_get_theme($parent)->get('Version');
+ wp_enqueue_script( 'uw-accordionmodule', get_template_directory_uri() . '/js/uw.accordionmodule.js', array( 'jquery' ), $parent_version, true );
$output = do_shortcode( $content );
- return sprintf( '