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

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