re-enabled my work so far on realtime for Fabio

This commit is contained in:
Connor Turland 2013-01-23 13:55:50 -05:00
parent 02ac167444
commit 1727d95c4c

View file

@ -1,38 +1,11 @@
<%#
# @file
# Code to display a map
# TODO: Where is this accessible from?
# Top card is currently hidden to just show beautiful expanses of unadultered
# mappy goodness.
# /maps/:id
#%>
<!--<div class="focus">
<div class="focusleft">
<p># of Topics: <%= @map.topics.count %></p>
<p># of Synapses: <%= @map.synapses.count %></p>
<% if (@map.permission == "commons" && authenticated?) || @map.user == user %>
<%= form_for @map, :url => savelayout_path(@map), :html => { :class => "saveMapLayout", :id => "saveMapLayout"}, remote: true do |form| %>
<%= form.hidden_field "coordinates", :value => "" %>
<%= form.submit "Save Layout", class: "saveLayout", id: "saveLayout" %>
<% end %>
<% end %>
<button onclick="if (!goRealtime) { this.innerHTML = 'Stop Realtime'; $('#saveLayout').css('display','none');} else if (goRealtime) { this.innerHTML = 'Start Realtime'; $('#saveLayout').css('display','block');} goRealtime = !goRealtime;">Start Realtime</button>
</div>
<div class="focusmiddle">
<h1 class="title"><%= @map.name %> <% if (@map.permission == "commons" && authenticated?) || @map.user == user %><%= link_to "[edit]", edit_map_path(@map) %><% end %></h1>
<div class="desc">
<p><%= @map.desc %></p>
</div>
</div>
<div class="focusright">
<div class="link"><p>Permissions: <%= @map.permission %></p></div>
</div>
</div>
<div class="clearfloat nodemargin"></div>-->
<div class="headertop">
<% if false %>
<button onclick="if (!goRealtime) { this.innerHTML = 'Stop Realtime'; $('#saveLayout').css('display','none');} else if (goRealtime) { this.innerHTML = 'Start Realtime'; $('#saveLayout').css('display','block');} goRealtime = !goRealtime;">Start Realtime</button>
<% end %>
<button onclick="if (!goRealtime) { this.innerHTML = 'Stop Realtime'; $('#saveLayout').css('display','none'); } else if (goRealtime) { this.innerHTML = 'Start Realtime'; $('#saveLayout').css('display','block');} goRealtime = !goRealtime;">Start Realtime</button>
<button onclick="hideSelectedEdges();hideSelectedNodes();">Hide Selected</button>
<% if authenticated? %>
<button onclick="removeSelectedEdges();removeSelectedNodes();">Remove Selected From Map</button>
@ -74,21 +47,19 @@
<%= render :partial => 'maps/new' %>
<% end %>
<% if false %>
<%= form_for @map, :url => realtime_path(@map), :method => "GET", :html => { :id => "MapRealtime"}, remote: true do |form| %>
<%= form_for @map, :url => realtime_path(@map), :method => "GET", :html => { :id => "MapRealtime"}, remote: true do |form| %>
<%= form.hidden_field :time, :value => Time.now.to_i %>
<%= form.hidden_field :ids, :value => 0 %>
<% end %>
<% end %>
<script>
var dragged = 0;
mapid = <%= @map.id %>;
/*var int = setInterval(function(){
var int = setInterval(function(){
if (goRealtime) {
$('#MapRealtime').submit();
}
},4000);*/
},4000);
</script>
<script>