114 lines
4.6 KiB
Text
114 lines
4.6 KiB
Text
<%#
|
|
# @file
|
|
# Main application file. Holds scaffolding present on every page.
|
|
# Then a certain non-partial view (no _ preceding filename) will be
|
|
# displayed within, based on URL
|
|
#%>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title><%=h yield(:title) %></title>
|
|
<%= csrf_meta_tags %>
|
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
|
|
|
<%= stylesheet_link_tag "application", :media => "all" %>
|
|
<%= javascript_include_tag "application" %>
|
|
<script type="text/javascript" src="//use.typekit.net/tki2nyo.js"></script>
|
|
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
|
|
<script type="text/javascript" src="//use.typekit.net/obp7wss.js"></script>
|
|
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
|
|
|
|
<!-- shims for backwards compatibility -->
|
|
<script type="text/javascript" src="http://code.famo.us/lib/functionPrototypeBind.js"></script>
|
|
<script type="text/javascript" src="http://code.famo.us/lib/classList.js"></script>
|
|
<script type="text/javascript" src="http://code.famo.us/lib/requestAnimationFrame.js"></script>
|
|
|
|
<!-- module loader -->
|
|
<script type="text/javascript" src="http://code.famo.us/lib/require.js"></script>
|
|
|
|
<!-- famous -->
|
|
<link rel="stylesheet" type="text/css" href="http://code.famo.us/famous/0.2/famous.css" />
|
|
<script type="text/javascript" src="http://code.famo.us/famous/0.2/famous.min.js"></script>
|
|
|
|
<!-- app code -->
|
|
<script type="text/javascript">
|
|
require.config({baseUrl: '/famous/'});
|
|
require(['main']);
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<% if notice %>
|
|
<p id="toast"><%= notice %></p>
|
|
<% end %>
|
|
|
|
<%= content_tag :div, class: authenticated? ? "main authenticated" : "main unauthenticated" do %>
|
|
|
|
<% classes = action_name == "home" ? "homePage" : ""
|
|
classes += action_name == "home" && authenticated? ? " explorePage" : ""
|
|
classes += controller_name == "maps" && action_name == "index" ? " explorePage" : ""
|
|
classes += controller_name == "maps" && action_name == "show" ? " mapPage" : ""
|
|
%>
|
|
|
|
<div class="wrapper <%= classes %>" id="wrapper">
|
|
|
|
<%= render :partial => 'layouts/upperelements' %>
|
|
|
|
<%= yield %>
|
|
|
|
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
|
|
<% if authenticated? %>
|
|
<% # for creating and pulling in topics and synapses %>
|
|
<%= render :partial => 'maps/newtopic' %>
|
|
<%= render :partial => 'maps/newsynapse' %>
|
|
<% # for populating the change metacode list on the topic card %>
|
|
<%= render :partial => 'shared/metacodeoptions' %>
|
|
<% end %>
|
|
<%= render :partial => 'layouts/lowermapelements' %>
|
|
|
|
<div id="famousOverlay"></div>
|
|
<div id="loading"></div>
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%= render :partial => 'layouts/lightboxes' %>
|
|
<%= render :partial => 'layouts/templates' %>
|
|
|
|
<style type='text/css'>@import url('http://getbarometer.s3.amazonaws.com/assets/barometer/css/barometer.css');</style>
|
|
<script src='http://getbarometer.s3.amazonaws.com/assets/barometer/javascripts/barometer.js'
|
|
type='text/javascript'></script>
|
|
<script type="text/javascript" charset="utf-8">
|
|
BAROMETER.load('Scqak8nyHdFEkezKMNeQp');
|
|
|
|
<% if authenticated? %>
|
|
Metamaps.Active.Mapper = <%= user.to_json.html_safe %>
|
|
<% else %>
|
|
Metamaps.Active.Mapper = null;
|
|
<% end %>
|
|
Metamaps.Metacodes = <%= Metacode.all.to_json.html_safe %>;
|
|
|
|
Metamaps.Loading = {
|
|
loader: new CanvasLoader('loading'),
|
|
hide: function () {
|
|
$('#loading').hide();
|
|
},
|
|
show: function () {
|
|
$('#loading').show();
|
|
}
|
|
};
|
|
Metamaps.Loading.loader.setColor('#4fb5c0'); // default is '#000000'
|
|
Metamaps.Loading.loader.setDiameter(28); // default is 40
|
|
Metamaps.Loading.loader.setDensity(41); // default is 40
|
|
Metamaps.Loading.loader.setRange(0.9); // default is 1.3
|
|
Metamaps.Loading.loader.show(); // Hidden by default
|
|
|
|
// embedly
|
|
!function(a){var b="embedly-platform",c="script";if(!a.getElementById(b)){var d=a.createElement(c);d.id=b,d.src=("https:"===document.location.protocol?"https":"http")+"://cdn.embedly.com/widgets/platform.js";var e=document.getElementsByTagName(c)[0];e.parentNode.insertBefore(d,e)}}(document);
|
|
</script>
|
|
|
|
<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %>
|
|
</body>
|
|
</html>
|