mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 12:06:59 -05:00
Compare commits
No commits in common. "e3d8f64c5c078fe9afd8c6535bdefc7404aaad49" and "051fb87addaa66dd0994c7cf3cb5360ca551db7c" have entirely different histories.
e3d8f64c5c
...
051fb87add
@ -3,8 +3,6 @@
|
|||||||
from .brython import Brython
|
from .brython import Brython
|
||||||
from .brython_stdlib import Brython_stdlib
|
from .brython_stdlib import Brython_stdlib
|
||||||
|
|
||||||
from .brython_bry import Brython_bry
|
|
||||||
|
|
||||||
|
|
||||||
class fHDHR_Brython():
|
class fHDHR_Brython():
|
||||||
|
|
||||||
@ -13,5 +11,3 @@ class fHDHR_Brython():
|
|||||||
|
|
||||||
self.brython = Brython(fhdhr)
|
self.brython = Brython(fhdhr)
|
||||||
self.brython_stdlib = Brython_stdlib(fhdhr)
|
self.brython_stdlib = Brython_stdlib(fhdhr)
|
||||||
|
|
||||||
self.brython_bry = Brython_bry(fhdhr)
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ from flask import send_from_directory
|
|||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
|
||||||
class Brython():
|
class Brython():
|
||||||
endpoints = ["/brython.js"]
|
endpoints = ["/brython.js"]
|
||||||
endpoint_name = "file_brython_js"
|
endpoint_name = "file_brython_js"
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
from flask import send_from_directory
|
|
||||||
|
|
||||||
import pathlib
|
|
||||||
|
|
||||||
|
|
||||||
class Brython_bry():
|
|
||||||
endpoints = ["/brython.bry"]
|
|
||||||
endpoint_name = "file_brython_bry"
|
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
|
||||||
self.fhdhr = fhdhr
|
|
||||||
self.brython_path = pathlib.Path(self.fhdhr.config.internal["paths"]["fHDHR_web_dir"]).joinpath('brython')
|
|
||||||
|
|
||||||
def __call__(self, *args):
|
|
||||||
return self.get(*args)
|
|
||||||
|
|
||||||
def get(self, *args):
|
|
||||||
|
|
||||||
return send_from_directory(self.brython_path, 'brython_code.py')
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
from browser import document, bind # alert, window
|
|
||||||
|
|
||||||
|
|
||||||
@bind("#enable_button", "click")
|
|
||||||
def enable_all(event):
|
|
||||||
for element in document.get(selector='input[type="checkbox"]'):
|
|
||||||
if element.name.endswith("enabled"):
|
|
||||||
if document["enable_button"].value == "0":
|
|
||||||
element.checked = False
|
|
||||||
element.value = False
|
|
||||||
else:
|
|
||||||
element.checked = True
|
|
||||||
element.value = True
|
|
||||||
|
|
||||||
if document["enable_button"].value == "0":
|
|
||||||
document["enable_button"].value = "1"
|
|
||||||
document["enable_button"].text = "Enable All"
|
|
||||||
else:
|
|
||||||
document["enable_button"].value = "0"
|
|
||||||
document["enable_button"].text = "Disable All"
|
|
||||||
|
|
||||||
|
|
||||||
@bind("#chanSubmit", "submit")
|
|
||||||
def submit_fixup(evt):
|
|
||||||
for element in document.get(selector='input[type="checkbox"]'):
|
|
||||||
if element.name.endswith("enabled"):
|
|
||||||
if element.checked is False:
|
|
||||||
element.checked = True
|
|
||||||
element.value = False
|
|
||||||
if element.name.endswith("favorite"):
|
|
||||||
if element.checked is False:
|
|
||||||
element.checked = True
|
|
||||||
element.value = 0
|
|
||||||
|
|
||||||
items = document.select(".channels")
|
|
||||||
chanlist = []
|
|
||||||
chandict = {}
|
|
||||||
|
|
||||||
for element in items:
|
|
||||||
if element.name == "id":
|
|
||||||
if len(chandict.keys()):
|
|
||||||
chanlist.append(chandict)
|
|
||||||
chandict = {}
|
|
||||||
chandict[element.name] = element.value
|
|
||||||
element.clear()
|
|
||||||
|
|
||||||
postForm = document.createElement('form')
|
|
||||||
postData = document.createElement('input')
|
|
||||||
postForm.method = "POST"
|
|
||||||
postForm.action = "/api/channels?method=modify&redirect=/channels_editor"
|
|
||||||
postForm.setRequestHeader = "('Content-Type', 'application/json')"
|
|
||||||
postData.name = "channels"
|
|
||||||
postData.value = chanlist
|
|
||||||
postForm.appendChild(postData)
|
|
||||||
|
|
||||||
document.body.appendChild(postForm)
|
|
||||||
|
|
||||||
postForm.submit()
|
|
||||||
|
|
||||||
evt.preventDefault()
|
|
||||||
@ -2,7 +2,6 @@ from flask import send_from_directory
|
|||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
|
|
||||||
class Brython_stdlib():
|
class Brython_stdlib():
|
||||||
endpoints = ["/brython_stdlib.js"]
|
endpoints = ["/brython_stdlib.js"]
|
||||||
endpoint_name = "file_brython_stdlib_js"
|
endpoint_name = "file_brython_stdlib_js"
|
||||||
|
|||||||
@ -5,14 +5,9 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link href="style.css" rel="stylesheet">
|
<link href="style.css" rel="stylesheet">
|
||||||
|
|
||||||
<script type="text/javascript" src="/brython.js"></script>
|
|
||||||
<script type="text/javascript" src="/brython_stdlib.js"></script>
|
|
||||||
<script type="text/python" src="brython.bry"></script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="brython({debug: 1, indexedDB: false})">
|
<body>
|
||||||
|
|
||||||
<h1 class="center" style="text-align:center">
|
<h1 class="center" style="text-align:center">
|
||||||
<span style="text-decoration: underline;"><strong><em>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</em></strong>
|
<span style="text-decoration: underline;"><strong><em>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</em></strong>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -49,8 +49,8 @@
|
|||||||
<td>
|
<td>
|
||||||
{% if chan_dict["enabled"] %}
|
{% if chan_dict["enabled"] %}
|
||||||
<a href="{{ chan_dict["m3u_url"] }}">Play</a>
|
<a href="{{ chan_dict["m3u_url"] }}">Play</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ chan_dict["m3u_url"] }}" style="visibility:hidden">Play</a>
|
<a href="{{ chan_dict["m3u_url"] }}" style="visibility:hidden">Play</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,70 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<body onload="brython({debug: 1, indexedDB: false})">
|
||||||
|
<script type="text/javascript" src="/brython.js"></script>
|
||||||
|
<script type="text/javascript" src="/brython_stdlib.js"></script>
|
||||||
|
<script type="text/python" id="enable0">
|
||||||
|
from browser import document, alert, window, bind
|
||||||
|
|
||||||
|
@bind("#enable_button", "click")
|
||||||
|
def enable_all(event):
|
||||||
|
for element in document.get(selector='input[type="checkbox"]'):
|
||||||
|
if element.name.endswith("enabled"):
|
||||||
|
if document["enable_button"].value == "0":
|
||||||
|
element.checked = False
|
||||||
|
element.value = False
|
||||||
|
else:
|
||||||
|
element.checked = True
|
||||||
|
element.value = True
|
||||||
|
|
||||||
|
if document["enable_button"].value == "0":
|
||||||
|
document["enable_button"].value = "1"
|
||||||
|
document["enable_button"].text = "Enable All"
|
||||||
|
else:
|
||||||
|
document["enable_button"].value = "0"
|
||||||
|
document["enable_button"].text = "Disable All"
|
||||||
|
|
||||||
|
@bind("#chanSubmit", "submit")
|
||||||
|
def submit_fixup(evt):
|
||||||
|
for element in document.get(selector='input[type="checkbox"]'):
|
||||||
|
if element.name.endswith("enabled"):
|
||||||
|
if element.checked == False:
|
||||||
|
element.checked = True
|
||||||
|
element.value = False
|
||||||
|
if element.name.endswith("favorite"):
|
||||||
|
if element.checked == False:
|
||||||
|
element.checked = True
|
||||||
|
element.value = 0
|
||||||
|
|
||||||
|
items = document.select(".channels")
|
||||||
|
chanlist = []
|
||||||
|
chandict = {}
|
||||||
|
|
||||||
|
for element in items:
|
||||||
|
if element.name == "id":
|
||||||
|
if len(chandict.keys()):
|
||||||
|
chanlist.append(chandict)
|
||||||
|
chandict = {}
|
||||||
|
chandict[element.name] = element.value
|
||||||
|
element.clear()
|
||||||
|
|
||||||
|
postForm = document.createElement('form')
|
||||||
|
postData = document.createElement('input')
|
||||||
|
postForm.method = "POST"
|
||||||
|
postForm.action = "/api/channels?method=modify&redirect=/channels_editor"
|
||||||
|
postForm.setRequestHeader = "('Content-Type', 'application/json')"
|
||||||
|
postData.name = "channels"
|
||||||
|
postData.value = chanlist
|
||||||
|
postForm.appendChild(postData)
|
||||||
|
|
||||||
|
document.body.appendChild(postForm)
|
||||||
|
|
||||||
|
postForm.submit()
|
||||||
|
|
||||||
|
evt.preventDefault()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels Editor</h4>
|
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels Editor</h4>
|
||||||
|
|
||||||
@ -36,16 +100,16 @@
|
|||||||
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
|
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
|
||||||
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
|
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
|
||||||
{% if chan_dict["enabled"] %}
|
{% if chan_dict["enabled"] %}
|
||||||
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
|
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
|
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if chan_dict["favorite"] %}
|
{% if chan_dict["favorite"] %}
|
||||||
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
|
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
|
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>
|
<td>
|
||||||
<form method="post" action="/api/channels?method=update&redirect=/channels_editor">
|
<form method="post" action="/api/channels?method=update&redirect=/channels_editor">
|
||||||
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
|
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
|
||||||
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
|
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
|
||||||
@ -55,7 +119,7 @@
|
|||||||
<input type="hidden" class="reset" name="enabled" value=True>
|
<input type="hidden" class="reset" name="enabled" value=True>
|
||||||
<input type="submit" value="Reset">
|
<input type="submit" value="Reset">
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ config_item }}</td>
|
<td>{{ config_item }}</td>
|
||||||
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
|
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" action="/api/settings?method=update&redirect=/settings">
|
<form method="post" action="/api/settings?method=update&redirect=/settings">
|
||||||
<input type="hidden" name="config_section" value="{{ config_section }}">
|
<input type="hidden" name="config_section" value="{{ config_section }}">
|
||||||
<input type="hidden" name="config_name" value="{{ config_item }}">
|
<input type="hidden" name="config_name" value="{{ config_item }}">
|
||||||
@ -47,17 +47,17 @@
|
|||||||
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
|
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="display:flex;">
|
<td style="display:flex;">
|
||||||
<span style="margin:auto">
|
<span style="margin:auto">
|
||||||
<input type="submit" value="Update">
|
<input type="submit" value="Update">
|
||||||
</form>
|
</form>
|
||||||
</span>
|
</span>
|
||||||
<form style="margin:auto">
|
<form style="margin:auto">
|
||||||
<input type="hidden" name="config_section" value="{{ config_section }}">
|
<input type="hidden" name="config_section" value="{{ config_section }}">
|
||||||
<input type="hidden" name="config_name" value="{{ config_item }}">
|
<input type="hidden" name="config_name" value="{{ config_item }}">
|
||||||
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
||||||
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
||||||
<input type="submit" value="Reset">
|
<input type="submit" value="Reset">
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-medium center action-col">
|
<table class="table-medium center action-col">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Channel</th>
|
<th>Channel</th>
|
||||||
<th>Method</th>
|
<th>Method</th>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user