Difference between revisions of "Team:Dundee/jquery.js"

 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<html>
 +
<script type="text/javascript">
 
/*!
 
/*!
 
  * jQuery JavaScript Library v1.10.2
 
  * jQuery JavaScript Library v1.10.2
Line 9,301: Line 9,303:
 
},
 
},
 
animate: function( prop, speed, easing, callback ) {
 
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
+
var empty = jQue
optall = jQuery.speed( speed, easing, callback ),
+
</script>
doAnimation = function() {
+
</html>
// Operate on a copy of prop so per-property easing won't be lost
+
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
 
+
// Empty animations, or finishing resolves immediately
+
if ( empty || jQuery._data( this, "finish" ) ) {
+
anim.stop( true );
+
}
+
};
+
doAnimation.finish = doAnimation;
+
 
+
return empty || optall.queue === false ?
+
this.each( doAnimation ) :
+
this.queue( optall.queue, doAnimation );
+
},
+
stop: function( type, clearQueue, gotoEnd ) {
+
var stopQueue = function( hooks ) {
+
var stop = hooks.stop;
+
delete hooks.stop;
+
stop( gotoEnd );
+
};
+
 
+
if ( typeof type !== "string" ) {
+
gotoEnd = clearQueue;
+
clearQueue = type;
+
type = undefined;
+
}
+
if ( clearQueue && type !== false ) {
+
this.queue( type || "fx", [] );
+
}
+
 
+
return this.each(function() {
+
var dequeue = true,
+
index = type != null && type + "queueHooks",
+
timers = jQuery.timers,
+
data = jQuery._data( this );
+
 
+
if ( index ) {
+
if ( data[ index ] && data[ index ].stop ) {
+
stopQueue( data[ index ] );
+
}
+
} else {
+
for ( index in data ) {
+
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+
stopQueue( data[ index ] );
+
}
+
}
+
}
+
 
+
for ( index = timers.length; index--; ) {
+
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+
timers[ index ].anim.stop( gotoEnd );
+
dequeue = false;
+
timers.splice( index, 1 );
+
}
+
}
+
 
+
// start the next in the queue if the last step wasn't forced
+
// timers currently will call their complete callbacks, which will dequeue
+
// but only if they were gotoEnd
+
if ( dequeue || !gotoEnd ) {
+
jQuery.dequeue( this, type );
+
}
+
});
+
},
+
finish: function( type ) {
+
if ( type !== false ) {
+
type = type || "fx";
+
}
+
return this.each(function() {
+
var index,
+
data = jQuery._data( this ),
+
queue = data[ type + "queue" ],
+
hooks = data[ type + "queueHooks" ],
+
timers = jQuery.timers,
+
length = queue ? queue.length : 0;
+
 
+
// enable finishing flag on private data
+
data.finish = true;
+
 
+
// empty the queue first
+
jQuery.queue( this, type, [] );
+
 
+
if ( hooks && hooks.stop ) {
+
hooks.stop.call( this, true );
+
}
+
 
+
// look for any active animations, and finish them
+
for ( index = timers.length; index--; ) {
+
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+
timers[ index ].anim.stop( true );
+
timers.splice( index, 1 );
+
}
+
}
+
 
+
// look for any animations in the old queue and finish them
+
for ( index = 0; index < length; index++ ) {
+
if ( queue[ index ] && queue[ index ].finish ) {
+
queue[ index ].finish.call( this );
+
}
+
}
+
 
+
// turn off finishing flag
+
delete data.finish;
+
});
+
}
+
});
+
 
+
// Generate parameters to create a standard animation
+
function genFx( type, includeWidth ) {
+
var which,
+
attrs = { height: type },
+
i = 0;
+
 
+
// if we include width, step value is 1 to do all cssExpand values,
+
// if we don't include width, step value is 2 to skip over Left and Right
+
includeWidth = includeWidth? 1 : 0;
+
for( ; i < 4 ; i += 2 - includeWidth ) {
+
which = cssExpand[ i ];
+
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+
}
+
 
+
if ( includeWidth ) {
+
attrs.opacity = attrs.width = type;
+
}
+
 
+
return attrs;
+
}
+
 
+
// Generate shortcuts for custom animations
+
jQuery.each({
+
slideDown: genFx("show"),
+
slideUp: genFx("hide"),
+
slideToggle: genFx("toggle"),
+
fadeIn: { opacity: "show" },
+
fadeOut: { opacity: "hide" },
+
fadeToggle: { opacity: "toggle" }
+
}, function( name, props ) {
+
jQuery.fn[ name ] = function( speed, easing, callback ) {
+
return this.animate( props, speed, easing, callback );
+
};
+
});
+
 
+
jQuery.speed = function( speed, easing, fn ) {
+
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+
complete: fn || !fn && easing ||
+
jQuery.isFunction( speed ) && speed,
+
duration: speed,
+
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+
};
+
 
+
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
 
+
// normalize opt.queue - true/undefined/null -> "fx"
+
if ( opt.queue == null || opt.queue === true ) {
+
opt.queue = "fx";
+
}
+
 
+
// Queueing
+
opt.old = opt.complete;
+
 
+
opt.complete = function() {
+
if ( jQuery.isFunction( opt.old ) ) {
+
opt.old.call( this );
+
}
+
 
+
if ( opt.queue ) {
+
jQuery.dequeue( this, opt.queue );
+
}
+
};
+
 
+
return opt;
+
};
+
 
+
jQuery.easing = {
+
linear: function( p ) {
+
return p;
+
},
+
swing: function( p ) {
+
return 0.5 - Math.cos( p*Math.PI ) / 2;
+
}
+
};
+
 
+
jQuery.timers = [];
+
jQuery.fx = Tween.prototype.init;
+
jQuery.fx.tick = function() {
+
var timer,
+
timers = jQuery.timers,
+
i = 0;
+
 
+
fxNow = jQuery.now();
+
 
+
for ( ; i < timers.length; i++ ) {
+
timer = timers[ i ];
+
// Checks the timer has not already been removed
+
if ( !timer() && timers[ i ] === timer ) {
+
timers.splice( i--, 1 );
+
}
+
}
+
 
+
if ( !timers.length ) {
+
jQuery.fx.stop();
+
}
+
fxNow = undefined;
+
};
+
 
+
jQuery.fx.timer = function( timer ) {
+
if ( timer() && jQuery.timers.push( timer ) ) {
+
jQuery.fx.start();
+
}
+
};
+
 
+
jQuery.fx.interval = 13;
+
 
+
jQuery.fx.start = function() {
+
if ( !timerId ) {
+
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+
}
+
};
+
 
+
jQuery.fx.stop = function() {
+
clearInterval( timerId );
+
timerId = null;
+
};
+
 
+
jQuery.fx.speeds = {
+
slow: 600,
+
fast: 200,
+
// Default speed
+
_default: 400
+
};
+
 
+
// Back Compat <1.8 extension point
+
jQuery.fx.step = {};
+
 
+
if ( jQuery.expr && jQuery.expr.filters ) {
+
jQuery.expr.filters.animated = function( elem ) {
+
return jQuery.grep(jQuery.timers, function( fn ) {
+
return elem === fn.elem;
+
}).length;
+
};
+
}
+
jQuery.fn.offset = function( options ) {
+
if ( arguments.length ) {
+
return options === undefined ?
+
this :
+
this.each(function( i ) {
+
jQuery.offset.setOffset( this, options, i );
+
});
+
}
+
 
+
var docElem, win,
+
box = { top: 0, left: 0 },
+
elem = this[ 0 ],
+
doc = elem && elem.ownerDocument;
+
 
+
if ( !doc ) {
+
return;
+
}
+
 
+
docElem = doc.documentElement;
+
 
+
// Make sure it's not a disconnected DOM node
+
if ( !jQuery.contains( docElem, elem ) ) {
+
return box;
+
}
+
 
+
// If we don't have gBCR, just use 0,0 rather than error
+
// BlackBerry 5, iOS 3 (original iPhone)
+
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
+
box = elem.getBoundingClientRect();
+
}
+
win = getWindow( doc );
+
return {
+
top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
+
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+
};
+
};
+
 
+
jQuery.offset = {
+
 
+
setOffset: function( elem, options, i ) {
+
var position = jQuery.css( elem, "position" );
+
 
+
// set position first, in-case top/left are set even on static elem
+
if ( position === "static" ) {
+
elem.style.position = "relative";
+
}
+
 
+
var curElem = jQuery( elem ),
+
curOffset = curElem.offset(),
+
curCSSTop = jQuery.css( elem, "top" ),
+
curCSSLeft = jQuery.css( elem, "left" ),
+
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+
props = {}, curPosition = {}, curTop, curLeft;
+
 
+
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+
if ( calculatePosition ) {
+
curPosition = curElem.position();
+
curTop = curPosition.top;
+
curLeft = curPosition.left;
+
} else {
+
curTop = parseFloat( curCSSTop ) || 0;
+
curLeft = parseFloat( curCSSLeft ) || 0;
+
}
+
 
+
if ( jQuery.isFunction( options ) ) {
+
options = options.call( elem, i, curOffset );
+
}
+
 
+
if ( options.top != null ) {
+
props.top = ( options.top - curOffset.top ) + curTop;
+
}
+
if ( options.left != null ) {
+
props.left = ( options.left - curOffset.left ) + curLeft;
+
}
+
 
+
if ( "using" in options ) {
+
options.using.call( elem, props );
+
} else {
+
curElem.css( props );
+
}
+
}
+
};
+
 
+
 
+
jQuery.fn.extend({
+
 
+
position: function() {
+
if ( !this[ 0 ] ) {
+
return;
+
}
+
 
+
var offsetParent, offset,
+
parentOffset = { top: 0, left: 0 },
+
elem = this[ 0 ];
+
 
+
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+
if ( jQuery.css( elem, "position" ) === "fixed" ) {
+
// we assume that getBoundingClientRect is available when computed position is fixed
+
offset = elem.getBoundingClientRect();
+
} else {
+
// Get *real* offsetParent
+
offsetParent = this.offsetParent();
+
 
+
// Get correct offsets
+
offset = this.offset();
+
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+
parentOffset = offsetParent.offset();
+
}
+
 
+
// Add offsetParent borders
+
parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+
}
+
 
+
// Subtract parent offsets and element margins
+
// note: when an element has margin: auto the offsetLeft and marginLeft
+
// are the same in Safari causing offset.left to incorrectly be 0
+
return {
+
top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+
};
+
},
+
 
+
offsetParent: function() {
+
return this.map(function() {
+
var offsetParent = this.offsetParent || docElem;
+
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
+
offsetParent = offsetParent.offsetParent;
+
}
+
return offsetParent || docElem;
+
});
+
}
+
});
+
 
+
 
+
// Create scrollLeft and scrollTop methods
+
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+
var top = /Y/.test( prop );
+
 
+
jQuery.fn[ method ] = function( val ) {
+
return jQuery.access( this, function( elem, method, val ) {
+
var win = getWindow( elem );
+
 
+
if ( val === undefined ) {
+
return win ? (prop in win) ? win[ prop ] :
+
win.document.documentElement[ method ] :
+
elem[ method ];
+
}
+
 
+
if ( win ) {
+
win.scrollTo(
+
!top ? val : jQuery( win ).scrollLeft(),
+
top ? val : jQuery( win ).scrollTop()
+
);
+
 
+
} else {
+
elem[ method ] = val;
+
}
+
}, method, val, arguments.length, null );
+
};
+
});
+
 
+
function getWindow( elem ) {
+
return jQuery.isWindow( elem ) ?
+
elem :
+
elem.nodeType === 9 ?
+
elem.defaultView || elem.parentWindow :
+
false;
+
}
+
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+
// margin is only for outerHeight, outerWidth
+
jQuery.fn[ funcName ] = function( margin, value ) {
+
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
 
+
return jQuery.access( this, function( elem, type, value ) {
+
var doc;
+
 
+
if ( jQuery.isWindow( elem ) ) {
+
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+
// isn't a whole lot we can do. See pull request at this URL for discussion:
+
// https://github.com/jquery/jquery/pull/764
+
return elem.document.documentElement[ "client" + name ];
+
}
+
 
+
// Get document width or height
+
if ( elem.nodeType === 9 ) {
+
doc = elem.documentElement;
+
 
+
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+
return Math.max(
+
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+
elem.body[ "offset" + name ], doc[ "offset" + name ],
+
doc[ "client" + name ]
+
);
+
}
+
 
+
return value === undefined ?
+
// Get width or height on the element, requesting but not forcing parseFloat
+
jQuery.css( elem, type, extra ) :
+
 
+
// Set width or height on the element
+
jQuery.style( elem, type, value, extra );
+
}, type, chainable ? margin : undefined, chainable, null );
+
};
+
});
+
});
+
// Limit scope pollution from any deprecated API
+
// (function() {
+
 
+
// The number of elements contained in the matched element set
+
jQuery.fn.size = function() {
+
return this.length;
+
};
+
 
+
jQuery.fn.andSelf = jQuery.fn.addBack;
+
 
+
// })();
+
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
+
// Expose jQuery as module.exports in loaders that implement the Node
+
// module pattern (including browserify). Do not create the global, since
+
// the user will be storing it themselves locally, and globals are frowned
+
// upon in the Node module world.
+
module.exports = jQuery;
+
} else {
+
// Otherwise expose jQuery to the global object as usual
+
window.jQuery = window.$ = jQuery;
+
 
+
// Register as a named AMD module, since jQuery can be concatenated with other
+
// files that may use define, but not via a proper concatenation script that
+
// understands anonymous AMD modules. A named AMD is safest and most robust
+
// way to register. Lowercase jquery is used because AMD module names are
+
// derived from file names, and jQuery is normally delivered in a lowercase
+
// file name. Do this after creating the global so that if an AMD module wants
+
// to call noConflict to hide this version of jQuery, it will work.
+
if ( typeof define === "function" && define.amd ) {
+
define( "jquery", [], function () { return jQuery; } );
+
}
+
}
+
 
+
})( window );
+
 
+
// LIGHTBOX ///*
+
/*
+
  autoPlayModal();
+
 
+
  //FUNCTION TO GET AND PLAY VIDEO FROM DATATAG
+
  function autoPlayModal() {
+
      var trigger = $("body").find('[data-toggle="modal"]');
+
      trigger.click(function () {
+
          var theModal = $(this).data("target"),
+
              videoSRC = $(this).attr("data-theVideo"),
+
              videoSRCauto = videoSRC;
+
          $(theModal + ' iframe').attr('src', videoSRCauto);
+
          $(theModal + ' button.close').click(function () {
+
              $(theModal + ' iframe').attr('src', videoSRC);
+
          });
+
      });
+
  }
+
 
+
  $(document).ready(function(){
+
  autoPlayModal();
+
});
+
*/
+
 
+
jQuery(".modal-backdrop, #myModal .close, #myModal .btn").live("click", function() {
+
        jQuery("#myModal iframe").attr("src", jQuery("#myModal iframe").attr("src"));
+
});
+

Latest revision as of 09:35, 22 June 2015