Last active
August 29, 2015 14:15
-
-
Save s4553711/c5c898a93babf2797497 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messageBox.show = function(infoNodeId, PositionNodeId) { | |
var title = jstree().messageBoxTitle(infoNodeId); | |
var content = jstree().messageBoxText(infoNodeId, PositionNodeId); | |
}; | |
//------ | |
contextMenu.delete_node = function(node) { | |
this.popupMessage.show(node.id, node.id); | |
this.popupMessage.loading.done(function(){ | |
jstree().CompleteDeleteNode(); | |
}); | |
}; | |
contexeMenu.move_node = function(node, parent, old_parent) { | |
this.popupMessage.show(node.id, parent.id); | |
this.popupMessage.loading.done(function(){ | |
jstree().CompleteMoveNode(); | |
}); | |
this.popupMessage.loading.fail(function(msg){ | |
jstree().ResetMoveNodeStatus(); | |
}); | |
}; | |
//------- | |
var jstree = {}; | |
jstree.messageBoxText = function(InfoNodeID, PositinNodeID) { | |
var InfoNode = this.get_node(InfoNodeID); | |
var PositionNode = this.get_node(PositionNodeID); | |
if (InfoNode.type == 'sample') { | |
var totalSample = 0; | |
$.ajax({ | |
url: "json/getFastqInfo", | |
async: false, | |
data: { id: InfoNodeID }, | |
type: "post", | |
error: function(e) { | |
alertHttpStatus(e); | |
}, | |
success: function( data ) { | |
totalSample = data.fastqList.length; | |
} | |
}); | |
return InfoNode.text+' contains '+totalSample+' fastq files'; | |
} else { | |
var child = PositionNode.children_d; | |
var ar = []; | |
for(child) { | |
ar.push('X folders'); | |
} | |
return InfoNode.text+' contains '+ar.join(", "); | |
} | |
}; | |
jstree.messageBoxTitle = function(InfoNodeID, operation) { | |
var InfoNode = this.get_node(InfoNodeID); | |
if (operation == 'move_node') { | |
return "Are you sure you want to move "+InfoNode.type+ | |
" <span style='font-weight:bold;font-style: italic'>"+InfoNode.text+ | |
"</span> to <span style='font-weight:bold;font-style: italic'>"+ | |
targetFolderPath.join(" / ")+"</span> ?"; | |
} else { | |
return "Are you sure you want to delete "+InfoNode.type+" "+InfoNode.text+" ?"; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment