2012-10-09 03:18:00 +00:00
|
|
|
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
|
|
// listed below.
|
|
|
|
//
|
|
|
|
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
|
|
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
|
|
//
|
|
|
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
|
|
// the compiled file.
|
|
|
|
//
|
|
|
|
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
|
|
|
// GO AFTER THE REQUIRES BELOW.
|
|
|
|
//
|
|
|
|
//= require jquery
|
|
|
|
//= require jquery_ujs
|
|
|
|
//= require_tree .
|
|
|
|
//= require Jit/jit-yc
|
|
|
|
//= require Jit/excanvas
|
2012-10-21 19:57:48 +00:00
|
|
|
//= require Jit/ForceDirected/metamapFD
|
|
|
|
//= require Jit/RGraph/metamapRG
|
2012-10-22 01:10:43 +00:00
|
|
|
//= require Jit/filters
|
2012-10-31 22:53:11 +00:00
|
|
|
//= require scroll/jquery-ui-1.8.23.custom.min
|
|
|
|
//= require scroll/jquery.mousewheel.min
|
|
|
|
//= require scroll/jquery.mCustomScrollbar.min
|
2012-10-22 01:10:43 +00:00
|
|
|
|
2012-10-09 03:18:00 +00:00
|
|
|
$(document).ready(function() {
|
2012-10-31 22:53:11 +00:00
|
|
|
|
|
|
|
$(".focus .desc").mCustomScrollbar();
|
|
|
|
$(".scroll").mCustomScrollbar();
|
|
|
|
|
2012-10-09 03:18:00 +00:00
|
|
|
$('.nodemargin').css('padding-top',$('.focus').css('height'));
|
2012-10-21 17:19:59 +00:00
|
|
|
|
2012-10-24 06:47:08 +00:00
|
|
|
|
|
|
|
// if there's an add topic directly to page form loaded on the page you're on then let the user add one
|
2012-10-21 17:19:59 +00:00
|
|
|
$('#newtopic').click(function(event){
|
2012-10-24 06:47:08 +00:00
|
|
|
obj1 = document.getElementById('new_item');
|
|
|
|
if (obj1 != null) {
|
|
|
|
$('#new_synapse').css('display','none');
|
2012-10-21 17:19:59 +00:00
|
|
|
$('#new_item').fadeIn('fast');
|
2012-10-21 18:32:17 +00:00
|
|
|
event.preventDefault();
|
2012-10-21 17:19:59 +00:00
|
|
|
}
|
|
|
|
});
|
2012-10-21 18:32:17 +00:00
|
|
|
|
2012-10-24 06:47:08 +00:00
|
|
|
// if there's an add synapse directly to page form loaded on the page you're on then let the user add one
|
|
|
|
$('#newsynapse').click(function(event){
|
|
|
|
obj2 = document.getElementById('new_synapse');
|
|
|
|
if (obj2 != null) {
|
|
|
|
$('#new_item').css('display','none');
|
|
|
|
$('#new_synapse').fadeIn('fast');
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-10-28 18:37:46 +00:00
|
|
|
|
|
|
|
// controls the sliding hover of the filters
|
|
|
|
var sliding1 = false;
|
|
|
|
$(".accountWrap").hover(
|
|
|
|
function () {
|
|
|
|
if (! sliding1) {
|
|
|
|
sliding1 = true;
|
|
|
|
$(".account").slideDown('slow', function() {
|
|
|
|
sliding1 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function () {
|
|
|
|
if (! sliding1) {
|
|
|
|
sliding1 = true;
|
|
|
|
$(".account").slideUp('slow', function() {
|
|
|
|
sliding1 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
var sliding2 = false;
|
|
|
|
$(".createWrap").hover(
|
|
|
|
function () {
|
|
|
|
if (! sliding2) {
|
|
|
|
sliding2 = true;
|
|
|
|
$(".create").slideDown('slow', function() {
|
|
|
|
sliding2 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function () {
|
|
|
|
if (! sliding2) {
|
|
|
|
sliding2 = true;
|
|
|
|
$(".create").slideUp('slow', function() {
|
|
|
|
sliding2 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
var sliding3 = false;
|
|
|
|
$(".exploreWrap").hover(
|
|
|
|
function () {
|
|
|
|
if (! sliding3) {
|
|
|
|
sliding3 = true;
|
|
|
|
$(".explore").slideDown('slow', function() {
|
|
|
|
sliding3 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function () {
|
|
|
|
if (! sliding3) {
|
|
|
|
sliding3 = true;
|
|
|
|
$(".explore").slideUp('slow', function() {
|
|
|
|
sliding3 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
var sliding4 = false;
|
2012-10-22 01:10:43 +00:00
|
|
|
$(".legend").hover(
|
|
|
|
function () {
|
2012-10-28 18:37:46 +00:00
|
|
|
if (! sliding4) {
|
|
|
|
sliding4 = true;
|
2012-10-22 01:10:43 +00:00
|
|
|
$("#iconLegend ul").slideDown('slow', function() {
|
2012-10-28 18:37:46 +00:00
|
|
|
sliding4 = false;
|
2012-10-22 01:10:43 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function () {
|
2012-10-28 18:37:46 +00:00
|
|
|
if (! sliding4) {
|
|
|
|
sliding4 = true;
|
2012-10-22 01:10:43 +00:00
|
|
|
$("#iconLegend ul").slideUp('slow', function() {
|
2012-10-28 18:37:46 +00:00
|
|
|
sliding4 = false;
|
2012-10-22 01:10:43 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2012-10-23 14:46:06 +00:00
|
|
|
// toggle visibility of item categories based on status in the filters list
|
2012-10-22 01:10:43 +00:00
|
|
|
$('.legend ul li').click(function(event) {
|
|
|
|
obj = document.getElementById('container');
|
|
|
|
|
|
|
|
var category = $(this).children('img').attr('alt');
|
|
|
|
|
|
|
|
// this means that we are on a map view
|
|
|
|
if (obj != null) {
|
|
|
|
if (fd != null) {
|
|
|
|
switchVisible(fd, category);
|
|
|
|
}
|
|
|
|
else if (rg != null) {
|
|
|
|
switchVisible(rg, category);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// this means that we are on a card view
|
|
|
|
else {
|
|
|
|
console.log('test');
|
2012-10-22 01:25:26 +00:00
|
|
|
if (categoryVisible[category] == true) {
|
2012-10-23 14:46:06 +00:00
|
|
|
if (category.split(' ').length == 1) {
|
|
|
|
$('#cards .' + category).fadeOut('slow');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#cards .' + category.split(' ')[0]).fadeOut('slow');
|
|
|
|
}
|
2012-10-22 01:10:43 +00:00
|
|
|
}
|
2012-10-22 01:25:26 +00:00
|
|
|
else if (categoryVisible[category] == false) {
|
2012-10-23 14:46:06 +00:00
|
|
|
if (category.split(' ').length == 1) {
|
|
|
|
$('#cards .' + category).fadeIn('slow');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#cards .' + category.split(' ')[0]).fadeIn('slow');
|
|
|
|
}
|
2012-10-22 01:10:43 +00:00
|
|
|
}
|
2012-10-22 01:25:26 +00:00
|
|
|
}
|
|
|
|
// toggle the image and the boolean array value
|
|
|
|
if (categoryVisible[category] == true) {
|
|
|
|
$(this).addClass('toggledOff');
|
|
|
|
categoryVisible[category] = false;
|
|
|
|
}
|
|
|
|
else if (categoryVisible[category] == false) {
|
|
|
|
$(this).removeClass('toggledOff');
|
|
|
|
categoryVisible[category] = true;
|
|
|
|
}
|
2012-10-22 01:10:43 +00:00
|
|
|
});
|
|
|
|
});
|
2012-10-18 00:51:54 +00:00
|
|
|
|
|
|
|
|