Re: [Proto-Scripty] [OT] Rails 3.1 - Prototype = WTF?

2011-03-14 Thread Jane Hunter
I can tell you my experience, perhaps others have had a similar ones. I
tried jquery and found that I liked its ability to chain a lot. It toggles
more powerfully than prototype. I also like the fact that I only need one
reference for plenty of effects -- as many as I'll ever care about.Jquery
does have some really aggravating aspects. In a couple of instances I have
been able to find an element with plain old javascript that defied jquery
and I'm still figuring out how to manage its events.

Beyond a nice scrollbar, which is only a couple of hundred bytes, I haven't
explored JQuery's plugins, because I like to make my own stuff.

Additionally, because I plan to do freelance asp.net and javascript work
when I retire (soon), I decided that because JQuery is so much more
prevalent and  because Microsoft is beginning to facilitate using it, that's
what I should spend time learning.

Jane

On Mon, Mar 14, 2011 at 1:53 PM, Walter Lee Davis wa...@wdstudio.comwrote:

 Sorry for the rant, but I came to Prototype by way of early exploration
 with Rails. I found Prototype approachable and learn-able in a way that I
 didn't (and don't) find jQuery to be.

 I've invested years in learning Prototype and it has trained and patterned
 my JavaScript brain. I'm quite cheesed about the notion of having to learn
 another way to look at JavaScript.

 At the same time, I can't help but notice the crickets around here
 lately. When I joined this list (back in the rails-spinoff days) there were
 dozens of posts per day, now we're lucky to get there in a week.

 What the heck is going on here?

 Walter

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



Re: [Proto-Scripty] element.getStyle('border') does not work

2010-12-23 Thread Jane Hunter
reorder the border attributes so they are type, size, color and see if that
solves your problem.

On Thu, Dec 23, 2010 at 11:53 AM, marbrun marb...@me.com wrote:

 Hello guys

 I am using the latest version of JS Prototype, 1.7.
 I have never asked a question about JS Prototype online because I
 always figured it out somehow or just found another solution. But
 that's not true this time.

 In CSS, the border is set on an element like this:

 #element {
 border:#00 solid 3px;
 }

 Now I try to get the border value in JS Prototype with this code:

 $('element').getStyle('border');

 And this is the return I get in Firebug:

 (an empty string)

 I have simplified all other code, so there nothing else influencing
 it. I have even tested this in another project using Prototype version
 1.6. No result.

 How can I solve this quite important problem?

 Thanks

 --
 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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@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] using nested lists for drop-down menus. Am I unclear on a concept?

2010-11-17 Thread Jane Hunter
I like using nested lists positioned by percentages, but in trying to make
them work for a dropdown menu, I'm not succeeding in getting the child lists
to stay visible when the mouse moves from the parent list item to the
block-displayed child list. I'm also having trouble getting the lists to
display on top of images in IE, despite setting z-indices on the various
elements. Do I need to unnest the lists and make the parent items spans or
divs or something? Or am I missing something else (probably obvious)?

Thanks very much for your help.


ul id=TopicATop onmouseover=$('topicA').show(); return false;
onmouseout=$('topicA').hide(); return false; liTopic Abr /

ul id=TopicA 

lia href=# class=lvl3menu item/a/li

lia href=# class=lvl3menu item/a/li

lia href=# class=lvl3menu item/a/li

/ul/li/ul

I have the css set up like this (omitting the positioning for the lists,
which is absolute relative to the containing div):



#menu ul, #menu ul li

{font-family:Papyrus, Parisian BT, Palatino Linotype, Times New Roman;

color:White;

font-size:15px;

font-weight:bold;

margin:0;

text-align:left;

display:block;

list-style:none;

cursor:pointer;

}



#menu ul li ul

{padding-top:6px;

}

#menu ul li ul, #menu ul li ul li, .lvl3

{display:block;

list-style:none;

color:White;

background-color:#5d4550;

width:100%;

font-family:Papyrus, Parisian BT, Palatino Linotype, Times New Roman;

font-size:15px;

cursor:pointer;

}



a.lvl3:link

{cursor:pointer;

color:White;

background-color:#5d4550;

text-decoration:none;}

etc...

-- 
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-scriptacul...@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] Looking for a way to disable buttons, inputs while images load

2010-09-17 Thread Jane Hunter
Thanks very much, Walter. I'm inclined to try your approach, but I have a
couple of questions that,if you could answer them, will help me understand
it better. First, what is the difference between observe...evt.stop() and
stopObserving? And why would a new div catch the clicks, when
document.stopObserving('click'), which I've also tried, did not? How does
Z-index work here?  I'm not familiar with first() and hope I'm correct
that it makes an element a first descendant?

Again, many thanks; I'll try your approach this evening,
Jane
On Fri, Sep 17, 2010 at 2:43 PM, Walter Lee Davis wa...@wdstudio.comwrote:

 Off the top of my head, I would say observe clicks on a temporary element
 placed over the top of the page and cause them to die, rather than trying to
 disable clicks where you are. By the time your clicks bubble from the
 element they were made on up to the outer shell, it's already too late --
 the click has fired on that element, then bubbled up to the shell.

 if(!$('cover')){
var cover = new Element('div',{id:'cover'});
cover.setStyle('position:fixed;
 width:100%;height:100%;z-index:1000;top:0;left:0');
$$('body').first().insert({top:cover});
cover.observe('click',function(evt){evt.stop();});
 }

 later, when everything is ready

 $('cover').stopObserving().remove();

 Something like that.

 Walter


 On Sep 17, 2010, at 2:26 PM, Jane Hunter wrote:

   Hello,
 I'm making an html/javascript copy of a flash slide-show, probably the
 first of several necessitated by the iPad. Thanks to Prototype, everything
 works well in every browser -- EXCEPT, if the user clicks one of the
 navigation buttons or image buttons before the images are finished loading,
 the display image doesn't position itself correctly. (The images are of
 varying sizes and I caculate their position on the fly.) I've tried this
 (shell being my outermost div), which has no effect at all:

 

 script type=text/javascript
 document.observe(

 dom:loaded, function() {
 $(

 'shell').stopObserving('click');
 firstimage();

 });

 /

 script
 I can disable each of the buttons and inputs, individually, which is
 really lame, plus would make me re-iterate through them to un-disable them
 at the end of the load functions. It would be ideal to disable all the
 buttons at the beginning of the load process and then have an on-complete
 event that will re-enable them (and will work in all browsers).

 Is there a way to do that with Prototype? I'd be very grateful for advice
 and suggestions.

 Thank you!

 Jane Hunter


 --
 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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@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] Looking for a way to disable buttons, inputs while images load

2010-09-17 Thread Jane Hunter
Thanks, but that won't work. Everything I make is in divs,but I can't hide
these divs or there'd be little to show on the page.

On Fri, Sep 17, 2010 at 2:48 PM, Phil Petree phil.pet...@gmail.com wrote:

 place the buttons in a div and show/hide the div

   On Fri, Sep 17, 2010 at 2:26 PM, Jane Hunter jane...@gmail.com wrote:

   Hello,
 I'm making an html/javascript copy of a flash slide-show, probably the
 first of several necessitated by the iPad. Thanks to Prototype, everything
 works well in every browser -- EXCEPT, if the user clicks one of the
 navigation buttons or image buttons before the images are finished loading,
 the display image doesn't position itself correctly. (The images are of
 varying sizes and I caculate their position on the fly.) I've tried this
 (shell being my outermost div), which has no effect at all:


 
 script type=text/javascript

 document.observe(
 dom:loaded, function() {

 $(
 'shell').stopObserving('click');

 firstimage();

 });

 /
 script

 I can disable each of the buttons and inputs, individually, which is
 really lame, plus would make me re-iterate through them to un-disable them
 at the end of the load functions. It would be ideal to disable all the
 buttons at the beginning of the load process and then have an on-complete
 event that will re-enable them (and will work in all browsers).

 Is there a way to do that with Prototype? I'd be very grateful for advice
 and suggestions.

 Thank you!

 Jane Hunter

 --
 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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@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] Looking for a way to disable buttons, inputs while images load

2010-09-17 Thread Jane Hunter
Thank you so much! This is very helpful. I hate using code that I don't
understand. I'm bemused that I never understood z-index's behavior in
bubbling, but glad that I now do!

On Fri, Sep 17, 2010 at 4:24 PM, Walter Lee Davis wa...@wdstudio.comwrote:

 Answers inline below...


 On Sep 17, 2010, at 3:37 PM, Jane Hunter wrote:

 Thanks very much, Walter. I'm inclined to try your approach, but I have a
 couple of questions that,if you could answer them, will help me understand
 it better. First, what is the difference between observe...evt.stop() and
 stopObserving?


 It's proactive -- trapping the click before it can go anywhere versus
 trying to stop the click after it happens. By creating an element that is
 above the rest of your page, and using it to catch the clicks, you pretty
 much guarantee that the event will be caught there first.


 And why would a new div catch the clicks, when
 document.stopObserving('click'), which I've also tried, did not? How does
 Z-index work here?


 Imagine your page as a stack of sheets of glass or similar. Each sheet has
 a z-index, and the higher it is, the closer to the visitor's eyes it is. The
 page itself is at z-index 0. Each element on your page has a z-index. If you
 don't explicitly set a z-index, or if you set it to auto, then the browser
 will sort this out using source code order and various layout rules to
 figure out what lies in front of what. For example, if you had one element
 floated right, and another floated left, and then you closed up your browser
 window so that they had to overlap -- one element would slide under the
 other, and that's z-index:auto at work. So in this case, setting the element
 to a ridiculously high number makes it float way up above everything else on
 the page.



 I'm not familiar with first() and hope I'm correct that it makes an
 element a first descendant?


 first() is a Prototype thing, it finds the first element in an enumerable
 object (in this case an array). Unless you set an id on your page body and
 use $('my_body'), you can't access the document.body in Prototype and extend
 it for use in all browsers. So the double-dollar function, which I think of
 as a souped up example of 'find everything that matches this CSS selector',
 is used to find all the 'body' tags in the document (there should only be
 one, right) and then first() operates on the result of the double-dollar,
 and thus returns the one and only body tag, extended and ready for work.

 What makes the new inserted div a first descendent of the body is the use
 of insert({top:cover});

 insert can either take an object as an argument, or a hash. If you send it
 a hash, the key must be one of the following: before, after, top, or bottom.
 If you just pass it an object, that object will be inserted at the bottom of
 the element, so insert({bottom:foo}) is the same as insert(foo).

 Either form can take a string as the argument, too, as long as it
 represents a valid thing to insert. So if you wanted to
 insert('pHello/p) or insert({top:'hiHello/hi1'}) you could do that.
 It will fail quietly if you try to insert something where it doesn't belong,
 like trying to add an li to a select or something silly like that.

 Walter



 Again, many thanks; I'll try your approach this evening,
 Jane
 On Fri, Sep 17, 2010 at 2:43 PM, Walter Lee Davis wa...@wdstudio.com
 wrote:
 Off the top of my head, I would say observe clicks on a temporary element
 placed over the top of the page and cause them to die, rather than trying to
 disable clicks where you are. By the time your clicks bubble from the
 element they were made on up to the outer shell, it's already too late --
 the click has fired on that element, then bubbled up to the shell.

 if(!$('cover')){
   var cover = new Element('div',{id:'cover'});
   cover.setStyle('position:fixed;
 width:100%;height:100%;z-index:1000;top:0;left:0');
   $$('body').first().insert({top:cover});
   cover.observe('click',function(evt){evt.stop();});
 }

 later, when everything is ready

 $('cover').stopObserving().remove();

 Something like that.

 Walter


 On Sep 17, 2010, at 2:26 PM, Jane Hunter wrote:

 Hello,
 I'm making an html/javascript copy of a flash slide-show, probably the
 first of several necessitated by the iPad. Thanks to Prototype, everything
 works well in every browser -- EXCEPT, if the user clicks one of the
 navigation buttons or image buttons before the images are finished loading,
 the display image doesn't position itself correctly. (The images are of
 varying sizes and I caculate their position on the fly.) I've tried this
 (shell being my outermost div), which has no effect at all:

 

 script type=text/javascript
 document.observe(

 dom:loaded, function() {
 $(

 'shell').stopObserving('click');
 firstimage();

 });

 /

 script
 I can disable each of the buttons and inputs, individually, which is
 really lame, plus would make me re-iterate through them to un-disable them
 at the end

Re: [Proto-Scripty] Re: how to modify a part of an a href=...

2010-08-19 Thread Jane Hunter
I've done well with Regex buddy, but we ended up buying the program. Its
interface lets you experiment with regular expressions for various
languages, which is far better than examples.

On Thu, Aug 19, 2010 at 3:01 PM, Dave Kibble davekib...@gmail.com wrote:

 depends entirely on what you are trying to capture - is the edit
 always there? is the  /admin/users/ always there?

 in general I'm a great fan of http://www.w3schools.com/ but not sure
 what to recommend for regular expressions in general - most sites are
 confusing rather than educational for the novice :) you can try
 http://www.w3schools.com/jsref/jsref_obj_regexp.asp

 On 19 August 2010 14:26, Erwin yves_duf...@mac.com wrote:
  I tried  the following
 
  var editRegExp = /(^.*?)([^\/]*)\/edit\?(.*$)/;
 
  var edit_link = $('edit_user').down('a');
  var match = editRegExp.exec(edit_link.href.toString());
 
  on this url  :
 
   /admin/users/4c6a275ea326cb01f401/edit?locale=en
 
  seems to work , maybe a better writing ?
 
 
 
  On 19 août, 15:10, Erwin yves_duf...@mac.com wrote:
  Hi Dave .. sorry to ask you an additional trick ...  but as you are
  qui good in RegExp ...
 
  what if the href is as following :
 
/admin/users/4c6a275ea326cb01f401/edit?locale=en
 
  in this case (^.*?) is getting the 'edit' string, not the id number :
  4c6a275ea326cb01f401
 
  btw : which tutorial do you recommend to get a better understanding of
  RegExp ..?  (I found some of them w good explanation but few
  examples;..)
 
  erwin
 
  On 18 août, 19:27, Dave Kibble davekib...@gmail.com wrote:
 
 
 
   you might find this regular expression useful:
 
   var myRegExp = /(^.*?)([^\/]*)\?(.*$)/;
   var match = myRegExp.exec(link.href.toString());
   alert(match[1] + '\n' + match[2] + '\n' + match[3]);
 
  --
  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-scriptacul...@googlegroups.com.
  To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@googlegroups.com.
 To unsubscribe from this group, send email to
 prototype-scriptaculous+unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@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-scriptacul...@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] problem using prototype/scriptaculous in asp.net page

2010-08-09 Thread Jane Hunter
Hello,
I'm trying to run a scriptaculous appear effect on an asp.net page. The
script references are in the head element, not  microsoft's script manager.
The code works fine in IE, but not in FF, Safari or Chrome. In FF I get this
error:

Error: uncaught exception: [Exception... Component returned failure code:
0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.removeChild]
 nsresult: 0x80004003 (NS_ERROR_INVALID_POINTER)  location: JS frame ::
http://localhost:57114/ApName/PageName.aspx :: gen :: line 225  data: no]


The function gets called by an asp.net button's clientclick event,
thus: OnClientClick=gen(); $('rmAbout').appear(); return false;

I've removed the variables from my function and hardcoded in  two child
divs, the first of which loads with the page.this is the totality of what's
now in gen:

 $('rightmenushell').removeChild($('rmGenLoad'));
$('rightmenushell').appendChild($('rmAbout'));


This is the first time I've tried to use Prototype with Asp.net and if I'm
doing something dumb, would be very grateful if someone could point out
what.

Jane Hunter

-- 
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-scriptacul...@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.