Merge pull request #130 from aceisace/bugfix/web-ui

Fix web-UI url handling
This commit is contained in:
Ace 2020-07-04 14:11:36 +02:00 committed by GitHub
commit 6386530c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,11 @@
</div> </div>
<div class="field"> <div class="field">
<label>Which E-Paper model are you using?</label> <label>Which E-Paper model are you using?</label>
<div class="ts checkboxes">
<div class="ts radio checkbox">
<input id="9_in_7" type="radio" name="dp" checked>
<label for="9_in_7">9.7" ePaper</label>
</div>
<div class="ts checkboxes"> <div class="ts checkboxes">
<div class="ts radio checkbox"> <div class="ts radio checkbox">
<input id="epd_7_in_5_v2_colour" type="radio" name="dp" checked> <input id="epd_7_in_5_v2_colour" type="radio" name="dp" checked>
@ -266,7 +271,7 @@
<div class="content"> <div class="content">
<p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div> <p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div>
</details> </details>
<input id="top_height" type="number" min="1" max="10000" placeholder="10"> <input id="top_height" type="number" min="1" max="100" placeholder="10">
</div> </div>
<div class="field"> <div class="field">
@ -301,7 +306,7 @@
<div class="content"> <div class="content">
<p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div> <p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div>
</details> </details>
<input id="middle_height" type="number" min="1" max="10000" placeholder="65"> <input id="middle_height" type="number" min="1" max="100" placeholder="65">
</div> </div>
@ -366,7 +371,7 @@
<div class="content"> <div class="content">
<p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div> <p>Section height is calculated relative to other sections. With this approach you can choose pixel-perfect, relative or percentage panel heights.</p></div>
</details> </details>
<input id="bottom_height" type="number" min="1" max="10000" placeholder="25"> <input id="bottom_height" type="number" min="1" max="100" placeholder="25">
</div> </div>
<div class="field"> <div class="field">
@ -390,14 +395,14 @@
Panel-specific settings Panel-specific settings
</legend> </legend>
<div class="field"> <div class="field">
<label>iCalendar URLs in the following format: 'URL 1', 'URL 2', 'URL 3'</label> <label>iCalendar URL/s, separated by comma: url1, url2, url3</label>
<input id="ical_urls" type="text" <input id="ical_urls" type="text"
placeholder="'https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics'"> placeholder="https://calendar.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics">
</div> </div>
<div class="field"> <div class="field">
<label>RSS-Feed URL/s in the following format: 'URL 1', 'URL 2', 'URL 3'</label> <label>RSS-Feed URL/s, separated by comma: url1, url2, url3</label>
<input id="rss_urls" type="text" placeholder="'http://feeds.bbci.co.uk/news/world/rss.xml#'"> <input id="rss_urls" type="text" placeholder="http://feeds.bbci.co.uk/news/world/rss.xml#">
</div> </div>
<div class="field"> <div class="field">
@ -477,12 +482,12 @@
}); });
function generate() { function generate() {
var ical_urls = $("#ical_urls").val().trim(); var ical_urls = $("#ical_urls").val().trim().split(' ').join('').split(',');
if (ical_urls == "") { if (ical_urls == "") {
ical_urls = $("#ical_urls").attr("placeholder"); ical_urls = $("#ical_urls").attr("placeholder");
} }
var rss_urls = $("#rss_urls").val().trim(); var rss_urls = $("#rss_urls").val().trim().split(' ').join('').split(',');
if (rss_urls == "") { if (rss_urls == "") {
rss_urls = $("#rss_urls").attr("placeholder"); rss_urls = $("#rss_urls").attr("placeholder");
} }
@ -525,6 +530,9 @@
} }
var model = "epd_7_in_5_v2_colour"; var model = "epd_7_in_5_v2_colour";
if ($('#9_in_7').is(':checked')) {
model = "9_in_7";
}
if ($('#epd_7_in_5_v2').is(':checked')) { if ($('#epd_7_in_5_v2').is(':checked')) {
model = "epd_7_in_5_v2"; model = "epd_7_in_5_v2";
} }
@ -697,7 +705,7 @@
image_path_body image_path_body
) { ) {
var result = { var result = {
"language": language, // "en", "de", "fr", "jp" etc. "language": language, // "en", "de", "fr", "jp" etc.
"units": units, // "metric", "imperial" "units": units, // "metric", "imperial"
"hours": Number(hours), // 24, 12 "hours": Number(hours), // 24, 12
"model": model, "model": model,
@ -735,7 +743,7 @@
"height" : middle_section_height, "height" : middle_section_height,
"config": { "config": {
"week_starts_on": week_starts_on, //"Sunday", "Monday"... "week_starts_on": week_starts_on, //"Sunday", "Monday"...
"ical_urls": ical_urls.split().map(function (x) { return TrimSingleQuotes(x); }) "ical_urls": ical_urls
} }
} }
) )
@ -765,7 +773,7 @@
"type": bottom_section, "type": bottom_section,
"height" : bottom_section_height, "height" : bottom_section_height,
"config": { "config": {
"rss_urls": rss_urls.split().map(function (x) { return TrimSingleQuotes(x); }) "rss_urls": rss_urls
} }
} }
) )