Changeset 3519 for lang/javascript/userchrome
- Timestamp:
- 12/24/07 13:32:19 (13 months ago)
- Files:
-
- 1 modified
-
lang/javascript/userchrome/editonfavorite.uc.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userchrome/editonfavorite.uc.js
r3518 r3519 32 32 } 33 33 34 self.watching = {};34 self.watching = []; 35 35 }, 36 36 … … 64 64 args.unshift("-a", "Vim"); 65 65 ps.run(false, args, args.length); 66 self.watching [file.path] ={66 self.watching.push({ 67 67 file: file, 68 68 time: (new Date()).getTime(), 69 69 doc: e.target.ownerDocument, 70 70 target: e.target 71 } ;71 }); 72 72 if (!self.watcher) { 73 73 self.watcher = setInterval(function () { 74 74 self.watch(); 75 75 }, 1000); 76 log("start watcher thread. "+self.watcher); 76 77 } 77 78 } … … 81 82 log("unload"+e.originalTarget); 82 83 var self = this; 83 for (var k in self.watching) { 84 if (!self.watching.hasOwnProperty(k)) continue; 85 var w = self.watching[k]; 84 for (var i = 0; i < self.watching.length; i++) { 85 var w = self.watching[i]; 86 86 log(w.doc == e.originalTarget); 87 87 if (w.doc == e.originalTarget) { 88 log("unwatch: "+w.file.path );88 log("unwatch: "+w.file.path+" len:"+self.watching.length); 89 89 w.file.remove(false); 90 delete self.watching[k]; 90 self.watching.splice(i, 1); 91 if (!self.watching.length) { 92 log("end watcher thread. "+self.watcher); 93 clearInterval(self.watcher); 94 self.watcher = null; 95 } 91 96 } 92 97 } … … 95 100 watch : function () { 96 101 var self = this; 97 for (var k in self.watching) { 98 if (!self.watching.hasOwnProperty(k)) continue; 99 var w = self.watching[k]; 102 for (var i = 0; i < self.watching.length; i++) { 103 var w = self.watching[i]; 100 104 if (w.time < w.file.lastModifiedTime) { 101 105 log("changed:"+w.file.path);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)