Ilya Shlyakhter ilya_...@alum.mit.edu writes:
It would be good if the HTML exporter had an option to create a web
page with two frames:
in the top frame would be the original exported HTML, and in the
bottom frame would display
the targets of all external links in the org file. Within-orgfile
links would still be shown in the
top frame. Then, the org file could serve as an index for organizing
a variety of information, and
one could browse the org file in the top frame and quickly see the
targets of external links
in the bottom frame, without having to switch tabs or windows in the browser.
There would be an option to have the index on the left, instead of on the top.
Hi Ilya,
here is a solution in JavaScript.
Adjust the line
#+STYLE: var targetFrame = otherFrame;
You could even receive the targetFrame as URL-Parameter.
#+STYLE: script type=text/javascript
#+STYLE: !--/*--![CDATA[/*!--*/
#+STYLE: function modifyExternalLinks()
#+STYLE: {
#+STYLE: if(null == document['body']) {
#+STYLE: window.setTimeout(modifyExternalLinks(), 250);
#+STYLE: return;
#+STYLE: }
#+STYLE: var targetFrame = otherFrame;
#+STYLE: var baseURL = document.URL;
#+STYLE: if( != location.hash)
#+STYLE: baseURL = baseURL.substring(0, baseURL.indexOf('#'));
#+STYLE: if( != location.search)
#+STYLE: baseURL = baseURL.substring(0, baseURL.indexOf('?'));
#+STYLE: var regx = new RegExp(^baseURL, gi);
#+STYLE: var links = document.getElementsByTagName(a);
#+STYLE: for(j=0; jlinks.length; ++j)
#+STYLE: {
#+STYLE: if(! links[j].href.match(regx))
#+STYLE: links[j].target = targetFrame;
#+STYLE: }
#+STYLE: }
#+STYLE: window.setTimeout(modifyExternalLinks(), 250);
#+STYLE: *]]*///--
#+STYLE: /script
HTH
Sebastian
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode