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
|
2012-12-14 07:16:17 +00:00
|
|
|
//= require jquery-ui
|
2012-12-31 03:56:05 +00:00
|
|
|
//= require jquery.purr
|
|
|
|
//= require best_in_place
|
2012-12-14 07:16:17 +00:00
|
|
|
//= require autocomplete-rails-uncompressed
|
2012-10-09 03:18:00 +00:00
|
|
|
//= require jquery_ujs
|
|
|
|
//= require_tree .
|
2012-11-23 16:56:22 +00:00
|
|
|
|
2012-12-15 07:39:14 +00:00
|
|
|
// other options are 'graph'
|
|
|
|
var viewMode = "list";
|
2012-10-22 01:10:43 +00:00
|
|
|
|
2013-01-05 02:39:16 +00:00
|
|
|
var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false, findOpen = false, analyzeOpen = false, organizeOpen = false, goRealtime = false, mapid = null;
|
2012-12-21 04:45:44 +00:00
|
|
|
|
2012-10-09 03:18:00 +00:00
|
|
|
$(document).ready(function() {
|
2012-12-16 20:00:43 +00:00
|
|
|
|
2013-01-01 22:45:35 +00:00
|
|
|
$('#new_topic, #new_synapse').bind('contextmenu', function(e){
|
2012-12-21 00:24:27 +00:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2012-12-25 23:29:20 +00:00
|
|
|
/// this is for the topic creation autocomplete field
|
2013-01-01 22:45:35 +00:00
|
|
|
$('#topic_name').bind('railsAutocomplete.select', function(event, data){
|
2012-12-16 20:00:43 +00:00
|
|
|
if (data.item.id != undefined) {
|
2013-01-01 22:45:35 +00:00
|
|
|
$('#topic_grabTopic').val(data.item.id);
|
2013-01-05 21:21:11 +00:00
|
|
|
$('.new_topic').submit();
|
2012-12-14 07:16:17 +00:00
|
|
|
}
|
|
|
|
});
|
2012-12-16 20:00:43 +00:00
|
|
|
|
2012-12-27 04:00:05 +00:00
|
|
|
$('.new_topic').bind('submit', function(event, data){
|
|
|
|
event.preventDefault();
|
|
|
|
});
|
|
|
|
|
2012-10-31 22:53:11 +00:00
|
|
|
$(".focus .desc").mCustomScrollbar();
|
|
|
|
$(".scroll").mCustomScrollbar();
|
|
|
|
|
2012-12-16 06:12:41 +00:00
|
|
|
$('.nodemargin').css('padding-top',$('.focus').css('height'));
|
2012-10-28 18:37:46 +00:00
|
|
|
|
2012-12-16 20:00:43 +00:00
|
|
|
// controls the sliding hover of the menus at the top
|
2012-12-25 23:29:20 +00:00
|
|
|
var sliding1 = false;
|
|
|
|
var lT;
|
|
|
|
$(".logo").hover(
|
2012-10-28 18:37:46 +00:00
|
|
|
function () {
|
2012-12-25 23:29:20 +00:00
|
|
|
clearTimeout(lT);
|
2012-10-28 18:37:46 +00:00
|
|
|
if (! sliding1) {
|
|
|
|
sliding1 = true;
|
2012-12-25 23:29:20 +00:00
|
|
|
if (userid != null) {
|
|
|
|
$('.footer .menu').animate({
|
2012-12-26 03:47:02 +00:00
|
|
|
height: '252px'
|
2012-12-25 23:29:20 +00:00
|
|
|
}, 300, function() {
|
|
|
|
sliding1 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('.footer .menu').animate({
|
2012-12-27 01:57:06 +00:00
|
|
|
height: '140px'
|
2012-12-25 23:29:20 +00:00
|
|
|
}, 300, function() {
|
|
|
|
sliding1 = false;
|
|
|
|
});
|
|
|
|
}
|
2012-10-28 18:37:46 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
function () {
|
2012-12-25 23:29:20 +00:00
|
|
|
lT = setTimeout(function() {
|
|
|
|
if (! sliding1) {
|
|
|
|
sliding1 = true;
|
|
|
|
$('.footer .menu').animate({
|
|
|
|
height: '0px'
|
|
|
|
}, 300, function() {
|
|
|
|
sliding1 = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},800);
|
2012-10-28 18:37:46 +00:00
|
|
|
}
|
|
|
|
);
|
2012-12-03 23:40:14 +00:00
|
|
|
|
2012-12-25 23:29:20 +00:00
|
|
|
// this is to save the layout of maps when you're on a map page
|
2012-12-03 23:40:14 +00:00
|
|
|
$("#saveLayout").click(function(event) {
|
|
|
|
event.preventDefault();
|
2013-01-04 21:51:37 +00:00
|
|
|
saveLayoutAll();
|
2012-12-03 23:40:14 +00:00
|
|
|
});
|
2012-12-25 23:29:20 +00:00
|
|
|
|
2012-10-22 01:10:43 +00:00
|
|
|
});
|
2012-12-25 23:29:20 +00:00
|
|
|
|
2013-01-04 21:51:37 +00:00
|
|
|
// this is to save the layout of a map
|
|
|
|
function saveLayoutAll() {
|
|
|
|
var coor = "";
|
|
|
|
if (gType == "arranged" || gType == "chaotic") {
|
|
|
|
Mconsole.graph.eachNode(function(n) {
|
|
|
|
coor = coor + n.data.$mappingid + '/' + n.pos.x + '/' + n.pos.y + ',';
|
|
|
|
});
|
|
|
|
coor = coor.slice(0, -1);
|
|
|
|
$('#map_coordinates').val(coor);
|
|
|
|
$('#saveMapLayout').submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// this is to update the location coordinate of a single node on a map
|
|
|
|
function saveLayout(id) {
|
|
|
|
var n = Mconsole.graph.getNode(id);
|
|
|
|
$('#map_coordinates').val(n.data.$mappingid + '/' + n.pos.x + '/' + n.pos.y);
|
|
|
|
$('#saveMapLayout').submit();
|
|
|
|
dragged = 0;
|
|
|
|
}
|
|
|
|
|
2012-12-25 23:29:20 +00:00
|
|
|
// this is to save your console to a map
|
|
|
|
function saveToMap() {
|
|
|
|
var Coor = "";
|
|
|
|
Mconsole.graph.eachNode(function(n) {
|
|
|
|
Coor = Coor + n.id + '/' + n.pos.x + '/' + n.pos.y + ',';
|
|
|
|
});
|
|
|
|
Coor = Coor.slice(0, -1);
|
|
|
|
$('#map_topicsToMap').val(Coor);
|
|
|
|
$('#new_map').fadeIn('fast');
|
|
|
|
}
|
|
|
|
|
2013-01-05 02:39:16 +00:00
|
|
|
|
|
|
|
// this is for hiding one topic from your canvas
|
|
|
|
function removeFromCanvas(topic_id) {
|
|
|
|
var node = Mconsole.graph.getNode(topic_id);
|
|
|
|
node.setData('alpha', 0, 'end');
|
|
|
|
node.eachAdjacency(function(adj) {
|
|
|
|
adj.setData('alpha', 0, 'end');
|
|
|
|
});
|
|
|
|
Mconsole.fx.animate({
|
|
|
|
modes: ['node-property:alpha',
|
|
|
|
'edge-property:alpha'],
|
|
|
|
duration: 1000
|
|
|
|
});
|
|
|
|
Mconsole.graph.removeNode(topic_id);
|
|
|
|
Mconsole.labels.disposeLabel(topic_id);
|
|
|
|
}
|
|
|
|
|
2012-12-25 23:29:20 +00:00
|
|
|
function addMetacode() {
|
|
|
|
// code from http://www.professorcloud.com/mainsite/carousel-integration.htm
|
2013-01-03 23:21:46 +00:00
|
|
|
//mouseWheel:true,
|
2012-12-25 23:29:20 +00:00
|
|
|
if (!metacodeIMGinit) {
|
2013-01-03 23:21:46 +00:00
|
|
|
$("#metacodeImg").CloudCarousel( {
|
2012-12-25 23:29:20 +00:00
|
|
|
titleBox: $('#metacodeImgTitle'),
|
|
|
|
yRadius:40,
|
|
|
|
xPos: 150,
|
|
|
|
yPos: 40,
|
2013-01-05 19:07:46 +00:00
|
|
|
speed:0.15,
|
|
|
|
mouseWheel:true,
|
2012-12-25 23:29:20 +00:00
|
|
|
bringToFront: true
|
|
|
|
});
|
|
|
|
metacodeIMGinit = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-10-18 00:51:54 +00:00
|
|
|
|
|
|
|
|