[Proto-Scripty] Re: Extending the Array object

2010-06-03 Thread 0m4r
I did click report as spam by mistake, please don't mark this as
spam! :)

On Jun 3, 6:07 pm, 0m4r  wrote:
> I am trying to get this code to work, but, no luck till now:
> ==
> var myArray = Class.create(Array, {
>
>  initialize: function($super, obj){
>    for(var i=0; i      var tmp = obj[i];
>
>        //do stuff to tmp
>
>      $super.push(tmp);
>  }
>
> }
>
> ==
>
> this is the error:
>
> ==
> parent.subclasses is undefined
>  parent.subclasses.push(klass);
> ==
>
> can anybody help me?
>
> Thanks,
>
> Omar

-- 
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] Wrong accept header with Ajax.Request

2010-06-03 Thread rdavila
Hi, I've a weird problem, I'm using Rails 3 with prototype 1.6.1 and I
want to send my form via Ajax, when I set the ":remote => true" option
in the form generator all works fine(It's handled by rails.js), but If
I want to customize the request it fails with 406 error, I've checked
the header with the Live HTTP Headers extension for Firefox and I saw
that the "Accept" isn't set correctly:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
*;q=0.8


Here is the JS code:

document.observe("dom:loaded", function() {
  $('new_user').observe('submit', function(){
new Ajax.Request('/users', {
  parameters: this.serialize(),
  asynchronous: true,
  evalScripts: true,
});
  });
});

I don't know why Prototype doesn't set the headers fine. I saw the
source code ant it should be set this headers.

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.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] RE: returning a value from a function calling a page with Ajax

2010-06-03 Thread Scott
In case this replay didn't end up in the appropriate thread:

http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/
db829a1d3ca58d79

 

REPLY:

 

So here is my simple test using your method:

 

I had to change the 'onSuccess' method in the updater to 'onComplete'

it wasn't working for some reason. I don't remember if 'onSuccess' is

after the DOM is loaded or not.

 



   

   Simple callback test

   

   

   function userChooser(callback) {

   $('readout').insert({ bottom: 'loading callback.vb.asp...
' }); new Ajax.Updater('divID', 'callback.vb.asp', { onComplete: function() { updateSuccess(); $('readout').insert({ bottom: 'loading success!
' }); } }); function updateSuccess() { $('divID').down("input[name=btnChoose]").observe('click', chosenClick); $('readout').insert({ bottom: 'observing button...
' }); } function chosenClick(event) { var theDiv; event.stop(); $('readout').insert({ bottom: 'event stopped...
' }); theDiv = $('divID'); theDiv.stopObserving('click', chosenClick); $('readout').insert({ bottom: 'observing stopped...
' }); callback(theDiv.down('select[name=choices]').getValue()); } } Event.observe(window, 'load', function() { userChooser(choiceMade); function choiceMade(choice) { $('readout').insert({ bottom: choice + '
' }); } }); body{margin:0px;padding:0px;} #divID{border:solid 1px #000;width:400px;} #readout{font:normal 8pt Arial;width:400px;} and callback.vb.asp: Bob Dave Joe Mick It works perfectly. As long as I disable any other user input until they have chosen a user, this should work out great. Again sorry for the long wait for my response. Your work is much appreciated! Thank you! -- 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] prototype(js) docs

2010-06-03 Thread Miguel Beltran R.
2010/6/2 davidenke 

> Yeah, http://api.prototypejs.org/ will give you a good documentation
> about it.
> In my opinion the old interface (http://www.prototypejs.org/api) is
> much better and more cheerful.
>
>
I'm agreed
I think is more easy to understand the api old page

-- 
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] Extending the Array object

2010-06-03 Thread 0m4r
I am trying to get this code to work, but, no luck till now:
==
var myArray = Class.create(Array, {

 initialize: function($super, obj){
   for(var i=0; ihttp://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Re: how to get started

2010-06-03 Thread ankit jain
Thanks Lemmi for sharing the information, now i'll try to explore myself.

Thanks & regards
Ankit Jain

On Thu, Jun 3, 2010 at 6:23 AM, Lemmi  wrote:

> The basis using a framework is a good skill in the build-in functions
> of JavaScript. Never the less, you can use the Tips and Tutorials Page
> of Prototype to see a few first steps of working with the framework
> (http://www.prototypejs.org/learn).
>
> The great extending of the dom, I think, is the biggest advantage of
> Prototype for nearly every JavaScript developer (http://
> www.prototypejs.org/learn/extensions).
> While you try to get a special element on your page, you often have to
> deal with IDs of the elements or boring tag names. Extending the dom
> means a great way to "talk" to your elements on your page. More
> details you'll find in the linked section.
>
> But, as I sad: The API is great way to take look into the full
> complexity of the Framework. Here you find for example tricky and nice
> functions extending the normal String object of JavaScript. E.g.
> escaping HTML tags in a string (http://api.prototypejs.org/language/
> string/prototype/escapehtml/).
> While I write my JavaScript programs, I
> often take look into the API to find a easier solution to many
> different problems.
>
> On 2 Jun., 09:37, "ankit.it09"  wrote:
> > Thanks for your reply , i know little bit of javascript now i like to
> > work on this framework, that's why i asked from where i get started &
> > How can i make this prototype helpful for me & makes my work more
> > simpler.
> >
> > Thanks & Regards:
> > Ankit Jain
> >
> > On Jun 2, 11:12 am, Lemmi  wrote:
> >
> > > This depends on your skill with JavaScript. What do you know about it?
> > > Especially the API of Prototype (http://api.prototypejs.org/) is a
> > > great and easy way to find functionality, which can simplify your
> > > "life".
> >
> > > On 1 Jun., 07:35, "ankit.it09"  wrote:
> >
> > > > Hi All,
> >
> > > > I am newbie to this, can anyone help from where i get started, any
> > > > kind of help is much appreciated.
> >
> > > > Thanks & Regards:
> > > > Ankit Jain
>
> --
> 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.
>
>

-- 
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] getting error with select() function since upgrade to prototype 1.6.1

2010-06-03 Thread E Heller
Ever since we upgraded to prototype 1.6.1, I have been getting errors
when using the select function. the error is... An invalid or illegal
string was specified" code: "12
It stops at line 3299 in prototype.js, which is:
results = $A(root.querySelectorAll(e)).map(Element.extend);

Example of my code where I call the function...
variables used (and their values according to firebug watch):
elem = div#addressForm[0].addressForm
index = [0]
[id='AddressIsService" + index +"'] amounts to
[id='AddressIsService[0]']
what i am checking is an radio input by that id - AddressIsService[0]

if(elem.select("[id='AddressIsService" + index +"']")[0].checked)
{
elem.select("[id='cityFieldRequired" + index +"']")
[0].setStyle({display:'none'});
for(i=0;ihttp://groups.google.com/group/prototype-scriptaculous?hl=en.