first commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// Animations v1.4, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/
|
||||
// ==================================================================================
|
||||
|
||||
function animateElement(){jQuery(".animate").each(jQuery(window).width()>=960?function(a,n){var n=jQuery(n),i=jQuery(this).attr("data-anim-type"),t=jQuery(this).attr("data-anim-delay");n.visible(!0)&&setTimeout(function(){n.addClass(i)},t)}:function(a,n){var n=jQuery(n),i=jQuery(this).attr("data-anim-type"),t=jQuery(this).attr("data-anim-delay");setTimeout(function(){n.addClass(i)},t)})}function randomClass(){var a=Math.ceil(Math.random()*classAmount);return classesArray[a]}function animateOnce(a,n){"random"==n&&(n=randomClass()),jQuery(a).removeClass("trigger infinite "+triggerClasses).addClass("trigger").addClass(n).one("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){jQuery(this).removeClass("trigger infinite "+triggerClasses)})}function animateInfinite(a,n){"random"==n&&(n=randomClass()),jQuery(a).removeClass("trigger infinite "+triggerClasses).addClass("trigger infinite").addClass(n).one("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){jQuery(this).removeClass("trigger infinite "+triggerClasses)})}function animateEnd(a){jQuery(a).removeClass("trigger infinite "+triggerClasses)}jQuery(document).ready(function(){jQuery("html").hasClass("no-js")&&jQuery("html").removeClass("no-js").addClass("js"),animateElement()}),jQuery(window).resize(function(){animateElement()}),jQuery(window).scroll(function(){animateElement(),jQuery(window).scrollTop()+jQuery(window).height()==jQuery(document).height()&&animateElement()});var triggerClasses="flash strobe shakeH shakeV bounce tada wave spinCW spinCCW slingshotCW slingshotCCW wobble pulse pulsate heartbeat panic",classesArray=new Array,classesArray=triggerClasses.split(" "),classAmount=classesArray.length;
|
||||
@@ -0,0 +1,94 @@
|
||||
var messageDelay = 2000; // How long to display status messages (in milliseconds)
|
||||
|
||||
// Init the form once the document is ready
|
||||
$( init );
|
||||
|
||||
|
||||
// Initialize the form
|
||||
|
||||
function init() {
|
||||
|
||||
// Hide the form initially.
|
||||
// Make submitForm() the form's submit handler.
|
||||
// Position the form so it sits in the centre of the browser window.
|
||||
$('#contactForm').show().submit( submitForm ).addClass( 'positioned' );
|
||||
|
||||
// When the "Send us an email" link is clicked:
|
||||
// 1. Fade the content out
|
||||
// 2. Display the form
|
||||
// 3. Move focus to the first field
|
||||
// 4. Prevent the link being followed
|
||||
|
||||
$('a[href="#contactForm"]').click( function() {
|
||||
$('#contactForm').fadeTo( 'slow', .2 );
|
||||
$('#contactForm').fadeIn( 'slow', function() {
|
||||
$('#senderName').focus();
|
||||
} )
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Submit the form via Ajax
|
||||
|
||||
function submitForm() {
|
||||
var contactForm = $(this);
|
||||
|
||||
// Are all the fields filled in?
|
||||
|
||||
if ( !$('#senderName').val() || !$('#senderEmail').val() || !$('#message').val() ) {
|
||||
|
||||
// No; display a warning message and return to the form
|
||||
$('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
|
||||
contactForm.fadeOut().delay(messageDelay).fadeIn();
|
||||
|
||||
} else {
|
||||
|
||||
// Yes; submit the form to the PHP script via Ajax
|
||||
|
||||
$('#sendingMessage').fadeIn();
|
||||
contactForm.fadeOut();
|
||||
|
||||
$.ajax( {
|
||||
url: contactForm.attr( 'action' ) + "?ajax=true",
|
||||
type: contactForm.attr( 'method' ),
|
||||
data: contactForm.serialize(),
|
||||
success: submitFinished
|
||||
} );
|
||||
}
|
||||
|
||||
// Prevent the default form submission occurring
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Handle the Ajax response
|
||||
|
||||
function submitFinished( response ) {
|
||||
response = $.trim( response );
|
||||
$('#sendingMessage').fadeOut();
|
||||
|
||||
if ( response == "success" ) {
|
||||
|
||||
// Form submitted successfully:
|
||||
// 1. Display the success message
|
||||
// 2. Clear the form fields
|
||||
// 3. Fade the content back in
|
||||
|
||||
$('#successMessage').fadeIn().delay(messageDelay).fadeOut();
|
||||
$('#senderName').val( "" );
|
||||
$('#senderEmail').val( "" );
|
||||
$('#message').val( "" );
|
||||
|
||||
$('#contactForm').delay(messageDelay+500).fadeIn();
|
||||
|
||||
} else {
|
||||
|
||||
// Form submission failed: Display the failure message,
|
||||
// then redisplay the form
|
||||
$('#failureMessage').fadeIn().delay(messageDelay).fadeOut();
|
||||
$('#contactForm').delay(messageDelay+500).fadeIn();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,741 @@
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
var http = createRequestObject();
|
||||
var areal = Math.random() + "";
|
||||
var real = areal.substring(2,6);
|
||||
|
||||
function createRequestObject() {
|
||||
var xmlhttp;
|
||||
try {
|
||||
var xmlhttp = null;if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest();}else{ if (window.ActiveXObject) { xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); } }
|
||||
|
||||
// xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
catch(e) {
|
||||
try {
|
||||
var xmlhttp = null;if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest();}else{ if (window.ActiveXObject) { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } }
|
||||
//xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch(f) { xmlhttp=null; }
|
||||
}
|
||||
if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
return xmlhttp;
|
||||
}
|
||||
|
||||
|
||||
function sendRequest() {
|
||||
|
||||
var rnd = Math.random();
|
||||
var name = escape(document.getElementById("name").value);
|
||||
var email = escape(document.getElementById("email").value);
|
||||
var subject = escape(document.getElementById("subject").value);
|
||||
var body = document.getElementById("body").value;
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/contactform.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse;
|
||||
http.send('name='+name+'&email='+email+'&subject='+subject+'&body='+body+'&rnd='+rnd);
|
||||
}
|
||||
catch(e){}
|
||||
finally{
|
||||
jQuery('#contactform').slideUp("slow").hide();
|
||||
jQuery('#contactWrapper').append('<div class="success"><h4>Email Successfully Sent!</h4><br><p>Thank you for using our contact form <strong>'+decodeURIComponent(name)+'</strong>! Your email was successfully sent and we'll be in touch with you soon.</p></div>');
|
||||
}
|
||||
}
|
||||
function sendRequest_booking() {
|
||||
|
||||
var rnd = Math.random();
|
||||
var name = escape(document.getElementById("name").value);
|
||||
var email = escape(document.getElementById("email").value);
|
||||
|
||||
var surname = escape(document.getElementById("surname").value);
|
||||
var arrival = escape(document.getElementById("arrival").value);
|
||||
var room = escape(document.getElementById("room").value);
|
||||
var departure = escape(document.getElementById("departure").value);
|
||||
var children = escape(document.getElementById("children").value);
|
||||
var adults = escape(document.getElementById("adults").value);
|
||||
var rooms = escape(document.getElementById("rooms").value);
|
||||
|
||||
var body = document.getElementById("body").value;
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/bookingform.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse;
|
||||
http.send('name='+name+'&surname='+surname+'&email='+email+'&arrival='+arrival+'&room='+room+'&departure='+departure+'&children='+children+'&adults='+adults+'&rooms='+rooms+'&body='+body+'&rnd='+rnd);
|
||||
}
|
||||
catch(e){}
|
||||
finally{
|
||||
jQuery('#contactform_booking').slideUp("slow").hide();
|
||||
jQuery('#contactWrapper').append('<div class="success"><h4>Email Successfully Sent!</h4><br><p>Thank you for using our contact form <strong>'+decodeURIComponent(name)+'</strong>! Your email was successfully sent and we'll be in touch with you soon.</p></div>');
|
||||
}
|
||||
}
|
||||
|
||||
function sendRequest_loans() {
|
||||
|
||||
var rnd = Math.random();
|
||||
var name = escape(document.getElementById("name").value);
|
||||
var name_s = escape(document.getElementById("name_s").value);
|
||||
var subject = escape(document.getElementById("subject").value);
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/contactform_loans.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse_popup;
|
||||
http.send('name='+name+'&name_s='+name_s+'&subject='+subject+'&rnd='+rnd);
|
||||
}
|
||||
catch(e){}
|
||||
finally{
|
||||
jQuery('#contactform_popup').slideUp("slow").hide();
|
||||
jQuery('#contactWrapper_popup').append('<div class="success"><h4>Email Successfully Sent!</h4><br><p>Thank you for using our contact form <strong>'+name+'</strong>! Your email was successfully sent and we'll be in touch with you soon.</p></div>');
|
||||
}
|
||||
}
|
||||
|
||||
function sendRequest_popup() {
|
||||
|
||||
var rnd = Math.random();
|
||||
var name = escape(document.getElementById("name_popup").value);
|
||||
var email = escape(document.getElementById("email_popup").value);
|
||||
var subject = escape(document.getElementById("subject_popup").value);
|
||||
var body = escape(document.getElementById("body_popup").value);
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/contactform.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse_popup;
|
||||
http.send('name='+name+'&email='+email+'&subject='+subject+'&body='+body+'&rnd='+rnd);
|
||||
}
|
||||
catch(e){}
|
||||
finally{
|
||||
jQuery('#contactform_popup').slideUp("slow").hide();
|
||||
jQuery('#contactWrapper_popup').append('<div class="success"><h4>Email Successfully Sent!</h4><br><p>Thank you for using our contact form <strong>'+name+'</strong>! Your email was successfully sent and we'll be in touch with you soon.</p></div>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sendRequest_news() {
|
||||
|
||||
var rnd = Math.random();
|
||||
if(document.getElementById("name_news") instanceof Object){
|
||||
var name = escape(document.getElementById("name_news").value);}
|
||||
else{
|
||||
var name ='noname';
|
||||
}
|
||||
var email = escape(document.getElementById("email_news").value);
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/newsletter.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse_news;
|
||||
|
||||
http.send('name_news='+name+'&email_news='+email+'&rnd_news='+rnd);
|
||||
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
finally{
|
||||
jQuery('#newsletterform').slideUp("slow").hide();
|
||||
jQuery('#newsletterform').parent().append('<div class="success"><h4>Subscription Successfully Sent!</h4><br><p>Your email: '+email+' has been registered.</p></div>');
|
||||
|
||||
}
|
||||
}
|
||||
function sendRequest_news_simple() {
|
||||
|
||||
var rnd = Math.random();
|
||||
|
||||
var email = escape(document.getElementById("email_news").value);
|
||||
|
||||
try{
|
||||
http.open('POST', 'php/newsletter.php');
|
||||
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
http.onreadystatechange = handleResponse_news;
|
||||
|
||||
http.send('email_news='+email+'&rnd_news='+rnd);
|
||||
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
finally{
|
||||
jQuery('#newsletterform').slideUp("slow").hide();
|
||||
jQuery('#newsletterform').parent().append('<div class="success"><h4>Subscription Successfully Sent!</h4><br><p>Your email: '+email+' has been registered.</p></div>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function validate_email(address) {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
if(reg.test(address) == false) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function validate_phone(phone){
|
||||
var reg = /^[\:\-\.\_\(\) 0-9]+$/
|
||||
if(reg.test(phone) == false) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
function check_values() {
|
||||
//Form
|
||||
var valid = '';
|
||||
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
var name = '';
|
||||
var email = '';
|
||||
var subject = '';
|
||||
var body = '';
|
||||
|
||||
if(typeof $j('#contactform #name').val() != "undefined" )
|
||||
{
|
||||
name = document.getElementById("name").value;
|
||||
}
|
||||
if(typeof $j('#contactform #email').val() != "undefined" )
|
||||
{
|
||||
email = document.getElementById("email").value;
|
||||
}
|
||||
if(typeof $j('#contactform #subject').val() != "undefined" )
|
||||
{
|
||||
subject = document.getElementById("subject").value;
|
||||
}
|
||||
if(typeof $j('#contactform #body').val() != "undefined" )
|
||||
{
|
||||
body = document.getElementById("body").value;
|
||||
}
|
||||
|
||||
|
||||
var errors=0;
|
||||
if($j('#contactform #name').val()!=undefined)
|
||||
if($j('#contactform #name').val()=='') {
|
||||
var hasClass=$j('#contactform #name').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #name').parent().append('<label for="contactname" generated="true" class="error">Please enter your name</label>');
|
||||
$j('#contactform #name').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #name').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform #email').val()!=undefined)
|
||||
if(validate_email($j('#contactform #email').val())==false ) {
|
||||
var hasClass=$j('#contactform #email').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #email').parent().append('<label for="contactname" generated="true" class="error">Please enter a valid email address</label>');
|
||||
$j('#contactform #email').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #email').parent().find(".error").remove();
|
||||
|
||||
|
||||
if($j('#contactform #subject').val()!=undefined)
|
||||
if($j('#contactform #subject').val()==''){
|
||||
var hasClass=$j('#contactform #subject').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #subject').parent().append('<label for="contactname" generated="true" class="error">You need to enter a subject!</label>');
|
||||
$j('#contactform #subject').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #subject').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform #body').val()!=undefined)
|
||||
if($j('#contactform #body').val()==''){
|
||||
var hasClass=$j('#contactform #body').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #body').parent().append('<label for="contactname" generated="true" class="error">You need to enter a message!</label>');
|
||||
$j('#contactform #body').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #body').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit").disabled=true;
|
||||
document.getElementById("submit").value='Please Wait..';
|
||||
sendRequest();
|
||||
}
|
||||
}
|
||||
function check_values_loans() {
|
||||
//Form
|
||||
var valid = '';
|
||||
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
var name = '';
|
||||
var subject = '';
|
||||
var name_s = '';
|
||||
|
||||
if(typeof $j('#contactform #name').val() != "undefined" )
|
||||
{
|
||||
name = document.getElementById("name").value;
|
||||
}
|
||||
if(typeof $j('#contactform #subject').val() != "undefined" )
|
||||
{
|
||||
subject = document.getElementById("subject").value;
|
||||
}
|
||||
if(typeof $j('#contactform #name_s').val() != "undefined" )
|
||||
{
|
||||
name_s = document.getElementById("name_s").value;
|
||||
}
|
||||
|
||||
|
||||
var errors=0;
|
||||
if($j('#contactform #name').val()!=undefined)
|
||||
if($j('#contactform #name').val()=='') {
|
||||
var hasClass=$j('#contactform #name').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #name').parent().append('<label for="contactname" generated="true" class="error">Please enter your first name</label>');
|
||||
$j('#contactform #name').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #name').parent().find(".error").remove();
|
||||
|
||||
|
||||
if($j('#contactform #subject').val()!=undefined)
|
||||
if($j('#contactform #subject').val()==''){
|
||||
var hasClass=$j('#contactform #subject').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #subject').parent().append('<label for="contactname" generated="true" class="error">You need to enter a subject!</label>');
|
||||
$j('#contactform #subject').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #subject').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform #name_s').val()!=undefined)
|
||||
if($j('#contactform #name_s').val()==''){
|
||||
var hasClass=$j('#contactform #name_s').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform #name_s').parent().append('<label for="contactname" generated="true" class="error">You need to enter your last name!</label>');
|
||||
$j('#contactform #name_s').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform #name_s').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit").disabled=true;
|
||||
document.getElementById("submit").value='Please Wait..';
|
||||
sendRequest_loans();
|
||||
}
|
||||
}
|
||||
|
||||
function check_values_booking() {
|
||||
//Form
|
||||
var valid = '';
|
||||
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
var name = '';
|
||||
var email = '';
|
||||
var body = '';
|
||||
|
||||
var surname = '';
|
||||
var arrival = '';
|
||||
var departure = '';
|
||||
var room = '';
|
||||
var adults = '';
|
||||
var children = '';
|
||||
var rooms = '';
|
||||
|
||||
|
||||
if(typeof $j('#contactform_booking #name').val() != "undefined" )
|
||||
{
|
||||
name = document.getElementById("name").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #email').val() != "undefined" )
|
||||
{
|
||||
email = document.getElementById("email").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #body').val() != "undefined" )
|
||||
{
|
||||
body = document.getElementById("body").value;
|
||||
}
|
||||
|
||||
if(typeof $j('#contactform_booking #surname').val() != "undefined" )
|
||||
{
|
||||
surname = document.getElementById("surname").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #arrival').val() != "undefined" )
|
||||
{
|
||||
arrival = document.getElementById("arrival").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #departure').val() != "undefined" )
|
||||
{
|
||||
departure = document.getElementById("departure").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #room').val() != "undefined" )
|
||||
{
|
||||
room = document.getElementById("room").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #adults').val() != "undefined" )
|
||||
{
|
||||
adults = document.getElementById("adults").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #children').val() != "undefined" )
|
||||
{
|
||||
children = document.getElementById("children").value;
|
||||
}
|
||||
if(typeof $j('#contactform_booking #rooms').val() != "undefined" )
|
||||
{
|
||||
rooms = document.getElementById("rooms").value;
|
||||
}
|
||||
|
||||
|
||||
var errors=0;
|
||||
if($j('#contactform_booking #name').val()!=undefined)
|
||||
if($j('#contactform_booking #name').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #name').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #name').parent().append('<label for="contactname" generated="true" class="error">Please enter your name</label>');
|
||||
$j('#contactform_booking #name').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #name').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform_booking #email').val()!=undefined)
|
||||
if(validate_email($j('#contactform_booking #email').val())==false ) {
|
||||
var hasClass=$j('#contactform_booking #email').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #email').parent().append('<label for="contactname" generated="true" class="error">Please enter a valid email address</label>');
|
||||
$j('#contactform_booking #email').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #email').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($j('#contactform_booking #surname').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #surname').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #surname').parent().append('<label for="contactname" generated="true" class="error">Please enter your surname</label>');
|
||||
$j('#contactform_booking #surname').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #surname').parent().find(".error").remove();
|
||||
if($j('#contactform_booking #arrival').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #arrival').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #arrival').parent().append('<label for="contactname" generated="true" class="error">Please enter arrival date</label>');
|
||||
$j('#contactform_booking #arrival').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #arrival').parent().find(".error").remove();
|
||||
if($j('#contactform_booking #departure').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #departure').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #departure').parent().append('<label for="contactname" generated="true" class="error">Please enter departure date</label>');
|
||||
$j('#contactform_booking #departure').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #departure').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform_booking #room').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #room').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #room').parent().append('<label for="contactname" generated="true" class="error">Please enter your room nr</label>');
|
||||
$j('#contactform_booking #room').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #room').parent().find(".error").remove();
|
||||
if($j('#contactform_booking #adults').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #adults').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #adults').parent().append('<label for="contactname" generated="true" class="error">Please enter adults nr</label>');
|
||||
$j('#contactform_booking #adults').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #adults').parent().find(".error").remove();
|
||||
if($j('#contactform_booking #children').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #children').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #children').parent().append('<label for="contactname" generated="true" class="error">Please enter children nr</label>');
|
||||
$j('#contactform_booking #children').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #children').parent().find(".error").remove();
|
||||
if($j('#contactform_booking #rooms').val()=='') {
|
||||
var hasClass=$j('#contactform_booking #rooms').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #rooms').parent().append('<label for="contactname" generated="true" class="error">Please enter rooms nr</label>');
|
||||
$j('#contactform_booking #rooms').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #rooms').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($j('#contactform_booking #body').val()!=undefined)
|
||||
if($j('#contactform_booking #body').val()==''){
|
||||
var hasClass=$j('#contactform_booking #body').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_booking #body').parent().append('<label for="contactname" generated="true" class="error">You need to enter a message!</label>');
|
||||
$j('#contactform_booking #body').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_booking #body').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit").disabled=true;
|
||||
document.getElementById("submit").value='Please Wait..';
|
||||
sendRequest_booking();
|
||||
}
|
||||
}
|
||||
|
||||
function check_values_popup() {
|
||||
//Form
|
||||
var valid = '';
|
||||
|
||||
|
||||
var $j = jQuery.noConflict();
|
||||
var name = document.getElementById("name_popup").value;
|
||||
var email = document.getElementById("email_popup").value;
|
||||
var subject = document.getElementById("subject_popup").value;
|
||||
var body = document.getElementById("body_popup").value;
|
||||
|
||||
var errors=0;
|
||||
if($j('#contactform_popup #name_popup').val()!=undefined)
|
||||
if($j('#contactform_popup #name_popup').val()=='') {
|
||||
var hasClass=$j('#contactform_popup #name_popup').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_popup #name_popup').parent().append('<label for="contactname" generated="true" class="error">Please enter your name</label>');
|
||||
$j('#contactform_popup #name_popup').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_popup #name_popup').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform_popup #email_popup').val()!=undefined)
|
||||
if(validate_email($j('#contactform_popup #email_popup').val())==false ) {
|
||||
var hasClass=$j('#contactform_popup #email_popup').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_popup #email_popup').parent().append('<label for="contactname" generated="true" class="error">Please enter a valid email address</label>');
|
||||
$j('#contactform_popup #email_popup').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_popup #email_popup').parent().find(".error").remove();
|
||||
|
||||
|
||||
if($j('#contactform_popup #subject').val()!=undefined)
|
||||
if($j('#contactform_popup #subject_popup').val()==''){
|
||||
var hasClass=$j('#contactform_popup #subject_popup').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_popup #subject_popup').parent().append('<label for="contactname" generated="true" class="error">You need to enter a subject!</label>');
|
||||
$j('#contactform_popup #subject_popup').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_popup #subject_popup').parent().find(".error").remove();
|
||||
|
||||
if($j('#contactform_popup #body_popup').val()!=undefined)
|
||||
if($j('#contactform_popup #body_popup').val()==''){
|
||||
var hasClass=$j('#contactform_popup #body_popup').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#contactform_popup #body_popup').parent().append('<label for="contactname" generated="true" class="error">You need to enter a message!</label>');
|
||||
$j('#contactform_popup #body_popup').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#contactform_popup #body_popup').parent().find(".error").remove();
|
||||
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit_popup").disabled=true;
|
||||
document.getElementById("submit_popup").value='Please Wait..';
|
||||
sendRequest_popup();
|
||||
}
|
||||
}
|
||||
|
||||
function check_values_news() {
|
||||
//Form
|
||||
var valid = '';
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
var name = '';
|
||||
var email = '';
|
||||
|
||||
if(typeof $j('#newsletterform #name_news').val() != "undefined" )
|
||||
{
|
||||
name = document.getElementById("name_news").value;
|
||||
}
|
||||
if(typeof $j('#newsletterform #email_news').val() != "undefined" )
|
||||
{
|
||||
email = document.getElementById("email_news").value;
|
||||
}
|
||||
|
||||
var errors=0;
|
||||
|
||||
if($j('#newsletterform #name_news').val()!=undefined)
|
||||
if($j('#newsletterform #name_news').val()=='') {
|
||||
var hasClass=$j('#newsletterform #name_news').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#newsletterform #name_news').parent().append('<label for="contactname" generated="true" class="error">Please enter your name</label>');
|
||||
$j('#newsletterform #name_news').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#newsletterform #name_news').parent().find(".error").remove();
|
||||
|
||||
if($j('#newsletterform #email_news').val()!=undefined)
|
||||
if(validate_email($j('#newsletterform #email_news').val())==false ) {
|
||||
var hasClass=$j('#newsletterform #email_news').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#newsletterform #email_news').parent().append('<label for="contactname" generated="true" class="error">Please enter a valid email address</label>');
|
||||
$j('#newsletterform #email_news').focus();
|
||||
//return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#newsletterform #email_news').parent().find(".error").remove();
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit").disabled=true;
|
||||
document.getElementById("submit").value='Please Wait..';
|
||||
sendRequest_news();
|
||||
}
|
||||
}
|
||||
|
||||
function check_values_news_simple() {
|
||||
console.log("dsa");
|
||||
//Form
|
||||
var valid = '';
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
|
||||
var email = '';
|
||||
|
||||
|
||||
if(typeof $j('#newsletterform #email_news').val() != "undefined" )
|
||||
{
|
||||
email = document.getElementById("email_news").value;
|
||||
}
|
||||
|
||||
var errors=0;
|
||||
|
||||
if($j('#newsletterform #email_news').val()!=undefined)
|
||||
if(validate_email($j('#newsletterform #email_news').val())==false ) {
|
||||
var hasClass=$j('#newsletterform #email_news').parent().find(".error").hasClass("error");
|
||||
if(!hasClass)
|
||||
$j('#newsletterform #email_news').parent().append('<label for="contactname" generated="true" class="error">Please enter a valid email address</label>');
|
||||
$j('#newsletterform #email_news').focus();
|
||||
return false;
|
||||
errors++;
|
||||
}
|
||||
else
|
||||
$j('#newsletterform #email_news').parent().find(".error").remove();
|
||||
|
||||
|
||||
if(errors==0) {
|
||||
document.getElementById("submit").disabled=true;
|
||||
document.getElementById("submit").value='Please Wait..';
|
||||
sendRequest_news_simple();
|
||||
}
|
||||
}
|
||||
function handleResponse() {
|
||||
try{
|
||||
if((http.readyState == 4)&&(http.status == 200)){
|
||||
var response = http.responseText;
|
||||
document.getElementById("confirmation").innerHTML = response;
|
||||
document.getElementById("confirmation").style.display ="";
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
finally{}
|
||||
}
|
||||
function handleResponse_popup() {
|
||||
try{
|
||||
if((http.readyState == 4)&&(http.status == 200)){
|
||||
var response = http.responseText;
|
||||
document.getElementById("confirmation_popup").innerHTML = response;
|
||||
document.getElementById("confirmation_popup").style.display ="";
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
finally{}
|
||||
}
|
||||
|
||||
function handleResponse_news() {
|
||||
try{
|
||||
if((http.readyState == 4)&&(http.status == 200)){
|
||||
var response = http.responseText;
|
||||
document.getElementById("confirmation").innerHTML = response;
|
||||
document.getElementById("confirmation").style.display ="";
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
finally{}
|
||||
}
|
||||
|
||||
function isUndefined(a) {
|
||||
return typeof a == 'undefined';
|
||||
}
|
||||
|
||||
function trim(a) {
|
||||
return a.replace(/^s*(S*(s+S+)*)s*$/, "$1");
|
||||
}
|
||||
|
||||
function isEmail(a) {
|
||||
return (a.indexOf(".") > 0) && (a.indexOf("@") > 0);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Vendored
+4
File diff suppressed because one or more lines are too long
+114
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.jplayer.org
|
||||
*
|
||||
* Copyright (c) 2009 - 2013 Happyworm Ltd
|
||||
* Licensed under the MIT license.
|
||||
* http://opensource.org/licenses/MIT
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Version: 2.5.0
|
||||
* Date: 7th November 2013
|
||||
*/
|
||||
|
||||
(function(b,f){"function"===typeof define&&define.amd?define(["jquery"],f):b.jQuery?f(b.jQuery):f(b.Zepto)})(this,function(b,f){b.fn.jPlayer=function(a){var c="string"===typeof a,d=Array.prototype.slice.call(arguments,1),e=this;a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&"_"===a.charAt(0))return e;c?this.each(function(){var c=b(this).data("jPlayer"),h=c&&b.isFunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b(this).data("jPlayer");c?c.option(a||
|
||||
{}):b(this).data("jPlayer",new b.jPlayer(a,this))});return e};b.jPlayer=function(a,c){if(arguments.length){this.element=b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};"function"!==typeof b.fn.stop&&(b.fn.stop=function(){});b.jPlayer.emulateMethods="load play pause";b.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";b.jPlayer.emulateOptions="muted volume";b.jPlayer.reservedEvent=
|
||||
"ready flashreset resize repeat error warning";b.jPlayer.event={};b.each("ready flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange".split(" "),function(){b.jPlayer.event[this]="jPlayer_"+this});b.jPlayer.htmlEvent="loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough".split(" ");b.jPlayer.pause=
|
||||
function(){b.each(b.jPlayer.prototype.instances,function(a,c){c.data("jPlayer").status.srcSet&&c.jPlayer("pause")})};b.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var m=function(){this.init()};m.prototype={init:function(){this.options={timeFormat:b.jPlayer.timeFormat}},time:function(a){var c=new Date(1E3*(a&&"number"===typeof a?a:0)),b=c.getUTCHours();a=this.options.timeFormat.showHour?c.getUTCMinutes():c.getUTCMinutes()+60*
|
||||
b;c=this.options.timeFormat.showMin?c.getUTCSeconds():c.getUTCSeconds()+60*a;b=this.options.timeFormat.padHour&&10>b?"0"+b:b;a=this.options.timeFormat.padMin&&10>a?"0"+a:a;c=this.options.timeFormat.padSec&&10>c?"0"+c:c;b=""+(this.options.timeFormat.showHour?b+this.options.timeFormat.sepHour:"");b+=this.options.timeFormat.showMin?a+this.options.timeFormat.sepMin:"";return b+=this.options.timeFormat.showSec?c+this.options.timeFormat.sepSec:""}};var n=new m;b.jPlayer.convertTime=function(a){return n.time(a)};
|
||||
b.jPlayer.uaBrowser=function(a){a=a.toLowerCase();var c=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||c.exec(a)||b.exec(a)||0>a.indexOf("compatible")&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jPlayer.uaPlatform=function(a){var c=a.toLowerCase(),b=/(android)/,e=/(mobile)/;a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(c)||[];c=/(ipad|playbook)/.exec(c)||!e.exec(c)&&b.exec(c)||
|
||||
[];a[1]&&(a[1]=a[1].replace(/\s/g,"_"));return{platform:a[1]||"",tablet:c[1]||""}};b.jPlayer.browser={};b.jPlayer.platform={};var k=b.jPlayer.uaBrowser(navigator.userAgent);k.browser&&(b.jPlayer.browser[k.browser]=!0,b.jPlayer.browser.version=k.version);k=b.jPlayer.uaPlatform(navigator.userAgent);k.platform&&(b.jPlayer.platform[k.platform]=!0,b.jPlayer.platform.mobile=!k.tablet,b.jPlayer.platform.tablet=!!k.tablet);b.jPlayer.getDocMode=function(){var a;b.jPlayer.browser.msie&&(document.documentMode?
|
||||
a=document.documentMode:(a=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(a=7)));return a};b.jPlayer.browser.documentMode=b.jPlayer.getDocMode();b.jPlayer.nativeFeatures={init:function(){var a=document,c=a.createElement("video"),b={w3c:"fullscreenEnabled fullscreenElement requestFullscreen exitFullscreen fullscreenchange fullscreenerror".split(" "),moz:"mozFullScreenEnabled mozFullScreenElement mozRequestFullScreen mozCancelFullScreen mozfullscreenchange mozfullscreenerror".split(" "),
|
||||
webkit:" webkitCurrentFullScreenElement webkitRequestFullScreen webkitCancelFullScreen webkitfullscreenchange ".split(" "),webkitVideo:"webkitSupportsFullscreen webkitDisplayingFullscreen webkitEnterFullscreen webkitExitFullscreen ".split(" ")},e=["w3c","moz","webkit","webkitVideo"],g,h;this.fullscreen=c={support:{w3c:!!a[b.w3c[0]],moz:!!a[b.moz[0]],webkit:"function"===typeof a[b.webkit[3]],webkitVideo:"function"===typeof c[b.webkitVideo[2]]},used:{}};g=0;for(h=e.length;g<h;g++){var f=e[g];if(c.support[f]){c.spec=
|
||||
f;c.used[f]=!0;break}}if(c.spec){var l=b[c.spec];c.api={fullscreenEnabled:!0,fullscreenElement:function(c){c=c?c:a;return c[l[1]]},requestFullscreen:function(a){return a[l[2]]()},exitFullscreen:function(c){c=c?c:a;return c[l[3]]()}};c.event={fullscreenchange:l[4],fullscreenerror:l[5]}}else c.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},c.event={}}};b.jPlayer.nativeFeatures.init();b.jPlayer.focus=null;b.jPlayer.keyIgnoreElementNames=
|
||||
"INPUT TEXTAREA";var p=function(a){var c=b.jPlayer.focus,d;c&&(b.each(b.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(c,b){if(a.target.nodeName.toUpperCase()===b.toUpperCase())return d=!0,!1}),d||b.each(c.options.keyBindings,function(d,g){if(g&&a.which===g.key&&b.isFunction(g.fn))return a.preventDefault(),g.fn(c),!1}))};b.jPlayer.keys=function(a){b(document.documentElement).unbind("keydown.jPlayer");a&&b(document.documentElement).bind("keydown.jPlayer",p)};b.jPlayer.keys(!0);b.jPlayer.prototype=
|
||||
{count:0,version:{script:"2.5.0",needFlash:"2.5.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:"metadata",volume:0.8,muted:!1,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:0.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",
|
||||
volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1E3},loop:!1,repeat:function(a){a.jPlayer.options.loop?
|
||||
b(this).unbind(".jPlayerRepeat").bind(b.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){b(this).jPlayer("play")}):b(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,
|
||||
android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:32,fn:function(a){a.status.paused?a.play():a.pause()}},fullScreen:{key:13,fn:function(a){(a.status.video||a.options.audioFullScreen)&&a._setOption("fullScreen",!a.options.fullScreen)}},muted:{key:8,fn:function(a){a._muted(!a.options.muted)}},volumeUp:{key:38,fn:function(a){a.volume(a.options.volume+
|
||||
0.1)}},volumeDown:{key:40,fn:function(a){a.volume(a.options.volume-0.1)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",
|
||||
media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,flash:!0},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',
|
||||
flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
|
||||
flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var a=
|
||||
this;this.element.empty();this.status=b.extend({},this.status);this.internal=b.extend({},this.internal);this.options.timeFormat=b.extend({},b.jPlayer.timeFormat,this.options.timeFormat);this.internal.cmdsIgnored=b.jPlayer.platform.ipad||b.jPlayer.platform.iphone||b.jPlayer.platform.ipod;this.internal.domNode=this.element.get(0);this.options.keyEnabled&&!b.jPlayer.focus&&(b.jPlayer.focus=this);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video=
|
||||
{};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=[];this.options.volume=this._limitValue(this.options.volume,0,1);b.each(this.options.supplied.toLowerCase().split(","),function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.format[e]){var f=!1;b.each(a.formats,function(a,c){if(e===c)return f=!0,!1});f||a.formats.push(e)}});b.each(this.options.solution.toLowerCase().split(","),function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.solution[e]){var f=!1;b.each(a.solutions,function(a,
|
||||
c){if(e===c)return f=!0,!1});f||a.solutions.push(e)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=b.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=b.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:f});this.internal.video=b.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:f});this.internal.flash=
|
||||
b.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:f,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"Jplayer.swf":"")});this.internal.poster=b.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:f});b.each(b.jPlayer.event,function(c,b){a.options[c]!==f&&(a.element.bind(b+".jPlayer",a.options[c]),a.options[c]=f)});this.require.audio=!1;this.require.video=!1;b.each(this.formats,function(c,
|
||||
b){a.require[a.format[b].media]=!0});this.options=this.require.video?b.extend(!0,{},this.optionsVideo,this.options):b.extend(!0,{},this.optionsAudio,this.options);this._setSize();this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this.status.noVolume=this._uaBlocklist(this.options.noVolume);b.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners();this._restrictNativeVideoControls();
|
||||
this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){a.status.video&&!a.status.waitForPlay||a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=b("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.internal.poster.jq.bind("click.jPlayer",function(){a._trigger(b.jPlayer.event.click)});
|
||||
this.html.audio.available=!1;this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio));this.html.video.available=!1;this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video));
|
||||
this.flash.available=this._checkForFlash(10.1);this.html.canPlay={};this.flash.canPlay={};b.each(this.formats,function(c,b){a.html.canPlay[b]=a.html[a.format[b].media].available&&""!==a.htmlElement[a.format[b].media].canPlayType(a.format[b].codec);a.flash.canPlay[b]=a.format[b].flashCanPlay&&a.flash.available});this.html.desired=!1;this.flash.desired=!1;b.each(this.solutions,function(c,d){if(0===c)a[d].desired=!0;else{var e=!1,f=!1;b.each(a.formats,function(c,b){a[a.solutions[0]].canPlay[b]&&("video"===
|
||||
a.format[b].media?f=!0:e=!0)});a[d].desired=a.require.audio&&!e||a.require.video&&!f}});this.html.support={};this.flash.support={};b.each(this.formats,function(c,b){a.html.support[b]=a.html.canPlay[b]&&a.html.desired;a.flash.support[b]=a.flash.canPlay[b]&&a.flash.desired});this.html.used=!1;this.flash.used=!1;b.each(this.solutions,function(c,d){b.each(a.formats,function(c,b){if(a[d].support[b])return a[d].used=!0,!1})});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);
|
||||
this.html.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:b.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:b.jPlayer.errorMsg.NO_SOLUTION,hint:b.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show());if(this.flash.used){var c,d="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+
|
||||
"&muted="+this.options.muted;if(b.jPlayer.browser.msie&&(9>Number(b.jPlayer.browser.version)||9>b.jPlayer.browser.documentMode)){d=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+d+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];c=document.createElement('<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>');
|
||||
for(var e=0;e<d.length;e++)c.appendChild(document.createElement(d[e]))}else e=function(a,c,b){var d=document.createElement("param");d.setAttribute("name",c);d.setAttribute("value",b);a.appendChild(d)},c=document.createElement("object"),c.setAttribute("id",this.internal.flash.id),c.setAttribute("name",this.internal.flash.id),c.setAttribute("data",this.internal.flash.swf),c.setAttribute("type","application/x-shockwave-flash"),c.setAttribute("width","1"),c.setAttribute("height","1"),c.setAttribute("tabindex",
|
||||
"-1"),e(c,"flashvars",d),e(c,"allowscriptaccess","always"),e(c,"bgcolor",this.options.backgroundColor),e(c,"wmode",this.options.wmode);this.element.append(c);this.internal.flash.jq=b(c)}this.status.playbackRateEnabled=this.html.used&&!this.flash.used?this._testPlaybackRate("audio"):!1;this._updatePlaybackRate();this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=b("#"+this.internal.audio.id)),
|
||||
this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=b("#"+this.internal.video.id),this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):this.internal.video.jq.css({width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){a._trigger(b.jPlayer.event.click)})));this.options.emulateHtml&&this._emulateHtmlBridge();
|
||||
this.html.used&&!this.flash.used&&setTimeout(function(){a.internal.ready=!0;a.version.flash="n/a";a._trigger(b.jPlayer.event.repeat);a._trigger(b.jPlayer.event.ready)},100);this._updateNativeVideoControls();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();b.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");b.each(this.css.jq,function(a,
|
||||
c){c.length&&c.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");this._fullscreenRemoveEventListeners();this===b.jPlayer.focus&&(b.jPlayer.focus=null);this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},enable:function(){},disable:function(){},_testCanPlayType:function(a){try{return a.canPlayType(this.format.mp3.codec),
|
||||
!0}catch(c){return!1}},_testPlaybackRate:function(a){a=document.createElement("string"===typeof a?a:"audio");try{return"playbackRate"in a?(a.playbackRate=0.5,0.5===a.playbackRate):!1}catch(c){return!1}},_uaBlocklist:function(a){var c=navigator.userAgent.toLowerCase(),d=!1;b.each(a,function(a,b){if(b&&b.test(c))return d=!0,!1});return d},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&
|
||||
this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(a,c){var d=this;a.preload=this.options.preload;a.muted=this.options.muted;
|
||||
a.volume=this.options.volume;this.status.playbackRateEnabled&&(a.defaultPlaybackRate=this.options.defaultPlaybackRate,a.playbackRate=this.options.playbackRate);a.addEventListener("progress",function(){c.gate&&(d.internal.cmdsIgnored&&0<this.readyState&&(d.internal.cmdsIgnored=!1),d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.progress))},!1);a.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.timeupdate))},!1);
|
||||
a.addEventListener("durationchange",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.durationchange))},!1);a.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(b.jPlayer.event.play))},!1);a.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(b.jPlayer.event.playing))},!1);a.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(b.jPlayer.event.pause))},
|
||||
!1);a.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.waiting))},!1);a.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.seeking))},!1);a.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.seeked))},!1);a.addEventListener("volumechange",function(){c.gate&&(d.options.volume=a.volume,d.options.muted=a.muted,d._updateMute(),d._updateVolume(),d._trigger(b.jPlayer.event.volumechange))},!1);a.addEventListener("ratechange",
|
||||
function(){c.gate&&(d.options.defaultPlaybackRate=a.defaultPlaybackRate,d.options.playbackRate=a.playbackRate,d._updatePlaybackRate(),d._trigger(b.jPlayer.event.ratechange))},!1);a.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.suspend))},!1);a.addEventListener("ended",function(){c.gate&&(b.jPlayer.browser.webkit||(d.htmlElement.media.currentTime=0),d.htmlElement.media.pause(),d._updateButtons(!1),d._getHtmlStatus(a,!0),d._updateInterface(),d._trigger(b.jPlayer.event.ended))},
|
||||
!1);a.addEventListener("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:b.jPlayer.error.URL,context:d.status.src,message:b.jPlayer.errorMsg.URL,
|
||||
hint:b.jPlayer.errorHint.URL})))},!1);b.each(b.jPlayer.htmlEvent,function(e,g){a.addEventListener(this,function(){c.gate&&d._trigger(b.jPlayer.event[g])},!1)})},_getHtmlStatus:function(a,c){var b=0,e=0,g=0,f=0;isFinite(a.duration)&&(this.status.duration=a.duration);b=a.currentTime;e=0<this.status.duration?100*b/this.status.duration:0;"object"===typeof a.seekable&&0<a.seekable.length?(g=0<this.status.duration?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=0<this.status.duration?
|
||||
100*a.currentTime/a.seekable.end(a.seekable.length-1):0):(g=100,f=e);c&&(e=f=b=0);this.status.seekPercent=g;this.status.currentPercentRelative=f;this.status.currentPercentAbsolute=e;this.status.currentTime=b;this.status.videoWidth=a.videoWidth;this.status.videoHeight=a.videoHeight;this.status.readyState=a.readyState;this.status.networkState=a.networkState;this.status.playbackRate=a.playbackRate;this.status.ended=a.ended},_resetStatus:function(){this.status=b.extend({},this.status,b.jPlayer.prototype.status)},
|
||||
_trigger:function(a,c,d){a=b.Event(a);a.jPlayer={};a.jPlayer.version=b.extend({},this.version);a.jPlayer.options=b.extend(!0,{},this.options);a.jPlayer.status=b.extend(!0,{},this.status);a.jPlayer.html=b.extend(!0,{},this.html);a.jPlayer.flash=b.extend(!0,{},this.flash);c&&(a.jPlayer.error=b.extend({},c));d&&(a.jPlayer.warning=b.extend({},d));this.element.trigger(a)},jPlayerFlashEvent:function(a,c){if(a===b.jPlayer.event.ready)if(!this.internal.ready)this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",
|
||||
height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:b.jPlayer.error.VERSION,context:this.version.flash,message:b.jPlayer.errorMsg.VERSION+this.version.flash,hint:b.jPlayer.errorHint.VERSION}),this._trigger(b.jPlayer.event.repeat),this._trigger(a);else if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);0<d&&(e?this.pause(d):this.play(d))}this._trigger(b.jPlayer.event.flashreset)}if(this.flash.gate)switch(a){case b.jPlayer.event.progress:this._getFlashStatus(c);
|
||||
this._updateInterface();this._trigger(a);break;case b.jPlayer.event.timeupdate:this._getFlashStatus(c);this._updateInterface();this._trigger(a);break;case b.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(a);break;case b.jPlayer.event.pause:this._updateButtons(!1);this._trigger(a);break;case b.jPlayer.event.ended:this._updateButtons(!1);this._trigger(a);break;case b.jPlayer.event.click:this._trigger(a);break;case b.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=
|
||||
!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:b.jPlayer.error.URL,context:c.src,message:b.jPlayer.errorMsg.URL,hint:b.jPlayer.errorHint.URL});break;case b.jPlayer.event.seeking:this._seeking();
|
||||
this._trigger(a);break;case b.jPlayer.event.seeked:this._seeked();this._trigger(a);break;case b.jPlayer.event.ready:break;default:this._trigger(a)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration;this.status.videoWidth=a.videoWidth;this.status.videoHeight=a.videoHeight;this.status.readyState=
|
||||
4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(a){a===f?a=!this.status.paused:this.status.paused=!a;this.css.jq.play.length&&this.css.jq.pause.length&&(a?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide()));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),
|
||||
this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+
|
||||
"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));this.css.jq.currentTime.length&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime));this.css.jq.duration.length&&this.css.jq.duration.text(this._convertTime(this.status.duration))},_convertTime:m.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},
|
||||
_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.flash.active=!1},_escapeHtml:function(a){return a.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")},_qualifyURL:function(a){var c=document.createElement("div");c.innerHTML='<a href="'+this._escapeHtml(a)+'">x</a>';return c.firstChild.href},_absoluteMediaUrls:function(a){var c=this;b.each(a,function(b,e){c.format[b]&&
|
||||
(a[b]=c._qualifyURL(e))});return a},setMedia:function(a){var c=this,d=!1,e=this.status.media.poster!==a.poster;this._resetMedia();this._resetGate();this._resetActive();a=this._absoluteMediaUrls(a);b.each(this.formats,function(e,f){var k="video"===c.format[f].media;b.each(c.solutions,function(b,e){if(c[e].support[f]&&c._validString(a[f])){var g="html"===e;k?(g?(c.html.video.gate=!0,c._html_setVideo(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setVideo(a),c.flash.active=!0),c.css.jq.videoPlay.length&&
|
||||
c.css.jq.videoPlay.show(),c.status.video=!0):(g?(c.html.audio.gate=!0,c._html_setAudio(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setAudio(a),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1);d=!0;return!1}});if(d)return!1});d?(this.status.nativeVideoControls&&this.html.video.gate||!this._validString(a.poster)||(e?this.htmlElement.poster.src=a.poster:this.internal.poster.jq.show()),this.status.srcSet=!0,this.status.media=b.extend({},a),this._updateButtons(!1),
|
||||
this._updateInterface()):this._error({type:b.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:b.jPlayer.errorMsg.NO_SUPPORT,hint:b.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia();
|
||||
this.html.active?this._html_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(b.jPlayer.focus=this)},play:function(a){a="number"===typeof a?a:NaN;this.status.srcSet?(this.focus(),this.html.active?this._html_play(a):this.flash.active&&this._flash_play(a)):this._urlNotSetError("play")},
|
||||
videoPlay:function(){this.play()},pause:function(a){a="number"===typeof a?a:NaN;this.status.srcSet?this.html.active?this._html_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},tellOthers:function(a,c){var d=this,e="function"===typeof c,g=Array.prototype.slice.call(arguments);"string"===typeof a&&(e&&g.splice(1,1),b.each(this.instances,function(){d.element!==this&&(e&&!c.call(this.data("jPlayer"),d)||this.jPlayer.apply(this,g))}))},pauseOthers:function(a){this.tellOthers("pause",
|
||||
function(){return this.status.srcSet},a)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);this.status.srcSet?this.html.active?this._html_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.mutedWorker(a);this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},
|
||||
a)},mutedWorker:function(a){this.options.muted=a;this.html.used&&this._html_setProperty("muted",a);this.flash.used&&this._flash_mute(a);this.html.video.gate||this.html.audio.gate||(this._updateMute(a),this._updateVolume(this.options.volume),this._trigger(b.jPlayer.event.volumechange))},mute:function(a){a=a===f?!0:!!a;this._muted(a)},unmute:function(a){a=a===f?!0:!!a;this._muted(!a)},_updateMute:function(a){a===f&&(a=this.options.muted);this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?
|
||||
(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){this.volumeWorker(a);this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},a)},volumeWorker:function(a){a=this._limitValue(a,0,1);this.options.volume=a;this.html.used&&this._html_setProperty("volume",a);this.flash.used&&this._flash_volume(a);this.html.video.gate||this.html.audio.gate||
|
||||
(this._updateVolume(a),this._trigger(b.jPlayer.event.volumechange))},volumeBar:function(a){if(this.css.jq.volumeBar.length){var c=b(a.currentTarget),d=c.offset(),e=a.pageX-d.left,g=c.width();a=c.height()-a.pageY+d.top;c=c.height();this.options.verticalVolume?this.volume(a/c):this.volume(e/g)}this.options.muted&&this._muted(!1)},volumeBarValue:function(){},_updateVolume:function(a){a===f&&(a=this.options.volume);a=this.options.muted?0:a;this.status.noVolume?(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),
|
||||
this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*a+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(a){var c=
|
||||
this;this.options.cssSelectorAncestor=a;this._removeUiClass();this.ancestorJq=a?b(a):[];a&&1!==this.ancestorJq.length&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();b.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();
|
||||
this._updateMute()},_cssSelector:function(a,c){var d=this;"string"===typeof c?b.jPlayer.prototype.options.cssSelector[a]?(this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer"),this.options.cssSelector[a]=c,this.css.cs[a]=this.options.cssSelectorAncestor+" "+c,this.css.jq[a]=c?b(this.css.cs[a]):[],this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(c){c.preventDefault();d[a](c);b(this).blur()}),c&&1!==this.css.jq[a].length&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,
|
||||
context:this.css.cs[a],message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:b.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:b.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:b.jPlayer.warningHint.CSS_SELECTOR_STRING})},
|
||||
seekBar:function(a){if(this.css.jq.seekBar.length){var c=b(a.currentTarget),d=c.offset();a=a.pageX-d.left;c=c.width();this.playHead(100*a/c)}},playBar:function(){},playbackRate:function(a){this._setOption("playbackRate",a)},playbackRateBar:function(a){if(this.css.jq.playbackRateBar.length){var c=b(a.currentTarget),d=c.offset(),e=a.pageX-d.left,g=c.width();a=c.height()-a.pageY+d.top;c=c.height();this.playbackRate((this.options.verticalPlaybackRate?a/c:e/g)*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+
|
||||
this.options.minPlaybackRate)}},playbackRateBarValue:function(){},_updatePlaybackRate:function(){var a=(this.options.playbackRate-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*a+"%"))):
|
||||
(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(){this._loop(!0)},repeatOff:function(){this._loop(!1)},_loop:function(a){this.options.loop!==a&&(this.options.loop=a,this._updateButtons(),this._trigger(b.jPlayer.event.repeat))},currentTime:function(){},duration:function(){},gui:function(){},noSolution:function(){},option:function(a,c){var d=a;if(0===arguments.length)return b.extend(!0,
|
||||
{},this.options);if("string"===typeof a){var e=a.split(".");if(c===f){for(var d=b.extend(!0,{},this.options),g=0;g<e.length;g++)if(d[e[g]]!==f)d=d[e[g]];else return this._warning({type:b.jPlayer.warning.OPTION_KEY,context:a,message:b.jPlayer.warningMsg.OPTION_KEY,hint:b.jPlayer.warningHint.OPTION_KEY}),f;return d}for(var g=d={},h=0;h<e.length;h++)h<e.length-1?(g[e[h]]={},g=g[e[h]]):g[e[h]]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(a,b){c._setOption(a,
|
||||
b)});return this},_setOption:function(a,c){var d=this;switch(a){case "volume":this.volume(c);break;case "muted":this._muted(c);break;case "globalVolume":this.options[a]=c;break;case "cssSelectorAncestor":this._cssSelectorAncestor(c);break;case "cssSelector":b.each(c,function(a,c){d._cssSelector(a,c)});break;case "playbackRate":this.options[a]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("playbackRate",c);this._updatePlaybackRate();
|
||||
break;case "defaultPlaybackRate":this.options[a]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("defaultPlaybackRate",c);this._updatePlaybackRate();break;case "minPlaybackRate":this.options[a]=c=this._limitValue(c,0.1,this.options.maxPlaybackRate-0.1);this._updatePlaybackRate();break;case "maxPlaybackRate":this.options[a]=c=this._limitValue(c,this.options.minPlaybackRate+0.1,16);this._updatePlaybackRate();break;case "fullScreen":if(this.options[a]!==
|
||||
c){var e=b.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;if(!e||e&&!this.status.waitForPlay)e||(this.options[a]=c),c?this._requestFullscreen():this._exitFullscreen(),e||this._setOption("fullWindow",c)}break;case "fullWindow":this.options[a]!==c&&(this._removeUiClass(),this.options[a]=c,this._refreshSize());break;case "size":this.options.fullWindow||this.options[a].cssClass===c.cssClass||this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "sizeFull":this.options.fullWindow&&
|
||||
this.options[a].cssClass!==c.cssClass&&this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "autohide":this.options[a]=b.extend({},this.options[a],c);this._updateAutohide();break;case "loop":this._loop(c);break;case "nativeVideoControls":this.options[a]=b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case "noFullWindow":this.options[a]=
|
||||
b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case "noVolume":this.options[a]=b.extend({},this.options[a],c);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case "emulateHtml":this.options[a]!==c&&((this.options[a]=c)?this._emulateHtmlBridge():
|
||||
this._destroyHtmlBridge());break;case "timeFormat":this.options[a]=b.extend({},this.options[a],c);break;case "keyEnabled":this.options[a]=c;c||this!==b.jPlayer.focus||(b.jPlayer.focus=null);break;case "keyBindings":this.options[a]=b.extend(!0,{},this.options[a],c);break;case "audioFullScreen":this.options[a]=c}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(b.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?
|
||||
(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},
|
||||
_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var a=this,
|
||||
c=function(){a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId);a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),this.element.unbind(".jPlayerAutohide"),this.css.jq.gui.unbind(".jPlayerAutohide"),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||
|
||||
!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind("mousemove.jPlayer.jPlayerAutohide",c),this.css.jq.gui.bind("mousemove.jPlayer.jPlayerAutohide",c),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(){this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var a=this,c=b.jPlayer.nativeFeatures.fullscreen;c.api.fullscreenEnabled&&c.event.fullscreenchange&&("function"!==typeof this.internal.fullscreenchangeHandler&&
|
||||
(this.internal.fullscreenchangeHandler=function(){a._fullscreenchange()}),document.addEventListener(c.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var a=b.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.addEventListener(a.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!b.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&
|
||||
this._setOption("fullScreen",!1)},_requestFullscreen:function(){var a=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],c=b.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(a=this.htmlElement.video);c.api.fullscreenEnabled&&c.api.requestFullscreen(a)},_exitFullscreen:function(){var a=b.jPlayer.nativeFeatures.fullscreen,c;a.used.webkitVideo&&(c=this.htmlElement.video);a.api.fullscreenEnabled&&a.api.exitFullscreen(c)},_html_initMedia:function(a){var c=b(this.htmlElement.media).empty();
|
||||
b.each(a.track||[],function(a,b){var g=document.createElement("track");g.setAttribute("kind",b.kind?b.kind:"");g.setAttribute("src",b.src?b.src:"");g.setAttribute("srclang",b.srclang?b.srclang:"");g.setAttribute("label",b.label?b.label:"");b.def&&g.setAttribute("default",b.def);c.append(g)});this.htmlElement.media.src=this.status.src;"none"!==this.options.preload&&this._html_load();this._trigger(b.jPlayer.event.timeupdate)},_html_setFormat:function(a){var c=this;b.each(this.formats,function(b,e){if(c.html.support[e]&&
|
||||
a[e])return c.status.src=a[e],c.status.format[e]=!0,c.status.formatType=e,!1})},_html_setAudio:function(a){this._html_setFormat(a);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(a)},_html_setVideo:function(a){this._html_setFormat(a);this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(a.poster)?a.poster:"");this.htmlElement.media=this.htmlElement.video;this._html_initMedia(a)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==
|
||||
this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load());clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this,d=this.htmlElement.media;this._html_load();if(isNaN(a))d.play();
|
||||
else{this.internal.cmdsIgnored&&d.play();try{if(!d.seekable||"object"===typeof d.seekable&&0<d.seekable.length)d.currentTime=a,d.play();else throw 1;}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},250);return}}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this,d=this.htmlElement.media;0<a?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);d.pause();if(!isNaN(a))try{if(!d.seekable||"object"===typeof d.seekable&&0<d.seekable.length)d.currentTime=a;else throw 1;
|
||||
}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},250);return}0<a&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this,d=this.htmlElement.media;this._html_load();try{if("object"===typeof d.seekable&&0<d.seekable.length)d.currentTime=a*d.seekable.end(d.seekable.length-1)/100;else if(0<d.duration&&!isNaN(d.duration))d.currentTime=a*d.duration/100;else throw"e";}catch(e){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},250);return}this.status.waitForLoad||
|
||||
this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(a,b){this.html.audio.available&&(this.htmlElement.audio[a]=b);this.html.video.available&&(this.htmlElement.video[a]=b)},_flash_setAudio:function(a){var c=this;try{b.each(this.formats,
|
||||
function(b,d){if(c.flash.support[d]&&a[d]){switch(d){case "m4a":case "fla":c._getMovie().fl_setAudio_m4a(a[d]);break;case "mp3":c._getMovie().fl_setAudio_mp3(a[d]);break;case "rtmpa":c._getMovie().fl_setAudio_rtmp(a[d])}c.status.src=a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var c=this;try{b.each(this.formats,function(b,d){if(c.flash.support[d]&&
|
||||
a[d]){switch(d){case "m4v":case "flv":c._getMovie().fl_setVideo_m4v(a[d]);break;case "rtmpv":c._getMovie().fl_setVideo_rtmp(a[d])}c.status.src=a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},
|
||||
_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=!1;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}0<a&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||
|
||||
this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},
|
||||
_getFlashPluginVersion:function(){var a=0,b;if(window.ActiveXObject)try{if(b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var d=b.GetVariable("$version");d&&(d=d.split(" ")[1].split(","),a=parseInt(d[0],10)+"."+parseInt(d[1],10))}}catch(e){}else navigator.plugins&&0<navigator.mimeTypes.length&&(b=navigator.plugins["Shockwave Flash"])&&(a=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1"));return 1*a},_checkForFlash:function(a){var b=!1;this._getFlashPluginVersion()>=
|
||||
a&&(b=!0);return b},_validString:function(a){return a&&"string"===typeof a},_limitValue:function(a,b,d){return a<b?b:a>d?d:a},_urlNotSetError:function(a){this._error({type:b.jPlayer.error.URL_NOT_SET,context:a,message:b.jPlayer.errorMsg.URL_NOT_SET,hint:b.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){var c;c=this.internal.ready?"FLASH_DISABLED":"FLASH";this._error({type:b.jPlayer.error[c],context:this.internal.flash.swf,message:b.jPlayer.errorMsg[c]+a.message,hint:b.jPlayer.errorHint[c]});
|
||||
this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(a){this._trigger(b.jPlayer.event.error,a);this.options.errorAlerts&&this._alert("Error!"+(a.message?"\n"+a.message:"")+(a.hint?"\n"+a.hint:"")+"\nContext: "+a.context)},_warning:function(a){this._trigger(b.jPlayer.event.warning,f,a);this.options.warningAlerts&&this._alert("Warning!"+(a.message?"\n"+a.message:"")+(a.hint?"\n"+a.hint:"")+"\nContext: "+a.context)},_alert:function(a){a="jPlayer "+this.version.script+" : id='"+this.internal.self.id+
|
||||
"' : "+a;this.options.consoleAlerts?console&&console.log&&console.log(a):alert(a)},_emulateHtmlBridge:function(){var a=this;b.each(b.jPlayer.emulateMethods.split(/\s+/g),function(b,d){a.internal.domNode[d]=function(b){a[d](b)}});b.each(b.jPlayer.event,function(c,d){var e=!0;b.each(b.jPlayer.reservedEvent.split(/\s+/g),function(a,b){if(b===c)return e=!1});e&&a.element.bind(d+".jPlayer.jPlayerHtml",function(){a._emulateHtmlUpdate();var b=document.createEvent("Event");b.initEvent(c,!1,!0);a.internal.domNode.dispatchEvent(b)})})},
|
||||
_emulateHtmlUpdate:function(){var a=this;b.each(b.jPlayer.emulateStatus.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.status[d]});b.each(b.jPlayer.emulateOptions.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.options[d]})},_destroyHtmlBridge:function(){var a=this;this.element.unbind(".jPlayerHtml");b.each((b.jPlayer.emulateMethods+" "+b.jPlayer.emulateStatus+" "+b.jPlayer.emulateOptions).split(/\s+/g),function(b,d){delete a.internal.domNode[d]})}};b.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",
|
||||
NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};b.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",
|
||||
URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+b.jPlayer.prototype.version.script+" needs Jplayer.swf version "+b.jPlayer.prototype.version.needFlash+" but found "};b.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",
|
||||
URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};b.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};b.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",
|
||||
OPTION_KEY:"The option requested in jPlayer('option') is undefined."};b.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* MuffinMenu
|
||||
*
|
||||
* Horizontal Multilevel Menu with WP MegaMenu Support
|
||||
*
|
||||
* 3.0 | Muffin Group
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
"use strict";
|
||||
|
||||
$.fn.mfnMenu = function( options ){
|
||||
|
||||
var menu = $(this);
|
||||
|
||||
var defaults = {
|
||||
addLast : false,
|
||||
arrows : false,
|
||||
delay : 100,
|
||||
hoverClass : 'hover',
|
||||
mobileInit : 768,
|
||||
responsive : true
|
||||
};
|
||||
options = $.extend( defaults, options );
|
||||
|
||||
|
||||
var init = function(){
|
||||
|
||||
// add '.submenu' class
|
||||
$( 'li:has(ul)', menu ).addClass( 'submenu' );
|
||||
|
||||
// append mobile toggle button
|
||||
$( 'li:has(ul)', menu ).append( '<span class="menu-toggle"></span>' );
|
||||
|
||||
// add '.mfn-megamenu-parent' class
|
||||
menu.children( 'li:has( ul.mfn-megamenu )' ).addClass( 'mfn-megamenu-parent' );
|
||||
|
||||
// add '.last-item' class
|
||||
$( '.submenu ul li:last-child', menu ).addClass( 'last-item' );
|
||||
|
||||
// add '.last' class
|
||||
if( options.addLast ) {
|
||||
$( '> li:last-child', menu ).addClass( 'last' )
|
||||
.prev().addClass( 'last' );
|
||||
}
|
||||
|
||||
// appand submenu arrows
|
||||
if( options.arrows ) {
|
||||
$( 'li ul li:has(ul) > a', menu ).append( '<i class="menu-arrow icon-right-open"></i>' );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
var doMenu = function(){
|
||||
|
||||
if( ( $(window).width() >= options.mobileInit ) || ( ! options.responsive ) ){
|
||||
|
||||
// desktop --------------------------------
|
||||
|
||||
$( '> li, ul:not(.mfn-megamenu) li', menu ).hover(function() {
|
||||
|
||||
$(this).stop(true,true).addClass( options.hoverClass );
|
||||
|
||||
$(this).children( 'ul' ).stop(true,true).fadeIn( options.delay );
|
||||
|
||||
|
||||
}, function(){
|
||||
|
||||
$(this).stop(true,true).removeClass( options.hoverClass );
|
||||
|
||||
$(this).children( 'ul' ).stop(true,true).fadeOut( options.delay );
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
// mobile ---------------------------------
|
||||
|
||||
$( 'li', menu ).unbind('hover');
|
||||
|
||||
$( 'li > .menu-toggle', menu ).off('click').on('click', function(){
|
||||
|
||||
var el = $(this).closest('li');
|
||||
|
||||
if( el.hasClass( options.hoverClass ) ){
|
||||
|
||||
el.removeClass( options.hoverClass )
|
||||
.children('ul').stop(true,true).fadeOut( options.delay );
|
||||
|
||||
} else {
|
||||
|
||||
el.addClass( options.hoverClass )
|
||||
.children('ul').stop(true,true).fadeIn( options.delay );
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
$(window).bind( 'resize', doMenu );
|
||||
|
||||
var __constructor = function(){
|
||||
init();
|
||||
doMenu();
|
||||
};
|
||||
|
||||
__constructor();
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,279 @@
|
||||
/**
|
||||
* Parallax
|
||||
*
|
||||
* Translate3d
|
||||
*
|
||||
* 1.0 | Muffin Group
|
||||
*/
|
||||
|
||||
mfnSetup = {
|
||||
translate: null
|
||||
};
|
||||
|
||||
|
||||
(function( $ ){
|
||||
"use strict";
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
*
|
||||
* mfnSetup
|
||||
*
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// has3d ------------------------------------------------
|
||||
|
||||
var has3d = function(){
|
||||
|
||||
if ( ! window.getComputedStyle ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var el = document.createElement('div'),
|
||||
has3d,
|
||||
transforms = {
|
||||
'webkitTransform':'-webkit-transform',
|
||||
'OTransform':'-o-transform',
|
||||
'msTransform':'-ms-transform',
|
||||
'MozTransform':'-moz-transform',
|
||||
'transform':'transform'
|
||||
};
|
||||
|
||||
document.body.insertBefore(el, null);
|
||||
|
||||
for (var t in transforms) {
|
||||
if (el.style[t] !== undefined) {
|
||||
el.style[t] = "translate3d(1px,1px,1px)";
|
||||
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
|
||||
}
|
||||
}
|
||||
|
||||
document.body.removeChild(el);
|
||||
|
||||
return( has3d !== undefined && has3d !== null && has3d.length > 0 && has3d !== "none" );
|
||||
}
|
||||
|
||||
|
||||
// browserPrefix ------------------------------------------------
|
||||
|
||||
var browserPrefix = function () {
|
||||
|
||||
var el = document.createElement('div'),
|
||||
vendor = ["ms", "O", "Webkit", "Moz"],
|
||||
i, prefix;
|
||||
|
||||
for (i in vendor) {
|
||||
if (el.style[vendor[i] + "Transition"] !== undefined) {
|
||||
prefix = vendor[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return prefix;
|
||||
};
|
||||
|
||||
|
||||
// __construct ------------------------------------------------
|
||||
|
||||
var __construct = function () {
|
||||
|
||||
if( has3d() ){
|
||||
|
||||
mfnSetup.translate = function (el, x, y) {
|
||||
el.css( '-' + browserPrefix() + '-transform', 'translate3d(' + x + ', ' + y + ', 0)' );
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
mfnSetup.translate = function (el, x, y) {
|
||||
el.css({ "left": x, "top": y });
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
__construct();
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
(function( $ ){
|
||||
"use strict";
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
*
|
||||
* $.fn.mfnParallax
|
||||
*
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
$.fn.mfnParallax = function () {
|
||||
|
||||
var el = $(this),
|
||||
parent = el.parent(),
|
||||
speed = 500,
|
||||
element, parentPos, windowH, translate;
|
||||
|
||||
|
||||
// imageSize ------------------------------------------------
|
||||
|
||||
var imageSize = function( img ){
|
||||
|
||||
var w, h, l, t; // width, height, left, top
|
||||
|
||||
var imageW = img.get(0).naturalWidth;
|
||||
var imageH = img.get(0).naturalHeight;
|
||||
|
||||
var parentW = img.parent().outerWidth();
|
||||
var parentH = img.parent().outerHeight();
|
||||
|
||||
var windowH = $(window).height()
|
||||
|
||||
// fix for small sections
|
||||
if( windowH > parentH ){
|
||||
parentH = windowH;
|
||||
}
|
||||
|
||||
var diff = imageW / parentW;
|
||||
|
||||
if( (imageH / diff) < parentH ){
|
||||
|
||||
w = imageW / (imageH / parentH);
|
||||
h = parentH;
|
||||
|
||||
if( w > imageW ){
|
||||
|
||||
if( h > windowH ){
|
||||
|
||||
w = imageW / (imageH / windowH);
|
||||
h = windowH;
|
||||
|
||||
} else {
|
||||
|
||||
w = imageW;
|
||||
h = imageH;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
w = parentW;
|
||||
h = imageH / diff;
|
||||
|
||||
}
|
||||
|
||||
l = ( parentW - w ) / 2;
|
||||
t = ( parentH - h ) / 2;
|
||||
|
||||
return [w, h, l, t];
|
||||
}
|
||||
|
||||
|
||||
// parallax ------------------------------------------------
|
||||
|
||||
var parallax = function(){
|
||||
|
||||
var scrollTop = $(window).scrollTop(),
|
||||
scrollDiff, ratio, translateTop;
|
||||
|
||||
if( parentPos !== undefined ){
|
||||
|
||||
if( scrollTop >= parentPos.min && scrollTop <= parentPos.max ) {
|
||||
|
||||
scrollDiff = scrollTop - parentPos.min;
|
||||
ratio = scrollDiff / parentPos.height;
|
||||
|
||||
translateTop = windowH + ( ratio * speed ) - scrollDiff - ( speed * ( windowH / parentPos.height ) ) ;
|
||||
|
||||
mfnSetup.translate( el, element.left + "px", -Math.round( translateTop ) + "px" );
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// init ------------------------------------------------
|
||||
|
||||
var init = function(){
|
||||
|
||||
windowH = $(window).height();
|
||||
|
||||
|
||||
var initElement = function () {
|
||||
|
||||
var size = imageSize( el );
|
||||
|
||||
el.removeAttr('style').css({
|
||||
'width' : size[0],
|
||||
'height' : size[1]
|
||||
});
|
||||
|
||||
mfnSetup.translate(el, size[2] + "px", size[3] + "px");
|
||||
|
||||
return {
|
||||
'width' : size[0],
|
||||
'height' : size[1],
|
||||
'left' : size[2],
|
||||
'top' : size[3]
|
||||
};
|
||||
};
|
||||
|
||||
element = initElement();
|
||||
|
||||
|
||||
var initParent = function () {
|
||||
|
||||
var min = parent.offset().top - $(window).height();
|
||||
var max = parent.offset().top + $(parent).outerHeight();
|
||||
|
||||
return {
|
||||
'min' : min,
|
||||
'max' : max,
|
||||
'height' : max - min
|
||||
};
|
||||
};
|
||||
|
||||
parentPos = initParent();
|
||||
};
|
||||
|
||||
|
||||
// reload ------------------------------------------------
|
||||
|
||||
var reload = function () {
|
||||
|
||||
setTimeout(function () {
|
||||
init();
|
||||
parallax();
|
||||
}, 200);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// .bind() ------------------------------------------------
|
||||
|
||||
$(window).bind('load resize', reload);
|
||||
$(window).bind('scroll', parallax);
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
*
|
||||
* $(document).ready
|
||||
*
|
||||
* --------------------------------------------------------------------- */
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if( $(".mfn-parallax").length ) {
|
||||
|
||||
$(".mfn-parallax").each( function(){
|
||||
$(this).mfnParallax();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
+1974
File diff suppressed because it is too large
Load Diff
Vendored
+13
File diff suppressed because one or more lines are too long
+611
@@ -0,0 +1,611 @@
|
||||
/*!
|
||||
* jQuery UI Accordion 1.8.22
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.widget( "ui.accordion", {
|
||||
options: {
|
||||
active: 0,
|
||||
animated: "slide",
|
||||
autoHeight: true,
|
||||
clearStyle: false,
|
||||
collapsible: false,
|
||||
event: "click",
|
||||
fillSpace: false,
|
||||
header: "> li > :first-child,> :not(li):even",
|
||||
icons: {
|
||||
header: "ui-icon-triangle-1-e",
|
||||
headerSelected: "ui-icon-triangle-1-s"
|
||||
},
|
||||
navigation: false,
|
||||
navigationFilter: function() {
|
||||
return this.href.toLowerCase() === location.href.toLowerCase();
|
||||
}
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
var self = this,
|
||||
options = self.options;
|
||||
|
||||
self.running = 0;
|
||||
|
||||
self.element
|
||||
.addClass( "ui-accordion ui-widget ui-helper-reset" )
|
||||
// in lack of child-selectors in CSS
|
||||
// we need to mark top-LIs in a UL-accordion for some IE-fix
|
||||
.children( "li" )
|
||||
.addClass( "ui-accordion-li-fix" );
|
||||
|
||||
self.headers = self.element.find( options.header )
|
||||
.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" )
|
||||
.bind( "mouseenter.accordion", function() {
|
||||
if ( options.disabled ) {
|
||||
return;
|
||||
}
|
||||
$( this ).addClass( "ui-state-hover" );
|
||||
})
|
||||
.bind( "mouseleave.accordion", function() {
|
||||
if ( options.disabled ) {
|
||||
return;
|
||||
}
|
||||
$( this ).removeClass( "ui-state-hover" );
|
||||
})
|
||||
.bind( "focus.accordion", function() {
|
||||
if ( options.disabled ) {
|
||||
return;
|
||||
}
|
||||
$( this ).addClass( "ui-state-focus" );
|
||||
})
|
||||
.bind( "blur.accordion", function() {
|
||||
if ( options.disabled ) {
|
||||
return;
|
||||
}
|
||||
$( this ).removeClass( "ui-state-focus" );
|
||||
});
|
||||
|
||||
self.headers.next()
|
||||
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
|
||||
|
||||
if ( options.navigation ) {
|
||||
var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 );
|
||||
if ( current.length ) {
|
||||
var header = current.closest( ".ui-accordion-header" );
|
||||
if ( header.length ) {
|
||||
// anchor within header
|
||||
self.active = header;
|
||||
} else {
|
||||
// anchor within content
|
||||
self.active = current.closest( ".ui-accordion-content" ).prev();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.active = self._findActive( self.active || options.active )
|
||||
.addClass( "ui-state-default ui-state-active" )
|
||||
.toggleClass( "ui-corner-all" )
|
||||
.toggleClass( "ui-corner-top" );
|
||||
self.active.next().addClass( "ui-accordion-content-active" );
|
||||
|
||||
self._createIcons();
|
||||
self.resize();
|
||||
|
||||
// ARIA
|
||||
self.element.attr( "role", "tablist" );
|
||||
|
||||
self.headers
|
||||
.attr( "role", "tab" )
|
||||
.bind( "keydown.accordion", function( event ) {
|
||||
return self._keydown( event );
|
||||
})
|
||||
.next()
|
||||
.attr( "role", "tabpanel" );
|
||||
|
||||
self.headers
|
||||
.not( self.active || "" )
|
||||
.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-selected": "false",
|
||||
tabIndex: -1
|
||||
})
|
||||
.next()
|
||||
.hide();
|
||||
|
||||
// make sure at least one header is in the tab order
|
||||
if ( !self.active.length ) {
|
||||
self.headers.eq( 0 ).attr( "tabIndex", 0 );
|
||||
} else {
|
||||
self.active
|
||||
.attr({
|
||||
"aria-expanded": "true",
|
||||
"aria-selected": "true",
|
||||
tabIndex: 0
|
||||
});
|
||||
}
|
||||
|
||||
// only need links in tab order for Safari
|
||||
if ( !$.browser.safari ) {
|
||||
self.headers.find( "a" ).attr( "tabIndex", -1 );
|
||||
}
|
||||
|
||||
if ( options.event ) {
|
||||
self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) {
|
||||
self._clickHandler.call( self, event, this );
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_createIcons: function() {
|
||||
var options = this.options;
|
||||
if ( options.icons ) {
|
||||
$( "<span></span>" )
|
||||
.addClass( "ui-icon " + options.icons.header )
|
||||
.prependTo( this.headers );
|
||||
this.active.children( ".ui-icon" )
|
||||
.toggleClass(options.icons.header)
|
||||
.toggleClass(options.icons.headerSelected);
|
||||
this.element.addClass( "ui-accordion-icons" );
|
||||
}
|
||||
},
|
||||
|
||||
_destroyIcons: function() {
|
||||
this.headers.children( ".ui-icon" ).remove();
|
||||
this.element.removeClass( "ui-accordion-icons" );
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
var options = this.options;
|
||||
|
||||
this.element
|
||||
.removeClass( "ui-accordion ui-widget ui-helper-reset" )
|
||||
.removeAttr( "role" );
|
||||
|
||||
this.headers
|
||||
.unbind( ".accordion" )
|
||||
.removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
|
||||
.removeAttr( "role" )
|
||||
.removeAttr( "aria-expanded" )
|
||||
.removeAttr( "aria-selected" )
|
||||
.removeAttr( "tabIndex" );
|
||||
|
||||
this.headers.find( "a" ).removeAttr( "tabIndex" );
|
||||
this._destroyIcons();
|
||||
var contents = this.headers.next()
|
||||
.css( "display", "" )
|
||||
.removeAttr( "role" )
|
||||
.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" );
|
||||
if ( options.autoHeight || options.fillHeight ) {
|
||||
contents.css( "height", "" );
|
||||
}
|
||||
|
||||
return $.Widget.prototype.destroy.call( this );
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
$.Widget.prototype._setOption.apply( this, arguments );
|
||||
|
||||
if ( key == "active" ) {
|
||||
this.activate( value );
|
||||
}
|
||||
if ( key == "icons" ) {
|
||||
this._destroyIcons();
|
||||
if ( value ) {
|
||||
this._createIcons();
|
||||
}
|
||||
}
|
||||
// #5332 - opacity doesn't cascade to positioned elements in IE
|
||||
// so we need to add the disabled class to the headers and panels
|
||||
if ( key == "disabled" ) {
|
||||
this.headers.add(this.headers.next())
|
||||
[ value ? "addClass" : "removeClass" ](
|
||||
"ui-accordion-disabled ui-state-disabled" );
|
||||
}
|
||||
},
|
||||
|
||||
_keydown: function( event ) {
|
||||
if ( this.options.disabled || event.altKey || event.ctrlKey ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var keyCode = $.ui.keyCode,
|
||||
length = this.headers.length,
|
||||
currentIndex = this.headers.index( event.target ),
|
||||
toFocus = false;
|
||||
|
||||
switch ( event.keyCode ) {
|
||||
case keyCode.RIGHT:
|
||||
case keyCode.DOWN:
|
||||
toFocus = this.headers[ ( currentIndex + 1 ) % length ];
|
||||
break;
|
||||
case keyCode.LEFT:
|
||||
case keyCode.UP:
|
||||
toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
|
||||
break;
|
||||
case keyCode.SPACE:
|
||||
case keyCode.ENTER:
|
||||
this._clickHandler( { target: event.target }, event.target );
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if ( toFocus ) {
|
||||
$( event.target ).attr( "tabIndex", -1 );
|
||||
$( toFocus ).attr( "tabIndex", 0 );
|
||||
toFocus.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
var options = this.options,
|
||||
maxHeight;
|
||||
|
||||
if ( options.fillSpace ) {
|
||||
if ( $.browser.msie ) {
|
||||
var defOverflow = this.element.parent().css( "overflow" );
|
||||
this.element.parent().css( "overflow", "hidden");
|
||||
}
|
||||
maxHeight = this.element.parent().height();
|
||||
if ($.browser.msie) {
|
||||
this.element.parent().css( "overflow", defOverflow );
|
||||
}
|
||||
|
||||
this.headers.each(function() {
|
||||
maxHeight -= $( this ).outerHeight( true );
|
||||
});
|
||||
|
||||
this.headers.next()
|
||||
.each(function() {
|
||||
$( this ).height( Math.max( 0, maxHeight -
|
||||
$( this ).innerHeight() + $( this ).height() ) );
|
||||
})
|
||||
.css( "overflow", "auto" );
|
||||
} else if ( options.autoHeight ) {
|
||||
maxHeight = 0;
|
||||
this.headers.next()
|
||||
.each(function() {
|
||||
maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
|
||||
})
|
||||
.height( maxHeight );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
activate: function( index ) {
|
||||
// TODO this gets called on init, changing the option without an explicit call for that
|
||||
this.options.active = index;
|
||||
// call clickHandler with custom event
|
||||
var active = this._findActive( index )[ 0 ];
|
||||
this._clickHandler( { target: active }, active );
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_findActive: function( selector ) {
|
||||
return selector
|
||||
? typeof selector === "number"
|
||||
? this.headers.filter( ":eq(" + selector + ")" )
|
||||
: this.headers.not( this.headers.not( selector ) )
|
||||
: selector === false
|
||||
? $( [] )
|
||||
: this.headers.filter( ":eq(0)" );
|
||||
},
|
||||
|
||||
// TODO isn't event.target enough? why the separate target argument?
|
||||
_clickHandler: function( event, target ) {
|
||||
var options = this.options;
|
||||
if ( options.disabled ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// called only when using activate(false) to close all parts programmatically
|
||||
if ( !event.target ) {
|
||||
if ( !options.collapsible ) {
|
||||
return;
|
||||
}
|
||||
this.active
|
||||
.removeClass( "ui-state-active ui-corner-top" )
|
||||
.addClass( "ui-state-default ui-corner-all" )
|
||||
.children( ".ui-icon" )
|
||||
.removeClass( options.icons.headerSelected )
|
||||
.addClass( options.icons.header );
|
||||
this.active.next().addClass( "ui-accordion-content-active" );
|
||||
var toHide = this.active.next(),
|
||||
data = {
|
||||
options: options,
|
||||
newHeader: $( [] ),
|
||||
oldHeader: options.active,
|
||||
newContent: $( [] ),
|
||||
oldContent: toHide
|
||||
},
|
||||
toShow = ( this.active = $( [] ) );
|
||||
this._toggle( toShow, toHide, data );
|
||||
return;
|
||||
}
|
||||
|
||||
// get the click target
|
||||
var clicked = $( event.currentTarget || target ),
|
||||
clickedIsActive = clicked[0] === this.active[0];
|
||||
|
||||
// TODO the option is changed, is that correct?
|
||||
// TODO if it is correct, shouldn't that happen after determining that the click is valid?
|
||||
options.active = options.collapsible && clickedIsActive ?
|
||||
false :
|
||||
this.headers.index( clicked );
|
||||
|
||||
// if animations are still active, or the active header is the target, ignore click
|
||||
if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// find elements to show and hide
|
||||
var active = this.active,
|
||||
toShow = clicked.next(),
|
||||
toHide = this.active.next(),
|
||||
data = {
|
||||
options: options,
|
||||
newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
|
||||
oldHeader: this.active,
|
||||
newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
|
||||
oldContent: toHide
|
||||
},
|
||||
down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
|
||||
|
||||
// when the call to ._toggle() comes after the class changes
|
||||
// it causes a very odd bug in IE 8 (see #6720)
|
||||
this.active = clickedIsActive ? $([]) : clicked;
|
||||
this._toggle( toShow, toHide, data, clickedIsActive, down );
|
||||
|
||||
// switch classes
|
||||
active
|
||||
.removeClass( "ui-state-active ui-corner-top" )
|
||||
.addClass( "ui-state-default ui-corner-all" )
|
||||
.children( ".ui-icon" )
|
||||
.removeClass( options.icons.headerSelected )
|
||||
.addClass( options.icons.header );
|
||||
if ( !clickedIsActive ) {
|
||||
clicked
|
||||
.removeClass( "ui-state-default ui-corner-all" )
|
||||
.addClass( "ui-state-active ui-corner-top" )
|
||||
.children( ".ui-icon" )
|
||||
.removeClass( options.icons.header )
|
||||
.addClass( options.icons.headerSelected );
|
||||
clicked
|
||||
.next()
|
||||
.addClass( "ui-accordion-content-active" );
|
||||
}
|
||||
|
||||
return;
|
||||
},
|
||||
|
||||
_toggle: function( toShow, toHide, data, clickedIsActive, down ) {
|
||||
var self = this,
|
||||
options = self.options;
|
||||
|
||||
self.toShow = toShow;
|
||||
self.toHide = toHide;
|
||||
self.data = data;
|
||||
|
||||
var complete = function() {
|
||||
if ( !self ) {
|
||||
return;
|
||||
}
|
||||
return self._completed.apply( self, arguments );
|
||||
};
|
||||
|
||||
// trigger changestart event
|
||||
self._trigger( "changestart", null, self.data );
|
||||
|
||||
// count elements to animate
|
||||
self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
|
||||
|
||||
if ( options.animated ) {
|
||||
var animOptions = {};
|
||||
|
||||
if ( options.collapsible && clickedIsActive ) {
|
||||
animOptions = {
|
||||
toShow: $( [] ),
|
||||
toHide: toHide,
|
||||
complete: complete,
|
||||
down: down,
|
||||
autoHeight: options.autoHeight || options.fillSpace
|
||||
};
|
||||
} else {
|
||||
animOptions = {
|
||||
toShow: toShow,
|
||||
toHide: toHide,
|
||||
complete: complete,
|
||||
down: down,
|
||||
autoHeight: options.autoHeight || options.fillSpace
|
||||
};
|
||||
}
|
||||
|
||||
if ( !options.proxied ) {
|
||||
options.proxied = options.animated;
|
||||
}
|
||||
|
||||
if ( !options.proxiedDuration ) {
|
||||
options.proxiedDuration = options.duration;
|
||||
}
|
||||
|
||||
options.animated = $.isFunction( options.proxied ) ?
|
||||
options.proxied( animOptions ) :
|
||||
options.proxied;
|
||||
|
||||
options.duration = $.isFunction( options.proxiedDuration ) ?
|
||||
options.proxiedDuration( animOptions ) :
|
||||
options.proxiedDuration;
|
||||
|
||||
var animations = $.ui.accordion.animations,
|
||||
duration = options.duration,
|
||||
easing = options.animated;
|
||||
|
||||
if ( easing && !animations[ easing ] && !$.easing[ easing ] ) {
|
||||
easing = "slide";
|
||||
}
|
||||
if ( !animations[ easing ] ) {
|
||||
animations[ easing ] = function( options ) {
|
||||
this.slide( options, {
|
||||
easing: easing,
|
||||
duration: duration || 700
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
animations[ easing ]( animOptions );
|
||||
} else {
|
||||
if ( options.collapsible && clickedIsActive ) {
|
||||
toShow.toggle();
|
||||
} else {
|
||||
toHide.hide();
|
||||
toShow.show();
|
||||
}
|
||||
|
||||
complete( true );
|
||||
}
|
||||
|
||||
// TODO assert that the blur and focus triggers are really necessary, remove otherwise
|
||||
toHide.prev()
|
||||
.attr({
|
||||
"aria-expanded": "false",
|
||||
"aria-selected": "false",
|
||||
tabIndex: -1
|
||||
})
|
||||
.blur();
|
||||
toShow.prev()
|
||||
.attr({
|
||||
"aria-expanded": "true",
|
||||
"aria-selected": "true",
|
||||
tabIndex: 0
|
||||
})
|
||||
.focus();
|
||||
},
|
||||
|
||||
_completed: function( cancel ) {
|
||||
this.running = cancel ? 0 : --this.running;
|
||||
if ( this.running ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( this.options.clearStyle ) {
|
||||
this.toShow.add( this.toHide ).css({
|
||||
height: "",
|
||||
overflow: ""
|
||||
});
|
||||
}
|
||||
|
||||
// other classes are removed before the animation; this one needs to stay until completed
|
||||
this.toHide.removeClass( "ui-accordion-content-active" );
|
||||
// Work around for rendering bug in IE (#5421)
|
||||
if ( this.toHide.length ) {
|
||||
this.toHide.parent()[0].className = this.toHide.parent()[0].className;
|
||||
}
|
||||
|
||||
this._trigger( "change", null, this.data );
|
||||
}
|
||||
});
|
||||
|
||||
$.extend( $.ui.accordion, {
|
||||
version: "1.8.22",
|
||||
animations: {
|
||||
slide: function( options, additions ) {
|
||||
options = $.extend({
|
||||
easing: "swing",
|
||||
duration: 300
|
||||
}, options, additions );
|
||||
if ( !options.toHide.size() ) {
|
||||
options.toShow.animate({
|
||||
height: "show",
|
||||
paddingTop: "show",
|
||||
paddingBottom: "show"
|
||||
}, options );
|
||||
return;
|
||||
}
|
||||
if ( !options.toShow.size() ) {
|
||||
options.toHide.animate({
|
||||
height: "hide",
|
||||
paddingTop: "hide",
|
||||
paddingBottom: "hide"
|
||||
}, options );
|
||||
return;
|
||||
}
|
||||
var overflow = options.toShow.css( "overflow" ),
|
||||
percentDone = 0,
|
||||
showProps = {},
|
||||
hideProps = {},
|
||||
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
|
||||
originalWidth;
|
||||
// fix width before calculating height of hidden element
|
||||
var s = options.toShow;
|
||||
originalWidth = s[0].style.width;
|
||||
s.width( s.parent().width()
|
||||
- parseFloat( s.css( "paddingLeft" ) )
|
||||
- parseFloat( s.css( "paddingRight" ) )
|
||||
- ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 )
|
||||
- ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) );
|
||||
|
||||
$.each( fxAttrs, function( i, prop ) {
|
||||
hideProps[ prop ] = "hide";
|
||||
|
||||
var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
|
||||
showProps[ prop ] = {
|
||||
value: parts[ 1 ],
|
||||
unit: parts[ 2 ] || "px"
|
||||
};
|
||||
});
|
||||
options.toShow.css({ height: 0, overflow: "hidden" }).show();
|
||||
options.toHide
|
||||
.filter( ":hidden" )
|
||||
.each( options.complete )
|
||||
.end()
|
||||
.filter( ":visible" )
|
||||
.animate( hideProps, {
|
||||
step: function( now, settings ) {
|
||||
// only calculate the percent when animating height
|
||||
// IE gets very inconsistent results when animating elements
|
||||
// with small values, which is common for padding
|
||||
if ( settings.prop == "height" ) {
|
||||
percentDone = ( settings.end - settings.start === 0 ) ? 0 :
|
||||
( settings.now - settings.start ) / ( settings.end - settings.start );
|
||||
}
|
||||
|
||||
options.toShow[ 0 ].style[ settings.prop ] =
|
||||
( percentDone * showProps[ settings.prop ].value )
|
||||
+ showProps[ settings.prop ].unit;
|
||||
},
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: function() {
|
||||
if ( !options.autoHeight ) {
|
||||
options.toShow.css( "height", "" );
|
||||
}
|
||||
options.toShow.css({
|
||||
width: originalWidth,
|
||||
overflow: overflow
|
||||
});
|
||||
options.complete();
|
||||
}
|
||||
});
|
||||
},
|
||||
bounceslide: function( options ) {
|
||||
this.slide( options, {
|
||||
easing: options.down ? "easeOutBounce" : "swing",
|
||||
duration: options.down ? 1000 : 200
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
+334
@@ -0,0 +1,334 @@
|
||||
/*!
|
||||
* jQuery UI 1.8.22
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
// prevent duplicate loading
|
||||
// this is only a problem because we proxy existing functions
|
||||
// and we don't want to double proxy them
|
||||
$.ui = $.ui || {};
|
||||
if ( $.ui.version ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.extend( $.ui, {
|
||||
version: "1.8.22",
|
||||
|
||||
keyCode: {
|
||||
ALT: 18,
|
||||
BACKSPACE: 8,
|
||||
CAPS_LOCK: 20,
|
||||
COMMA: 188,
|
||||
COMMAND: 91,
|
||||
COMMAND_LEFT: 91, // COMMAND
|
||||
COMMAND_RIGHT: 93,
|
||||
CONTROL: 17,
|
||||
DELETE: 46,
|
||||
DOWN: 40,
|
||||
END: 35,
|
||||
ENTER: 13,
|
||||
ESCAPE: 27,
|
||||
HOME: 36,
|
||||
INSERT: 45,
|
||||
LEFT: 37,
|
||||
MENU: 93, // COMMAND_RIGHT
|
||||
NUMPAD_ADD: 107,
|
||||
NUMPAD_DECIMAL: 110,
|
||||
NUMPAD_DIVIDE: 111,
|
||||
NUMPAD_ENTER: 108,
|
||||
NUMPAD_MULTIPLY: 106,
|
||||
NUMPAD_SUBTRACT: 109,
|
||||
PAGE_DOWN: 34,
|
||||
PAGE_UP: 33,
|
||||
PERIOD: 190,
|
||||
RIGHT: 39,
|
||||
SHIFT: 16,
|
||||
SPACE: 32,
|
||||
TAB: 9,
|
||||
UP: 38,
|
||||
WINDOWS: 91 // COMMAND
|
||||
}
|
||||
});
|
||||
|
||||
// plugins
|
||||
$.fn.extend({
|
||||
propAttr: $.fn.prop || $.fn.attr,
|
||||
|
||||
_focus: $.fn.focus,
|
||||
focus: function( delay, fn ) {
|
||||
return typeof delay === "number" ?
|
||||
this.each(function() {
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
$( elem ).focus();
|
||||
if ( fn ) {
|
||||
fn.call( elem );
|
||||
}
|
||||
}, delay );
|
||||
}) :
|
||||
this._focus.apply( this, arguments );
|
||||
},
|
||||
|
||||
scrollParent: function() {
|
||||
var scrollParent;
|
||||
if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
} else {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
}
|
||||
|
||||
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
||||
},
|
||||
|
||||
zIndex: function( zIndex ) {
|
||||
if ( zIndex !== undefined ) {
|
||||
return this.css( "zIndex", zIndex );
|
||||
}
|
||||
|
||||
if ( this.length ) {
|
||||
var elem = $( this[ 0 ] ), position, value;
|
||||
while ( elem.length && elem[ 0 ] !== document ) {
|
||||
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
||||
// This makes behavior of this function consistent across browsers
|
||||
// WebKit always returns auto if the element is positioned
|
||||
position = elem.css( "position" );
|
||||
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
||||
// IE returns 0 when zIndex is not specified
|
||||
// other browsers return a string
|
||||
// we ignore the case of nested elements with an explicit value of 0
|
||||
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
||||
value = parseInt( elem.css( "zIndex" ), 10 );
|
||||
if ( !isNaN( value ) && value !== 0 ) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
elem = elem.parent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
||||
".ui-disableSelection", function( event ) {
|
||||
event.preventDefault();
|
||||
});
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
return this.unbind( ".ui-disableSelection" );
|
||||
}
|
||||
});
|
||||
|
||||
// support: jQuery <1.8
|
||||
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
|
||||
$.each( [ "Width", "Height" ], function( i, name ) {
|
||||
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
||||
type = name.toLowerCase(),
|
||||
orig = {
|
||||
innerWidth: $.fn.innerWidth,
|
||||
innerHeight: $.fn.innerHeight,
|
||||
outerWidth: $.fn.outerWidth,
|
||||
outerHeight: $.fn.outerHeight
|
||||
};
|
||||
|
||||
function reduce( elem, size, border, margin ) {
|
||||
$.each( side, function() {
|
||||
size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
|
||||
if ( border ) {
|
||||
size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
|
||||
}
|
||||
if ( margin ) {
|
||||
size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
|
||||
}
|
||||
});
|
||||
return size;
|
||||
}
|
||||
|
||||
$.fn[ "inner" + name ] = function( size ) {
|
||||
if ( size === undefined ) {
|
||||
return orig[ "inner" + name ].call( this );
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
$( this ).css( type, reduce( this, size ) + "px" );
|
||||
});
|
||||
};
|
||||
|
||||
$.fn[ "outer" + name] = function( size, margin ) {
|
||||
if ( typeof size !== "number" ) {
|
||||
return orig[ "outer" + name ].call( this, size );
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
$( this).css( type, reduce( this, size, true, margin ) + "px" );
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// selectors
|
||||
function focusable( element, isTabIndexNotNaN ) {
|
||||
var nodeName = element.nodeName.toLowerCase();
|
||||
if ( "area" === nodeName ) {
|
||||
var map = element.parentNode,
|
||||
mapName = map.name,
|
||||
img;
|
||||
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
||||
return false;
|
||||
}
|
||||
img = $( "img[usemap=#" + mapName + "]" )[0];
|
||||
return !!img && visible( img );
|
||||
}
|
||||
return ( /input|select|textarea|button|object/.test( nodeName )
|
||||
? !element.disabled
|
||||
: "a" == nodeName
|
||||
? element.href || isTabIndexNotNaN
|
||||
: isTabIndexNotNaN)
|
||||
// the element and all of its ancestors must be visible
|
||||
&& visible( element );
|
||||
}
|
||||
|
||||
function visible( element ) {
|
||||
return !$( element ).parents().andSelf().filter(function() {
|
||||
return $.curCSS( this, "visibility" ) === "hidden" ||
|
||||
$.expr.filters.hidden( this );
|
||||
}).length;
|
||||
}
|
||||
|
||||
$.extend( $.expr[ ":" ], {
|
||||
data: $.expr.createPseudo ?
|
||||
$.expr.createPseudo(function( dataName ) {
|
||||
return function( elem ) {
|
||||
return !!$.data( elem, dataName );
|
||||
};
|
||||
}) :
|
||||
// support: jQuery <1.8
|
||||
function( elem, i, match ) {
|
||||
return !!$.data( elem, match[ 3 ] );
|
||||
},
|
||||
|
||||
focusable: function( element ) {
|
||||
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
|
||||
},
|
||||
|
||||
tabbable: function( element ) {
|
||||
var tabIndex = $.attr( element, "tabindex" ),
|
||||
isTabIndexNaN = isNaN( tabIndex );
|
||||
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
|
||||
}
|
||||
});
|
||||
|
||||
// support
|
||||
$(function() {
|
||||
var body = document.body,
|
||||
div = body.appendChild( div = document.createElement( "div" ) );
|
||||
|
||||
// access offsetHeight before setting the style to prevent a layout bug
|
||||
// in IE 9 which causes the elemnt to continue to take up space even
|
||||
// after it is removed from the DOM (#8026)
|
||||
div.offsetHeight;
|
||||
|
||||
$.extend( div.style, {
|
||||
minHeight: "100px",
|
||||
height: "auto",
|
||||
padding: 0,
|
||||
borderWidth: 0
|
||||
});
|
||||
|
||||
$.support.minHeight = div.offsetHeight === 100;
|
||||
$.support.selectstart = "onselectstart" in div;
|
||||
|
||||
// set display to none to avoid a layout bug in IE
|
||||
// http://dev.jquery.com/ticket/4014
|
||||
body.removeChild( div ).style.display = "none";
|
||||
});
|
||||
|
||||
// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css
|
||||
if ( !$.curCSS ) {
|
||||
$.curCSS = $.css;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// deprecated
|
||||
$.extend( $.ui, {
|
||||
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
||||
plugin: {
|
||||
add: function( module, option, set ) {
|
||||
var proto = $.ui[ module ].prototype;
|
||||
for ( var i in set ) {
|
||||
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
||||
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
||||
}
|
||||
},
|
||||
call: function( instance, name, args ) {
|
||||
var set = instance.plugins[ name ];
|
||||
if ( !set || !instance.element[ 0 ].parentNode ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ( var i = 0; i < set.length; i++ ) {
|
||||
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
||||
set[ i ][ 1 ].apply( instance.element, args );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
|
||||
contains: function( a, b ) {
|
||||
return document.compareDocumentPosition ?
|
||||
a.compareDocumentPosition( b ) & 16 :
|
||||
a !== b && a.contains( b );
|
||||
},
|
||||
|
||||
// only used by resizable
|
||||
hasScroll: function( el, a ) {
|
||||
|
||||
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
||||
if ( $( el ).css( "overflow" ) === "hidden") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
||||
has = false;
|
||||
|
||||
if ( el[ scroll ] > 0 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: determine which cases actually cause this to happen
|
||||
// if the element doesn't have the scroll set, see if it's possible to
|
||||
// set the scroll
|
||||
el[ scroll ] = 1;
|
||||
has = ( el[ scroll ] > 0 );
|
||||
el[ scroll ] = 0;
|
||||
return has;
|
||||
},
|
||||
|
||||
// these are odd functions, fix the API or move into individual plugins
|
||||
isOverAxis: function( x, reference, size ) {
|
||||
//Determines when x coordinate is over "b" element axis
|
||||
return ( x > reference ) && ( x < ( reference + size ) );
|
||||
},
|
||||
isOver: function( y, x, top, left, height, width ) {
|
||||
//Determines when x, y coordinates is over "b" element
|
||||
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
|
||||
}
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
+757
@@ -0,0 +1,757 @@
|
||||
/*!
|
||||
* jQuery UI Tabs 1.8.22
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
var tabId = 0,
|
||||
listId = 0;
|
||||
|
||||
function getNextTabId() {
|
||||
return ++tabId;
|
||||
}
|
||||
|
||||
function getNextListId() {
|
||||
return ++listId;
|
||||
}
|
||||
|
||||
$.widget( "ui.tabs", {
|
||||
options: {
|
||||
add: null,
|
||||
ajaxOptions: null,
|
||||
cache: false,
|
||||
cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
|
||||
collapsible: false,
|
||||
disable: null,
|
||||
disabled: [],
|
||||
enable: null,
|
||||
event: "click",
|
||||
fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
|
||||
idPrefix: "ui-tabs-",
|
||||
load: null,
|
||||
panelTemplate: "<div></div>",
|
||||
remove: null,
|
||||
select: null,
|
||||
show: null,
|
||||
spinner: "<em>Loading…</em>",
|
||||
tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
this._tabify( true );
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
if ( key == "selected" ) {
|
||||
if (this.options.collapsible && value == this.options.selected ) {
|
||||
return;
|
||||
}
|
||||
this.select( value );
|
||||
} else {
|
||||
this.options[ key ] = value;
|
||||
this._tabify();
|
||||
}
|
||||
},
|
||||
|
||||
_tabId: function( a ) {
|
||||
return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
|
||||
this.options.idPrefix + getNextTabId();
|
||||
},
|
||||
|
||||
_sanitizeSelector: function( hash ) {
|
||||
// we need this because an id may contain a ":"
|
||||
return hash.replace( /:/g, "\\:" );
|
||||
},
|
||||
|
||||
_cookie: function() {
|
||||
var cookie = this.cookie ||
|
||||
( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() );
|
||||
return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );
|
||||
},
|
||||
|
||||
_ui: function( tab, panel ) {
|
||||
return {
|
||||
tab: tab,
|
||||
panel: panel,
|
||||
index: this.anchors.index( tab )
|
||||
};
|
||||
},
|
||||
|
||||
_cleanup: function() {
|
||||
// restore all former loading tabs labels
|
||||
this.lis.filter( ".ui-state-processing" )
|
||||
.removeClass( "ui-state-processing" )
|
||||
.find( "span:data(label.tabs)" )
|
||||
.each(function() {
|
||||
var el = $( this );
|
||||
el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" );
|
||||
});
|
||||
},
|
||||
|
||||
_tabify: function( init ) {
|
||||
var self = this,
|
||||
o = this.options,
|
||||
fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
|
||||
|
||||
this.list = this.element.find( "ol,ul" ).eq( 0 );
|
||||
this.lis = $( " > li:has(a[href])", this.list );
|
||||
this.anchors = this.lis.map(function() {
|
||||
return $( "a", this )[ 0 ];
|
||||
});
|
||||
this.panels = $( [] );
|
||||
|
||||
this.anchors.each(function( i, a ) {
|
||||
var href = $( a ).attr( "href" );
|
||||
// For dynamically created HTML that contains a hash as href IE < 8 expands
|
||||
// such href to the full page url with hash and then misinterprets tab as ajax.
|
||||
// Same consideration applies for an added tab with a fragment identifier
|
||||
// since a[href=#fragment-identifier] does unexpectedly not match.
|
||||
// Thus normalize href attribute...
|
||||
var hrefBase = href.split( "#" )[ 0 ],
|
||||
baseEl;
|
||||
if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] ||
|
||||
( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) {
|
||||
href = a.hash;
|
||||
a.href = href;
|
||||
}
|
||||
|
||||
// inline tab
|
||||
if ( fragmentId.test( href ) ) {
|
||||
self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) );
|
||||
// remote tab
|
||||
// prevent loading the page itself if href is just "#"
|
||||
} else if ( href && href !== "#" ) {
|
||||
// required for restore on destroy
|
||||
$.data( a, "href.tabs", href );
|
||||
|
||||
// TODO until #3808 is fixed strip fragment identifier from url
|
||||
// (IE fails to load from such url)
|
||||
$.data( a, "load.tabs", href.replace( /#.*$/, "" ) );
|
||||
|
||||
var id = self._tabId( a );
|
||||
a.href = "#" + id;
|
||||
var $panel = self.element.find( "#" + id );
|
||||
if ( !$panel.length ) {
|
||||
$panel = $( o.panelTemplate )
|
||||
.attr( "id", id )
|
||||
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
|
||||
.insertAfter( self.panels[ i - 1 ] || self.list );
|
||||
$panel.data( "destroy.tabs", true );
|
||||
}
|
||||
self.panels = self.panels.add( $panel );
|
||||
// invalid tab href
|
||||
} else {
|
||||
o.disabled.push( i );
|
||||
}
|
||||
});
|
||||
|
||||
// initialization from scratch
|
||||
if ( init ) {
|
||||
// attach necessary classes for styling
|
||||
this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" );
|
||||
this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
|
||||
this.lis.addClass( "ui-state-default ui-corner-top" );
|
||||
this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" );
|
||||
|
||||
// Selected tab
|
||||
// use "selected" option or try to retrieve:
|
||||
// 1. from fragment identifier in url
|
||||
// 2. from cookie
|
||||
// 3. from selected class attribute on <li>
|
||||
if ( o.selected === undefined ) {
|
||||
if ( location.hash ) {
|
||||
this.anchors.each(function( i, a ) {
|
||||
if ( a.hash == location.hash ) {
|
||||
o.selected = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if ( typeof o.selected !== "number" && o.cookie ) {
|
||||
o.selected = parseInt( self._cookie(), 10 );
|
||||
}
|
||||
if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) {
|
||||
o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
|
||||
}
|
||||
o.selected = o.selected || ( this.lis.length ? 0 : -1 );
|
||||
} else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release
|
||||
o.selected = -1;
|
||||
}
|
||||
|
||||
// sanity check - default to first tab...
|
||||
o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 )
|
||||
? o.selected
|
||||
: 0;
|
||||
|
||||
// Take disabling tabs via class attribute from HTML
|
||||
// into account and update option properly.
|
||||
// A selected tab cannot become disabled.
|
||||
o.disabled = $.unique( o.disabled.concat(
|
||||
$.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) {
|
||||
return self.lis.index( n );
|
||||
})
|
||||
) ).sort();
|
||||
|
||||
if ( $.inArray( o.selected, o.disabled ) != -1 ) {
|
||||
o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );
|
||||
}
|
||||
|
||||
// highlight selected tab
|
||||
this.panels.addClass( "ui-tabs-hide" );
|
||||
this.lis.removeClass( "ui-tabs-selected ui-state-active" );
|
||||
// check for length avoids error when initializing empty list
|
||||
if ( o.selected >= 0 && this.anchors.length ) {
|
||||
self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" );
|
||||
this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" );
|
||||
|
||||
// seems to be expected behavior that the show callback is fired
|
||||
self.element.queue( "tabs", function() {
|
||||
self._trigger( "show", null,
|
||||
self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) );
|
||||
});
|
||||
|
||||
this.load( o.selected );
|
||||
}
|
||||
|
||||
// clean up to avoid memory leaks in certain versions of IE 6
|
||||
// TODO: namespace this event
|
||||
$( window ).bind( "unload", function() {
|
||||
self.lis.add( self.anchors ).unbind( ".tabs" );
|
||||
self.lis = self.anchors = self.panels = null;
|
||||
});
|
||||
// update selected after add/remove
|
||||
} else {
|
||||
o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
|
||||
}
|
||||
|
||||
// update collapsible
|
||||
// TODO: use .toggleClass()
|
||||
this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" );
|
||||
|
||||
// set or update cookie after init and add/remove respectively
|
||||
if ( o.cookie ) {
|
||||
this._cookie( o.selected, o.cookie );
|
||||
}
|
||||
|
||||
// disable tabs
|
||||
for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {
|
||||
$( li )[ $.inArray( i, o.disabled ) != -1 &&
|
||||
// TODO: use .toggleClass()
|
||||
!$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" );
|
||||
}
|
||||
|
||||
// reset cache if switching from cached to not cached
|
||||
if ( o.cache === false ) {
|
||||
this.anchors.removeData( "cache.tabs" );
|
||||
}
|
||||
|
||||
// remove all handlers before, tabify may run on existing tabs after add or option change
|
||||
this.lis.add( this.anchors ).unbind( ".tabs" );
|
||||
|
||||
if ( o.event !== "mouseover" ) {
|
||||
var addState = function( state, el ) {
|
||||
if ( el.is( ":not(.ui-state-disabled)" ) ) {
|
||||
el.addClass( "ui-state-" + state );
|
||||
}
|
||||
};
|
||||
var removeState = function( state, el ) {
|
||||
el.removeClass( "ui-state-" + state );
|
||||
};
|
||||
this.lis.bind( "mouseover.tabs" , function() {
|
||||
addState( "hover", $( this ) );
|
||||
});
|
||||
this.lis.bind( "mouseout.tabs", function() {
|
||||
removeState( "hover", $( this ) );
|
||||
});
|
||||
this.anchors.bind( "focus.tabs", function() {
|
||||
addState( "focus", $( this ).closest( "li" ) );
|
||||
});
|
||||
this.anchors.bind( "blur.tabs", function() {
|
||||
removeState( "focus", $( this ).closest( "li" ) );
|
||||
});
|
||||
}
|
||||
|
||||
// set up animations
|
||||
var hideFx, showFx;
|
||||
if ( o.fx ) {
|
||||
if ( $.isArray( o.fx ) ) {
|
||||
hideFx = o.fx[ 0 ];
|
||||
showFx = o.fx[ 1 ];
|
||||
} else {
|
||||
hideFx = showFx = o.fx;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset certain styles left over from animation
|
||||
// and prevent IE's ClearType bug...
|
||||
function resetStyle( $el, fx ) {
|
||||
$el.css( "display", "" );
|
||||
if ( !$.support.opacity && fx.opacity ) {
|
||||
$el[ 0 ].style.removeAttribute( "filter" );
|
||||
}
|
||||
}
|
||||
|
||||
// Show a tab...
|
||||
var showTab = showFx
|
||||
? function( clicked, $show ) {
|
||||
$( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
|
||||
$show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way
|
||||
.animate( showFx, showFx.duration || "normal", function() {
|
||||
resetStyle( $show, showFx );
|
||||
self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
|
||||
});
|
||||
}
|
||||
: function( clicked, $show ) {
|
||||
$( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
|
||||
$show.removeClass( "ui-tabs-hide" );
|
||||
self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
|
||||
};
|
||||
|
||||
// Hide a tab, $show is optional...
|
||||
var hideTab = hideFx
|
||||
? function( clicked, $hide ) {
|
||||
$hide.animate( hideFx, hideFx.duration || "normal", function() {
|
||||
self.lis.removeClass( "ui-tabs-selected ui-state-active" );
|
||||
$hide.addClass( "ui-tabs-hide" );
|
||||
resetStyle( $hide, hideFx );
|
||||
self.element.dequeue( "tabs" );
|
||||
});
|
||||
}
|
||||
: function( clicked, $hide, $show ) {
|
||||
self.lis.removeClass( "ui-tabs-selected ui-state-active" );
|
||||
$hide.addClass( "ui-tabs-hide" );
|
||||
self.element.dequeue( "tabs" );
|
||||
};
|
||||
|
||||
// attach tab event handler, unbind to avoid duplicates from former tabifying...
|
||||
this.anchors.bind( o.event + ".tabs", function() {
|
||||
var el = this,
|
||||
$li = $(el).closest( "li" ),
|
||||
$hide = self.panels.filter( ":not(.ui-tabs-hide)" ),
|
||||
$show = self.element.find( self._sanitizeSelector( el.hash ) );
|
||||
|
||||
// If tab is already selected and not collapsible or tab disabled or
|
||||
// or is already loading or click callback returns false stop here.
|
||||
// Check if click handler returns false last so that it is not executed
|
||||
// for a disabled or loading tab!
|
||||
if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
|
||||
$li.hasClass( "ui-state-disabled" ) ||
|
||||
$li.hasClass( "ui-state-processing" ) ||
|
||||
self.panels.filter( ":animated" ).length ||
|
||||
self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
|
||||
o.selected = self.anchors.index( this );
|
||||
|
||||
self.abort();
|
||||
|
||||
// if tab may be closed
|
||||
if ( o.collapsible ) {
|
||||
if ( $li.hasClass( "ui-tabs-selected" ) ) {
|
||||
o.selected = -1;
|
||||
|
||||
if ( o.cookie ) {
|
||||
self._cookie( o.selected, o.cookie );
|
||||
}
|
||||
|
||||
self.element.queue( "tabs", function() {
|
||||
hideTab( el, $hide );
|
||||
}).dequeue( "tabs" );
|
||||
|
||||
this.blur();
|
||||
return false;
|
||||
} else if ( !$hide.length ) {
|
||||
if ( o.cookie ) {
|
||||
self._cookie( o.selected, o.cookie );
|
||||
}
|
||||
|
||||
self.element.queue( "tabs", function() {
|
||||
showTab( el, $show );
|
||||
});
|
||||
|
||||
// TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
|
||||
self.load( self.anchors.index( this ) );
|
||||
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( o.cookie ) {
|
||||
self._cookie( o.selected, o.cookie );
|
||||
}
|
||||
|
||||
// show new tab
|
||||
if ( $show.length ) {
|
||||
if ( $hide.length ) {
|
||||
self.element.queue( "tabs", function() {
|
||||
hideTab( el, $hide );
|
||||
});
|
||||
}
|
||||
self.element.queue( "tabs", function() {
|
||||
showTab( el, $show );
|
||||
});
|
||||
|
||||
self.load( self.anchors.index( this ) );
|
||||
} else {
|
||||
throw "jQuery UI Tabs: Mismatching fragment identifier.";
|
||||
}
|
||||
|
||||
// Prevent IE from keeping other link focussed when using the back button
|
||||
// and remove dotted border from clicked link. This is controlled via CSS
|
||||
// in modern browsers; blur() removes focus from address bar in Firefox
|
||||
// which can become a usability and annoying problem with tabs('rotate').
|
||||
//if ( $.browser.msie ) {
|
||||
// this.blur();
|
||||
//}
|
||||
});
|
||||
|
||||
// disable click in any case
|
||||
this.anchors.bind( "click.tabs", function(){
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
_getIndex: function( index ) {
|
||||
// meta-function to give users option to provide a href string instead of a numerical index.
|
||||
// also sanitizes numerical indexes to valid values.
|
||||
if ( typeof index == "string" ) {
|
||||
index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
|
||||
}
|
||||
|
||||
return index;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
var o = this.options;
|
||||
|
||||
this.abort();
|
||||
|
||||
this.element
|
||||
.unbind( ".tabs" )
|
||||
.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" )
|
||||
.removeData( "tabs" );
|
||||
|
||||
this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
|
||||
|
||||
this.anchors.each(function() {
|
||||
var href = $.data( this, "href.tabs" );
|
||||
if ( href ) {
|
||||
this.href = href;
|
||||
}
|
||||
var $this = $( this ).unbind( ".tabs" );
|
||||
$.each( [ "href", "load", "cache" ], function( i, prefix ) {
|
||||
$this.removeData( prefix + ".tabs" );
|
||||
});
|
||||
});
|
||||
|
||||
this.lis.unbind( ".tabs" ).add( this.panels ).each(function() {
|
||||
if ( $.data( this, "destroy.tabs" ) ) {
|
||||
$( this ).remove();
|
||||
} else {
|
||||
$( this ).removeClass([
|
||||
"ui-state-default",
|
||||
"ui-corner-top",
|
||||
"ui-tabs-selected",
|
||||
"ui-state-active",
|
||||
"ui-state-hover",
|
||||
"ui-state-focus",
|
||||
"ui-state-disabled",
|
||||
"ui-tabs-panel",
|
||||
"ui-widget-content",
|
||||
"ui-corner-bottom",
|
||||
"ui-tabs-hide"
|
||||
].join( " " ) );
|
||||
}
|
||||
});
|
||||
|
||||
if ( o.cookie ) {
|
||||
this._cookie( null, o.cookie );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
add: function( url, label, index ) {
|
||||
if ( index === undefined ) {
|
||||
index = this.anchors.length;
|
||||
}
|
||||
|
||||
var self = this,
|
||||
o = this.options,
|
||||
$li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ),
|
||||
id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] );
|
||||
|
||||
$li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true );
|
||||
|
||||
// try to find an existing element before creating a new one
|
||||
var $panel = self.element.find( "#" + id );
|
||||
if ( !$panel.length ) {
|
||||
$panel = $( o.panelTemplate )
|
||||
.attr( "id", id )
|
||||
.data( "destroy.tabs", true );
|
||||
}
|
||||
$panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" );
|
||||
|
||||
if ( index >= this.lis.length ) {
|
||||
$li.appendTo( this.list );
|
||||
$panel.appendTo( this.list[ 0 ].parentNode );
|
||||
} else {
|
||||
$li.insertBefore( this.lis[ index ] );
|
||||
$panel.insertBefore( this.panels[ index ] );
|
||||
}
|
||||
|
||||
o.disabled = $.map( o.disabled, function( n, i ) {
|
||||
return n >= index ? ++n : n;
|
||||
});
|
||||
|
||||
this._tabify();
|
||||
|
||||
if ( this.anchors.length == 1 ) {
|
||||
o.selected = 0;
|
||||
$li.addClass( "ui-tabs-selected ui-state-active" );
|
||||
$panel.removeClass( "ui-tabs-hide" );
|
||||
this.element.queue( "tabs", function() {
|
||||
self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) );
|
||||
});
|
||||
|
||||
this.load( 0 );
|
||||
}
|
||||
|
||||
this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
|
||||
return this;
|
||||
},
|
||||
|
||||
remove: function( index ) {
|
||||
index = this._getIndex( index );
|
||||
var o = this.options,
|
||||
$li = this.lis.eq( index ).remove(),
|
||||
$panel = this.panels.eq( index ).remove();
|
||||
|
||||
// If selected tab was removed focus tab to the right or
|
||||
// in case the last tab was removed the tab to the left.
|
||||
if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) {
|
||||
this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );
|
||||
}
|
||||
|
||||
o.disabled = $.map(
|
||||
$.grep( o.disabled, function(n, i) {
|
||||
return n != index;
|
||||
}),
|
||||
function( n, i ) {
|
||||
return n >= index ? --n : n;
|
||||
});
|
||||
|
||||
this._tabify();
|
||||
|
||||
this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) );
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function( index ) {
|
||||
index = this._getIndex( index );
|
||||
var o = this.options;
|
||||
if ( $.inArray( index, o.disabled ) == -1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lis.eq( index ).removeClass( "ui-state-disabled" );
|
||||
o.disabled = $.grep( o.disabled, function( n, i ) {
|
||||
return n != index;
|
||||
});
|
||||
|
||||
this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
|
||||
return this;
|
||||
},
|
||||
|
||||
disable: function( index ) {
|
||||
index = this._getIndex( index );
|
||||
var self = this, o = this.options;
|
||||
// cannot disable already selected tab
|
||||
if ( index != o.selected ) {
|
||||
this.lis.eq( index ).addClass( "ui-state-disabled" );
|
||||
|
||||
o.disabled.push( index );
|
||||
o.disabled.sort();
|
||||
|
||||
this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
select: function( index ) {
|
||||
index = this._getIndex( index );
|
||||
if ( index == -1 ) {
|
||||
if ( this.options.collapsible && this.options.selected != -1 ) {
|
||||
index = this.options.selected;
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
this.anchors.eq( index ).trigger( this.options.event + ".tabs" );
|
||||
return this;
|
||||
},
|
||||
|
||||
load: function( index ) {
|
||||
index = this._getIndex( index );
|
||||
var self = this,
|
||||
o = this.options,
|
||||
a = this.anchors.eq( index )[ 0 ],
|
||||
url = $.data( a, "load.tabs" );
|
||||
|
||||
this.abort();
|
||||
|
||||
// not remote or from cache
|
||||
if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) {
|
||||
this.element.dequeue( "tabs" );
|
||||
return;
|
||||
}
|
||||
|
||||
// load remote from here on
|
||||
this.lis.eq( index ).addClass( "ui-state-processing" );
|
||||
|
||||
if ( o.spinner ) {
|
||||
var span = $( "span", a );
|
||||
span.data( "label.tabs", span.html() ).html( o.spinner );
|
||||
}
|
||||
|
||||
this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {
|
||||
url: url,
|
||||
success: function( r, s ) {
|
||||
self.element.find( self._sanitizeSelector( a.hash ) ).html( r );
|
||||
|
||||
// take care of tab labels
|
||||
self._cleanup();
|
||||
|
||||
if ( o.cache ) {
|
||||
$.data( a, "cache.tabs", true );
|
||||
}
|
||||
|
||||
self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
|
||||
try {
|
||||
o.ajaxOptions.success( r, s );
|
||||
}
|
||||
catch ( e ) {}
|
||||
},
|
||||
error: function( xhr, s, e ) {
|
||||
// take care of tab labels
|
||||
self._cleanup();
|
||||
|
||||
self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
|
||||
try {
|
||||
// Passing index avoid a race condition when this method is
|
||||
// called after the user has selected another tab.
|
||||
// Pass the anchor that initiated this request allows
|
||||
// loadError to manipulate the tab content panel via $(a.hash)
|
||||
o.ajaxOptions.error( xhr, s, index, a );
|
||||
}
|
||||
catch ( e ) {}
|
||||
}
|
||||
} ) );
|
||||
|
||||
// last, so that load event is fired before show...
|
||||
self.element.dequeue( "tabs" );
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
abort: function() {
|
||||
// stop possibly running animations
|
||||
this.element.queue( [] );
|
||||
this.panels.stop( false, true );
|
||||
|
||||
// "tabs" queue must not contain more than two elements,
|
||||
// which are the callbacks for the latest clicked tab...
|
||||
this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) );
|
||||
|
||||
// terminate pending requests from other tabs
|
||||
if ( this.xhr ) {
|
||||
this.xhr.abort();
|
||||
delete this.xhr;
|
||||
}
|
||||
|
||||
// take care of tab labels
|
||||
this._cleanup();
|
||||
return this;
|
||||
},
|
||||
|
||||
url: function( index, url ) {
|
||||
this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url );
|
||||
return this;
|
||||
},
|
||||
|
||||
length: function() {
|
||||
return this.anchors.length;
|
||||
}
|
||||
});
|
||||
|
||||
$.extend( $.ui.tabs, {
|
||||
version: "1.8.22"
|
||||
});
|
||||
|
||||
/*
|
||||
* Tabs Extensions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Rotate
|
||||
*/
|
||||
$.extend( $.ui.tabs.prototype, {
|
||||
rotation: null,
|
||||
rotate: function( ms, continuing ) {
|
||||
var self = this,
|
||||
o = this.options;
|
||||
|
||||
var rotate = self._rotate || ( self._rotate = function( e ) {
|
||||
clearTimeout( self.rotation );
|
||||
self.rotation = setTimeout(function() {
|
||||
var t = o.selected;
|
||||
self.select( ++t < self.anchors.length ? t : 0 );
|
||||
}, ms );
|
||||
|
||||
if ( e ) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
var stop = self._unrotate || ( self._unrotate = !continuing
|
||||
? function(e) {
|
||||
if (e.clientX) { // in case of a true click
|
||||
self.rotate(null);
|
||||
}
|
||||
}
|
||||
: function( e ) {
|
||||
rotate();
|
||||
});
|
||||
|
||||
// start rotation
|
||||
if ( ms ) {
|
||||
this.element.bind( "tabsshow", rotate );
|
||||
this.anchors.bind( o.event + ".tabs", stop );
|
||||
rotate();
|
||||
// stop rotation
|
||||
} else {
|
||||
clearTimeout( self.rotation );
|
||||
this.element.unbind( "tabsshow", rotate );
|
||||
this.anchors.unbind( o.event + ".tabs", stop );
|
||||
delete this._rotate;
|
||||
delete this._unrotate;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
+272
@@ -0,0 +1,272 @@
|
||||
/*!
|
||||
* jQuery UI Widget 1.8.22
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function( $, undefined ) {
|
||||
|
||||
// jQuery 1.4+
|
||||
if ( $.cleanData ) {
|
||||
var _cleanData = $.cleanData;
|
||||
$.cleanData = function( elems ) {
|
||||
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
||||
try {
|
||||
$( elem ).triggerHandler( "remove" );
|
||||
// http://bugs.jquery.com/ticket/8235
|
||||
} catch( e ) {}
|
||||
}
|
||||
_cleanData( elems );
|
||||
};
|
||||
} else {
|
||||
var _remove = $.fn.remove;
|
||||
$.fn.remove = function( selector, keepData ) {
|
||||
return this.each(function() {
|
||||
if ( !keepData ) {
|
||||
if ( !selector || $.filter( selector, [ this ] ).length ) {
|
||||
$( "*", this ).add( [ this ] ).each(function() {
|
||||
try {
|
||||
$( this ).triggerHandler( "remove" );
|
||||
// http://bugs.jquery.com/ticket/8235
|
||||
} catch( e ) {}
|
||||
});
|
||||
}
|
||||
}
|
||||
return _remove.call( $(this), selector, keepData );
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
$.widget = function( name, base, prototype ) {
|
||||
var namespace = name.split( "." )[ 0 ],
|
||||
fullName;
|
||||
name = name.split( "." )[ 1 ];
|
||||
fullName = namespace + "-" + name;
|
||||
|
||||
if ( !prototype ) {
|
||||
prototype = base;
|
||||
base = $.Widget;
|
||||
}
|
||||
|
||||
// create selector for plugin
|
||||
$.expr[ ":" ][ fullName ] = function( elem ) {
|
||||
return !!$.data( elem, name );
|
||||
};
|
||||
|
||||
$[ namespace ] = $[ namespace ] || {};
|
||||
$[ namespace ][ name ] = function( options, element ) {
|
||||
// allow instantiation without initializing for simple inheritance
|
||||
if ( arguments.length ) {
|
||||
this._createWidget( options, element );
|
||||
}
|
||||
};
|
||||
|
||||
var basePrototype = new base();
|
||||
// we need to make the options hash a property directly on the new instance
|
||||
// otherwise we'll modify the options hash on the prototype that we're
|
||||
// inheriting from
|
||||
// $.each( basePrototype, function( key, val ) {
|
||||
// if ( $.isPlainObject(val) ) {
|
||||
// basePrototype[ key ] = $.extend( {}, val );
|
||||
// }
|
||||
// });
|
||||
basePrototype.options = $.extend( true, {}, basePrototype.options );
|
||||
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
||||
namespace: namespace,
|
||||
widgetName: name,
|
||||
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
||||
widgetBaseClass: fullName
|
||||
}, prototype );
|
||||
|
||||
$.widget.bridge( name, $[ namespace ][ name ] );
|
||||
};
|
||||
|
||||
$.widget.bridge = function( name, object ) {
|
||||
$.fn[ name ] = function( options ) {
|
||||
var isMethodCall = typeof options === "string",
|
||||
args = Array.prototype.slice.call( arguments, 1 ),
|
||||
returnValue = this;
|
||||
|
||||
// allow multiple hashes to be passed on init
|
||||
options = !isMethodCall && args.length ?
|
||||
$.extend.apply( null, [ true, options ].concat(args) ) :
|
||||
options;
|
||||
|
||||
// prevent calls to internal methods
|
||||
if ( isMethodCall && options.charAt( 0 ) === "_" ) {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
if ( isMethodCall ) {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, name ),
|
||||
methodValue = instance && $.isFunction( instance[options] ) ?
|
||||
instance[ options ].apply( instance, args ) :
|
||||
instance;
|
||||
// TODO: add this back in 1.9 and use $.error() (see #5972)
|
||||
// if ( !instance ) {
|
||||
// throw "cannot call methods on " + name + " prior to initialization; " +
|
||||
// "attempted to call method '" + options + "'";
|
||||
// }
|
||||
// if ( !$.isFunction( instance[options] ) ) {
|
||||
// throw "no such method '" + options + "' for " + name + " widget instance";
|
||||
// }
|
||||
// var methodValue = instance[ options ].apply( instance, args );
|
||||
if ( methodValue !== instance && methodValue !== undefined ) {
|
||||
returnValue = methodValue;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, name );
|
||||
if ( instance ) {
|
||||
instance.option( options || {} )._init();
|
||||
} else {
|
||||
$.data( this, name, new object( options, this ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
};
|
||||
|
||||
$.Widget = function( options, element ) {
|
||||
// allow instantiation without initializing for simple inheritance
|
||||
if ( arguments.length ) {
|
||||
this._createWidget( options, element );
|
||||
}
|
||||
};
|
||||
|
||||
$.Widget.prototype = {
|
||||
widgetName: "widget",
|
||||
widgetEventPrefix: "",
|
||||
options: {
|
||||
disabled: false
|
||||
},
|
||||
_createWidget: function( options, element ) {
|
||||
// $.widget.bridge stores the plugin instance, but we do it anyway
|
||||
// so that it's stored even before the _create function runs
|
||||
$.data( element, this.widgetName, this );
|
||||
this.element = $( element );
|
||||
this.options = $.extend( true, {},
|
||||
this.options,
|
||||
this._getCreateOptions(),
|
||||
options );
|
||||
|
||||
var self = this;
|
||||
this.element.bind( "remove." + this.widgetName, function() {
|
||||
self.destroy();
|
||||
});
|
||||
|
||||
this._create();
|
||||
this._trigger( "create" );
|
||||
this._init();
|
||||
},
|
||||
_getCreateOptions: function() {
|
||||
return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
|
||||
},
|
||||
_create: function() {},
|
||||
_init: function() {},
|
||||
|
||||
destroy: function() {
|
||||
this.element
|
||||
.unbind( "." + this.widgetName )
|
||||
.removeData( this.widgetName );
|
||||
this.widget()
|
||||
.unbind( "." + this.widgetName )
|
||||
.removeAttr( "aria-disabled" )
|
||||
.removeClass(
|
||||
this.widgetBaseClass + "-disabled " +
|
||||
"ui-state-disabled" );
|
||||
},
|
||||
|
||||
widget: function() {
|
||||
return this.element;
|
||||
},
|
||||
|
||||
option: function( key, value ) {
|
||||
var options = key;
|
||||
|
||||
if ( arguments.length === 0 ) {
|
||||
// don't return a reference to the internal hash
|
||||
return $.extend( {}, this.options );
|
||||
}
|
||||
|
||||
if (typeof key === "string" ) {
|
||||
if ( value === undefined ) {
|
||||
return this.options[ key ];
|
||||
}
|
||||
options = {};
|
||||
options[ key ] = value;
|
||||
}
|
||||
|
||||
this._setOptions( options );
|
||||
|
||||
return this;
|
||||
},
|
||||
_setOptions: function( options ) {
|
||||
var self = this;
|
||||
$.each( options, function( key, value ) {
|
||||
self._setOption( key, value );
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
_setOption: function( key, value ) {
|
||||
this.options[ key ] = value;
|
||||
|
||||
if ( key === "disabled" ) {
|
||||
this.widget()
|
||||
[ value ? "addClass" : "removeClass"](
|
||||
this.widgetBaseClass + "-disabled" + " " +
|
||||
"ui-state-disabled" )
|
||||
.attr( "aria-disabled", value );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
return this._setOption( "disabled", false );
|
||||
},
|
||||
disable: function() {
|
||||
return this._setOption( "disabled", true );
|
||||
},
|
||||
|
||||
_trigger: function( type, event, data ) {
|
||||
var prop, orig,
|
||||
callback = this.options[ type ];
|
||||
|
||||
data = data || {};
|
||||
event = $.Event( event );
|
||||
event.type = ( type === this.widgetEventPrefix ?
|
||||
type :
|
||||
this.widgetEventPrefix + type ).toLowerCase();
|
||||
// the original event may come from any element
|
||||
// so we need to reset the target on the new event
|
||||
event.target = this.element[ 0 ];
|
||||
|
||||
// copy original event properties over to the new event
|
||||
orig = event.originalEvent;
|
||||
if ( orig ) {
|
||||
for ( prop in orig ) {
|
||||
if ( !( prop in event ) ) {
|
||||
event[ prop ] = orig[ prop ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.element.trigger( event, data );
|
||||
|
||||
return !( $.isFunction(callback) &&
|
||||
callback.call( this.element[0], event, data ) === false ||
|
||||
event.isDefaultPrevented() );
|
||||
}
|
||||
};
|
||||
|
||||
})( jQuery );
|
||||
Reference in New Issue
Block a user