1 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
2 #+TITLE: ORG-INFO.JS: Changes
3 #+AUTHOR: Sebastian Rose
6 #+INFOJS_OPT: path:org-info.js
7 #+INFOJS_OPT: toc:nil localtoc:t view:info mouse:underline
8 #+INFOJS_OPT: up:http://orgmode.org/worg/
9 #+INFOJS_OPT: home:http://orgmode.org buttons:nil
14 Bugfix for links nested in lists.
15 Thanks to Xin Shi for finding this and sending a testfile.
19 * Fix for start section.
20 I a section was removed and the *.org file was published again, we saw an
21 empty page when browsing to that old location (e.g. =xy.html#sec-11=). Now the
22 first section is shown instead.
28 * FIX: go to previous sibling, even if it's the first one.
30 * Removed some more unused stuff and fixed typos (=this.INPUT_FIELD=, =DEBUG=...).
32 * All names of regular expressions end in =_REGEX=.
34 * FIX: Altering the history lead to jumping of the page.
36 * Uppercase names everywehre. I want this to distinguish class fields from
37 functions and temporary variables. Stay YUI compressor friendly when we
38 shorten the names. Needed for the rest of the todays changes.
40 * Replaced =this.= by a local variable where possible. Decreased org-info.js
43 * Add a Makefile target for realy small org-info.js. This is not exactly
44 perfect, but decreases the resulting file by about 10 Kb.
46 * Added =hacking.org= to explain what happens here a bit.
48 * Reworked the Docs. Oha, I wonder how noone complained about that...
50 * FIX html tags in local toc.
55 + Manipulate the histories current location.
56 So if one clicks a link to an external file, the browser's `back' button
57 will bring the user back to the last section visited in the file.
59 + If one faces the internal histories end using `b' and `B', he may now go
60 back/forward in the browsers history by repeatedly pressing `b' and `B'
67 + Choose the human-readable IDs for links by regexp again.
68 + Fix the `g' command.
69 + Fix: still support old section IDs.
71 * 2009-04-21 - Org-mode 6.26
73 + New way to detect the IDs for sections. The script does not search for '#sec-'
74 anymore. Instead, the new human readable IDs are used as well.
76 To not break the old human readable IDs in anchors inside of headlines, those
79 + org-info.js is now minified without obfuscation. This decreases the filesize
85 + Fixed title. Title was not displayed in info-view-mode.
86 + Title above is now optiona. Append =\_title-above= to your view option, to
87 always leave the title alone:
88 =view:info\_title-above=
92 Org-mode v. 6.23, commit a68eb4b1e64cbe6e495fdd2c1eaf8ae597bf8602, introduced
93 a new <div> element around all the body's contents. You'll need at least the
94 changes from today (org-info.js v. 0.1.0.1) from now on.
96 org-info.js v. 0.1.0.1 is backward compatible with elder versions of
101 + Reuse the `ltoc' option for positioning the local toc. No local TOC stays
102 the default. If a local TOC is shown, it's below the first text in a section
103 by default. To display the local TOC above a sections text use
105 : org_html_manager.set("LOCAL_TOC", "above");
109 + Fixed footnotes and back again.
110 + You may now define, if the local TOC appears above or below the text of a
111 section that preceeds the first subsection. Simply use something like this
112 in the head of your HTML-files:
114 : org_html_manager.set("LTOC_BEFORE_TEXT", "0");
116 If not set, the local TOC is placed directly beneeth the section's
117 headline. The default is to place the local TOC beneeth the text.
119 + FIX: Avoid footnote-ref IDs in links to named sections.
124 + FIX: if non existent `#target', show the first section.
125 + FIX: finaly make named anchors work.
129 Look for the id attribute for anchors to make named anchors work in XHTML.
133 + Default for links created by the Script (`l' and `L') now use the first
134 named target for section if any. I.e. use =some.html#named= instead of
135 =some.html#sec-3.1.2= where ever possible. This was a suggestion of Carsten
140 + FIXED: named internal links in local TOC.
141 + FIXED: internal links were not working.
145 + Footnotes working. It's a bit durty but works.
146 Org-mode 6.12a required.
150 + *Toggle list items automatically* ::
151 No need to create several sections with redundant content. Now the script
152 handles exactly one plain list per section (the first one found)
153 specially. The list items are displayed one by one.
155 Fixed some errors there and added a seperate section for presentation.
160 Move back and forth by double click and click.
164 + *Footnotes now working* ::
165 Now =convertLinks()= converts footnote links too.
169 + *Wrap text before first headline in <p>* ::
170 If you use org-info.js, the text before first headline is now wrapped into
172 :<p id="text-before-first-headline"> text </p>
174 =C= now shows an index based on tags. This was an [[http://lists.gnu.org/archive/html/emacs-orgmode/2008-07/msg00434.html][idea of Rick Moynihan]].
175 + *Fixed appearance of 'HELP' link et al* ::
176 I.e. added href attribute instead of onclick.
180 + *Next and previous sibling* ::
181 Shortcuts: '=N=' and '=P='.
185 + Close the minibuffer, when reading ::
186 do this, when a link ('next'...) is clicked.
187 + Close help screen on ANY key press ::
188 ...not only if a printable key was pressed.
192 + Broken links for 'l' and 'L' ::
193 Thank's again to Carsten for reporting.
194 + Startup help is now optional ::
195 We have a little 'HELP' link now to click on.
199 + Any key to proceed ::
200 Now it's realy any key that shuts down the minibuffer.
201 + More hardcoded styles ::
202 ...to avoid a border around the input field in the minibuffer and too much
203 padding in the minibuffers =<td>= elements.
205 + Divide the script in sections ::
206 The script is now roughly devided in sections by form-feeds. Thus we can
207 move section wise using the common emacs commands for this purpos ('=M-x
208 ]=' and '=M-x ]='). This was done to ease editing of the script.
211 1. The comment block on top of the file.
212 2. Everything around =OrgNodes=.
213 3. =org_html_manager= constructor and setup.
214 4. =org_html_manager= folding and view related stuff.
215 5. =org_html_manager= history related methods.
216 6. =org_html_manager= minibuffer handling.
217 7. =org_html_manager= user input.
218 8. =org_html_manager= search functonality.
219 9. =org_html_manager= misc.
220 10. Global functions.
224 + Missing shortcuts in help ::
226 + Use two lines to be more verbose ::
227 Since the new read-mode, there are many occasions when you have to press RET
228 to close the minibuffer. Thus we should always have a parenthesis saying
229 '/press X to close/'.
230 + Implement the 'standard minibuffer' ::
231 A little bit more visible, two lines, a narrow gray border.
232 + Scroll to the very top for sec. 0 in plain view mode ::
233 Scrolling the NODE.div into view seemed unnatural.
234 + Standard height for minibuffer ::
235 This was done to hide and show the minibuffer quite correct.
236 + Reduce flicker after reading ::
237 =hideConsole()= is only called, if the result of the last read command does
238 not lead to an error. =showConsole()= looks, wether the the minibuffer is
243 + Stop searching empty strings.
244 + Use the local stylesheet again.
245 + Show a startup message ::
246 One out of many ideas from Carsten. This one is cutomizable. Use
247 =org_html_manager.set("STARTUP_MESSAGE", "0");= to inhibit.
251 + '=L=' and '=l=' use the new read mode ::
252 This means we may use =CTRL-c= to copy the link. Close the minibuffer
254 + '=L=' and '=l=' choose link type ::
255 If the search string is not empty, the visitor is prompted to choose
256 between a link to the current section or an 'occur' link.
258 :Carsten Dominik schrieb:
261 :> index.html still says that "l" shows the list of shortcuts. This is no
265 + Absolute path to stylesheet ::
266 Avoid missing stylesheet. Now this file links to the absolute URL.
267 + RET hides minibuffer ::
268 ...in every case now.
269 + 's RET' does the same as 'S' ::
270 One of the many good ideas of Carsten. \\
271 Implementation: if the search string has not changed, '=s=' and '=r=' move on
272 to the next/previous section. Else the current section is searched first.
273 + Clear the search highlight ::
274 If a new search/occur is started, the search highlight is cleared. It may
275 still be cleared by pressing '=c=' (clear).
276 + CSS styles renamed ::
277 All the style classes and IDs in use are renamed, to avoid clashing with
278 styles in other packages in Worg.git/code/*. All the styles are now
279 prefixed by =org-info-js_= (see [[CSS]]).
283 + Position of minibuffer ::
285 + Remove nested search highlight ::
286 If searching for /org/ and after that for /rg/, the highlight was not
287 removed when pressing '=c=' (clear search highlight). Fixed.
288 + Build regexp from user input ::
289 To be able to search for e.g. '>' and '<' these characters are replaced with
290 '=>=' and '=<=' respectively. It's now possible to search for the
291 following characters:
293 This is still a compromise since syntax highlighting is done using html
294 tags. Thus searching for '=<script=' will not work for passages wehre the
295 angle bracket has a different color than the word '=script='.
297 Press '=o=' to get prompted for a string to search. The document switches
298 to plain view mode and opens all sections containing the search
299 string. Matches will be highlighted. Neither connected to the navigation
300 history nor any special navigation so far. But you may walk through all
301 the occurences using '=S=' and '=R='.
302 + URL suffix for occur ::
303 See section Section [[*Linking to Files using the Script]] for an example.
305 Thanks to Carsten Dominik for the great org radio table trick and the new
310 This update introduced some changes concerning keyboard shortcuts.
312 *This one is not tested in IE yet!*
315 You may use '=s=' to search forward and '=r=' to search
316 backwards. These two prompt for input. To repeat the last search, use
317 '=S=' and '=R=' to search forward and backwards respectively.
318 Use '=c=' to remove all the match highlights.
323 Since '=s=' was the candidate for searching, it could no longer be used
324 for the /goto section/ command. This is now remapped to '=g=' (goto).
326 The minibuffer can be switched to read mode. Thus it may be used to read
327 input. No need for popup windows (=window.prompt()=) anymore.
331 + New Variable org-export-section-number-format ::
332 Adjusted the script to detect the IDs correctly for use with the new
333 OrgMode version 6.05 (the section number format can now be adjusted in
334 OrgMode via =org-export-section-number-format=). This Change is backward
336 + Display HTML links ::
337 '=l=' now displays a HTML link to the current section whereas '=L=' now
338 shows the OrgMode link. Thanks to Carsten for this idea.
342 + *T.O.C. fixed accidentally*
343 + Jump to link in sidebar ::
345 If =FIXED\_TOC= is set, '=i=' focusses the first link in the T.O.C. =TAB=
346 may be used to traverse the links.
350 + Docs where wrong ::
351 Still some outdated stuff here.
352 + Allow overwrites ::
353 Changed the code to explicitly allow a certain URL overwrite. Otherwise
354 visitors could overwrite any variable internally used by the
360 Now the user may call the script and pass options to overwrite the authors
361 settings using this syntax:
362 : http://localhost/index.html?TOC=0&VIEW=showall&MOUSE_HINT=rgb(255,133,0)
363 Some links for testing are provided in section [[Linking to Files using the Script]]
365 + Focus the T.O.C. ::
366 '=i=' tries to focus the T.O.C. if =FIXED_TOC= is ="1"=. This is still
367 very primitive. Just the first step. '=i=' simply focusses the first
368 anchor in the T.O.C. Tabindexes empower the user to run through the links
369 in the table of contents using the TAB key.
371 + FIX: Show Start Section ::
372 The start section (index.html#sec-X.Y) was not shown in plain view
373 mode. Now this section is always shown regardless of initial folding state
376 + FIX: Hitting '=u=' several times ::
377 Hitting '=u=' multiple times made the script focus the root node so that
378 '=n=' went to the first section. Fixed.
381 Trying a different technique to make IE handle the clicks on
382 headlines. Can't test this now in IE but don't want to forget the trick :)
387 '=l=' prints an Org link in the minibuffer for copying to an org
388 file. Currently it's only possible to copy the link using the mouse. A
389 change of this is on my TODO list.
393 + *New key to go to the first section* ::
394 Since '=i=' now shows the T.O.C. there was a shortcut missing to go to the
395 first section (which might as well be the T.O.C. if =#+INFOJS_OPT:
396 toc:t=). This key is now '=t=' or '=<='. For toggling the view mode, '=m=' is used
398 + *New key for last section* ::
399 '=E=' or '=>=' move to the last section.
401 To show the help screen one may use the '=ยฟ=' key. The help-screen got
402 upated using '=¿=' now to avoid distorted displaying of this
404 + *org-info-info-navigation* ::
405 Style class for the navigation bar in info view mode.
407 Documentation reworked. Should be fairly uptodate now.
411 + *Removal of Minibuffer* ::
412 The minibuffer was not removed when unsing the mouse to navigate. Fixed.
417 '=n=' now unfolds the current section if folded when in plain view
418 mode. Thus the first section will be shown after startup in folded view.
419 + *Startup in info view mode* ::
420 This one was broken. Fixed.
424 + *OrgHtmlManager class* ::
425 No more OrgHtmlManager class anymore. Script uses the
426 :var org_html_manager = { property: value, /* ... */ };
427 syntax now. This was done to avoid inheritance and instantiation of more
428 than one OrgHtmlManager.
431 The displaying of Keyboard shortcuts now behaves like the (hidden)
432 TOC. I.e. keyboard shortcuts are displayed when pressing '=?=' and any
433 hidden again when pressing any key. The old view mode is restored when
434 hiding the help display.
436 + *Fixed: external links* ::
437 External links now work again.
441 + *Minibuffer Handling* ::
442 If the document is neither in info view mode nor displayed with a fixed
443 TOC, the minibuffer will be shown right above the current headline. This
444 is not the final fix for this, but a work around for the wrong IE
445 behaviout concerning /position:fixed/.
447 + *Keyboard Input on keypress* ::
448 The script now takes the =onkeypress= function to read user input. This is
449 more compatible then =onkeydown= or =onkeyup=. Thus the keys work now in
450 IE too (and the '?' key in Firefox). Holding the '=n=' key down for a
451 while can be used for fast searching.
453 + *Scrolling in IE* ::
454 ...is fixed. But it is not possible to scroll in IE if =FIXED_TOC= is on.
459 The option '=RUNS=' is dropped now. The =org_html_manager= now tries to
460 scan the document until it's entirely loaded. There is an internal limit
461 now set to some hundred runs which will makes a max. ~2 minute scan
466 These two changes where ideas of Carsten Dominik.
469 ...shows now subsections only.
471 Now the table of contents may be cutted to a certain depth. Navigation is
472 not affected. The name of the new =set()= option is '=TOC\_DEPTH='.
476 + *Overall history* ::
477 History now records all commands that change the current section.
478 + *Hide TOC but show when 'i' is pressed* ::
479 The TOC is now always shown, when '=i=' is pressed, even if hidden from
480 the document. The fun is, that each following navigation command triggers
481 a history-back event. This way the hidden TOC does not show up when moving
482 in the history thereafter. Hence now it's possible to read section 5.1,
483 take a short look in the TOC and the next '=n=', '=p=' or '=b=' command
484 takes you back to the section last visited (5.1 in this case).
488 - *Minibuffer fixed for IE* ::
489 It now appears and hides again. Thanks to Tobias Prinz for the trick with
494 + *Adjusted to new Setup*
495 Carsten Dominik added the new possibility to configure the script using
496 typical org syntax. Users may even use customize to set up the script
497 now. Names of options passed to the =set()= functions are now adjusted to
498 the ones we discussed. Internal variable names where changed to reflect
501 * TODO search my mails to figure out the correct date!!!
506 + *Fixed subindexes* ::
507 ...when using =HIDE\_TOC=. First section had no subindex in this case.
509 ...to close the window.
511 * << 2008-03-30 So >>
513 + Internal links working ::
514 Internal links are now converted to work with this script. The user has
515 to go back using the `=s=' key since the history is not
516 updated. Could Browsers understand this? Or is there a possibility to
517 catch the `/back/' button event?
518 + org-file.html#sec-x.y.z ::
519 is now working too. That is, http://path/to/org-file.html#sec-x.y.z makes
520 the script displaying that section in the configured view mode.
522 + Folding now on by default. ::
525 '=v=' and '=V=' now scroll the window by the visible height of the
526 document window. A little bit less though for better orientation.
528 + Deleted setup section using export options template ::
529 This one was not working. I'm not shure it ever was... but I think so. I
530 should look up this one in the documentation again.
532 + Plain view mode is default ::
535 - The view mode was dependend on the folding feature.
536 - When folding was of an error was shown when trying to fold.
540 + Clicking a headline makes it the current section ::
541 and thus the candidate for displaying in next info view and the point
542 from where 'next' and 'previous' work.
544 * << 2008-03-22 Sa >>
546 + TOC, title and global folding ::
547 The title was doubled in some cases. This should be fixed now. The TOC
548 is now a node as all the other sections to.
551 Some more work on this. There seems to be some locale related problem
552 concerning the keyboard input of a `?ยด (help) in Firefox. Added a
553 workaround for this one, but probably only working here.
555 + *Documentation updated.*
558 now with indentation. This demonstrates the folding somewhat better.
561 The table of contents can now be hidden completely due to the new option
562 =HIDE_TOC=. Hence the documents have to be exported with T.O.C., but may
563 be displayed without it.
565 * << 2008-03-21 Fr >>
567 + Commands reworked ::
568 The '/minibuffer/' is now invisible by default. Commands can be entered
569 into the =document= itself. Still, the chars entered are appended to the
570 minibuffers contents, to keep the possibility to enter more complex
571 commands in the future. The minibuffer is still needed for commands to
574 + Section numbers are now read through =window.prompt()= ::
575 This was done to simplify the command interface code. Now the commands
576 entered are just one char in length.
578 + Global folding now working ::
579 There was not much to do left for this one to do.
581 * << 2008-03-13 Do >>
583 *Added new config options:*
586 May be set, to link to an other file, preferably the main index page. This
587 link will be displayed as
588 :<a href="LINK_UP">HOME</a>
589 Command: '=h=' - home
591 May be set, to link to an other file, preferably the main index page. This
592 link will be displayed as
593 :<a href="LINK_TO_MAIN">Up</a>
594 Command: '=H=' - HOME
596 This way we can link files into a tree, if all subdirectories in the
597 project follow the same conventions. Like containing some
598 =subdir/index.org= and a homepage somwhere else.
600 * << 2008-03-12 Mi >>
603 First attempt to get the global folding working. Hmm.
605 - '=?=' - show the little help screen.
606 - '=n=' - go to next section.
607 - '=p=' - go to previous section.
608 - '=i=' - go to Index.
609 - '=f=' - fold current section when in plain view mode.
610 - '=g=' - fold globally when in plain view mode.
611 - '=u=' - up to parent section.
612 - '=t=' - toggle view mode.
613 - '=v=' - scroll down.
616 * << 2008-03-11 Di >>
618 + Radical code cleanup. ::
619 Removed unused variables and functions. More secure, less
620 errorprone. This cood be even better.
621 + *Org mode like toggling of headlines now basically works.*
622 + Commands can be input through a little 'minibuffer' on top of the screen. ::
623 This needs some special style settings for IE (position fixed). I will
624 append a minimal stylesheet for this purpos the next days in this
625 documentation for copy and paste.
626 This is partially working. Implemented Commands are:
627 - '=help=' - show a little help screen. This done with =alert()= and
629 - '=t=' - toggle view mode.
630 - '=k=' - kill the /minibuffer/.
631 - '=N=' - where =N= is a section number: goto section =N=. This could be
632 working in both modes very easy, but currently also only in info view
634 + *Code relies now on next generation XHTML-Export format.*
635 + Some kind of rudimentary debugging system. ::
636 May be turned on bei seting config options:
637 :org_html_manager.set("WINDOW_BORDER", "true");
638 :org_html_manager.set("DEBUG", org_html_manager.DEBUG_FATAL);
639 + Better way of configuration for the enduser. Fault tolerant. No undefined ::
640 variables when scanning starts. The users my use the =set(key, value)=
641 function of the =OrgHtmlManger= class like this:
642 :org_html_manager.set ( "LOCAL_TOC", 0);
643 :org_html_manager.set ( "VIEW_BUTTONS", "true");
644 :org_html_manager.set ( "FOLDING", "true");
645 :org_html_manager.set ( "MOUSE_HINT", "underline");
646 :org_html_manager.set ( "CONSOLE", "true");
647 :org_html_manager.setup ();
648 + New configuration accepts these options ::
650 Create subindexes for sections containing sections.
651 - =INFO\_SWITCH\_ALWAYS= ::
652 Show the small '/toggle view/' link next to every Headline to toggle
653 the view easily without scrolling back to top of the page in plain
656 This is for the new folding. Turn it on. This will be the default when
657 the moving and toggling has an acceptable form.
659 I love this one. Accepts the keyword '=underline=' or any other
660 value. But if not '=underline=', it should be a valid value to set the
661 =background-color= in CSS. So preferebly something like
662 '=#eeeeee='. In plain view mode with toggle feature turned on the
663 headline with mouse in it will be either hightlighted, if you pass a
664 color, or underlined.
666 Display the /minibuffer/ on top of the screen. Turn this one on. It's
667 fun and you can kill it simply by pressing '=k='.
669 Set the initial view mode. Set to =org\_html\_manager.PLAIN\_VIEW= or
670 =org\_html\_manager.INFO\_VIEW=.
672 * COMMENT html style specifications
675 # org-export-html-style: "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" />"