Added option to show time of last display-update
This commit is contained in:
		| @@ -284,6 +284,20 @@ body{ | |||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|  |       <div class="field"> | ||||||
|  |         <label>Show time when the display was last updated?</label> | ||||||
|  |         <div class="ts checkboxes"> | ||||||
|  |           <div class="ts radio checkbox"> | ||||||
|  |             <input id="last_update_false" type="radio" name="lu" checked> | ||||||
|  |             <label for="last_update_false">No</label> | ||||||
|  |           </div> | ||||||
|  |           <div class="ts radio checkbox"> | ||||||
|  |             <input id="last_update_true" type="radio" name="lu"> | ||||||
|  |             <label for="last_update_true">Yes</label> | ||||||
|  |           </div> | ||||||
|  |         </div> | ||||||
|  |       </div> | ||||||
|  |  | ||||||
|     </form> |     </form> | ||||||
|     <br> |     <br> | ||||||
|     <button class="ts primary button" onClick="generate();">Generate</button> |     <button class="ts primary button" onClick="generate();">Generate</button> | ||||||
| @@ -308,7 +322,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||||||
|   <br> |   <br> | ||||||
|    |    | ||||||
|   <script> |   <script> | ||||||
|   var template = 'ical_urls = ["{ical_urls}"]\nrss_feeds = ["{rss_urls}"]\nupdate_interval = "{update_interval}"\napi_key = "{api_key}"\nlocation = "{location}"\nweek_starts_on = "{week_starts_on}"\nevents_max_range = "{events_max_range}"\ncalibration_hours = [{calibration_hours}]\ndisplay_colours = "{display_colours}"\nlanguage = "{language}"\nunits = "{units}"\nhours = "{hours}"\ntop_section = "{top_section}"\nmiddle_section = "{middle_section}"\nbottom_section = "{bottom_section}"'; |   var template = 'ical_urls = ["{ical_urls}"]\nrss_feeds = ["{rss_urls}"]\nupdate_interval = "{update_interval}"\napi_key = "{api_key}"\nlocation = "{location}"\nweek_starts_on = "{week_starts_on}"\nevents_max_range = "{events_max_range}"\ncalibration_hours = [{calibration_hours}]\ndisplay_colours = "{display_colours}"\nlanguage = "{language}"\nunits = "{units}"\nhours = "{hours}"\ntop_section = "{top_section}"\nmiddle_section = "{middle_section}"\nbottom_section = "{bottom_section}"\nshow_last_update_time = "{last_update}"'; | ||||||
|    |    | ||||||
|   function generate(){ |   function generate(){ | ||||||
|     var ical_urls = $("#ical_urls").val().trim(); |     var ical_urls = $("#ical_urls").val().trim(); | ||||||
| @@ -444,9 +458,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||||||
|       bottom_section = ""; |       bottom_section = ""; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     var last_update = "False"; | ||||||
|  |     if ($('#last_update_true').is(':checked')){ | ||||||
|  |       last_update = "True"; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     //console.log(ical_urls, rss_urls, update_interval, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours, top_section, middle_section, bottom_section); |     //console.log(ical_urls, rss_urls, update_interval, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours, top_section, middle_section, bottom_section, last_update); | ||||||
|     createPythonSetting(ical_urls, rss_urls, update_interval, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours, top_section, middle_section, bottom_section); |     createPythonSetting(ical_urls, rss_urls, update_interval, api_key, location, week_starts_on, events_max_range, calibration_hours, display_colours, language, units, hours, top_section, middle_section, bottom_section, last_update); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   function rk(content,key,value){ |   function rk(content,key,value){ | ||||||
| @@ -454,7 +472,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||||||
|     return content.split("{" + key + "}").join(value); |     return content.split("{" + key + "}").join(value); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   function createPythonSetting(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){ |   function createPythonSetting(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){ | ||||||
|     var box = template; |     var box = template; | ||||||
|     box = rk(box,"ical_urls",a); |     box = rk(box,"ical_urls",a); | ||||||
|     box = rk(box,"rss_urls",b); |     box = rk(box,"rss_urls",b); | ||||||
| @@ -471,6 +489,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||||||
|     box = rk(box,"top_section",m); |     box = rk(box,"top_section",m); | ||||||
|     box = rk(box,"middle_section",n); |     box = rk(box,"middle_section",n); | ||||||
|     box = rk(box,"bottom_section",o); |     box = rk(box,"bottom_section",o); | ||||||
|  |     box = rk(box,"last_update",p); | ||||||
|  |  | ||||||
|  |  | ||||||
|     var config = new Blob([box], {type : "text/plain"}); |     var config = new Blob([box], {type : "text/plain"}); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user