From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy at warmcat.com (Andy Green) Date: Thu, 21 Jun 2018 15:30:59 +0800 Subject: [PATCH 1/3] ui-shared: introduce line range highlight javascript In-Reply-To: <20180621090347.471c2727@leda> References: <152955977062.31282.13926467680412169482.stgit@mail.warmcat.com> <20180621090347.471c2727@leda> Message-ID: <6568883b-14ef-41b2-c639-132a7d35ea83@warmcat.com> On 06/21/2018 03:03 PM, Christian Hesse wrote: > Andy Green on Thu, 2018/06/21 13:42: >> This adds a small css class and a function in ui-shared that >> emits canned javascript to interpret the # part of the URL >> on the client, and apply a highlight to filtered source. " e1.style.backgroundColor = >> \"yellow\";\n" >> + " }\n" >> + "\n" >> + " e.scrollIntoView(true);\n" >> + " }\n" >> + " }\n" >> + "}\n" >> + "\n" >> + "document.addEventListener(\"DOMContentLoaded\", function() {" >> + " cgit_line_range_highlight();\n" >> + "}, false);\n" >> + "\n"); >> +} > > I would prefer to have this in a file cgit.js (much like cgit.css). OK... for the main part of it, it makes sense. And have it brought in in HEAD. Because I think the direction of the JS stuff is that it will only want to increase once it's a thing. For the stuff using it or not though, it will still want to have its own little