mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 15:50:13 +01:00
parent
f39108d2e7
commit
66e9c42033
2 changed files with 23 additions and 3 deletions
|
|
@ -2,9 +2,6 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<% if @prefs.refresh != 0 -%>
|
||||
<meta http-equiv="Refresh" content="<%= @prefs["refresh"].to_i*60 %>;url=<%= request.request_uri %>">
|
||||
<% end -%>
|
||||
<% bundle :name => "tracks_css" do %>
|
||||
<%= stylesheet_link_tag *%w[ standard superfish niftyCorners jquery-ui jquery.autocomplete] %>
|
||||
<% end %>
|
||||
|
|
@ -34,6 +31,9 @@
|
|||
var tagNames = <%= tag_names_for_autocomplete %>;
|
||||
var dateFormat = '<%= date_format_for_date_picker %>';
|
||||
<% end -%>
|
||||
<% if @prefs.refresh != 0 -%>
|
||||
setup_auto_refresh(<%= @prefs["refresh"].to_i*60000 %>);
|
||||
<% end -%>
|
||||
</script>
|
||||
<link rel="shortcut icon" href="<%= url_for(:controller => 'favicon.ico') %>" />
|
||||
<%= auto_discovery_link_tag(:rss, {:controller => "todos", :action => "index", :format => 'rss', :token => "#{current_user.token}"}, {:title => "RSS feed of next actions"}) %>
|
||||
|
|
|
|||
|
|
@ -222,6 +222,26 @@ function enable_rich_interaction(){
|
|||
drop: drop_todo,
|
||||
hoverClass: 'hover'
|
||||
});
|
||||
|
||||
/* Reset auto updater */
|
||||
field_touched = false;
|
||||
}
|
||||
|
||||
/* Auto-refresh */
|
||||
|
||||
function setup_auto_refresh(interval){
|
||||
field_touched = false;
|
||||
function refresh_page() {
|
||||
if(!field_touched){
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
setTimeout(refresh_page, interval);
|
||||
$(function(){
|
||||
$("input").live('keydown', function(){
|
||||
field_touched = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue