/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Functions used in Setup configuration forms
*/
// 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').click(function () {
var old_location = window.location;
window.location.href = 'https:' + old_location.href.substring(old_location.protocol.length);
return false;
});
}
var hiddenmessages = $('.hiddenmessage');
if (hiddenmessages.length > 0) {
hiddenmessages.hide();
var link = $('#show_hidden_messages');
link.click(function (e) {
e.preventDefault();
hiddenmessages.show();
$(this).remove();
});
link.html(link.html().replace('#MSG_COUNT', hiddenmessages.length));
link.show();
}
});
// set document width
$(document).ready(function () {
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