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

* Re: Some Javascript Adventures
  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 14:03 ` Sebastian Rose
  1 sibling, 1 reply; 12+ messages in thread
From: Sebastian Rose @ 2009-05-12 13:48 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode


jQuery is  _the_ JS framework :-)
I use it all the time here...


I have this in my Sitemap:

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
 <!--/*--><![CDATA[/*><!--*/
var doMenu = true;
$(document).ready(
  function(){
  $("ul").eq(0).find("li").each(
    function(){if($(this).children().eq(0)){
      $(this).css({cursor: "pointer"});
      $(this).bind(
        "click",
        function(){
          if($(this).children().eq(0).is(":visible")) $(this).children().eq(0).slideUp(250);
          else $(this).children().eq(0).slideDown(250);
          return false;});}});
  $("ul").eq(0).find("ul").hide();
});




Ian Barton <lists@manor-farm.org> 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" />
>

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

* Re: Some Javascript Adventures
  2009-05-12 13:48 ` Sebastian Rose
@ 2009-05-12 13:49   ` Carsten Dominik
  2009-05-12 15:51     ` Sebastian Rose
  0 siblings, 1 reply; 12+ messages in thread
From: Carsten Dominik @ 2009-05-12 13:49 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode


On May 12, 2009, at 3:48 PM, Sebastian Rose wrote:

>
> jQuery is  _the_ JS framework :-)
> I use it all the time here...
>
>
> I have this in my Sitemap:
>
> <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
> <script type="text/javascript">
> <!--/*--><![CDATA[/*><!--*/
> var doMenu = true;
> $(document).ready(
>  function(){
>  $("ul").eq(0).find("li").each(
>    function(){if($(this).children().eq(0)){
>      $(this).css({cursor: "pointer"});
>      $(this).bind(
>        "click",
>        function(){
>          if($(this).children().eq(0).is(":visible")) $ 
> (this).children().eq(0).slideUp(250);
>          else $(this).children().eq(0).slideDown(250);
>          return false;});}});
>  $("ul").eq(0).find("ul").hide();
> });

What does this code do?  Just curious....

- Carsten


>
>
>
>
> Ian Barton <lists@manor-farm.org> 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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Some Javascript Adventures
  2009-05-12 11:42 Some Javascript Adventures Ian Barton
  2009-05-12 13:48 ` Sebastian Rose
@ 2009-05-12 14:03 ` Sebastian Rose
  2009-05-13 13:57   ` Sebastian Rose
  2009-05-14 12:19   ` Ian Barton
  1 sibling, 2 replies; 12+ messages in thread
From: Sebastian Rose @ 2009-05-12 14:03 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode

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 <lists@manor-farm.org> 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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

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

* Re: Some Javascript Adventures
  2009-05-12 13:49   ` Carsten Dominik
@ 2009-05-12 15:51     ` Sebastian Rose
  2009-05-13 12:07       ` Carsten Dominik
  0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Rose @ 2009-05-12 15:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode



If your Sitmap looks like this normaly:


  * Folder 1
    - item 1.1
    - item 1.2
    * folder 1.1
      - file 1.1.1
    * folder 1.2
      - file 1.2.1
  * Folder 2
    - item 2.1
    - item 2.2

It collapses all, but the top folders on startup:


  * Folder 1
  * Folder 2


Each folder can be clicked, to expand and collapse from now on.


To do this with each TOC, just use another CSS selector in the jQuery
code: 



 <!--/*--><![CDATA[/*><!--*/
 $(document).ready(
  function(){
  $("#text-table-of-contents ul").eq(0).find("li").each(

 //      ^--- and here

    function(){if($(this).children().eq(0)){
      $(this).css({cursor: "pointer"});
      $(this).bind(
        "click",
        function(){
          if($(this).children().eq(0).is(":visible")) $
 (this).children().eq(0).slideUp(250);
          else $(this).children().eq(0).slideDown(250);
          return false;});}});
  $("#text-table-of-contents ul").eq(0).find("ul").hide();

 //      ^--- and here

 });


If you use correct styles, you could even create a horizontal menubar
with dropdown menus from this.



Best


   Sebastian



Carsten Dominik <carsten.dominik@gmail.com> writes:
> On May 12, 2009, at 3:48 PM, Sebastian Rose wrote:
>
>>
>> jQuery is  _the_ JS framework :-)
>> I use it all the time here...
>>
>>
>> I have this in my Sitemap:
>>
>> <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
>> <script type="text/javascript">
>> <!--/*--><![CDATA[/*><!--*/
>> var doMenu = true;
>> $(document).ready(
>>  function(){
>>  $("ul").eq(0).find("li").each(
>>    function(){if($(this).children().eq(0)){
>>      $(this).css({cursor: "pointer"});
>>      $(this).bind(
>>        "click",
>>        function(){
>>          if($(this).children().eq(0).is(":visible")) $
>> (this).children().eq(0).slideUp(250);
>>          else $(this).children().eq(0).slideDown(250);
>>          return false;});}});
>>  $("ul").eq(0).find("ul").hide();
>> });
>
> What does this code do?  Just curious....
>
> - Carsten
>
>
>>
>>
>>
>>
>> Ian Barton <lists@manor-farm.org> 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.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Some Javascript Adventures
  2009-05-12 15:51     ` Sebastian Rose
@ 2009-05-13 12:07       ` Carsten Dominik
  0 siblings, 0 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-05-13 12:07 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

That is pretty cool, thanks.

- Carsten

On May 12, 2009, at 5:51 PM, Sebastian Rose wrote:

>
>
> If your Sitmap looks like this normaly:
>
>
>  * Folder 1
>    - item 1.1
>    - item 1.2
>    * folder 1.1
>      - file 1.1.1
>    * folder 1.2
>      - file 1.2.1
>  * Folder 2
>    - item 2.1
>    - item 2.2
>
> It collapses all, but the top folders on startup:
>
>
>  * Folder 1
>  * Folder 2
>
>
> Each folder can be clicked, to expand and collapse from now on.
>
>
> To do this with each TOC, just use another CSS selector in the jQuery
> code:
>
>
>
> <!--/*--><![CDATA[/*><!--*/
> $(document).ready(
>  function(){
>  $("#text-table-of-contents ul").eq(0).find("li").each(
>
> //      ^--- and here
>
>    function(){if($(this).children().eq(0)){
>      $(this).css({cursor: "pointer"});
>      $(this).bind(
>        "click",
>        function(){
>          if($(this).children().eq(0).is(":visible")) $
> (this).children().eq(0).slideUp(250);
>          else $(this).children().eq(0).slideDown(250);
>          return false;});}});
>  $("#text-table-of-contents ul").eq(0).find("ul").hide();
>
> //      ^--- and here
>
> });
>
>
> If you use correct styles, you could even create a horizontal menubar
> with dropdown menus from this.
>
>
>
> Best
>
>
>   Sebastian
>
>
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> On May 12, 2009, at 3:48 PM, Sebastian Rose wrote:
>>
>>>
>>> jQuery is  _the_ JS framework :-)
>>> I use it all the time here...
>>>
>>>
>>> I have this in my Sitemap:
>>>
>>> <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
>>> <script type="text/javascript">
>>> <!--/*--><![CDATA[/*><!--*/
>>> var doMenu = true;
>>> $(document).ready(
>>> function(){
>>> $("ul").eq(0).find("li").each(
>>>   function(){if($(this).children().eq(0)){
>>>     $(this).css({cursor: "pointer"});
>>>     $(this).bind(
>>>       "click",
>>>       function(){
>>>         if($(this).children().eq(0).is(":visible")) $
>>> (this).children().eq(0).slideUp(250);
>>>         else $(this).children().eq(0).slideDown(250);
>>>         return false;});}});
>>> $("ul").eq(0).find("ul").hide();
>>> });
>>
>> What does this code do?  Just curious....
>>
>> - Carsten
>>
>>
>>>
>>>
>>>
>>>
>>> Ian Barton <lists@manor-farm.org> 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.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Some Javascript Adventures
  2009-05-12 14:03 ` Sebastian Rose
@ 2009-05-13 13:57   ` Sebastian Rose
  2009-05-14 12:14     ` Ian Barton
  2009-05-14 12:19   ` Ian Barton
  1 sibling, 1 reply; 12+ messages in thread
From: Sebastian Rose @ 2009-05-13 13:57 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode

> => --->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;});}});


Add this line here:

#+STYLE:   $("#text-1 ul").eq(0).find("a").bind("click", function(){document.location.href=$(this).attr('href');return false;});


> #+STYLE:   $("#text-1 ul").eq(0).find("ul").hide();
> #+STYLE: });
> #+STYLE: /*]]>*///-->
> #+STYLE: </script>
>
>
> * Sitemap
> #+INCLUDE sitemap.org
>
> <= ---8<-----------------------------8<-----------------------------8<---
>




Unfortunately, it's tricky to get jQuery to work in Opera together with
org-info.js (org-info.js works, jQuery doesn't :) ).
Even in Firefox, if you place the jQuery stuff below the org-info.js
stuff, it stops working.

We should realy create a jQuery version of org-info.js...



   Sebastian

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

* Re: Some Javascript Adventures
  2009-05-13 13:57   ` Sebastian Rose
@ 2009-05-14 12:14     ` Ian Barton
  2009-05-15 11:17       ` Sebastian Rose
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Barton @ 2009-05-14 12:14 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]


> Unfortunately, it's tricky to get jQuery to work in Opera together with
> org-info.js (org-info.js works, jQuery doesn't :) ).
> Even in Firefox, if you place the jQuery stuff below the org-info.js
> stuff, it stops working.
> 
> We should realy create a jQuery version of org-info.js...
> 
> 
Thanks for the tip about the sitemap. Ihad wondered about trying to 
create a jQuery version, but I need to do a lot more learning first!

Attached is a patch that fixes a mis-spelling in org-info.js.

Ian.


[-- Attachment #2: org-info-src.diff --]
[-- Type: text/x-patch, Size: 2432 bytes --]

diff --git a/code/org-info-js/org-info-src.js b/code/org-info-js/org-info-src.js
index fe73ef1..2e1d4bb 100644
--- a/code/org-info-js/org-info-src.js
+++ b/code/org-info-js/org-info-src.js
@@ -71,7 +71,7 @@ function OrgNode ( _div, _heading, _link, _depth, _parent, _base_id)
   this.link = _link;
   this.hasHighlight = false;              // Node highlighted (search)
   this.parent = _parent;
-  this.durty = false;                     // Node is durty, when children get
+  this.dirty = false;                     // Node is dirty, when children get
                                           // folded seperatly.
   this.state = OrgNode.STATE_FOLDED;
   this.depth = _depth;                    // The Rootelement will have
@@ -250,7 +250,7 @@ OrgNode.prototype.hideAllChildren = function ()
 
 /**
  * This one is called onclick() to toggle the folding state of the node.
- * This one sets it's parent durty, since node is folded individually. Hence the
+ * This one sets it's parent dirty, since node is folded individually. Hence the
  * next folding of parent has to collapse all.
  * @param show_childrens_folders Boolean. This is only used for the special way
  * of toggling of the ROOT element. If true, prevents this OrgNode from showing
@@ -259,9 +259,9 @@ OrgNode.prototype.hideAllChildren = function ()
 OrgNode.prototype.fold = function (hide_folder)
 {
   if(this.parent)
-    this.parent.durty = true;
-  if(this.durty) {
-    this.durty = false;
+    this.parent.dirty = true;
+  if(this.dirty) {
+    this.dirty = false;
     this.state = OrgNode.STATE_UNFOLDED; // so next state is FOLDED. See below.
   }
 
@@ -1200,7 +1200,7 @@ var org_html_manager = {
 
   toggleGlobaly: function ()
   {
-    if(this.ROOT.durty) {
+    if(this.ROOT.dirty) {
       this.ROOT.state = OrgNode.STATE_UNFOLDED;
     }
 
@@ -1224,8 +1224,8 @@ var org_html_manager = {
       this.ROOT.state = OrgNode.STATE_UNFOLDED;
     }
 
-    // All this sets ROOT durty again. So clean it:
-    this.ROOT.durty = false;
+    // All this sets ROOT dirty again. So clean it:
+    this.ROOT.dirty = false;
   },
 
 \f
@@ -1793,7 +1793,7 @@ var org_html_manager = {
 
       this.hideConsole();
       if(this.PLAIN_VIEW != this.VIEW) this.plainView();
-      this.ROOT.durty = true;
+      this.ROOT.dirty = true;
       this.toggleGlobaly();
       for(var i = 0; i < this.SECS.length; ++i) {
         OrgNode.showElement(this.SECS[i].div);

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Some Javascript Adventures
  2009-05-12 14:03 ` Sebastian Rose
  2009-05-13 13:57   ` Sebastian Rose
@ 2009-05-14 12:19   ` Ian Barton
  2009-05-14 12:30     ` Carsten Dominik
  2009-05-14 18:50     ` Sebastian Rose
  1 sibling, 2 replies; 12+ messages in thread
From: Ian Barton @ 2009-05-14 12:19 UTC (permalink / raw)
  To: emacs-orgmode

I have been wondering if it would somehow be possible to get the #+STYLE 
option to allow for an include file in addition to directly typing stuff 
in. The maintainability of multi line STYLE options would then be much 
easier.

Ian.

> 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(

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

* Re: Some Javascript Adventures
  2009-05-14 12:19   ` Ian Barton
@ 2009-05-14 12:30     ` Carsten Dominik
  2009-05-14 18:50     ` Sebastian Rose
  1 sibling, 0 replies; 12+ messages in thread
From: Carsten Dominik @ 2009-05-14 12:30 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode


On May 14, 2009, at 2:19 PM, Ian Barton wrote:

> I have been wondering if it would somehow be possible to get the # 
> +STYLE option to allow for an include file in addition to directly  
> typing stuff in. The maintainability of multi line STYLE options  
> would then be much easier.
>
> Ian.
>
>> 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(

I believe you should be able to use <link> here.

- Carsten

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

* Re: Some Javascript Adventures
  2009-05-14 12:19   ` Ian Barton
  2009-05-14 12:30     ` Carsten Dominik
@ 2009-05-14 18:50     ` Sebastian Rose
  1 sibling, 0 replies; 12+ messages in thread
From: Sebastian Rose @ 2009-05-14 18:50 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode




#+SETUPFILE: filename


??

Ian Barton <lists@manor-farm.org> writes:
> I have been wondering if it would somehow be possible to get the #+STYLE option
> to allow for an include file in addition to directly typing stuff in. The
> maintainability of multi line STYLE options would then be much easier.
>
> Ian.
>
>> 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(
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

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

* Re: Some Javascript Adventures
  2009-05-14 12:14     ` Ian Barton
@ 2009-05-15 11:17       ` Sebastian Rose
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Rose @ 2009-05-15 11:17 UTC (permalink / raw)
  To: lists; +Cc: emacs-orgmode


Applied. Learning english never ends... :)



  Sebastian

Ian Barton <lists@manor-farm.org> writes:
>> Unfortunately, it's tricky to get jQuery to work in Opera together with
>> org-info.js (org-info.js works, jQuery doesn't :) ).
>> Even in Firefox, if you place the jQuery stuff below the org-info.js
>> stuff, it stops working.
>>
>> We should realy create a jQuery version of org-info.js...
>>
>>
> Thanks for the tip about the sitemap. Ihad wondered about trying to create a
> jQuery version, but I need to do a lot more learning first!
>
> Attached is a patch that fixes a mis-spelling in org-info.js.
>
> Ian.
>
>
> diff --git a/code/org-info-js/org-info-src.js b/code/org-info-js/org-info-src.js
> index fe73ef1..2e1d4bb 100644
> --- a/code/org-info-js/org-info-src.js
> +++ b/code/org-info-js/org-info-src.js
> @@ -71,7 +71,7 @@ function OrgNode ( _div, _heading, _link, _depth, _parent, _base_id)
>    this.link = _link;
>    this.hasHighlight = false;              // Node highlighted (search)
>    this.parent = _parent;
> -  this.durty = false;                     // Node is durty, when children get
> +  this.dirty = false;                     // Node is dirty, when children get
>                                            // folded seperatly.
>    this.state = OrgNode.STATE_FOLDED;
>    this.depth = _depth;                    // The Rootelement will have
> @@ -250,7 +250,7 @@ OrgNode.prototype.hideAllChildren = function ()
>  
>  /**
>   * This one is called onclick() to toggle the folding state of the node.
> - * This one sets it's parent durty, since node is folded individually. Hence the
> + * This one sets it's parent dirty, since node is folded individually. Hence the
>   * next folding of parent has to collapse all.
>   * @param show_childrens_folders Boolean. This is only used for the special way
>   * of toggling of the ROOT element. If true, prevents this OrgNode from showing
> @@ -259,9 +259,9 @@ OrgNode.prototype.hideAllChildren = function ()
>  OrgNode.prototype.fold = function (hide_folder)
>  {
>    if(this.parent)
> -    this.parent.durty = true;
> -  if(this.durty) {
> -    this.durty = false;
> +    this.parent.dirty = true;
> +  if(this.dirty) {
> +    this.dirty = false;
>      this.state = OrgNode.STATE_UNFOLDED; // so next state is FOLDED. See below.
>    }
>  
> @@ -1200,7 +1200,7 @@ var org_html_manager = {
>  
>    toggleGlobaly: function ()
>    {
> -    if(this.ROOT.durty) {
> +    if(this.ROOT.dirty) {
>        this.ROOT.state = OrgNode.STATE_UNFOLDED;
>      }
>  
> @@ -1224,8 +1224,8 @@ var org_html_manager = {
>        this.ROOT.state = OrgNode.STATE_UNFOLDED;
>      }
>  
> -    // All this sets ROOT durty again. So clean it:
> -    this.ROOT.durty = false;
> +    // All this sets ROOT dirty again. So clean it:
> +    this.ROOT.dirty = false;
>    },
>  
>  \f
> @@ -1793,7 +1793,7 @@ var org_html_manager = {
>  
>        this.hideConsole();
>        if(this.PLAIN_VIEW != this.VIEW) this.plainView();
> -      this.ROOT.durty = true;
> +      this.ROOT.dirty = true;
>        this.toggleGlobaly();
>        for(var i = 0; i < this.SECS.length; ++i) {
>          OrgNode.showElement(this.SECS[i].div);

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