[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] suggestion: HTML frames option
From: |
Sebastian Rose |
Subject: |
Re: [Orgmode] suggestion: HTML frames option |
Date: |
Wed, 05 May 2010 17:56:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Ilya Shlyakhter <address@hidden> 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; j<links.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