emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Some Javascript Adventures
@ 2009-05-12 11:42 Ian Barton
  2009-05-12 13:48 ` Sebastian Rose
  2009-05-12 14:03 ` Sebastian Rose
  0 siblings, 2 replies; 12+ messages in thread
From: Ian Barton @ 2009-05-12 11:42 UTC (permalink / raw)
  To: emacs-orgmode

Yesterday on my bike ride I was listening to an old FLOSS Podcast about 
jQuery. There are a few things that Sebastian's org-info-js doesn't do, 
that I would like. Unfortunately, my knowledge of javascript is almost zero.

However, the jQuery library seems to have excellent documentation. More 
importantly using jQuery seems to mostly protect you from trying to 
debug your code on lots of different browsers, since the jQuery author 
has already done it for you.

After some experiments I cam up with the following snippets which toggle 
the visibility of DONE tasks and also timestamps. Hope someone finds 
them useful!

Ian.

<script 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" 
type="text/javascript"></script>

<script type="text/javascript" >
<!--/*--><![CDATA[/*><!--*/

      $(document).ready(function(){

        $('#toggletimestamp').click(function() {
             $('span.timestamp-wrapper').toggle();
        });

        $('#toggledone').click(function() {
             myParent = $("span.done").parent();
             myParent.toggle();
        });
      });
/*]]>*/-->
</script>

You can set up a buttons to call these functions:

<input type="submit"
  name="toggletimestamp"
  value="Toggle Time Stamp"
  id="toggletimestamp" />

<input type="submit"
    name="toggledone"
    value="Toggle Done"
id="toggledone" />

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

end of thread, other threads:[~2009-05-15 11:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 11:42 Some Javascript Adventures Ian Barton
2009-05-12 13:48 ` Sebastian Rose
2009-05-12 13:49   ` Carsten Dominik
2009-05-12 15:51     ` Sebastian Rose
2009-05-13 12:07       ` Carsten Dominik
2009-05-12 14:03 ` Sebastian Rose
2009-05-13 13:57   ` Sebastian Rose
2009-05-14 12:14     ` Ian Barton
2009-05-15 11:17       ` Sebastian Rose
2009-05-14 12:19   ` Ian Barton
2009-05-14 12:30     ` Carsten Dominik
2009-05-14 18:50     ` Sebastian Rose

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