similar to: prototype.js: enumerable mixin for hash broken

Displaying 20 results from an estimated 10000 matches similar to: "prototype.js: enumerable mixin for hash broken"

2006 Jun 28
3
Add to enumerable
This might seem like a really daft question, but I couldn''t find an answer anywhere. How do you add something to an enumerable object? Something like var first = $A(getElementsByTagName(''td'')); var second = $A(getElementsByTagName(''tr'')); first.PUSH(second); where the PUSH is something unknown. am i supposed to use inject here in some way? Andreas
2006 Jan 23
4
Enumerable
Hi and sorry if this has already been discussed. I''m new on theese lists, and I couldn''t find a way to search through them. I have been looking at the sources of script.aculo.us and I''m rather impressed by the Enumerable class. What I don''t get is why you choose to extend Array.prototype with this addon. It seems like a rather intrusive thing to do, if the code
2006 Feb 09
3
Error in prototype.js? / Enumerable.each
Hi List! I am using the latest version of prototype.js from the SVN, including the wonderful $$ operator to loop through a number of elements with a certain classname. In Firefox everything works fine, no JS error, but in IE I get an error in the .each function saying that an Object was expected. What I do is function initializePlugins() { $$(".plugin").each(function(plugin) {
2006 Mar 07
1
Sortable trouble
Hi everybody, Could somebody have a look at a little sortable example at http://www.weisshuhn.de/diagnose/sortable.html It implements two Sortables and a Draggable. You can drag elements from the "source" Sortable to the main Sortable, sort them (surprise) and drag them to a trash. Whenever you drag from the "source", a new element is created (by cloning an invisible
2005 Oct 13
3
Tweaks of Array.prototype
Hi all, I encountered a big problem when trying to use Scriptaculous and Htmlarea in the same page. The Htmlarea code uses a lot of "for (var i in array_variable)" to iterate on array elements. Problem is that prototype.js augments Array.prototype, which then show up in the iteration, severely breaking htmlarea. The easy workaround is for sure to use "for (var i = 0; i <
2006 May 24
6
enumerables problem?
I was wondering whether anybody could please tell me why this is causing an error in IE (works in Firefox): $A(container.getElementsByTagName(''*'')).each( function(el) { Element.cleanWhitespace(el); }.bind(this)); What would be an alternative of achieving the same? Thank you Marco M. Jaeger | Url: http://mmjaeger.com <http://mmjaeger.com/> | E-mail:
2005 Dec 09
5
Prototype Enumerable, Array and Hash Documentation
Hey guys, I recently published an article documenting some of the more useful and interesting parts of Prototype''s Enumerable, Hash and Array objects. You can find it here: http://encytemedia.com/blog/articles/ 2005/12/07/prototype-meets-ruby-a-look-at-enumerable-array-and-hash If you have any feedback or suggestions, fire away. Cheers, -Justin Palmer
2005 Jul 08
8
Integrating script.aculo.us into existing javascript codebase
Hi, I''m new to this mailing list, so first off, a big THANK YOU for the script.aculo.us and prototype.js libraries. I''m trying to integrate script.aculo.us into an existing pretty large Javascript codebase (see http://openrecord.org). I''m running into a problem with prototype.js and the existing codebase''s use of for/in loops over an Array.
2008 Mar 25
6
Prototype 1.6.0.2 + Firefox 3 Enumerable problems
I am using Prototype 1.6.0.2 on Firefox 3.0b4. The following does not work when I enter it in Firebug: $A([1,2,3,4]).each(function(n) {alert(n);}); The above is just an example. Any array, using $A and any enumerable method, returns the following: TypeError: iterator.bind is not a function Seems like some objects are not being extended correctly? Using Prototype 1.5.0 on Firefox 3.0b4, this
2006 Feb 09
3
each()
I have been reading the documentation at: http://www.sergiopereira.com/articles/prototype.js.html One of the examples does this: var someNodeList = $(''lstEmployees'').getElementsByTagName(''option''); var nodes = $A(someNodeList); nodes.each(function(node){ alert(node.nodeName + '': '' + node.innerHTML); }); How can I access the array index as
2006 Jan 15
6
PROPOSAL: Validations as Mixin
It seems to me that Validations are quite useful for many objects, even ones having nothing to do with ActiveRecord. Common examples are Contact Us forms, multi-step forms, web service paramater validations, etc. I took a look at the source for Validations, and it seems that it is very independent from ActiveRecord. I caught only three depenedencies: 1. validates_numericy --> depends on
2007 Jan 22
1
Prototype.js object.constructor exception
I''m trying to debug an a uncaught exception: Permission denied to get property Object.constructor error. I have some code like this: myObject.js ------------ function myObject (arg1, arg2, arg3) { //does some constructor related stuff } myObject.prototype.createSomething = function() { // do more boring stuff // return an Array; } manager.js ----------- var fakeHashMap = new
2008 Dec 09
7
subclassing vs mixins, which one should be used?
Hey all, I have two models in my rails project that share a lot of traits. They each have the same 4 properties, and now I need to add 2-3 methods to each one that will be the same. In the spirit of DRY I am looking for a solution to write these methods only once. Both of these models already inherit from ActiveRecord . . . and I didn''t know if it was safe to just "whip up" a
2006 Mar 16
20
help with each
can you please tell me why this is not working? i got the example for how to use each online and copied it to a t (except i added the if). its telling me items.each does not exist. var items = document.getElementsByClassName(''editView''); if (items.length > 0){ items.each(function (result){ thisid = result.id; thiskey = thisid.replace(/se_item_/gi, '''');
2006 Jul 20
3
AOP in Prototype / JS
Hey folks I am just investigating using Aspects for logging my main Javascript "interfaces". I don''t believe Prototype has any built in capabilities for this but I just thought I''d check and see how people had tackled this before. I am still getting to grips with core JS so apologies if this is easy or obvious.. I am Googling as we speak also.. Cheers Matt
2007 Nov 01
8
Specifying mixins
Hi folks, Can anyone share some accumulated wisdom about the best way to spec mixins in general, and (Jamis Buck-style) ActiveRecord "concerns" in particular? The standard situation here is that there''s a bunch of functionality, related by concept if not by implementation, that one wants to inherit in many different classes (e.g. ActiveRecord models) without having to
2006 Jan 11
2
Good OOP and JS books / tutorials? Looking to teach my team
Can anyone recommend good books, online tutorials, or any other learning materials for Javascript - specifically Object Oriented Programming using JS? I want the rest of my dev team to be able to help me code in JS, specifically using prototype and scriptaculous. I''ve been using JS for so long, and I kinda "grew up" on OOP programming but my whole team is Coldfusion
2006 Feb 03
3
overloading dragdrop.js
Hi everybody- First time poster, please be gentle. I have written a little rails app where you can create divs and move them around via Thomas'' wonderful dragdrop.js. I would like to be able to fire an AJAX event to update the top and left of the dragged object upon release. I see many AJAX link_to_remote and observe_field. What is the proper way to observe that the position (not
2006 Jan 16
2
Behaviour.js and prototype Event.pointerX
is there a way to take advantage of prototypes Event.pointerX when using Behaviour to manage my events? somthing like.. var myrules = { ''body'' : function(el){ el.onclick = function(){ alert(Event.pointerX(e)); } } }; thanks ______________________________________________________________________ Alex Duffield . Principal . InControl Solutions . http://
2005 Dec 08
2
Prototype.js Hash Methods
Hi, Has anyone seen any documentation on the Hash Object defined in the prototype library? To be precise the following methods - 1. keys 2. values 3. toQueryString 4. inspect 5. Merge I am trying to play around with them and have come up with the following examples - var h = $H({name: "john doe", email: "john-Ch9RrZxMC0c@public.gmane.org", msg: "say hello to