[Proto-Scripty] Re: Where is ver. 2.0 is coming?

2011-11-30 Thread T.J. Crowder
Other than the unnecessary assignment to `child`, doesn't look that
bad to me... How would you improve it?
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Nov 30, 6:38 am, Victor vkhomyac...@gmail.com wrote:
 Also CoffeeScript sometimes generates very ugly code. Example:

 CoffeeScript:
 SelectParser.select_to_array = (select) -
   parser = new SelectParser()
   parser.add_node( child ) for child in select.childNodes
   parser.parsed

 Generated JavaScript:
   SelectParser.select_to_array = function(select) {
     var child, parser, _i, _len, _ref;
     parser = new SelectParser();
     _ref = select.childNodes;
     for (_i = 0, _len = _ref.length; _i  _len; _i++) {
       child = _ref[_i];
       parser.add_node(child);
     }
     return parser.parsed;
   };

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Element.replace get top node of replaced content

2011-11-30 Thread vhochstein
Hi,

Unfortunetly, I had to realize that my approach does not work in any
every case.

var new_element = new Element('div').update('tr/tr'); fails. tr
Tag is not added to div

I think update function checks if tr elements are allowed inside of
div elements, cause
new Element('tbody').update('tr/tr'); works as aspected.

Does anybody if there exists a tag which can be updated with any html
code?

Thanks a lot in advance.

--
Volker





On 5 Nov., 10:58, vhochstein vhochst...@googlemail.com wrote:
 Hi

 Thanks a lot for your help.

 I slightly changed it:
 var new_element = new Element('div').update(html);
     new_element = new_element.firstDescendant();
     Element.replace(old_element, new_element);

 --
 Volker

 On 4 Nov., 23:31, T.J. Crowder t...@crowdersoftware.com wrote:







  On Nov 4, 5:30 pm, vhochstein vhochst...@googlemail.com wrote:

   Hi,

   if I call old_element = Element.replace(element, 'html code for new
   element')
   I get the old_element in response.

   How may I get the new_element node if it does nt have an id attribute?

   Thanks a lot in advance.

   --
   Volker

  Well, you could find it through the hierarchy or some such, but
  probably the easiest thing is to get a reference to it *before* you
  replace it:

  var new_element = new Element('tagName').update('contents');
  Element.replace(old_element, new_element);

  Live example:http://jsbin.com/uwibuh

  HTH,
  --
  T.J. Crowder
  Independent Software Engineer
  tj / crowder software / com
  www / crowder software / com

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: Element.replace get top node of replaced content

2011-11-30 Thread Walter Lee Davis
There is no universal parent, not while there are tr, td, th, li, etc. in the 
mix of possible children. There are quite a few low-level elements that can 
only go in one or two possible parent tags, and nothing else will work.

Walter

On Nov 30, 2011, at 11:09 AM, vhochstein wrote:

 Hi,
 
 Unfortunetly, I had to realize that my approach does not work in any
 every case.
 
 var new_element = new Element('div').update('tr/tr'); fails. tr
 Tag is not added to div
 
 I think update function checks if tr elements are allowed inside of
 div elements, cause
 new Element('tbody').update('tr/tr'); works as aspected.
 
 Does anybody if there exists a tag which can be updated with any html
 code?
 
 Thanks a lot in advance.
 
 --
 Volker
 
 
 
 
 
 On 5 Nov., 10:58, vhochstein vhochst...@googlemail.com wrote:
 Hi
 
 Thanks a lot for your help.
 
 I slightly changed it:
 var new_element = new Element('div').update(html);
 new_element = new_element.firstDescendant();
 Element.replace(old_element, new_element);
 
 --
 Volker
 
 On 4 Nov., 23:31, T.J. Crowder t...@crowdersoftware.com wrote:
 
 
 
 
 
 
 
 On Nov 4, 5:30 pm, vhochstein vhochst...@googlemail.com wrote:
 
 Hi,
 
 if I call old_element = Element.replace(element, 'html code for new
 element')
 I get the old_element in response.
 
 How may I get the new_element node if it does nt have an id attribute?
 
 Thanks a lot in advance.
 
 --
 Volker
 
 Well, you could find it through the hierarchy or some such, but
 probably the easiest thing is to get a reference to it *before* you
 replace it:
 
 var new_element = new Element('tagName').update('contents');
 Element.replace(old_element, new_element);
 
 Live example:http://jsbin.com/uwibuh
 
 HTH,
 --
 T.J. Crowder
 Independent Software Engineer
 tj / crowder software / com
 www / crowder software / com
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Prototype  script.aculo.us group.
 To post to this group, send email to prototype-scriptaculous@googlegroups.com.
 To unsubscribe from this group, send email to 
 prototype-scriptaculous+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/prototype-scriptaculous?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: Is someone working on Scripty2?

2011-11-30 Thread joe t.
i created a live bookmark in Firefox well over a year  a half ago
that was supposed to provide news updates for Scriptaculous/Scripty2
(http://feeds.feedburner.com/scriptaculous)  in that time, the only
news items were 1 post about a maintenance release to fix a Prototype
1.7 compatibility issue, and 3 posts about online Javascript Master
Classes.

Personally, i think it's time to call the patient's Time Of Death.
Javascript engines have been advancing, new functionality being added
to the core language, new devices  platforms for JS to adapt to...
Most libraries are keeping up while Proto  Scripty 1  2 have barely
shown signs of a heartbeat.

It used to matter to me, but i haven't even used Prototype in over a
year.
-joe t.


On Nov 30, 1:41 am, Victor vkhomyac...@gmail.com wrote:
 Is Scripty2 still developed? Or it is as alive (half-dead, actually) as
 Prototype? I've posted tickets on both projects in Lighthouseapp but no
 response...

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.