[Proto-Scripty] Re: How to handle non-JavaScript browsers when using Ajax.Updaters for content
True. We actually dabble in Catalyst w/ Template Toolkit, but so far have actually found it far more intrusive that helpful to our online application, hence we're hand coding everything on the production site to-date [using handmade HTML, PHP, Prototype, LivePipe, and a dash of Scriptaculous!). I also completely agree that the use of Ajax is to optimize in new-and-awesome ways for the user experience, which strictly speaking has the exact effect you mention: extra work coding to make those optimizations happen. With that said I refuse to make things ugly server side because we want to optimize past web 1.0 using an Ajax framework yet maintain backwards compatibility. I'm going to push on with this problem and hopefully come up with an elegant solution to the hybrid goal of Ajax-y goodness and SEO (which is the real reason anybody should care about non-JavaScript support IMHO). I'll of course post back with anything we can come up with... cheers- On Thu, Sep 11, 2008 at 7:48 PM, Ken Snyder [EMAIL PROTECTED] wrote: On Thu, Sep 11, 2008 at 6:19 PM, dustin [EMAIL PROTECTED] wrote: That seems like it would work nicely, but doesn't it pretty much negate the gracefulness of using Ajax to insert content into a DIV (the grace that allowed me to stop maintaining clumsy header.php, footer.php, navbar.php, etc, and piecing together based on the user- agent type)? Yes, I was oversimplifying. If you use an MVC system, you shouldn't ever have to worry about headers, footers or nav bars. With MVC, the layout template echoes your content. When requested by ajax, the layout template will be blank. Otherwise the layout template will be a complete page minus the content. For example: empty.phtml: - ?php echo $content ? htmlHeadAndFootAndNav.phtml: - html head.../head body div id=page div id=header div id=navigation.../div /div div id=content ?php echo $content ? /div /div /body /html myContent.phtml: - ?php ob_start() ? pContent.../p ?php $content = ob_get_clean(); if ($_REQUEST['ajax']) { include 'empty.phtml'; } else { include 'htmlHeadAndFootAndNav.phtml'; } ? Ajax isn't traditionally used to make less work on the server side; it is usually implemented to reduce page load times and allow immediate feedback for simple actions. If you're looking for better content management, start with a CMS or an MVC framework on the server side. Oops, that was a long answer. :P - Ken --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] User types freely on webpage and it jumps to a link...
Not sure this is the right group for this question, I'm looking for a bit of JavaScript functionality for a site... I have a huge html page with a big list of links and want the user to be able to type the beginning of the word of the link (not in a box just freely type) and it jumps to that link... Expecting to be using JavaScript on it's own or Ajax, not really bothered... Any ideas? Sorry again if I'm in the wrong place! --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: User types freely on webpage and it jumps to a link...
Just thought of a great comparison.. I want it to work like the phonebook in a mobile phone where you complete more and more of the name and it moves down the list accordingly. Cheers On Sep 12, 8:53 am, beebul [EMAIL PROTECTED] wrote: Not sure this is the right group for this question, I'm looking for a bit of JavaScript functionality for a site... I have a huge html page with a big list of links and want the user to be able to type the beginning of the word of the link (not in a box just freely type) and it jumps to that link... Expecting to be using JavaScript on it's own or Ajax, not really bothered... Any ideas? Sorry again if I'm in the wrong place! --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re:Livepipe
HI all, Wondering whether I have to have ruby to use livepipe??? --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Get value from table cell when table row have checkbox checked
On Sep 12, 5:10 am, Daniel Lopes [EMAIL PROTECTED] wrote: Thanks Diogo... this fix my problem: function check_entries(){ sum = 0; $$(#entries_list input:checked).each( function(e) { value = $(value_+$(e).id).innerHTML; value = currency_to_float(value); sum += parseFloat(value); }); alert(sum); } function currency_to_float(value){ value = value.gsub(/[R$.)]/, '') ; value = value.gsub(/,/, '.'); value = value.gsub(/(/,'-'); return value } An approach I have used is something like $$(#entries_list input:checked).each( function(e) { var value = e.up('tr').down('.value').firstChild.value; Since you are using their position in the DOM tree, you don't have to worry about setting the right id on the value TD's. Colin --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effects.toggle messes up the overflow style
I'm using the Effects.toggle effect on a div that has the overflow: auto attribute on it's style. The problem is that the execution of the effect clear the overflow attribute so it's no longer set to auto after the effect executes. This only happens with the script.aculo.us toggle effect. If i use the simple prototype toggle function the overflow attribute isn't clear and everything works fine. --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effects.toggle messes up the overflow style
Hi Hugo, depending on effect, sometime scrtiptaculous change CSS properties, the only method i found was to check before the effect the CSS propertiy, save it and on afterFinish event, set the saved value. -- david On 12 sep, 13:11, Hugo Palma [EMAIL PROTECTED] wrote: I'm using the Effects.toggle effect on a div that has the overflow: auto attribute on it's style. The problem is that the execution of the effect clear the overflow attribute so it's no longer set to auto after the effect executes. This only happens with the script.aculo.us toggle effect. If i use the simple prototype toggle function the overflow attribute isn't clear and everything works fine. --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: a problem with IE
will i dont hardcode any thing since i deal with url as variables taken from db , so that i dont care about hardcode the domain . On Sep 12, 7:55 am, Justin Perkins [EMAIL PROTECTED] wrote: On Thu, Sep 11, 2008 at 11:21 PM, zaher ghaibeh [EMAIL PROTECTED] wrote: can i ask you where you got this rule from ? It's not really a rule, just a good practice so that you can move your code from server to server and your code will work without alteration. If you always hardcode the domain then you'll have branch your code all over the place for production vs. dev/test. -justin --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Trouble with Element.extend in cross-window interaction in IE
Hi dolzenko, If I understand, you extend the window1 with window2 object ??? Why not extending with static method, so event if a window is present or not, the element is extend -- david On 11 sep, 09:00, dolzenko [EMAIL PROTECTED] wrote: Say we have two windows. Window2 operates (and extends) some element from Window1. Then Window2 is reloaded and tries again to operate on Window1 element, which fails with Can't execute code from a freed script error in IE. That behaviour probably makes sense, as element in Window1 was extended from now absent (after reloading) part of script in Window2. So how do I deal with this? Should I somehow force element extending from reloaded window? --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Livepipe
Dunno. This group has nothing to do with Ruby. On Sep 12, 7:19 am, jason maina [EMAIL PROTECTED] wrote: HI all, Wondering whether I have to have ruby to use livepipe??? --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Get value from table cell when table row have checkbox checked
On Sep 12, 12:53 pm, Daniel Lopes [EMAIL PROTECTED] wrote: This not solution when you want use grids... table are not for layout, right use is to display data, layout must be maded in divs. That makes no sense at all. I wasn't suggesting your use of a table is wrong, but that you use the form controls the way they were meant to be used, i.e. in a form. -- Rob --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Effects.toggle messes up the overflow style
That worked great, thanks for the tip. Cheers, Hugo On Sep 12, 1:16 pm, david [EMAIL PROTECTED] wrote: Hi Hugo, depending on effect, sometime scrtiptaculous change CSS properties, the only method i found was to check before the effect the CSS propertiy, save it and on afterFinish event, set the saved value. -- david On 12 sep, 13:11, Hugo Palma [EMAIL PROTECTED] wrote: I'm using the Effects.toggle effect on a div that has the overflow: auto attribute on it's style. The problem is that the execution of the effect clear the overflow attribute so it's no longer set to auto after the effect executes. This only happens with the script.aculo.us toggle effect. If i use the simple prototype toggle function the overflow attribute isn't clear and everything works fine. --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: User types freely on webpage and it jumps to a link...
Yes you could just setup a keyup observer on the entire document, the two problems that I see right away is that any keyboard shortcuts the user already uses may or may not work any longer depending on how you write your code. Secondly, depending on the size of the list of links, the script may take a while to process each keypress. There's a few other issues I'd be concerned with, but the above is probably enough to think about for now. Having a textbox to type into would solve the first problem. Keeping a copy of the list of links in a local variable would help to solve the second problem. -justin --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Livepipe
No, just JavaScript. http://goodserviceguide.com uses it, and it's written in PHP. Walter On Sep 12, 2008, at 7:19 AM, jason maina wrote: HI all, Wondering whether I have to have ruby to use livepipe??? --~--~-~--~~~---~--~~ --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: prototype.js problemfix
On Sep 12, 11:44 am, achernin [EMAIL PROTECTED] wrote: prototype.js, Version: '1.6.0.2', Line 3462 focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; }, this code is unsafe. findFirstElement() function returns empty value, if form has no elements. look at this: var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type !element.disabled; }); so, our solution is to rewrite focusFirstElement like this: focusFirstElement: function(form) { form = $(form); var element = Form.findFirstElement(form); if(!Object.isUndefined(element)) element.activate(); return form; }, What do you think? Good catch. I think there's no need for `isUndefined`: focusFirstElement: function(form) { form = $(form); var element = form.findFirstElement(); element element.activate(); return form; } Could you please file a bug report. Thank you. Regards, Alexander Chernin, Naumen comp. -- kangax --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: autocompleter does not work with contents pasted by using mouse
On Fri, Sep 12, 2008 at 11:57 AM, Jack [EMAIL PROTECTED] wrote: Question 1: I've observed that when copy paste the search string using keyboard in the text box, it displays hints. However, if I copy paste the same stuff using mouse, then the hints are not displayed at all. I think the even is placed on keydown or something. The Autocompleter listens for the keydown event to trigger Ajax request. To accommodate the event you are describing, you could wrap the Autocompleter#baseInitialize method and add an additional mousedown or mouseup listener bound to the same method that the keydown listener invokes. Question 2: I kept minChars to 2 I entered ab in text box, it shows hints for all matching abs. If I enter a (a followed by a space), it does not even invoke anything does not display hint. Is this a bug? Why space is excluded? Any workaround? The reason for this is because the input is stripped (leading and trailing spaces removed) which means that a single character followed by any number of spaces is still considered a single character. The default minChars value is 1, if you're going to be typing a character then a space you might want to just leave the default value instead of using minChars:2. Alternatively, you can override the getToken method to return an unstripped string. -justin --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: autocompleter does not work with contents pasted by using mouse
Hi Justin, Thanks for your reply. Can you give me exact code where to add for mouse event? Regarding 2nd solution, do I just need to replace line 316 with the below line? return this.element.value.substring(bounds[0], bounds[1]); Will there be any impact on any other part of the autocompleter? I mean what would be the side efftect of the above 2 soluns? Thanks! On Fri, Sep 12, 2008 at 10:15 AM, Justin Perkins [EMAIL PROTECTED]wrote: On Fri, Sep 12, 2008 at 11:57 AM, Jack [EMAIL PROTECTED] wrote: Question 1: I've observed that when copy paste the search string using keyboard in the text box, it displays hints. However, if I copy paste the same stuff using mouse, then the hints are not displayed at all. I think the even is placed on keydown or something. The Autocompleter listens for the keydown event to trigger Ajax request. To accommodate the event you are describing, you could wrap the Autocompleter#baseInitialize method and add an additional mousedown or mouseup listener bound to the same method that the keydown listener invokes. Question 2: I kept minChars to 2 I entered ab in text box, it shows hints for all matching abs. If I enter a (a followed by a space), it does not even invoke anything does not display hint. Is this a bug? Why space is excluded? Any workaround? The reason for this is because the input is stripped (leading and trailing spaces removed) which means that a single character followed by any number of spaces is still considered a single character. The default minChars value is 1, if you're going to be typing a character then a space you might want to just leave the default value instead of using minChars:2. Alternatively, you can override the getToken method to return an unstripped string. -justin --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Unsetting value in Autocompleter
Hello, Can anyone help me in the below issue? Thanks! On Fri, Sep 12, 2008 at 9:30 AM, Jack [EMAIL PROTECTED] wrote: Hi, I'm using 1.8.1 autocompleter as shown below: new Ajax.Autocompleter(companyName, companyHint, abc.php, {paramName: companyName, minChars: 1, indicator: 'inprogress', callback: null, afterUpdateElement: getSelectedId}); function getSelectedId(text, li) { $('company_id').value = li.id; } As you see above, I'm setting the value of id from li to the company_id variable. What I need is that if I enter couple of spaces in the textbox do not type anything, then how can I unset the company_id value? Basically, assume follwing sequence: 1. I'm typing xyz in the textbox 2. I got the result selected xyz. 3. Due to the selection, company_id is set from li 4. Now, I deleted xyz from text box entered couple of spaces or some other character which does not exist in database. 5. The result didn't show up since no match occured. 6. However, the company_id is still set to the earlier value of xyz's id. This is causing problem when the form is submitted to the next page. How can I unset the earlier value of selection? 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Not Extending Function on IE
Hi, I'm having a problem with prototype. this code breaks in IE 6 $(formId).submit.wrap(function(proceed){}) because wrap is undefinded. any ideas? Thanx! --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: JSON, ASP.NET and Date's
Ah right, yes that makes perfect sense. What if the date were to be serialized as new Date(...)? For example, var input = new String({ dob:new Date(1220453756681+0100) }); var evaluated = input.evalJSON(); var v1 = evaluated.dob.toString(); // v1 == Wed Sep 03 2008 15:55:56 GMT+0100 (GMT Daylight Time) var v2 = evaluated.dob.getDay(); // v2 == 3 Would there be any nasty pitfalls with this approach? Lea Hayes On Sep 11, 7:26 pm, Walter Lee Davis [EMAIL PROTECTED] wrote: On Sep 11, 2008, at 2:02 PM, T.J. Crowder wrote: We probably don't want the JSON deserializer to look at every string value and make it a date if it happens to look like one... :-) Right, cuz then it would be like a phone number on MobileSafari. Walter --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Ajax - bookmarking, back button, etc..
Hi, I developed and put online a small library that offers an integrated and flexible solution: The components and History Ajax.History allow you to manage browsing history very easily. You can see examples and documentation online at: http://www.prototypextensions.com Of course, the use of onhashchange will be integrated later, replacing a PeriodicalExecuter. For example, when IE 8 released in stable onhashchange will be used solely for IE 8 (until other browsers integrates). By the way, all the views, comments, criticisms on my code are welcome Simon On 27 août, 20:16, Thiago Esteves [EMAIL PROTECTED] wrote: Hello, I'm using Prototype to make some Ajax calls. I want to know if prototype can solve the problem of Bookmarks and Back Buttons in the ajax world. I've searched on google, but no lucky. Thank you. Best Regards, Thiago Esteves --~--~-~--~~~---~--~~ 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-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---