From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Koell Subject: html export: what do codehighlighton/off functions do? Date: Thu, 12 Nov 2015 17:27:22 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c072010deb85905245a6ac0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwuic-0002A8-5A for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:27:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwuib-0005ah-5K for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:27:26 -0500 Received: from mail-yk0-x230.google.com ([2607:f8b0:4002:c07::230]:36614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwuia-0005Zi-Uv for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:27:25 -0500 Received: by ykdr82 with SMTP id r82so100368324ykd.3 for ; Thu, 12 Nov 2015 08:27:23 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list --94eb2c072010deb85905245a6ac0 Content-Type: text/plain; charset=UTF-8 Can someone please tell me what these functions do? ``` function CodeHighlightOn(elem, id) { var target = document.getElementById(id); if(null != target) { elem.cacheClassElem = elem.className; elem.cacheClassTarget = target.className; target.className = "code-highlighted"; elem.className = "code-highlighted"; } } function CodeHighlightOff(elem, id) { var target = document.getElementById(id); if(elem.cacheClassElem) elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) target.className = elem.cacheClassTarget; } ``` The only thing I could think of is to toggle some classes, but I can't seem to find some real world example out there. This javascript code is included on every export, doesn't matter if you've src/example blocks in your org file or not. Thanks --94eb2c072010deb85905245a6ac0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Can someone please tell me what these functions = do?

```
function CodeHighlightOn(elem, id=
)
 {
   var target =3D document.getElementById(id);
   if(null !=3D target) {
     elem.cacheClassElem =3D elem.className;
     elem.cacheClassTarget =3D target.className;
     target.className =3D "code-highlighted=
";
     elem.className   =3D "code-highlighted=
";
   }
 }
 function CodeHighlightOff(elem, id)
 {
   var target =3D document.getElementById(id);
   if(elem.cacheClassElem)
     elem.className =3D elem.cacheClassElem;
   if(elem.cacheClassTarget)
     target.className =3D elem.cacheClassTarget;
 }

```

The only thi= ng I could think of is to toggle some classes, but I can't seem to find= some real world example out there. This javascript code is included on eve= ry export, doesn't matter if you've src/example blocks in your org = file or not.

Thanks
--94eb2c072010deb85905245a6ac0--