From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Re: Highlight current page in TOC Date: Wed, 24 Nov 2010 18:13:40 +0100 Message-ID: <87vd3mpruj.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=38192 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLIxe-0001uP-9D for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 12:19:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLIvQ-0004fJ-5b for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 12:16:48 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]:34110 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PLIvP-0004dy-PA for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 12:14:32 -0500 In-Reply-To: (Benny Simonsen's message of "Mon, 22 Nov 2010 21:06:40 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Benny Simonsen Cc: emacs-orgmode@gnu.org Benny Simonsen writes: > 2010/11/14 Benny Simonsen >> >> Hi >> >> With the org-info-js mode enabled each section is shown as a seperate >> page, but then I would like to get current page marked in the TOC in >> some way (e.g. class=3Dcurrent and then some CSS to make the markup) >> ... but is it possible? >> >> /Benny > > Hi > > I have made it. > > The result can be seen on a example page I have made (in danish - > (translated org-info-src.js [1] it into danish)) - > http://slbs.dk/org/oensker.html > > I have modified org-info-src.js [1] to include an extra function > setLinkClass + using this function at the end of showSection. > I have also added a small css script [2] with the extra content, which > could be included in the normal worg.css [3] without side effects, I > think. > I include one css - main.css [4] that includes the two css files > mentioed here + an extra file with my own site style.' > > Except the changes in my site slbs.css, the only style changes I have mad= e are: > - Current page/section are marked black and bold > - Visited pages are marked in different color > > Anyone interested in a patch for the highlighting of the links? > Anyone interested in a patch for the danish org-info-src.js? > > [1] http://slbs.dk/org/scripts/org-info-src.marklinks.js > =C2=A0=C2=A0=C2=A0=C2=A0 ... in danish: http://slbs.dk/org/scripts/org-in= fo-src.da.marklinks.js > =C2=A0=C2=A0=C2=A0=C2=A0 ... in danish without modifications: > http://slbs.dk/org/scripts/org-info-src.da.js > [2] http://slbs.dk/org/style/marklink.css > [3] Copy from http://orgmode.org/worg/worg.css > [4] http://slbs.dk/org/style/main.css - Which includes the other css files > > I have also included lightbox-2.04, and changed it so that a group is > limited to one visible page(one section) > > > Best regards > Benny Simonsen Hi Benny! That's very beautiful with fixed T.O.C! I have added a modified version of your patch (just the "className" part of it). The sections now reference their anchor HTML-Element in the TOC passed as an additional parameter in the constructor OrgNode (in the function `mkNodeFromHref()'). This might lead to problems in old Internet Explorers when leaving the page - but in old ones. I guess the cleanest way to add actions to org-info.js is to add hooks and use them this way (e.g. in the HTML section): #+STYLE: That's what I'm working at currently: Just gimme an hour. You can then hook in your LightBox function. Note: currently the names in sources and compressed scripts are different (see `sed.txt'). We should change that in the future for some widely used variables (like OrgNode.H <=3D> OrgNode.HEADING). Best wishes Sebastian