Skip to content

Commit

Permalink
Merge pull request killme2008#4 from komarov/master
Browse files Browse the repository at this point in the history
branch refresh on double click
  • Loading branch information
killme2008 committed Jan 19, 2014
2 parents 350abcf + 531b726 commit ba965dd
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions views/tree.ejs
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript" src="jquery.tree.js"></script>
<script type="text/javascript" language="javascript">
<!--
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
$(function () {
$.ajaxSetup({cache:false});
$("#zkTree").tree({
data : {
type : "json",
async : true,
opts : {
method : "get",
url : "/node-zk/children"
}
},//end data
ui:{
theme_name : "classic"
},
lang:{
loading : "目录加载中……"
},
types :{
"default" : {
draggable : false
}
},
callback : {
beforedata : function(node,tree_obj){
var rootPath= '<%= path %>';
return {path : $(node).attr("path") || rootPath,rel : $(node).attr("rel")};
<script type="text/javascript">
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
$(function () {
$.ajaxSetup({cache:false});
$("#zkTree").tree({
data : {
type : "json",
async : true,
opts : {
method : "get",
url : "/node-zk/children"
}
},
ui : {
theme_name : "classic"
},
lang : {
loading : "目录加载中……"
},
types : {
"default" : {
draggable : false
}
},
callback : {
beforedata : function(node,tree_obj) {
var rootPath= '<%= path %>';
return {path : $(node).attr("path") || rootPath,rel : $(node).attr("rel")};
},
onselect : function(node,tree_obj){
var test = $(node).children("a").attr("href");
$(parent.document.body).find('#content').attr('src', test);
onselect : function(node,tree_obj) {
var test = $(node).children("a").attr("href");
$(parent.document.body).find('#content').attr('src', test);
},
onsearch : function(node, tree_obj) {
tree_obj.container.find(".search").removeClass("search");
node.addClass("search");
},
ondblclk : function(node, tree_obj) {
tree_obj.refresh(node);
}
} //end callback
});
}
});
function searchnodes(){
var searchPath=$('#search_path').val();
window.location.href='/node-zk/tree?path='+searchPath;
$(parent.document.body).find('#content').attr('src', "/node-zk/get?path="+searchPath);
}
//-->
});
function searchnodes(){
var searchPath=$('#search_path').val();
window.location.href='/node-zk/tree?path='+searchPath;
$(parent.document.body).find('#content').attr('src', "/node-zk/get?path="+searchPath);
}
</script>
<div id="container">
<h2><a target="_blank" href="https://github.com/killme2008/node-zk-browser" style='text-decoration:none;'>Node-ZK-Browser</a></h2>
<div>
<a href="/node-zk/create" target="content">create path</a>
</div>
<div>
<input type="text" id="search_path" value='<%= path %>'/>
<input type="button" id="search_op" onclick="searchnodes()" value="Search" />
</div>
<div id="zkTree"></div>
</div>
<div id="container">
<h2><a target="_blank" href="https://github.com/killme2008/node-zk-browser" style='text-decoration:none;'>Node-ZK-Browser</a></h2>
<div>
<a href="/node-zk/create" target="content">create path</a>
</div>
<div>
<input type="text" id="search_path" value='<%= path %>'/>
<input type="button" id="search_op" onclick="searchnodes()" value="Search" />
</div>
<div id="zkTree"></div>
</div>

0 comments on commit ba965dd

Please sign in to comment.