From e73da0fc62fb9b1e0344354147bc850d64acd4ec Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 17 Apr 2019 23:41:08 +0200 Subject: [PATCH] Bugfix+minor improvements --- Calendar/Settings-Web-UI.html | 522 +++++++++++++++++----------------- 1 file changed, 261 insertions(+), 261 deletions(-) diff --git a/Calendar/Settings-Web-UI.html b/Calendar/Settings-Web-UI.html index 572b61a..816ba47 100644 --- a/Calendar/Settings-Web-UI.html +++ b/Calendar/Settings-Web-UI.html @@ -9,298 +9,298 @@

-
-
-
- Setting Generator -
For Inky-Calendar Project of Ace-Innovation Laboratory (by aceisace)
- -
-
- If no value is filled in for any of the row, the default value will be used. -
- -
-
-
-
- - -
+
+
+
+ Setting Generator +
For Inky-Calendar Project of Ace-Innovation Laboratory (by aceisace)
+ +
+
+ If no value is filled in for any of the row, the default value will be used. +
+ +
+
+ +
+ + +
- - -
+ + +
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
-
- -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+
-
- - -
-
- - -
- -
- -
-
- - -
-
- - -
-
-
+
+ + +
+
+ + +
+ +
+ +
+
+ + +
+
+ + +
+
+
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+
-
- -
-
- - -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
-
- -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+
-
- -
-
- - -
-
- - -
-
-
+
+ +
+
+ + +
+
+ + +
+
+
-
-
- -

- Developed by Toby Chui for Inky-Calendar Project, modified by aceisace Licensed under MIT -
- - MIT License - -
-

Copyright 2019 Toby Chui
+ +
+ +

+ Developed by Toby Chui for Inky-Calendar Project, modified by aceisace Licensed under MIT +

+ + MIT License + +
+

Copyright 2019 Toby Chui
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-
-
-
-
-
- - + var hours = "24"; + if ($('#12_hours').is(':checked')){ + hours = "12"; + } + //console.log(ical_urls, rss_urls,update_interval, additional_feature, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours); + createPythonSetting(ical_urls, rss_urls,update_interval, additional_feature, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours); + } + + function rk(content,key,value){ + //Use to replace key-value pair in template string + return content.split("{" + key + "}").join(value); + } + + function createPythonSetting(a,b,c,d,e,f,g,h,i,j,k,l,m){ + var box = template; + box = rk(box,"ical_urls",a); + box = rk(box,"rss_urls",b); + box = rk(box,"update_interval",c); + box = rk(box,"additional_feature",d); + box = rk(box,"api_key",e); + box = rk(box,"location",f); + box = rk(box,"week_starts_on",g); + box = rk(box,"events_max_range",h); + box = rk(box,"calibration_hours",i); + box = rk(box,"display_colours",j); + box = rk(box,"language",k); + box = rk(box,"units",l); + box = rk(box,"hours",m); + var config = new Blob([box], {type : "text/plain"}); + var link = document.createElement('link'); + link.href = window.URL.createObjectURL(config); + var a = document.createElement('A'); + a.href = link.href; + a.download = link.href.substr(link.href.lastIndexOf('/') + 1); + document.body.appendChild(a); + $(a).attr('download','settings.py'); + a.click(); + document.body.removeChild(a); + } + + +