Ticket #1146: mythweb_remote.2.diff
| File mythweb_remote.2.diff, 20.4 KB (added by , 19 years ago) |
|---|
-
mythweb/includes/mythfrontend.php
40 40 var $fp; 41 41 42 42 /** @var string Hostname to connect to. */ 43 var$host;43 public $host; 44 44 /** @var string Hostname to connect to. */ 45 var$port;45 public $port; 46 46 47 47 /** @var array List of jump points available on this host. */ 48 48 var $jump_points = array(); -
mythweb/skins/default/frontends.css
1 2 3 .success { 4 color: #3AF030; 5 background-color: #033600; 6 border-color: #3AF030; 7 border: thin groove #3AF030; 8 } 9 10 11 .frontends { 12 float: left; 13 left: 2%; 14 width: 20%; 15 position: relative; 16 } 17 18 19 .frontends select { 20 width: 100%; 21 } 22 23 24 .frontends option[disabled] { 25 color: #68686F; 26 } 27 28 .jumps { 29 30 float: left; 31 width: 50%; 32 left: 25%; 33 position: absolute; 34 } 35 36 .keys { 37 float: right; 38 width: 20%; 39 right: 2%; 40 position: relative; 41 } 42 43 44 .keypad td { 45 text-align : center; 46 width : 33%; 47 } 48 49 50 .keypad td:hover { 51 cursor : pointer; 52 border : 1px solid yellow; 53 } 54 -
mythweb/modules/frontends/jump.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 4 if( $_POST['frontends'] && $_POST['jump'] ) 5 foreach( $_POST['frontends'] as $frontend ) 6 $Frontends[$frontend]->send_jump( $_POST['jump'] ); 7 8 if( $_GET['frontends'] && $_GET['jump'] ) 9 foreach( $_GET['frontends'] as $frontend ) 10 $Frontends[$frontend]->send_jump( $_GET['jump'] ); 11 12 sleep(1); //give the frontend time to do it's thing -
mythweb/modules/frontends/keys.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 4 if( $_POST['frontends'] && $_POST['key'] ) 5 foreach( $_POST['frontends'] as $frontend ) 6 $Frontends[$frontend]->send_keypress( $_POST['key'] ); 7 8 if( $_GET['frontends'] && $_GET['key'] ) 9 foreach( $_GET['frontends'] as $frontend ) 10 $Frontends[$frontend]->send_keypress( $_GET['key'] ); 11 12 sleep(1); //give the frontend time to do it's thing -
mythweb/modules/frontends/handler.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 4 require_once( "includes/mythfrontend.php" ); 5 6 if( array_key_exists( "key", $_GET ) || array_key_exists( "key", $_POST ) ) 7 require_once( "modules/frontends/keys.php" ); 8 9 if( array_key_exists( "jump", $_GET ) || array_key_exists( "jump", $_POST ) ) 10 require_once( "modules/frontends/jump.php" ); 11 12 if( $Path[1] == "scripts.php" ) 13 require_once( "modules/frontends/scripts.php" ); 14 else 15 require_once( "modules/frontends/main.php" ); 16 -
mythweb/modules/frontends/init.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 /** 4 * Initialization routines for the MythWeb TV module. 5 * 6 * @url $URL: http://svn.mythtv.org/svn/branches/release-0-19-fixes/mythplugins/mythweb/modules/tv/init.php $ 7 * @date $Date: 2006-01-01 11:00:31 +1100 (Sun, 01 Jan 2006) $ 8 * @version $Revision: 8460 $ 9 * @author $Author: Philip Nelson <phatfil@optusnet.com.au> $ 10 * @license GPL 11 * 12 * @package MythWeb 13 * @subpackage TV 14 * 15 /**/ 16 17 // The TV module is always enabled. 18 $Modules['frontends'] = array('path' => 'frontends', 19 'name' => t('Frontends'), 20 'links' => array('status' => t('Frontend Status'), 21 ), 22 ); 23 -
mythweb/modules/frontends/main.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 4 // Set the desired page title 5 $page_title = 'MythTV Frontend Status'; 6 7 // Custom headers 8 $headers[] = '<link rel="stylesheet" type="text/css" href="'.skin_url.'/frontends.css" />'; 9 10 // Print the page header 11 require 'modules/_shared/tmpl/'.tmpl.'/header.php'; 12 ?> 13 14 15 <script id="scripts" language="javascript" type="text/javascript"></script> 16 17 <script language="javascript" type="text/javascript"> 18 document.onload = get_element( "scripts" ).src = "frontends/scripts.php"; 19 </script> 20 21 22 <h1>Frontends (TESTING)</h1> 23 24 <form id="main" method="post" action="frontends"> 25 26 27 <!-- Frontends --> 28 <div class="frontends"> 29 30 <fieldset> 31 <legend>Frontends</legend> 32 33 <div id="no_frontends_reachable" class="hidden">No frontends reachable</div> 34 <div id="no_frontends_selected" class="hidden">No frontends selected</div> 35 36 <select id="frontends_select" multiple name="frontends[]"> 37 38 <option id="loading_option">LOADING...</option> 39 40 </select> 41 42 </fieldset> 43 44 <p>You must select at least one frontend to communicate with. You can select as many as you want by holding CTRL while selecting multiple options. All discovered frontends are listed, any that are unreachable will appear as disabled select options.</p> 45 46 </div> 47 48 49 <!-- Jump points --> 50 <div id="jumps" class="jumps"></div> 51 52 53 <!-- Keys --> 54 <div class='keys'> 55 56 <table width='100%' border=1 class="keypad"> 57 <tr><td class='menu' colspan=3><font color=white face='Courier New'><b>MythTV - Remote</b></font></td></tr> 58 <tr><td colspan=3></td></tr> 59 <tr><td onclick="sendKey(1)">1</td><td onclick="sendKey(2)">2</td><td onclick="sendKey(1)">3</td></tr> 60 <tr><td onclick="sendKey(4)">4</td><td onclick="sendKey(5)">5</td><td onclick="sendKey(6)">6</td></tr> 61 <tr><td onclick="sendKey(7)">7</td><td onclick="sendKey(8)">8</td><td onclick="sendKey(9)">9</td></tr> 62 <tr><td border="0"></td><td onclick="sendKey(0)">0</td><td border="0"></td></tr> 63 <tr><td colspan=3></td></tr> 64 <tr><td></td><td onclick="sendKey('up')">Up</td><td></td></tr> 65 <tr><td onclick="sendKey('left')">Left</td><td onclick="sendKey('enter')">Enter</td><td onclick="sendKey('right')">Right</td></tr> 66 <tr><td></td><td onclick="sendKey('down')">Down</td><td></td></tr> 67 <tr><td colspan=3></td></tr> 68 <tr><td onclick="sendKey('delete')">Delete</a></td><td></td><td onclick="sendKey('end')">End</td></tr> 69 <tr><td onclick="sendKey('pageup')">Page Up</a></td><td onclick="sendKey('escape')">Escape</td><td onclick="sendKey('pagedown')">Page Down</td></tr> 70 </table> 71 72 Select other possible 73 <select> 74 75 <option>keys</option> 76 <option onclick="sendKey('space')">space</option> 77 <option onclick="sendKey('backspace')">backspace</option> 78 <option onclick="sendKey('slash')">/</option> 79 <option onclick="sendKey('backslash')">\</option> 80 <option onclick="sendKey('bracketleft')">[</option> 81 <option onclick="sendKey('bracketright')">]</option> 82 <option onclick="sendKey('colon')">:</option> 83 <option onclick="sendKey('semicolon')">;</option> 84 <option onclick="sendKey('equal')">=</option> 85 <option onclick="sendKey('greater')">greater</option> 86 <option onclick="sendKey('less')">less</option> 87 <option onclick="sendKey('f1')">F1</option> 88 <option onclick="sendKey('f2')">F2</option> 89 <option onclick="sendKey('f3')">F3</option> 90 <option onclick="sendKey('f4')">F4</option> 91 <option onclick="sendKey('f5')">F5</option> 92 <option onclick="sendKey('f6')">F6</option> 93 <option onclick="sendKey('f7')">F7</option> 94 <option onclick="sendKey('f8')">F8</option> 95 <option onclick="sendKey('f9')">F9</option> 96 <option onclick="sendKey('f10')">F10</option> 97 <option onclick="sendKey('f11')">F11</option> 98 <option onclick="sendKey('f12')">F12</option> 99 100 </select> 101 to send 102 103 <br> 104 Keypress to send: <input id="key" type="text" name="key" size="11" /> 105 <input type="button" value="Send" onclick="sendPOST()"> 106 <br><br> 107 <div align="center"><input id="detect_key_presses_button" type="button" onclick="toggleKeyDetect(); this.value == 'Detect Key Presses (OFF)' ? this.value='Detect Key Presses (ON)' : this.value='Detect Key Presses (OFF)'" value="Detect Key Presses (OFF)" /></div> 108 109 <p>Keypress can be a letter, number or one of the following: backslash, backspace, bracketleft, bracketright, colon, down, enter, equal, escape, f1, f10, f11, f12, f2, f3, f4, f5, f6, f7, f8, f9, greater, left, less, pagedown, pageup, right, semicolon, slash, space, up</p> 110 <p>"Detect Key Presses" will send every key that is pressed in the browser window to the selected frontends</p> 111 112 </div> 113 114 115 </form> 116 117 118 <?php 119 // Print the page footer 120 require 'modules/_shared/tmpl/'.tmpl.'/footer.php'; 121 ?> -
mythweb/modules/frontends/tmpl/default/welcome.php
1 <?php 2 /** 3 * Welcome page description of the Music module. 4 * 5 * @url $URL: http://svn.mythtv.org/svn/trunk/mythplugins/mythweb/modules/music/tmpl/default/welcome.php $ 6 * @date $Date: 2005-12-13 20:23:18 +1300 (Tue, 13 Dec 2005) $ 7 * @version $Revision: 8252 $ 8 * @author $Author: xris $ 9 * @license GPL 10 * 11 * @package MythWeb 12 * 13 /**/ 14 15 // Open with a div and an image 16 echo '<div id="info_music" class="hidden">', 17 '<img src="', skin_url, '/img/music.png" class="module_icon" />', 18 19 // Print a basic overview of what this module does 20 t('welcome: music'), 21 22 // Next, print a list of possible subsectons 23 #### 24 25 // Close the div 26 "</div>\n"; 27 No newline at end of file -
mythweb/modules/frontends/scripts.php
1 <?php 2 /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ 3 4 Header("content-type: application/x-javascript"); 5 ?> 6 7 8 function set() 9 { 10 main_form = document.forms[0]; 11 frontends_select = get_element("frontends_select"); 12 jumps_div = get_element("jumps"); 13 14 <?php 15 16 foreach ($Frontends as $frontend) 17 { 18 19 $hostName = $frontend->host; 20 $location = $frontend->query_location(); 21 $jumppoints = $frontend->get_jump_points(); 22 23 if ( !empty( $hostName ) ) 24 { ?> 25 26 // FRONTENDS 27 var frontends_select_option = document.createElement("option"); 28 frontends_select_option.disabled = <?php echo $location == "Unreachable" ? "true" : "false" ?>; 29 frontends_select_option.text = "<?php echo $hostName ?>"; 30 frontends_select.add(frontends_select_option, null); 31 32 // JUMPS 33 34 new_element = document.createElement("div"); 35 36 new_element.innerHTML = "<h3><?php echo $hostName; ?></h3>Current location:<?php echo $location; ?><br><br>Jump to "; 37 38 jumps_select = document.createElement("select"); 39 jumps_select.onchange = "document.forms['main'].submit()"; 40 jumps_select.onchange = sendJump; 41 42 jumps_option_default = document.createElement("option"); 43 jumps_option_default.selected = true; 44 jumps_option_default.value = "DEFAULT"; 45 jumps_option_default.text = ""; 46 47 jumps_select.appendChild(jumps_option_default); 48 jumps_select.selectedIndex = jumps_option_default.index; 49 50 <?php foreach ( array_keys($jumppoints) as $jumppoint_key ) { ?> 51 jumps_option = document.createElement("option"); 52 jumps_option.value = "<?php echo $jumppoint_key ?>"; 53 jumps_option.text = "<?php echo trim( $jumppoints[$jumppoint_key] ) ?>"; 54 jumps_select.appendChild(jumps_option); 55 <?php } ?> 56 57 new_element.appendChild(jumps_select); 58 jumps_div.appendChild(new_element); 59 60 <? 61 } 62 } 63 ?> 64 } 65 set(); 66 67 loading = get_element("loading_option"); 68 loading.parentNode.removeChild(loading); 69 70 71 function clear() 72 { 73 for (frontends_option in get_element("frontends_select").options) 74 frontends_select.remove(frontends_option); 75 76 get_element("jumps").innerHTML = ""; 77 get_element("key").value = ""; 78 } 79 80 function update() 81 { 82 clear(); 83 set(); 84 } 85 86 function setKey(value) 87 { 88 key = get_element("key"); 89 key.value = value; 90 } 91 92 function sendKey(value) 93 { 94 setKey(value); 95 sendPOST(getSelectedFrontends() + "key=" + value); 96 } 97 98 function keypress(event) 99 { 100 switch(event.keyCode) 101 { 102 case 8: key = "backspace"; break; 103 case 13: key = "enter"; break; 104 case 27: key = "escape"; break; 105 case 33: key = "pageup"; break; 106 case 34: key = "pagedown"; break; 107 case 37: key = "left"; break; 108 case 38: key = "up"; break; 109 case 39: key = "right"; break; 110 case 40: key = "down"; break; 111 case 46: key = "delete"; break; 112 113 case 112: key = "f1"; break; 114 case 113: key = "f2"; break; 115 case 114: key = "f3"; break; 116 case 115: key = "f4"; break; 117 case 116: key = "f5"; break; 118 case 117: key = "f6"; break; 119 case 118: key = "f7"; break; 120 case 119: key = "f8"; break; 121 case 120: key = "f9"; break; 122 case 121: key = "f10"; break; 123 case 122: key = "f11"; break; 124 case 123: key = "f12"; break; 125 126 default: key = String.fromCharCode(event.charCode); break; 127 } 128 129 sendKey(key); 130 } 131 132 function toggleKeyDetect() 133 { 134 window.onkeypress == null ? window.onkeypress = keypress : window.onkeypress = null; 135 } 136 137 138 function sendJump( value ) 139 { 140 sendPOST(getSelectedFrontends() + "jump=" + this.value); 141 } 142 143 144 function getSelectedFrontends() 145 { 146 147 frontends_string = ""; 148 frontends = document.forms['main'].elements['frontends[]']; 149 150 for (index = 0; index < frontends.length; index++) 151 { 152 if( frontends.options[index].selected ) 153 frontends_string += "frontends[" + index + "]=" + frontends.options[index].value + "&"; 154 } 155 156 return frontends_string; 157 } 158 159 160 function sendPOST(send_string) 161 { 162 var req = get_connection_object(); 163 req.open("POST", "frontends", false); 164 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 165 req.send(send_string); 166 } -
mythweb/modules/_shared/lang/English_GB.lang
217 217 "Found %s results for '%s'" 218 218 "freqid" 219 219 "Friday" 220 "Frontend Status" 221 "Frontends" 220 222 "generic_date" 221 223 %a %b %e, %Y 222 224 "generic_time" -
mythweb/modules/_shared/lang/Catalan.lang
325 325 id freqÌÚncia 326 326 "Friday" 327 327 Divendres 328 "Frontend Status" 329 "Frontends" 328 330 "generic_date" 329 331 %b %e, %Y 330 332 "generic_time" -
mythweb/modules/_shared/lang/Spanish.lang
325 325 id frecuencia 326 326 "Friday" 327 327 Viernes 328 "Frontend Status" 329 "Frontends" 328 330 "generic_date" 329 331 %b %e, %Y 330 332 "generic_time" -
mythweb/modules/_shared/lang/French.lang
279 279 "freqid" 280 280 "Friday" 281 281 Vendredi 282 "Frontend Status" 283 "Frontends" 282 284 "generic_date" 283 285 %e %b, %Y 284 286 "generic_time" -
mythweb/modules/_shared/lang/Swedish.lang
406 406 frekvens-id 407 407 "Friday" 408 408 Fredag 409 "Frontend Status" 410 "Frontends" 409 411 "generic_date" 410 412 %Y-%m-%d 411 413 "generic_time" -
mythweb/modules/_shared/lang/Danish.lang
320 320 Frekvens ID 321 321 "Friday" 322 322 Fredag 323 "Frontend Status" 324 "Frontends" 323 325 "generic_date" 324 326 %a %e %b %Y 325 327 "generic_time" -
mythweb/modules/_shared/lang/Dutch.lang
313 313 frequentie 314 314 "Friday" 315 315 Vrijdag 316 "Frontend Status" 317 "Frontends" 316 318 "generic_date" 317 319 %a %e %b, %Y 318 320 "generic_time" -
mythweb/modules/_shared/lang/German.lang
313 313 Kanal 314 314 "Friday" 315 315 Freitag 316 "Frontend Status" 317 "Frontends" 316 318 "generic_date" 317 319 %e.%m.%Y 318 320 "generic_time" -
mythweb/modules/_shared/lang/Japanese.lang
314 314 åšæ³¢æ°ID 315 315 "Friday" 316 316 éææ¥ 317 "Frontend Status" 318 "Frontends" 317 319 "generic_date" 318 320 %Y %b %e 319 321 "generic_time" -
mythweb/modules/_shared/lang/English.lang
212 212 "Found %s results for '%s'" 213 213 "freqid" 214 214 "Friday" 215 "Frontend Status" 216 "Frontends" 215 217 "generic_date" 216 218 %a %b %e, %Y 217 219 "generic_time" -
mythweb/modules/_shared/lang/Czech.lang
248 248 "freqid" 249 249 "Friday" 250 250 Pátek 251 "Frontend Status" 252 "Frontends" 251 253 "generic_date" 252 254 %a %b %e, %Y 253 255 "generic_time" -
mythweb/modules/_shared/lang/Finnish.lang
305 305 "freqid" 306 306 "Friday" 307 307 Perjantai 308 "Frontend Status" 309 "Frontends" 308 310 "generic_date" 309 311 %a %b %e, %Y 310 312 "generic_time" -
mythweb/modules/_shared/lang/Slovenian.lang
273 273 "freqid" 274 274 "Friday" 275 275 Petek 276 "Frontend Status" 277 "Frontends" 276 278 "generic_date" 277 279 %e.%m.%Y 278 280 "generic_time"
