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;
|
2014-03-24 21:07:32 +00:00
|
|
|
if ($(this).prop('checked'))
|
2012-01-21 01:27:06 +00:00
|
|
|
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')
|
2014-04-22 00:03:29 +00:00
|
|
|
.html('<img src=/img/loading.gif> Please wait...')
|
|
|
|
.load('/settings/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');
|
|
|
|
});
|
|
|
|
});
|
2013-09-08 19:48:26 +00:00
|
|
|
|
2013-09-08 20:41:01 +00:00
|
|
|
$('#accordion').accordion({
|
2013-09-08 19:48:26 +00:00
|
|
|
header: 'h4',
|
|
|
|
collapsible: true,
|
2013-09-08 20:41:01 +00:00
|
|
|
active: 0,
|
2013-09-08 19:48:26 +00:00
|
|
|
heightStyle: 'content'
|
|
|
|
});
|
2013-09-08 20:41:01 +00:00
|
|
|
|
|
|
|
// For now - until plugins are updated.
|
|
|
|
$('div.pluginsettings').find('br + br').remove();
|
2012-01-19 21:15:52 +00:00
|
|
|
});
|
|
|
|
|