]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Update to new jsdom API
authorPierre Ossman <ossman@cendio.se>
Fri, 6 Oct 2017 08:05:29 +0000 (10:05 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 6 Oct 2017 08:05:29 +0000 (10:05 +0200)
po/xgettext-html

index d71822c4144df8bb06d4205fcaebac3c7f8776a2..2e4e93bf5e5c534fbefd0f0eed53789d518c4e3f 100755 (executable)
@@ -89,15 +89,16 @@ for (var i = 0;i < opt.argv.length;i++) {
 
     fn = opt.argv[i];
     file = fs.readFileSync(fn, "utf8");
-    doc = jsdom.jsdom(file);
+    dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
+    body = dom.window.document.body;
 
     locator = function (elem) {
-        offset = jsdom.nodeLocation(elem).start;
+        offset = dom.nodeLocation(elem).startOffset;
         line = file.slice(0, offset).split("\n").length;
         return fn + ":" + line;
     };
 
-    process(doc.body, locator, true);
+    process(body, locator, true);
 }
 
 var output = "";