2012-01-19 21:15:52 +00:00
|
|
|
(function($)
|
|
|
|
{
|
|
|
|
$.fn.enable = function()
|
|
|
|
{
|
|
|
|
return this.each(function() {
|
|
|
|
$(this)
|
|
|
|
.removeClass('ui-state-disabled')
|
|
|
|
.removeProp('disabled');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.disable = function()
|
|
|
|
{
|
|
|
|
return this.each(function() {
|
|
|
|
$(this)
|
|
|
|
.addClass('ui-state-disabled')
|
|
|
|
.prop('disabled', true);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
})(jQuery);
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(":submit").button();
|
2012-11-30 21:17:16 +00:00
|
|
|
//$('[type="checkbox"] :not(.yesno)').iphoneStyle();
|
|
|
|
$('[type="checkbox"]').iphoneStyle({
|
|
|
|
checkedLabel: 'YES',
|
|
|
|
uncheckedLabel: 'NO'
|
|
|
|
});
|
2012-01-19 21:15:52 +00:00
|
|
|
$('form.auto').each(function(i, el) {
|
|
|
|
var id = $(this).attr('id');
|
2012-10-08 22:40:51 +00:00
|
|
|
var output = '#' + id + '_output';
|
2012-01-19 21:15:52 +00:00
|
|
|
$(this).ajaxForm({
|
|
|
|
target: output,
|
|
|
|
success: function() {
|
2012-10-08 22:40:51 +00:00
|
|
|
$(output)
|
|
|
|
.css('font-style', 'italic')
|
|
|
|
.show('slow')
|
|
|
|
.delay(2000)
|
|
|
|
.fadeOut('slow');
|
2012-01-19 21:15:52 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-04-05 20:07:42 +00:00
|
|
|
$('.setting_toggle').change(function() {
|
2012-01-21 01:27:06 +00:00
|
|
|
var arg = '0';
|
2013-04-05 20:07:42 +00:00
|
|
|
var urlargs;
|
2012-01-21 01:27:06 +00:00
|
|
|
if ($(this).attr('checked'))
|
|
|
|
arg = '1';
|
|
|
|
|
2013-04-05 20:07:42 +00:00
|
|
|
if ($(this).attr('invert'))
|
|
|
|
arg = arg == "0" ? "1" : "0";
|
2012-05-21 20:23:41 +00:00
|
|
|
|
2013-04-05 20:07:42 +00:00
|
|
|
var el = $(this);
|
|
|
|
var attr = $(this).attr('attr');
|
|
|
|
var output = '#' + attr + '_output';
|
2012-11-16 21:16:03 +00:00
|
|
|
|
2013-04-05 20:07:42 +00:00
|
|
|
if ($(this).attr('useval'))
|
|
|
|
urlargs = 'act=' + attr + '&val=' + arg;
|
|
|
|
else
|
|
|
|
urlargs = attr + '=' + arg;
|
2013-02-17 22:58:37 +00:00
|
|
|
|
|
|
|
$(this).disable();
|
|
|
|
|
2013-04-05 20:07:42 +00:00
|
|
|
$(output)
|
2013-02-17 22:58:37 +00:00
|
|
|
.empty()
|
|
|
|
.show('slow')
|
2013-04-05 20:07:42 +00:00
|
|
|
.load('/cgi-bin/settings.jim?' + urlargs,
|
2013-02-17 22:58:37 +00:00
|
|
|
function() {
|
2013-04-05 20:07:42 +00:00
|
|
|
$(el).enable();
|
|
|
|
$(output)
|
2013-02-17 22:58:37 +00:00
|
|
|
.css('font-style', 'italic')
|
|
|
|
.delay(2000).fadeOut('slow');
|
|
|
|
});
|
|
|
|
});
|
2012-01-19 21:15:52 +00:00
|
|
|
});
|
|
|
|
|