Current Courses

/* global trackGeoLocation, jqueryReady */
/* exported resourceLoadedSuccessfully */
function requestGeoPosition() { // console.log('Requesting GeoLocation data from the browser...'); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showGeoPosition, logGeoLocationError, { maximumAge: 600000, timeout: 5000, enableHighAccuracy: true }); } else { // console.log('Browser does not support Geo Location'); } }
function logGeoLocationError(error) { switch (error.code) { case error.PERMISSION_DENIED: // console.log('User denied the request for GeoLocation.'); break; case error.POSITION_UNAVAILABLE: // console.log('Location information is unavailable.'); break; case error.TIMEOUT: // console.log('The request to get user location timed out.'); break; default: // console.log('An unknown error occurred.'); break; } }
function showGeoPosition(position) { $('[name="geolocation"]').val(position.coords.latitude + ',' + position.coords.longitude + ',' + position.coords.accuracy + ',' + position.timestamp); }
function preserveAnchorTagOnForm() { $('#loginForm').submit(function () { var location = self.document.location; var hash = decodeURIComponent(location.hash);
if (hash != undefined && hash != '' && hash.indexOf('#') === -1) { hash = '#' + hash; }
var action = $('#loginForm').attr('action'); if (action == undefined) { action = location.href; } else { var qidx = location.href.indexOf('?'); if (qidx != -1) { var queryParams = location.href.substring(qidx); action += queryParams; } } action += hash; $('#loginForm').attr('action', action);
}); }
function areCookiesEnabled() { if ($.cookie == undefined) { return; }
$.cookie('cookiesEnabled', 'true'); var value = $.cookie('cookiesEnabled'); $.removeCookie('cookiesEnabled'); return value != undefined;
}
function disableEmptyInputFormSubmission() { var fields = $('#loginForm input[name="Email"],[name="Password"]');
if (fields.length == 2) { fields.on('input', function (event) { var enableSubmission = $('#loginForm input[name="Email"]').val().trim() && $('#loginForm input[name="Password"]').val().trim();
if (enableSubmission) { $('#loginForm input[name=submit]').removeAttr('disabled'); event.stopPropagation(); } else { $('#loginForm input[name=submit]').attr('disabled', 'true'); } }); }
/** * Handle auto-complete events to the extent possible. */ if ($('#loginForm input[name="Email"]').length > 0) { setTimeout(function () { var uid = $('#username').val(); if (uid != null && uid != '') { $('#username').change(); $('#username').focus(); $('#loginForm input[name=submit]').removeAttr('disabled'); }
}, 100); } }
function resourceLoadedSuccessfully() { $(document).ready(function () {
if (trackGeoLocation) { requestGeoPosition(); }
if ($(':focus').length === 0) { $('input:visible:enabled:first').focus(); }
if (areCookiesEnabled()) { $('#cookiesDisabled').hide(); } else { $('#cookiesDisabled').show(); }
disableEmptyInputFormSubmission(); //preserveAnchorTagOnForm();
$('#capslock-on').hide(); $('#loginForm input[name="Email"],[name="Password"]').trigger('input'); $('#loginForm input[name="Email"]').focus();
$('#password').keypress(function (e) { //console.log("asdasdsada"); var s = String.fromCharCode(e.which); if (s.toUpperCase() === s && s.toLowerCase() !== s && !e.shiftKey) { //console.log(s) $('#capslock-on').show(); $('#password-clear').hide(); } else { //console.log("hide",s); $('#capslock-on').hide(); $('#password-clear').show();
} }); if (typeof (jqueryReady) == 'function') { jqueryReady(); } });
}
function isCapLock(e) {
if (e) {
var w = e.which ? e.which : (e.keyCode ? e.keyCode : -1);
var s = e.shiftKey ? e.shiftKey : (e.modifiers ? !!(e.modifiers & 4) : false);
var c = ((w >= 65 && w <= 90) && !s) || ((w >= 97 && w <= 122) && s);
if (c) {
// if(this.id=='username') document.getElementById('username-caps').style.visibility='visible';
if (this.id == 'password') document.getElementById('password-caps').style.visibility = 'visible';
} else {
// if(this.id=='username') document.getElementById('username-caps').style.visibility='hidden';
if (this.id == 'password') document.getElementById('password-caps').style.visibility = 'hidden';
}
}
}
function kilitle() {
document.getElementById('btnSubmit').disabled = true; // tikladiginda butonu kilitlenir.
$('.welcome-title').focus(); // 2 kere enter basmamasi icin
return true;
}