thingspeak/app/views/channels/public_show.html.erb
2014-07-30 14:33:08 -04:00

91 lines
1.9 KiB
Plaintext

<%= render :partial => "devinfo" %>
<div class="col-xs-12 col-sm-6">
<ol class="breadcrumb">
<li><%= link_to t(:channels), auth_channels_path %></li>
<li class="active"><%= t(:channel) %> <%= @channel.id %></li>
</ol>
</div>
<%= render :partial=>"socialbuttons" %>
<div id="maincontent">
<ul>
<li><a href="#publicview">Public View</a></li>
</ul>
<div id="publicview">
<%= render :partial => "public_show" %>
</div>
</div>
<script type="text/javascript">
$('#watch').click(function() {
var checked = this.checked;
$.update(
'/channels/<%= @channel.id %>/watch',
{ flag: checked },
function (response) {
if (checked) {
$("#watchText").text("Un-watch");
} else {
$("#watchText").text("Watch");
}
}
);
});
$("#devInfoLink").click(function() {
$("#devInfo").dialog("open") ;
});
$(document).on('page:load ready', function() {
$("#devInfo").dialog({
autoOpen:false,
resizable:false,
width:"500px",
position: {
my: 'top',
at: 'top',
of: $('#maincontent')
},
title: "Developer Info",
dialogClass: "dev-info-dialog"
});
$("#watch").button();
if ($("#watch").attr("checked")) {
$("#watchText").text("Un-watch");
}
else {
$("#watchText").text("Watch");
}
$("#maincontent").tabs( {
select: function( e, ui)
{
$.cookie('stickyTab', ui.index );
}
}
);
stickyTab = $.cookie( 'stickyTab' );
if( ! isNaN( stickyTab ) )
{
$("#maincontent").tabs( 'select', stickyTab );
}
var current_user = "<%= @mychannel %>" ;
var channel_id = <%= @channel.id %>;
$.getJSON('/channels/<%=@channel.id %>/windows.json', createWindows (current_user, channel_id, "public") )
.complete(function() {
setupColumns(current_user, channel_id);
})
});
</script>