filterbox progress
This commit is contained in:
parent
e08c702494
commit
2b267ea0c6
10 changed files with 5761 additions and 136 deletions
BIN
app/assets/images/icons/synapsevisualize.png
Normal file
BIN
app/assets/images/icons/synapsevisualize.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 909 B |
|
@ -14,7 +14,7 @@
|
|||
});
|
||||
Metamaps.Router = new Router();
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
/*Backbone.history.start({
|
||||
pushState: true,
|
||||
root: ''
|
||||
});
|
||||
|
@ -30,6 +30,6 @@
|
|||
evt.preventDefault();
|
||||
Backbone.history.navigate(href.attr, true);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
})();
|
35
app/assets/javascripts/metamaps/Metamaps.Router.js~
Normal file
35
app/assets/javascripts/metamaps/Metamaps.Router.js~
Normal file
|
@ -0,0 +1,35 @@
|
|||
(function () {
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
"": "home", // #home
|
||||
"explore/:section": "explore", // #explore/active
|
||||
"maps/:id": "maps" // #maps/7
|
||||
},
|
||||
explore: function (section) {
|
||||
console.log(section);
|
||||
},
|
||||
maps: function (id) {
|
||||
console.log(id);
|
||||
}
|
||||
});
|
||||
Metamaps.Router = new Router();
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
pushState: true,
|
||||
root: ''
|
||||
});
|
||||
console.log('router started');
|
||||
$(document).on("click", "a:not([data-bypass])", function (evt) {
|
||||
var href = {
|
||||
prop: $(this).prop("href"),
|
||||
attr: $(this).attr("href")
|
||||
};
|
||||
var root = location.protocol + "//" + location.host + Backbone.history.options.root;
|
||||
|
||||
if (href.prop && href.prop.slice(0, root.length) === root) {
|
||||
evt.preventDefault();
|
||||
Backbone.history.navigate(href.attr, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
2713
app/assets/javascripts/metamaps/Metamaps.js
Normal file
2713
app/assets/javascripts/metamaps/Metamaps.js
Normal file
File diff suppressed because it is too large
Load diff
2711
app/assets/javascripts/metamaps/Metamaps.js~
Normal file
2711
app/assets/javascripts/metamaps/Metamaps.js~
Normal file
File diff suppressed because it is too large
Load diff
|
@ -38,9 +38,7 @@
|
|||
<div class="sidebarFilter <%= authenticated? ? 'loggedin' : 'loggedout' %>">
|
||||
<div class="sidebarFilterIcon"></div>
|
||||
<div class="sidebarFilterBox">
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'shared/filterbymetacode' %>
|
||||
<%= render :partial => 'shared/filterBox' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
82
app/views/maps/show.html.erb~
Normal file
82
app/views/maps/show.html.erb~
Normal file
|
@ -0,0 +1,82 @@
|
|||
<%#
|
||||
# @file
|
||||
# Code to display a map
|
||||
# /maps/:id
|
||||
#%>
|
||||
|
||||
<% content_for :title, @map.name + " | Metamaps" %>
|
||||
|
||||
<div id="preloaded-images">
|
||||
<img src="/assets/MMCCicon_realtime_blue.png" />
|
||||
</div>
|
||||
|
||||
|
||||
<% if authenticated? %>
|
||||
<div class="sidebarFork">
|
||||
<div class="sidebarForkIcon">
|
||||
</div>
|
||||
<div class="sidebarForkBox"></div>
|
||||
</div>
|
||||
<% if @map.permission == "commons" || @map.user == user %>
|
||||
<div class="sidebarCollaborate">
|
||||
<div class="sidebarCollaborateIcon blue"></div>
|
||||
<div class="sidebarCollaborateBox">
|
||||
<h3 class="realtimeBoxTitle">Realtime: </h3>
|
||||
<span class="realtimeOnOff rtOn">ON</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div class="realtimeMapperList">
|
||||
<ul>
|
||||
<li class="rtMapper littleRtOn rtMapperSelf">
|
||||
<%= user.name %> (me)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="sidebarFilter <%= authenticated? ? 'loggedin' : 'loggedout' %>">
|
||||
<div class="sidebarFilterIcon"></div>
|
||||
<div class="sidebarFilterBox">
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'shared/filterBox' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="index">
|
||||
<div class="openCheatsheet openLightbox" data-open="cheatsheet"></div>
|
||||
<span class="mapInfo"></span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'maps/mapinfobox' %>
|
||||
</div>
|
||||
|
||||
<div class="maps onMap" id="container">
|
||||
<div id="center-container">
|
||||
<div id="infovis"></div>
|
||||
</div>
|
||||
<div class="showcard" id="showcard"></div>
|
||||
</div>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<% if authenticated? %>
|
||||
|
||||
<% # add these if you have edit permissions on the map %>
|
||||
<% if @map.permission == "commons" || @map.user == user %>
|
||||
<% # for creating and pulling in topics and synapses %>
|
||||
<%= render :partial => 'newtopic' %>
|
||||
<%= render :partial => 'newsynapse' %>
|
||||
<% end %>
|
||||
|
||||
<% # for populating the change metacode list on the topic card %>
|
||||
<%= render :partial => 'shared/metacodeoptions' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<script>
|
||||
Metamaps.Active.Map = <%= @map.to_json.html_safe %>;
|
||||
Metamaps.Metacodes = <%= @allmetacodes.to_json.html_safe %>;
|
||||
Metamaps.Topics = <%= @alltopics.to_json.html_safe %>;
|
||||
Metamaps.Synapses = <%= @allsynapses.to_json.html_safe %>;
|
||||
Metamaps.Mappings = <%= @allmappings.to_json.html_safe %>;
|
||||
</script>
|
44
app/views/shared/_filterBox.html.erb
Normal file
44
app/views/shared/_filterBox.html.erb
Normal file
|
@ -0,0 +1,44 @@
|
|||
<%#
|
||||
# @file
|
||||
# this code generates the list of icons in the filter by metacode box in the upper right menu area
|
||||
#%>
|
||||
|
||||
<%
|
||||
@mappers = []
|
||||
@synapses = []
|
||||
@metacodes = []
|
||||
@metacodelist = ''
|
||||
@mapperlist = ''
|
||||
@synapselist = ''
|
||||
@map.topics.each_with_index do |topic, index|
|
||||
if @metacodes.index(topic.metacode_id) == nil
|
||||
@metacodes.push(topic.metacode_id)
|
||||
@metacodelist += '<li><img src="' + topic.metacode.icon + '" alt="' + topic.metacode.id.to_s + '" /><p>' + topic.metacode.name.downcase + '</p></li>'
|
||||
end
|
||||
end
|
||||
|
||||
@map.synapses.each_with_index do |synapses, index|
|
||||
if @synapses.index(synapses.synapse_id) == nil
|
||||
@synapses.push(synapses.synapse_id)
|
||||
@synapselist += '<li><img src="/assets/images/icons/synapsevisualize.png" alt="' + synapse.id.to_s + '" /><p>' + synapse.name.downcase + '</p></li>'
|
||||
end
|
||||
|
||||
end
|
||||
%>
|
||||
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div id="filter_by_metacode">
|
||||
<ul>
|
||||
<%= @metacodelist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<div id="filter_by_synapse">
|
||||
<ul>
|
||||
<%= @synapselist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
42
app/views/shared/_filterBox.html.erb~
Normal file
42
app/views/shared/_filterBox.html.erb~
Normal file
|
@ -0,0 +1,42 @@
|
|||
<%#
|
||||
# @file
|
||||
# this code generates the list of icons in the filter by metacode box in the upper right menu area
|
||||
#%>
|
||||
|
||||
<%
|
||||
@mappers = []
|
||||
@synapses = []
|
||||
@metacodes = []
|
||||
@metacodelist = ''
|
||||
@mapperlist = ''
|
||||
@synapselist = ''
|
||||
@map.topics.each_with_index do |topic, index|
|
||||
if @metacodes.index(topic.metacode_id) == nil
|
||||
@metacodes.push(topic.metacode_id)
|
||||
@metacodelist += '<li><img src="' + topic.metacode.icon + '" alt="' + topic.metacode.id.to_s + '" /><p>' + topic.metacode.name.downcase + '</p></li>'
|
||||
end
|
||||
end
|
||||
|
||||
@map.synapses.each_with_index do |synapses, index|
|
||||
if @synapses.index(synapses.synapse_id) == nil
|
||||
@synapses.push(synapses.synapse_id)
|
||||
@synapselist += '<li><img src="/assets/images/icons/synapsevisualize.png" alt="' + synapse.id.to_s + '" /><p>' + synapse.name.downcase + '</p></li>'
|
||||
end
|
||||
|
||||
end
|
||||
%>
|
||||
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div id="filter_by_metacode">
|
||||
<ul>
|
||||
<%= @metacodelist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<div id="filter_by_synapse">
|
||||
<ul>
|
||||
<%= @synapselist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
</div>
|
Loading…
Reference in a new issue