]> granicus.if.org Git - transmission/commitdiff
in file-row getPath(), don't leak 'path' into the global namespace
authorJordan Lee <jordan@transmissionbt.com>
Sun, 23 Sep 2012 17:21:19 +0000 (17:21 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 23 Sep 2012 17:21:19 +0000 (17:21 +0000)
web/javascript/file-row.js
web/javascript/inspector.js

index 1f6352c9e3763ce82e8085c6f4c4c90fbf531e09..fe2e9d5eacb9002ddce6be41d77d451ed5843ef2 100644 (file)
@@ -174,10 +174,10 @@ function FileRow(torrent, i)
        };
        this.getPath = function () {
                var file = torrent.getFile(i);
-        path = file.name.replace(/\/\/+/g,'/')
-               path = path.split('/').slice(0,-1)
-               path.push('t' + fields.torrent.getId() + 'f' + fields.index)
-               return path
+               var path = file.name.replace(/\/\/+/g,'/');
+               path = path.split('/').slice(0,-1);
+               path.push('t' + fields.torrent.getId() + 'f' + fields.index);
+               return path;
        };
 
        initialize(torrent, i);
index b4e29e6ab05d65c1c4bcf3c5cbb52ab24259b3dc..ef5c3adff22d1347b3a85095167c7f364896f38c 100644 (file)
@@ -513,7 +513,7 @@ function Inspector(controller) {
         n = tor.getFileCount();
         data.file_rows = [];
         fragment = document.createDocumentFragment();
-               heirarchy = {'/':[]}
+        heirarchy = {'/':[]}
         
         for (i=0; i<n; ++i) {
             row = data.file_rows[i] = new FileRow(tor, i);
@@ -537,6 +537,7 @@ function Inspector(controller) {
                 }
             }
         }
+       console.log(heirarchy);
         /*
         At this point we have a single object containing the whole
         torrent heirarchy. The '/' key is file element ids as assigned above