[Rails-spinoffs] Re: [script.aculo.us] disabling and reactivating draggables

2008-07-10 Thread Justin Perkins
Have you tried destroying your draggable? var dragMe = new Draggable('element'); // do stuff dragMe.destroy(); // if you need to make it draggable again later, you'll have to create a new Draggable I've only worked with Sortable, so I might not be the best person to answer this. -justin --~--~

[Rails-spinoffs] Re: RJS on javascript disabled browsers

2008-07-08 Thread Justin Perkins
This list is being phased out, you should move your JS questions to the new list here: http://groups.google.com/group/prototype-scriptaculous To your question, this isn't really a JavaScript related question as it deals with the server responding to different content types. You should look into R

[Rails-spinoffs] Re: Shall we create a new "Prototype Scriptaculous Users" group?

2008-07-03 Thread Justin Perkins
I, and aye could help moderate new member posts if needed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com T

[Rails-spinoffs] Re: form.submit() not firing onSubmit calls

2008-07-02 Thread Justin Perkins
On Tue, Jul 1, 2008 at 11:09 AM, louis w <[EMAIL PROTECTED]> wrote: > Nice one. .click() works. Thanks. If you have an inline JavaScript handler for the submit event, then you can fire it by just calling onsubmit like a method. Given: ... $('my-form').onsubmit() Think of it as a named meth

[Rails-spinoffs] Re: finding orhpaned elements

2008-06-30 Thread Justin Perkins
On Mon, Jun 30, 2008 at 5:21 PM, jdalton <[EMAIL PROTECTED]> wrote: > if you use element = $(element); you shouldnt have to worry about IE, > because the element will be extended and it will have the descendentOf > method. In my usage that is unnecessary since I'm calling that method directly on

[Rails-spinoffs] Re: finding orhpaned elements

2008-06-30 Thread Justin Perkins
Thanks John, welcome improvements. One more tweak so the fallback condition works for IE... Element.addMethods({ isOrphaned: function(element){ if (element.sourceIndex < 1) return true; // for IE only if (element.id) return !element.ownerDocument.getElementById(element.id); return (

[Rails-spinoffs] Re: Disable right click menu

2008-06-30 Thread Justin Perkins
On Mon, Jun 30, 2008 at 3:58 PM, Matt Foster <[EMAIL PROTECTED]> wrote: > Locking down source is a futile effort, but allowing custom context > menus is a fabulous feature. I find the Context Menu in Google > Documents to be quite a delightful UI option, I would have no use for > the standard men

[Rails-spinoffs] Re: finding orhpaned elements

2008-06-30 Thread Justin Perkins
Wow thanks guys, I tend to be overly verbose :) This is what I got now, works great. Element.addMethods({ isOrphaned: function(element){ if (element.id) return !element.ownerDocument.getElementById(element.id); return !element.up('body'); }); -justin --~--~-~--~~-

[Rails-spinoffs] finding orhpaned elements

2008-06-30 Thread Justin Perkins
How do you guys check if an element has been orphaned or not? I've been using the parentNode method, but it only works when the element itself has been removed, but not when the container holding a few elements has been removed (understandably). I know I could probably just use Element#up to chec

[Rails-spinoffs] Re: Array.in_array ?

2008-06-27 Thread Justin Perkins
On Fri, Jun 27, 2008 at 2:09 PM, louis w <[EMAIL PROTECTED]> wrote: > > Is there any intentions of adding a method which operates like the php > in_array. That's what Enumerable#include is for. -justin --~--~-~--~~~---~--~~ You received this message because you a

[Rails-spinoffs] Re: Prototype Error

2008-06-27 Thread Justin Perkins
What version of Firefox and what version of Firebug? Firefox 3 and Firebug is not rock-solid yet. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send

[Rails-spinoffs] Re: submit button with an onclick attribute set doesn't work in opera

2008-06-26 Thread Justin Perkins
On Thu, Jun 26, 2008 at 2:46 PM, Justin Perkins <[EMAIL PROTECTED]> wrote: > This is typically achieved by adding an onStart() handler onStart is nothing, I mean onLoading. ... (untested) -justin --~--~-~--~~~---~--~~ You received this message be

[Rails-spinoffs] Re: submit button with an onclick attribute set doesn't work in opera

2008-06-26 Thread Justin Perkins
On Thu, Jun 26, 2008 at 1:53 PM, Chris S <[EMAIL PROTECTED]> wrote: > finalizing() basically changes the button text and disables the button > while the form is submitting. Works as expected in FF, but in Opera If you disable a submit button before the form onsubmit event actually fires, the form

[Rails-spinoffs] Re: unit test and mocking functions

2008-06-23 Thread Justin Perkins
On Mon, Jun 23, 2008 at 1:27 PM, kangax <[EMAIL PROTECTED]> wrote: > > Unwrapping function is possible, but not in current Function#wrap > implementation. You could either store a reference to original > function Shortly after sending my original message, I realized that all I need to do is store

[Rails-spinoffs] unit test and mocking functions

2008-06-23 Thread Justin Perkins
I'm curious if anyone has written an add-on to unittest to support mocking-like behavior for functions so that we can write assertions that ensure a function is called within other functions. If this hasn't been done, I thought it'd be pretty straight forward to add a assertCall() method to the T

[Rails-spinoffs] Re: [PROTOTYPE] hidden element

2008-06-06 Thread Justin Perkins
On Fri, Jun 6, 2008 at 1:33 PM, Frederick Polgardy <[EMAIL PROTECTED]> wrote: > Well visible() just boils down to a check to see that element.style.display > != 'hidden'. > > If it's hidden by setting style.visibility to hidden, it won't work, you'll > have to check that yourself. Man I really mi

[Rails-spinoffs] Re: [PROTOTYPE] hidden element

2008-06-06 Thread Justin Perkins
On Fri, Jun 6, 2008 at 1:14 PM, Frederick Polgardy <[EMAIL PROTECTED]> wrote: > Depends on how it's hidden, but for the most part you can say: > > if ($(...).visible()) { ... } I think he means where the type=hidden, in which the above would still evaluate to true. You can just say: myElement.ty

[Rails-spinoffs] Re: Update changing visibility?

2008-06-04 Thread Justin Perkins
Why aren't you just using getDimensions()? It does all that work of setting the visibility to hidden if display is set to none so that the dimensions can be determined. No need to reinvent the wheel here. -justin --~--~-~--~~~---~--~~ You received this message be

[Rails-spinoffs] Re: Update changing visibility?

2008-06-04 Thread Justin Perkins
> Yeah, normally you don't want to do visibility: hidden, that keeps the > element in the layout, just doesn't show it. He's doing that so that the dimensions of the element can be calculated. Element.getDimensions() already does this though, if an element is hidden. -justin --~--~-~--

[Rails-spinoffs] Re: Layout of Javascript code - how do you guys do it?

2008-06-04 Thread Justin Perkins
You want to use: document.observe('dom:loaded', yourObserver); From: http://www.prototypejs.org/api/document/observe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this

[Rails-spinoffs] Re: Iframe shenanigans

2008-06-03 Thread Justin Perkins
On Tue, Jun 3, 2008 at 12:22 PM, Paul R. <[EMAIL PROTECTED]> wrote: > As for an example.. I don't think I'm allowed to show what I've built > yet to the world. Think big company NDA > type of stuff. If you could make a simple page that illustrates this issue, it would be easier to help solve it.

[Rails-spinoffs] Re: Iframe shenanigans

2008-06-03 Thread Justin Perkins
Sorry, I didn't realize that you were already shimming. Have you tried playing with the z-index of your menu and iframe, to make the menu z-index larger than the iframe's? I haven't seen behavior like that in Firefox, and I've done quite a bit with DOM-content being overlaid on top of an iframe,

[Rails-spinoffs] Re: Iframe shenanigans

2008-06-03 Thread Justin Perkins
It's due to how IE6 (and earlier versions) draws IFRAMES and SELECT elements. You need to use a shim technique to take care of this problem: http://www.google.com/search?q=iframe+shim+technique -justin --~--~-~--~~~---~--~~ You received this message because you a

[Rails-spinoffs] Re: Will Firefox 3 Break Prototype?

2008-06-02 Thread Justin Perkins
On Mon, Jun 2, 2008 at 10:46 AM, Andy Koch <[EMAIL PROTECTED]> wrote: > so FireBug might be game-day ready now. I don't know about game-day ready, but it's a lot better than it was 2 months ago. -justin --~--~-~--~~~---~--~~ You received this message because you

[Rails-spinoffs] Re: Styling an Anchor Tag With Prototype

2008-05-31 Thread Justin Perkins
On Sat, May 31, 2008 at 2:44 PM, kangax <[EMAIL PROTECTED]> wrote: > > Justin, > there's no need to explicitly return a "rule" in this case. > #detect(#find) does it automatically: Thanks, that's a lot more concise :) -justin --~--~-~--~~~---~--~~ You received th

[Rails-spinoffs] Re: Styling an Anchor Tag With Prototype

2008-05-31 Thread Justin Perkins
You can access the stylesheets via document.styleSheets, and you can even manipulate through these means as well. It gets extremely clunky very fast, but it is possible. Here is an example: var hoverRule = $A(document.styleSheets[0].cssRules).detect(function(rule){if (rule.selectorText == 'a:hove

[Rails-spinoffs] Re: "Not implemented" error in IE for Element.up

2008-05-22 Thread Justin Perkins
What does your complete code look like? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscr

[Rails-spinoffs] Re: IPE question on ok/cancel buttons

2008-05-22 Thread Justin Perkins
Well I was just looking into this a bit further, and I'm thinking the code is this way because it is leftover from the old IPE (it was nearly totally rewritten about a year ago), since it's using native DOM creation methods rather than Prototype helpers. In addition, there are parameters passed in

[Rails-spinoffs] IPE question on ok/cancel buttons

2008-05-22 Thread Justin Perkins
I just noticed that if you're using the ok/cancel buttons in an IPE, and you are using IE, then there is a bug that pops up due to how the click events are attached to those buttons. In IE, there is no event passed into the handleFormSubmission method, so the event is not stopped from bubbling up

[Rails-spinoffs] Re: BUG Firefox 3.0 - getElementsByClassName(...) returning HTMLCollection

2008-05-21 Thread Justin Perkins
This is not a bug with Prototype. getElementsByClassName is a native JavaScript method in Firefox 3. You should use select() or $$() instead. See the Prototype API for getElementsByClassName: http://prototypejs.org/api/element/methods/getElementsByClassName -justin --~--~-~--~~

[Rails-spinoffs] Re: sortables

2008-05-20 Thread Justin Perkins
On Mon, May 19, 2008 at 5:08 PM, elduderino <[EMAIL PROTECTED]> wrote: > I'm working with sortables. I've set constraint to be flase as i want > my list to be sortable in both directions. Is that code in your sortable.js file? I don't see the constraint option being passed in. Try it like this:

[Rails-spinoffs] Re: Fixed headers in a scrollable table

2008-05-20 Thread Justin Perkins
On Tue, May 20, 2008 at 3:23 PM, Justin Perkins <[EMAIL PROTECTED]> wrote: > ... you may wish to utilize CSS to ... That should have read "you may wish to utilize JavaScript". Sorry about that. -justin --~--~-~--~~~---~--~~ You received this

[Rails-spinoffs] Re: Fixed headers in a scrollable table

2008-05-20 Thread Justin Perkins
What you are asking for will require some custom coding, using a combination of a CSS-based approach (use a thead, and a tbody with a fixed height and overflow set to scroll) which will work for the good browsers out there. Unfortunately IE (both IE6 and IE7) does not support such a technique. Yo

[Rails-spinoffs] Re: Class instantiation problems

2008-05-20 Thread Justin Perkins
Try this: var ItemScroller = Class.create({ initialize: function(el,options) { // quit if no main element passed in if (!$(el)) return; this.options = Object.extend({ containerSelector: 'ul', itemSelector: 'li', viewPortSelector: '.wrap', scrollerSelector: '.item_scroller'

[Rails-spinoffs] Re: $(element).select('[attr]') in IE selects attributes *and* methods?

2008-05-15 Thread Justin Perkins
On Thu, May 15, 2008 at 1:19 PM, Byron Young <[EMAIL PROTECTED]> wrote: > I was just using 'attr' as an example meaning 'any attribute'. The > one I actually ran into trouble with was 'show', Show is also a bad choice. Any short, single word is probably a bad choice. I use custom attributes qui

[Rails-spinoffs] Re: $(element).select('[attr]') in IE selects attributes *and* methods?

2008-05-15 Thread Justin Perkins
On Thu, May 15, 2008 at 6:37 AM, RobG <[EMAIL PROTECTED]> wrote: > User agents should ignore unrecognised attributes, but as the OP > discovered, their use can create problems in other ways. Yes, that is a big risk. I meant to mention that in my last reply. If you are aware of these risks when yo

[Rails-spinoffs] Re: $(element).select('[attr]') in IE selects attributes *and* methods?

2008-05-14 Thread Justin Perkins
On Thu, May 15, 2008 at 12:22 AM, RobG <[EMAIL PROTECTED]> wrote: > It is not a good idea to use custom attributes on HTML elements, the > class attribute can provide similar functionality. With all do respect, why? I have been using custom attributes for a very long time and have never seen one

[Rails-spinoffs] Re: Two instances of one class use one variable

2008-05-13 Thread Justin Perkins
You want to setup those variables in the instance methods. The way you have it now, it's being evaluated when the class is being created (not instantiated) and so the variable is global to all classes. var MyClass = Class.create({ initialize: function(someString){ this.myVar = someString;

[Rails-spinoffs] Re: does getDimensions actually work?

2008-05-08 Thread Justin Perkins
> alert(document.viewport.getHeight()); > > In FF the alert says 8, and in IE 6 & 7 I get 0. Isn't this supposed > to return the height of the viewable area? To get the full height of the window, including scrollable space, I've always us

[Rails-spinoffs] Re: prototype PeriodicalExecuter pause/restart patch

2008-05-07 Thread Justin Perkins
What's wrong with just using stop() and start()? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To

[Rails-spinoffs] Re: best way to remove item from array

2008-05-06 Thread Justin Perkins
> The "proxy" is being made this way so that you can simply pass it to > most of enumerable methods - i.e. "function iterator(value, index) Yeah I figured it out shortly after I posted that last message, as you might have guessed I've never used a named function for an iterator before, but it s

[Rails-spinoffs] Re: best way to remove item from array

2008-05-06 Thread Justin Perkins
Can you explain this proxy method a bit more for me... > Regarding your snippet, what about something like: > > var SomeClass = Class.create({ > initialize: function(index) { > this.index = index; > } > }) > > // it might sense to use iterator-like "proxy" for filtering > SomeClass.c

[Rails-spinoffs] Re: best way to remove item from array

2008-05-05 Thread Justin Perkins
On Mon, May 5, 2008 at 7:04 PM, kangax <[EMAIL PROTECTED]> wrote: > > Justin, > there's no need to "wrap" array with $A. Array.prototype is already Thanks for the tip, I'm paranoid. IE has scarred me. I'll try to remember that. I usually initialize with this.foo = $A(), so that's what I was doi

[Rails-spinoffs] best way to remove item from array

2008-05-05 Thread Justin Perkins
Just curious what people's opinions are on trimming items from an array. In my case this is an array of objects, not just a simple array of integers or something. Here are a few possibilities.. $A([1, 2, 3 4, 5]).collect(function(item){ if (item != 4) return true; }).compact(); // I'm concerned

[Rails-spinoffs] Re: finding the index of the selected item in getElementByclassname

2008-04-30 Thread Justin Perkins
On Wed, Apr 30, 2008 at 7:14 PM, smartcookie <[EMAIL PROTECTED]> wrote: > How do you return the selected index of an array of > elementsbyclassname on the element that execute an onclick event? First thing is you should use select() instead of getElementsByClassName(), as you will run into prob

[Rails-spinoffs] Re: Form.Serialize : Pulling My Hair Out

2008-04-30 Thread Justin Perkins
I can't figure out what is wrong either. Can you tell us what is happening? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-s

[Rails-spinoffs] Re: Extensions to select table rows and columns

2008-04-29 Thread Justin Perkins
On Tue, Apr 29, 2008 at 6:13 PM, Mike van Lammeren <[EMAIL PROTECTED]> wrote: > var tableRows = tableElement.down().childElements(); What is the purpose of down() in this case? Is it to get to the tbody? To avoid fetching every row in the table, you could get away with using a child selec

[Rails-spinoffs] Re: Event.observe_if_present

2008-04-28 Thread Justin Perkins
In that situation I prefer to component-ize my page initializers. So I'll have a global initializer that attaches observers to elements that are known to *always* exist, then other initializers that are invoked based on page content. Your solution works also, it's a personal preference. -justin

[Rails-spinoffs] Re: order of including prototype.js

2008-04-25 Thread Justin Perkins
If the onload event for the image fires fast enough, then this will *always* causes errors since you aren't defining the ShowMe function until later in the document. Why don't you put your JS code in the header, to alleviate this problem? -justin --~--~-~--~~~---~--~-

[Rails-spinoffs] Re: requestHeaders not pushing content-length ??

2008-04-25 Thread Justin Perkins
On Fri, Apr 25, 2008 at 11:03 AM, polomasta <[EMAIL PROTECTED]> wrote: > > still no updates... when I check firebug under response it still says > "Loading..." Firebug will say that if no content is returned from an Ajax call. -justin --~--~-~--~~~---~--~~ You

[Rails-spinoffs] Re: Drag and Drop Table Cell Problem

2008-04-24 Thread Justin Perkins
On Thu, Apr 24, 2008 at 1:30 PM, jdalton <[EMAIL PROTECTED]> wrote: > I can't find it in the docs now, but I seem to remember that dragables > and tablers didnt mix well. I would not expect them to. Just thinking about how all that code would work makes my brain hurt. Draggables would great wi

[Rails-spinoffs] Re: delay() and bind()

2008-04-24 Thread Justin Perkins
function foo(){ alert('hello'); } foo(); // -> alerts 'hello' immediately foo.delay(5); // alerts 'hello' in 5 seconds That's the basics for delay. Since you're trying to use 'this' to invoke the method, you need to bind it (sorry, I should have mentioned this in the earlier reply)... var Foo

[Rails-spinoffs] Re: delay() and bind()

2008-04-24 Thread Justin Perkins
On Thu, Apr 24, 2008 at 10:54 AM, Geuintoo <[EMAIL PROTECTED]> wrote: > this.hideNavi().delay(5000); > this.hideNavi().bind(this).delay(5000); Yes, those won't work. You are invoking the function and then trying to call delay on the invoked function.. no go. Try: this.hideNavi.delay(5) Note

[Rails-spinoffs] Re: Prototype object functions in posted ajax array

2008-04-23 Thread Justin Perkins
On Wed, Apr 23, 2008 at 2:17 PM, Dan Previte <[EMAIL PROTECTED]> wrote: > Looks like $A instead of new Array() or new Object fixes it. Ahh, yes. I was looking at the Ajax.Base#initialize method which only parses out Strings or Hashes. If you look a little further, at the request method, the code

[Rails-spinoffs] Re: Prototype object functions in posted ajax array

2008-04-23 Thread Justin Perkins
On Wed, Apr 23, 2008 at 11:27 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Anyone know why posting an array in an Ajax Request You either want to pass a string or a Hash as the parameters value, not an Array. How would you like your post data to look when it comes in to the server? -ju

[Rails-spinoffs] Re: Incorrect value for the href link attribute for javascript handlers

2008-04-22 Thread Justin Perkins
That's why in the handleFormCancellation method the event.stop() method is called. All browsers will focus the top of the page when you click a link with '#' as the HREF, unless the event is prevented from bubbling up. -justin --~--~-~--~~~---~--~~ You received t

[Rails-spinoffs] Re: getStyle({margin}) on TD element is null in IE

2008-04-22 Thread Justin Perkins
Table cells are not allowed/supposed to have margins. "Like other elements of the document language, internal table elements generate rectangular boxes with content, padding, and borders. *They do not have margins*, however." Source: http://www.w3.org/TR/REC-CSS2/tables.html#q7 -justin --~--~-

[Rails-spinoffs] Re: Ajax.request - SOAPAction

2008-04-21 Thread Justin Perkins
You can pass in custom headers with the requestHeaders parameter I believe. Such as: new Ajax.Request('/foo/bar', {requestHeaders: {'SOAPAction':'updateClient'} } ) Un-tested. Take a look at the prototype source code in the setRequestHeaders method of the Ajax.Request class for more info. -just

[Rails-spinoffs] Re: scriptaculous InPlaceEditor validation

2008-04-19 Thread Justin Perkins
On Sat, Apr 19, 2008 at 9:31 AM, Aart Nicolai <[EMAIL PROTECTED]> wrote: > That's right. Server side validation is always required, using client side > validation you can save a roundtrip to the server. From my point of view > client side validation should be an option for IPE. I recommend extend

[Rails-spinoffs] Re: Nested Droppable divs -- drag & drop

2008-04-18 Thread Justin Perkins
I've never done too much with droppables, other than for re-ordering simple lists. What is the use-case for a droppable target with more droppable targets inside? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[Rails-spinoffs] Re: scriptaculous InPlaceEditor validation

2008-04-18 Thread Justin Perkins
On Fri, Apr 18, 2008 at 8:40 AM, Garito <[EMAIL PROTECTED]> wrote: > > Sorry Justin but > "The InPlaceEditor is not really intended to behave like that. " is a > not very realistic response. I think the validation is a so normal Validation on the server is normal, but imo validation on the cli

[Rails-spinoffs] Re: Keeping 'this' with bindAsEventListener

2008-04-17 Thread Justin Perkins
On Fri, Apr 18, 2008 at 12:04 AM, anathema <[EMAIL PROTECTED]> wrote: > > Thanks for the added reply Justin, although I am just confused now. Sorry about that. > $(this).hasClassName is not a function Unless you're talking about instances of objects, which you clearly are not talking about, '

[Rails-spinoffs] Re: Keeping 'this' with bindAsEventListener

2008-04-17 Thread Justin Perkins
To add to kangax's reply, it is possible to pass in additional parameters to the bindAsEventListener call and they will be passed down to your observing function via additional parameters. Keep in mind though that the first argument will always be the fired event object. Here is a small example wi

[Rails-spinoffs] Re: scriptaculous InPlaceEditor validation

2008-04-17 Thread Justin Perkins
The documentation is lacking at the moment, due to being moved around. I've found it's best to just read the source code, but I think a new documentation site is in the works. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

[Rails-spinoffs] Re: scriptaculous InPlaceEditor validation

2008-04-17 Thread Justin Perkins
The InPlaceEditor is not really intended to behave like that. You can either cancel the edit, in which case the Ajax will not occur, or you can submit the changes in which case there is nothing you can do to stop the Ajax from being sent (aside from overriding the handleFormSubmission method).

[Rails-spinoffs] Re: scriptaculous InPlaceEditor validation

2008-04-17 Thread Justin Perkins
s for the quick reply. > I validate on the server as well, but the generated error message appears in > the InPlaceEditir field. I just would like to see an javasscript alert.. > > > > On 17/04/2008, Justin Perkins <[EMAIL PROTECTED]> wrote: > > > > The InPlac

[Rails-spinoffs] Re: what javascript editor/IDE do you recommend for someone learning javascript & prototype code???

2008-04-14 Thread Justin Perkins
On Mon, Apr 14, 2008 at 7:59 PM, greghauptmann <[EMAIL PROTECTED]> wrote: > > oh really - I knew you could step through existing js code. So you're > saying I could open any html page and then in FireBug write some > javascript and then run/step through it? Yes. Drop the keyword debugger anyw

[Rails-spinoffs] Re: trying to use Ajax.InPlaceEditor

2008-04-07 Thread Justin Perkins
On Mon, Apr 7, 2008 at 9:30 AM, David Beckwith <[EMAIL PROTECTED]> wrote: > adding $('edit_field').update('[EMAIL PROTECTED]'); For some reason $ > ('edit_field').value = . wasn't working but .update did do the > trick. That's because the element with an ID of 'edit_field' is your paragra

[Rails-spinoffs] Re: trying to use Ajax.InPlaceEditor

2008-04-07 Thread Justin Perkins
> I tried setting htmlResponse: false, I think that solved the problem, > but now I just see "Saving . . . . ." How do I update it with the > latest value? Why are you only responding to the JS content type if the save was successful. You need to handle both situations. Also, if you're going

[Rails-spinoffs] Re: IE and Element methods

2008-04-02 Thread Justin Perkins
> Just updated to version 1.5.1.2 to see if it would fix the problem The latest version is 1.6.0.2. It offers the extensions you are looking for. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Ra

[Rails-spinoffs] Re: How to do multiple inheritance with mixins in 1.6?

2008-03-26 Thread Justin Perkins
On Wed, Mar 26, 2008 at 7:16 PM, kangax <[EMAIL PROTECTED]> wrote: > var Person = Class.create( Vulnerable, Dangerous, ... Nice! I tried passing an array of modules as the first argument but didn't think to try like that. Way nicer. Guess I should have looked at the source code first. :) -just

[Rails-spinoffs] Re: Form.Element.disable() shifts focus in some browsers...why?

2008-03-26 Thread Justin Perkins
As noted in that trac ticket, simply removing the call to blur is a somewhat poor solution to the problem. If you have other event observers that are listening for the blur event, this can have an undesirable effect. Making sure that the element you're about to disable currently has focus, before

[Rails-spinoffs] Re: Form.Element.disable() shifts focus in some browsers...why?

2008-03-26 Thread Justin Perkins
On Wed, Mar 26, 2008 at 3:55 PM, kangax <[EMAIL PROTECTED]> wrote: > > You could apply this patch http://dev.rubyonrails.org/ticket/11214 I guess I misunderstood the question, I thought the complaint was that an element that had focus, was then disabled and thereby lost focus and the author of t

[Rails-spinoffs] Re: Form.Element.disable() shifts docus

2008-03-26 Thread Justin Perkins
Disabled form elements by there very definition cannot have focus. The blur() event is fired just before the control is disabled. IE is doing it wrong :) -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails-spinoffs] Re: How to do multiple inheritance with mixins in 1.6?

2008-03-26 Thread Justin Perkins
I should follow up that when I said "if both the classes" I really meant to say objects. I don't even want to know what happens when you start mixing together multiple classes into a child class (which all would have an initialize method) and then try to instantiate a new hybrid object. Don't do i

[Rails-spinoffs] Re: How to do multiple inheritance with mixins in 1.6?

2008-03-26 Thread Justin Perkins
Well, you're going to run into trouble if both the classes you are trying to mixin to you Person class are both implementing the same method names, but assuming that is not the case you can use Object.extend to mixin another set of methods when you're creating the class. This is pretty crazy and i

[Rails-spinoffs] Re: Prototype Element.insert API documentation

2008-03-26 Thread Justin Perkins
On Wed, Mar 26, 2008 at 2:43 PM, adriand <[EMAIL PROTECTED]> wrote: > > as currently, I do > think it is a bit lacking. It's lacking from a "new to prototype" sense, but once you're familiar with prototype I think you'll find that the site is a wonderful resource. I do agree that it (that sente

[Rails-spinoffs] Re: Prototype Element.insert API documentation

2008-03-26 Thread Justin Perkins
Your copied text is lacking the code syntax from the page, but "position" is a keyword and is to be replaced by the position you desire. Here are some examples: $('foo').insert( { top: 'Hello' } ) $('foo').insert( { bottom: 'Hello' } ) $('foo').insert( { before: 'Hello' } ) $('foo').insert( { aft

[Rails-spinoffs] Re: PeriodicalUpdater Stop

2008-03-26 Thread Justin Perkins
Isn't the problem that you're assigning the periodical updater to a global variable objTick and then later you're trying to access the same object via this.objTick? > objTick = new Ajax.PeriodicalUpdater( > ... > this.objTick.stop(); The Ajax.PeriodicalUpdater object most certainly supports the

[Rails-spinoffs] Re: Having Difficulty Updating Text Field

2008-03-25 Thread Justin Perkins
On Tue, Mar 25, 2008 at 12:04 PM, kangax <[EMAIL PROTECTED]> wrote: > > There's a (not yet documented) #setValue method (since 1.6) True, but isn't it Form.Element.setValue('id, 'value') ? $('id').value = 'value' is still pretty easy :) -justin --~--~-~--~~~---~--~

[Rails-spinoffs] Re: Having Difficulty Updating Text Field

2008-03-25 Thread Justin Perkins
You cannot use an Ajax.Updater to update an input control. All the updater does is basically call $('your-id').update('your Ajax Response') which will never work on an form control. Switch back to using an Ajax.Request and an onSuccess handler like you were doing before if you really want to upda

[Rails-spinoffs] Re: Having Difficulty Updating Text Field

2008-03-25 Thread Justin Perkins
On Tue, Mar 25, 2008 at 11:10 AM, Joe Harman <[EMAIL PROTECTED]> wrote: > $F('greeting') = transport.responseText; $F() is a reader only, it cannot be used as a setter. After all, it's just a function call and you cannot assign a value to a function call in JavaScript (to my knowledge). Like Br

[Rails-spinoffs] Re: What is the corresponding scripaculous version for Prototype 1.5.1

2008-03-03 Thread Justin Perkins
On Mon, Mar 3, 2008 at 11:11 AM, Brian Williams <[EMAIL PROTECTED]> wrote: > Just because Intel releases a new chip doesn't mean I need to go out and buy > it. Just because you have lots of metaphors up your sleeve, doesn't make them applicable to web development ;) This is how I look at it: Upg

[Rails-spinoffs] Re: What is the corresponding scripaculous version for Prototype 1.5.1

2008-03-03 Thread Justin Perkins
On Mon, Mar 3, 2008 at 1:57 AM, NavneetK <[EMAIL PROTECTED]> wrote: > I was suggested to change the scriptaculous version to the one > that uses Prototype 1.5.1. > > Can anyone tell which scriptaculous version uses prototype 1.5.1 All the old scriptaculous distributions can be found here: http

[Rails-spinoffs] Re: IE: don“t get element-focus if I enhancing the DOM-Tree via "Element.insert" or "appendChild( )"

2008-03-03 Thread Justin Perkins
I didn't realize that you could focus non-form controls, such as a span. What purpose does this serve? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group,

[Rails-spinoffs] Re: What is the corresponding scripaculous version for Prototype 1.5.1

2008-03-03 Thread Justin Perkins
On Mon, Mar 3, 2008 at 10:36 AM, Brian Williams <[EMAIL PROTECTED]> wrote: > if it ain't broke why should I waste my time "fixing" it? Because the newer version of prototype is more efficient, has more features and is easier to extend/monkey patch than any previous version. Same goes for the late

[Rails-spinoffs] Re: How do I know when my move effect is finished? (script.aculo.us)

2008-02-24 Thread Justin Perkins
On Sun, Feb 24, 2008 at 10:43 PM, mng0 <[EMAIL PROTECTED]> wrote: > I want to call another method after my move-effect is finished. You want to use the afterFinish parameter to pass in a function. http://wiki.script.aculo.us/scriptaculous/show/CoreEffects -justin --~--~-~--~~-

[Rails-spinoffs] Re: Who wants to 'Kick'/'Ban' "Share and Care blog"?

2008-02-22 Thread Justin Perkins
Moderating new members would make the list spotless, but does require substantially more work on behalf of the admins. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post

[Rails-spinoffs] Re: wiki down?

2008-02-20 Thread Justin Perkins
On Wed, Feb 20, 2008 at 11:54 PM, joe t. <[EMAIL PROTECTED]> wrote: > Wow, would have thought more people would have noticed and/or spoken > up by now. i've seen it down since Wednesday. Do you mean Wednesday of last week, because today is Wednesday :| There was this other thread from two days

[Rails-spinoffs] Re: Adding new javascript function using Insertion (or Element.replace)

2008-02-18 Thread Justin Perkins
You might want to consider defining the function once in your JS file, then call it from the Rails partial with parameters instead of re-defining the function every time the partial is rendered. There was a thread about this recently, I seem to remember the guy in that thread having a similar pro

[Rails-spinoffs] Re: Event.observe on hidden element

2008-02-15 Thread Justin Perkins
You should be able to attach events just fine to hidden elements, assuming they are in the DOM, but with their visibility turned off (display:none or visibility:hidden). -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

[Rails-spinoffs] Re: Topics for a quick presentation on Prototype

2008-02-12 Thread Justin Perkins
On Feb 13, 2008 12:02 AM, emullet <[EMAIL PROTECTED]> wrote: > Is there anything else that I'm missing that would be really useful to > newbs? Event observers? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails-spinoffs] Re: Element.update removing tags

2008-02-12 Thread Justin Perkins
You cannot have a form in a form, you're probably doing a page.replace_html 'form_id', :partial => 'form_partial' which is causing this situation. You need to have an inner div with a unique ID and a partial for the form contents that you will replace. Something like: Then in your R

[Rails-spinoffs] Re: acts_as_taggable Rails 2.0.2.

2008-02-12 Thread Justin Perkins
acts_as_taggable is a plugin in Rails 2.0, as is many other things that provided JavaScript helper methods for you. This is better discussed on a Rails-focused list. This post explains all the changes (see the section titled "Active Record: Shedding some weight"): http://weblog.rubyonrails.org/20

[Rails-spinoffs] Re: In-Place Editor when field is empty

2008-02-11 Thread Justin Perkins
If there is nothing there but white space, how is anyone supposed to know that the intention is to click to edit the non-existent value? This was discussed recently, the comments in this thread may help: http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/3d983cb0b37d86c0/0a5

[Rails-spinoffs] Re: Ajax.Request evalJSON document.write hangs

2008-02-10 Thread Justin Perkins
On Feb 10, 2008 2:57 PM, Burst Web Solutions <[EMAIL PROTECTED]> wrote: > Its writing the value to the screen That's what happens when you use document.write like that. If you're just debugging, and you use Firefox/Firebug, use console.log instead. -justin --~--~-~--~~~-

[Rails-spinoffs] Re: Upgrading Prototype

2008-02-08 Thread Justin Perkins
To add to Christophe's reply, for clearing out hash entries, use the unset method... myhash.unset(propNameExpr) Depending on the size of your project, this can be a rather daunting exercise, but well worth it :) -justin --~--~-~--~~~---~--~~ You received this me

[Rails-spinoffs] Re: Object does not support this property or method... obviously only in IE

2008-02-06 Thread Justin Perkins
On Feb 6, 2008 9:18 AM, Abba <[EMAIL PROTECTED]> wrote: > > Thanks, it works. But in the end is like passing the Id of the element > and then make a getElementByID... is not what i was expecting :( The $() function not does what the getElementByID() function does, but it also does so much more, i

[Rails-spinoffs] Re: Catching Ajax Failures (not 500s)

2008-02-05 Thread Justin Perkins
Thanks a lot Ken, that's exactly what I need to see. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.co

[Rails-spinoffs] Catching Ajax Failures (not 500s)

2008-02-05 Thread Justin Perkins
I am trying to catch failed Ajax requests, but I'm talking about requests that receive no response from the server (server is down), not responses that result in a 500. The latter can be handled with the onException or onFailure callback, but I am not able to handle the former. To reproduce/test

  1   2   3   >