Recent Posts by Christophe Porteneuve
|
Jul 27, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / ShiftClick to select a range of check boxes Hey Johan, Well your implementation works alright. It makes little use of “comfort methods” so it’s pretty fast as it is. I have a few remarks, however:
So I might rephrase your function like this:
There are several tricks we could use to size it down a little, but they’d be somewhat detrimental to speed, so the trade-off isn’t so good. ‘HTH |
|
Jul 23, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / ShiftClick to select a range of check boxes Hey Johan, No time to reply just now, but the problem is interesting and I think I see a simple solution. Ping me by email tomorrow and I’ll try to come up with something here. Cheers, |
|
Jul 18, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Draggable Blocks Size problem Hey there, These forums are not exactly a support list, especially outside the context of the book itself. Just now, I won’t have the time to dive into your problem and help. I suggest you take the following steps:
I hope you’ll get a good reply! |
|
Jul 16, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / prototype toggle with image rollover? Well, that’s a way to have it work. I dislike inline event handlers, but they sure work in this case. And just changing the What I don’t really get is why you keep using |
|
Jul 8, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / DOM Oh. The archive wasn’t regenerated after the recent typo fix in one of the early code blocks. This only borked IE, are you using IE? This is all due to a superfluous comma before closing the You’ll have to explain “static”. Do you mean it is bound to elements already present in the DOM at load time? Going dynamic simply means that after injecting your form elements in the page’s DOM, you can register event handlers for them using Also, it’s been my experience that in dynamic, user-controled forms, most of the event-related behavior is not field-specific, but by field kind. So perhaps using appropriate field classes and event delegation at the whole form’s level would be a win, too. |
|
Jul 7, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / DOM Hey, So sorry, but I have no idea what you’re talking about… Could you perhaps illustrate your need? |
|
Jun 28, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Effect.Highlight Bug Hey Kevin, ‘sounds to me like there was some weird overwrite+typo on your effects.js file: “toRngorPart” should read “toColorPart,” which bears the hallmark of an overzealous search-and-replace of “Col” to “Rng” (perhaps you did a project-wide change instead of a file-wide change?) |
|
Jun 15, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Chapter 16 - AutoCompletion Hey Bharat, Well, I finally found time to wrap up the article and full demo page: check it out I hope this addresses your questions. |
|
Jun 10, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Chapter 17: Builder Regular IE “debugging:” load the page with individual JS messages enabled, see the line being claimed as faulty, then go to the JS file, sprinkle Fortunately, the script for this page is pretty short :-) |
|
Jun 9, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Chapter 17: Builder Hey Bharat, Thanks for the heads up! I’m astounded this hasn’t cropped up before… I investigated and posted an errata notice on the book’s blog. |
|
Jun 9, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Chapter 16 - AutoCompletion Hey Bharat, Your request actually gave me an idea for a fuller post on the book’s blog. Obviously it’s taking some time to write, and I have precious little of it, but it’s moving ahead nonetheless. Keep an eye on the book’s blog for it, it’s going to be the next post, and will discuss rich contents in Ajax autocompletion and how to leverage it with predefined options and Cheers, |
|
Jun 9, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Praise and suggestion Hey Matt, Well, thanks for the praise! I’m delighted the book is helpful to you. As for your suggestion, it’s a pretty good idea. I’ll keep it around for the second edition, and tuck it somewhere between the intro and the Prototype part (or, at worst, put it up as first appendix and reference it throughout the book). |
|
Jun 6, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Array.indexOf Hey, So your point, I guess, is that our Thanks and cheers, |
|
Jun 2, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Adding a drop down menu Hey Mike, Essentially, you should try and style your menu items so that they appear in the proper positions by default, all shown. Use a first-level list for the top navbar, and inner lists inside the The markup would go like this:
Then you should style those using a
When it renders well on all browsers you want to support, add the inline hiding and event-based ‘HTH |
|
Jun 2, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Adding a drop down menu Have a look at the SCTI website I did a while back, which does what you want. It uses semantic markup for the menu (nested lists) and JavaScript to react to mouseover/mouseout’s by hiding/showing the sublists. CSS positions the menus. The script ( ‘HTH |
|
May 27, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Section 9.4 Polling: Ajax.PeriodicalUpdater Hey Bharat, I believe the issue you have with IE7 is that you may have not configured it out of its stupid defaults, so that it would check the server on each request in order to know whether to invalidate its cache or not. The default setting says something like “automatic,” which should more properly be worded “moronic.” Forcing About the connection closed thing: perhaps you closed IE right when it was performing a POST to the server? As connections are not supposed to be Keep-Alive, that may explain it. Also, I can’t vouch for JRuby’s properly running WEBrick, but I suspect it does fine all the same. |
|
May 24, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / dom example does not work in IE 7? Sharing is what we write books and speak at conferences for, man :-) Looking forward to hook up at TAE, then! |
|
May 23, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / dom example does not work in IE 7? Hey Bharat, I’m glad you enjoy the book! As for your questions: 1. Effectively debugging JS in MSIE is a friggin’ mess. Basically, either you have VisualStudio installed and plug into IE with it, or you’re pretty much out of luck. The IE Developer Toolbar is a joke, and whatever “features” it has don’t extend to JS anyway. Still, there are new 3rd-party plugins being released quite often, and I can’t keep on top of it all, so perhaps there is a better alternative these days. If there were, I’d love to know about it! The way I go about frontoffice dev these days is: develop, debug, tune and hone with Firefox and Firebug, double-check on Safari 3 and Opera 9, then test on IE7, then on IE6. Experience has me put a few extra tidbits here and there for IE’s sake when I script, but Prototype handles most of the complexity of this for you, so it’s just a matter of avoiding certain well-known issues (mostly related to table components and 2. I don’t know, really. IMHO, the book’s DOM chapter strives to explain away any potential complexity or “trick” in the code, so it’s more a matter of carefully reading the surrounding text when you try the code out. If there are pending questions after that, you could ask about them here or on the book’s blog, for instance as comments on the relevant Neuron Workout solutions post. 3. What JS lib you use is orthogonal to whether you use Rails or not. I prefer Prototype over jQuery but that’s largely a question of coding style. jQuery works just fine with any backend, as does Prototype. What framework you’re using server-side shouldn’t constrain your client-side choices (except perhaps in the ASP.NET world, but even there, most people ditch Ajax.Net to use another, more established lib such as Prototype, jQuery or Dojo). Still, the nice thing about using Prototype is that it’ll let you use RJS, for instance. And while you could load Prototype for RJS purposes, and jQuery for your own custom scripting, it feels pretty heavy-handed. ‘HTH |
|
May 22, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / dom example does not work in IE 7? Hi Bharat, First, know that there is an issue with the script as present in the book, that b0rks some behavior in IE: there’s an extraneous trailing comma at the end of the Second, if you still have issues, as this is a fairly large example, the first thing to try is the online example (except for this stupid comma, which should be fixed online pretty soon). You can download all the files from its directory, correct the comma, and try that. I assure you this works on all major browsers. You would then diff against your own copy and see whether you perhaps mistyped something? ‘HTH |
|
May 16, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Slider and drop down lists Hey Abbas, Well, I’m not going to guide you through a complete UI control creation, this is not what these forums are for, and I lack the time. BUT, the product browser you’re linking to is, indeed, based on Prototype and script.aculo.us (through the Control.Slider class), with a couple nice UI touches on it, such as putting category labels on top of the handle image, and dissociating the actual handle (invisible) and the image to let the “visible” one slide around when you click. You can get inspiration on how to replicate this cool widget by looking at its source code (it’s in http://www.apple.com/global/scripts/product_browser.js), but be sure to avoid just copy-pasting it: the code belongs to Apple. At any rate, it probably relies on data structures not quite fit for your own purposes. You’ll probably need to dive into the Sliders chapter around the end of the book before, though. ‘HTH |
|
May 2, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / How to create traggable columns with Prototype and Scriptaculous Hey Geshan, Can you clarify what you mean by “columns” and “rows,” exactly? Effectively dragging table rows is kind of a nightmare for now, as various browsers have a very different level of support for As for columns, they’re not represented by an element in HTML, so you can’t make a whole column draggable, as there’s no such element as the column itself. If you need to make columns draggable, it has to look like a column, but actually be something else codewise. Perhaps what you’re looking for is just a series of left-floating Perhaps HTML tables are mandated in your page because of the semantics of the underlying data, but if you don’t mind wrecking the semantics of the page, you can use alternate markup and CSS tricks to make it all draggable. It becomes pretty easy then: just consider what floating elements can do, when dragged! Also, if you’re more into just creating a portal-like interface, have a look at Sébastien Gruhier’s Prototype Portal attempt. |
|
May 1, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Replace dashes with other text Hey Mike, I put a minimalistic demo page for it up at http://tddsworld.com/questions/ Let me know if that makes it. |
|
Apr 26, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Drag & drop question about revert behavior Glad I could help. Keep reading! :-) |
|
Apr 26, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / Drag & drop question about revert behavior Hey Jeff, I believe the special Let me know if that cut it out for you! Cheers, |
|
Apr 8, 2008
Christophe P...
48 posts
|
Topic: Prototype and script.aculo.us / binding? scoping? That’s because you used responseText instead of responseJSON, tss tss… |
48 posts
