93936600ca6a0a4e81a3fae66812e9b5045d5965 larrym Wed Jul 13 17:08:26 2011 -0700 more work on in-place updating diff --git src/hg/js/ajax.js src/hg/js/ajax.js index 15b2c35..2fc0083 100644 --- src/hg/js/ajax.js +++ src/hg/js/ajax.js @@ -410,15 +410,26 @@ } } }); var myWidth = $(window).width() - 300; if(myWidth > 900) myWidth = 900; $(popUp).dialog("option", "maxWidth", myWidth); $(popUp).dialog("option", "width", myWidth); $(popUp).dialog('open'); var buttOk = $('button.ui-state-default'); if($(buttOk).length == 1) $(buttOk).focus(); } +function scrapeVariable(html, name) +{ +// scrape a variable defintion out of html (see jsHelper.c::jsPrintHash) + var re = new RegExp("^// START " + name + "\\nvar " + name + " = ([\\S\\s]+);\\n// END " + name + "$", "m"); + var a = re.exec(html); + var json; + if(a && a[1]) { + json = eval("(" + a[1] + ")"); + } + return json; +}