Re: [Prototype-core] Playing with Google's Closure Compiler and got a message for Prototype 1.7.0.0
Using a getter to alter state sounds like a really bad idea. Thank you all for looking at this. Glad it wasn't anything important. OOI, the Sizzle code wraps the access in a condition. Should this be ported to Prototype? On 17 May 2011 18:53, Andrew Dupont goo...@andrewdupont.net wrote: I had to look it up, because that's part of Sizzle [1], but accessing that property does have a side effect, apparently. It makes the `selected` property work correctly when something is selected by default. That strikes me as a spurious thing for GCC to warn about — you wouldn't typically expect property access to have side effects, but with getters/setters now in JavaScript, it'll become more and more common. Cheers, Andrew [1] https://github.com/jquery/sizzle/blob/master/sizzle.js#L598 On May 17, 2011, at 11:24 AM, Richard Quadling wrote: Hi. Using Google Maps API with Prototype. Playing putting it into Google Closure Compiler. Got a message ... Number of warnings: 1 JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a bug? at line 4437 character 3 in prototype.js elem.parentNode.selectedIndex; ^ which is ... filters: { enabled: function(elem){ return elem.disabled === false elem.type !== hidden; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ elem.parentNode.selectedIndex; // line 4437 return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, It looks like they are right? From what I know, that statement isn't going to do anything. To see this in action... Go to http://closure-compiler.appspot.com/home and enter ... // ==ClosureCompiler== // @compilation_level SIMPLE_OPTIMIZATIONS // @output_file_name default.js // @code_url http://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js // @code_url http://maps.google.com/maps/api/js?libraries=geometrysensor=false // ==/ClosureCompiler== // ADD YOUR CODE HERE alert(1); as the code to optimize. Choose Simple from the list of optimizations. Click Compile and then look at the warnings tab on the right hand side. Regards, Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Playing with Google's Closure Compiler and got a message for Prototype 1.7.0.0
Hi. Using Google Maps API with Prototype. Playing putting it into Google Closure Compiler. Got a message ... Number of warnings: 1 JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a bug? at line 4437 character 3 in prototype.js elem.parentNode.selectedIndex; ^ which is ... filters: { enabled: function(elem){ return elem.disabled === false elem.type !== hidden; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ elem.parentNode.selectedIndex; // line 4437 return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, It looks like they are right? From what I know, that statement isn't going to do anything. To see this in action... Go to http://closure-compiler.appspot.com/home and enter ... // ==ClosureCompiler== // @compilation_level SIMPLE_OPTIMIZATIONS // @output_file_name default.js // @code_url http://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js // @code_url http://maps.google.com/maps/api/js?libraries=geometrysensor=false // ==/ClosureCompiler== // ADD YOUR CODE HERE alert(1); as the code to optimize. Choose Simple from the list of optimizations. Click Compile and then look at the warnings tab on the right hand side. Regards, Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] New machine and new get clone ...
Hi. Getting a problem downloading sizzle ... [2011-03-28 18:14:58] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule init Submodule 'vendor/caja_builder' (git://github.com/tobie/unittest_js_caja_builder.git) registered for path 'vendor/caja_builder' Submodule 'vendor/nwmatcher/repository' (git://github.com/dperini/nwmatcher.git) registered for path 'vendor/nwmatcher/repository' Submodule 'vendor/pdoc' (git://github.com/tobie/pdoc.git) registered for path 'vendor/pdoc' Submodule 'vendor/sizzle/repository' (git://github.com/jeresig/sizzle.git) registered for path 'vendor/sizzle/repository' Submodule 'vendor/slick/repository' (git://github.com/mootools/slick.git) registered for path 'vendor/slick/repository' Submodule 'vendor/sprockets' (git://github.com/sstephenson/sprockets.git) registered for path 'vendor/sprockets' Submodule 'vendor/unittest_js' (git://github.com/tobie/unittest_js.git) registered for path 'vendor/unittest_js' [2011-03-28 18:15:20] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule update Cloning into vendor/caja_builder... remote: Counting objects: 100, done. remote: Compressing objects: 100% (92/92), done. remote: Total 100 (delta 17), reused 0 (delta 0) Receiving objects: 100% (100/100), 3.84 MiB | 51 KiB/s, done. Resolving deltas: 100% (17/17), done. Submodule path 'vendor/caja_builder': checked out 'aeda517c2e82db92bc88d56ed68fa4ce05f487a9' Cloning into vendor/nwmatcher/repository... remote: Counting objects: 2258, done. remote: Compressing objects: 100% (1285/1285), done. remote: Total 2258 (delta 998), reused 2172 (delta 934) Receiving objects: 100% (2258/2258), 721.39 KiB | 77 KiB/s, done. Resolving deltas: 100% (998/998), done. Submodule path 'vendor/nwmatcher/repository': checked out 'c9f5d5d4fc4ca294477f803bb8d688a8d45de664' Cloning into vendor/pdoc... remote: Counting objects: 2166, done. remote: Compressing objects: 100% (819/819), done. remote: Total 2166 (delta 1252), reused 2115 (delta 1224) Receiving objects: 100% (2166/2166), 468.69 KiB | 82 KiB/s, done. Resolving deltas: 100% (1252/1252), done. Submodule path 'vendor/pdoc': checked out 'b92409f605a65c94fcfd0df68fdd830ff9ca2195' Cloning into vendor/sizzle/repository... fatal: remote error: Could not find Repository jeresig/sizzle Clone of 'git://github.com/jeresig/sizzle.git' into submodule path 'vendor/sizzle/repository' failed https://github.com/jeresig no longer shows sizzle as one of his projects. I guess it should be jquery/sizzle, ... but that would just seem wrong ... ! Of course, it could be me. Any pointers? Regards, Richard Quadling. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Re: New machine and new get clone ...
On 28 March 2011 18:22, Richard Quadling rquadl...@gmail.com wrote: Hi. Getting a problem downloading sizzle ... [2011-03-28 18:14:58] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule init Submodule 'vendor/caja_builder' (git://github.com/tobie/unittest_js_caja_builder.git) registered for path 'vendor/caja_builder' Submodule 'vendor/nwmatcher/repository' (git://github.com/dperini/nwmatcher.git) registered for path 'vendor/nwmatcher/repository' Submodule 'vendor/pdoc' (git://github.com/tobie/pdoc.git) registered for path 'vendor/pdoc' Submodule 'vendor/sizzle/repository' (git://github.com/jeresig/sizzle.git) registered for path 'vendor/sizzle/repository' Submodule 'vendor/slick/repository' (git://github.com/mootools/slick.git) registered for path 'vendor/slick/repository' Submodule 'vendor/sprockets' (git://github.com/sstephenson/sprockets.git) registered for path 'vendor/sprockets' Submodule 'vendor/unittest_js' (git://github.com/tobie/unittest_js.git) registered for path 'vendor/unittest_js' [2011-03-28 18:15:20] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule update Cloning into vendor/caja_builder... remote: Counting objects: 100, done. remote: Compressing objects: 100% (92/92), done. remote: Total 100 (delta 17), reused 0 (delta 0) Receiving objects: 100% (100/100), 3.84 MiB | 51 KiB/s, done. Resolving deltas: 100% (17/17), done. Submodule path 'vendor/caja_builder': checked out 'aeda517c2e82db92bc88d56ed68fa4ce05f487a9' Cloning into vendor/nwmatcher/repository... remote: Counting objects: 2258, done. remote: Compressing objects: 100% (1285/1285), done. remote: Total 2258 (delta 998), reused 2172 (delta 934) Receiving objects: 100% (2258/2258), 721.39 KiB | 77 KiB/s, done. Resolving deltas: 100% (998/998), done. Submodule path 'vendor/nwmatcher/repository': checked out 'c9f5d5d4fc4ca294477f803bb8d688a8d45de664' Cloning into vendor/pdoc... remote: Counting objects: 2166, done. remote: Compressing objects: 100% (819/819), done. remote: Total 2166 (delta 1252), reused 2115 (delta 1224) Receiving objects: 100% (2166/2166), 468.69 KiB | 82 KiB/s, done. Resolving deltas: 100% (1252/1252), done. Submodule path 'vendor/pdoc': checked out 'b92409f605a65c94fcfd0df68fdd830ff9ca2195' Cloning into vendor/sizzle/repository... fatal: remote error: Could not find Repository jeresig/sizzle Clone of 'git://github.com/jeresig/sizzle.git' into submodule path 'vendor/sizzle/repository' failed https://github.com/jeresig no longer shows sizzle as one of his projects. I guess it should be jquery/sizzle, ... but that would just seem wrong ... ! Of course, it could be me. Any pointers? Regards, Richard Quadling. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY Ha!!! jeresig pushed to master at jquery/jquery 12 minutes ago 2555a5a Update the Sizzle location to point to the newly-moved repo. Talk about being on the cutting-edge. I assume that there is now a small delay until prototype changes its submodule requirement? -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Re: New machine and new get clone ...
On 28 March 2011 18:24, Richard Quadling rquadl...@gmail.com wrote: On 28 March 2011 18:22, Richard Quadling rquadl...@gmail.com wrote: Hi. Getting a problem downloading sizzle ... [2011-03-28 18:14:58] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule init Submodule 'vendor/caja_builder' (git://github.com/tobie/unittest_js_caja_builder.git) registered for path 'vendor/caja_builder' Submodule 'vendor/nwmatcher/repository' (git://github.com/dperini/nwmatcher.git) registered for path 'vendor/nwmatcher/repository' Submodule 'vendor/pdoc' (git://github.com/tobie/pdoc.git) registered for path 'vendor/pdoc' Submodule 'vendor/sizzle/repository' (git://github.com/jeresig/sizzle.git) registered for path 'vendor/sizzle/repository' Submodule 'vendor/slick/repository' (git://github.com/mootools/slick.git) registered for path 'vendor/slick/repository' Submodule 'vendor/sprockets' (git://github.com/sstephenson/sprockets.git) registered for path 'vendor/sprockets' Submodule 'vendor/unittest_js' (git://github.com/tobie/unittest_js.git) registered for path 'vendor/unittest_js' [2011-03-28 18:15:20] [D:\Personal Files\Downloads\Software\Programming\Javascript\Prototype] [] git submodule update Cloning into vendor/caja_builder... remote: Counting objects: 100, done. remote: Compressing objects: 100% (92/92), done. remote: Total 100 (delta 17), reused 0 (delta 0) Receiving objects: 100% (100/100), 3.84 MiB | 51 KiB/s, done. Resolving deltas: 100% (17/17), done. Submodule path 'vendor/caja_builder': checked out 'aeda517c2e82db92bc88d56ed68fa4ce05f487a9' Cloning into vendor/nwmatcher/repository... remote: Counting objects: 2258, done. remote: Compressing objects: 100% (1285/1285), done. remote: Total 2258 (delta 998), reused 2172 (delta 934) Receiving objects: 100% (2258/2258), 721.39 KiB | 77 KiB/s, done. Resolving deltas: 100% (998/998), done. Submodule path 'vendor/nwmatcher/repository': checked out 'c9f5d5d4fc4ca294477f803bb8d688a8d45de664' Cloning into vendor/pdoc... remote: Counting objects: 2166, done. remote: Compressing objects: 100% (819/819), done. remote: Total 2166 (delta 1252), reused 2115 (delta 1224) Receiving objects: 100% (2166/2166), 468.69 KiB | 82 KiB/s, done. Resolving deltas: 100% (1252/1252), done. Submodule path 'vendor/pdoc': checked out 'b92409f605a65c94fcfd0df68fdd830ff9ca2195' Cloning into vendor/sizzle/repository... fatal: remote error: Could not find Repository jeresig/sizzle Clone of 'git://github.com/jeresig/sizzle.git' into submodule path 'vendor/sizzle/repository' failed https://github.com/jeresig no longer shows sizzle as one of his projects. I guess it should be jquery/sizzle, ... but that would just seem wrong ... ! Of course, it could be me. Any pointers? Regards, Richard Quadling. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY Ha!!! jeresig pushed to master at jquery/jquery 12 minutes ago 2555a5a Update the Sizzle location to point to the newly-moved repo. Talk about being on the cutting-edge. I assume that there is now a small delay until prototype changes its submodule requirement? -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY https://github.com/jquery/jquery/commit/2555a5a2322f78fc1cfc8a0f2b55580fc79d2f32 -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Suggestions for a small private project.
Hi. I've got an archive of a PHP framework. The archive contains the 55 official releases and patch levels to date. It is NOT an SVN/CVS repository, just a directory for each release and expanded content in each directory. There are just over 111,000 files in total. What I'm looking for is a quick way to see the differences between the different versions for a particular file. To that end, the idea I've got is to have a two panel display. The left panel is a tree view of combined contents of all the versions (but missing the version from the tree). library framework class1.php class2.php class3.php So, if a file is added in version x, it will appear in the appropriate place in the tree. The second panel will somehow display the versions and the differences between the versions. My backend is PHP. I'm happy in producing and caching the diffs (the diff between version A and version B will never change, so once generated, a cache will be fine. The idea is to be able to see the evolution of a class through its releases and to be able to see the changes. I'm pretty sure I'm reinventing the wheel here to some degree. For the tree, I was thinking of using something like ExtJS, but I don't know enough about the licensing issues going on in there. I like Prototype, but there doesn't seem to be the UI components for Prototype/Scripty that other libraries have. Ideally, I'd like to be able to use the frontend on multiple source trees. That can easily be handled server side with a small list on screen to choose the project and tree style. So. What suggestions do you have. Regards, Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Re: Suggestions for a small private project.
On 3 February 2011 11:26, Richard Quadling rquadl...@gmail.com wrote: Hi. I've got an archive of a PHP framework. The archive contains the 55 official releases and patch levels to date. It is NOT an SVN/CVS repository, just a directory for each release and expanded content in each directory. Sorry. Wrong group. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] CSS object standardisation.
Hi. I use Prototype a lot and the one thing I find most useful is the level playing field it provides me. Prototype covers AJAX and HTML Elements very well in this regard. Are there any plans to do the same with CSS? Specifically in using JS to add/remove/alter CSS rules. Code like http://www.hunlock.com/blogs/Totally_Pwn_CSS_with_Javascript suggests that this code be a pretty simple task. Regards, Richard. -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Re: [Prototype-core] Re: Documentation for second parameter to AJAX callbacks.
On 4 June 2010 21:28, Tobie Langel tobie.lan...@gmail.com wrote: It may be just a case of the code and the documentation not agreeing and no comments saying that the second parameter is deprecated. Right on. I also wasn't aware it was documented for Responders. We never marked it deprecated for ajax callbacks, as it never actually was documented. This whole exercise has been useful though. I didn't quite get the difference between headerJSON and responseJSON. Both of which are extremely useful. headerJSON for the status (data retrieved, errors, etc.) and responseJSON the the content (data, error messages, etc.) from the server side app. Excellent stuff! Regards, Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Documentation for second parameter to AJAX callbacks.
Hi. I'm pretty sure I'm missing it, but where is the documentation about the second parameter to the AJAX callbacks please? The second parameter contains the headerJSON value (or null). Has this facility been dropped? http://api.prototypejs.org/ajax/ajax/request/ (scroll down to Evaluating JSON headers) doesn't mention it. It is mentioned on http://api.prototypejs.org/ajax/ajax/responders So, for example, what happens for onSuccess() ? As far as I can tell, it works just the same. Regards, Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Re: [Prototype-core] Re: rake doc's error.
2010/1/5 Tobie Langel tobie.lan...@gmail.com: Yes. Or you can use coderay instead, but I haven't included a stylesheet for that yet. We choose pygments as it's already the default for github and Jekyll. Thought this consistency might end up being useful. Also Pygment's a real lexer. Best, Tobie On Jan 5, 12:00 pm, Richard Quadling rquadl...@googlemail.com wrote: 2010/1/5 Tobie Langel tobie.lan...@gmail.com: Hi Richard. You'll have to use another syntax highlighter ATM or build the documentation without syntax highlighting. To do so, just modify the rake task like so: http://gist.github.com/266858 Hope this helps. Best, Tobie (Also, a patch to make pygments work on windows would be absolutely awesome!) On Jan 4, 2:50 pm, Richard Quadling rquadl...@googlemail.com wrote: Hi. Using open4 on Windows seems to be an issue. (in D:/Personal Files/Downloads/Software/Programming/Javascript/prototype) mkdir -p D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp rm -rf D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc Parsing source files: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp/pro totype.temp.js. Parsing completed in 46.735 seconds. Generating documentation to: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc. rake aborted! uninitialized constant Fcntl::F_SETFD D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/rakefile:75:in `build_doc_for' (See full trace by running task with --trace) Isn't Pygments python? Do I need to have Python as well now? http://pygments.org/docs/lexers/ -- - Richard Quadling Standing on the shoulders of some very clever giants! EE :http://www.experts-exchange.com/M_248814.html Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA :http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en I think I'll skip all of this and use the website instead. I'd much rather have DocBook V5 orientated documentation. But then the dox wouldn't be inline. Swings and roundabouts. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Re: [Prototype-core] Re: rake doc's error.
2010/1/6 Tobie Langel tobie.lan...@gmail.com: Erh... but the documentation IS the website. And DocBook support is planned. Maybe you'd like to help with it? Best, Tobie On Jan 6, 11:43 am, Richard Quadling rquadl...@googlemail.com wrote: 2010/1/5 Tobie Langel tobie.lan...@gmail.com: Yes. Or you can use coderay instead, but I haven't included a stylesheet for that yet. We choose pygments as it's already the default for github and Jekyll. Thought this consistency might end up being useful. Also Pygment's a real lexer. Best, Tobie On Jan 5, 12:00 pm, Richard Quadling rquadl...@googlemail.com wrote: 2010/1/5 Tobie Langel tobie.lan...@gmail.com: Hi Richard. You'll have to use another syntax highlighter ATM or build the documentation without syntax highlighting. To do so, just modify the rake task like so: http://gist.github.com/266858 Hope this helps. Best, Tobie (Also, a patch to make pygments work on windows would be absolutely awesome!) On Jan 4, 2:50 pm, Richard Quadling rquadl...@googlemail.com wrote: Hi. Using open4 on Windows seems to be an issue. (in D:/Personal Files/Downloads/Software/Programming/Javascript/prototype) mkdir -p D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp rm -rf D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc Parsing source files: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp/pro totype.temp.js. Parsing completed in 46.735 seconds. Generating documentation to: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc. rake aborted! uninitialized constant Fcntl::F_SETFD D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/rakefile:75:in `build_doc_for' (See full trace by running task with --trace) Isn't Pygments python? Do I need to have Python as well now? http://pygments.org/docs/lexers/ -- - Richard Quadling Standing on the shoulders of some very clever giants! EE :http://www.experts-exchange.com/M_248814.html Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA :http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/prototype-core?hl=en I think I'll skip all of this and use the website instead. I'd much rather have DocBook V5 orientated documentation. But then the dox wouldn't be inline. Swings and roundabouts. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE :http://www.experts-exchange.com/M_248814.html Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA :http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en Is that generating DocBook XML from the source code comments? Or starting from scratch and create the XML files directly? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Re: [Prototype-core] Re: rake doc's error.
2010/1/5 Tobie Langel tobie.lan...@gmail.com: Hi Richard. You'll have to use another syntax highlighter ATM or build the documentation without syntax highlighting. To do so, just modify the rake task like so: http://gist.github.com/266858 Hope this helps. Best, Tobie (Also, a patch to make pygments work on windows would be absolutely awesome!) On Jan 4, 2:50 pm, Richard Quadling rquadl...@googlemail.com wrote: Hi. Using open4 on Windows seems to be an issue. (in D:/Personal Files/Downloads/Software/Programming/Javascript/prototype) mkdir -p D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp rm -rf D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc Parsing source files: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/test/unit/tmp/pro totype.temp.js. Parsing completed in 46.735 seconds. Generating documentation to: D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/doc. rake aborted! uninitialized constant Fcntl::F_SETFD D:/Personal Files/Downloads/Software/Programming/Javascript/prototype/rakefile:75:in `build_doc_for' (See full trace by running task with --trace) Isn't Pygments python? Do I need to have Python as well now? http://pygments.org/docs/lexers/ -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Re: [Prototype-core] Re: For() loops, ++i, i++, i+=1
2009/12/17 T.J. Crowder t...@crowdersoftware.com: Forget the CPU cycles, it's the brain cycles I want back. But it was all worth it to learn about JSLitmus. :-) On Dec 17, 3:33 pm, Bob Kerns r...@acm.org wrote: Not to be a curmudgeon about it -- I'll just point out that the CPU cycles consumed in processing the email for this discussion far exceeds the CPU cycles saved by all the code the lot of you will ever write with such tweaks. Purely entertainment / mental game play. If you want to improve performance, the mental effort would be better spent looking at your algorithm, or even better, measuring the performance to find where you need to focus your attention. I can tell you now it won't be your choice of iteration statements! Play on -- I just wanted to put it into context... -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en Well I'm glad you all had a little look. These sorts of things don't often mean much. OOI. ++i, ++i vs i += 2 also seems to be a little better. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
[Prototype-core] Re: Element.classNames()
2009/11/3 Andrew Dupont goo...@andrewdupont.net: On Nov 3, 2009, at 3:54 AM, Richard Quadling wrote: According to [1], you will get a string back, not an array of strings. Nope — that's the notation for returning an array of strings. OMG! My excuse is I'm 42 years old and going bald. Enough to give anyone brain farts! -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
2009/10/21 Izidor Jerebic ij.l...@gmail.com: On 21.10.2009, at 16:40, Robert Kieffer wrote: Or to put it another way, what is the difference between f(x) = x and f(x) = x+1... why would the former be up-cased, but not the latter? Ours already has a name in mathematics - identity function, and it is primarily used by assigning its value (like var f = Function.IDENTITY), not by calling it (like Function.IDENTITY(3); ) We want this value to be assigned or passed as parameter. That is the main purpose of the definition. Our interest in other functions is primarily in calling them - you rarely assign Math.random. So the difference is in usage - is it used more as value or more as function call ? If it is value, then it is treated as constant (which it is). If it is called, it is treated as function name. IDENTITY is obviously never meant to be called explicitly, so it is a constant value meant to be passed around. izidor http://en.wikipedia.org/wiki/Constant_function vs http://en.wikipedia.org/wiki/Identity_function I don't see identity() as a constant function. A function which returns your DOB would be a constant function. In some ways.. define('DOB', '1967/10/01'); would be the same as ... function DOB(){ returns '1967/10/01'; } In both cases, it is the value that has to remain constant. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
2009/9/29 Joran Greef jorangr...@gmail.com: Prototype's existing String.empty and Array.empty interfaces would imply that Function.empty return a boolean indicating perhaps that the function is empty. Numpty brain this morning, but ... As I understand things, K(x) = x, not K(x) = (fn() = x) -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Ajax.Responders.register for onFailure event
2009/9/28 Mona Remlawi mona.reml...@gmail.com: i knew it, i had asked the same question before [10/29/08] so i'll stick to the same recommended patch at [http://prototype.lighthouseapp.com/projects/8886/tickets/334-onsuccessfailure-not-dispatched-to-ajaxresponders] while waiting for the anax revamp in v2 thanks and sorry for the double post. cheers -- mona On Mon, Sep 28, 2009 at 11:35 AM, Mona Remlawi mona.reml...@gmail.com wrote: Hello Prototypers, Any reason why the Ajax.Responders does not support the registration of handlers for onFailure event? cheers -- mona Also http://dev.rubyonrails.org/ticket/9690 -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
2009/9/25 T.J. Crowder t...@crowdersoftware.com: Andrew, Make sense. Shouldn't that be Function.empty and Function.k, though, to follow our naming rules? And perhaps Function.k should have a more meaningful name. -- T.J. On Sep 25, 4:20 am, Andrew Dupont goo...@andrewdupont.net wrote: Unless anyone has serious objections, or has a better idea, I'm going to add these as aliases of `Prototype.emptyFunction` and `Prototype.K`, respectively. They belong better there, since in theory the `Prototype` namespace is for internal stuff, not for stuff that has value to end-user developers. Cheers, Andrew As f(x) = x, f is an identity function. So, maybe Function.identity(x) { return x; } Hmm, whilst technically correct, the term identity may not be what people are used to. Maybe Function.AsIs() ? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: A more efficient $super for Prototype 2
: OP(hi) OC OGC GOOD: NP(hi) Exception: TypeError: nifty.$super is undefined and in IE ... Test loops: (suggest about 5,000 for IE, 200,000 for Chrome, 100,000 for Firefox or Safari) GOOD: OP(hi) GOOD: OP(hi) OC GOOD: OP(hi) OC OGC GOOD: NP(hi) Exception: [object Error] I ran ... git clone git://github.com/tjcrowder/prototype.git crowder to create a new local copy before doing a rake dist (did the submodules bit too). Seems I've got the standard version and not TJ's. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: A more efficient $super for Prototype 2
2009/9/8 T.J. Crowder t...@crowdersoftware.com: Hi, It really looks nicer :) Thanks! I haven't run it but I guest it is possible to do this.method.$super.call(this, ...) No, you need to drop the this. from the beginning of that. See my reply to Allen a couple up (or the PDoc comments here[1]) for why. arguments.callee.$supper.call(this, ...) Yup, that works (assuming $super rather than $supper), although it's a lot slower than using the function name. It's still markedly faster than the current mechanism. -- T.J. :-) On Sep 8, 11:20 am, Radoslav Stankov rstan...@gmail.com wrote: It really looks nicer :) I was generally using this.constructor ... and so on. But this is better. I haven't run it but I guest it is possible to do this.method.$super.call(this, ...) arguments.callee.$supper.call(this, ...) Witch is nice. In the end I downloaded the archive and used src to rebuild a new prototype. Chrome... test loops: 50 Old mechanism time: 9666ms New mechanism time: 639ms *** The test was a bit short, the timing data may be suspect; try more loops. Improvement: 93.39%, e.g., old takes 15.13 times as long as new. A bit short Half a million loops and it's a bit short -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Odd Maruku errors whilst raking the docs.
/maruku/input/parse_block.rb:251:in `read_raw_html' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:88:in `parse_blocks' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:301:in `read_list_item' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:78:in `parse_blocks' \___ ___ | Maruku tells you: +--- | Could you please format this better? | I see that : An Element instance to insert is left after the raw HTML. | At line 7 | raw_html |codea title=Element (class) href=../dom/element.htmlElement/a/code: An Element instance to insert| +--- !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:251:in `read_raw_html' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:88:in `parse_blocks' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:301:in `read_list_item' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:78:in `parse_blocks' Rendering: dom/event.html ___ | Maruku tells you: +--- | Could you please format this better? | I see that returns a _new_ function every time it's called, and so if you don't retain is left after the raw HTML. | At line 37 | code |$('foo').stopObserving('click', this.handlerMethod.bind(this)); // == WRONG| | empty || | raw_html |codea title=Function#bind (instance method) href=../language/function.html#bind-instance_methodFunction#bind/a/code returns a _new_ function every time it's called, and so if you don't retain| | text -- |the reference you used when observing, you can't unhook that function specifically. (You can| | text |still unhook __all__ handlers for an event, or all handlers on the element entirely.)| | empty || | text |To do this, you need to keep a reference to the bound function:| +--- !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:251:in `read_raw_html' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:88:in `parse_blocks' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_block.rb:41:in `parse_text_as_markdown' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:57:in `parse_doc' Documentation generated in 24.921 seconds. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] rake doc in prototype giving error.
Hi. I've just updated my local copy of prototype from git. All looks OK. Rebuilt prototype.js all fine. Run rake doc and now getting an error ... (in D:/Personal Files/Downloads/Software/Programming/Javascript/prototype) You'll need PDoc to generate the documentation. Just run: $ git submodule init $ git submodule update vendor/pdoc and you should be all set. But vender/pdoc is present and I assume correct. Trying ... git submodule init git submodule update vender/pdoc results in the error ... error: pathspec 'vender/PDoc' did not match any file(s) known to git. Did you forget to 'git add'? Anyone know the issue? Regards, RichardQ. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: checked !status in line 1496? (prototype-1.6.1.RC3)
2009/7/16 foolged fool...@gmail.com: 1494: success: function() { 1495: var status = this.getStatus(); 1496: return !status || (status = 200 status 300); 1497: } Why !status checked in line 1496? Because of this, an event onFailure not triggered when the status is == 0. IMHO rightly so, without !status. 1496: return (status = 200 status 300); Hi. I recently read [1] regarding How To - Bulletproof Ajax Requests. Out of that How To, I see that the use of an on0 callback is useful. I would like to be able to use an on0 Responder. Defining an on0 callback for every request/periodical/update AJAX call sort of rubs me wrong. Duplication of code, maintenance issues, etc. Having a global responder for on0 would allow me to define in a single place how I want to handle the demise/inaccessibility of the web server. Currently, there is no support for the onXYZ responders, just callbacks which need to be defined for every request/periodical/update. I've had a ticket (with a patch) which I've been using for over 2 years now [2]. The patch on the ticket is probably out of date. I can submit a new one if required. The one thing that is slightly different about the onXYZ responders is that they can control the cascade to the onSuccess/onFailure callback. If the onXYZ responder returns true, then the normal onSuccess/onFailure callback can be called. If false, this inhibits the onSuccess/onFailure callback. Specifically, an on0 responder should return false to stop the onSuccess route from being followed. Is there any interest in such a mechanism? Regards, Richard Quadling. [1] http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests [2] http://dev.rubyonrails.org/ticket/9690 -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Responders for onXYZ.
Hi. I recently read [1] regarding How To - Bulletproof Ajax Requests. Out of that How To, I see that the use of an on0 callback is useful. I would like to be able to use an on0 Responder. Defining an on0 callback for every request/periodical/update AJAX call sort of rubs me wrong. Duplication of code, maintenance issues, etc. Having a global responder for on0 would allow me to define in a single place how I want to handle the demise/inaccessibility of the web server. Currently, there is no support for the onXYZ responders, just callbacks which need to be defined for every request/periodical/update. I've had a ticket (with a patch) which I've been using for over 2 years now [2]. The patch on the ticket is probably out of date. I can submit a new one if required. The one thing that is slightly different about the onXYZ responders is that they can control the cascade to the onSuccess/onFailure callback. If the onXYZ responder returns true, then the normal onSuccess/onFailure callback can be called. If false, this inhibits the onSuccess/onFailure callback. Specifically, an on0 responder should return false to stop the onSuccess route from being followed. Is there any interest in such a mechanism? Regards, Richard Quadling. [1] http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests [2] http://dev.rubyonrails.org/ticket/9690 -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: IE6: This page contains both secure and nonsecure items.
2009/6/29 Diodeus diod...@gmail.com Hi gang, When testing with 1.6.1_rc2 and 1.6.1_rc3 I got complaints from some corporate clients that they're getting the following dialog on IE6. This page contains both secure and nonsecure items. I managed to test this, and confirmed this is the case. Older versions of Prototype do not cause this problem. I'm not sure why it's happening. I searched through rc3 and other than comments I didn't find any obvious culprits. So I cannot concurrently support both IE8 and IE6 users. Why is this a prototype issue? If you have a site which has hardcoded the protocol for some resources, then they will generate this message. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! I need a car : http://snipurl.com/l4pih ZOPA : http://uk.zopa.com/member/RQuadling --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: New findElements with selector API is faulty
2009/4/23 HissingInfernoOfAudio rono.mu...@gmail.com: Hi, I've stumbled onto the case in which we want to perform a selector find on an element with a period in its id: $('my_mail_google.com').down('img') and the result is null, since Selector.findElements alters the selector for the selector API by inserting # and the id into the selector, resulting in the new selector: '#my_mail_google.com img' which of course looks for an img element under an element with id 'my_mail_google' and class 'com'. In short, findElements is missing an escaping for the id. Here's a revised code: findElements: function(root) { root = root || document; var e = this.expression, results; switch (this.mode) { case 'selectorsAPI': // querySelectorAll queries document-wide, then filters to descendants // of the context element. That's not what we want. // Add an explicit context to the selector if necessary. if (root !== document) { var oldId = root.id, id = $(root).identify(); e = # + id.replace(/\./, '\\.') + + e; } results = $A(root.querySelectorAll(e)).map(Element.extend); root.id = oldId; return results; case 'xpath': return document._getElementsByXPath(this.xpath, root); default: return this.matcher(root); } }, Thanks! Interesting. Initially, I thought you can't have a . in an ID, but http://dev.w3.org/html5/spec/Overview.html#the-id-attribute says only spaces are disallowed. The issue is how would $$('#mail.com') differentiate between ... span id=mail class=com and span id=mail.com No matter how you fiddle with the selector, the . gets in the way. If possible, I would change my id's and classes to only use the _ symbol as this symbol is of no importance in any of the languages (well, except as a single character in SQL's LIKE syntax). -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/8 Andrew Dupont goo...@andrewdupont.net: On Apr 8, 2:26 am, Richard Quadling rquadl...@googlemail.com wrote: Having refreshed my prototype checkout (along with the submodules), the sprockets issue is still present. Ball's still in Sam's court on that one. If it doesn't get fixed soon I'll ask him for commit access to the Sprockets repo so I can fix it myself. As the file is unique, what benefit does setting the timestamp have? For windows, this will be updated automatically anyway. At that point in the Sprockets code, it doesn't know that it's writing to a tempfile. It could be writing to a file that already exists. Though it is VERY VERY slow. I can build our PHP manual from DocBook XML to CHM in about the same time. And that contains over 8,500 pages from a single 23MB XML file (which is first concatenated from over 12,500 XML files). Yeah, PDoc is slow. We think it's because there's an obscenely large number of objects being created during the parsing phase — and the fact that they're all kept around during the generation phase. (Time to generate grows exponentially — when I switch the task to process only, say, the Ajax files, it takes _far_ less time.) At some point, Tobie and I will change PDoc to include an intermediate stage that takes the objects from the parsing phase and converts them into lightweight objects that have only the information we need. Fun fact: it takes less time to generate docs for Prototype within my Windows VM (in VMWare Fusion, 512MB RAM) than it does in OS X (2GB RAM). Cheers, Andrew Being VERY new to using Ruby, is there a realtime debugger I could use (ideally stepwise execution with rollback, but that may be asking a lot!). Being able to provide a patch will help move things along a bit. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Permission denied error from 'rake doc'
Having refreshed my prototype checkout (along with the submodules), the sprockets issue is still present. Trying to change the timestamp causes a problem. Looking at the output of Filemon (http://live.sysinternals.com/filemon.exe), I can see the information contained in the attached log file (best viewable in a spreadsheet to separate the columns cleanly). It seems that there is a SHARING VIOLATION. As the file is unique, what benefit does setting the timestamp have? For windows, this will be updated automatically anyway. So, commenting out the odd line allows the build to succeed. Though it is VERY VERY slow. I can build our PHP manual from DocBook XML to CHM in about the same time. And that contains over 8,500 pages from a single 23MB XML file (which is first concatenated from over 12,500 XML files). 2009/4/8 Andrew Dupont goo...@andrewdupont.net: OK, fixed it. This was caused by a recent commit to PDoc that fixed one problem but introduced another. Cheers, Andrew On Apr 7, 5:44 am, T.J. Crowder t...@crowdersoftware.com wrote: Thanks Richard. I've opened ticket #647[1] for it, just to track it. I don't think this needs to get in the way of the doc tickets I'm trying to clean up. [1]https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/647 -- T.J. On Apr 7, 11:15 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 T.J. Crowder t...@crowdersoftware.com: Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Can anyone build the docs without having that problem? I just need to know whether it's an issue with my setup. Thanks, -- T.J. On Apr 3, 10:41 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Haven't had a chance to try Ubuntu yet. -- T.J. On Apr 3, 6:56 pm, Andrew Dupont goo...@andrewdupont.net wrote: OK, once I commented out that File.utime line, things went smoothly. There was an error in the rendering stage that I had to correct (something that was showing up with BlueCloth but not with RDiscount) — so do a git pull once again. Then the docs will build. The line that needs commenting out is a bug in Sprockets that I've passed along to Sam, so expect a fix for that sometime soon. T.J., let me know if you have any further problems. Cheers, Andrew On Apr 3, 11:22 am, Andrew Dupont goo...@andrewdupont.net wrote: *headdesk* Had local changes to my PDoc checkout that I had not pushed back to the repo. Fixed now. git pull git submodule update ...should do the trick. Cheers, Andrew On Apr 3, 9:28 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Richard, I'm really stumped here. I wonder if the lack of a ... I'd leave it until Andrew's had a chance to take a look. -- T.J. :-) On Apr 3, 3:21 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: [snip] I think I've found the problem. File.utime(timestamp, timestamp, filename) is trying to amend the time on the open file. I commented this line and it worked. Yup, that lets me get past that point as well. Andrew said he'd be working on this in his Windows VM soon, so hopefully that gives him a leg up. rake aborted! undefined method `signature' for #Documentation::InstanceProperty Ajax.Response#headerJSON Yup, here too. Probably a different problem. -- T.J. I'm really stumped here. I wonder if the lack of a ... headerJSON: function() { ... is causing it. I tried temporarily adding one to response.js, but it didn't make a diff. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Please hold, your call will be answered shortly. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/8 Richard Quadling rquadl...@googlemail.com: Having refreshed my prototype checkout (along with the submodules), the sprockets issue is still present. Trying to change the timestamp causes a problem. Looking at the output of Filemon (http://live.sysinternals.com/filemon.exe), I can see the information contained in the attached log file (best viewable in a spreadsheet to separate the columns cleanly). It seems that there is a SHARING VIOLATION. As the file is unique, what benefit does setting the timestamp have? For windows, this will be updated automatically anyway. So, commenting out the odd line allows the build to succeed. Though it is VERY VERY slow. I can build our PHP manual from DocBook XML to CHM in about the same time. And that contains over 8,500 pages from a single 23MB XML file (which is first concatenated from over 12,500 XML files). 2009/4/8 Andrew Dupont goo...@andrewdupont.net: OK, fixed it. This was caused by a recent commit to PDoc that fixed one problem but introduced another. Cheers, Andrew On Apr 7, 5:44 am, T.J. Crowder t...@crowdersoftware.com wrote: Thanks Richard. I've opened ticket #647[1] for it, just to track it. I don't think this needs to get in the way of the doc tickets I'm trying to clean up. [1]https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/647 -- T.J. On Apr 7, 11:15 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 T.J. Crowder t...@crowdersoftware.com: Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Can anyone build the docs without having that problem? I just need to know whether it's an issue with my setup. Thanks, -- T.J. On Apr 3, 10:41 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Haven't had a chance to try Ubuntu yet. -- T.J. On Apr 3, 6:56 pm, Andrew Dupont goo...@andrewdupont.net wrote: OK, once I commented out that File.utime line, things went smoothly. There was an error in the rendering stage that I had to correct (something that was showing up with BlueCloth but not with RDiscount) — so do a git pull once again. Then the docs will build. The line that needs commenting out is a bug in Sprockets that I've passed along to Sam, so expect a fix for that sometime soon. T.J., let me know if you have any further problems. Cheers, Andrew On Apr 3, 11:22 am, Andrew Dupont goo...@andrewdupont.net wrote: *headdesk* Had local changes to my PDoc checkout that I had not pushed back to the repo. Fixed now. git pull git submodule update ...should do the trick. Cheers, Andrew On Apr 3, 9:28 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Richard, I'm really stumped here. I wonder if the lack of a ... I'd leave it until Andrew's had a chance to take a look. -- T.J. :-) On Apr 3, 3:21 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: [snip] I think I've found the problem. File.utime(timestamp, timestamp, filename) is trying to amend the time on the open file. I commented this line and it worked. Yup, that lets me get past that point as well. Andrew said he'd be working on this in his Windows VM soon, so hopefully that gives him a leg up. rake aborted! undefined method `signature' for #Documentation::InstanceProperty Ajax.Response#headerJSON Yup, here too. Probably a different problem. -- T.J. I'm really stumped here. I wonder if the lack of a ... headerJSON: function() { ... is causing it. I tried temporarily adding one to response.js, but it didn't make a diff. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Please hold, your call will be answered shortly. -- - Richard Quadling Zend
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/8 Richard Quadling rquadl...@googlemail.com: 2009/4/8 Richard Quadling rquadl...@googlemail.com: Having refreshed my prototype checkout (along with the submodules), the sprockets issue is still present. Trying to change the timestamp causes a problem. Looking at the output of Filemon (http://live.sysinternals.com/filemon.exe), I can see the information contained in the attached log file (best viewable in a spreadsheet to separate the columns cleanly). It seems that there is a SHARING VIOLATION. As the file is unique, what benefit does setting the timestamp have? For windows, this will be updated automatically anyway. So, commenting out the odd line allows the build to succeed. Though it is VERY VERY slow. I can build our PHP manual from DocBook XML to CHM in about the same time. And that contains over 8,500 pages from a single 23MB XML file (which is first concatenated from over 12,500 XML files). 2009/4/8 Andrew Dupont goo...@andrewdupont.net: OK, fixed it. This was caused by a recent commit to PDoc that fixed one problem but introduced another. Cheers, Andrew On Apr 7, 5:44 am, T.J. Crowder t...@crowdersoftware.com wrote: Thanks Richard. I've opened ticket #647[1] for it, just to track it. I don't think this needs to get in the way of the doc tickets I'm trying to clean up. [1]https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/647 -- T.J. On Apr 7, 11:15 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 Richard Quadling rquadl...@googlemail.com: 2009/4/7 T.J. Crowder t...@crowdersoftware.com: Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Can anyone build the docs without having that problem? I just need to know whether it's an issue with my setup. Thanks, -- T.J. On Apr 3, 10:41 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Haven't had a chance to try Ubuntu yet. -- T.J. On Apr 3, 6:56 pm, Andrew Dupont goo...@andrewdupont.net wrote: OK, once I commented out that File.utime line, things went smoothly. There was an error in the rendering stage that I had to correct (something that was showing up with BlueCloth but not with RDiscount) — so do a git pull once again. Then the docs will build. The line that needs commenting out is a bug in Sprockets that I've passed along to Sam, so expect a fix for that sometime soon. T.J., let me know if you have any further problems. Cheers, Andrew On Apr 3, 11:22 am, Andrew Dupont goo...@andrewdupont.net wrote: *headdesk* Had local changes to my PDoc checkout that I had not pushed back to the repo. Fixed now. git pull git submodule update ...should do the trick. Cheers, Andrew On Apr 3, 9:28 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Richard, I'm really stumped here. I wonder if the lack of a ... I'd leave it until Andrew's had a chance to take a look. -- T.J. :-) On Apr 3, 3:21 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: [snip] I think I've found the problem. File.utime(timestamp, timestamp, filename) is trying to amend the time on the open file. I commented this line and it worked. Yup, that lets me get past that point as well. Andrew said he'd be working on this in his Windows VM soon, so hopefully that gives him a leg up. rake aborted! undefined method `signature' for #Documentation::InstanceProperty Ajax.Response#headerJSON Yup, here too. Probably a different problem. -- T.J. I'm really stumped here. I wonder if the lack of a ... headerJSON: function() { ... is causing it. I tried temporarily adding one to response.js, but it didn't make a diff. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Please hold, your call
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/8 T.J. Crowder t...@crowdersoftware.com: Hi Richard, For these really long listings and such, I wonder if it might be better to use Pastie[1] rather than inlining them in messages? (Pastie has a plain text choice.) It's just that with replies and quoting and such, these messages get REALLY long and in some cases they seem to freak out the GGroups display (not, I know, an enormously difficult task :-) ). [1] http://pastie.org -- T.J. :-) On Apr 8, 8:45 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/8 Richard Quadling rquadl...@googlemail.com: [snip] Sorry. I forgot about that. Will do next time. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/7 T.J. Crowder t...@crowdersoftware.com: Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Can anyone build the docs without having that problem? I just need to know whether it's an issue with my setup. Thanks, -- T.J. On Apr 3, 10:41 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks. With the latest, on Windows if I also comment out the atime line, building the docs goes through to completion. However, the generated doc seems to have issues: For instance, if I go into index.html, then choose Language Section from the menu, if I click on $A on the Utilities line on the page, I get a 404 for language \dollara.html. Haven't had a chance to try Ubuntu yet. -- T.J. On Apr 3, 6:56 pm, Andrew Dupont goo...@andrewdupont.net wrote: OK, once I commented out that File.utime line, things went smoothly. There was an error in the rendering stage that I had to correct (something that was showing up with BlueCloth but not with RDiscount) — so do a git pull once again. Then the docs will build. The line that needs commenting out is a bug in Sprockets that I've passed along to Sam, so expect a fix for that sometime soon. T.J., let me know if you have any further problems. Cheers, Andrew On Apr 3, 11:22 am, Andrew Dupont goo...@andrewdupont.net wrote: *headdesk* Had local changes to my PDoc checkout that I had not pushed back to the repo. Fixed now. git pull git submodule update ...should do the trick. Cheers, Andrew On Apr 3, 9:28 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Richard, I'm really stumped here. I wonder if the lack of a ... I'd leave it until Andrew's had a chance to take a look. -- T.J. :-) On Apr 3, 3:21 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: [snip] I think I've found the problem. File.utime(timestamp, timestamp, filename) is trying to amend the time on the open file. I commented this line and it worked. Yup, that lets me get past that point as well. Andrew said he'd be working on this in his Windows VM soon, so hopefully that gives him a leg up. rake aborted! undefined method `signature' for #Documentation::InstanceProperty Ajax.Response#headerJSON Yup, here too. Probably a different problem. -- T.J. I'm really stumped here. I wonder if the lack of a ... headerJSON: function() { ... is causing it. I tried temporarily adding one to response.js, but it didn't make a diff. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Please hold, your call will be answered shortly. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/3 T.J. Crowder t...@crowdersoftware.com: Hi, I think the issue is the /'s in the filename. I know nada about Ruby, but does it auto translate / to \ for window? I don't think. If it didn't, it probably wouldn't get that far. Most cross-OS systems (Java, for instance) handle translating slashes to backslashes in file ops on Windows. I also know nothing about Ruby, but I suspect that it does as well. -- T.J. On Apr 3, 1:37 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: Hi Andrew, T.J., are you sure you're running the latest code? Yup, for the Ubuntu system yesterday I grabbed everything fresh, including updating the submodules. The Windows stuff last week was also brand-spanking-new, but just to be sure nothing was fixed in the last week, I re-grabbed the entire thing this morning and I get the same permissions error. Maybe it's an issue with how I'm setting up my repos? Here's what I'm doing when building from scratch: (Starting in my projects directory) git clone git://github.com/sstephenson/prototype.git cd prototype git submodule init git submodule update rake dist (Check that prototype.js is in the dist subdirectory) rake doc Until the rake doc part, I'm not getting any errors. Thanks, -- T.J. On Apr 3, 8:35 am, Andrew Dupont goo...@andrewdupont.net wrote: T.J., are you sure you're running the latest code? Do a git submodule update from the root Prototype directory. Those sound like issues I had run into, and fixed, several weeks ago. Meanwhile, I'll fire up my Windows VM and see what happens when I try to generate docs from there. Cheers, Andrew On Apr 2, 6:17 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi again, Thought I'd give this a try on the Ubuntu lab machine I'd just built, in hopes that the permissions problem is Windows-specific. I got further, it can read the temp file, but then it runs into a problem in the PDoc Runner where it can't find the file ajax/ajax: * * * * t...@lab06:~/projects/prototype$ rake doc (in /home/tjc/projects/prototype) Parsing source files: /tmp/pdoc20090402-6276-fmbqy1-0. Parsing completed in 81.040395 seconds. Generating documentation to: /home/tjc/projects/prototype/doc. Rendering: ajax_section.html rake aborted! No such file or directory - ajax/ajax /home/tjc/projects/prototype/Rakefile:74 (See full trace by running task with --trace) * * * * (Rakefile:74 is the PDoc Runner call.) I'm guessing it's meant to be in the doc subdirectory, but looking there, there is no subdirectory called ajax. There is, however, one called Ajax (with a capital A): * * * * t...@lab06:~/projects/prototype$ ls -lA doc total 44 drwxr-xr-x 2 tjc tjc 4096 2009-04-02 12:01 Ajax -rw-r--r-- 1 tjc tjc 21681 2009-04-02 12:01 ajax_section.html -rw-r--r-- 1 tjc tjc 12309 2009-04-02 12:01 index.html * * * * Some kind of case sensitivity problem? I wonder if this has only been used successfully on Windows (if even there?), Mac OS X, and the like that don't (by default) have case-sensitive file systems... -- T.J. On Apr 2, 10:08 am, T.J. Crowder t...@crowdersoftware.com wrote: Folks, Can anyone build the docs other than Tobie and Andrew? If so, do you have any idea what's going on? I really want to close the large number of doc tickets on my plate, but there's no point in doing the work if the patches are just going to sit there unused (like this one [1]), that's just a waste of time, and none of us have time to waste. I'm about to hit a phase of a project where I won't have time to do this, so I was trying to clean them up before that. [1]https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/610 Thanks in advance, -- T.J. On Mar 31, 4:00 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks for the help. Yeah, it is weird, isn't it? :-) And yet we have permission to delete it (apparently, as it does get deleted). Are you logged in as an administrator? I am indeed, and that file is being created in the temp directory associated with my account, which in theory I'd be able to read/write to regardless. Early on, as a test, I created a different directory with a short path with no spaces and that I have full control permissions to and pointed TEMP/TMP at it instead. The directory got used, but I got the same result. -- T.J. :-) On Mar 31, 6:23 am, Andrew Dupont goo...@andrewdupont.net wrote: Christ, that's weird. It's saying you don't have permission to read the temporary file we create to build a concatenated version of Prototype with documentation comments included. The whole point of the temporary-file approach
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/3 Richard Quadling rquadl...@googlemail.com: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: Hi, I think the issue is the /'s in the filename. I know nada about Ruby, but does it auto translate / to \ for window? I don't think. If it didn't, it probably wouldn't get that far. Most cross-OS systems (Java, for instance) handle translating slashes to backslashes in file ops on Windows. I also know nothing about Ruby, but I suspect that it does as well. -- T.J. On Apr 3, 1:37 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/4/3 T.J. Crowder t...@crowdersoftware.com: Hi Andrew, T.J., are you sure you're running the latest code? Yup, for the Ubuntu system yesterday I grabbed everything fresh, including updating the submodules. The Windows stuff last week was also brand-spanking-new, but just to be sure nothing was fixed in the last week, I re-grabbed the entire thing this morning and I get the same permissions error. Maybe it's an issue with how I'm setting up my repos? Here's what I'm doing when building from scratch: (Starting in my projects directory) git clone git://github.com/sstephenson/prototype.git cd prototype git submodule init git submodule update rake dist (Check that prototype.js is in the dist subdirectory) rake doc Until the rake doc part, I'm not getting any errors. Thanks, -- T.J. On Apr 3, 8:35 am, Andrew Dupont goo...@andrewdupont.net wrote: T.J., are you sure you're running the latest code? Do a git submodule update from the root Prototype directory. Those sound like issues I had run into, and fixed, several weeks ago. Meanwhile, I'll fire up my Windows VM and see what happens when I try to generate docs from there. Cheers, Andrew On Apr 2, 6:17 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi again, Thought I'd give this a try on the Ubuntu lab machine I'd just built, in hopes that the permissions problem is Windows-specific. I got further, it can read the temp file, but then it runs into a problem in the PDoc Runner where it can't find the file ajax/ajax: * * * * t...@lab06:~/projects/prototype$ rake doc (in /home/tjc/projects/prototype) Parsing source files: /tmp/pdoc20090402-6276-fmbqy1-0. Parsing completed in 81.040395 seconds. Generating documentation to: /home/tjc/projects/prototype/doc. Rendering: ajax_section.html rake aborted! No such file or directory - ajax/ajax /home/tjc/projects/prototype/Rakefile:74 (See full trace by running task with --trace) * * * * (Rakefile:74 is the PDoc Runner call.) I'm guessing it's meant to be in the doc subdirectory, but looking there, there is no subdirectory called ajax. There is, however, one called Ajax (with a capital A): * * * * t...@lab06:~/projects/prototype$ ls -lA doc total 44 drwxr-xr-x 2 tjc tjc 4096 2009-04-02 12:01 Ajax -rw-r--r-- 1 tjc tjc 21681 2009-04-02 12:01 ajax_section.html -rw-r--r-- 1 tjc tjc 12309 2009-04-02 12:01 index.html * * * * Some kind of case sensitivity problem? I wonder if this has only been used successfully on Windows (if even there?), Mac OS X, and the like that don't (by default) have case-sensitive file systems... -- T.J. On Apr 2, 10:08 am, T.J. Crowder t...@crowdersoftware.com wrote: Folks, Can anyone build the docs other than Tobie and Andrew? If so, do you have any idea what's going on? I really want to close the large number of doc tickets on my plate, but there's no point in doing the work if the patches are just going to sit there unused (like this one [1]), that's just a waste of time, and none of us have time to waste. I'm about to hit a phase of a project where I won't have time to do this, so I was trying to clean them up before that. [1]https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/610 Thanks in advance, -- T.J. On Mar 31, 4:00 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Andrew, Thanks for the help. Yeah, it is weird, isn't it? :-) And yet we have permission to delete it (apparently, as it does get deleted). Are you logged in as an administrator? I am indeed, and that file is being created in the temp directory associated with my account, which in theory I'd be able to read/write to regardless. Early on, as a test, I created a different directory with a short path with no spaces and that I have full control permissions to and pointed TEMP/TMP at it instead. The directory got used, but I got the same result. -- T.J. :-) On Mar 31, 6:23 am, Andrew Dupont goo...@andrewdupont.net wrote: Christ, that's weird. It's saying you don't have permission to read the temporary file we create to build a concatenated version of Prototype with documentation comments included
[Prototype-core] Re: Permission denied error from 'rake doc'
2009/4/3 T.J. Crowder t...@crowdersoftware.com: [snip] I think I've found the problem. File.utime(timestamp, timestamp, filename) is trying to amend the time on the open file. I commented this line and it worked. Yup, that lets me get past that point as well. Andrew said he'd be working on this in his Windows VM soon, so hopefully that gives him a leg up. rake aborted! undefined method `signature' for #Documentation::InstanceProperty Ajax.Response#headerJSON Yup, here too. Probably a different problem. -- T.J. I'm really stumped here. I wonder if the lack of a ... headerJSON: function() { ... is causing it. I tried temporarily adding one to response.js, but it didn't make a diff. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Cloned repo via git, not seeing the unit test html files
2009/3/21 T.J. Crowder t...@crowdersoftware.com: Hi all, FWIW, my results for trunk this morning on Windows XP: * Fully passes on FF3 * Tries to run against Chrome but fails to launch it (rake just sits there until you kill it); but then, Chrome isn't a supported browser [1], not sure why we're trying to test it * Failures on IE7: form_test.html - testFormMethodsOnExtendedElements: 4 assertions, 1 failures, 1 errors Failure: assert got undefined TypeError: Object doesn't support this property or method, error= ([object Error]) selector_test.html - testFormMethodsOnExtendedElements: 0 assertions, 2 failures, 0 errors Failure: #level1 *:empty expected: [span id=level3_1, span id=level3_2, div id=level2_3], actual: [span id=level3_1, span id=level3_2, em id=level_only_child, div id=level2_3] Failure: newlines count as content! expected: [], actual: [em id=level_only_child] * Failures in Opera 9.64, all in dom_test.html: testElementScrollTo 0 assertions, 2 failures, 0 errors Failure: assertEqual expected: 1946, actual: 0 Failure: assertEqual expected: 1946, actual: 0 testViewportDimensions 0 assertions, 2 failures, 0 errors Failure: NOTE: YOU MUST ALLOW JAVASCRIPT TO RESIZE YOUR WINDOW FOR THIS TEST TO PASS expected: 1041, actual: 991 Failure: NOTE: YOU MUST ALLOW JAVASCRIPT TO RESIZE YOUR WINDOW FOR THIS TEST TO PASS expected: 648, actual: 598 testViewportScrollOffsets 2 assertions, 1 failures, 0 errors Failure: NOTE: YOU MUST ALLOW JAVASCRIPT TO RESIZE YOUR WINDOW FOR THESE TESTS TO PASS expected: 25, actual: 0 (Yes, I do have JavaScript allowed to do anything it wants with the window.) * Refuses to test against Safari 3.2.2, says it's not supported on Windows [1] http://prototypejs.org/download FWIW, -- T.J. :-) On Mar 20, 8:59 pm, kangax kan...@gmail.com wrote: On Mar 20, 3:03 pm, T.J. Crowder t...@crowdersoftware.com wrote: Thanks, Tobie. That was the missing bit all right. The contribute page _does_ mention rake test, but much further down; I'll update the page to tie things together a bit. Out of curiousity, anyone successfully run the tests lately on Chrome, IE7, or Opera on Windows? I'm on mac. Trunk fully passes FF3 and Safari 4 here. There are a couple of failures in Opera 9.64. I'm taking care of IE8 at the moment - just pushed few fixes for DOM suite. [...] -- kangax I use Chrome and FF as my main browsers. Chrome as it is so clean. FF because of FB. IE7 for testing. So far, my code is working as expected on all 3 of these browsers. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Add JavaScript Lint to build process?
2009/3/15 Tobie Langel tobie.lan...@gmail.com: I wonder why Caja is taken in so much more consideration than a practice that always existed in the programming world. There's two reasons to that: 1. I've been consulting for Google Caja team to make Prototype Caja- compliant, 2. Valija[1], the language which was created by the Google Caja team as a result of that work[2], is an approximate subset of the ES3.1 strict mode, so supporting it today means supporting strict mode tomorrow. Best, Tobie [1] http://code.google.com/p/google-caja/wiki/WhatsMissing [2] http://groups.google.com/group/google-caja-discuss/browse_thread/thread/284935fa0784316d/31e476a985ae8c66?lnk=gst#31e476a985ae8c66 Is there any evidence that NOT being strict is slower for a non-strict environment? Does missing a few {} or the odd ; in allowable places make the parser have more work to do? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Possible bug : Form.seriaize() only serializes first submit button.
2009/2/27 Richard Quadling rquadl...@googlemail.com: 2009/2/27 Mislav Marohnić mislav.maroh...@gmail.com: On Fri, Feb 27, 2009 at 17:18, Richard Quadling rquadl...@googlemail.com wrote: Firstly, Form.serialize only serializes the first input[type=submit] button. That is what browser does, too, when you press Enter while in a text input field. Secondly, the pressed button (if one was pressed) should be serialized. And how would you go about detecting which button was pressed? There is no API in JavaScript to detect this while processing the submit event. Is there anything that can be done about this behaviour? Yes: http://gist.github.com/71574 In user code. If you have any ideas how to implement this in the framework, let us know. I think I'll populate a input type=hidden when a submit is pressed. That way serialize will work without amendments. Thank you. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Just so you don't all think I'm a total buffoon, observing a form's submit event is where I was going wrong. I should be watching the submit buttons click event to determine the submit type. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Possible bug : Form.seriaize() only serializes first submit button.
Hi. I suppose this is actually 2 bugs in 1. Firstly, Form.serialize only serializes the first input[type=submit] button. In Form.serializeElements(), the variable submitted is set when the first submit button is serialized, inhibiting the serialization of other submit buttons. Secondly, the pressed button (if one was pressed) should be serialized. Is there anything that can be done about this behaviour? The only way I can think of is to add a property to the form indicating which submit button was clicked and then serialize that button, rather than the first one. Having multiple submit buttons is fine according the HTML 4.01 (http://www.w3.org/TR/html401/interact/forms.html#submit-button) Also ... A button (and its value) is only included in the form submission if the button itself was used to initiate the form submission. (http://www.w3.org/TR/2009/WD-html5-20090212/forms.html#the-button-element) As a consequence, submitting a form via AJAX doesn't supply the appropriate button. Or that is what is happening to me. Regards, Richard. Example (http://pastie.org/402166) : html head script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js;/script script type=text/javascript document.observe('dom:loaded', function() { $('seri').observe('submit', function(ev) { ev.stop(); alert($('seri').serialize()); }); }); /script body div form id=seri method=post action= select id=aSelector name=bob option value=1One/option option value=2Two/option option value=3Three/option option value=4Four/option /select input type=submit id=tabRG_PDF name=tabRG_ReportType[31] value=Adobe Acrobat PDF / input type=submit id=tabRG_Excel name=tabRG_ReportType[36] value=Microsoft Excel Spreadsheet / input type=submit id=tabRG_Word name=tabRG_ReportType[14] value=Microsoft Word Document / input type=reset id=tabRG_Reset name=tabRG_Reset value=Discard / /form div /body /html -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Possible bug : Form.seriaize() only serializes first submit button.
2009/2/27 Mislav Marohnić mislav.maroh...@gmail.com: On Fri, Feb 27, 2009 at 17:18, Richard Quadling rquadl...@googlemail.com wrote: Firstly, Form.serialize only serializes the first input[type=submit] button. That is what browser does, too, when you press Enter while in a text input field. Secondly, the pressed button (if one was pressed) should be serialized. And how would you go about detecting which button was pressed? There is no API in JavaScript to detect this while processing the submit event. Is there anything that can be done about this behaviour? Yes: http://gist.github.com/71574 In user code. If you have any ideas how to implement this in the framework, let us know. I think I'll populate a input type=hidden when a submit is pressed. That way serialize will work without amendments. Thank you. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: $('formID').reset() is not returning $('formID')
2009/2/26 Mislav Marohnić mislav.maroh...@gmail.com: On Thu, Feb 26, 2009 at 12:38, Richard Quadling rquadl...@googlemail.com wrote: $('formID').reset().getElements().invoke('disable'); should work. But it doesn't. form#reset() is a native method: https://developer.mozilla.org/En/DOM/Form.reset Yep, and as I type this I realise you can't override native methods and then still access them. Doh! Not having a good day really! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: I suck at getting uptodate prototype/master.
2009/2/26 Ryan Angilly angi...@gmail.com: 'git status' and 'git diff' are nice for seeing what's changed locally since the last pull/commit. I run them all the time... sometimes without even thinking about it. On Thu, Feb 26, 2009 at 8:51 AM, Richard Quadling rquadl...@googlemail.com wrote: 2009/2/26 Mislav Marohnić mislav.maroh...@gmail.com: Hey Richard, A git pull command is a combo of git fetch and git merge. The first command pulls objects (commits, etc.) from the repository that you don't have locally. It also updates your remote branches (origin/master, etc.). After fetching, git notices you are currently on the master branch and wants to merge origin/master into it. This is called tracking branch -- master is set up to track origin/master by default whenever you clone a repository. However, a git merge cannot succeed if the file that has changes to be merged also has uncommited changes in your working copy. You made local changes to src/dom/form.js, but you didn't commit them. You can inspect that by typing git status. If you commited those changes to master, the merge could proceed. However, there might be a conflict if the same lines of code were changed by you as well as upstream. You will then be prompted to resolve the conflicts by hand. The git stash command can help in cases you're not ready to commit your changes, but want to pull from the repository anyway with your changes preserved afterwards: git stash git pull git stash pop However, the best practice for experimenting with Prototype is to commit your changes to a separate branch, then when you wish to pull in the latest version of Prototype you just checkout master again and do a git pull. Now, if you want to update the master branch to the latest state as currently on github and you don't care about your changes made to the working copy, you can issue this command while on master: git fetch origin git reset --hard origin/master. YOU WILL LOSE all changes (commited or uncommited) on this branch that are not a part of the master branch on github, but sometimes you want to use this destructive method simply to clean up some mess you have made on the branch by saying get me the latest state of prototype library, period. On Wed, Feb 25, 2009 at 17:10, Richard Quadling rquadl...@googlemail.com wrote: Hi. I do the following steps ... cd /d D:\Source\prototype git pull And get an error ... Updating ab1313e..8bfd9cf error: Entry 'src/dom/form.js' not uptodate. Cannot merge. Thank you. I didn't realise I'd edited the files locally. What a dope! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! More thank you. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Event.observe problem
2009/2/26 Yuncong Zhang njit...@gmail.com: I'm using prototype 1.5 I want to click once and update text in two div parts. But I find out when I click the first time, nothing happened; when I click the second time, both div changed. why is that? How can I click only once, change both of these divs. Thank you in advance Yuncong !-- code begins -- script language=javascript src=prototype.js/script div id=qwer change this /div div id=zxcv also change this /div a id=asdf onclick=new Event.observe('asdf', 'click', function(){ new Ajax.Updater ( 'qwer', 'event1.html', { asynchronous: true, method: 'get' } ); new Ajax.Updater ( 'zxcv', 'event2.html', { asynchronous: true, method: 'get' } ); }); event.returnvalue=false; return false; href=event.html test /a When you click the first time, it attaches an onclick event handler. When you click the second time, the handler is executed. But potentially the handler could also be overwritten by attempting to reattach the handler again. Much better is to put the onClick into... document.observe('dom:loaded', function() { $('asdf').observe('click', function(ev) { ev.stop(); new Ajax.Updater( 'qwer', 'event1.html', { asynchronous: true, method: 'get' } ); new Ajax.Updater( 'zxcv', 'event2.html', { asynchronous: true, method: 'get' } ); }); }); sort of thing. The above code is probably only compatible with 1.6. I never used 1.5 sorry. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Problems with $('formID').serialize(true).merge({foo:'bar'}).
Hello. I'm having problems using the Hash.merge() method on a Form.serialize(true). What I want to do is ... parameters : $('formUserAdmin').serialize(true).merge({Action : 'ClientAddUser', JSONP:'tabUA_UpdateUserIDs'}); But it isn't working because the output of the serialize method is not a true Hash, like you would get from $H(). Using ... parameters : $H($('formUserAdmin').serialize(true)).merge({Action : 'ClientAddUser', JSONP:'tabUA_UpdateUserIDs'}); is working as I would expect. But I don't know if I should be doing that as I was expecting the serialize() method to return a hash. As always, there are 2 fixes. 1 - Correct the documentation to reflect the behaviour. 2 - Fix the code. I think the fix is in src/dom/form.js, line 28 which currently reads ... return options.hash ? data : Object.toQueryString(data); and maybe should read ... return options.hash ? $H(data) : Object.toQueryString(data); Now, if a user is already $H() the form.serialize(true), then this still seems to be OK. $H($H($H($H($H($('formUserAdmin').serialize(true)).merge({Foo:'bar'}).inspect() provides the same output as ... $H($('formUserAdmin').serialize(true)).merge({Foo:'bar'}).inspect() which, with the patch applied is now the same as ... $('formUserAdmin').serialize(true).merge({Foo:'bar'}).inspect() With this patch, the documentation now agrees with the code. In looking at the unit tests, I think the reason this has not been seen is in unittest.js function assertHashEqual(expected, actual, message) { expected = $H(expected); actual = $H(actual); var expected_array = expected.toArray().sort(), actual_array = actual.toArray().sort(); message = buildMessage(message || 'assertHashEqual', 'expected: ?, actual: ?', expected, actual); // from now we recursively zip compare nested arrays function block() { return expected_array.length == actual_array.length expected_array.zip(actual_array).all(assertPairEqual); } this.assertBlock(message, block); } Both the expected and actual are converted to $H()'d. Which means they will match. Only the expected should be $H()'d as it the actual should already be $H()'d by prototype. I hope that makes sense and is right, if not, I'll stick with $H()-ing my serialized form. Regards, Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Slight documentation issue/error/something.
2009/2/16 Tobie Langel tobie.lan...@gmail.com: Nothing major, but the last section onhttp://prototypejs.org/api/ajax/request(Evaluating JSON headers) doesn't mention that the second parameter of the onSuccess() call contains transport.headerJSON That's completely on purpose as we intend to deprecate its use in the future. :) Best, Tobie Ha! RTFM and not RTFC. Thank you. I'll amend my code for this. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Trying to rake dist on windows.
2009/2/16 Sam Stephenson s...@37signals.com: This should be fixed in 6fb6308. -sam On Feb 11, 2009, at 6:01 AM, Richard Quadling wrote: Hi. I think there is a problem using in the Sprockets Environment class. The absolute() method is checking for / -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Thanks for that. All working my end, once I worked out how to update the submodules after making a change to my local version and then git not updating them. There is still a lot of whitespace present. Ideally, I'd use these 2 regexes. Remove trailing whitespace. /[\t ]+$/ and // Remove additional empty lines. (\r\n|\r[^\n]|[^\r]\n){3,} = \1\1 The first simply removes any trailing tabs or spaces. The second one looks for \r\n (windows) \r (unix) or \n (mac) repeated 3 times (the end of a proper line followed by 2 or more blank lines) and replaces them with 2 versions of the captured line type, leaving a single blank line between them. I don't know how to apply this logic to the code. I think it should be applied to the final output and there should be a blank line between each included file in case there isn't one at the bottom of the file (but that's just my opinion). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Trying to rake dist on windows.
Hi. I think there is a problem using in the Sprockets Environment class. The absolute() method is checking for / -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Whitespaces
Hi. How seriously should the whitespaces be kept under control in the current master? There seems to be a large number of trailing spaces and lines with just a space. Also more double blank lines. I've had to change my diff from ... diff -du to diff -duEbwB Basically ignoring all white spaces and blank lines, etc. I can create a whitespace patch if you want/need? (Ideally as part of the community, I'd like to just commit it, but ...) Regards, Richard Quadling. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Can the community do anything to help make bugfix releases more frequent?
2009/2/3 Yanick yanick.roc...@gmail.com: On Feb 2, 4:07 pm, Richard Quadling rquadl...@googlemail.com wrote: 2009/2/2 Andrew Kaspick akasp...@gmail.com: The dom:loaded bug is critical as far as I'm concerned and should have warranted a bug fix release right away. Lack of updates is definitely turning out to be a sore spot with Prototype unfortunately. On Mon, Feb 2, 2009 at 10:28 AM, Ryan H ryan.holli...@gmail.com wrote: [snip] After 1.6.0.3 came out there was a blog post (growing the community) that indicated more frequent releases were a goal: [snip] Ryan Holliday [snip] I always thought this is supposed to be a community product. It doesn't really feel like one. Richard. -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! Hi, Well, Richard, as a Zend Certified Engineer, I am a fan of the Zend framework myself, why isn't there a Prototype integration in ZF? That could help leap foreword Prototype dev, no? Just a thought... To the OP (and the others) : As far as I'm concerned, and reading the spinoff newsgroup and this one for a while now, it is clear that Prototype should simply be a core library, and should absolutely not be bloated by extra user- specific-cased scenarios. Therefore It is normal that, at some point, it would lean toward reaching the end of it's logarithmic expansion, thus having fewer releases. I would hate to see it piled with features that do not apply to my project, at least not without being able to compile a personalized version (like Mootools). Script.aculo.us (http://script.aculo.us/) is one project to extend Prototype. Prototype UI (http://prototype-ui.com/) is another one (still at an infant stage) Prototype.js extension library (http://scripteka.com/) is another... etc. My point is that, to actively create a community, there should be projects out there contributing in the growth of the library by using it and sharing it's use back to the community. I am sure that there are plans to improve the core, but I seriously think that it's time to actually focus on extension projects too. Perhaps have them listed (or even hosted) on the prototypejs.org (?) Finally, Andrew did write an answer to that here (http:// www.prototypejs.org/2008/10/7/growing-the-community), so I assume that after all these complaining are done, and after the migration process is completely over, new candidates will surely be available at a more frequent rate. As JFK as said (paraphrased), don't ask what the community can do for you, but what you can do for the community. This was my humbe opinion anyway. GIYF : zend framework prototype -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Can the community do anything to help make bugfix releases more frequent?
2009/2/2 Andrew Kaspick akasp...@gmail.com: The dom:loaded bug is critical as far as I'm concerned and should have warranted a bug fix release right away. Lack of updates is definitely turning out to be a sore spot with Prototype unfortunately. On Mon, Feb 2, 2009 at 10:28 AM, Ryan H ryan.holli...@gmail.com wrote: Hello, I'm a long time prototype.js user, and while I very much appreciate the software I (along with others) have had some frustrations with the infrequency of bugfix releases. As one example, it has been over four months since the 1.6.0.3 release, and during that time dom:loaded has had problems on IE6 (lighthouse issue #127) despite the fact that a fix has been available since shortly after 1.6.0.3 came out. While it's easy enough to grab the bugfix from the issue tracker or GIT for these sorts of issues, I think it might be beneficial to understand the reasons why bugfix releases are so infrequent and if there is anything the community can do to help speed up the process, such as testing. Is it beneficial to add lighthouse comments indicating this works for me and fixes the issue, or to add posts to this group indicating tickets that might be seen as higher priority? Is there anything else that prototype.js users can do? After 1.6.0.3 came out there was a blog post (growing the community) that indicated more frequent releases were a goal: This means, among other things, that we're planning to move away from a when it's ready release schedule. Instead, we'll move toward one in which there are several releases per year; whatever is ready in time for a given release will go in, and whatever is not will have to wait. That applies to bug fixes and features alike. Eight months between releases just won't work. Moving to a schedule in which bugs were fixed more quickly would be a huge benefit, so please share any way that users might be able to help make that happen. Ryan Holliday Hi. It might be me and a complete lack of understanding of how git works (as compared to CVS), but shouldn't there be a work in progress version? So, bug fixes are added to the work in progress version as they become available. At some stage a release is made and this is given a tag to say that this is Vx.y.z I work with PHP and there are several branches as well as the head. If this sort of thing was available, patches could be made and committed by the community and would be available for all instantly. A committed patch does not mean it will be released. By having it in there / out there, others can decide on its suitability (and amend it if necessary). When it comes to releasing a new version, only the patches which are acknowledged as suitable/stable would be merged from the head to a new branch. (I'm not too sure of the terminology as I don't run the CVS servers, but as a user, I see how I can submit patches to the different branches easily). So, if you wanted a release you would get a release version. If you wanted the bleeding edge (the YMMV release), then you could go for the work in progress branch. You don't have to allow everyone to commit patches. Just those that have shown an understanding and have a sympathy for the style used (so no js-lint happifiers). I always thought this is supposed to be a community product. It doesn't really feel like one. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: JavaScriptLint formatting for Prototype
2009/1/28 Diego Perini diego.per...@gmail.com: The other good thing you are doing with JSLint is enforce the type of each function, I mean the return type. I have been told several time that not being a strict typed language it doesn't matter blah..blah blah. Why would you cripple the language by enforcing return types? Many times it is useful to return a boolean False if something doesn't work and the appropriate type when it does. So mainly return types are mixed. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: JavaScriptLint formatting for Prototype
2009/1/29 Diego Perini diego.per...@gmail.com: Richard, On 29 Gen, 13:43, Richard Quadling rquadl...@googlemail.com wrote: 2009/1/28 Diego Perini diego.per...@gmail.com: The other good thing you are doing with JSLint is enforce the type of each function, I mean the return type. I have been told several time that not being a strict typed language it doesn't matter blah..blah blah. Why would you cripple the language by enforcing return types? Hey it is Douglas Crockford JSLint saying that, not me, I am just happily supporting the idea... Are you saying that C and Java are crippled languages because they enforce return types ? Absolutely not. But the nature of Javascript IS to have an non-strictly typed language. I use PHP as my day to day and that is non strictly typed. I suppose it is partially strictly typed in so much as you have scalars (strings, boolean, numbers), arrays and objects. Just wanted to point out that doing what Crockford suggests will help write more robust javascript, though that doesn't mean you may be able to achieve the same goal using functions returning mixed types. Not everybody is able to write and work well in a polymorphic environment. Ah, part of the dumb it down brigade. I'm reminded of UK news story recently which said that due to the poor quality of education, kids sitting their end of year English exams were unable to write an essay. So rather than spending anything on increasing the ability of kids to write, they dumb down the exam to a multiple choice test instead. Bums on seats, stack 'em high sell it cheap. etc. etc. (Gee I sound like an old man. Guess what though, I am!). Many times it is useful to return a boolean False if something doesn't work and the appropriate type when it does. You can do the same with any type without mixing: - object, return null instead of an existing object (null is still an object) - string, return empty string instead of not empty string - number, return negative number instead of a positive - boolean, return boolean false instead of boolean true That's OK as far as it goes, but how do you differentiate between no value and an error? Something returning null means that there is no data. It implies that the call was OK, just that there isn't anything suitable to respond with. An error on the other hand is something quite different. Mixed return types are REALLY useful. I agree about that methodology you enforce is a shortcut most of the time, but I would try to avoid that if possible. So mainly return types are mixed. Yep...in Prototype, functions return types are mixed (but only in some special circumstance), I don't have them enumerated and I don't know which one does that and I don't see any documentation explaining which one does :-) Diego Perini -- - Richard Quadling Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: New Element.Layout API
2009/1/16 Andrew Dupont goo...@andrewdupont.net: I've just committed a couple large API additions in a layout branch in our Git repository: http://github.com/sstephenson/prototype/tree/layout http://github.com/sstephenson/prototype/blob/9d28f04d98307f652a2d85ff35e869f2e0ac7f38/src/dom/layout.js It's still very preliminary, but Element.Layout is meant to like a lazy-loading, memoized subclass of Hash. It gives measurements and offsets of practically any aspect an element's layout box. It's lazy- loading because some of these computations are costly and shouldn't be done unless strictly necessary. In other words, I can do something like this... var foo = $('foo'); var layout = foo.getLayout(); var width = layout.get('width'); // 144 (or some other number) var marginBoxWidth = layout.get('margin-box-width'); // 164 (content + padding + border + margin) Behind the scenes, it determined the width (i.e., the content box width) by taking the offsetWidth property from the element (which is the width of the element's border box) and subtracting the computed padding and border widths on both sides. When it did this, it cached the values for many other measurements, like border-box-width, padding-left, padding-right, and so on. If any of these values are requested directly, no further computation is necessary. Furthermore, when we ask for the margin-box-width (i.e., the space the element truly commands), it knows it needs to fetch margin-left and margin-right, but the values of all other properties are already cached. (A caveat: because of the caching, an Element.Layout object should be treated like a snapshot of an element's dimensions. When the dimensions of an object change, you ought to grab a new instance of Element.Layout.) Take a look at the code and tell me what you think. The API is far from complete, naturally, but it'd be great to know if people think this is the right idea. Cheers, Andrew Assuming I've used ... git clone git://github.com/sstephenson/prototype.git why do I not get the layout.js file? And I've done this in a clean folder. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Prototype CHM issue.
Hi. I can't easily find an email address for Remi who created the CHM file. There is a slight issue with 1 link. In the api/elements/methods.htm file, there is a link ... or through the a href=../../api/elementcodeElement/code/a object This link works fine online, but not in an html file. Changing the link to ... or through the a href=../../api/element.htmcodeElement/code/a object (adding .htm) and it all works. Also, I was able to remove the auto hide of the navigation panel (which I found really annoying). I can supply the amended CHM file if anyone wants it or if possible, could you forward this message to Remi. Thank you. Richard Quadling. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Where can I get a CVS/SVN of the documentation please?
Hi. Where can I get a CVS/SVN of the documentation please? Regards, Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Had a lightbulb moment.
Hi. I've just reduced a fairly long winded each() loop to ... var i_LargestLabel = $$(s_CSS).invoke('getWidth').max(); So, this is just a thank you to all you developers. You all make me look really good! Thank you. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Deprecated API documentation
2008/10/26 T.J. Crowder [EMAIL PROTECTED]: Folks, We've had a suggestion to make the deprecated items in the API docs more obviously deprecated (e.g., in lists ): http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/291 What do you think of: 1. Using [deprecated] in the list of classes on the left (as we currently do for the list of methods on the right) for classes that have been deprecated, e.g., Position. 2. Using strikeout followed by the [deprecated] marker in the list at the top right when you're looking at the methods in a class? 3. Using strikeout in the list of methods (they already say [deprecated]). Seems like that would be fairly clear. Strikeout is still fairly readable, but it makes the point of something having been removed. -- T.J. Crowder tj / crowder software / com -1 for strikeout - simply looks ugly. +1 for [deprecated] -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Prototype.js (1.6.0.3) breaks Firebug (1.2.1) Options allegedly.
2008/10/15 Andrew Dupont [EMAIL PROTECTED]: Only in the sense that Prototype seems not to be safe to use inside a Firefox extension. But even that isn't clear. I posted in the thread to try to cut through the hearsay and speculation. Thanks, Richard. Cheers, Andrew Just fighting the good fight! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Prototype.js (1.6.0.3) breaks Firebug (1.2.1) Options allegedly.
Hi. There's been this recent thread in the FireBug Google Group - http://groups.google.com/group/firebug/browse_thread/thread/095caa522cecbeca?hl=en# Is there any real issue here? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Fwd: Where is the source?
2008/9/12 John-David Dalton [EMAIL PROTECTED]: The core devs are in the process of cleaning up the 1.6.0.3 release: You may check Tobies 1.6.0.3 branch: http://github.com/tobie/prototype/tree/1.6.0.3 - JDD I see. I would have thought that prototype would have been in the same place for all branches. I'm used to working with CVS and have tags and branches. Didn't realize git required a completely different repository for a branch. So what happens if (for arguments sake), Tobie decides to up and leave, closing the github? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: New Name for Users Group (RoR Spinoffs)
For keeping them all guessing ... 'Your Sprout, A Sceptic Plot' 2008/6/17 kangax [EMAIL PROTECTED]: TJ, Why users postfix? : ) Why not just Prototype Scriptaculous? - kangax On Jun 17, 1:57 pm, T.J. Crowder [EMAIL PROTECTED] wrote: Hi folks, I've been chatting today with Tobie about renaming / replacing the RoR Spinoffs mailing list (there's a thread about it over there[1]). Rationale and discussion over there, but the short version is that pretty much everyone agrees we should do it, and so Tobie and I were talking about mechanics and transition. So we need to think of a new name. I made a suggestion in the thread, I made a suggestion that no one really commented on either way. I'll revise it slightly: My suggestion is Prototype and Scriptaculous Users ([EMAIL PROTECTED]). Boring, but fairly clear. Tobie suggested we should discuss the name here. What do you think? Better ideas? -- T.J. Crowder tj / crowder software / com [1] - http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thr... -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: typeof returning object for certain 'native' functions in IE
2008/6/6 artemy tregoubenko [EMAIL PROTECTED]: Some other functions: typeof setTimeout object typeof clearTimeout object typeof setInterval object typeof clearInterval object Thus: typeof setTimeout.defer undefined typeof setTimeout.delay undefined typeof setTimeout.curry undefined On Fri, 06 Jun 2008 14:08:24 +0400, T.J. Crowder [EMAIL PROTECTED] wrote: OMG, I can confirm this, on IE6 anyway. (Couldn't they get *anything* right? I mean, I know Firefox has its issues, but... And yes, technically a function is an object, but that's no excuse.) The only workaround that immediately comes to mind is to actually have a list of these and compare against them in IE -- e.g.: isFunction: (function(){ if (typeof window.close == object) { // IE version, works around typeof returning object for intrinsic functions return function(object) { return ( typeof object == function || object === window.close || object === document.getElementById // etc., etc., etc. ); }; } else { // Non-IE version, expects typeof to work correctly return function(object) { return typeof object == function; }; } })() Blech. The more of this that happens, the more I want a separate file that only IE people have to download containing these workarounds... -- T.J. Crowder tj / crowder software / com On Jun 6, 9:27 am, Viktor Kojouharov [EMAIL PROTECTED] wrote: Here's quite the problem in IE. For certain 'native' functions, like window.close, or document.getElementById, typeof for those functions returns on object in IE. Consequently, Object.isFunction will actually return false for those functions. Though there's probably little that can be done, I thought you guys should know about it. -- arty ( http://arty.name ) Thinking out loud ... if it is an object, what are it's properties? Can the presence of one of these be enough to act as a confirmation for isFunction()? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: typeof returning object for certain 'native' functions in IE
2008/6/6 T.J. Crowder [EMAIL PROTECTED]: Yeah, Richard's approach would be about eight times more elegant...if there were something reliable to test for. It can be IE-specific, of course. I was sure when I saw his post that there would be *something* we could check for, but none of the things that come to mind are both present (IE doesn't have arity) and sufficiently unique (see Kangax's comments about call, apply, etc.). (BTW, don't try to iterate the properties of an intrinsic function object using for..in with IE6 on XP; Bad Things happen.) Sadly my big list approach just won't work, it will always have holes in it. For example: var x = document.createElement(p); if (Object.isFunction(x.getAttribute)) { ... } So between the holes and the bloat involved in handling even the ones we could handle, I'd say we just mention it in Object.isFunction's docs and move on, until/unless someone finds the magic thing. -- T.J. Crowder tj / crowder software / com On Jun 6, 12:51 pm, kangax [EMAIL PROTECTED] wrote: I wish it was that easy : ) Unfortunately, we can't really account for all host objects, which are notorious for their incompliance with specs (e.g. it's well known how some of them have no constructor property, and others throw error when accessing certain properties). Hardcoding few methods barely solves the problem. We could of course check for apply/call members on an object, but guess what - those are undefined as well : ) As far as I remember jQuery calls object's toString, then tests if result contains function. That's clever, but unreliable, as any other object which defines toString to return something that contains function will produce falsy results. - kangax On Jun 6, 6:08 am, T.J. Crowder [EMAIL PROTECTED] wrote: OMG, I can confirm this, on IE6 anyway. (Couldn't they get *anything* right? I mean, I know Firefox has its issues, but... And yes, technically a function is an object, but that's no excuse.) The only workaround that immediately comes to mind is to actually have a list of these and compare against them in IE -- e.g.: isFunction: (function(){ if (typeof window.close == object) { // IE version, works around typeof returning object for intrinsic functions return function(object) { return ( typeof object == function || object === window.close || object === document.getElementById // etc., etc., etc. ); }; } else { // Non-IE version, expects typeof to work correctly return function(object) { return typeof object == function; }; } })() Blech. The more of this that happens, the more I want a separate file that only IE people have to download containing these workarounds... -- T.J. Crowder tj / crowder software / com On Jun 6, 9:27 am, Viktor Kojouharov [EMAIL PROTECTED] wrote: Here's quite the problem in IE. For certain 'native' functions, like window.close, or document.getElementById, typeof for those functions returns on object in IE. Consequently, Object.isFunction will actually return false for those functions. Though there's probably little that can be done, I thought you guys should know about it. What about a process of reduction? Those that can be id'd successfully by having a particular property then that solves them. The remaining ones ... And as much it pains me ... is it about time we had a browser_version_compatibility_plugin.js ? That way, for those that need to support clients with ie6, then they load the ie6 compatible layer. sort of thing. Hmm. There are a LOT of browsers and versions aren't there? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods
2008/5/14 Pat Nakajima [EMAIL PROTECTED]: I've started putting together a way to specify per-object before/after callbacks for any method. Probably not something to go in core, but maybe something that would be interesting to core contributors. There are some examples in a GitHub wiki (http://github.com/nakajima/ nakatype/wikis/callbacks), but basically, you specify callbacks like so: var someArray = [1,2,3]; Callbacks.add(someArray, { before: { push: function(entry) { var msg = 'about to push ' + entry + ' on array: ' + this.join(', '); console.info(msg); } }, after: { push: function(entry) { var msg = 'just pushed ' + entry + ' on array: ' + this.join(', '); console.info(msg); } } }); someArray.push(4); In addition to adding 4 to someArray, the above code snippet will log to the console before and after. If anybody has any suggestions/criticisms/threats, please do share! A very useful idea. How far is it from simple before/after callbacks to a full AOP implementation? Where I can see this being of instant use is the ability to develop a class with no logging/diagnostics from day 1 and have a drop-in before/after logger which wouldn't upset the main class. Rather than having to name the methods, it would be great to be able to wildcard/regex them ( /[sg]et.+/ for example) as well as allowing all with an exclude mechanism (allow the high use methods to NOT be logged). I used to do Delphi development for a Point of Sale system. One of the issues that we had was the user would say the calculation was wrong. By using a plugin we could effectively record all the values of all the calculations and the source of the values and produce a report of any calculation. Remove the plugin and the app did nothing. All the hooking and recording was in the plugin. This was useful especially when you are converting costs with markups for bulk quantities converted between buying and selling units. It is in keeping with the unobtrusive nature of much JS code. I think the callback handler should be available as an extension (like the deprecated.js one is). So, officially supported/recognised, but not built-in as standard. Maybe amend the rake dist process to allow those with the skills to build their own prototype.js with the required extensions built in. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods
2008/5/15 Pat Nakajima [EMAIL PROTECTED]: With regards to your desire to skip the callbacks for some methods, you can actually call methodWithoutCallbacks to call a method sans- callbacks. I think that the wildcard/regex idea is neat, though I'm not sure how it could be accomplished unobtrusively. I could imagine overriding all of the object's methods to be called through a sort of method handler (similar to what I was playing with when I created this lazy class: http://github.com/nakajima/nakatype/tree/master/src/lazy_class.js), then having the method handler match callbacks to called methods. It seems a bit cleaner than my example, though it doesn't quite feel right still. This is top of my head stuff. // Allow the wrapping of many different methods. Callback.addWrappers : function(klass_ToWrap, before/after/around, {array of methods}/single method/regex, klass_Payload.Payload) // Allow the wrapping of all methods except those supplied. Callback.addWrappersAllBut : function(klass_ToWrap, before/after/around, {array of methods}/single method/regex, klass_Payload.Payload) Param 1 : klass_ToWrap is the class to which we are going to wrap some additional behaviour. Param 2 : before/after/around is 1 of the three ways to wrap the behaviour : before only, after only or around which is both before and after. Param 3 : {array of methods}/single method/regex : allow an array of known methods to be wrapped, a single method or a regex Param 4 : the method to call. The first argument in the callback will be to indicate if it is before or after. This allows for a single method to be wrapped around another. The other parameters need to be the parameters passed to the klass_ToWrap method. I would guess that there would be a private method which did the wrapping for a single source class method. So both Callback methods iterate the list of supplied methods and call the private method to do the wrapping. So, in the JS file that defines the logging class (which would need to be loaded after prototype.js, the callback handling class and the klass_being_wrapped), ... var klass_Logging = Class.create({ // Use Firebug's console to show trace. Logging : function(b_Before, s_Klass, s_Method) { switch(b_Before) { case true : console.group('Entering ' + s_Klass + '.' + s_Method + '(', arguments, ')'); break; default : console.groupEnd(); } } }); // Add Firebug tracing to klass_ToWrap Callback.addWrappers(klass_ToWrap, 'around', /*/, klass_Logging.Logging); I'm actually not so familiar with AOP, so perhaps after I spend some time with that, I'll be able to tackle some of these ideas. On May 15, 8:17 am, Richard Quadling [EMAIL PROTECTED] wrote: 2008/5/14 Pat Nakajima [EMAIL PROTECTED]: I've started putting together a way to specify per-object before/after callbacks for any method. Probably not something to go in core, but maybe something that would be interesting to core contributors. There are some examples in a GitHub wiki (http://github.com/nakajima/ nakatype/wikis/callbacks), but basically, you specify callbacks like so: var someArray = [1,2,3]; Callbacks.add(someArray, { before: { push: function(entry) { var msg = 'about to push ' + entry + ' on array: ' + this.join(', '); console.info(msg); } }, after: { push: function(entry) { var msg = 'just pushed ' + entry + ' on array: ' + this.join(', '); console.info(msg); } } }); someArray.push(4); In addition to adding 4 to someArray, the above code snippet will log to the console before and after. If anybody has any suggestions/criticisms/threats, please do share! A very useful idea. How far is it from simple before/after callbacks to a full AOP implementation? Where I can see this being of instant use is the ability to develop a class with no logging/diagnostics from day 1 and have a drop-in before/after logger which wouldn't upset the main class. Rather than having to name the methods, it would be great to be able to wildcard/regex them ( /[sg]et.+/ for example) as well as allowing all with an exclude mechanism (allow the high use methods to NOT be logged). I used to do Delphi development for a Point of Sale system. One of the issues that we had was the user would say the calculation was wrong. By using a plugin we could effectively record all the values of all the calculations and the source of the values and produce a report of any calculation. Remove the plugin and the app did nothing. All the hooking and recording was in the plugin. This was useful especially when you are converting costs with markups for bulk quantities converted between buying and selling units. It is in keeping with the unobtrusive nature of much JS code. I think the callback handler should be available as an extension (like the deprecated.js one is). So, officially supported
[Prototype-core] GIT's equivalent of the ChangeSet number.
Hi. I'm new to GIT. I've used CVS and SVN. With CVS, version numbers could be automatically updated within the file so you know from the version numbers you knew if you were upto date or not as the number was human readable ((lcoal) 1.2.3 vs (cvs) 1.2.4 for example). With SVN, you could see the last changeset number to know if you were uptodate. In my mind, having the number in the file would have been nice, but that's only cause I'm use to it from CVS. The changeset numbers are useful as they are sequential and like a cross-project commit whereas in CVS each commit is to a file. (As I understand things only being a user of these tools!). With GIT, the changeset numbers are meaningless and there is no version number in the file. I feel like I've lost something. I'm not sure I have, I just feel like it. What is the normal way these tools are supposed to be used? Am I supposed to blindly update each time I want to work on the code? This isn't finger pointing or anything, I'm just wondering how I'm supposed to work without versioning. Regards, Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Version numbers.
Hi. With the new git repository, is there any chance of having version numbers in the src files which are automatically updated by commits to git? I know this is possible with both CVS and SVN (but SVN didn't have branches so you only had 1 sequence). Not sure about git yet. Looking forward to some clever people getting a TortoiseGIT (don't look at me! I'm just a user). Regards, Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: [Rails Trac] #11481: [PATCH] [TEST] Constructor wrapper should return value
2008/4/28 Rails Trac [EMAIL PROTECTED]: #11481: [PATCH] [TEST] Constructor wrapper should return value ---+ Reporter: cch1 |Owner: sam Type: defect | Status: closed Priority: normal |Milestone: 2.x Component: Prototype | Version: edge Severity: normal | Resolution: wontfix Keywords: TRIVIAL constructor initialize return | ---+ Changes (by jdalton): * status: new = closed * resolution: = wontfix Comment: After some discussions I don't believe this will ever make it into the core. -- Ticket URL: http://dev.rubyonrails.org/ticket/11481#comment:9 In general, having class X being able to return class Y can be very useful (implementing a factory for example). I'm not saying that this SHOULD go in, but what are the primary reasons for NOT putting it in? Thanks. Richard Quadling. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: String methods
On 22/04/2008, braudes [EMAIL PROTECTED] wrote: Hi, I notice that the String class doesn´t have some simple methods. So, I added these: ltrim: function() { var re = /\s*((\S+\s*)*)/; return this.replace(re, $1); }, rtrim: function() { var re = /((\s*\S+)*)\s*/; return this.replace(re, $1); }, trim: function() { return this.rtrim().ltrim(); }, invert: function() { var len = this.length; var str = ; for (var i = len - 1; i -1 ;i--){ str += this.charAt(i); } return str; } I think we'll all got variations on this ... addCommas : function(s_Decimal, s_Thousand, s_SplitDecimalUsing){ return addCommas(this, s_Decimal, s_Thousand, s_SplitDecimalUsing); }, left : function(i_Len){ return this.substring(0, i_Len); }, lTrim : function(s_Trim){ return this.replace(((0 == arguments.length) || '' == s_Trim) ? /^\\s+/ : /^ + s_Trim + +/, ''); }, mid : function(i_Start, i_End){ i_Start = (!i_Start) ? 0 : i_Start; i_End = (!i_End || i_End this.length) ? this.length : i_End; i_End = (i_End != this.length) ? i_Start + i_End : i_End; return this.substring(i_Start, i_End); }, pad : function(i_padLen, s_padStr, i_padType){ return s_padStr || (s_padStr = ), (i_padLen -= this.length) 0 ? (s_padStr = new Array(Math.ceil(i_padLen / s_padStr.length) + 1).join(s_padStr)).substr(0, i_padType = !i_padType ? i_padLen : i_padType == 1 ? 0 : Math.ceil(i_padLen / 2)) + this + s_padStr.substr(0, i_padLen - i_padType) : this; }, right : function(i_Len){ return this.substring((this.length - i_Len), this.length); }, rTrim : function(s_Trim){ return this.replace((0 == arguments.length) ? /\\s+$/ : / + s_Trim + +$/, ''); }, trim : function(s_Trim){ if (0 == arguments.length){ return this.replace(/^\s+|\s+$/g, ''); } else { return this.lTrim(s_Trim).rTrim(s_Trim); } } -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: String methods
On 22/04/2008, Richard Quadling [EMAIL PROTECTED] wrote: On 22/04/2008, braudes [EMAIL PROTECTED] wrote: Hi, I notice that the String class doesn´t have some simple methods. So, I added these: ltrim: function() { var re = /\s*((\S+\s*)*)/; return this.replace(re, $1); }, rtrim: function() { var re = /((\s*\S+)*)\s*/; return this.replace(re, $1); }, trim: function() { return this.rtrim().ltrim(); }, invert: function() { var len = this.length; var str = ; for (var i = len - 1; i -1 ;i--){ str += this.charAt(i); } return str; } I think we'll all got variations on this ... addCommas : function(s_Decimal, s_Thousand, s_SplitDecimalUsing){ return addCommas(this, s_Decimal, s_Thousand, s_SplitDecimalUsing); }, left : function(i_Len){ return this.substring(0, i_Len); }, lTrim : function(s_Trim){ return this.replace(((0 == arguments.length) || '' == s_Trim) ? /^\\s+/ : /^ + s_Trim + +/, ''); }, mid : function(i_Start, i_End){ i_Start = (!i_Start) ? 0 : i_Start; i_End = (!i_End || i_End this.length) ? this.length : i_End; i_End = (i_End != this.length) ? i_Start + i_End : i_End; return this.substring(i_Start, i_End); }, pad : function(i_padLen, s_padStr, i_padType){ return s_padStr || (s_padStr = ), (i_padLen -= this.length) 0 ? (s_padStr = new Array(Math.ceil(i_padLen / s_padStr.length) + 1).join(s_padStr)).substr(0, i_padType = !i_padType ? i_padLen : i_padType == 1 ? 0 : Math.ceil(i_padLen / 2)) + this + s_padStr.substr(0, i_padLen - i_padType) : this; }, right : function(i_Len){ return this.substring((this.length - i_Len), this.length); }, rTrim : function(s_Trim){ return this.replace((0 == arguments.length) ? /\\s+$/ : / + s_Trim + +$/, ''); }, trim : function(s_Trim){ if (0 == arguments.length){ return this.replace(/^\s+|\s+$/g, ''); } else { return this.lTrim(s_Trim).rTrim(s_Trim); } } The addCommas shouldn't be there. Cut'n'paste error. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Timeline for supporting native array methods?
On 19/04/2008, John-David Dalton [EMAIL PROTECTED] wrote: Hi Richard, I was a little bummed by the switch at first as well. Now though I am beginning to see the cool side of it. For example before when you wanted to contribute you had to make a patch that would only work for the current version of Prototype and probably not the version that was in SVN (SVN is very picky about patches). With Git and GitHub you can create a forked repo of prototype. Commit your changes to it and send the core devs a pull request. Then they merge the changes into their repo :). Also this allows you to target a specific dev or group of devs and there are lots of options with Git. GitHub is hooked into Lighthouse (Prototype's new home for bug tracking) as well. It is command line at the time and the GUI's for it are very very basic. I am still learning it. I did have some issues getting my fork to pulldown, turns out I needed to log into my pull address via putty first to get it to save some registry info. Here are some links: Windows version of Git: http://code.google.com/p/msysgit/downloads/list Helpful links: http://www.sourcemage.org/Git_Guide http://www.kenegozi.com/Blog/2008/04/01/gitself-take-one.aspx http://github.com/guides Thanks for that. Can't wait for a Tortoise. It would almost be worth building a TortoiseAnything which provides an interface for CVS/SVN/GIT/etc to plug into. I bet the boffins are working on this right now. Thanks again. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Timeline for supporting native array methods?
On 17/04/2008, Tobie Langel [EMAIL PROTECTED] wrote: Changing versioning system (svn to git) What tools/software will be needed to download trunk, et al. I use TortoiseCVS and TortoiseSVN (all for Windows). Should I be looking for TortoiseGIT now? Why the change? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: OO concept in prototypejs
On 05/03/2008, vtsuper [EMAIL PROTECTED] wrote: There are 2 classes FormExt, AjaxRequest I create a FormExt object and when the user submit the form, then I will call another AjaxRequest Object When the AjaxRequest finish the process, then it will trigger onComplete I would like the onComplete method will call the FormExt.reset() so hwo to do this? I must pass the FormExt obj to the AjaxRequest??? and other method??? var FormExt = Class.create({ initialize: function(id){ this.id=id; this.obj=$(this.id); this.ajaxObj=''; this.eventSubmit=this.submit.bindAsEventListener(this); Event.observe(this.id, 'submit', this.eventSubmit); }, submit:function(e){ this.ajaxObj=new AjaxForm(this.id); this.ajaxObj.startAjax(); break; }, reset:function(){ this.obj.reset(); } }); var AjaxRequest = Class.create({ initialize: function(id){ this.frmObj=$(id); this.ajaxObj=''; }, startAjax: function(){ this.ajaxObj = new Ajax.Request( 'abc.php',{ onComplete:this.onComplete.bind(this) } ); } onComplete:function(){ alert('complete now'); } }); var AjaxRequest = Class.create ({ initialize: function(id) { this.frmObj=$(id); this.ajaxObj=''; }, startAjax: function() { this.ajaxObj = new Ajax.Request ( 'abc.php', { onComplete:function() { alert('complete now'); this.formObj.reset(); } } } }); maybe. Sorry for the reform. Makes it easier for me to read. Basically added this.formObj.reset(); to the onComplete function. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Deprecation.js
On 14/02/2008, Richard Quadling [EMAIL PROTECTED] wrote: On 14/02/2008, Tobie Langel [EMAIL PROTECTED] wrote: Hi Richard, Thanks for the thumbs up. deprecation.js is meant to be used with prototype.js, not a subset of it, so I don't think that's really an issue for now. The plan is to keep this new prototype extension up to date with the changes in Prototype, so once we remove the Position object, we'll add it to deprecation.js. Aha. Ok. I see. I was getting ahead of the game by taking out Postition before its time. Thanks. On Feb 14, 11:02 am, Richard Quadling [EMAIL PROTECTED] wrote: Hi. If you comment out from prototype.js the deprecated functions/classes (I take out the whole Position class for example), then deprecation.js fails due to the lack of the namespace: Position. So, using v1.6.0.2, should Position be defined but unused and therefore be in the global namespace or should it be commented out and deprecation.js cope with its absence? (I can't quite decide if this is a core or a spinoff issue). Would it be possible to add a version number/build number to the extension please. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Attaching event to instance of object in class
On 14/02/2008, kojilab [EMAIL PROTECTED] wrote: Hi, I have a class with DOM elements as properties. I want to bind events within the class to the ements. Unfortunately I am getting an error telling me those properties are not defined. Here's an simplfied example of what I'm trying to achieve. var MyClass=Class.create() MyClass.prototye = { initialize: function(element1, element2){ this.element1=element1; this.element2=element2; }, hide: function(){ this.element2.hide(); } } Can you try ... var MyClass=Class.create() MyClass.prototye = { initialize: function(element1, element2){ this.element1=$(element1); this.element2=$(element2); this.element1.observe('click', this.hide).bindAsEventListener(this); }, hide: function(){ this.element2.hide(); } } Not sure what you are observing, so chose click. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Event.isLeftClick() vs. click event in IE
On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: You'll be surprised that click _can_ be toggled via keyboard (FF, Opera for sure). You may easily test this. And my first example shows how isLeftClick is broken in IE6. I can't forget about IE6. Ah. Yes. on clickable objects (anchors and buttons), sorry. Forgot about those. But what are you trying to do by watching which mouse button? On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: I don't want to break keyboard navigation only because of IE problem. mousedown and click are both non-keyboard events. but click is only for left button. This is true for IE (7 on WinXPSP2) and FF (2.0.0.1 on WinXPSP2). Here is a script to show you... html head script type=text/javascript src=http://prototypejs.org/assets/2008/1/25/prototype-1.6.0.2.js;/script script type=text/javascript function clicking(e) { $('clicker').update($('clicker').innerHTML + 'br /' + 'You clicked with your ' + (Event.isLeftClick(e) ? 'Left' : '') + (Event.isRightClick(e) ? 'Right' : '') + (Event.isMiddleClick(e) ? 'Middle' : '') + ' button. Event.button = ' + e.button + ' and Event.which = ' + e.which ); } /script titleTesting clicking/title /head body span id=clickerLeft, Right or Middle click me!/span script type=text/javascript Event.observe(document.body, 'click', clicking); /script /body /html Try left/right/middle clicking in IE and FF and then change 'click' to 'mousedown' and retest. Hopefully that will show you what we mean. On Tue, 12 Feb 2008 03:45:22 +0300, tancurrom [EMAIL PROTECTED] wrote: I think its just because of the way JavaScript handles the click event. Use the 'mousedown' event instead of the 'click' event and you will get your results On Feb 11, 2:42 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: Hello, Event.isLeftClick() is told to differ left clicks from right and middle clicks. However when I run document.observe('click', function(event){ alert(event.isLeftClick()); }) in IE and then left-click page, I see 'false' in alert. This starts working if you listen to 'mousedown' or 'mouseup' events, but I don't like this way out. I don't like it because 'click' event may be triggered by keyboard too, and it's not good to forbid people to use keyboard at your site. I had an idea to listen for both 'mousedown' and 'click' events, but didn't manage to differ keyboard and mouse clicks in handler to avoid doubleposts. Is it possible to fix isLeftClick? If not, is there some nice workaround for this situation? -- arty (http://arty.name) -- arty ( http://arty.name ) -- arty ( http://arty.name ) -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Event.isLeftClick() vs. click event in IE
On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: I don't want to break keyboard navigation only because of IE problem. mousedown and click are both non-keyboard events. but click is only for left button. This is true for IE (7 on WinXPSP2) and FF (2.0.0.1 on WinXPSP2). Here is a script to show you... html head script type=text/javascript src=http://prototypejs.org/assets/2008/1/25/prototype-1.6.0.2.js;/script script type=text/javascript function clicking(e) { $('clicker').update($('clicker').innerHTML + 'br /' + 'You clicked with your ' + (Event.isLeftClick(e) ? 'Left' : '') + (Event.isRightClick(e) ? 'Right' : '') + (Event.isMiddleClick(e) ? 'Middle' : '') + ' button. Event.button = ' + e.button + ' and Event.which = ' + e.which ); } /script titleTesting clicking/title /head body span id=clickerLeft, Right or Middle click me!/span script type=text/javascript Event.observe(document.body, 'click', clicking); /script /body /html Try left/right/middle clicking in IE and FF and then change 'click' to 'mousedown' and retest. Hopefully that will show you what we mean. On Tue, 12 Feb 2008 03:45:22 +0300, tancurrom [EMAIL PROTECTED] wrote: I think its just because of the way JavaScript handles the click event. Use the 'mousedown' event instead of the 'click' event and you will get your results On Feb 11, 2:42 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: Hello, Event.isLeftClick() is told to differ left clicks from right and middle clicks. However when I run document.observe('click', function(event){ alert(event.isLeftClick()); }) in IE and then left-click page, I see 'false' in alert. This starts working if you listen to 'mousedown' or 'mouseup' events, but I don't like this way out. I don't like it because 'click' event may be triggered by keyboard too, and it's not good to forbid people to use keyboard at your site. I had an idea to listen for both 'mousedown' and 'click' events, but didn't manage to differ keyboard and mouse clicks in handler to avoid doubleposts. Is it possible to fix isLeftClick? If not, is there some nice workaround for this situation? -- arty (http://arty.name) -- arty ( http://arty.name ) -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: onXYZ handlers in Ajax.Responders
On 08/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: On Fri, 08 Feb 2008 13:23:48 +0300, Richard Quadling [EMAIL PROTECTED] wrote: On 08/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: Hi, My site will respond with 503 http code while in maintenance. I want to handle this response in ajax requests. Prototype's onXYZ ajax handlers suit perfectly for this task. Except for one thing: these handlers aren't called when specified in Ajax.Responders, so I will have to include them in every request. This is highly inconvenient : ( This problem can be easily solved with just one extra line in respondToReadyState (patch applied, and I can post it in trac too), but this requires code to be included in core prototype, as handling the situation in custom wrapper isn't too easy. Are there objections against supporting onXYZ handlers in Ajax.Responders? -- arty ( http://arty.name ) I've already submitted a more encompassing patch to allow onXYZ and still allow onSuccess/onFailure. http://dev.rubyonrails.org/ticket/9690 Great! Though I'm not sure that existence of onXYZ responder should cancel onSuccess/onFailure, as this creates multiple ambiguities/problems you've noted in comments to that issue. I'm not so sure. If you have them defined for the current request AND you have onxyz as a global responder ... By allowing the global responder to return true/false, you can say what you want to happen in the current request. That is the idea. But even though I use this patch all day, I'm not sure what the core team think on it. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: samples
On 30/01/2008, sharosh [EMAIL PROTECTED] wrote: hi got you hear about prototype from a friend of mine. im a usablity designer so im more intersted in seeing protype in action is there some demo's or samples put up in the website, cas i was trying to find out in the website . i would really apperciate if you can help me with some URLS for the same.. thanks sharosh Prototype is a library. It doesn't DO anything itself. You have to create your own applications. A good example of the use of Prototype is it's sister-in-crime, Scriptaculous. Lot's of demos - http://script.aculo.us/ -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: How to get the request parameters from the response?
The response object has a property of request. One issue I found. If there is an exception, the exception always gets the request object. http://dev.rubyonrails.org/ticket/9691 I've sent a patch which would add the response to the request (which is fed to the exception) to allow an exception to get the whole picture. On 28/01/2008, Gareth Evans [EMAIL PROTECTED] wrote: I always thought the parameter to the callback was just the server reply (response) The docs show transport as a param, I didn't realise it was an instance of the request. Given this information, you're right, there's not a lot of sense to what i'm doing. After a quick spot of searching the API docs, it is mentioned there.. http://www.prototypejs.org/api/ajax/options Common callbacks When used on individual instances, all callbacks (except onException) are invoked with two parameters: the XMLHttpRequest object and the result of evaluating the X-JSON response header, if any (can be null). However, you have to actually check Ajax.Response; http://www.prototypejs.org/api/ajax/response To see what the structure of the first paramter should be. Is it worth rewording the common callbacks section and providing a link to ajax.response here? Also a function signature could be included in the common callbacks section. Might prevent others from making the same mistake. Gareth On Jan 28, 2008 1:29 PM, kangax [EMAIL PROTECTED] wrote: Gareth, new instance of Ajax.Response is passed as a first argument into a callback. That instance has request property which points to request object (the one that has all your settings/parameters, etc.). I don't really see a reason to do what you're doing. Best, kangax -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Deprecated Section.. gone when?
On 07/01/2008, Kjell Bublitz [EMAIL PROTECTED] wrote: Hi all! Since we are past 1.6.0 final i wonder when you will remove the deprecated portion of the source. Best, Kjell Bublitz I do this by hand by adding comment tags around the code. That way, it is just an uncomment when you realize you are still relying on some old code! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: A question regarding changeset 8548.
On 04/01/2008, Richard Quadling [EMAIL PROTECTED] wrote: Hi. I have a question which those who know it better may be able to answer. Shouldn't the order of firing the dom:loaded event and the setting of document.loaded be swapped? What I'm thinking is if any event handlers on dom:loaded take a while, anything trying to see if document.loaded is true isn't going to get it. As it stands, the dom isn't loaded until all the observers have finished executing (I think). I may have got some or all of this wrong. Richard. http://dev.rubyonrails.org/changeset/8548 -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Event.element Problem
My patch, my patch! Woo hoo! On 12/12/2007, Mislav Marohnić [EMAIL PROTECTED] wrote: Relevant ticket: http://dev.rubyonrails.org/ticket/8397 This has been reported in the issue tracker multiple times, I closed the duplicates. On Dec 12, 2007 8:00 AM, Andrés Robinet [EMAIL PROTECTED] wrote: Hello there, I was experiencing a problem with the Prototype Adapter for ExtJS (http://extjs.com). It happened to me that every time I hit the refresh button in IE 7, I got a JavaScript error popup. Then I tried the fix posted at this link http://extjs.com/forum/showthread.php?p=97978#post97978 by splintor (the last post) as I was using Prototype 1.6. That fixed my problem once and forever. Maybe this is an ExtJS bug which requires patching prototype because it's easier than fixing the adapter... I tried searching the ruby on rails bug tracking system for this bug and didn't find it (Please double check it, I just spent 15 minutes or so trying to find it... maybe it's there, or has another title). Anyway... I just wanted to draw your attention on this, so if this is a Prototype bug you can give it the proper treatment (or you can throw some hints and explanations if this is not a bug, that is also welcome). Thanks in advance, Rob -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: features request
Here is the Scriptaculous.require method ... var Scriptaculous = { Version: '1.8.0', require: function(libraryName) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write('script type=text/javascript src='+libraryName+'\/script'); }, Notice the comment? I'm not in a position to test this (I don't have Safari). On 22/11/2007, tbela99 [EMAIL PROTECTED] wrote: Hello Mr Ken, you did not understand me very well, i do the same thing as you do, merging many javascript and css files into single files to optimize resources. but i do not merge all files at once. as user need, i may dynamically load one or many optimized file, and this does not require XMLHTTPRequest, just setting up a script or link correctly and push it into the head section, this make the browser load the file. function loadScript(src) { myScript = document.createElement('SCRIPT'); myScript.src = url my.type = 'text/javascript'; ... } after that, you just insert the script into the head section of the page. you can do the same for css with the link element. additionnaly you may add a way to set up a callback function that control the loading state. -- best regards -- -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Other API using Object.prototype breaks prototype.js for/in loop
Just in case anyone who isn't german (I assume) is reading this - verboten === forbidden. On 24/10/2007, Olivier Jaquemet [EMAIL PROTECTED] wrote: In short, Object prototype is verboten. Prototype library will break if you augment Object.prototype, and this is not likely to change. [...] We could say, json.js is verboten :) I hope this clears up the issue. This is very clear :) I will forward this to the RSH maintainer in hope he will agree :) Thanks for you quick answer. Regards, Olivier Jaquemet -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Other API using Object.prototype breaks prototype.js for/in loop
On 29/10/2007, Mislav Marohnić [EMAIL PROTECTED] wrote: On 10/29/07, Richard Quadling [EMAIL PROTECTED] wrote: Just in case anyone who isn't german (I assume) is reading this - verboten === forbidden. Do a Google search for object.prototype is * and see what verb first pops up :) http://www.google.com/search?q=object.prototype+is+* It is a well-known article that was frequently cited. Thanks for that. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: `new Element' does not take care to properly set up event attributes in IE
On 19/10/2007, Mislav Marohnić [EMAIL PROTECTED] wrote: On 10/19/07, Viktor Kojouharov [EMAIL PROTECTED] wrote: Mislav, the problem is not whether you are interested in making this work or not, the problem is that `new Element' doesn't behave like a 'prototype' function, since it's not consistent across browsers. So, to make it work in IE we should special-case onclick, onsubmit etc. not to be set with setAttribute. Any bright idea how we could differentiate those? Names beginning with on is out of the question. How bad would it be if the value is detected as a function and then an observe is done based upon the name. What is odd is that by passing a function as the value it works in IE but not in FF. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: `new Element' does not take care to properly set up event attributes in IE
On 19/10/2007, Viktor Kojouharov [EMAIL PROTECTED] wrote: This is a really troublesome bug, which is exhibited in IE browsers. Consider this code: new Element('div', {onclick: 'alert(this)'}); In every other browser, this will produce a div, that, when clicked, will alert. In IE, on* events are not registered, since internally prototype uses setAttribute. setAttribute cannot set these. The only way such attributes can be registered is in the createElement method itself. For this reason, I've written a drop-in replacement for 'new Element' which fixes this issue. I seriously urge you to fix this issue (by either using the code below, or using your own methods), otherwise `new Element' will not create elements that are identical throughout all browsers. That being said, this is my drop-in replacement: (function() { var element = this.Element; this.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (Prototype.Browser.IE) { var conflicts = $H(attributes).grep(/(?:name|on\w+)/); if (conflicts.length) { var attributeString = ''; conflicts.each(function (tuple) { delete attributes[tuple[0]]; attributeString += tuple[0] + '=' + tuple[1] + ''; }); tagName = '' + tagName + ' ' + attributeString + ''; return Element.writeAttribute(document.createElement(tagName), attributes); } } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; Object.extend(this.Element, element || { }); }).call(window); Here is the code not working. http://pastie.caboo.se/108855 I can get it to work in IE OR FF but not both. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: isLeftClick Bug in Proto 1.6.0 RC1
On 17/10/2007, Bart Lewis [EMAIL PROTECTED] wrote: Today I updated to Prototype 1.6.0 RC1 from RC0. I am also using Scriptaculous 1.8 preview. Beyond changing my contentloaded to dom:loaded the transition seemed to go fairly smoothly. Until I encountered the following error in IE (6 and 7): Drags created with new Draggable(...) no longer drag. I traced this back to prototype's isLeftClick always returning false. Looks like isLeftClick was significantly changed just yesterday: http://dev.rubyonrails.org/changeset/7926 -B Yes it was. Here is the new code you need for the is[Left|Middle|Right]Click to work. Around line 3700-ish. Event.Methods = (function() { var isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; isButton = function(event, code) { return event.button == buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { isButton = function(event, code) { switch (code) { case 0: return event.which == 1 !event.metaKey; case 1: return event.which == 1 event.metaKey; default: return false; } }; } else { isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } return { isLeftClick: function(event) { return isButton(event, 0) }, isMiddleClick: function(event) { return isButton(event, 1) }, isRightClick: function(event) { return isButton(event, 2) }, ... -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Source code style
Are there any good JS prettifiers online? Maybe a link through for those needing a little visual help would benefit? On 05/10/2007, Thomas Fuchs [EMAIL PROTECTED] wrote: Hi Sven! We won't change the way the source code is formatted, as we like it the way it is. Most people take a short while to switch over from more traditional JavaScript source code formatting, but once you've made that step the code is pretty easy to read. The basic rules governing the style are conciseness and overal code beauty (of course, beauty lies in the eye of the beholder, so YMMV). Best, Thomas Am 04.10.2007 um 13:07 schrieb Sven Klose: I�m new to the source code, and had big trouble reading it. With the right indentation one could spot constructs immediately, but actually, the code is so compressed, it takes ages to even figure out where a function starts and where it ends, to spot if-statements and variable declarations, and so on. Some suggestions in detail: - dedicate a whole line for an opening/ending brace of a function if it doesn't contain just one statement, - keep the width of lines small, - declare only a single variable in a var-statement, - have indented conditional blocks, instead of squeezing an if- statement into a single line, - use distinct variable names, not 'Method' and 'method' in the same function for example, - use TABs, so all this all can be done without increasing the code size, and one can set the indentation width to suit his/her needs, - add more comments :) Your visual perception can spot the overall structure of code at once. Please keep it stupid for the likes of me. ;) I'd do the reformatting, if desired. However, I find the use of spaces and empty lines very good already. Best regards. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Bug?
Using FF and/or the patch previously mentioned and no requests are made. On 22/08/07, Mislav Marohnić [EMAIL PROTECTED] wrote: On 8/22/07, Wiktor Ihárosi [EMAIL PROTECTED] wrote: I think Sam had reason to write this. I reread Dean Edwards's - who else? :) - post about the window.onload and one of the last comment says with https you can remove the protocol. http://dean.edwards.name/weblog/2006/06/again/?full#comment56361 Nice research, Wiktor. Thanks Jason, can you confirm for sure that your setup makes HTTP requests? Can you give us more detailed information? Thanks -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Date prototype functions [BUMP]
I think many users would be grateful of having additional libraries/plugins like this. Whilst not necessarily part of the core, having them logged and available from prototype.js (with all the usual test cases) would be a nice idea. Libraries/snippets could/would have peer review for conforming to best practice for using prototype. The alternative is that a lot of this sort of stuff is on a hundred different servers and no validation on which version of prototype things work with. I would say that whoever wrote the library has the responsibility of keeping it upto date with the current prototype. Tests can should be run to confirm that the library works and ensures compatibility. On 22/08/07, Mislav Marohnić [EMAIL PROTECTED] wrote: On 8/22/07, Ken Snyder [EMAIL PROTECTED] wrote: What is the feeling on adding functions to Date.prototype? As mentioned in March (see message at bottom), adding Date.prototype.succ() would allow some helpful iterating. I would suggest an optional argument to succ for time period and I also would like to throw out several more possible methods (below). Ken, these are nice and certainly useful, but I don't think most of the people have a need for them. Most of the heavy-duty date/time logic should be kept in your application (server-side). But I'll let other core members speak for themselves. You're encouraged to keep maintaining this extensions and releasing them open-source so people who do need them can benefit. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Bug?
On 23/08/07, Mislav Marohnić [EMAIL PROTECTED] wrote: On 8/23/07, Richard Quadling [EMAIL PROTECTED] wrote: Using FF and/or the patch previously mentioned and no requests are made. Can you please try src=//: ... like in Base2 and see if there are requests. Thanks Being a numpty, my current code is ... var src = javascript:void(0); if (location.protocol == https:) src = https://; + src; document.write(script id=__onDOMContentLoaded defer src=' + src + '\/script); This needs to become what? I don't know what Base2 is (sorry). -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Array inline filtering.
Hi. I've just created a small function to filter an array. Sort of the reverse of each+without. /* Version 1.0.0 - Thursday, 23 August 2007 10:25 am */ Object.extend ( Array.prototype, { /***/ /* Allow inline filtering of an array. */ /***/ filter: function(f_Filter) { var a_Return = []; for (var i = 0, length = this.length; i length; ++i) if (f_Filter(this[i])) a_Return.push(this[i]); return a_Return; } } ); Usage : a_Array.filter(function(item){return true/false;}).chain().chain(); With that 2 questions. 1 - Have I made any REALLY obvious mistakes. 2 - How do I submit this to the core? Richard -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Bug?
On 23/08/07, Mislav Marohnić [EMAIL PROTECTED] wrote: On 8/23/07, Richard Quadling [EMAIL PROTECTED] wrote: This needs to become what? I don't know what Base2 is (sorry). document.write(script id=__onDOMContentLoaded defer src=//:\/script); Works fine in IE7 and FF using 1.6.0_rc0. No requests made. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Bug?
On 23/08/07, Wiktor Ihárosi [EMAIL PROTECTED] wrote: On Aug 23, 11:35 am, Richard Quadling [EMAIL PROTECTED] wrote: document.write(script id=__onDOMContentLoaded defer src=//:\/script); Works fine in IE7 and FF using 1.6.0_rc0. No requests made. Great! :) ps: I obviously meant //: when I wrote ://. sorry for the typo... Ah. That's now generating requests. 127.0.0.1 - - [23/Aug/2007:13:01:42 +0100] GET /:// HTTP/1.1 404 434 78 http://dev.salesops.rquadling/index.php?Action=1.1D; Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; 127.0.0.1 - - [23/Aug/2007:13:01:42 +0100] GET /:// HTTP/1.1 404 434 78 http://dev.salesops.rquadling/index.php?Action=1.1D; Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; But only for IE, not FF2. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Bug?
On 23/08/07, Wiktor Ihárosi [EMAIL PROTECTED] wrote: On Aug 23, 2:03 pm, Richard Quadling [EMAIL PROTECTED] wrote: That's now generating requests. I think I was not clear enough. The correct and working syntax is //: which Mislav mentioned. In my first letter I made a typo, but Mislav wrote the correct syntax for you. He is right, document.write(script id=__onDOMContentLoaded defer src=//:\/script); is right! Sorry for confusing things! :( No problems. Back working again now. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Array inline filtering.
Ah. My CHM is upto 1.5 which is why I didn't see it. On 23/08/07, Jeff Watkins [EMAIL PROTECTED] wrote: Richard, this seems similar to the standard js 1.6 Array.prototype.filter method. You might be well advised to look at the Mozilla MDC site for example code that does this. On Aug 23, 2007, at 2:32 AM, Richard Quadling [EMAIL PROTECTED] wrote: Hi. I've just created a small function to filter an array. Sort of the reverse of each+without. /* Version 1.0.0 - Thursday, 23 August 2007 10:25 am */ Object.extend ( Array.prototype, { /***/ /* Allow inline filtering of an array. */ /***/ filter: function(f_Filter) { var a_Return = []; for (var i = 0, length = this.length; i length; ++i) if (f_Filter(this[i])) a_Return.push(this[i]); return a_Return; } } ); Usage : a_Array.filter(function(item){return true/false;}).chain().chain(); With that 2 questions. 1 - Have I made any REALLY obvious mistakes. 2 - How do I submit this to the core? Richard -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: SV: [Prototype-core] Inheritance: your thoughts?
On 27/06/07, Tobias Haagen Michaelsen [EMAIL PROTECTED] wrote: JavaScript is not a class based language and I think it is a mistake to try to hard to make it act like one. Many have tried this - and failed. I think we should focus some more on what it is we want to be able to do and not trying to make JavaScript into something it isn't. One of the reasons I love Prototype is because it utilises the strengths of the language. I don't want a lot of new 'magic' ways of doing stuff that is already possible pretty clean ways. Just my 2 cents -- since I felt this discussion was heading in a 'lets make JS more like Java/C++/etc. (or even Ruby)' :) -Tobias I don't think TPTB are trying to make JS into Java/PHP, etc. Just trying to make it easier for those that use OOP in the server all day long have a helping hand in getting similar functionality into their client side work. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@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-core?hl=en -~--~~~~--~~--~--~---