TreeController.prototype.configureKeyListeners = function()

in src/main/resources/SLING-INF/libs/sling/resource-editor/static/js/tree/TreeController.js [76:102]


	TreeController.prototype.configureKeyListeners = function(e) {
    	// see http://www.javascripter.net/faq/keycodes.htm
		var del = 46;
		var c = 67;
		var v = 86;

    	if (e.ctrlKey && c==e.which) { /*ctrl-c*/
    		var resourcePath = this.getPathFromLi($(e.target).parents("li"));
    		sessionStorage["resourcePath"] = resourcePath;
    	}
    	if (e.ctrlKey && v==e.which) { /*ctrl-v*/
    		var from = sessionStorage["resourcePath"];
    		var to = this.getPathFromLi($(e.target).parents("li"));
    		this.copy(from, to);
    	}
		switch(e.which) {
		    case del:
	    		treeController.deleteNodes();
		        break;
		    case c:
		    	if (!e.ctrlKey){
		    		this.openAddNodeDialog($(e.target).parents("li"));
		    	}
		        break;
		}
		
	}