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
|
|
|
|
2012-12-25 23:29:20 +00:00
|
|
|
var labelType, useGradients, nativeTextSupport, animate, json, Mconsole = null, gType, tempNode = null, tempInit = false, tempNode2 = null, metacodeIMGinit = false;
|
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
|
|
|
|
2012-12-21 04:45:44 +00:00
|
|
|
$('#new_item, #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
|
2012-12-16 20:00:43 +00:00
|
|
|
$('#item_name').bind('railsAutocomplete.select', function(event, data){
|
|
|
|
if (data.item.id != undefined) {
|
|
|
|
$('#item_grabItem').val(data.item.id);
|
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
|
|
|
var coor = "";
|
|
|
|
$("#saveLayout").click(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
coor = "";
|
2012-12-14 18:31:39 +00:00
|
|
|
if (gType == "arranged" || gType == "chaotic") {
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.graph.eachNode(function(n) {
|
2012-12-03 23:40:14 +00:00
|
|
|
coor = coor + n.data.$mappingid + '/' + n.pos.x + '/' + n.pos.y + ',';
|
|
|
|
});
|
2012-12-14 18:31:39 +00:00
|
|
|
coor = coor.slice(0, -1);
|
|
|
|
$('#map_coordinates').val(coor);
|
|
|
|
$('#saveMapLayout').submit();
|
2012-12-15 07:39:14 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
// 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');
|
|
|
|
}
|
|
|
|
|
|
|
|
function addMetacode() {
|
|
|
|
// code from http://www.professorcloud.com/mainsite/carousel-integration.htm
|
|
|
|
if (!metacodeIMGinit) {
|
|
|
|
$("#metacodeImg").CloudCarousel( {
|
|
|
|
//reflHeight: 10,
|
|
|
|
//reflGap: 2,
|
|
|
|
titleBox: $('#metacodeImgTitle'),
|
|
|
|
//buttonLeft: $('#left-but'),
|
|
|
|
//buttonRight: $('#right-but'),
|
|
|
|
yRadius:40,
|
|
|
|
xPos: 150,
|
|
|
|
yPos: 40,
|
|
|
|
speed:0.15,
|
|
|
|
mouseWheel:true,
|
|
|
|
bringToFront: true
|
|
|
|
});
|
|
|
|
metacodeIMGinit = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-10-18 00:51:54 +00:00
|
|
|
|
|
|
|
|