diff --git a/var/mongoose/cgi-bin/epg_search.jim b/var/mongoose/cgi-bin/epg_search.jim
index 0b986a0..cbdacf6 100755
--- a/var/mongoose/cgi-bin/epg_search.jim
+++ b/var/mongoose/cgi-bin/epg_search.jim
@@ -4,7 +4,6 @@ package require cgi
source /mod/var/mongoose/lib/epg.class
source /mod/var/mongoose/lib/spinner.class
source /mod/var/mongoose/lib/altrow
-source /mod/var/mongoose/lib/cat
puts "Content-Type: text/html"
puts ""
@@ -13,17 +12,25 @@ source /mod/var/mongoose/html/lib/header.jim
puts ""
-source /mod/var/mongoose/lib/epg_popup
-
cgi_input
#cgi_dump
+
+source /mod/var/mongoose/lib/epg_search
+
+[spinner new {
+ text "Searching EPG..."
+ size "1.2em"
+ style "margin: 1em;"
+ }] start
+
+source /mod/var/mongoose/lib/epg_popup
+
#set _cgi [dict create term "doctor who"]
#set env(REQUEST_URI) "test"
-set term ""
-catch { set term [dict get $_cgi term] }
set cmd "search"
-if {[dict exists $_cgi full]} { set cmd "searchall" }
+if {$searchfull} { set cmd "searchall" }
+
set ct 0
catch { set ct [dict get $_cgi ct] }
set crid ""
@@ -31,107 +38,22 @@ catch { set crid [dict get $_cgi crid] }
set scrid ""
catch { set scrid [dict get $_cgi scrid] }
-puts "
-
"
-
-[spinner new {
- text "Loading EPG Data..."
- size "1.2em"
- style "margin: 1em;"
- }] start
-
if {$ct > 0 } {
set records [epg fetch dump -type $ct]
} elseif {$crid ne ""} {
set records [epg fetch dump -crid $crid]
} elseif {$scrid ne ""} {
set records [epg fetch dump -scrid $scrid]
-} elseif {$term ne ""} {
- set records [epg fetch $cmd -extra $term]
+} elseif {$searchterm ne ""} {
+ set records [epg fetch $cmd -extra $searchterm]
+} else {
+ set records {}
}
set favlist [epg favlist]
-puts {
+if {[llength $records] > 0} {
+ puts {
| Date |
@@ -139,6 +61,9 @@ puts {
Programme |
Synopsis |
+ }
+} else {
+ puts "No results found."
}
proc rsort {v1 v2} {
@@ -173,10 +98,11 @@ foreach record [lsort -command rsort $records] {
}
puts "
"
-if {$term != ""} {
+if {$searchterm != ""} {
puts "
"
}
diff --git a/var/mongoose/html/epg.shtml b/var/mongoose/html/epg.shtml
index c4f49f4..479e242 100644
--- a/var/mongoose/html/epg.shtml
+++ b/var/mongoose/html/epg.shtml
@@ -1,27 +1,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/var/mongoose/html/img/more_hide.png b/var/mongoose/html/img/more_hide.png
new file mode 100644
index 0000000..5786461
Binary files /dev/null and b/var/mongoose/html/img/more_hide.png differ
diff --git a/var/mongoose/html/img/more_show.png b/var/mongoose/html/img/more_show.png
new file mode 100644
index 0000000..62ba86e
Binary files /dev/null and b/var/mongoose/html/img/more_show.png differ
diff --git a/var/mongoose/html/js/packages.js b/var/mongoose/html/js/packages.js
index 96ad842..20c214b 100755
--- a/var/mongoose/html/js/packages.js
+++ b/var/mongoose/html/js/packages.js
@@ -1,9 +1,4 @@
-function reset_results()
-{
- $('#dresults').empty().val('Running package command, please wait...');
-}
-
$(document).ready(function() {
$('button').button();
@@ -15,9 +10,8 @@ $(document).ready(function() {
draggable: true, resizable: true,
buttons: { "Close":
function() {$(this).dialog('close');}},
- close: function(e,u) { reset_results(); }
+ close: function(e,u) { window.location.reload(true); }
});
- reset_results();
var opkg = '/cgi-bin/opkg.jim?cmd=';
@@ -26,21 +20,13 @@ $(document).ready(function() {
$('#results').show('slow');
});
- $('button.remove').click(function() {
- $('#dresults').load(opkg +
- encodeURIComponent('remove ' + $(this).attr('id')));
- $dialog.dialog('open');
- });
-
- $('button.install').click(function() {
- $('#dresults').load(opkg +
- encodeURIComponent('install ' + $(this).attr('id')));
- $dialog.dialog('open');
- });
-
- $('button.upgrade').click(function() {
- $('#dresults').load(opkg +
- encodeURIComponent('upgrade ' + $(this).attr('id')));
+ $('button.remove, button.install, button.upgrade').click(function() {
+ $('#dspinner').show();
+ $('#dresults').load(
+ opkg + encodeURIComponent(
+ $(this).attr('action') + ' ' + $(this).attr('id')
+ ),
+ function() { $('#dspinner').hide('slow') });
$dialog.dialog('open');
});
});
diff --git a/var/mongoose/html/packages.shtml b/var/mongoose/html/packages.shtml
index b6e6708..e85ce0f 100644
--- a/var/mongoose/html/packages.shtml
+++ b/var/mongoose/html/packages.shtml
@@ -11,7 +11,10 @@ Results...
-
+
+
+

Processing...
+
diff --git a/var/mongoose/include/epg.jim b/var/mongoose/include/epg.jim
index 3dc36d4..9afb020 100755
--- a/var/mongoose/include/epg.jim
+++ b/var/mongoose/include/epg.jim
@@ -1,17 +1,17 @@
#!/mod/bin/jimsh
+package require cgi
source /mod/var/mongoose/lib/epg.class
source /mod/var/mongoose/lib/spinner.class
source /mod/var/mongoose/lib/altrow
-source /mod/var/mongoose/lib/cat
+source /mod/var/mongoose/lib/epg_search
[spinner new {
- text "Loading EPG Data..."
+ text "Loading Now/Next Information..."
size "1.2em"
style "margin: 1em;"
}] start
-#cat /mod/var/mongoose/lib/epg_popup
source /mod/var/mongoose/lib/epg_popup
set start [clock milliseconds]
diff --git a/var/mongoose/include/packages.jim b/var/mongoose/include/packages.jim
index 47c9d9d..34782ee 100755
--- a/var/mongoose/include/packages.jim
+++ b/var/mongoose/include/packages.jim
@@ -48,6 +48,7 @@ foreach name [lsort [array names avail]] {
}
puts " | "
puts ""
diff --git a/var/mongoose/lib/epg_search b/var/mongoose/lib/epg_search
new file mode 100755
index 0000000..59ff42b
--- /dev/null
+++ b/var/mongoose/lib/epg_search
@@ -0,0 +1,111 @@
+
+puts {
+
+}
+
+set searchterm ""
+catch { set searchterm [dict get $_cgi term] }
+set searchfull 0
+catch { if {[dict exists $_cgi full]} { set searchfull 1 } }
+
+puts "
+"
+
+puts {
+
+}
+