source: pro-bachkim-filespace/sourcecode/assets/js/manager.js @ 244

Last change on this file since 244 was 243, checked in by quyenla, 11 years ago

upload file

  • Property svn:mime-type set to text/plain
File size: 20.8 KB
Line 
1if(jQuery) (function($){
2        $.extend($.fn, {
3                violetFileManager : function (o) {
4                        if( !o ) var o = {};
5                        if( o.tree == undefined ) o.tree = null;
6                        if( o.grid == undefined ) o.grid = null;
7                       
8                        if( o.maincontainer == undefined ) o.maincontainer = null;
9                        if( o.titlebar == undefined ) o.titlebar = null;
10                        if( o.toolsbar == undefined ) o.toolsbar = null;
11                        if( o.statusbar == undefined ) o.statusbar = null;
12                       
13                        if( o.oTree == undefined ) o.oTree = null;
14                        if( o.oGrid == undefined ) o.oGrid = null;
15                        if( o.host == undefined ) o.host = 'http://localhost/';
16                        if( o.hostmodule == undefined ) o.hostmodule = 'privatecontent/';
17                        if( o.script == undefined ) o.script = 'getcontent';
18                        if( o.data == undefined ) o.data = null;
19                        if( o.datasource == undefined ) o.datasource = 'ajax';
20                       
21                        o.host = o.host + 'ajax/';
22                       
23                        var isDev = false;
24                        var contextmenu = null;
25                        var oContainer = this;
26                        var tree = [];
27                        var totalItem = 0;
28                        var countItem = 0;
29                        var maxWidth = 0;
30                        var treeCurrentNode = null;
31                        var self = this;
32                        var oClipBoard = {items:null, act:null};
33                       
34                        /**
35                         * Toolbar defined
36                         * */
37                        var btnNewFolder = $('#' + o.toolsbar + ' > DIV.btn-group.basic > #btnNewFolder');
38                        var btnDel = $('#' + o.toolsbar + ' > DIV.btn-group.basic > #btnDel');
39                        var btnCopy = $('#' + o.toolsbar + ' > DIV.btn-group.basic > #btnCopy');
40                        var btnCut = $('#' + o.toolsbar + ' > DIV.btn-group.basic > #btnCut');
41                        var btnPaste = $('#' + o.toolsbar + ' > DIV.btn-group.basic > #btnPaste');
42                        var btnShare = $('#' + o.toolsbar + ' > DIV.btn-group.social > #btnShare');
43                        var btnPreview = $('#' + o.toolsbar + ' > DIV.btn-group.social > #btnPreview');
44                        var btnDownload = $('#' + o.toolsbar + ' > DIV.btn-group.creation > #btnDownload');
45                        var btnUpload = $('#' + o.toolsbar + ' > DIV.btn-group.creation > #btnUpload');
46                        var btnRefresh = $('#' + o.toolsbar + ' > DIV.btn-group.control > #btnRefresh');
47                       
48                        var sendCommand = function (p) {
49                                if( p.postdata == undefined ) p.postdata = null;
50                                if( p.script == undefined ) p.script = o.script;
51                                if( p.callbackSuccess == undefined ) p.callbackSuccess = null;
52                                if( p.callbackDone == undefined ) p.callbackDone = null;
53                                if( p.callbackFail == undefined ) p.callbackFail = null;
54                                if( p.callbackAlways == undefined ) p.callbackAlways = null;
55                                if( p.parseData == undefined ) p.parseData = null;
56                                if( p.self == undefined ) p.self = this;
57
58                                if (p.script != null && (o.datasource == 'ajax' || isDev)) {
59                                        $.post(o.host + o.hostmodule + p.script, p.postdata, function (data){
60                                                if (data) {
61                                                        parseData = $.parseJSON(data);
62                                                        p.parseData = parseData;
63                                                }
64
65                                                if (p.callbackSuccess != null) {
66                                                        if (parseInt(parseData.ERROR.errCode) === 0)
67                                                                p.callbackSuccess(parseData);
68                                                        else {
69                                                                p.callbackFail(parseData.ERROR);
70                                                        }
71                                                }
72
73                                        }).done(function() {if (p.callbackDone != null)p.callbackDone(p.parseData);}).fail(function() {if (p.callbackFail != null)p.callbackFail(this);}).always(function() {if (p.callbackAlways != null)p.callbackAlways(this);});
74                                }
75                                else if (o.datasource == 'json'){
76                                        if (p.callbackSuccess != null) p.callbackSuccess(o.data);
77                                        if (p.callbackDone != null)     p.callbackDone(this);
78                                }
79                               
80                        };
81                       
82                        var getDirTreeMaxWidth = function  () {
83                                var scrWidth = $(o.maincontainer).width();
84                                return parseInt(scrWidth / 2);
85                        }
86                       
87                        var layoutRender = function () {
88                                var scrWidth = $('#' + o.maincontainer).width();
89                                var scrHeght = $(window).height();
90                                var dirTreeHeight = scrHeght - $('#' + o.titlebar).height() - $('#' + o.toolsbar).height() - $('#' + o.statusbar).height() - 2;
91                                $('#' + o.tree).parent().height(dirTreeHeight);
92                                $('#' + o.grid).parent().height(dirTreeHeight);
93                                $('#' + o.grid).parent().width('calc(100% - ' + ($('#' + o.tree).parent().width() + 8) + 'px)');
94                                var scollWidth = $('#' + o.grid).parent().width();
95                                maxWidth = getDirTreeMaxWidth();
96                                $(o.tree).height(dirTreeHeight - 5);
97                        }
98                       
99                        var createFileManager = function (parseData) {
100                                o.data = parseData;
101                                totalItem = o.data.DIRECTORIES.length;
102                                o.oTree = $('#' + o.tree).violetTree({data:o.data.DIRECTORIES,manager:oContainer});
103                                o.oGrid = $('#' + o.grid).violetGrid({data:o.data,manager:oContainer});
104                        };
105
106                        var getAllDirChild = function (parentID, aryChild) {
107                                parentID = parentID == null ? 0:parentID;
108                                var dirList = searchItemsByParent(parentID,'directory');
109                                var index = aryChild.length;
110                                aryChild[index] = parentID;
111                                if (dirList.length > 0) {
112                                        for (var i = 0; i < dirList.length; i++) {
113                                                getAllDirChild(dirList[i].id, aryChild);
114                                        }
115                                }
116                        }
117
118                        var buildTreeFromParent = function (dirID, node) {                             
119                                var aryChildFiles = [];
120                                var aryChildDirs = [];
121                                var aryChildIDs = [];
122                                var aryTmp = [];
123                                var dir = o.data.DIRECTORIES[searchItemByID(dirID, 'directory')];
124                                aryChildDirs = searchItemsByParent(dirID, 'directory');
125                                aryChildFiles = searchItemsByParent(dirID, 'file');
126
127                                node.id = dir.id;
128                                node.name = dir.name;
129                                node.type = 'directory';
130
131                                $(aryChildDirs).each(function (index) {
132                                        var id = this.id;
133                                        var name = this.name;
134                                        var type = 'directory';
135                                        var cDir = {id:id, name:name, type:type, childs:null};
136                                        aryChildIDs[index] = cDir;
137                                });
138
139                                if ($(aryChildFiles).length > 0 ) {
140                                        if (node.files == undefined) node.files = [];
141                                        $(aryChildFiles).each(function (index) {
142                                                var id = this.id;
143                                                var name = this.name;
144                                                var type = 'file';
145                                                var cFile = {id:id, name:name, type:type};
146                                                node.files[index] = cFile;
147                                        });
148                                }                               
149
150                                if ($(aryChildDirs).length > 0) {
151                                        if (node.childs == undefined) node.childs = [];
152                                        $(aryChildIDs).each(function (index) {
153                                                node.childs[index] = new Object;
154                                                buildTreeFromParent(aryChildIDs[index].id, node.childs[index]);
155                                        });
156                                }
157                        }
158                       
159                        var checkChildExisted = function (id) {
160                                var dirList = searchItemsByParent(id,'directory');
161                                var fileList = searchItemsByParent(id,'file');
162                                return (dirList.length > 0) || (fileList.length > 0);
163                        }
164                       
165                        var doneInit = function () {
166                                bindEventToToolbars();
167                                documentEventsBinding();
168                        };
169                       
170                        var failInit = function (er) {
171                                bootbox.alert(er.err);
172                        }
173                       
174                        var init = function () {
175                                layoutRender ();
176                                $('#' + o.tree).parent().resizable({
177                                        maxWidth: maxWidth,
178                                        minWidth: 220,
179                                        handles: "e",
180                                        resize: function (event, ui) {
181                                                layoutRender ();
182                                        }
183                                });
184                                $(window).resize (function() {layoutRender ();$('#' + o.tree).parent().resizable({maxWidth: maxWidth});});
185                                sendCommand ({postdata:null,callbackSuccess:createFileManager,callbackDone:doneInit,callbackFail:failInit});
186                        };
187                       
188                        var searchItemByID = function (id, type) {
189                                var data = {};
190                                switch (type) {
191                                        case 'directory':
192                                                data = o.data.DIRECTORIES;
193                                                break;
194                                        case 'file':
195                                                data = o.data.FILES;
196                                                break;
197                                        default:
198                                                break;
199                                }
200                               
201                                //for (var i = 0; i < data.length; i++) {
202                                for (var i in data) {
203                                        if (data[i].id == id) {
204                                                return i;
205                                        }
206                                }
207                        }
208                       
209                        var searchItemsByParent = function (parentID, type) {
210                                var data = {};
211                                var aryItem = [];
212                                var index = aryItem.length;
213                               
214                                switch (type) {
215                                        case 'directory':
216                                                data = o.data.DIRECTORIES;
217                                                break;
218                                        case 'file':
219                                                data = o.data.FILES;
220                                                break;
221                                        default:
222                                                break;
223                                }
224                               
225                                for(i in data) {
226                                        if (data[i].parentID == parentID) {
227                                                aryItem[index] = data[i];
228                                                index ++;
229                                        }
230                                }
231                               
232                                return aryItem;
233                        }
234                       
235                        /**************************
236                         * TOOLBAR EVENTS - START *
237                         **************************/
238                        var btnRefreshClick = function (obj) {
239                                $(o).find('i').addClass('icon-spin');                           
240                                sendCommand ({  postdata:null,
241                                                                callbackSuccess:function (parseData) {
242                                                                        o.data = parseData;
243                                                                        self.updateData({updateAll:true});
244                                                                        o.oTree.refeshTree();
245                                                                },
246                                                                callbackDone:function () {$(o).find('i').removeClass('icon-spin');},
247                                                                callbackFail:failInit
248                                        });
249                        }
250                       
251                        var btnNewFolderClick = function () {
252                                createFolderStart();
253                        }
254                        var btnUploadClick = function () {
255                                uploadStart();
256                                upload_init();
257                        }
258                       
259                        var btnDelClick = function () {
260                                var items = o.oGrid.getHightLightItem();
261                                if ($(items).length == 0){
262                                        var dirID = $(o.oTree.getSelectedNode()).attr('id');
263                                        var item = o.data.DIRECTORIES[searchItemByID(dirID,'directory')];
264                                        item.type = 'directory';
265                                        items = [item];
266                                }
267                                self.deleteItem(items);
268                        }
269                       
270                        var btnCopyClick = function () {                               
271                                copy('copy');
272                        }
273
274                        var btnPasteClick = function () {
275                                paste();
276                        }
277                       
278                        var btnCutClick = function () {
279                                copy('move');
280                        }
281                       
282                        var bindEventToToolbars = function () {
283                                $(btnRefresh).click(function(e){btnRefreshClick(this)});
284                               
285                                $(btnNewFolder).click(function(e){btnNewFolderClick()});
286                                $(btnUpload).click(function(e){btnUploadClick()});
287                                $(btnDel).click(function(e){btnDelClick()});
288                                $(btnCopy).click(function(e){btnCopyClick()});
289                                $(btnCut).click(function(e){btnCutClick()});
290                                $(btnPaste).click(function(e){btnPasteClick()})
291                               
292                                /*btnShare
293                                btnPreview
294                                btnDownload
295                                btnUpload*/
296                        }
297                        /************************
298                         * TOOLBAR EVENTS - END *
299                         ************************/
300
301                        /***********************************
302                         * DOCUMENT EVENTS BINDING - START *
303                         ***********************************/
304                         var documentEventsBinding = function () {
305                                $(document).bind('keydown', function (e){
306                                        switch( e.which ) {
307                                                case 113:                                                       
308                                                case 27:
309                                                        var gridSelectedItems = o.oGrid.getHightLightItem();
310                                                        if ($(gridSelectedItems).length > 0) {
311                                                                o.oGrid.rename(e.which);
312                                                        }else {                                                         
313                                                                o.oTree.rename(e.which);
314                                                        }
315                                                        break;
316                                                case 46:
317                                                        //delete
318                                                        btnDelClick();
319                                                        break;
320                                                case 65:
321                                                        if (e.ctrlKey) {
322                                                                o.oGrid.selectAllNode();
323                                                        }
324                                                        break;
325                                                default:
326                                                        break;
327                                        }
328                                });
329                         }
330                        /***********************************
331                         * DOCUMENT EVENTS BINDING - END *
332                         ***********************************/                   
333                       
334                        /*******************************
335                         * CREATE FOLDER - START *
336                         *******************************/
337                        var createFolderStart = function () {
338                                var promptOptions = {
339                                                  title: "Tạo thư mục mới",
340                                                  buttons: {
341                                                    confirm: {
342                                                      label: "Lưu"
343                                                    },
344                                                    cancel: {
345                                                      label: "Há»§y"   
346                                                    }
347                                                  },
348                                                  callback: function(result) {               
349                                                      if (result === null) {                                             
350                                                                                     
351                                                      } else {
352                                                          createFolder(treeCurrentNode, result);
353                                                      }
354                                                    }
355                                                };
356
357                                return bootbox.prompt(promptOptions);
358                        }
359                       
360                        var uploadStart = function () {
361                                var promptOptions = {
362                                                  title: "Tải lên",
363                                                   message: "<form id='upload' method='post' action='upload/upload.php' enctype='multipart/form-data'><div id='drop'>Drop Here<a>Browse</a><input type='file' name='upl' multiple /></div><ul></ul></form>",
364                                                  buttons: {
365                                                    confirm: {
366                                                      label: "Lưu"
367                                                    },
368                                                    cancel: {
369                                                      label: "Há»§y"   
370                                                    }
371                                                  },
372                                                  callback: function(result) {               
373                                                      if (result === null) {                                             
374                                                                                     
375                                                      } else {
376                                                         
377                                                         
378                                                          createFolder(treeCurrentNode, result);
379                                                      }
380                                                    }
381                                                };
382
383                                return bootbox.dialog(promptOptions);
384                        }
385                       
386                        var createFolder = function (parent, name) {
387                                var postdata = {fname:name,fparentid:parent};
388                                var script = 'createdir';
389                                /*isDev = true;*/
390                                sendCommand ({
391                                        postdata:postdata,
392                                        script:script,
393                                        callbackSuccess:function(parseData){createFolderFinish(parseData);},
394                                        callbackFail: function(){}
395                                });
396                        }
397                       
398                        var createFolderFinish = function (parseData) {
399                                /*isDev = false;*/
400                                if (parseData.ERROR.errCode == 0) {
401                                        var node = {id:parseData.id, name:parseData.name,parentID:parseData.parentID};
402                                        o.oTree.createNode(node);
403                                        o.data.DIRECTORIES[$(o.data.DIRECTORIES).length] = node;
404                                        if (o.oGrid) o.oGrid.reloadGrid();
405                                }
406                        }
407                        /*******************************
408                         * CREATE FOLDER - END         *
409                         *******************************/
410                        /********************************
411                         * COPY & PASTE & MOVE - START  *
412                         ************=*******************/     
413                        var copy = function (act){
414                                //detect selected items
415                                //push to clipboard
416                                var items = o.oGrid.getHightLightItem();
417                               
418                                if ($(items).length == 0) {
419                                        var node = o.oTree.getSelectedNode();
420                                        var itemID = $(node).attr('id');
421                                       
422                                        if (itemID == 0) return false;
423                                       
424                                        items[0] = o.data.DIRECTORIES[searchItemByID(itemID, 'directory')];
425                                        items[0].type = 'directory';
426                                }
427
428                                if ($(items).length > 0) {
429                                        oClipBoard.items = items;
430                                        oClipBoard.act = act;
431                                }
432                                return true;
433                        }
434                       
435                        var paste = function () {
436                                if ((oClipBoard.act != 'copy'
437                                        && oClipBoard.act != 'move')
438                                        || oClipBoard.items == null) return;
439                               
440                                var items = [];
441                                var destination = self.getTreeCurrentNode();
442                                if (oClipBoard.act != 'copy') {
443                                        $(oClipBoard.items).each(function (index) {
444                                                var node = new Object;
445                                                if (this.type == 'directory')
446                                                        buildTreeFromParent(this.id, node);
447                                                else {
448                                                        node.id = this.id;
449                                                        node.type = 'file';
450                                                }
451       
452                                                items[index] = node;
453                                        });
454                                }
455                                else {
456                                        items = oClipBoard.items;
457                                }
458                               
459                                var postdata = {act:oClipBoard.act,destination:destination,data:JSON.stringify(items)};
460                                var script = oClipBoard.act;
461                               
462                                sendCommand ({
463                                        postdata:postdata,
464                                        script:script,
465                                        callbackSuccess:function(parseData){
466                                                if (oClipBoard.act == 'copy'){
467                                                        $(parseData.DIRECTORIES).each(function (index) {
468                                                                o.data.DIRECTORIES[$(o.data.DIRECTORIES).length] = this;
469                                                        });
470                                                       
471                                                        $(parseData.FILES).each(function (index) {
472                                                                o.data.FILES[$(o.data.FILES).length] = this;
473                                                        });
474                                                                                                       
475                                                        o.data.DIRECTORIES.sort(function (a,b) {
476                                                                return a.parentID - b.parentID;
477                                                        });                                             
478                                                       
479                                                        o.oTree.setData (o.data.DIRECTORIES);
480                                                        o.oGrid.setData (o.data);                                               
481                                                        o.oTree.createCopyNode(parseData.DIRECTORIES);
482                                                        o.oGrid.reloadGrid();
483                                                }
484                                        }
485                                });
486                               
487                        }
488
489                        var move = function () {
490                               
491                        }
492
493                        var copyTo = function () {
494
495                        }
496
497                        var moveTo = function () {
498
499                        }
500                       
501                        /*****************************
502                         * COPY & PASTE & MOVE - END *
503                         *****************************/
504
505                        this.deleteItem = function (item) {
506                               
507                                var confirmText = 'Bạn có muốn xóa ';
508                               
509                                if ($.isArray(item) && item.length > 1) {
510                                        confirmText += 'các thư mục (và files) đã chọn?';
511                                }
512                                else if (item.length == 1) {
513                                        if (item[0].id == 0) return false;
514                                        confirmText += (item[0].type == 'directory')?'thư mục':'file';
515                                        confirmText += ' <span style="font-weight:bold">' + item[0].name + "</span> khÃŽng?";
516                                }
517                               
518                                confirmText += '<br /><div style="color:red">(hành động này sẜ xóa tất cả thư mục con và các file trong các thư mục đã chọn)</div>';
519                               
520                                var parentID = item[0].parentID;
521                               
522                                for (var i = 0; i < item.length; i++) {
523                                        if (item[i].type == 'directory') {
524                                                var aryChildDirTmp = [];
525                                                var aryChildDirID = [];
526                                                var aryChildFiles = searchItemsByParent(item[i].id, 'file');
527                                                var aryChildDirs = [];
528                                               
529                                                getAllDirChild (item[i].id, aryChildDirTmp);
530                                                for(var d = 1; d < aryChildDirTmp.length; d++) {
531                                                        aryChildDirID[d-1] = aryChildDirTmp[d];
532                                                }
533                                               
534                                                for (var j = 0; j < aryChildDirID.length; j++) {
535                                                        if (o.data.DIRECTORIES[searchItemByID(aryChildDirID[j],'directory')] != undefined)
536                                                                aryChildDirs[aryChildDirs.length] = o.data.DIRECTORIES[searchItemByID(aryChildDirID[j],'directory')];
537                                                       
538                                                        var aryTmp = searchItemsByParent(aryChildDirID[j], 'file');
539                                                        if (aryTmp.length > 0)
540                                                                for(var f in aryTmp) {
541                                                                        aryChildFiles[aryChildFiles.length] = aryTmp[f];
542                                                                }
543                                                }
544                                               
545                                                item[i].childDirs = aryChildDirs;
546                                                item[i].childFiles = aryChildFiles;
547                                        }
548                                }
549                               
550                                var confirmOptions = {
551                                                  message:confirmText,
552                                                  buttons: {
553                                                    confirm: {
554                                                      label: "Xóa"
555                                                    },
556                                                    cancel: {
557                                                      label: "KhÃŽng xóa"     
558                                                    }
559                                                  },
560                                                  callback: function(result) {               
561                                                          if (result) {
562                                                                        var delobj = JSON.stringify(item);
563                                                                        var postdata = {delobj:delobj};
564                                                                        var script = 'delete';
565                                                                        sendCommand ({
566                                                                                postdata:postdata,
567                                                                                script:script,
568                                                                                callbackSuccess:function(parseData){
569                                                                                        if($(parseData.DIRECTORIES).length > 0) {
570                                                                                                $(parseData.DIRECTORIES).each (function (index) {
571                                                                                                        o.oTree.deletion(this);
572                                                                                                        o.oGrid.deletion(this, 'directory');   
573                                                                                                });
574                                                                                        }
575
576                                                                                        if($(parseData.FILES).length > 0) {
577                                                                                                $(parseData.FILES).each (function (index) {
578                                                                                                        var file = o.data.FILES[searchItemByID(this, 'file')];                                                                                 
579                                                                                                        o.oGrid.deletion(this, file.minetype);
580                                                                                                });     
581                                                                                        }
582                                                                                },
583                                                                                callbackDone: function (obj) {
584                                                                                        if($(parseData.DIRECTORIES).length > 0) {
585                                                                                                $(parseData.DIRECTORIES).each(function(index){
586                                                                                                        delete o.data.DIRECTORIES[searchItemByID(this, 'directory')];
587                                                                                                });
588                                                                                        }
589                                                                                       
590                                                                                        if($(parseData.FILES).length > 0) {
591                                                                                                $(parseData.FILES).each(function(index){
592                                                                                                        delete o.data.FILES[searchItemByID(this, 'file')];
593                                                                                                });
594                                                                                        }
595                                                                                       
596                                                                                        o.oTree.setData (o.data.DIRECTORIES);
597                                                                                        o.oGrid.setData (o.data);
598                                                                                        self.setTreeCurrentNode(parentID);
599                                                                                        o.oGrid.reloadGrid();
600                                                                        },
601                                                                                callbackFail: function(){}
602                                                                        });
603                                                                }
604                                                    }
605                                                };
606                               
607                                bootbox.confirm(confirmOptions);
608                        }
609                       
610                        this.setTreeCurrentNode = function (treeNode) {
611                                //fire when click a node on Tree
612                                //then fire action of Grid
613                                treeCurrentNode = treeNode;
614                                if (o.oGrid) o.oGrid.reloadGrid();
615                        };
616                       
617                        this.getTreeCurrentNode = function () {
618                                return treeCurrentNode;
619                        }
620                       
621                        this.gridNodeDblClick = function (node) {
622                                if (node.minetype == 'directory') {
623                                        var treeNode = $('#' + o.tree).find('UL.vstree[rel^="node' + node.parentID + '"] > LI[rel^="folder"] > A#' + node.id);
624                                        o.oTree.activeNode(treeNode);
625                                }
626                                else {
627                                        //execute or preview file
628                                }
629                        };
630                       
631                        this.createNewFolder = function () {
632                               
633                        }
634                       
635                        this.updateData = function (p) {
636                                if( p.item == undefined ) p.item = null;
637                                if( p.updateAll == undefined ) p.updateAll = false;
638                                if( p.from == undefined ) p.from = null;
639                                if( p.type == undefined ) p.type = null;
640                                if( p.callback == undefined ) p.callback = null;
641
642                                var obj = p.from == 'tree' ? o.oGrid : o.oTree;
643                                if (!p.updateAll) {
644                                        var index = searchItemByID(p.item.id, p.type);
645                                        switch (p.type) {
646                                                case 'directory':
647                                                        o.data.DIRECTORIES[index].name = p.item.name;
648                                                        o.data.DIRECTORIES[index].parentID = p.item.parentID;
649                                                        break;
650                                                case 'file':
651                                                        o.data.FILES[index].name = p.item.name;
652                                                        o.data.FILES[index].parentID = p.item.parentID;
653                                                        o.data.FILES[index].minetype = p.item.minetype;
654                                                        break;
655                                                default:
656                                                        break;
657                                        }
658                                }
659                               
660                                o.oTree.setData (o.data.DIRECTORIES);
661                                o.oGrid.setData (o.data);
662                               
663                                if (p.callback != null) {
664                                        eval('obj.' + p.callback + '(p.item);')
665                                }
666                               
667                                //call sendCommand
668                        }
669                       
670                        this.searchItemsByParent = function (parentID, type) {
671                                return searchItemsByParent(parentID, type);
672                        }
673                       
674                        this.searchItemByID = function (parentID, type) {
675                                return searchItemByID(parentID, type);
676                        }
677                       
678                        this.initialize = function () {
679                                init();
680                                return this;
681                        };
682                       
683                        return this.initialize();
684                }
685        });
686})(jQuery);
Note: See TracBrowser for help on using the repository browser.