Re: [Proto-Scripty] Help with element.setattribute

2012-06-29 Thread Johan Arensman
Hello Larry, First of all how did you find this mailing list? You haven't used a single Prototype method in your code? You might want to have a look at the following sections: Creating elements (and adding attributes at the same time): http://api.prototypejs.org/dom/Element/new/ Or adding

Re: [Proto-Scripty] I need to initialize base class an do not bothe user to call $super in subclass

2012-01-03 Thread Johan Arensman
Have you ever considered not including the initialize method in the subclass? Perhaps your baseclass can check if there's a child 'constructor' present and automatically call that: var MySuper = Class.create({ initialize: function() { // do stuff if (this.childConstructor) {

Re: [Proto-Scripty] new Element removes the name property from passed initialiser in IE7

2011-09-27 Thread Johan Arensman
I've recently seen this aswell, I don't know why it's in but I guess it's to support IE6 or something. I simply created the element and then used writeAttribute('name', myname'); to add the name attribute. Although I am curious why this is. On Tue, Sep 27, 2011 at 12:55 PM, Dave Kibble

Re: [Proto-Scripty] Re: Snap for scriptaculous sortable

2011-09-26 Thread Johan Arensman
http://madrobby.github.com/scriptaculous/sortable/ Doubt it, but have you tried 'snap' from the Draggable options? On Mon, Sep 26, 2011 at 2:47 PM, T.J. Crowder t...@crowdersoftware.comwrote: On Sep 26, 10:18 am, Vaji vajiram...@gmail.com wrote: Any timely help would be much more

Re: [Proto-Scripty] Re: Organizing my dom:loaded event

2011-08-25 Thread Johan Arensman
to your DOM init and invoke it. Eric On Aug 23, 10:04 am, Johan Arensman johanm...@gmail.com wrote: Hey guys, I'm redesigning a template set for different kind of websites. In the past quite a lot of 'widgets' have been created in the form of prototype Classes and almost every widget works

[Proto-Scripty] Organizing my dom:loaded event

2011-08-23 Thread Johan Arensman
Hey guys, I'm redesigning a template set for different kind of websites. In the past quite a lot of 'widgets' have been created in the form of prototype Classes and almost every widget works the same way: 1. get all elements with className 'x' 2. for each element: create a new ClassX 3. ClassX

Re: [Proto-Scripty] event observe for image problem on IE

2011-06-29 Thread Johan Arensman
This is because your newImg is not an extended element. Create a new img element using: new Element('img'); or use the prototype dollar function (http://api.prototypejs.org/dom/dollar/) to properly extend your element with the prototype methods: $(newImg); Your addImage method could be

Re: [Proto-Scripty] Re: event observe for image problem on IE

2011-06-29 Thread Johan Arensman
TJ! How on earth can you do that so fast!? Do you have this reply as a template or something?? On Wed, Jun 29, 2011 at 10:31 AM, T.J. Crowder t...@crowdersoftware.comwrote: Hi, On IE, Prototype can't extend elements at the prototype level and so you have to extend them individually if you

Re: [Proto-Scripty] what is the advantage to use Class.create to create new class

2011-06-01 Thread Johan Arensman
plenty more functionality in the framework than only the Class object. On Tue, May 31, 2011 at 4:35 PM, maven apache apachemav...@gmail.comwrote: 2011/5/31 Johan Arensman johanm...@gmail.com Hi, Mostly because with Class.create() you can make use of the various inheritance functionality

Re: [Proto-Scripty] what is the advantage to use Class.create to create new class

2011-05-31 Thread Johan Arensman
Hi, Mostly because with Class.create() you can make use of the various inheritance functionality in the Prototype framework. See http://api.prototypejs.org/language/Class/create/ for more information. Greetings, Johan On Tue, May 31, 2011 at 3:26 PM, maven apache apachemav...@gmail.comwrote:

Re: [Proto-Scripty] Re: Class Inheritance Properties

2010-11-30 Thread Johan Arensman
by the child. Is that true or do you know any way to access it from the child? $super just seems to contain the parent's method that has the same name like the child's method it is passed to... . On Nov 29, 1:23 pm, Johan Arensman johanm...@gmail.com wrote: You can use the $super

Re: [Proto-Scripty] Event capture

2010-11-30 Thread Johan Arensman
http://api.prototypejs.org/dom/Event/observe/ http://api.prototypejs.org/dom/Event/observe/ Changes in 1.6.x Prior to Prototype 1.6, Event.observehttp://api.prototypejs.org/dom/Event/observe/ supported a fourth argument (useCapture), a boolean that indicated whether to use the browser's

Re: [Proto-Scripty] Class Inheritance Properties

2010-11-29 Thread Johan Arensman
You can use the $super parameter name to access the property of the parent class. See: http://api.prototypejs.org/language/Class/create/ On Mon, Nov 29, 2010 at 12:15 PM, Luke kickingje...@gmail.com wrote: Hi there! Is there a way you can inherit from a class and extend a property from the

Re: [Proto-Scripty] chain findall each

2010-09-17 Thread Johan Arensman
findAll is your filter function. The result from findAll can be iterated using each but I think we really need more information such as a datastructure to actually help you with your problem. Greets, Johan On Fri, Sep 17, 2010 at 6:15 AM, kstubs kst...@gmail.com wrote: How do you chain

Re: [Proto-Scripty] Re: Is there a way to determine if a parameter to a function is a Template?

2010-09-06 Thread Johan Arensman
...@gmail.com wrote: On 4 September 2010 07:54, Johan Arensman johanm...@gmail.com wrote: Feature checking is usually done by checking for a specific method or attribute on the object. For a template you can check for the evaluate method: if(MyObject.evaluate) { // it's a template

Re: [Proto-Scripty] Is there a way to determine if a parameter to a function is a Template?

2010-09-04 Thread Johan Arensman
Feature checking is usually done by checking for a specific method or attribute on the object. For a template you can check for the evaluate method: if(MyObject.evaluate) { // it's a template } On Wed, Sep 1, 2010 at 5:20 PM, Richard Quadling rquadl...@gmail.comwrote: Hi. I can't find a

Re: [Proto-Scripty] Re: Object extend magic

2010-09-01 Thread Johan Arensman
Also you cannot use the class keyword because it's reserved in javascript, you'll have to use className or 'class' between quotes in the objectliteral. There is a known bug in IE8 with creating elements with for example the Element constructor. In this case adding the classname with

Re: [Proto-Scripty] Delaying the execution of an AJAX Request.

2010-08-31 Thread Johan Arensman
Hello, Why not do exactly what you say, compose all the parameters for the request and execute whenever you want: var url = '/foo.php'; var ajaxOptions = { option1: foo, option2: bar } // do whatever you want.. // even add something ajaxOptions.option3 = 'bla'; // then execute new

Re: [Proto-Scripty] Newbie question: Add CSS style to TR

2010-08-31 Thread Johan Arensman
Hey, Setting styles can be done using the the setStyle method: http://api.prototypejs.org/dom/element/setstyle/ Selecting elements using a css selector can be done using the $$ method which is short for Element.select() but then global: http://api.prototypejs.org/language/dollardollar/

Re: [Proto-Scripty] Re: Newbie question: Add CSS style to TR

2010-08-31 Thread Johan Arensman
Bah T.J! You beat me to it! :-) On Tue, Aug 31, 2010 at 4:39 PM, T.J. Crowder t...@crowdersoftware.comwrote: Hi, Hope you enjoy Prototype! The Prototype equivalent of jQuery's `$` function is `$$` (yes, really): http://api.prototypejs.org/language/dollardollar/ The Prototype

Re: [Proto-Scripty] marquee in JavaScript (using Prototype)

2010-08-27 Thread Johan Arensman
I'm fully against marquee's in the first place but you also have an option to add the attribute data-duration to your element. If you're making a class to replace a depricated functionality you shouldn't use this way to add features or configuration to it. I've also done it before (the client

Re: [Proto-Scripty] Add event by class name

2010-08-23 Thread Johan Arensman
You are trying to apply a single method to a set of items. For this to work you need to apply the same function to each member of the set using invoke(). $$('input.compare_itm').invoke('observe', 'click', myFunction); See also: http://api.prototypejs.org/language/enumerable/prototype/invoke/

Re: [Proto-Scripty] Re: Add event by class name

2010-08-23 Thread Johan Arensman
Indeed T.J. catching bubbling events is something I need to consider more often. Thanks for the heads up :-) On Mon, Aug 23, 2010 at 10:05 AM, T.J. Crowder t...@crowdersoftware.comwrote: Hi, The $$ function returns an array[1]. Arrays don't have an `observe` method. However, Prototype does

Re: [Proto-Scripty] Re: Prevent enter from submitting form

2010-08-23 Thread Johan Arensman
You could also try to observe the form and prevent it from submitting: YourFormElement.observe('submit', function submitEvent(event) { event.stop(); // stops the form from actually submitting // other code you would like to run }); On Mon, Aug 23, 2010 at 10:24 AM, jhaagmans

Re: [Proto-Scripty] Really Simple History + Prototype

2010-08-20 Thread Johan Arensman
I'm no RSH expert, but i really think you should ask this at the RSH group. It's no prototype based application, it only uses prototype for serializing JSON strings as far as i can see. Have you tried any of the examples given at : http://code.google.com/p/reallysimplehistory/w/list ? Greets,

Re: [Proto-Scripty] Can you move an element with Element.Layout?

2010-08-13 Thread Johan Arensman
Setting styles can be done using setStyle(); var layout = $('myelement').getLayout(); $('myelement').setStyle({left: layout.get('left')+10}); Is this what you're looking for? Greets, Johan On Fri, Aug 13, 2010 at 12:48 PM, dinoD kapau...@gmail.com wrote: I'm fooling around with

Re: [Proto-Scripty] Can you move an element with Element.Layout?

2010-08-13 Thread Johan Arensman
Sorry, forgot to add 'px' to the value: var layout = $('myelement').getLayout(); $('myelement').setStyle({left: layout.get('left')+10+'px'}); On Fri, Aug 13, 2010 at 2:08 PM, Johan Arensman johanm...@gmail.com wrote: Setting styles can be done using setStyle(); var layout = $('myelement

Re: [Proto-Scripty] DOM elements updates

2010-06-15 Thread Johan Arensman
can create the entire element and child elements without any problems. You can even update() it, and addClassNames() if you want. Just realize that trying to find it's ancestor will fail when you haven't insert()ed it. Greetings, Johan Arensman On Tue, Jun 15, 2010 at 12:34 PM, Ran Berenfeld

Re: [Proto-Scripty] disable right click

2010-06-05 Thread Johan Arensman
You can using Event.observe() Event.observe(window, 'contextmenu', function(event) { event.stop(); }); On Sat, Jun 5, 2010 at 6:29 AM, ankit.it09 ankit.i...@gmail.com wrote: How to disable right click in a web page using prototype , i mean is there any method. Thanks Ankit -- You

Re: [Proto-Scripty] Does Prototype conflict with the native javascript object prototype?

2010-06-05 Thread Johan Arensman
Hi, There is no such object it's only some sort of property every object has and it's used to extend the native objects existing in Javascript. If you want to learn more about this check this page: http://www.prototypejs.org/learn/extensions Greets, Johan On Sat, Jun 5, 2010 at 6:16 AM,

Re: [Proto-Scripty] Problem with absolutize()

2010-06-01 Thread Johan Arensman
You could try 'try/catching' the code: replace your menu.absolutize(); with: try { menu.absolutize(); } catch(e) { alert(e); } What does the error message tell you? On Tue, Jun 1, 2010 at 11:12 AM, Ran Berenfeld berenfeld...@gmail.comwrote: Hello I'm trying Prototype 1.7 RC 2 and I have a

Re: [Proto-Scripty] Re: Problem with absolutize()

2010-06-01 Thread Johan Arensman
Consultant tj / crowder software / com www.crowdersoftware.com On Jun 1, 11:15 am, Ran Berenfeld berenfeld...@gmail.com wrote: It says Object Error On Tue, Jun 1, 2010 at 12:34 PM, Johan Arensman johanm...@gmail.com wrote: You could try 'try/catching' the code: replace your

Re: [Proto-Scripty] How can I access an element from outside iframe

2010-05-27 Thread Johan Arensman
Hello, I believe this is possible by first creating a reference to the element, extending it and then modifying it: // get the element and extend it with prototype's $() method: var element = $(top.document.getElementById('my_element')); // now apply the effect to the element: new