hide buttons until dialogue has loaded

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3169 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2016-08-14 12:33:53 +00:00
parent 0bd1f610d1
commit 950051032e
2 changed files with 77 additions and 71 deletions

View File

@ -1,10 +1,10 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.3.1-2 Version: 1.3.1-3
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hpkg.tv Maintainer: af123@hpkg.tv
Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.3),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl
Suggests: Suggests:
Description: An evolving web interface for the Humax. Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/7116/ Tags: http://hummy.tv/forum/threads/7116/

View File

@ -1,6 +1,7 @@
$(function() { $(function() {
function doschedule(type)
{ function doschedule(type)
{
$('#epginfo_extra').load('/cgi-bin/epg/schedule.jim?' + $('#epginfo_extra').load('/cgi-bin/epg/schedule.jim?' +
'service=' + 'service=' +
encodeURIComponent($('#epgpopup_dialogue').attr('xs')) + encodeURIComponent($('#epgpopup_dialogue').attr('xs')) +
@ -14,20 +15,20 @@ $(function() {
}); });
$(":button:contains('Record')").fadeOut('slow'); $(":button:contains('Record')").fadeOut('slow');
$(":button:contains('Reminder')").fadeOut('slow'); $(":button:contains('Reminder')").fadeOut('slow');
} }
var $buttons1 = { var $buttons1 = {
"Close" : function() {$(this).dialog('close');} "Close" : function() {$(this).dialog('close');}
}; };
var $buttons2 = $.extend( var $buttons2 = $.extend(
{"Record Programme": function() { doschedule(1) }}, {"Record Programme": function() { doschedule(1) }},
{"Set Reminder": function() { doschedule(3) }}, {"Set Reminder": function() { doschedule(3) }},
$buttons1); $buttons1);
var $buttons3 = $.extend( var $buttons3 = $.extend(
{"Record Series": function() { doschedule(2) }}, {"Record Series": function() { doschedule(2) }},
$buttons2); $buttons2);
var $dialog = $('#epgpopup_dialogue').dialog({ var $dialog = $('#epgpopup_dialogue').dialog({
title: "Programme Details", title: "Programme Details",
modal: false, autoOpen: false, modal: false, autoOpen: false,
height: 500, width: 700, height: 500, width: 700,
@ -36,21 +37,24 @@ $(function() {
buttons: $buttons1, buttons: $buttons1,
close: function(e,u) { $('#epgpopup_dialogue').empty().html( close: function(e,u) { $('#epgpopup_dialogue').empty().html(
'<img src="/img/loading.gif" alt="loading">'); } '<img src="/img/loading.gif" alt="loading">'); }
}); });
function epgpopup(e, o) function epgpopup(e, o)
{ {
e.preventDefault(); e.preventDefault();
var sch = o.attr('sch'); var sch = o.attr('sch');
var rec = o.attr('rec'); var rec = o.attr('rec');
$dialog.dialog("option", "buttons", $buttons1);
if (sch != 0) if (sch != 0)
$dialog.dialog("option", "buttons", $buttons1); $buttons = $buttons1;
else if (rec == 2) else if (rec == 2)
$dialog.dialog("option", "buttons", $buttons3); $buttons = $buttons3;
else if (rec == 1) else if (rec == 1)
$dialog.dialog("option", "buttons", $buttons2); $buttons = $buttons2;
else else
$dialog.dialog("option", "buttons", $buttons1); $buttons = $buttons1;
var url = '/cgi-bin/epg/info.jim?service=' + var url = '/cgi-bin/epg/info.jim?service=' +
o.attr('xs') + '&event=' + o.attr('xs') + '&event=' +
o.attr('xe') + '&bare=1'; o.attr('xe') + '&bare=1';
@ -58,6 +62,7 @@ $(function() {
.html('<img src=/img/loading.gif> Loading details...' + .html('<img src=/img/loading.gif> Loading details...' +
' Please wait...') ' Please wait...')
.load(url, function() { .load(url, function() {
$dialog.dialog("option", "buttons", $buttons);
$('#epgpopup_dialogue a.event').click(function(e) { $('#epgpopup_dialogue a.event').click(function(e) {
epgpopup(e, $(this)); epgpopup(e, $(this));
}); });
@ -66,9 +71,10 @@ $(function() {
.attr('xs', o.attr('xs')) .attr('xs', o.attr('xs'))
.attr('xe', o.attr('xe')); .attr('xe', o.attr('xe'));
$dialog.dialog('open'); $dialog.dialog('open');
} }
$('a.event').click(function(e) { $('a.event').click(function(e) {
e.preventDefault(); e.preventDefault();
epgpopup(e, $(this)) epgpopup(e, $(this))
}); });
}); });