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
13 * 2010-11-24 Benny Simonsen Part 1
15 * classNames for T.O.C links to highlight the current page in the TOC.
18 Currently, names of OrgNode's and OrgHtmlManger's members are different in
19 plain and compressed versions of the script (see "sed.txt"). Should we
20 change that for some of them?
22 * 2010-09-01 --- t.TITLE
24 * Make sure the correct heading is used as the =org-html-manager.TITLE= property.
26 * Thanks to tgbit on http://github.com/tgbit for the hint.
28 * 2010-04-24 --- Valid CSS2 IDs
30 * Changed =org_html_manager::SID_REGEX= to match valid CSS-IDs. Dots are not
31 valid in IDs as of CSS 2 (see http://www.w3.org/TR/CSS2/grammar.html). The
32 regexp still supports the `old' style IDs we used to be backward
35 * =SECNUM_REGEX= was not in use. Removed.
37 * 2010-02-14 --- Title and #sec-1 in plain view, TOC anywhere
39 * Some corrections of indentation and obsolet comments.
41 * Show the title in plain view mode, if showing the first section.
43 * Make the initial scan work, even if the table of contents is somewhere else,
44 but on top of the page. Honor the =[TABLE-OF-CONTENTS]= setting in Org-mode
47 * Fix for different behaviour of Opera-10 when requesting a page with `#sec-1'
48 jump target (any jump target for a tall section actually). Pressing the
49 reload button caused Opera-10 to scroll the view to the sections heading in
54 * Chao Lu was right. The current behaviour of VIEW=content is not what the
55 documentation promises. This is now fixed, finally.
57 To open a section in `...html?VIEW=content' or `...html?VIEW=overview', one
58 has to explicitly request a section like this:
60 `http://orgmode.org/worg/code/org-info-js/index.html?VIEW=content#sec-1'
62 * Tags where not removed from local TOCs (sections with subsections). Fix
63 Regexp and use the right one.
65 * When loading a page with the `?VIEW=...' query parameters, navigating
66 changed the view mode to one hard coded in the <head> section of the
67 document, in case it were different. This is now fixed.
71 * Inhibit reloading the page on startup.
72 Fixes startup with `?VIEW=overview#sec-1'.
76 * Existing access-keys now use the same keys as the shortcuts do.
77 * When FIXED_TOC, re-focus the last link in the TOC when pressing `i'.
78 * Allow TAB to traverse the TOC.
82 * Jumping TOC. Seems fixed now (hopefully).
83 * Added `W' for printing. For printing, the whole document has to be in plain
84 view mode and expanded. Browsers print what's visible on screen only.
88 Show the version number below the shortcut table.
92 Bugfix for links nested in lists.
93 Thanks to Xin Shi for finding this and sending a testfile.
97 * Fix for start section.
98 I a section was removed and the *.org file was published again, we saw an
99 empty page when browsing to that old location (e.g. =xy.html#sec-11=). Now the
100 first section is shown instead.
106 * FIX: go to previous sibling, even if it's the first one.
108 * Removed some more unused stuff and fixed typos (=this.INPUT_FIELD=, =DEBUG=...).
110 * All names of regular expressions end in =_REGEX=.
112 * FIX: Altering the history lead to jumping of the page.
114 * Uppercase names everywehre. I want this to distinguish class fields from
115 functions and temporary variables. Stay YUI compressor friendly when we
116 shorten the names. Needed for the rest of the todays changes.
118 * Replaced =this.= by a local variable where possible. Decreased org-info.js
121 * Add a Makefile target for realy small org-info.js. This is not exactly
122 perfect, but decreases the resulting file by about 10 Kb.
124 * Added =hacking.org= to explain what happens here a bit.
126 * Reworked the Docs. Oha, I wonder how noone complained about that...
128 * FIX html tags in local toc.
132 + Manipulate the histories current location.
133 So if one clicks a link to an external file, the browser's `back' button
134 will bring the user back to the last section visited in the file.
136 + If one faces the internal histories end using `b' and `B', he may now go
137 back/forward in the browsers history by repeatedly pressing `b' and `B'
142 + Choose the human-readable IDs for links by regexp again.
143 + Fix the `g' command.
144 + Fix: still support old section IDs.
146 * 2009-04-21 - Org-mode 6.26
148 + New way to detect the IDs for sections. The script does not search for '#sec-'
149 anymore. Instead, the new human readable IDs are used as well.
151 To not break the old human readable IDs in anchors inside of headlines, those
154 + org-info.js is now minified without obfuscation. This decreases the filesize
159 + Fixed title. Title was not displayed in info-view-mode.
160 + Title above is now optiona. Append =\_title-above= to your view option, to
161 always leave the title alone:
162 =view:info\_title-above=
166 Org-mode v. 6.23, commit a68eb4b1e64cbe6e495fdd2c1eaf8ae597bf8602, introduced
167 a new <div> element around all the body's contents. You'll need at least the
168 changes from today (org-info.js v. 0.1.0.1) from now on.
170 org-info.js v. 0.1.0.1 is backward compatible with elder versions of
175 + Reuse the `ltoc' option for positioning the local toc. No local TOC stays
176 the default. If a local TOC is shown, it's below the first text in a section
177 by default. To display the local TOC above a sections text use
179 : org_html_manager.set("LOCAL_TOC", "above");
183 + Fixed footnotes and back again.
184 + You may now define, if the local TOC appears above or below the text of a
185 section that preceeds the first subsection. Simply use something like this
186 in the head of your HTML-files:
188 : org_html_manager.set("LTOC_BEFORE_TEXT", "0");
190 If not set, the local TOC is placed directly beneeth the section's
191 headline. The default is to place the local TOC beneeth the text.
193 + FIX: Avoid footnote-ref IDs in links to named sections.
197 + FIX: if non existent `#target', show the first section.
198 + FIX: finaly make named anchors work.
202 Look for the id attribute for anchors to make named anchors work in XHTML.
206 + Default for links created by the Script (`l' and `L') now use the first
207 named target for section if any. I.e. use =some.html#named= instead of
208 =some.html#sec-3.1.2= where ever possible. This was a suggestion of Carsten
213 + FIXED: named internal links in local TOC.
214 + FIXED: internal links were not working.
218 + Footnotes working. It's a bit durty but works.
219 Org-mode 6.12a required.
223 + *Toggle list items automatically* ::
224 No need to create several sections with redundant content. Now the script
225 handles exactly one plain list per section (the first one found)
226 specially. The list items are displayed one by one.
228 Fixed some errors there and added a seperate section for presentation.
233 Move back and forth by double click and click.
237 + *Footnotes now working* ::
238 Now =convertLinks()= converts footnote links too.
242 + *Wrap text before first headline in <p>* ::
243 If you use org-info.js, the text before first headline is now wrapped into
245 :<p id="text-before-first-headline"> text </p>
247 =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]].
248 + *Fixed appearance of 'HELP' link et al* ::
249 I.e. added href attribute instead of onclick.
253 + *Next and previous sibling* ::
254 Shortcuts: '=N=' and '=P='.
258 + Close the minibuffer, when reading ::
259 do this, when a link ('next'...) is clicked.
260 + Close help screen on ANY key press ::
261 ...not only if a printable key was pressed.
265 + Broken links for 'l' and 'L' ::
266 Thank's again to Carsten for reporting.
267 + Startup help is now optional ::
268 We have a little 'HELP' link now to click on.
272 + Any key to proceed ::
273 Now it's realy any key that shuts down the minibuffer.
274 + More hardcoded styles ::
275 ...to avoid a border around the input field in the minibuffer and too much
276 padding in the minibuffers =<td>= elements.
278 + Divide the script in sections ::
279 The script is now roughly devided in sections by form-feeds. Thus we can
280 move section wise using the common emacs commands for this purpos ('=M-x
281 ]=' and '=M-x ]='). This was done to ease editing of the script.
284 1. The comment block on top of the file.
285 2. Everything around =OrgNodes=.
286 3. =org_html_manager= constructor and setup.
287 4. =org_html_manager= folding and view related stuff.
288 5. =org_html_manager= history related methods.
289 6. =org_html_manager= minibuffer handling.
290 7. =org_html_manager= user input.
291 8. =org_html_manager= search functonality.
292 9. =org_html_manager= misc.
293 10. Global functions.
297 + Missing shortcuts in help ::
299 + Use two lines to be more verbose ::
300 Since the new read-mode, there are many occasions when you have to press RET
301 to close the minibuffer. Thus we should always have a parenthesis saying
302 '/press X to close/'.
303 + Implement the 'standard minibuffer' ::
304 A little bit more visible, two lines, a narrow gray border.
305 + Scroll to the very top for sec. 0 in plain view mode ::
306 Scrolling the NODE.div into view seemed unnatural.
307 + Standard height for minibuffer ::
308 This was done to hide and show the minibuffer quite correct.
309 + Reduce flicker after reading ::
310 =hideConsole()= is only called, if the result of the last read command does
311 not lead to an error. =showConsole()= looks, wether the the minibuffer is
316 + Stop searching empty strings.
317 + Use the local stylesheet again.
318 + Show a startup message ::
319 One out of many ideas from Carsten. This one is cutomizable. Use
320 =org_html_manager.set("STARTUP_MESSAGE", "0");= to inhibit.
324 + '=L=' and '=l=' use the new read mode ::
325 This means we may use =CTRL-c= to copy the link. Close the minibuffer
327 + '=L=' and '=l=' choose link type ::
328 If the search string is not empty, the visitor is prompted to choose
329 between a link to the current section or an 'occur' link.
331 :Carsten Dominik schrieb:
334 :> index.html still says that "l" shows the list of shortcuts. This is no
338 + Absolute path to stylesheet ::
339 Avoid missing stylesheet. Now this file links to the absolute URL.
340 + RET hides minibuffer ::
341 ...in every case now.
342 + 's RET' does the same as 'S' ::
343 One of the many good ideas of Carsten. \\
344 Implementation: if the search string has not changed, '=s=' and '=r=' move on
345 to the next/previous section. Else the current section is searched first.
346 + Clear the search highlight ::
347 If a new search/occur is started, the search highlight is cleared. It may
348 still be cleared by pressing '=c=' (clear).
349 + CSS styles renamed ::
350 All the style classes and IDs in use are renamed, to avoid clashing with
351 styles in other packages in Worg.git/code/*. All the styles are now
352 prefixed by =org-info-js_= (see [[CSS]]).
356 + Position of minibuffer ::
358 + Remove nested search highlight ::
359 If searching for /org/ and after that for /rg/, the highlight was not
360 removed when pressing '=c=' (clear search highlight). Fixed.
361 + Build regexp from user input ::
362 To be able to search for e.g. '>' and '<' these characters are replaced with
363 '=>=' and '=<=' respectively. It's now possible to search for the
364 following characters:
366 This is still a compromise since syntax highlighting is done using html
367 tags. Thus searching for '=<script=' will not work for passages wehre the
368 angle bracket has a different color than the word '=script='.
370 Press '=o=' to get prompted for a string to search. The document switches
371 to plain view mode and opens all sections containing the search
372 string. Matches will be highlighted. Neither connected to the navigation
373 history nor any special navigation so far. But you may walk through all
374 the occurences using '=S=' and '=R='.
375 + URL suffix for occur ::
376 See section Section [[*Linking to Files using the Script]] for an example.
378 Thanks to Carsten Dominik for the great org radio table trick and the new
383 This update introduced some changes concerning keyboard shortcuts.
385 *This one is not tested in IE yet!*
388 You may use '=s=' to search forward and '=r=' to search
389 backwards. These two prompt for input. To repeat the last search, use
390 '=S=' and '=R=' to search forward and backwards respectively.
391 Use '=c=' to remove all the match highlights.
396 Since '=s=' was the candidate for searching, it could no longer be used
397 for the /goto section/ command. This is now remapped to '=g=' (goto).
399 The minibuffer can be switched to read mode. Thus it may be used to read
400 input. No need for popup windows (=window.prompt()=) anymore.
404 + New Variable org-export-section-number-format ::
405 Adjusted the script to detect the IDs correctly for use with the new
406 OrgMode version 6.05 (the section number format can now be adjusted in
407 OrgMode via =org-export-section-number-format=). This Change is backward
409 + Display HTML links ::
410 '=l=' now displays a HTML link to the current section whereas '=L=' now
411 shows the OrgMode link. Thanks to Carsten for this idea.
415 + *T.O.C. fixed accidentally*
416 + Jump to link in sidebar ::
418 If =FIXED\_TOC= is set, '=i=' focusses the first link in the T.O.C. =TAB=
419 may be used to traverse the links.
423 + Docs where wrong ::
424 Still some outdated stuff here.
425 + Allow overwrites ::
426 Changed the code to explicitly allow a certain URL overwrite. Otherwise
427 visitors could overwrite any variable internally used by the
433 Now the user may call the script and pass options to overwrite the authors
434 settings using this syntax:
435 : http://localhost/index.html?TOC=0&VIEW=showall&MOUSE_HINT=rgb(255,133,0)
436 Some links for testing are provided in section [[Linking to Files using the Script]]
438 + Focus the T.O.C. ::
439 '=i=' tries to focus the T.O.C. if =FIXED_TOC= is ="1"=. This is still
440 very primitive. Just the first step. '=i=' simply focusses the first
441 anchor in the T.O.C. Tabindexes empower the user to run through the links
442 in the table of contents using the TAB key.
444 + FIX: Show Start Section ::
445 The start section (index.html#sec-X.Y) was not shown in plain view
446 mode. Now this section is always shown regardless of initial folding state
449 + FIX: Hitting '=u=' several times ::
450 Hitting '=u=' multiple times made the script focus the root node so that
451 '=n=' went to the first section. Fixed.
454 Trying a different technique to make IE handle the clicks on
455 headlines. Can't test this now in IE but don't want to forget the trick :)
460 '=l=' prints an Org link in the minibuffer for copying to an org
461 file. Currently it's only possible to copy the link using the mouse. A
462 change of this is on my TODO list.
466 + *New key to go to the first section* ::
467 Since '=i=' now shows the T.O.C. there was a shortcut missing to go to the
468 first section (which might as well be the T.O.C. if =#+INFOJS_OPT:
469 toc:t=). This key is now '=t=' or '=<='. For toggling the view mode, '=m=' is used
471 + *New key for last section* ::
472 '=E=' or '=>=' move to the last section.
474 To show the help screen one may use the '=¿=' key. The help-screen got
475 upated using '=¿=' now to avoid distorted displaying of this
477 + *org-info-info-navigation* ::
478 Style class for the navigation bar in info view mode.
480 Documentation reworked. Should be fairly uptodate now.
484 + *Removal of Minibuffer* ::
485 The minibuffer was not removed when unsing the mouse to navigate. Fixed.
490 '=n=' now unfolds the current section if folded when in plain view
491 mode. Thus the first section will be shown after startup in folded view.
492 + *Startup in info view mode* ::
493 This one was broken. Fixed.
497 + *OrgHtmlManager class* ::
498 No more OrgHtmlManager class anymore. Script uses the
499 :var org_html_manager = { property: value, /* ... */ };
500 syntax now. This was done to avoid inheritance and instantiation of more
501 than one OrgHtmlManager.
504 The displaying of Keyboard shortcuts now behaves like the (hidden)
505 TOC. I.e. keyboard shortcuts are displayed when pressing '=?=' and any
506 hidden again when pressing any key. The old view mode is restored when
507 hiding the help display.
509 + *Fixed: external links* ::
510 External links now work again.
514 + *Minibuffer Handling* ::
515 If the document is neither in info view mode nor displayed with a fixed
516 TOC, the minibuffer will be shown right above the current headline. This
517 is not the final fix for this, but a work around for the wrong IE
518 behaviout concerning /position:fixed/.
520 + *Keyboard Input on keypress* ::
521 The script now takes the =onkeypress= function to read user input. This is
522 more compatible then =onkeydown= or =onkeyup=. Thus the keys work now in
523 IE too (and the '?' key in Firefox). Holding the '=n=' key down for a
524 while can be used for fast searching.
526 + *Scrolling in IE* ::
527 ...is fixed. But it is not possible to scroll in IE if =FIXED_TOC= is on.
532 The option '=RUNS=' is dropped now. The =org_html_manager= now tries to
533 scan the document until it's entirely loaded. There is an internal limit
534 now set to some hundred runs which will makes a max. ~2 minute scan
539 These two changes where ideas of Carsten Dominik.
542 ...shows now subsections only.
544 Now the table of contents may be cutted to a certain depth. Navigation is
545 not affected. The name of the new =set()= option is '=TOC\_DEPTH='.
549 + *Overall history* ::
550 History now records all commands that change the current section.
551 + *Hide TOC but show when 'i' is pressed* ::
552 The TOC is now always shown, when '=i=' is pressed, even if hidden from
553 the document. The fun is, that each following navigation command triggers
554 a history-back event. This way the hidden TOC does not show up when moving
555 in the history thereafter. Hence now it's possible to read section 5.1,
556 take a short look in the TOC and the next '=n=', '=p=' or '=b=' command
557 takes you back to the section last visited (5.1 in this case).
561 - *Minibuffer fixed for IE* ::
562 It now appears and hides again. Thanks to Tobias Prinz for the trick with
567 + *Adjusted to new Setup*
568 Carsten Dominik added the new possibility to configure the script using
569 typical org syntax. Users may even use customize to set up the script
570 now. Names of options passed to the =set()= functions are now adjusted to
571 the ones we discussed. Internal variable names where changed to reflect
574 * TODO search my mails to figure out the correct date!!!
579 + *Fixed subindexes* ::
580 ...when using =HIDE\_TOC=. First section had no subindex in this case.
582 ...to close the window.
584 * << 2008-03-30 So >>
586 + Internal links working ::
587 Internal links are now converted to work with this script. The user has
588 to go back using the `=s=' key since the history is not
589 updated. Could Browsers understand this? Or is there a possibility to
590 catch the `/back/' button event?
591 + org-file.html#sec-x.y.z ::
592 is now working too. That is, http://path/to/org-file.html#sec-x.y.z makes
593 the script displaying that section in the configured view mode.
595 + Folding now on by default. ::
598 '=v=' and '=V=' now scroll the window by the visible height of the
599 document window. A little bit less though for better orientation.
601 + Deleted setup section using export options template ::
602 This one was not working. I'm not shure it ever was... but I think so. I
603 should look up this one in the documentation again.
605 + Plain view mode is default ::
608 - The view mode was dependend on the folding feature.
609 - When folding was of an error was shown when trying to fold.
613 + Clicking a headline makes it the current section ::
614 and thus the candidate for displaying in next info view and the point
615 from where 'next' and 'previous' work.
617 * << 2008-03-22 Sa >>
619 + TOC, title and global folding ::
620 The title was doubled in some cases. This should be fixed now. The TOC
621 is now a node as all the other sections to.
624 Some more work on this. There seems to be some locale related problem
625 concerning the keyboard input of a `?´ (help) in Firefox. Added a
626 workaround for this one, but probably only working here.
628 + *Documentation updated.*
631 now with indentation. This demonstrates the folding somewhat better.
634 The table of contents can now be hidden completely due to the new option
635 =HIDE_TOC=. Hence the documents have to be exported with T.O.C., but may
636 be displayed without it.
638 * << 2008-03-21 Fr >>
640 + Commands reworked ::
641 The '/minibuffer/' is now invisible by default. Commands can be entered
642 into the =document= itself. Still, the chars entered are appended to the
643 minibuffers contents, to keep the possibility to enter more complex
644 commands in the future. The minibuffer is still needed for commands to
647 + Section numbers are now read through =window.prompt()= ::
648 This was done to simplify the command interface code. Now the commands
649 entered are just one char in length.
651 + Global folding now working ::
652 There was not much to do left for this one to do.
654 * << 2008-03-13 Do >>
656 *Added new config options:*
659 May be set, to link to an other file, preferably the main index page. This
660 link will be displayed as
661 :<a href="LINK_UP">HOME</a>
662 Command: '=h=' - home
664 May be set, to link to an other file, preferably the main index page. This
665 link will be displayed as
666 :<a href="LINK_TO_MAIN">Up</a>
667 Command: '=H=' - HOME
669 This way we can link files into a tree, if all subdirectories in the
670 project follow the same conventions. Like containing some
671 =subdir/index.org= and a homepage somwhere else.
673 * << 2008-03-12 Mi >>
676 First attempt to get the global folding working. Hmm.
678 - '=?=' - show the little help screen.
679 - '=n=' - go to next section.
680 - '=p=' - go to previous section.
681 - '=i=' - go to Index.
682 - '=f=' - fold current section when in plain view mode.
683 - '=g=' - fold globally when in plain view mode.
684 - '=u=' - up to parent section.
685 - '=t=' - toggle view mode.
686 - '=v=' - scroll down.
689 * << 2008-03-11 Di >>
691 + Radical code cleanup. ::
692 Removed unused variables and functions. More secure, less
693 errorprone. This cood be even better.
694 + *Org mode like toggling of headlines now basically works.*
695 + Commands can be input through a little 'minibuffer' on top of the screen. ::
696 This needs some special style settings for IE (position fixed). I will
697 append a minimal stylesheet for this purpos the next days in this
698 documentation for copy and paste.
699 This is partially working. Implemented Commands are:
700 - '=help=' - show a little help screen. This done with =alert()= and
702 - '=t=' - toggle view mode.
703 - '=k=' - kill the /minibuffer/.
704 - '=N=' - where =N= is a section number: goto section =N=. This could be
705 working in both modes very easy, but currently also only in info view
707 + *Code relies now on next generation XHTML-Export format.*
708 + Some kind of rudimentary debugging system. ::
709 May be turned on bei seting config options:
710 :org_html_manager.set("WINDOW_BORDER", "true");
711 :org_html_manager.set("DEBUG", org_html_manager.DEBUG_FATAL);
712 + Better way of configuration for the enduser. Fault tolerant. No undefined ::
713 variables when scanning starts. The users my use the =set(key, value)=
714 function of the =OrgHtmlManger= class like this:
715 :org_html_manager.set ( "LOCAL_TOC", 0);
716 :org_html_manager.set ( "VIEW_BUTTONS", "true");
717 :org_html_manager.set ( "FOLDING", "true");
718 :org_html_manager.set ( "MOUSE_HINT", "underline");
719 :org_html_manager.set ( "CONSOLE", "true");
720 :org_html_manager.setup ();
721 + New configuration accepts these options ::
723 Create subindexes for sections containing sections.
724 - =INFO\_SWITCH\_ALWAYS= ::
725 Show the small '/toggle view/' link next to every Headline to toggle
726 the view easily without scrolling back to top of the page in plain
729 This is for the new folding. Turn it on. This will be the default when
730 the moving and toggling has an acceptable form.
732 I love this one. Accepts the keyword '=underline=' or any other
733 value. But if not '=underline=', it should be a valid value to set the
734 =background-color= in CSS. So preferebly something like
735 '=#eeeeee='. In plain view mode with toggle feature turned on the
736 headline with mouse in it will be either hightlighted, if you pass a
737 color, or underlined.
739 Display the /minibuffer/ on top of the screen. Turn this one on. It's
740 fun and you can kill it simply by pressing '=k='.
742 Set the initial view mode. Set to =org\_html\_manager.PLAIN\_VIEW= or
743 =org\_html\_manager.INFO\_VIEW=.
745 * COMMENT html style specifications
748 # org-export-html-style: "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" />"