Update jstree.jquery to 1.0rc3

This commit is contained in:
Deon George
2011-10-07 11:57:59 +11:00
parent 130a87aa9a
commit be00deede7
24 changed files with 4814 additions and 221 deletions

View File

@@ -32,8 +32,7 @@ class Controller_lnApp_Tree extends Controller_Default {
$(function () {
$("#tree").jstree({
themes : {
"theme" : "default",
"url" : "'.URL::site($mediapath->uri(array('file'=>'css/jquery.jstree.css'))).'",
"theme" : "classic",
},
ui : {
"select_limit" : 1,
@@ -46,7 +45,7 @@ $(function () {
"correct_state" : "true",
"progressive_render" : "true",
"ajax" : {
"url" : "'.URL::site('/tree/json').'",
"url" : "'.URL::site('tree/json').'",
"data" : function (n) {
return { id : n.attr ? n.attr("id") : "N_"+0 };
}
@@ -60,14 +59,15 @@ $(function () {
if (a = data.rslt.obj.attr(\'id\').indexOf(\'_\')) {
id = data.rslt.obj.attr(\'id\').substr(a+1);
if (href = $("#N_"+id).attr("href"))
if (href = $("#N_"+id).attr("href")) {
$("#ajBODY").empty().html("<img src=\"'.URL::site('media/img/ajax-progress.gif').'\"/>");
$("#ajBODY").load(href, function(r,s,x) {
if (s == "error") {
var msg = "Sorry but there was an error: ";
$("#ajBODY").html(msg + x.status + " " + x.statusText + r);
}
});
else
} else
alert("Unknown: "+id+" HREF:"+href);
}
});
@@ -86,7 +86,7 @@ $(function () {
public function action_json(array $data=array()) {
if ($this->_auth_required() AND ! Auth::instance()->logged_in()) {
$this->output = array('attr'=>array('id'=>'a_login'),
'data'=>array('title'=>_('Please Login').'...','attr'=>array('id'=>'N_login','href'=>URL::site('/login'))));
'data'=>array('title'=>_('Please Login').'...','attr'=>array('id'=>'N_login','href'=>URL::site('login'))));
return;
}
@@ -98,7 +98,7 @@ $(function () {
'attr'=>array('id'=>sprintf('B_%s',$branch['id'])),
'state'=>$branch['state'],
'data'=>array('title'=>$branch['name']),
'attr'=>array('id'=>sprintf('N_%s',$branch['id']),'href'=>empty($branch['attr_href']) ? URL::site(sprintf('/%s/menu',$branch['name'])) : $branch['attr_href']),
'attr'=>array('id'=>sprintf('N_%s',$branch['id']),'href'=>empty($branch['attr_href']) ? URL::site(sprintf('%s/menu',$branch['name'])) : $branch['attr_href']),
)
);
}