thingspeak/app/views/channels/private_show.html.erb

120 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

<%= render :partial => "devinfo" %>
<%= render :partial => "addportlet" %>
2015-02-11 15:16:48 +01:00
<%= render :partial => "breadcrumb" %>
<%= render :partial => "socialbuttons" %>
2014-08-05 20:44:39 +02:00
<div id="maincontent_nowidth" class="col-xs-12 col-sm-12">
<ul>
<li><a href="#privateview"><%= t("private_view") %></a></li>
<li><a href="#publicview"><%= t("public_view") %></a></li>
<li><a href="#channelsettings"><%= t("channel_settings") %></a></li>
<li><a href="#apikeys"><%= t("api_keys") %></a></li>
<li><a href="#dataimport"><%= t("data_import") %></a></li>
</ul>
<div id="privateview">
<%= render :partial => "private_show" %>
</div>
<div id="publicview">
<%= render :partial => "public_show" %>
</div>
<div id="channelsettings">
<%= render :partial => "edit" %>
</div>
<div id="apikeys">
<%= render :partial => "api_keys/index" %>
</div>
<div id="dataimport">
<%= render :partial => "import" %>
</div>
</div>
<script type="text/javascript">
2014-07-30 20:33:08 +02:00
$('#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");
}
}
);
});
$(document).on('page:load ready', function() {
$(".timeago").timeago();
if(document.location.hash!='') {
$('html').animate({scrollTop:0}, 'normal');//IE, FF
$('body').animate({scrollTop:0}, 'normal');//chrome, don't know if safari works
}
$('.fade').fadeIn('normal').fadeOut(3500, function() {
$(this).remove();
});
$("#devInfo").dialog({
autoOpen:false,
resizable:false,
width:"500px",
title: "<%= t('developer_info') %>",
dialogClass: "dev-info-dialog"
});
$("#addPortlets").dialog({
modal:true,
autoOpen:false,
resizable:false,
width:"500px",
dialogClass: "dev-info-dialog"
});
$("#watch").button();
if ($("#watch").attr("checked")) {
$("#watchText").text("Un-watch");
}
else {
$("#watchText").text("Watch");
}
2014-08-05 20:44:39 +02:00
$("#maincontent_nowidth").tabs({
select: function( e, ui) {
$.cookie('stickyTab', ui.index );
},
activate: function( event, ui ) {
reloadCharts();
}
});
stickyTab = $.cookie( 'stickyTab' );
anchor = window.location.hash;
if (anchor.length > 0) {
stickyTab = anchor.substring(anchor.length - 1);
}
if( ! isNaN( stickyTab ) )
{
2014-08-05 20:44:39 +02:00
$("#maincontent_nowidth").tabs( 'select', stickyTab );
}
var current_user = "<%= @mychannel %>";
var channel_id = <%= @channel.id %>;
setupColumns(current_user, channel_id);
$.getJSON('/channels/<%=@channel.id %>/private_windows.json', function(data) {
createWindowsWithData (data, current_user, channel_id, "private");
$.getJSON('/channels/<%=@channel.id %>/windows.json',
createWindows (current_user, channel_id, "public")
);
});
});
</script>