2012-10-08 23:18:00 -04: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 02:16:17 -05:00
|
|
|
//= require jquery-ui
|
|
|
|
//= require autocomplete-rails-uncompressed
|
2012-10-08 23:18:00 -04:00
|
|
|
//= require jquery_ujs
|
|
|
|
//= require_tree .
|
2012-11-23 08:56:22 -08:00
|
|
|
|
2012-12-15 02:39:14 -05:00
|
|
|
// other options are 'graph'
|
|
|
|
var viewMode = "list";
|
2012-10-21 21:10:43 -04:00
|
|
|
|
2012-10-08 23:18:00 -04:00
|
|
|
$(document).ready(function() {
|
2012-12-16 15:00:43 -05:00
|
|
|
|
2012-12-20 19:24:27 -05:00
|
|
|
$('#new_item').bind('contextmenu', function(e){
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2012-12-16 15:00:43 -05:00
|
|
|
/// this is for the topic creation autocomplete fielf
|
|
|
|
$('#item_name').bind('railsAutocomplete.select', function(event, data){
|
|
|
|
if (data.item.id != undefined) {
|
|
|
|
$('#item_grabItem').val(data.item.id);
|
|
|
|
$('#new_item').submit();
|
2012-12-14 02:16:17 -05:00
|
|
|
}
|
|
|
|
});
|
2012-12-16 15:00:43 -05:00
|
|
|
|
2012-10-31 18:53:11 -04:00
|
|
|
$(".focus .desc").mCustomScrollbar();
|
|
|
|
$(".scroll").mCustomScrollbar();
|
|
|
|
|
2012-12-16 01:12:41 -05:00
|
|
|
$('.nodemargin').css('padding-top',$('.focus').css('height'));
|
2012-10-28 14:37:46 -04:00
|
|
|
|
2012-12-16 15:00:43 -05:00
|
|
|
// controls the sliding hover of the menus at the top
|
2012-10-28 14:37:46 -04:00
|
|
|
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;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2012-12-03 18:40:14 -05:00
|
|
|
|
|
|
|
// this is to save the layout of maps
|
|
|
|
var coor = "";
|
|
|
|
$("#saveLayout").click(function(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
coor = "";
|
2012-12-14 13:31:39 -05:00
|
|
|
if (gType == "arranged" || gType == "chaotic") {
|
2012-12-15 02:39:14 -05:00
|
|
|
Mconsole.graph.eachNode(function(n) {
|
2012-12-03 18:40:14 -05:00
|
|
|
coor = coor + n.data.$mappingid + '/' + n.pos.x + '/' + n.pos.y + ',';
|
|
|
|
});
|
2012-12-14 13:31:39 -05:00
|
|
|
coor = coor.slice(0, -1);
|
|
|
|
$('#map_coordinates').val(coor);
|
|
|
|
$('#saveMapLayout').submit();
|
2012-12-15 02:39:14 -05:00
|
|
|
|
2012-12-03 18:40:14 -05:00
|
|
|
}
|
|
|
|
});
|
2012-10-21 21:10:43 -04:00
|
|
|
});
|
2012-10-17 20:51:54 -04:00
|
|
|
|
|
|
|
|