SBO Commit
This commit is contained in:
parent
93390e3628
commit
39a249b0f1
|
|
@ -0,0 +1,240 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||||
|
<meta name="author" content="">
|
||||||
|
<script type="text/javascript">
|
||||||
|
function MM_preloadImages() { //v3.0
|
||||||
|
var d = document;
|
||||||
|
if (d.images) {
|
||||||
|
if (!d.MM_p) d.MM_p = new Array();
|
||||||
|
var i, j = d.MM_p.length
|
||||||
|
, a = MM_preloadImages.arguments;
|
||||||
|
for (i = 0; i < a.length; i++)
|
||||||
|
if (a[i].indexOf("#") != 0) {
|
||||||
|
d.MM_p[j] = new Image;
|
||||||
|
d.MM_p[j++].src = a[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function MM_swapImgRestore() { //v3.0
|
||||||
|
var i, x, a = document.MM_sr;
|
||||||
|
for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
|
||||||
|
}
|
||||||
|
|
||||||
|
function MM_findObj(n, d) { //v4.01
|
||||||
|
var p, i, x;
|
||||||
|
if (!d) d = document;
|
||||||
|
if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
|
||||||
|
d = parent.frames[n.substring(p + 1)].document;
|
||||||
|
n = n.substring(0, p);
|
||||||
|
}
|
||||||
|
if (!(x = d[n]) && d.all) x = d.all[n];
|
||||||
|
for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
|
||||||
|
for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
|
||||||
|
if (!x && d.getElementById) x = d.getElementById(n);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
function MM_swapImage() { //v3.0
|
||||||
|
var i, j = 0
|
||||||
|
, x, a = MM_swapImage.arguments;
|
||||||
|
document.MM_sr = new Array;
|
||||||
|
for (i = 0; i < (a.length - 2); i += 3)
|
||||||
|
if ((x = MM_findObj(a[i])) != null) {
|
||||||
|
document.MM_sr[j++] = x;
|
||||||
|
if (!x.oSrc) x.oSrc = x.src;
|
||||||
|
x.src = a[i + 2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<meta name="SkyFly Travel - Gyors, megbízható,kényelmes reptéri transzferek!" content="Reptéri transzfer - Gyors, megbízható,kényelmes reptéri transzferek!" />
|
||||||
|
<meta name="Description" content="Reptéri transzfer - Gyors, megbízható,kényelmes! Főbb útvonalak Győr - Bécs (Schwechat) / Győr - Budapest Liszt Ferenc reptér (Ferihegy) / Budapest - Bécs ! Info: +36305543838 (0-24)" />
|
||||||
|
<meta name="Keywords" content="személyszállítás
|
||||||
|
transzfer Győr, Budapest, Bécs, Pozsony
|
||||||
|
airport Shuttle
|
||||||
|
Airport taxi
|
||||||
|
Reptéri járatok
|
||||||
|
Repülőtéri transzfer
|
||||||
|
Budapest reptér
|
||||||
|
Pozsony repter
|
||||||
|
Bécs reptér (Vienna Airport)
|
||||||
|
Transfer Budapest airport
|
||||||
|
Transfer Vienna Airport" />
|
||||||
|
<link rel="icon" href="favicon.ico">
|
||||||
|
<title>SkyFly Travel - INFORMÁCIÓ KÉRÉS</title>
|
||||||
|
<!-- Bootstrap core CSS -->
|
||||||
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
|
||||||
|
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
|
||||||
|
<script src="js/ie-emulation-modes-warning.js"></script>
|
||||||
|
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
<!-- Custom styles for this template -->
|
||||||
|
<link href="carousel.css" rel="stylesheet"> </head>
|
||||||
|
<!-- NAVBV
|
||||||
|
==================================================-->
|
||||||
|
<div class="navbar-wrapper">
|
||||||
|
<div class="container">
|
||||||
|
<nav class="navbar navbar-inverse navbar-static-top">
|
||||||
|
<div class="container">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
|
||||||
|
<a class="navbar-brand visible-xs-block" href="#"><img style="max-width:100px; margin-top:-4px" src="images/logo-white.png" alt="SkyFly Logo"></a>
|
||||||
|
</div>
|
||||||
|
<div id="navbar" class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li>
|
||||||
|
<a href="index.html" class="glyphicon glyphicon-home"></a>
|
||||||
|
</li>
|
||||||
|
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">SZOLGÁLTATÁSOK<span class="caret"></span></a>
|
||||||
|
<ul class="navbar-right dropdown-menu" role="menu">
|
||||||
|
<li><a href="repteri.html">REPTÉRI TRANSZFER</a></li>
|
||||||
|
<li><a href="egyeb_szolg.html">EGYÉB SZEMÉLYSZÁLLÍTÁS </a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><a href="viteldij.html">VITELDÍJAK</a></li>
|
||||||
|
<li><a href="https://app.skyflytravel.hu/public/offers/new">ONLINE FOGLALÁS / AJÁNLAT</a></li>
|
||||||
|
<li><a href="feltetel.html">FELTÉTELEK</a></li>
|
||||||
|
<li><a href="flotta.html">FLOTTA</a></li>
|
||||||
|
<li><a href="eler.html">KAPCSOLAT</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<li class="active">
|
||||||
|
<a class="glyphicon glyphicon-envelope" href="#"></a>
|
||||||
|
</li>
|
||||||
|
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">HU<span class="caret"></span></a>
|
||||||
|
<ul class="navbar-right dropdown-menu" role="menu">
|
||||||
|
<li class="dropdown-header">Nyelv / Language / Sprache</li>
|
||||||
|
<li><a href="index.html">HU</a></li>
|
||||||
|
<li><a href="en-index.html">EN</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Marketing messaging and featurettes
|
||||||
|
================================================== -->
|
||||||
|
<!-- Wrap the rest of the page in another container to center all the content. -->
|
||||||
|
<div class="container marketing">
|
||||||
|
<div class="bs-docs-section">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1>INFORMÁCIÓ KÉRÉS</h1> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<div id="contact_form" class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<form role="form" id="feedbackForm" data-toggle="validator" data-disable="false">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="name">Név *</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" id="name" name="name" required/> <span class="input-group-addon"><i class="glyphicon glyphicon-unchecked form-control-feedback"></i></span> </div> <span class="help-block" style="display: none;">Kérem adja meg a nevét.</span> </div>
|
||||||
|
<!-- UNCOMMENT HERE IF YOU WANT TITLE, COMPANY, WEBSITE OR PHONE FIELDS - you must also uncomment values in $fields_req in sendmail.php
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="title">Title</label>
|
||||||
|
<input type="text" class="form-control optional" id="title" name="title" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="company">Company</label>
|
||||||
|
<input type="text" class="form-control optional" id="company" name="company" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="website">Website</label>
|
||||||
|
<input type="url" class="form-control optional" id="website" name="website" />
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="email">Email elérhetőség *</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="email" class="form-control" id="email" name="email" required/> <span class="input-group-addon"><i class="glyphicon glyphicon-unchecked form-control-feedback"></i></span> </div> <span class="help-block" style="display: none;">Kérem adjon meg egy érvényes email címet.</span> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="phone">Telefonszám</label>
|
||||||
|
<input type="tel" class="form-control optional" id="phone" name="phone" /> <span class="help-block" style="display: none;">Kérem adja meg telefonszámát.</span> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="email">Szolgáltatás típusa *</label>
|
||||||
|
<select name="reason" class="form-control" required>
|
||||||
|
<option value="REPTÉRI TRANSZFER">REPTÉRI TRANSZFER</option>
|
||||||
|
<option value="EGYÉB SZEMÉLYSZÁLLÍTÁS">EGYÉB SZEMÉLYSZÁLLÍTÁS</option>
|
||||||
|
</select> <span class="help-block" style="display: none;">Kérem adja meg a szolgátatás tipusát.</span> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="message">Üzenet szövege *</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<textarea rows="5" cols="30" class="form-control" id="message" name="message" required></textarea> <span class="input-group-addon"><i class="glyphicon glyphicon-unchecked form-control-feedback"></i></span> </div> <span class="help-block" style="display: none;">Kérem adja meg az üzenet szövegét.</span> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<label class="control-label" for="GDPR">Hozzájárulok, hogy a Z+T BT. (mint a SkyFly Travel üzemeltetője) az <a href="/ADATVEDELEMI_SZABALYZAT_ZT.pdf" target="_blank"> Adatvédelmi szabályzatában</a> foglaltak szerint személyes adataimat kezelje, illetve feldolgozza. Ön az engedélyt bármikor visszavonhatja, melyet kérünk írásban jelezni elérhetőségeink egyikén.</label>
|
||||||
|
<input type="checkbox" class="form-control checkbox-inline" id="GDPR" name="GDPR" value="1"> <span class="input-group-addon"><i class="glyphicon glyphicon-unchecked form-control-feedback"></i></span> </div> <span class="help-block" style="display: none;">Kérem fogadja el az adatvédelmi szabályzatot.</span> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="g-recaptcha" data-sitekey="6LeT5goTAAAAAINzng9wvyF0rnfYipx40Yh2YttR"></div> <span class="help-block" style="display: none;">Kérem jeölje be a "Nem vagyok robot" opciót.</span> </div> <span class="help-block" style="display: none;">Adja meg a titkos kódot.</span>
|
||||||
|
<button type="submit" id="feedbackSubmit" class="btn btn-primary btn-lg" data-loading-text="Küldés..." style="display: block; margin-top: 10px;">
|
||||||
|
<p class="glyphicon glyphicon-send"></p> Üzenet küldése</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<!--/span-->
|
||||||
|
</div>
|
||||||
|
<!--/row-->
|
||||||
|
</div>
|
||||||
|
<!--/.container-->
|
||||||
|
<!-- <======= UP TO HERE -->
|
||||||
|
<hr class="featurette-divider">
|
||||||
|
<div class="row featurette" align="center">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<p>Tel.: <a href="tel:+36305543838">+36 30 5543838</a>   Email:<a href="mailto:info@skyflytravel.hu">info@skyflytravel.hu</a></p>
|
||||||
|
<p class="pull-right">
|
||||||
|
<a href="http://skyflytravel.hu/"><img src="images/logo-white.png" alt="SkyFly logo" width="213" height="60" /></a>
|
||||||
|
</p>
|
||||||
|
<p class="pull-left">
|
||||||
|
<a href="https://www.facebook.com/airporttransfer.gyor" target="_blank"><img src="images/Facebook-icon.png" alt="SkyFly Travel on Facebook" width="64" height="64" /></a>
|
||||||
|
<a href="https://plus.google.com/u/0/115420236176324532133/posts " target="_blank"><img src="images/GooglePlus-icon.png" alt="SykFly Travel on google+" width="64" height="64" /></a>
|
||||||
|
<a href="https://twitter.com/SkyFlyTravel1" target="_blank"><img src="images/Twitter-icon.png" alt="SykFly Travel on Twitter" width="64" height="64" /></a>
|
||||||
|
</p>
|
||||||
|
<p>Partnereink:</p>
|
||||||
|
<p>
|
||||||
|
<a href="http://www.airtourist.hu/hu" target="_blank"><img src="images/airtourist-logo.png" alt="SkyFly logo" width="150" height="39" /></a>
|
||||||
|
<a href="http://www.tosi.hu" target="_blank"> <img src="images/Tosi logo.jpg" alt="SkyFly logo" width="116" height="38" /></a>
|
||||||
|
</p>
|
||||||
|
<p class="text-muted"> reptéri transzfer, transzfer Győr, Budapest, Bécs Schwechat, Pozsony - airport Shuttle - Airport taxi - Reptéri járatok - Repülőtéri transzfer - Budapest reptér - Pozsony repter - Bécs reptér (Vienna Airport) - Transfer Budapest airport - Transfer Vienna Airport Budapest Liszt Ferenc Ferihegy</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /END THE FEATURETTES -->
|
||||||
|
<!-- FOOTER -->
|
||||||
|
<footer>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-3">
|
||||||
|
<div class="text-left"> © 2015 Z+T BT. - Sky Fly Travel. · </div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 text-center"> <a href="http://transzfer.lap.hu/" rel="nofollow" target="_blank">transzfer.lap.hu</a> | <a href="http://utasszallitas.lap.hu/" rel="nofollow" target="_blank">utasszallitas.lap.hu</a> | <a href="http://repuloter.lap.hu/" rel="nofollow" target="_blank">repuloter.lap.hu</a> </div>
|
||||||
|
<div class="col-lg-3">
|
||||||
|
<div class="text-right"> <a href="#">A lap tetejére</a> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
<!-- /.container -->
|
||||||
|
<!-- Bootstrap core JavaScript
|
||||||
|
================================================== -->
|
||||||
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
|
||||||
|
<script src="js/bootstrap.min.js"></script>
|
||||||
|
<script src="js/contact-form.js"></script>
|
||||||
|
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||||
|
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
|
||||||
|
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
||||||
|
<script src="js/ie10-viewport-bug-workaround.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
angular.module('SkyApp', [])
|
||||||
|
.controller('SkyController', ['$scope', function($scope) {
|
||||||
|
$scope.teszt="teszt";
|
||||||
|
}]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,618 @@
|
||||||
|
if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
|
||||||
|
+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap')
|
||||||
|
var transEndEventNames={'WebkitTransition':'webkitTransitionEnd','MozTransition':'transitionend','OTransition':'oTransitionEnd otransitionend','transition':'transitionend'}
|
||||||
|
for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}
|
||||||
|
return false}
|
||||||
|
$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this
|
||||||
|
$(this).one($.support.transition.end,function(){called=true})
|
||||||
|
var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
|
||||||
|
setTimeout(callback,duration)
|
||||||
|
return this}
|
||||||
|
$(function(){$.support.transition=transitionEnd()})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]'
|
||||||
|
var Alert=function(el){$(el).on('click',dismiss,this.close)}
|
||||||
|
Alert.prototype.close=function(e){var $this=$(this)
|
||||||
|
var selector=$this.attr('data-target')
|
||||||
|
if(!selector){selector=$this.attr('href')
|
||||||
|
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
|
||||||
|
var $parent=$(selector)
|
||||||
|
if(e)e.preventDefault()
|
||||||
|
if(!$parent.length){$parent=$this.hasClass('alert')?$this:$this.parent()}
|
||||||
|
$parent.trigger(e=$.Event('close.bs.alert'))
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
$parent.removeClass('in')
|
||||||
|
function removeElement(){$parent.trigger('closed.bs.alert').remove()}
|
||||||
|
$.support.transition&&$parent.hasClass('fade')?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()}
|
||||||
|
var old=$.fn.alert
|
||||||
|
$.fn.alert=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.alert')
|
||||||
|
if(!data)$this.data('bs.alert',(data=new Alert(this)))
|
||||||
|
if(typeof option=='string')data[option].call($this)})}
|
||||||
|
$.fn.alert.Constructor=Alert
|
||||||
|
$.fn.alert.noConflict=function(){$.fn.alert=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element)
|
||||||
|
this.options=$.extend({},Button.DEFAULTS,options)
|
||||||
|
this.isLoading=false}
|
||||||
|
Button.DEFAULTS={loadingText:'loading...'}
|
||||||
|
Button.prototype.setState=function(state){var d='disabled'
|
||||||
|
var $el=this.$element
|
||||||
|
var val=$el.is('input')?'val':'html'
|
||||||
|
var data=$el.data()
|
||||||
|
state=state+'Text'
|
||||||
|
if(!data.resetText)$el.data('resetText',$el[val]())
|
||||||
|
$el[val](data[state]||this.options[state])
|
||||||
|
setTimeout($.proxy(function(){if(state=='loadingText'){this.isLoading=true
|
||||||
|
$el.addClass(d).attr(d,d)}else if(this.isLoading){this.isLoading=false
|
||||||
|
$el.removeClass(d).removeAttr(d)}},this),0)}
|
||||||
|
Button.prototype.toggle=function(){var changed=true
|
||||||
|
var $parent=this.$element.closest('[data-toggle="buttons"]')
|
||||||
|
if($parent.length){var $input=this.$element.find('input')
|
||||||
|
if($input.prop('type')=='radio'){if($input.prop('checked')&&this.$element.hasClass('active'))changed=false
|
||||||
|
else $parent.find('.active').removeClass('active')}
|
||||||
|
if(changed)$input.prop('checked',!this.$element.hasClass('active')).trigger('change')}
|
||||||
|
if(changed)this.$element.toggleClass('active')}
|
||||||
|
var old=$.fn.button
|
||||||
|
$.fn.button=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.button')
|
||||||
|
var options=typeof option=='object'&&option
|
||||||
|
if(!data)$this.data('bs.button',(data=new Button(this,options)))
|
||||||
|
if(option=='toggle')data.toggle()
|
||||||
|
else if(option)data.setState(option)})}
|
||||||
|
$.fn.button.Constructor=Button
|
||||||
|
$.fn.button.noConflict=function(){$.fn.button=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.button.data-api','[data-toggle^=button]',function(e){var $btn=$(e.target)
|
||||||
|
if(!$btn.hasClass('btn'))$btn=$btn.closest('.btn')
|
||||||
|
$btn.button('toggle')
|
||||||
|
e.preventDefault()})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element)
|
||||||
|
this.$indicators=this.$element.find('.carousel-indicators')
|
||||||
|
this.options=options
|
||||||
|
this.paused=this.sliding=this.interval=this.$active=this.$items=null
|
||||||
|
this.options.pause=='hover'&&this.$element.on('mouseenter',$.proxy(this.pause,this)).on('mouseleave',$.proxy(this.cycle,this))}
|
||||||
|
Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true}
|
||||||
|
Carousel.prototype.cycle=function(e){e||(this.paused=false)
|
||||||
|
this.interval&&clearInterval(this.interval)
|
||||||
|
this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval))
|
||||||
|
return this}
|
||||||
|
Carousel.prototype.getActiveIndex=function(){this.$active=this.$element.find('.item.active')
|
||||||
|
this.$items=this.$active.parent().children()
|
||||||
|
return this.$items.index(this.$active)}
|
||||||
|
Carousel.prototype.to=function(pos){var that=this
|
||||||
|
var activeIndex=this.getActiveIndex()
|
||||||
|
if(pos>(this.$items.length- 1)||pos<0)return
|
||||||
|
if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)})
|
||||||
|
if(activeIndex==pos)return this.pause().cycle()
|
||||||
|
return this.slide(pos>activeIndex?'next':'prev',$(this.$items[pos]))}
|
||||||
|
Carousel.prototype.pause=function(e){e||(this.paused=true)
|
||||||
|
if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end)
|
||||||
|
this.cycle(true)}
|
||||||
|
this.interval=clearInterval(this.interval)
|
||||||
|
return this}
|
||||||
|
Carousel.prototype.next=function(){if(this.sliding)return
|
||||||
|
return this.slide('next')}
|
||||||
|
Carousel.prototype.prev=function(){if(this.sliding)return
|
||||||
|
return this.slide('prev')}
|
||||||
|
Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active')
|
||||||
|
var $next=next||$active[type]()
|
||||||
|
var isCycling=this.interval
|
||||||
|
var direction=type=='next'?'left':'right'
|
||||||
|
var fallback=type=='next'?'first':'last'
|
||||||
|
var that=this
|
||||||
|
if(!$next.length){if(!this.options.wrap)return
|
||||||
|
$next=this.$element.find('.item')[fallback]()}
|
||||||
|
if($next.hasClass('active'))return this.sliding=false
|
||||||
|
var e=$.Event('slide.bs.carousel',{relatedTarget:$next[0],direction:direction})
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
this.sliding=true
|
||||||
|
isCycling&&this.pause()
|
||||||
|
if(this.$indicators.length){this.$indicators.find('.active').removeClass('active')
|
||||||
|
this.$element.one('slid.bs.carousel',function(){var $nextIndicator=$(that.$indicators.children()[that.getActiveIndex()])
|
||||||
|
$nextIndicator&&$nextIndicator.addClass('active')})}
|
||||||
|
if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type)
|
||||||
|
$next[0].offsetWidth
|
||||||
|
$active.addClass(direction)
|
||||||
|
$next.addClass(direction)
|
||||||
|
$active.one($.support.transition.end,function(){$next.removeClass([type,direction].join(' ')).addClass('active')
|
||||||
|
$active.removeClass(['active',direction].join(' '))
|
||||||
|
that.sliding=false
|
||||||
|
setTimeout(function(){that.$element.trigger('slid.bs.carousel')},0)}).emulateTransitionEnd($active.css('transition-duration').slice(0,-1)*1000)}else{$active.removeClass('active')
|
||||||
|
$next.addClass('active')
|
||||||
|
this.sliding=false
|
||||||
|
this.$element.trigger('slid.bs.carousel')}
|
||||||
|
isCycling&&this.cycle()
|
||||||
|
return this}
|
||||||
|
var old=$.fn.carousel
|
||||||
|
$.fn.carousel=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.carousel')
|
||||||
|
var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option)
|
||||||
|
var action=typeof option=='string'?option:options.slide
|
||||||
|
if(!data)$this.data('bs.carousel',(data=new Carousel(this,options)))
|
||||||
|
if(typeof option=='number')data.to(option)
|
||||||
|
else if(action)data[action]()
|
||||||
|
else if(options.interval)data.pause().cycle()})}
|
||||||
|
$.fn.carousel.Constructor=Carousel
|
||||||
|
$.fn.carousel.noConflict=function(){$.fn.carousel=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.carousel.data-api','[data-slide], [data-slide-to]',function(e){var $this=$(this),href
|
||||||
|
var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''))
|
||||||
|
var options=$.extend({},$target.data(),$this.data())
|
||||||
|
var slideIndex=$this.attr('data-slide-to')
|
||||||
|
if(slideIndex)options.interval=false
|
||||||
|
$target.carousel(options)
|
||||||
|
if(slideIndex=$this.attr('data-slide-to')){$target.data('bs.carousel').to(slideIndex)}
|
||||||
|
e.preventDefault()})
|
||||||
|
$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this)
|
||||||
|
$carousel.carousel($carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element)
|
||||||
|
this.options=$.extend({},Collapse.DEFAULTS,options)
|
||||||
|
this.transitioning=null
|
||||||
|
if(this.options.parent)this.$parent=$(this.options.parent)
|
||||||
|
if(this.options.toggle)this.toggle()}
|
||||||
|
Collapse.DEFAULTS={toggle:true}
|
||||||
|
Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
|
||||||
|
return hasWidth?'width':'height'}
|
||||||
|
Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
|
||||||
|
var startEvent=$.Event('show.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if(startEvent.isDefaultPrevented())return
|
||||||
|
var actives=this.$parent&&this.$parent.find('> .panel > .in')
|
||||||
|
if(actives&&actives.length){var hasData=actives.data('bs.collapse')
|
||||||
|
if(hasData&&hasData.transitioning)return
|
||||||
|
actives.collapse('hide')
|
||||||
|
hasData||actives.data('bs.collapse',null)}
|
||||||
|
var dimension=this.dimension()
|
||||||
|
this.$element.removeClass('collapse').addClass('collapsing')
|
||||||
|
[dimension](0)
|
||||||
|
this.transitioning=1
|
||||||
|
var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')
|
||||||
|
[dimension]('auto')
|
||||||
|
this.transitioning=0
|
||||||
|
this.$element.trigger('shown.bs.collapse')}
|
||||||
|
if(!$.support.transition)return complete.call(this)
|
||||||
|
var scrollSize=$.camelCase(['scroll',dimension].join('-'))
|
||||||
|
this.$element.one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)
|
||||||
|
[dimension](this.$element[0][scrollSize])}
|
||||||
|
Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
|
||||||
|
var startEvent=$.Event('hide.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if(startEvent.isDefaultPrevented())return
|
||||||
|
var dimension=this.dimension()
|
||||||
|
this.$element
|
||||||
|
[dimension](this.$element[dimension]())
|
||||||
|
[0].offsetHeight
|
||||||
|
this.$element.addClass('collapsing').removeClass('collapse').removeClass('in')
|
||||||
|
this.transitioning=1
|
||||||
|
var complete=function(){this.transitioning=0
|
||||||
|
this.$element.trigger('hidden.bs.collapse').removeClass('collapsing').addClass('collapse')}
|
||||||
|
if(!$.support.transition)return complete.call(this)
|
||||||
|
this.$element
|
||||||
|
[dimension](0).one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)}
|
||||||
|
Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
|
||||||
|
var old=$.fn.collapse
|
||||||
|
$.fn.collapse=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.collapse')
|
||||||
|
var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
|
||||||
|
if(!data&&options.toggle&&option=='show')option=!option
|
||||||
|
if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.collapse.Constructor=Collapse
|
||||||
|
$.fn.collapse.noConflict=function(){$.fn.collapse=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.collapse.data-api','[data-toggle=collapse]',function(e){var $this=$(this),href
|
||||||
|
var target=$this.attr('data-target')||e.preventDefault()||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
|
||||||
|
var $target=$(target)
|
||||||
|
var data=$target.data('bs.collapse')
|
||||||
|
var option=data?'toggle':$this.data()
|
||||||
|
var parent=$this.attr('data-parent')
|
||||||
|
var $parent=parent&&$(parent)
|
||||||
|
if(!data||!data.transitioning){if($parent)$parent.find('[data-toggle=collapse][data-parent="'+ parent+'"]').not($this).addClass('collapsed')
|
||||||
|
$this[$target.hasClass('in')?'addClass':'removeClass']('collapsed')}
|
||||||
|
$target.collapse(option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop'
|
||||||
|
var toggle='[data-toggle=dropdown]'
|
||||||
|
var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
|
||||||
|
Dropdown.prototype.toggle=function(e){var $this=$(this)
|
||||||
|
if($this.is('.disabled, :disabled'))return
|
||||||
|
var $parent=getParent($this)
|
||||||
|
var isActive=$parent.hasClass('open')
|
||||||
|
clearMenus()
|
||||||
|
if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click',clearMenus)}
|
||||||
|
var relatedTarget={relatedTarget:this}
|
||||||
|
$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
$parent.toggleClass('open').trigger('shown.bs.dropdown',relatedTarget)
|
||||||
|
$this.focus()}
|
||||||
|
return false}
|
||||||
|
Dropdown.prototype.keydown=function(e){if(!/(38|40|27)/.test(e.keyCode))return
|
||||||
|
var $this=$(this)
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
if($this.is('.disabled, :disabled'))return
|
||||||
|
var $parent=getParent($this)
|
||||||
|
var isActive=$parent.hasClass('open')
|
||||||
|
if(!isActive||(isActive&&e.keyCode==27)){if(e.which==27)$parent.find(toggle).focus()
|
||||||
|
return $this.click()}
|
||||||
|
var desc=' li:not(.divider):visible a'
|
||||||
|
var $items=$parent.find('[role=menu]'+ desc+', [role=listbox]'+ desc)
|
||||||
|
if(!$items.length)return
|
||||||
|
var index=$items.index($items.filter(':focus'))
|
||||||
|
if(e.keyCode==38&&index>0)index--
|
||||||
|
if(e.keyCode==40&&index<$items.length- 1)index++
|
||||||
|
if(!~index)index=0
|
||||||
|
$items.eq(index).focus()}
|
||||||
|
function clearMenus(e){$(backdrop).remove()
|
||||||
|
$(toggle).each(function(){var $parent=getParent($(this))
|
||||||
|
var relatedTarget={relatedTarget:this}
|
||||||
|
if(!$parent.hasClass('open'))return
|
||||||
|
$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
$parent.removeClass('open').trigger('hidden.bs.dropdown',relatedTarget)})}
|
||||||
|
function getParent($this){var selector=$this.attr('data-target')
|
||||||
|
if(!selector){selector=$this.attr('href')
|
||||||
|
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
|
||||||
|
var $parent=selector&&$(selector)
|
||||||
|
return $parent&&$parent.length?$parent:$this.parent()}
|
||||||
|
var old=$.fn.dropdown
|
||||||
|
$.fn.dropdown=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.dropdown')
|
||||||
|
if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
|
||||||
|
if(typeof option=='string')data[option].call($this)})}
|
||||||
|
$.fn.dropdown.Constructor=Dropdown
|
||||||
|
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle+', [role=menu], [role=listbox]',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options
|
||||||
|
this.$element=$(element)
|
||||||
|
this.$backdrop=this.isShown=null
|
||||||
|
if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}}
|
||||||
|
Modal.DEFAULTS={backdrop:true,keyboard:true,show:true}
|
||||||
|
Modal.prototype.toggle=function(_relatedTarget){return this[!this.isShown?'show':'hide'](_relatedTarget)}
|
||||||
|
Modal.prototype.show=function(_relatedTarget){var that=this
|
||||||
|
var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if(this.isShown||e.isDefaultPrevented())return
|
||||||
|
this.isShown=true
|
||||||
|
this.escape()
|
||||||
|
this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
|
||||||
|
this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
|
||||||
|
if(!that.$element.parent().length){that.$element.appendTo(document.body)}
|
||||||
|
that.$element.show().scrollTop(0)
|
||||||
|
if(transition){that.$element[0].offsetWidth}
|
||||||
|
that.$element.addClass('in').attr('aria-hidden',false)
|
||||||
|
that.enforceFocus()
|
||||||
|
var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
|
||||||
|
transition?that.$element.find('.modal-dialog').one($.support.transition.end,function(){that.$element.focus().trigger(e)}).emulateTransitionEnd(300):that.$element.focus().trigger(e)})}
|
||||||
|
Modal.prototype.hide=function(e){if(e)e.preventDefault()
|
||||||
|
e=$.Event('hide.bs.modal')
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if(!this.isShown||e.isDefaultPrevented())return
|
||||||
|
this.isShown=false
|
||||||
|
this.escape()
|
||||||
|
$(document).off('focusin.bs.modal')
|
||||||
|
this.$element.removeClass('in').attr('aria-hidden',true).off('click.dismiss.bs.modal')
|
||||||
|
$.support.transition&&this.$element.hasClass('fade')?this.$element.one($.support.transition.end,$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}
|
||||||
|
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.focus()}},this))}
|
||||||
|
Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keyup.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keyup.dismiss.bs.modal')}}
|
||||||
|
Modal.prototype.hideModal=function(){var that=this
|
||||||
|
this.$element.hide()
|
||||||
|
this.backdrop(function(){that.removeBackdrop()
|
||||||
|
that.$element.trigger('hidden.bs.modal')})}
|
||||||
|
Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
|
||||||
|
this.$backdrop=null}
|
||||||
|
Modal.prototype.backdrop=function(callback){var animate=this.$element.hasClass('fade')?'fade':''
|
||||||
|
if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
|
||||||
|
this.$backdrop=$('<div class="modal-backdrop '+ animate+'" />').appendTo(document.body)
|
||||||
|
this.$element.on('click.dismiss.bs.modal',$.proxy(function(e){if(e.target!==e.currentTarget)return
|
||||||
|
this.options.backdrop=='static'?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this))
|
||||||
|
if(doAnimate)this.$backdrop[0].offsetWidth
|
||||||
|
this.$backdrop.addClass('in')
|
||||||
|
if(!callback)return
|
||||||
|
doAnimate?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
|
||||||
|
$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(callback){callback()}}
|
||||||
|
var old=$.fn.modal
|
||||||
|
$.fn.modal=function(option,_relatedTarget){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.modal')
|
||||||
|
var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
|
||||||
|
if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
|
||||||
|
if(typeof option=='string')data[option](_relatedTarget)
|
||||||
|
else if(options.show)data.show(_relatedTarget)})}
|
||||||
|
$.fn.modal.Constructor=Modal
|
||||||
|
$.fn.modal.noConflict=function(){$.fn.modal=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
|
||||||
|
var href=$this.attr('href')
|
||||||
|
var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,'')))
|
||||||
|
var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
|
||||||
|
if($this.is('a'))e.preventDefault()
|
||||||
|
$target.modal(option,this).one('hide',function(){$this.is(':visible')&&$this.focus()})})
|
||||||
|
$(document).on('show.bs.modal','.modal',function(){$(document.body).addClass('modal-open')}).on('hidden.bs.modal','.modal',function(){$(document.body).removeClass('modal-open')})}(jQuery);+function($){'use strict';var Tooltip=function(element,options){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null
|
||||||
|
this.init('tooltip',element,options)}
|
||||||
|
Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false}
|
||||||
|
Tooltip.prototype.init=function(type,element,options){this.enabled=true
|
||||||
|
this.type=type
|
||||||
|
this.$element=$(element)
|
||||||
|
this.options=this.getOptions(options)
|
||||||
|
var triggers=this.options.trigger.split(' ')
|
||||||
|
for(var i=triggers.length;i--;){var trigger=triggers[i]
|
||||||
|
if(trigger=='click'){this.$element.on('click.'+ this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
|
||||||
|
var eventOut=trigger=='hover'?'mouseleave':'focusout'
|
||||||
|
this.$element.on(eventIn+'.'+ this.type,this.options.selector,$.proxy(this.enter,this))
|
||||||
|
this.$element.on(eventOut+'.'+ this.type,this.options.selector,$.proxy(this.leave,this))}}
|
||||||
|
this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
|
||||||
|
Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
|
||||||
|
Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options)
|
||||||
|
if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
|
||||||
|
return options}
|
||||||
|
Tooltip.prototype.getDelegateOptions=function(){var options={}
|
||||||
|
var defaults=this.getDefaults()
|
||||||
|
this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
|
||||||
|
return options}
|
||||||
|
Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.'+ this.type)
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
self.hoverState='in'
|
||||||
|
if(!self.options.delay||!self.options.delay.show)return self.show()
|
||||||
|
self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
|
||||||
|
Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.'+ this.type)
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
self.hoverState='out'
|
||||||
|
if(!self.options.delay||!self.options.delay.hide)return self.hide()
|
||||||
|
self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
|
||||||
|
Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+ this.type)
|
||||||
|
if(this.hasContent()&&this.enabled){this.$element.trigger(e)
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
var that=this;var $tip=this.tip()
|
||||||
|
this.setContent()
|
||||||
|
if(this.options.animation)$tip.addClass('fade')
|
||||||
|
var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
|
||||||
|
var autoToken=/\s?auto?\s?/i
|
||||||
|
var autoPlace=autoToken.test(placement)
|
||||||
|
if(autoPlace)placement=placement.replace(autoToken,'')||'top'
|
||||||
|
$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement)
|
||||||
|
this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
|
||||||
|
var pos=this.getPosition()
|
||||||
|
var actualWidth=$tip[0].offsetWidth
|
||||||
|
var actualHeight=$tip[0].offsetHeight
|
||||||
|
if(autoPlace){var $parent=this.$element.parent()
|
||||||
|
var orgPlacement=placement
|
||||||
|
var docScroll=document.documentElement.scrollTop||document.body.scrollTop
|
||||||
|
var parentWidth=this.options.container=='body'?window.innerWidth:$parent.outerWidth()
|
||||||
|
var parentHeight=this.options.container=='body'?window.innerHeight:$parent.outerHeight()
|
||||||
|
var parentLeft=this.options.container=='body'?0:$parent.offset().left
|
||||||
|
placement=placement=='bottom'&&pos.top+ pos.height+ actualHeight- docScroll>parentHeight?'top':placement=='top'&&pos.top- docScroll- actualHeight<0?'bottom':placement=='right'&&pos.right+ actualWidth>parentWidth?'left':placement=='left'&&pos.left- actualWidth<parentLeft?'right':placement
|
||||||
|
$tip.removeClass(orgPlacement).addClass(placement)}
|
||||||
|
var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
|
||||||
|
this.applyPlacement(calculatedOffset,placement)
|
||||||
|
this.hoverState=null
|
||||||
|
var complete=function(){that.$element.trigger('shown.bs.'+ that.type)}
|
||||||
|
$.support.transition&&this.$tip.hasClass('fade')?$tip.one($.support.transition.end,complete).emulateTransitionEnd(150):complete()}}
|
||||||
|
Tooltip.prototype.applyPlacement=function(offset,placement){var replace
|
||||||
|
var $tip=this.tip()
|
||||||
|
var width=$tip[0].offsetWidth
|
||||||
|
var height=$tip[0].offsetHeight
|
||||||
|
var marginTop=parseInt($tip.css('margin-top'),10)
|
||||||
|
var marginLeft=parseInt($tip.css('margin-left'),10)
|
||||||
|
if(isNaN(marginTop))marginTop=0
|
||||||
|
if(isNaN(marginLeft))marginLeft=0
|
||||||
|
offset.top=offset.top+ marginTop
|
||||||
|
offset.left=offset.left+ marginLeft
|
||||||
|
$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
|
||||||
|
$tip.addClass('in')
|
||||||
|
var actualWidth=$tip[0].offsetWidth
|
||||||
|
var actualHeight=$tip[0].offsetHeight
|
||||||
|
if(placement=='top'&&actualHeight!=height){replace=true
|
||||||
|
offset.top=offset.top+ height- actualHeight}
|
||||||
|
if(/bottom|top/.test(placement)){var delta=0
|
||||||
|
if(offset.left<0){delta=offset.left*-2
|
||||||
|
offset.left=0
|
||||||
|
$tip.offset(offset)
|
||||||
|
actualWidth=$tip[0].offsetWidth
|
||||||
|
actualHeight=$tip[0].offsetHeight}
|
||||||
|
this.replaceArrow(delta- width+ actualWidth,actualWidth,'left')}else{this.replaceArrow(actualHeight- height,actualHeight,'top')}
|
||||||
|
if(replace)$tip.offset(offset)}
|
||||||
|
Tooltip.prototype.replaceArrow=function(delta,dimension,position){this.arrow().css(position,delta?(50*(1- delta/dimension)+'%'):'')}
|
||||||
|
Tooltip.prototype.setContent=function(){var $tip=this.tip()
|
||||||
|
var title=this.getTitle()
|
||||||
|
$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
|
||||||
|
$tip.removeClass('fade in top bottom left right')}
|
||||||
|
Tooltip.prototype.hide=function(){var that=this
|
||||||
|
var $tip=this.tip()
|
||||||
|
var e=$.Event('hide.bs.'+ this.type)
|
||||||
|
function complete(){if(that.hoverState!='in')$tip.detach()
|
||||||
|
that.$element.trigger('hidden.bs.'+ that.type)}
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
$tip.removeClass('in')
|
||||||
|
$.support.transition&&this.$tip.hasClass('fade')?$tip.one($.support.transition.end,complete).emulateTransitionEnd(150):complete()
|
||||||
|
this.hoverState=null
|
||||||
|
return this}
|
||||||
|
Tooltip.prototype.fixTitle=function(){var $e=this.$element
|
||||||
|
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
|
||||||
|
Tooltip.prototype.hasContent=function(){return this.getTitle()}
|
||||||
|
Tooltip.prototype.getPosition=function(){var el=this.$element[0]
|
||||||
|
return $.extend({},(typeof el.getBoundingClientRect=='function')?el.getBoundingClientRect():{width:el.offsetWidth,height:el.offsetHeight},this.$element.offset())}
|
||||||
|
Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+ pos.height,left:pos.left+ pos.width/2- actualWidth/2}:placement=='top'?{top:pos.top- actualHeight,left:pos.left+ pos.width/2- actualWidth/2}:placement=='left'?{top:pos.top+ pos.height/2- actualHeight/2,left:pos.left- actualWidth}:{top:pos.top+ pos.height/2- actualHeight/2,left:pos.left+ pos.width}}
|
||||||
|
Tooltip.prototype.getTitle=function(){var title
|
||||||
|
var $e=this.$element
|
||||||
|
var o=this.options
|
||||||
|
title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
|
||||||
|
return title}
|
||||||
|
Tooltip.prototype.tip=function(){return this.$tip=this.$tip||$(this.options.template)}
|
||||||
|
Tooltip.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow')}
|
||||||
|
Tooltip.prototype.validate=function(){if(!this.$element[0].parentNode){this.hide()
|
||||||
|
this.$element=null
|
||||||
|
this.options=null}}
|
||||||
|
Tooltip.prototype.enable=function(){this.enabled=true}
|
||||||
|
Tooltip.prototype.disable=function(){this.enabled=false}
|
||||||
|
Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
|
||||||
|
Tooltip.prototype.toggle=function(e){var self=e?$(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.'+ this.type):this
|
||||||
|
self.tip().hasClass('in')?self.leave(self):self.enter(self)}
|
||||||
|
Tooltip.prototype.destroy=function(){clearTimeout(this.timeout)
|
||||||
|
this.hide().$element.off('.'+ this.type).removeData('bs.'+ this.type)}
|
||||||
|
var old=$.fn.tooltip
|
||||||
|
$.fn.tooltip=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.tooltip')
|
||||||
|
var options=typeof option=='object'&&option
|
||||||
|
if(!data&&option=='destroy')return
|
||||||
|
if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.tooltip.Constructor=Tooltip
|
||||||
|
$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
|
||||||
|
return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)}
|
||||||
|
if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
|
||||||
|
Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
|
||||||
|
Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
|
||||||
|
Popover.prototype.constructor=Popover
|
||||||
|
Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
|
||||||
|
Popover.prototype.setContent=function(){var $tip=this.tip()
|
||||||
|
var title=this.getTitle()
|
||||||
|
var content=this.getContent()
|
||||||
|
$tip.find('.popover-title')[this.options.html?'html':'text'](title)
|
||||||
|
$tip.find('.popover-content')[this.options.html?(typeof content=='string'?'html':'append'):'text'](content)
|
||||||
|
$tip.removeClass('fade top bottom left right in')
|
||||||
|
if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
|
||||||
|
Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
|
||||||
|
Popover.prototype.getContent=function(){var $e=this.$element
|
||||||
|
var o=this.options
|
||||||
|
return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
|
||||||
|
Popover.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find('.arrow')}
|
||||||
|
Popover.prototype.tip=function(){if(!this.$tip)this.$tip=$(this.options.template)
|
||||||
|
return this.$tip}
|
||||||
|
var old=$.fn.popover
|
||||||
|
$.fn.popover=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.popover')
|
||||||
|
var options=typeof option=='object'&&option
|
||||||
|
if(!data&&option=='destroy')return
|
||||||
|
if(!data)$this.data('bs.popover',(data=new Popover(this,options)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.popover.Constructor=Popover
|
||||||
|
$.fn.popover.noConflict=function(){$.fn.popover=old
|
||||||
|
return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){var href
|
||||||
|
var process=$.proxy(this.process,this)
|
||||||
|
this.$element=$(element).is('body')?$(window):$(element)
|
||||||
|
this.$body=$('body')
|
||||||
|
this.$scrollElement=this.$element.on('scroll.bs.scroll-spy.data-api',process)
|
||||||
|
this.options=$.extend({},ScrollSpy.DEFAULTS,options)
|
||||||
|
this.selector=(this.options.target||((href=$(element).attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,''))||'')+' .nav li > a'
|
||||||
|
this.offsets=$([])
|
||||||
|
this.targets=$([])
|
||||||
|
this.activeTarget=null
|
||||||
|
this.refresh()
|
||||||
|
this.process()}
|
||||||
|
ScrollSpy.DEFAULTS={offset:10}
|
||||||
|
ScrollSpy.prototype.refresh=function(){var offsetMethod=this.$element[0]==window?'offset':'position'
|
||||||
|
this.offsets=$([])
|
||||||
|
this.targets=$([])
|
||||||
|
var self=this
|
||||||
|
var $targets=this.$body.find(this.selector).map(function(){var $el=$(this)
|
||||||
|
var href=$el.data('target')||$el.attr('href')
|
||||||
|
var $href=/^#./.test(href)&&$(href)
|
||||||
|
return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+(!$.isWindow(self.$scrollElement.get(0))&&self.$scrollElement.scrollTop()),href]])||null}).sort(function(a,b){return a[0]- b[0]}).each(function(){self.offsets.push(this[0])
|
||||||
|
self.targets.push(this[1])})}
|
||||||
|
ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+ this.options.offset
|
||||||
|
var scrollHeight=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight
|
||||||
|
var maxScroll=scrollHeight- this.$scrollElement.height()
|
||||||
|
var offsets=this.offsets
|
||||||
|
var targets=this.targets
|
||||||
|
var activeTarget=this.activeTarget
|
||||||
|
var i
|
||||||
|
if(scrollTop>=maxScroll){return activeTarget!=(i=targets.last()[0])&&this.activate(i)}
|
||||||
|
if(activeTarget&&scrollTop<=offsets[0]){return activeTarget!=(i=targets[0])&&this.activate(i)}
|
||||||
|
for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(!offsets[i+ 1]||scrollTop<=offsets[i+ 1])&&this.activate(targets[i])}}
|
||||||
|
ScrollSpy.prototype.activate=function(target){this.activeTarget=target
|
||||||
|
$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')
|
||||||
|
var selector=this.selector+'[data-target="'+ target+'"],'+
|
||||||
|
this.selector+'[href="'+ target+'"]'
|
||||||
|
var active=$(selector).parents('li').addClass('active')
|
||||||
|
if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')}
|
||||||
|
active.trigger('activate.bs.scrollspy')}
|
||||||
|
var old=$.fn.scrollspy
|
||||||
|
$.fn.scrollspy=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.scrollspy')
|
||||||
|
var options=typeof option=='object'&&option
|
||||||
|
if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.scrollspy.Constructor=ScrollSpy
|
||||||
|
$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old
|
||||||
|
return this}
|
||||||
|
$(window).on('load',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this)
|
||||||
|
$spy.scrollspy($spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)}
|
||||||
|
Tab.prototype.show=function(){var $this=this.element
|
||||||
|
var $ul=$this.closest('ul:not(.dropdown-menu)')
|
||||||
|
var selector=$this.data('target')
|
||||||
|
if(!selector){selector=$this.attr('href')
|
||||||
|
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
|
||||||
|
if($this.parent('li').hasClass('active'))return
|
||||||
|
var previous=$ul.find('.active:last a')[0]
|
||||||
|
var e=$.Event('show.bs.tab',{relatedTarget:previous})
|
||||||
|
$this.trigger(e)
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
var $target=$(selector)
|
||||||
|
this.activate($this.parent('li'),$ul)
|
||||||
|
this.activate($target,$target.parent(),function(){$this.trigger({type:'shown.bs.tab',relatedTarget:previous})})}
|
||||||
|
Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active')
|
||||||
|
var transition=callback&&$.support.transition&&$active.hasClass('fade')
|
||||||
|
function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active')
|
||||||
|
element.addClass('active')
|
||||||
|
if(transition){element[0].offsetWidth
|
||||||
|
element.addClass('in')}else{element.removeClass('fade')}
|
||||||
|
if(element.parent('.dropdown-menu')){element.closest('li.dropdown').addClass('active')}
|
||||||
|
callback&&callback()}
|
||||||
|
transition?$active.one($.support.transition.end,next).emulateTransitionEnd(150):next()
|
||||||
|
$active.removeClass('in')}
|
||||||
|
var old=$.fn.tab
|
||||||
|
$.fn.tab=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.tab')
|
||||||
|
if(!data)$this.data('bs.tab',(data=new Tab(this)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.tab.Constructor=Tab
|
||||||
|
$.fn.tab.noConflict=function(){$.fn.tab=old
|
||||||
|
return this}
|
||||||
|
$(document).on('click.bs.tab.data-api','[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault()
|
||||||
|
$(this).tab('show')})}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options)
|
||||||
|
this.$window=$(window).on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this))
|
||||||
|
this.$element=$(element)
|
||||||
|
this.affixed=this.unpin=this.pinnedOffset=null
|
||||||
|
this.checkPosition()}
|
||||||
|
Affix.RESET='affix affix-top affix-bottom'
|
||||||
|
Affix.DEFAULTS={offset:0}
|
||||||
|
Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset
|
||||||
|
this.$element.removeClass(Affix.RESET).addClass('affix')
|
||||||
|
var scrollTop=this.$window.scrollTop()
|
||||||
|
var position=this.$element.offset()
|
||||||
|
return(this.pinnedOffset=position.top- scrollTop)}
|
||||||
|
Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)}
|
||||||
|
Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return
|
||||||
|
var scrollHeight=$(document).height()
|
||||||
|
var scrollTop=this.$window.scrollTop()
|
||||||
|
var position=this.$element.offset()
|
||||||
|
var offset=this.options.offset
|
||||||
|
var offsetTop=offset.top
|
||||||
|
var offsetBottom=offset.bottom
|
||||||
|
if(this.affixed=='top')position.top+=scrollTop
|
||||||
|
if(typeof offset!='object')offsetBottom=offsetTop=offset
|
||||||
|
if(typeof offsetTop=='function')offsetTop=offset.top(this.$element)
|
||||||
|
if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element)
|
||||||
|
var affix=this.unpin!=null&&(scrollTop+ this.unpin<=position.top)?false:offsetBottom!=null&&(position.top+ this.$element.height()>=scrollHeight- offsetBottom)?'bottom':offsetTop!=null&&(scrollTop<=offsetTop)?'top':false
|
||||||
|
if(this.affixed===affix)return
|
||||||
|
if(this.unpin)this.$element.css('top','')
|
||||||
|
var affixType='affix'+(affix?'-'+ affix:'')
|
||||||
|
var e=$.Event(affixType+'.bs.affix')
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if(e.isDefaultPrevented())return
|
||||||
|
this.affixed=affix
|
||||||
|
this.unpin=affix=='bottom'?this.getPinnedOffset():null
|
||||||
|
this.$element.removeClass(Affix.RESET).addClass(affixType).trigger($.Event(affixType.replace('affix','affixed')))
|
||||||
|
if(affix=='bottom'){this.$element.offset({top:scrollHeight- offsetBottom- this.$element.height()})}}
|
||||||
|
var old=$.fn.affix
|
||||||
|
$.fn.affix=function(option){return this.each(function(){var $this=$(this)
|
||||||
|
var data=$this.data('bs.affix')
|
||||||
|
var options=typeof option=='object'&&option
|
||||||
|
if(!data)$this.data('bs.affix',(data=new Affix(this,options)))
|
||||||
|
if(typeof option=='string')data[option]()})}
|
||||||
|
$.fn.affix.Constructor=Affix
|
||||||
|
$.fn.affix.noConflict=function(){$.fn.affix=old
|
||||||
|
return this}
|
||||||
|
$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this)
|
||||||
|
var data=$spy.data()
|
||||||
|
data.offset=data.offset||{}
|
||||||
|
if(data.offsetBottom)data.offset.bottom=data.offsetBottom
|
||||||
|
if(data.offsetTop)data.offset.top=data.offsetTop
|
||||||
|
$spy.affix(data)})})}(jQuery);
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,95 @@
|
||||||
|
(function () {
|
||||||
|
var contactFormUtils = {
|
||||||
|
isValidEmail: function (email) {
|
||||||
|
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||||
|
return regex.test(email);
|
||||||
|
},
|
||||||
|
clearErrors: function () {
|
||||||
|
$('#emailAlert').remove();
|
||||||
|
$('#feedbackForm .help-block').hide();
|
||||||
|
$('#feedbackForm .form-group').removeClass('has-error');
|
||||||
|
},
|
||||||
|
clearForm: function () {
|
||||||
|
$('#feedbackForm .glyphicon').removeClass('glyphicon-check').addClass('glyphicon-unchecked').css({color: ''});
|
||||||
|
$('#feedbackForm input,textarea').val("");
|
||||||
|
grecaptcha.reset();
|
||||||
|
},
|
||||||
|
addError: function ($input) {
|
||||||
|
var parentFormGroup = $input.parents('.form-group');
|
||||||
|
parentFormGroup.children('.help-block').show();
|
||||||
|
parentFormGroup.addClass('has-error');
|
||||||
|
},
|
||||||
|
addAjaxMessage: function(msg, isError) {
|
||||||
|
$("#feedbackSubmit").after('<!-- Google Code for Üzenet küldés Conversion Page --><script type="text/javascript">/* <![CDATA[ */var google_conversion_id = 879485887;var google_conversion_language = "en";var google_conversion_format = "3";var google_conversion_color = "ffffff";var google_conversion_label = "LFi9CMqN3GcQv8evowM";var google_remarketing_only = false;/* ]]> */</script><script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script><noscript><div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/879485887/?label=LFi9CMqN3GcQv8evowM&guid=ON&script=0"/></div></noscript><div id="emailAlert" class="alert alert-' + (isError ? 'danger' : 'success') + '" style="margin-top: 5px;">' + $('<div/>').text(msg).html() + '</div>');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
if ($("#phone").intlTelInput) {
|
||||||
|
$("#phone").intlTelInput({validationScript: "assets/vender/intl-tel-input/js/isValidNumber.js"});
|
||||||
|
$(".intl-tel-input.inside").css('width', '100%');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#feedbackSubmit").click(function() {
|
||||||
|
var $btn = $(this);
|
||||||
|
$btn.button('loading');
|
||||||
|
contactFormUtils.clearErrors();
|
||||||
|
|
||||||
|
//do a little client-side validation -- check that each field has a value and e-mail field is in proper format
|
||||||
|
//use bootstrap validator (https://github.com/1000hz/bootstrap-validator) if provided, otherwise a bit of custom validation
|
||||||
|
var $form = $("#feedbackForm"),
|
||||||
|
hasErrors = false;
|
||||||
|
if ($form.validator) {
|
||||||
|
hasErrors = $form.validator('validate').hasErrors;
|
||||||
|
} else {
|
||||||
|
$('#feedbackForm input,#feedbackForm textarea').not('.optional').each(function() {
|
||||||
|
var $this = $(this);
|
||||||
|
if (($this.is(':checkbox') && !$this.is(':checked')) || !$this.val()) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($(this));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var $email = $('#email');
|
||||||
|
if (!contactFormUtils.isValidEmail($email.val())) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($email);
|
||||||
|
}
|
||||||
|
var $phone = $('#phone');
|
||||||
|
if ($phone.val() && $phone.intlTelInput && !$phone.intlTelInput("isValidNumber")) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($phone.parent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if there are any errors return without sending e-mail
|
||||||
|
if (hasErrors) {
|
||||||
|
$btn.button('reset');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//send the feedback e-mail
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "library/sendmail.php",
|
||||||
|
data: $form.serialize(),
|
||||||
|
success: function(data) {
|
||||||
|
contactFormUtils.addAjaxMessage(data.message, false);
|
||||||
|
contactFormUtils.clearForm();
|
||||||
|
},
|
||||||
|
error: function(response) {
|
||||||
|
contactFormUtils.addAjaxMessage(response.responseJSON.message, true);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
$btn.button('reset');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$('#feedbackForm input, #feedbackForm textarea').change(function () {
|
||||||
|
var checkBox = $(this).siblings('span.input-group-addon').children('.glyphicon');
|
||||||
|
if ($(this).val()) {
|
||||||
|
checkBox.removeClass('glyphicon-unchecked').addClass('glyphicon-check').css({color: 'green'});
|
||||||
|
} else {
|
||||||
|
checkBox.removeClass('glyphicon-check').addClass('glyphicon-unchecked').css({color: ''});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
(function () {
|
||||||
|
var contactFormUtils = {
|
||||||
|
isValidEmail: function (email) {
|
||||||
|
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||||
|
return regex.test(email);
|
||||||
|
},
|
||||||
|
clearErrors: function () {
|
||||||
|
$('#emailAlert').remove();
|
||||||
|
$('#feedbackForm .help-block').hide();
|
||||||
|
$('#feedbackForm .form-group').removeClass('has-error');
|
||||||
|
},
|
||||||
|
clearForm: function () {
|
||||||
|
$('#feedbackForm .glyphicon').removeClass('glyphicon-check').addClass('glyphicon-unchecked').css({color: ''});
|
||||||
|
$('#feedbackForm input,textarea').val("");
|
||||||
|
grecaptcha.reset();
|
||||||
|
},
|
||||||
|
addError: function ($input) {
|
||||||
|
var parentFormGroup = $input.parents('.form-group');
|
||||||
|
parentFormGroup.children('.help-block').show();
|
||||||
|
parentFormGroup.addClass('has-error');
|
||||||
|
},
|
||||||
|
addAjaxMessage: function(msg, isError) {
|
||||||
|
$("#feedbackSubmit").after('<!-- Google Code for Uzenet kuldes ENG Conversion Page --><script type="text/javascript">/* <![CDATA[ */var google_conversion_id = 879485887;var google_conversion_language = "en";var google_conversion_format = "3";var google_conversion_color = "ffffff";var google_conversion_label = "jTjFCLL732cQv8evowM";var google_remarketing_only = false;/* ]]> */</script><script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script><noscript><div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/879485887/?label=jTjFCLL732cQv8evowM&guid=ON&script=0"/></div></noscript><div id="emailAlert" class="alert alert-' + (isError ? 'danger' : 'success') + '" style="margin-top: 5px;">' + $('<div/>').text(msg).html() + '</div>');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
if ($("#phone").intlTelInput) {
|
||||||
|
$("#phone").intlTelInput({validationScript: "assets/vender/intl-tel-input/js/isValidNumber.js"});
|
||||||
|
$(".intl-tel-input.inside").css('width', '100%');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#feedbackSubmit").click(function() {
|
||||||
|
var $btn = $(this);
|
||||||
|
$btn.button('loading');
|
||||||
|
contactFormUtils.clearErrors();
|
||||||
|
|
||||||
|
//do a little client-side validation -- check that each field has a value and e-mail field is in proper format
|
||||||
|
//use bootstrap validator (https://github.com/1000hz/bootstrap-validator) if provided, otherwise a bit of custom validation
|
||||||
|
var $form = $("#feedbackForm"),
|
||||||
|
hasErrors = false;
|
||||||
|
if ($form.validator) {
|
||||||
|
hasErrors = $form.validator('validate').hasErrors;
|
||||||
|
} else {
|
||||||
|
$('#feedbackForm input,#feedbackForm textarea').not('.optional').each(function() {
|
||||||
|
var $this = $(this);
|
||||||
|
if (($this.is(':checkbox') && !$this.is(':checked')) || !$this.val()) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($(this));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var $email = $('#email');
|
||||||
|
if (!contactFormUtils.isValidEmail($email.val())) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($email);
|
||||||
|
}
|
||||||
|
var $phone = $('#phone');
|
||||||
|
if ($phone.val() && $phone.intlTelInput && !$phone.intlTelInput("isValidNumber")) {
|
||||||
|
hasErrors = true;
|
||||||
|
contactFormUtils.addError($phone.parent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//if there are any errors return without sending e-mail
|
||||||
|
if (hasErrors) {
|
||||||
|
$btn.button('reset');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//send the feedback e-mail
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "library/en-sendmail.php",
|
||||||
|
data: $form.serialize(),
|
||||||
|
success: function(data) {
|
||||||
|
contactFormUtils.addAjaxMessage(data.message, false);
|
||||||
|
contactFormUtils.clearForm();
|
||||||
|
},
|
||||||
|
error: function(response) {
|
||||||
|
contactFormUtils.addAjaxMessage(response.responseJSON.message, true);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
$btn.button('reset');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$('#feedbackForm input, #feedbackForm textarea').change(function () {
|
||||||
|
var checkBox = $(this).siblings('span.input-group-addon').children('.glyphicon');
|
||||||
|
if ($(this).val()) {
|
||||||
|
checkBox.removeClass('glyphicon-unchecked').addClass('glyphicon-check').css({color: 'green'});
|
||||||
|
} else {
|
||||||
|
checkBox.removeClass('glyphicon-check').addClass('glyphicon-unchecked').css({color: ''});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,51 @@
|
||||||
|
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||||
|
// IT'S JUST JUNK FOR OUR DOCS!
|
||||||
|
// ++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
/*!
|
||||||
|
* Copyright 2014 Twitter, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||||
|
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||||
|
*/
|
||||||
|
// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
function emulatedIEMajorVersion() {
|
||||||
|
var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
|
||||||
|
if (groups === null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
var ieVersionNum = parseInt(groups[1], 10)
|
||||||
|
var ieMajorVersion = Math.floor(ieVersionNum)
|
||||||
|
return ieMajorVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
function actualNonEmulatedIEMajorVersion() {
|
||||||
|
// Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
|
||||||
|
// IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx
|
||||||
|
// @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx
|
||||||
|
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
|
||||||
|
if (jscriptVersion === undefined) {
|
||||||
|
return 11 // IE11+ not in emulation mode
|
||||||
|
}
|
||||||
|
if (jscriptVersion < 9) {
|
||||||
|
return 8 // IE8 (or lower; haven't tested on IE<8)
|
||||||
|
}
|
||||||
|
return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
|
||||||
|
}
|
||||||
|
|
||||||
|
var ua = window.navigator.userAgent
|
||||||
|
if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
|
||||||
|
return // Opera, which might pretend to be IE
|
||||||
|
}
|
||||||
|
var emulated = emulatedIEMajorVersion()
|
||||||
|
if (emulated === null) {
|
||||||
|
return // Not IE
|
||||||
|
}
|
||||||
|
var nonEmulated = actualNonEmulatedIEMajorVersion()
|
||||||
|
|
||||||
|
if (emulated !== nonEmulated) {
|
||||||
|
window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*!
|
||||||
|
* IE10 viewport hack for Surface/desktop Windows 8 bug
|
||||||
|
* Copyright 2014 Twitter, Inc.
|
||||||
|
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||||
|
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// See the Getting Started docs for more information:
|
||||||
|
// http://getbootstrap.com/getting-started/#support-ie10-width
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
|
||||||
|
var msViewportStyle = document.createElement('style')
|
||||||
|
msViewportStyle.appendChild(
|
||||||
|
document.createTextNode(
|
||||||
|
'@-ms-viewport{width:auto!important}'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
document.querySelector('head').appendChild(msViewportStyle)
|
||||||
|
}
|
||||||
|
})();
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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,322 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* Sets error header and json error message response.
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* @param String $messsage error message of response
|
||||||
|
|
||||||
|
* @return void
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
function errorResponse ($messsage) {
|
||||||
|
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
|
||||||
|
die(json_encode(array('message' => $messsage)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* Pulls posted values for all fields in $fields_req array.
|
||||||
|
|
||||||
|
* If a required field does not have a value, an error response is given.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
function constructMessageBody () {
|
||||||
|
|
||||||
|
$fields_req = array("name" => true, "email" => true, "message" => true);
|
||||||
|
|
||||||
|
$message_body = "";
|
||||||
|
|
||||||
|
foreach ($fields_req as $name => $required) {
|
||||||
|
|
||||||
|
$postedValue = $_POST[$name];
|
||||||
|
|
||||||
|
if ($required && empty($postedValue)) {
|
||||||
|
|
||||||
|
errorResponse("$name is empty.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// else {
|
||||||
|
|
||||||
|
// $message_body .= ucfirst($name) . ": " . $postedValue . "\n";
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$htmlhead .= "<html><head>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "</head>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<style type=\"text/css\">";
|
||||||
|
|
||||||
|
$htmlhead .= "body
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
margin: 0px;
|
||||||
|
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
font-family: \"Segoe UI\", Sans-Serif;
|
||||||
|
|
||||||
|
font-size: 12pt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
h1
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background-color: #ffc153;
|
||||||
|
|
||||||
|
font-size: 14pt;
|
||||||
|
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
margin: 0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#lastupdate
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
color: #AAA;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#todolist
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
border-collapse: collapse;
|
||||||
|
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist th
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
background-color: #ffc153;
|
||||||
|
|
||||||
|
padding: 4px 8px;
|
||||||
|
|
||||||
|
border-bottom: 1px solid #F93;
|
||||||
|
|
||||||
|
border-top: 1px solid #F93;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist th:first-child
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding-left: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
border-bottom: 1px solid #F93;
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.entryrow td:first-child
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding-left: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.entryrow:hover td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background-color: #A7CDF0;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.unseen td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
font-weight:bold;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.folderheader td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding: 20px 8px 3px 8px;
|
||||||
|
|
||||||
|
font-weight:bold;
|
||||||
|
|
||||||
|
}";
|
||||||
|
|
||||||
|
$htmlhead .= " </style>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<body>\r\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$message_body =$htmlhead."<h1>New REQUEST / CONTACT</h1><br>
|
||||||
|
|
||||||
|
Name: <strong>".$_POST['name']."</strong><br>\n".
|
||||||
|
|
||||||
|
"Email: <strong>".$_POST['email']."</strong><br>\n".
|
||||||
|
|
||||||
|
"Tel: <strong>".$_POST['phone']."</strong><br><br>\n".
|
||||||
|
|
||||||
|
"Type of service: <strong>".$_POST['reason']."</strong><br><br>\n".
|
||||||
|
|
||||||
|
"<u>Message: </u><br>\n".$_POST['message']."\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$message_body .= "</body>\r\n";
|
||||||
|
|
||||||
|
$message_body .= "</html>\r\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $message_body;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//do Captcha check, make sure the submitter is not a robot:)...
|
||||||
|
|
||||||
|
$url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||||
|
|
||||||
|
$opts = array('http' =>
|
||||||
|
|
||||||
|
array(
|
||||||
|
|
||||||
|
'method' => 'POST',
|
||||||
|
|
||||||
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
|
|
||||||
|
'content' => http_build_query(array('secret' => '6LeT5goTAAAAAGWeVhyUJSoItToTNpUCIf8mwu4-', 'response' => $_POST["g-recaptcha-response"]))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
|
||||||
|
$result = json_decode(file_get_contents($url, false, $context, -1, 40000));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!$result->success) {
|
||||||
|
|
||||||
|
errorResponse('reCAPTCHA checked failed! Error codes: ' . join(', ', $result->{"error-codes"}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//attempt to send email
|
||||||
|
|
||||||
|
$messageBody = constructMessageBody();
|
||||||
|
|
||||||
|
require './vender/php_mailer/PHPMailerAutoload.php';
|
||||||
|
|
||||||
|
$mail = new PHPMailer;
|
||||||
|
|
||||||
|
$mail->CharSet = 'UTF-8';
|
||||||
|
|
||||||
|
$mail->IsHTML(true);
|
||||||
|
|
||||||
|
//$mail->isSMTP();
|
||||||
|
|
||||||
|
//$mail->Host = 'mail.maxer.hu';
|
||||||
|
|
||||||
|
//$mail->SMTPAuth = true;
|
||||||
|
|
||||||
|
//$mail->Username = 'mail@sys.co.hu';
|
||||||
|
|
||||||
|
//$mail->Password = 'titok123';
|
||||||
|
|
||||||
|
//$mail->SMTPSecure = '';
|
||||||
|
|
||||||
|
//$mail->Port = 587;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$mail->setFrom('kapcsolat@skyflytravel.hu');
|
||||||
|
|
||||||
|
$mail->addAddress('info@skyflytravel.hu');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$mail->Subject = 'New request, '.$_POST['reason'];
|
||||||
|
|
||||||
|
$mail->Body = $messageBody;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//try to send the message
|
||||||
|
|
||||||
|
if($mail->send()) {
|
||||||
|
|
||||||
|
echo json_encode(array('message' => 'Your message was successfully submitted. Our colleague will contact you soon.'));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
errorResponse('An expected error occured while attempting to send the email: ' . $mail->ErrorInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,324 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* Sets error header and json error message response.
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* @param String $messsage error message of response
|
||||||
|
|
||||||
|
* @return void
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
function errorResponse ($messsage) {
|
||||||
|
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
|
||||||
|
die(json_encode(array('message' => $messsage)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* Pulls posted values for all fields in $fields_req array.
|
||||||
|
|
||||||
|
* If a required field does not have a value, an error response is given.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
function constructMessageBody () {
|
||||||
|
|
||||||
|
$fields_req = array("name" => true, "email" => true, "message" => true);
|
||||||
|
|
||||||
|
$message_body = "";
|
||||||
|
|
||||||
|
foreach ($fields_req as $name => $required) {
|
||||||
|
|
||||||
|
$postedValue = $_POST[$name];
|
||||||
|
|
||||||
|
if ($required && empty($postedValue)) {
|
||||||
|
|
||||||
|
errorResponse("$name is empty.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// else {
|
||||||
|
|
||||||
|
// $message_body .= ucfirst($name) . ": " . $postedValue . "\n";
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$htmlhead .= "<html><head>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "</head>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<style type=\"text/css\">";
|
||||||
|
|
||||||
|
$htmlhead .= "body
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
margin: 0px;
|
||||||
|
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
font-family: \"Segoe UI\", Sans-Serif;
|
||||||
|
|
||||||
|
font-size: 12pt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
h1
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background-color: #ffc153;
|
||||||
|
|
||||||
|
font-size: 14pt;
|
||||||
|
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
margin: 0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#lastupdate
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
color: #AAA;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#todolist
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
border-collapse: collapse;
|
||||||
|
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist th
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
font-weight: normal;
|
||||||
|
|
||||||
|
background-color: #ffc153;
|
||||||
|
|
||||||
|
padding: 4px 8px;
|
||||||
|
|
||||||
|
border-bottom: 1px solid #F93;
|
||||||
|
|
||||||
|
border-top: 1px solid #F93;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist th:first-child
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding-left: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
border-bottom: 1px solid #F93;
|
||||||
|
|
||||||
|
padding: 3px 8px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.entryrow td:first-child
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding-left: 25px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.entryrow:hover td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
background-color: #A7CDF0;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.unseen td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
font-weight:bold;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#todolist tbody tr.folderheader td
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
padding: 20px 8px 3px 8px;
|
||||||
|
|
||||||
|
font-weight:bold;
|
||||||
|
|
||||||
|
}";
|
||||||
|
|
||||||
|
$htmlhead .= " </style>\r\n";
|
||||||
|
|
||||||
|
$htmlhead .= "<body>\r\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$message_body =$htmlhead."<h1>Új érdeklődés / ajánlatkérés</h1><br>
|
||||||
|
|
||||||
|
Feladó neve: <strong>".$_POST['name']."</strong><br>\n".
|
||||||
|
|
||||||
|
"Email címe: <strong>".$_POST['email']."</strong><br>\n".
|
||||||
|
|
||||||
|
"Telefon: <strong>".$_POST['phone']."</strong><br><br>\n".
|
||||||
|
|
||||||
|
"Szolgáltatás típusa: <strong>".$_POST['reason']."</strong><br><br>\n".
|
||||||
|
|
||||||
|
"<u>Üzenet szövege: </u><br>\n".$_POST['message']."\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$message_body .= "</body>\r\n";
|
||||||
|
|
||||||
|
$message_body .= "</html>\r\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $message_body;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//do Captcha check, make sure the submitter is not a robot:)...
|
||||||
|
|
||||||
|
$url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||||
|
|
||||||
|
$opts = array('http' =>
|
||||||
|
|
||||||
|
array(
|
||||||
|
|
||||||
|
'method' => 'POST',
|
||||||
|
|
||||||
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
|
|
||||||
|
'content' => http_build_query(array('secret' => '6LeT5goTAAAAAGWeVhyUJSoItToTNpUCIf8mwu4-', 'response' => $_POST["g-recaptcha-response"]))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
|
||||||
|
$result = json_decode(file_get_contents($url, false, $context, -1, 40000));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!$result->success) {
|
||||||
|
|
||||||
|
errorResponse('reCAPTCHA ellenörzési hiba! Error codes: ' . join(', ', $result->{"error-codes"}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//attempt to send email
|
||||||
|
|
||||||
|
$messageBody = constructMessageBody();
|
||||||
|
|
||||||
|
require './vender/php_mailer/PHPMailerAutoload.php';
|
||||||
|
|
||||||
|
$mail = new PHPMailer;
|
||||||
|
|
||||||
|
$mail->CharSet = 'UTF-8';
|
||||||
|
|
||||||
|
$mail->IsHTML(true);
|
||||||
|
|
||||||
|
//$mail->isSMTP();
|
||||||
|
|
||||||
|
//$mail->Host = 'mail.maxer.hu';
|
||||||
|
|
||||||
|
//$mail->SMTPAuth = true;
|
||||||
|
|
||||||
|
//$mail->Username = 'mail@sys.co.hu';
|
||||||
|
|
||||||
|
//$mail->Password = 'titok123';
|
||||||
|
|
||||||
|
//$mail->SMTPSecure = '';
|
||||||
|
|
||||||
|
//$mail->Port = 587;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$mail->setFrom('kapcsolat@skyflytravel.hu');
|
||||||
|
|
||||||
|
$mail->addAddress('info@skyflytravel.hu');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$mail->Subject = 'Új ajánlatkérés, '.$_POST['reason'];
|
||||||
|
|
||||||
|
$mail->Body = $messageBody;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//try to send the message
|
||||||
|
|
||||||
|
if($mail->send()) {
|
||||||
|
|
||||||
|
echo json_encode(array('message' => 'Az üzenetét sikeresen elküldtük. Munkatársunk hamarosan felveszi önnel a kapcsolatot.'));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
errorResponse('HIBA történ az üzenet küldése közben: ' . $mail->ErrorInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Sets error header and json error message response.
|
||||||
|
*
|
||||||
|
* @param String $messsage error message of response
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function errorResponse ($messsage) {
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
die(json_encode(array('message' => $messsage)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pulls posted values for all fields in $fields_req array.
|
||||||
|
* If a required field does not have a value, an error response is given.
|
||||||
|
*/
|
||||||
|
function constructMessageBody () {
|
||||||
|
$fields_req = array("name" => true, "email" => true, "message" => true);
|
||||||
|
$message_body = "";
|
||||||
|
foreach ($fields_req as $name => $required) {
|
||||||
|
$postedValue = $_POST[$name];
|
||||||
|
if ($required && empty($postedValue)) {
|
||||||
|
errorResponse("$name is empty.");
|
||||||
|
} else {
|
||||||
|
$message_body .= ucfirst($name) . ": " . $postedValue . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $message_body;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
//do Captcha check, make sure the submitter is not a robot:)...
|
||||||
|
$url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||||
|
$opts = array('http' =>
|
||||||
|
array(
|
||||||
|
'method' => 'POST',
|
||||||
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
|
'content' => http_build_query(array('secret' => '6LeT5goTAAAAAGWeVhyUJSoItToTNpUCIf8mwu4-', 'response' => $_POST["g-recaptcha-response"]))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
$result = json_decode(file_get_contents($url, false, $context, -1, 40000));
|
||||||
|
|
||||||
|
if (!$result->success) {
|
||||||
|
errorResponse('reCAPTCHA ellenõrzési hiba! Error codes: ' . join(', ', $result->{"error-codes"}));
|
||||||
|
}
|
||||||
|
//attempt to send email
|
||||||
|
$messageBody = constructMessageBody();
|
||||||
|
require './vender/php_mailer/PHPMailerAutoload.php';
|
||||||
|
$mail = new PHPMailer;
|
||||||
|
$mail->CharSet = 'UTF-8';
|
||||||
|
$mail->isSMTP();
|
||||||
|
$mail->Host = 'mail.maxer.hu';
|
||||||
|
if (!getenv('FEEDBACK_SKIP_AUTH')) {
|
||||||
|
$mail->SMTPAuth = true;
|
||||||
|
$mail->Username = 'mail.sys.co.hu';
|
||||||
|
$mail->Password = 'titok123';
|
||||||
|
}
|
||||||
|
$mail->SMTPSecure = 'tls';
|
||||||
|
$mail->Port = 587;
|
||||||
|
|
||||||
|
$mail->setFrom($_POST['email'], $_POST['name']);
|
||||||
|
$mail->addAddress('bognar.szilard@habel.hu');
|
||||||
|
|
||||||
|
$mail->Subject = $_POST['reason'];
|
||||||
|
$mail->Body = $messageBody;
|
||||||
|
|
||||||
|
|
||||||
|
//try to send the message
|
||||||
|
if($mail->send()) {
|
||||||
|
echo json_encode(array('message' => 'Az ajánlatkérést sikeresen elküldtük!'));
|
||||||
|
} else {
|
||||||
|
errorResponse('Hiba lépett fel küldés közben: ' . $mail->ErrorInfo);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Sets error header and json error message response.
|
||||||
|
*
|
||||||
|
* @param String $messsage error message of response
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function errorResponse ($messsage) {
|
||||||
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
die(json_encode(array('message' => $messsage)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pulls posted values for all fields in $fields_req array.
|
||||||
|
* If a required field does not have a value, an error response is given.
|
||||||
|
*/
|
||||||
|
function constructMessageBody () {
|
||||||
|
$fields_req = array("name" => true, "email" => true, "message" => true);
|
||||||
|
$message_body = "";
|
||||||
|
foreach ($fields_req as $name => $required) {
|
||||||
|
$postedValue = $_POST[$name];
|
||||||
|
if ($required && empty($postedValue)) {
|
||||||
|
|
||||||
|
errorResponse("$name is empty.");
|
||||||
|
} else {
|
||||||
|
$message_body .= ucfirst($name) . ": " . $postedValue . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $message_body;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
//do Captcha check, make sure the submitter is not a robot:)...
|
||||||
|
$url = 'https://www.google.com/recaptcha/api/siteverify';
|
||||||
|
$opts = array('http' =>
|
||||||
|
array(
|
||||||
|
'method' => 'POST',
|
||||||
|
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||||
|
'content' => http_build_query(array('secret' => '6LeT5goTAAAAAGWeVhyUJSoItToTNpUCIf8mwu4-', 'response' => $_POST["g-recaptcha-response"]))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
$result = json_decode(file_get_contents($url, false, $context, -1, 40000));
|
||||||
|
|
||||||
|
if (!$result->success) {
|
||||||
|
errorResponse('reCAPTCHA ellenõrzési hiba! Error codes: ' . join(', ', $result->{"error-codes"}));
|
||||||
|
}
|
||||||
|
//attempt to send email
|
||||||
|
$messageBody = constructMessageBody();
|
||||||
|
require './vender/php_mailer/PHPMailerAutoload.php';
|
||||||
|
$mail = new PHPMailer;
|
||||||
|
$mail->CharSet = 'UTF-8';
|
||||||
|
$mail->isSMTP();
|
||||||
|
$mail->Host = 'mail.maxer.hu';
|
||||||
|
$mail->SMTPAuth = true;
|
||||||
|
$mail->Username = 'mail.sys.co.hu';
|
||||||
|
$mail->Password = 'titok123';
|
||||||
|
$mail->SMTPSecure = 'tls';
|
||||||
|
$mail->Port = 587;
|
||||||
|
|
||||||
|
$mail->setFrom($_POST['email'], $_POST['name']);
|
||||||
|
$mail->addAddress('bognar.szilard@habel.hu');
|
||||||
|
|
||||||
|
$mail->Subject = $_POST['reason'];
|
||||||
|
$mail->Body = $messageBody;
|
||||||
|
|
||||||
|
|
||||||
|
//try to send the message
|
||||||
|
if($mail->send()) {
|
||||||
|
echo json_encode(array('message' => 'Az ajánlatkérést sikeresen elküldtük!'));
|
||||||
|
} else {
|
||||||
|
errorResponse('Hiba lépett fel küldés közben: ' . $mail->ErrorInfo);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHPMailer SPL autoloader.
|
||||||
|
* PHP Version 5
|
||||||
|
* @package PHPMailer
|
||||||
|
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2014 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPMailer SPL autoloader.
|
||||||
|
* @param string $classname The name of the class to load
|
||||||
|
*/
|
||||||
|
function PHPMailerAutoload($classname)
|
||||||
|
{
|
||||||
|
//Can't use __DIR__ as it's only in PHP 5.3+
|
||||||
|
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
|
||||||
|
if (is_readable($filename)) {
|
||||||
|
require $filename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
|
||||||
|
//SPL autoloading was introduced in PHP 5.1.2
|
||||||
|
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||||
|
spl_autoload_register('PHPMailerAutoload', true, true);
|
||||||
|
} else {
|
||||||
|
spl_autoload_register('PHPMailerAutoload');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/**
|
||||||
|
* Fall back to traditional autoload for old PHP versions
|
||||||
|
* @param string $classname The name of the class to load
|
||||||
|
*/
|
||||||
|
function __autoload($classname)
|
||||||
|
{
|
||||||
|
PHPMailerAutoload($classname);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,397 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
|
* PHP Version 5
|
||||||
|
* @package PHPMailer
|
||||||
|
* @link https://github.com/PHPMailer/PHPMailer/
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2014 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
|
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
|
||||||
|
* Does not support APOP.
|
||||||
|
* @package PHPMailer
|
||||||
|
* @author Richard Davey (original author) <rich@corephp.co.uk>
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
class POP3
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The POP3 PHPMailer Version number.
|
||||||
|
* @type string
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $Version = '5.2.9';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default POP3 port number.
|
||||||
|
* @type integer
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $POP3_PORT = 110;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default timeout in seconds.
|
||||||
|
* @type integer
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $POP3_TIMEOUT = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 Carriage Return + Line Feed.
|
||||||
|
* @type string
|
||||||
|
* @access public
|
||||||
|
* @deprecated Use the constant instead
|
||||||
|
*/
|
||||||
|
public $CRLF = "\r\n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug display level.
|
||||||
|
* Options: 0 = no, 1+ = yes
|
||||||
|
* @type integer
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $do_debug = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 mail server hostname.
|
||||||
|
* @type string
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 port number.
|
||||||
|
* @type integer
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 Timeout Value in seconds.
|
||||||
|
* @type integer
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $tval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 username
|
||||||
|
* @type string
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 password.
|
||||||
|
* @type string
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public $password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource handle for the POP3 connection socket.
|
||||||
|
* @type resource
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private $pop_conn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are we connected?
|
||||||
|
* @type boolean
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private $connected = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error container.
|
||||||
|
* @type array
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private $errors = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Line break constant
|
||||||
|
*/
|
||||||
|
const CRLF = "\r\n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple static wrapper for all-in-one POP before SMTP
|
||||||
|
* @param $host
|
||||||
|
* @param boolean $port
|
||||||
|
* @param boolean $tval
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param integer $debug_level
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public static function popBeforeSmtp(
|
||||||
|
$host,
|
||||||
|
$port = false,
|
||||||
|
$tval = false,
|
||||||
|
$username = '',
|
||||||
|
$password = '',
|
||||||
|
$debug_level = 0
|
||||||
|
) {
|
||||||
|
$pop = new POP3;
|
||||||
|
return $pop->authorise($host, $port, $tval, $username, $password, $debug_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authenticate with a POP3 server.
|
||||||
|
* A connect, login, disconnect sequence
|
||||||
|
* appropriate for POP-before SMTP authorisation.
|
||||||
|
* @access public
|
||||||
|
* @param string $host The hostname to connect to
|
||||||
|
* @param integer|boolean $port The port number to connect to
|
||||||
|
* @param integer|boolean $timeout The timeout value
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param integer $debug_level
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
||||||
|
{
|
||||||
|
$this->host = $host;
|
||||||
|
// If no port value provided, use default
|
||||||
|
if (false === $port) {
|
||||||
|
$this->port = $this->POP3_PORT;
|
||||||
|
} else {
|
||||||
|
$this->port = (integer)$port;
|
||||||
|
}
|
||||||
|
// If no timeout value provided, use default
|
||||||
|
if (false === $timeout) {
|
||||||
|
$this->tval = $this->POP3_TIMEOUT;
|
||||||
|
} else {
|
||||||
|
$this->tval = (integer)$timeout;
|
||||||
|
}
|
||||||
|
$this->do_debug = $debug_level;
|
||||||
|
$this->username = $username;
|
||||||
|
$this->password = $password;
|
||||||
|
// Reset the error log
|
||||||
|
$this->errors = array();
|
||||||
|
// connect
|
||||||
|
$result = $this->connect($this->host, $this->port, $this->tval);
|
||||||
|
if ($result) {
|
||||||
|
$login_result = $this->login($this->username, $this->password);
|
||||||
|
if ($login_result) {
|
||||||
|
$this->disconnect();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// We need to disconnect regardless of whether the login succeeded
|
||||||
|
$this->disconnect();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to a POP3 server.
|
||||||
|
* @access public
|
||||||
|
* @param string $host
|
||||||
|
* @param integer|boolean $port
|
||||||
|
* @param integer $tval
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function connect($host, $port = false, $tval = 30)
|
||||||
|
{
|
||||||
|
// Are we already connected?
|
||||||
|
if ($this->connected) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
||||||
|
//Rather than suppress it with @fsockopen, capture it cleanly instead
|
||||||
|
set_error_handler(array($this, 'catchWarning'));
|
||||||
|
|
||||||
|
if (false === $port) {
|
||||||
|
$port = $this->POP3_PORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// connect to the POP3 server
|
||||||
|
$this->pop_conn = fsockopen(
|
||||||
|
$host, // POP3 Host
|
||||||
|
$port, // Port #
|
||||||
|
$errno, // Error Number
|
||||||
|
$errstr, // Error Message
|
||||||
|
$tval
|
||||||
|
); // Timeout (seconds)
|
||||||
|
// Restore the error handler
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
|
// Did we connect?
|
||||||
|
if (false === $this->pop_conn) {
|
||||||
|
// It would appear not...
|
||||||
|
$this->setError(array(
|
||||||
|
'error' => "Failed to connect to server $host on port $port",
|
||||||
|
'errno' => $errno,
|
||||||
|
'errstr' => $errstr
|
||||||
|
));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increase the stream time-out
|
||||||
|
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||||
|
|
||||||
|
// Get the POP3 server response
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
// Check for the +OK
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
// The connection is established and the POP3 server is talking
|
||||||
|
$this->connected = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log in to the POP3 server.
|
||||||
|
* Does not support APOP (RFC 2828, 4949).
|
||||||
|
* @access public
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function login($username = '', $password = '')
|
||||||
|
{
|
||||||
|
if (!$this->connected) {
|
||||||
|
$this->setError('Not connected to POP3 server');
|
||||||
|
}
|
||||||
|
if (empty($username)) {
|
||||||
|
$username = $this->username;
|
||||||
|
}
|
||||||
|
if (empty($password)) {
|
||||||
|
$password = $this->password;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send the Username
|
||||||
|
$this->sendString("USER $username" . self::CRLF);
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
// Send the Password
|
||||||
|
$this->sendString("PASS $password" . self::CRLF);
|
||||||
|
$pop3_response = $this->getResponse();
|
||||||
|
if ($this->checkResponse($pop3_response)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnect from the POP3 server.
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function disconnect()
|
||||||
|
{
|
||||||
|
$this->sendString('QUIT');
|
||||||
|
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||||
|
//So ignore errors here
|
||||||
|
try {
|
||||||
|
@fclose($this->pop_conn);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
//Do nothing
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a response from the POP3 server.
|
||||||
|
* $size is the maximum number of bytes to retrieve
|
||||||
|
* @param integer $size
|
||||||
|
* @return string
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function getResponse($size = 128)
|
||||||
|
{
|
||||||
|
$response = fgets($this->pop_conn, $size);
|
||||||
|
if ($this->do_debug >= 1) {
|
||||||
|
echo "Server -> Client: $response";
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send raw data to the POP3 server.
|
||||||
|
* @param string $string
|
||||||
|
* @return integer
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function sendString($string)
|
||||||
|
{
|
||||||
|
if ($this->pop_conn) {
|
||||||
|
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
|
||||||
|
echo "Client -> Server: $string";
|
||||||
|
}
|
||||||
|
return fwrite($this->pop_conn, $string, strlen($string));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the POP3 server response.
|
||||||
|
* Looks for for +OK or -ERR.
|
||||||
|
* @param string $string
|
||||||
|
* @return boolean
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function checkResponse($string)
|
||||||
|
{
|
||||||
|
if (substr($string, 0, 3) !== '+OK') {
|
||||||
|
$this->setError(array(
|
||||||
|
'error' => "Server reported an error: $string",
|
||||||
|
'errno' => 0,
|
||||||
|
'errstr' => ''
|
||||||
|
));
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an error to the internal error store.
|
||||||
|
* Also display debug output if it's enabled.
|
||||||
|
* @param $error
|
||||||
|
*/
|
||||||
|
private function setError($error)
|
||||||
|
{
|
||||||
|
$this->errors[] = $error;
|
||||||
|
if ($this->do_debug >= 1) {
|
||||||
|
echo '<pre>';
|
||||||
|
foreach ($this->errors as $error) {
|
||||||
|
print_r($error);
|
||||||
|
}
|
||||||
|
echo '</pre>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POP3 connection error handler.
|
||||||
|
* @param integer $errno
|
||||||
|
* @param string $errstr
|
||||||
|
* @param string $errfile
|
||||||
|
* @param integer $errline
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function catchWarning($errno, $errstr, $errfile, $errline)
|
||||||
|
{
|
||||||
|
$this->setError(array(
|
||||||
|
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
||||||
|
'errno' => $errno,
|
||||||
|
'errstr' => $errstr,
|
||||||
|
'errfile' => $errfile,
|
||||||
|
'errline' => $errline
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue