~vanvugt/ubuntu/oneiric/mediatomb/fix-770964-784431

« back to all changes in this revision

Viewing changes to web/js/tree.js

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2009-04-22 21:39:19 UTC
  • mto: (4.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090422213919-52m015y6gcpv1m1g
Tags: upstream-0.12.0~svn2018
ImportĀ upstreamĀ versionĀ 0.12.0~svn2018

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
    
10
 
    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
    
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: tree.js 1698 2008-02-23 20:48:30Z lww $
 
27
    $Id: tree.js 2010 2009-01-11 19:10:43Z lww $
28
28
*/
29
29
 
30
30
 
299
299
        return;
300
300
    }
301
301
    var type = xmlGetAttribute(containers, "type");
302
 
    var ofId = xmlGetAttribute(containers, "ofId");
 
302
    if (type == 'filesystem')
 
303
        type = 'f';
 
304
    else if (type == 'database')
 
305
        type = 'd';
 
306
    var ofId = xmlGetAttribute(containers, "parent_id");
303
307
    var parentId = type+ofId;
304
308
    
305
309
    var node = getTreeNode(parentId);
306
 
    var success = containers.getAttribute("success");
 
310
    var success = xmlGetElement(xml, 'root').getAttribute("success");
 
311
    //alert(success);
307
312
    if (! success || success != "1")
308
313
    {
309
314
        if (ofId == '0')
344
349
        var id = type + xmlGetAttribute(c, "id");
345
350
        
346
351
        //TODO: childCount unnecessary? - hasChildren instead?
347
 
        var childCount = xmlGetAttribute(c, "childCount");
 
352
        var childCount = xmlGetAttribute(c, "child_count");
348
353
        if (childCount)
349
354
            childCount = parseInt(childCount);
350
355
        var expandable = childCount ? true : false;
351
356
        
352
 
        var autoscanType = xmlGetAttribute(c, "autoscanType");
353
 
        var autoscanMode = xmlGetAttribute(c, "autoscanMode");
 
357
        var autoscanType = xmlGetAttribute(c, "autoscan_type");
 
358
        var autoscanMode = xmlGetAttribute(c, "autoscan_mode");
354
359
        
355
360
        var thisIconArray = iconArray;
356
 
        if (autoscanType == '1')
 
361
        if (autoscanType == 'ui')
357
362
        {
358
 
            if (autoscanMode == '2')
 
363
            if (autoscanMode == 'inotify')
359
364
                thisIconArray = autoscanInotifyIconArray;
360
365
            else
361
366
                thisIconArray = autoscanTimedIconArray;
362
367
        }
363
368
        
364
 
        if (autoscanType == '2')
 
369
        if (autoscanType == 'persistent')
365
370
        {
366
 
            if (autoscanMode == '2')
 
371
            if (autoscanMode == 'inotify')
367
372
                thisIconArray = autoscanInotifyConfigIconArray;
368
373
            else
369
374
                thisIconArray = autoscanTimedConfigIconArray;