[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Some Javascript Adventures
From: |
Sebastian Rose |
Subject: |
Re: [Orgmode] Some Javascript Adventures |
Date: |
Tue, 12 May 2009 16:03:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) |
And this is, how you need to do it, if you have the sitemap included:
=> --->8----------------------------->8----------------------------->8---
#+STYLE: <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
#+STYLE: <script type="text/javascript">
#+STYLE: <!--/*--><![CDATA[/*><!--*/
#+STYLE: $(document).ready(
#+STYLE: function(){
#+STYLE: $("#text-1 ul").eq(0).find("li").each(
#+STYLE: function(){if($(this).children().eq(0)){
#+STYLE: $(this).css({cursor: "pointer"});
#+STYLE: $(this).bind(
#+STYLE: "click",
#+STYLE: function(){
#+STYLE: if($(this).children().eq(0).is(":visible"))
$(this).children().eq(0).slideUp(250);
#+STYLE: else $(this).children().eq(0).slideDown(250);
#+STYLE: return false;});}});
#+STYLE: $("#text-1 ul").eq(0).find("ul").hide();
#+STYLE: });
#+STYLE: /*]]>*///-->
#+STYLE: </script>
* Sitemap
#+INCLUDE sitemap.org
<= ---8<-----------------------------8<-----------------------------8<---
Ian Barton <address@hidden> writes:
> 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" />
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>