E2OpenPlugins / e2openplugin-OpenWebif

GPL Web Interface for e2stabs
GNU General Public License v3.0
205 stars 226 forks source link

Multiepg: use toplevel service list to switch service #656

Closed rdamas closed 2 years ago

rdamas commented 7 years ago

Is there anything against using the toplevel (and bottom level) service list elements (the div with class="service") to switch the service? Like in multiepg timer editor?

jbleyel commented 7 years ago

kein Problem, aber bitte den Link für Zap nicht im HTML code einbauen, sondern unten als jquery, sonst wird die Seite zu groß.

jbleyel commented 7 years ago

Für mode 1 hab ichs mal eingebaut.

rdamas commented 7 years ago

Könnte ein Kopie sein von dem was ich vorbereitet habe :-) Ich habe den zweiten Parameter von zapChannel() noch mit $(this).text() befüllt.

diff --git a/plugin/controllers/views/ajax/multiepg.tmpl b/plugin/controllers/views/ajax/multiepg.tmpl
index e4610c3..ae116b6 100644
--- a/plugin/controllers/views/ajax/multiepg.tmpl
+++ b/plugin/controllers/views/ajax/multiepg.tmpl
@@ -105,7 +105,12 @@
 <thead>
 <tr>
    #for $sname, $eventlist in $events.iteritems()
-   <td class="border"><div class="service ui-widget-header"><img src="$(picons[$sname])" /> $sname</div></td>
+   #set $sref = ""
+   #set $ev = $eventlist[0]
+   #if len($ev)
+       #set $sref = $ev[0].ref
+   #end if
+   <td class="border"><div class="service ui-widget-header" data-ref="$sref"><img src="$(picons[$sname])" /> $sname</div></td>
    #end for
 </tr>
 </thead>
@@ -127,7 +132,12 @@
 <tfoot>
 <tr>
    #for $sname, $eventlist in $events.iteritems()
-   <td class="border"><div class="service ui-widget-header"><img src="$(picons[$sname])" /> $sname</div></td>
+   #set $sref = ""
+   #set $ev = $eventlist[0]
+   #if len($ev)
+       #set $sref = $ev[0].ref
+   #end if
+   <td class="border"><div class="service ui-widget-header" data-ref="$sref"><img src="$(picons[$sname])" /> $sname</div></td>
    #end for
 </tr>
 </tfoot>
@@ -168,10 +178,15 @@
    </ol>

    #for $sname, $eventlist in $events.iteritems()
+       #set $sref = ""
+       #set $ev = $eventlist[0]
+       #if len($ev)
+           #set $sref = $ev[0].ref
+       #end if
        <ol class="channel-listing">
            <li>
                <span class="ui-widget-header">
-                   <div>
+                   <div class="tl-service" data-ref="$sref">
                        <h2 class="picon" ><img src="$(picons[$sname])" title="$sname" /></h2>
                        <span>$sname</span>
                    </div>
@@ -377,4 +392,12 @@ if(mepgdirect==1) {

 });
 #end if
+#raw
+$('.service, .tl-service').click(function() {
+    var ref = $(this).data("ref");
+    if (ref != "") {
+        zapChannel(ref, $(this).text());
+    }
+});
+#end raw
 </script>
jbleyel commented 7 years ago

Deins sieht besser aus. ;-)

jbleyel commented 2 years ago

Hi @rdamas , can we close this issue?

rdamas commented 2 years ago

Yes, of course.