forked from hummypkg/webif
8a802e5c1d
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1662 2a923420-c742-0410-a762-8d5b09965624
87 lines
1.7 KiB
JavaScript
87 lines
1.7 KiB
JavaScript
(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();
|
|
//$('[type="checkbox"] :not(.yesno)').iphoneStyle();
|
|
$('[type="checkbox"]').iphoneStyle({
|
|
checkedLabel: 'YES',
|
|
uncheckedLabel: 'NO'
|
|
});
|
|
$('form.auto').each(function(i, el) {
|
|
var id = $(this).attr('id');
|
|
var output = '#' + id + '_output';
|
|
$(this).ajaxForm({
|
|
target: output,
|
|
success: function() {
|
|
$(output)
|
|
.css('font-style', 'italic')
|
|
.show('slow')
|
|
.delay(2000)
|
|
.fadeOut('slow');
|
|
}
|
|
});
|
|
});
|
|
|
|
$('.setting_toggle').change(function() {
|
|
var arg = '0';
|
|
var urlargs;
|
|
if ($(this).attr('checked'))
|
|
arg = '1';
|
|
|
|
if ($(this).attr('invert'))
|
|
arg = arg == "0" ? "1" : "0";
|
|
|
|
var el = $(this);
|
|
var attr = $(this).attr('attr');
|
|
var output = '#' + attr + '_output';
|
|
|
|
if ($(this).attr('useval'))
|
|
urlargs = 'act=' + attr + '&val=' + arg;
|
|
else
|
|
urlargs = attr + '=' + arg;
|
|
|
|
$(this).disable();
|
|
|
|
$(output)
|
|
.empty()
|
|
.show('slow')
|
|
.load('/cgi-bin/settings.jim?' + urlargs,
|
|
function() {
|
|
$(el).enable();
|
|
$(output)
|
|
.css('font-style', 'italic')
|
|
.delay(2000).fadeOut('slow');
|
|
});
|
|
});
|
|
|
|
$('#accordion').accordion({
|
|
header: 'h4',
|
|
collapsible: true,
|
|
active: 0,
|
|
heightStyle: 'content'
|
|
});
|
|
|
|
// For now - until plugins are updated.
|
|
$('div.pluginsettings').find('br + br').remove();
|
|
});
|
|
|