emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* html export: what do codehighlighton/off functions do?
@ 2015-11-12 16:27 Manuel Koell
  2015-11-12 17:02 ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel Koell @ 2015-11-12 16:27 UTC (permalink / raw)
  To: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 805 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1416 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: html export: what do codehighlighton/off functions do?
  2015-11-12 16:27 html export: what do codehighlighton/off functions do? Manuel Koell
@ 2015-11-12 17:02 ` Rasmus
  2015-11-13 19:55   ` Manuel Koell
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-11-12 17:02 UTC (permalink / raw)
  To: emacs-orgmode

Manuel Koell <man.koell@gmail.com> writes:

> 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.

It is used for "coderefs" links.  Example from unit tests:

#+BEGIN_SRC emacs-lisp
(+ 1 1)                  (ref:sc)
#+END_SRC
[[(sc)]]

It will highlight the appropriate line in the html export.

Are you asking us to remove the javascript conditionally on whether we
think it will be used?  This sounds hard.

You can remove the JS via the buffer option html-scripts or via
org-html-head-include-scripts.

Hope it helps,
Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: html export: what do codehighlighton/off functions do?
  2015-11-12 17:02 ` Rasmus
@ 2015-11-13 19:55   ` Manuel Koell
  2015-11-14  0:07     ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel Koell @ 2015-11-13 19:55 UTC (permalink / raw)
  To: Rasmus; +Cc: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]

Sorry, I didn't know such feature exists in org mode! It's just kinda
weird, these function still get called from onmouseover/onmouseout bindings.

2015-11-12 18:02 GMT+01:00 Rasmus <rasmus@gmx.us>:

> Manuel Koell <man.koell@gmail.com> writes:
>
> > 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.
>
> It is used for "coderefs" links.  Example from unit tests:
>
> #+BEGIN_SRC emacs-lisp
> (+ 1 1)                  (ref:sc)
> #+END_SRC
> [[(sc)]]
>
> It will highlight the appropriate line in the html export.
>
> Are you asking us to remove the javascript conditionally on whether we
> think it will be used?  This sounds hard.
>
> You can remove the JS via the buffer option html-scripts or via
> org-html-head-include-scripts.
>
> Hope it helps,
> Rasmus
>
> --
> I hear there's rumors on the, uh, Internets. . .
>
>
>

[-- Attachment #2: Type: text/html, Size: 2359 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: html export: what do codehighlighton/off functions do?
  2015-11-13 19:55   ` Manuel Koell
@ 2015-11-14  0:07     ` Rasmus
  2015-11-15 23:34       ` Manuel Koell
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-11-14  0:07 UTC (permalink / raw)
  To: man.koell; +Cc: emacs-orgmode

Manuel Koell <man.koell@gmail.com> writes:

> It's just kinda weird, these function still get called from
> onmouseover/onmouseout bindings.

What would you prefer?

Rasmus

-- 
I almost cut my hair, it happened just the other day

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: html export: what do codehighlighton/off functions do?
  2015-11-14  0:07     ` Rasmus
@ 2015-11-15 23:34       ` Manuel Koell
  2015-11-21 16:44         ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel Koell @ 2015-11-15 23:34 UTC (permalink / raw)
  To: Rasmus; +Cc: org-mode mailing list

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

document.querySelectorAll and addEventListener

2015-11-14 1:07 GMT+01:00 Rasmus <rasmus@gmx.us>:

> Manuel Koell <man.koell@gmail.com> writes:
>
> > It's just kinda weird, these function still get called from
> > onmouseover/onmouseout bindings.
>
> What would you prefer?
>
> Rasmus
>
> --
> I almost cut my hair, it happened just the other day
>

[-- Attachment #2: Type: text/html, Size: 812 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: html export: what do codehighlighton/off functions do?
  2015-11-15 23:34       ` Manuel Koell
@ 2015-11-21 16:44         ` Rasmus
  0 siblings, 0 replies; 6+ messages in thread
From: Rasmus @ 2015-11-21 16:44 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: man.koell

Manuel Koell <man.koell@gmail.com> writes:

> document.querySelectorAll and addEventListener

Do you want to provide a patch towards this?

Thanks,
Rasmus

-- 
There are known knowns; there are things we know that we know

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-21 16:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-12 16:27 html export: what do codehighlighton/off functions do? Manuel Koell
2015-11-12 17:02 ` Rasmus
2015-11-13 19:55   ` Manuel Koell
2015-11-14  0:07     ` Rasmus
2015-11-15 23:34       ` Manuel Koell
2015-11-21 16:44         ` Rasmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).