/**
* Functions used in Setup configuration forms
*/
/* global displayErrors, getAllValues, getIdPrefix, validators */ // js/config.js
// show this window in top frame
if (top !== self) {
window.top.location.href = location;
}
// ------------------------------------------------------------------
// Messages
//
$(function () {
if (window.location.protocol === 'https:') {
$('#no_https').remove();
} else {
$('#no_https a').on('click', function () {
var oldLocation = window.location;
window.location.href = 'https:' + oldLocation.href.substring(oldLocation.protocol.length);
return false;
});
}
var hiddenMessages = $('.hiddenmessage');
if (hiddenMessages.length > 0) {
hiddenMessages.hide();
var link = $('#show_hidden_messages');
link.on('click', function (e) {
e.preventDefault();
hiddenMessages.show();
$(this).remove();
});
link.html(link.html().replace('#MSG_COUNT', hiddenMessages.length));
link.show();
}
});
// set document width
$(function () {
var width = 0;
$('ul.tabs li').each(function () {
width += $(this).width() + 10;
});
var contentWidth = width;
width += 250;
$('body').css('min-width', width);
$('.tabs_contents').css('min-width', contentWidth);
});
//
// END: Messages
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// Form validation and field operations
//
/**
* Calls server-side validation procedures
*
* @param {Element} parent input field in