[Proto-Scripty] Re: Scriptaculous drag and drop
I have created a demo page to better describe my problem, take a look here: http://www.dantilley.net/dnd_problem.html This is a simplified version of a page I am working on, the problem is that if I scroll down to the lower objects I can no longer drop them on the areas at the top. On 7 Oct, 12:35, BlackEel dan.til...@gmail.com wrote: Basic problem: I have a large list of objects that are drag and drop, the page scrolls vertically, there also drop targets on the page, but at the top. Therefore if I scroll to the bottom of the object list I cannot drop draggables on the drop targets at the top of the page. Solution one: Make the drop targets position:fixed; This is great, the drop targets are always on screen no matter where you scroll on the object list, and is my prefered solution. Problem: postion:fixed; breaks the drop targets, the drop target stays at the top of the page only the visual representation of the drop target stays fixed. Solution two: Make the object list overflow-y:scroll; This is not as good a solution but it would work by making the object list height less than the browser window height with a scroll bar so that you can scroll the object list without moving the drop targets. Problem: Draggables are confined inside the scrollable div, you can still work the drop targets with the mouse cursor but the visual representation of the dragged object is hidden in the scrollable divs overflow. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Scriptaculous drag and drop
i would suggest using onDrag and checking if the current X/Y of the dragged element is outside the viewport ... if it is then scroll the window up to suit. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: BlackEel dan.til...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, October 08, 2009 12:34 PM Subject: [Proto-Scripty] Re: Scriptaculous drag and drop I have created a demo page to better describe my problem, take a look here: http://www.dantilley.net/dnd_problem.html This is a simplified version of a page I am working on, the problem is that if I scroll down to the lower objects I can no longer drop them on the areas at the top. On 7 Oct, 12:35, BlackEel dan.til...@gmail.com wrote: Basic problem: I have a large list of objects that are drag and drop, the page scrolls vertically, there also drop targets on the page, but at the top. Therefore if I scroll to the bottom of the object list I cannot drop draggables on the drop targets at the top of the page. Solution one: Make the drop targets position:fixed; This is great, the drop targets are always on screen no matter where you scroll on the object list, and is my prefered solution. Problem: postion:fixed; breaks the drop targets, the drop target stays at the top of the page only the visual representation of the drop target stays fixed. Solution two: Make the object list overflow-y:scroll; This is not as good a solution but it would work by making the object list height less than the browser window height with a scroll bar so that you can scroll the object list without moving the drop targets. Problem: Draggables are confined inside the scrollable div, you can still work the drop targets with the mouse cursor but the visual representation of the dragged object is hidden in the scrollable divs overflow. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] prototype.js from 1.5 from 1.6 in Zend Framework
Hi, I'm trying to replace the Prototype JavaScript framework version (1.5) with the 1.6.0.3 one into a PHP project using Zend framwork, Smarty and Scriptaculus. I do a Ajax.Request according to the parameters from the UserRegistrationForm. The response is sent using this helper method: public function sendJson ($data) { $this-_helper-viewRenderer-setNoRender(); $this-getResponse()-setHeader('Content-type', 'application/json'); echo Zend_Json::encode($data); } So, I changed some lines to fit the Prototype JavaScript framework, version 1.6.0.3 in the onFormSuccess : function(transport) { // var json = transport.responseText.evalJSON(true); // = v 1.5 var json = transport.responseJSON; // var errors = $H(json.errors); // = v 1.5 var errors = json.errors; if (errors.length 0) { this.form.down('.error').show(); errors.each( function(pair) { this.showError(pair.key, pair.value); }.bind(this)); } else { this.form.submit(); } } But actually this code doesn't work since errors is an Object and length property is undefined... (that's what i've seen in Firedebug) So I would like to know how I can process errors object to retrieve the key/value pairs. errors object is managed by a FormProcessor object: ?php abstract class FormProcessor { protected $_errors = array(); protected $_vals = array(); private $_sanitizeChain = null; public function __construct() { } abstract function process(Zend_Controller_Request_Abstract $request); public function sanitize($value) { if (!$this-_sanitizeChain instanceof Zend_Filter) { $this-_sanitizeChain = new Zend_Filter(); $this-_sanitizeChain-addFilter(new Zend_Filter_StringTrim()) -addFilter(new Zend_Filter_StripTags()); } // filter out any line feeds / carriage returns $ret = preg_replace('/[\r\n]+/', ' ', $value); // filter using the above chain return $this-_sanitizeChain-filter($ret); } public function addError($key, $val) { if (array_key_exists($key, $this-_errors)) { if (!is_array($this-_errors[$key])) $this-_errors[$key] = array($this-_errors [$key]); $this-_errors[$key][] = $val; } else $this-_errors[$key] = $val; } public function getError($key) { if ($this-hasError($key)) return $this-_errors[$key]; return null; } public function getErrors() { return $this-_errors; } public function hasError($key = null) { if (strlen($key) == 0) return count($this-_errors) 0; return array_key_exists($key, $this-_errors); } public function __set($name, $value) { $this-_vals[$name] = $value; } public function __get($name) { return array_key_exists($name, $this-_vals) ? $this-_vals [$name] : null; } } ? thanks, Romain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] About $$ utility
I have two strings 'part1' and 'partF'. I want to get the reference to the element that have the two strings in its id: input type=text id=partA part1 part2 partD input type=text id=partB part1 part3 partE input type=text id=partC part1 part4 partF input type=text id=partD part1 part5 partG I can use the $$ utility? Thanks. Lorenzo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] select elements
Hello anyone, i try to select a label for=options_10_2 like this: $('options-10-list').select('[for=options_10_2!]').each(function(e) { e.addClassName('highlight'); }); or this: $('options-10-list').down(3).each(function(e) { e.addClassName('highlight'); }); But its doing nothing. What wrong on this snippets? Thanks for Help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Limit in parameter lenght at Ajax.Request?
Hi all, I'm trying to send the text from a textarea via the Ajax.Request Method to my PHP-Script. If the lenght of the text in the textarea exceeds 6000 characters it seems not to work. Is there a limit somewhere? I can't find anything about that in the API Doc. Thanks for any help! Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: About $$ utility
Hi, I'm afraid those IDs are invalid. IDs cannot contain spaces.[1] Do you mean to be uses classes, perhaps? But leaving aside that issue, yes, $$ can do substring matches within attributes using substring attribute selectors[2]. So for instance, if you used underscores instead: div id='one_two_three'alpha/div div id='one_three'beta/div div id='three_one'gamma/div div id='three'delta/div Then $$([id*=three]) would match all four divs above. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com [1] http://www.w3.org/TR/html401/types.html#type-name [2] http://www.w3.org/TR/css3-selectors/#attribute-substrings On Oct 8, 10:27 am, lodecesa lorenzo.deces...@gmail.com wrote: I have two strings 'part1' and 'partF'. I want to get the reference to the element that have the two strings in its id: input type=text id=partA part1 part2 partD input type=text id=partB part1 part3 partE input type=text id=partC part1 part4 partF input type=text id=partD part1 part5 partG I can use the $$ utility? Thanks. Lorenzo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: prototype.js from 1.5 from 1.6 in Zend Framework
I dont think onFormSuccess is valid.. i think it was changed to onSuccess but check the docs just incase HTH Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Romain Dequidt dequidt.rom...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, October 07, 2009 7:28 PM Subject: [Proto-Scripty] prototype.js from 1.5 from 1.6 in Zend Framework Hi, I'm trying to replace the Prototype JavaScript framework version (1.5) with the 1.6.0.3 one into a PHP project using Zend framwork, Smarty and Scriptaculus. I do a Ajax.Request according to the parameters from the UserRegistrationForm. The response is sent using this helper method: public function sendJson ($data) { $this-_helper-viewRenderer-setNoRender(); $this-getResponse()-setHeader('Content-type', 'application/json'); echo Zend_Json::encode($data); } So, I changed some lines to fit the Prototype JavaScript framework, version 1.6.0.3 in the onFormSuccess : function(transport) { // var json = transport.responseText.evalJSON(true); // = v 1.5 var json = transport.responseJSON; // var errors = $H(json.errors); // = v 1.5 var errors = json.errors; if (errors.length 0) { this.form.down('.error').show(); errors.each( function(pair) { this.showError(pair.key, pair.value); }.bind(this)); } else { this.form.submit(); } } But actually this code doesn't work since errors is an Object and length property is undefined... (that's what i've seen in Firedebug) So I would like to know how I can process errors object to retrieve the key/value pairs. errors object is managed by a FormProcessor object: ?php abstract class FormProcessor { protected $_errors = array(); protected $_vals = array(); private $_sanitizeChain = null; public function __construct() { } abstract function process(Zend_Controller_Request_Abstract $request); public function sanitize($value) { if (!$this-_sanitizeChain instanceof Zend_Filter) { $this-_sanitizeChain = new Zend_Filter(); $this-_sanitizeChain-addFilter(new Zend_Filter_StringTrim()) -addFilter(new Zend_Filter_StripTags()); } // filter out any line feeds / carriage returns $ret = preg_replace('/[\r\n]+/', ' ', $value); // filter using the above chain return $this-_sanitizeChain-filter($ret); } public function addError($key, $val) { if (array_key_exists($key, $this-_errors)) { if (!is_array($this-_errors[$key])) $this-_errors[$key] = array($this-_errors [$key]); $this-_errors[$key][] = $val; } else $this-_errors[$key] = $val; } public function getError($key) { if ($this-hasError($key)) return $this-_errors[$key]; return null; } public function getErrors() { return $this-_errors; } public function hasError($key = null) { if (strlen($key) == 0) return count($this-_errors) 0; return array_key_exists($key, $this-_errors); } public function __set($name, $value) { $this-_vals[$name] = $value; } public function __get($name) { return array_key_exists($name, $this-_vals) ? $this-_vals [$name] : null; } } ? thanks, Romain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: About $$ utility
those ID's are illegal - ID's should not contain spaces. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: lodecesa lorenzo.deces...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, October 08, 2009 10:27 AM Subject: [Proto-Scripty] About $$ utility I have two strings 'part1' and 'partF'. I want to get the reference to the element that have the two strings in its id: input type=text id=partA part1 part2 partD input type=text id=partB part1 part3 partE input type=text id=partC part1 part4 partF input type=text id=partD part1 part5 partG I can use the $$ utility? Thanks. Lorenzo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: prototype.js from 1.5 from 1.6 in Zend Framework
As you can see, onFormSuccess method is bound to the onSuccess callback of the Ajax.Request onSubmit : function(e) { Event.stop(e); var options = { parameters : this.form.serialize(), method : this.form.method, //requestHeaders: {Accept: 'application/json'}, // - I don't know if it's useful onSuccess : this.onFormSuccess.bind(this) }; this.resetErrors(); new Ajax.Request(this.form.action, options); }, Actually, my problem is that I don't know how to convert the errors object (from transport.responseJSON.errors) to be able to do the same thing as the version 1.5: onFormSuccess : function(transport) { var json = transport.responseText.evalJSON(true); var errors = $H(json.errors); if (errors.size() 0) { this.form.down('.error').show(); errors.each(function(pair) { this.showError(pair.key, pair.value); }.bind(this)); } else { this.form.submit(); } } Actually, i think the main trouble is because the new version of Hash (since the 1.6.0_rc1, October 16, 2007) is NOT backwards compatible with the former Hash class. On 8 oct, 14:22, Alex McAuley webmas...@thecarmarketplace.com wrote: I dont think onFormSuccess is valid.. i think it was changed to onSuccess but check the docs just incase HTH Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: Romain Dequidt dequidt.rom...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Wednesday, October 07, 2009 7:28 PM Subject: [Proto-Scripty] prototype.js from 1.5 from 1.6 in Zend Framework Hi, I'm trying to replace the Prototype JavaScript framework version (1.5) with the 1.6.0.3 one into a PHP project using Zend framwork, Smarty and Scriptaculus. I do a Ajax.Request according to the parameters from the UserRegistrationForm. The response is sent using this helper method: public function sendJson ($data) { $this-_helper-viewRenderer-setNoRender(); $this-getResponse()-setHeader('Content-type', 'application/json'); echo Zend_Json::encode($data); } So, I changed some lines to fit the Prototype JavaScript framework, version 1.6.0.3 in the onFormSuccess : function(transport) { // var json = transport.responseText.evalJSON(true); // = v 1.5 var json = transport.responseJSON; // var errors = $H(json.errors); // = v 1.5 var errors = json.errors; if (errors.length 0) { this.form.down('.error').show(); errors.each( function(pair) { this.showError(pair.key, pair.value); }.bind(this)); } else { this.form.submit(); } } But actually this code doesn't work since errors is an Object and length property is undefined... (that's what i've seen in Firedebug) So I would like to know how I can process errors object to retrieve the key/value pairs. errors object is managed by a FormProcessor object: ?php abstract class FormProcessor { protected $_errors = array(); protected $_vals = array(); private $_sanitizeChain = null; public function __construct() { } abstract function process(Zend_Controller_Request_Abstract $request); public function sanitize($value) { if (!$this-_sanitizeChain instanceof Zend_Filter) { $this-_sanitizeChain = new Zend_Filter(); $this-_sanitizeChain-addFilter(new Zend_Filter_StringTrim()) -addFilter(new Zend_Filter_StripTags()); } // filter out any line feeds / carriage returns $ret = preg_replace('/[\r\n]+/', ' ', $value); // filter using the above chain return $this-_sanitizeChain-filter($ret); } public function addError($key, $val) { if (array_key_exists($key, $this-_errors)) { if (!is_array($this-_errors[$key])) $this-_errors[$key] = array($this-_errors [$key]); $this-_errors[$key][] = $val; } else $this-_errors[$key] = $val; } public function getError($key) { if ($this-hasError($key)) return $this-_errors[$key]; return null; } public function getErrors() { return $this-_errors; } public function hasError($key = null) { if (strlen($key) == 0) return count($this-_errors) 0; return array_key_exists($key, $this-_errors); } public function __set($name, $value) { $this-_vals[$name] = $value; } public function __get($name) {
[Proto-Scripty] Re: 1.5.1 Hash to 1.6.1 Hash compatibility
My problem (http://groups.google.fr/group/prototype-scriptaculous/t/ 313d3a8b674d5b28?hl=fr) comes from that issue. The errors object is actually a empty array when there is no error. But when I try to create my hash by doing: $H(transport.responseJSON.errors) the result is a weird hash (size() == 38!) yoshi, how do you fixed it? what kind of test should I do before the hash creation? On 8 oct, 00:34, yoshi yosh...@hotmail.com wrote: i m trying to upgrade prototype 1.5.1 to 1.6.1, then realized that the $H changed, and not compatible with '[]' anymore. the code base is huge, and $H is used very often. i m wondering if theres a smarter way then 1) writing my own wrapper around $H, so it works with old code, or 2) surgically update all variables using $H thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: 1.5.1 Hash to 1.6.1 Hash compatibility
Would that be a relevant wrapper? function hash_wrapper(var) { if (var (var.constructor == Array) (var.length == 0)) { return; } return $H(var); } On 8 oct, 15:55, Romain Dequidt dequidt.rom...@gmail.com wrote: My problem (http://groups.google.fr/group/prototype-scriptaculous/t/ 313d3a8b674d5b28?hl=fr) comes from that issue. The errors object is actually a empty array when there is no error. But when I try to create my hash by doing: $H(transport.responseJSON.errors) the result is a weird hash (size() == 38!) yoshi, how do you fixed it? what kind of test should I do before the hash creation? On 8 oct, 00:34, yoshi yosh...@hotmail.com wrote: i m trying to upgrade prototype 1.5.1 to 1.6.1, then realized that the $H changed, and not compatible with '[]' anymore. the code base is huge, and $H is used very often. i m wondering if theres a smarter way then 1) writing my own wrapper around $H, so it works with old code, or 2) surgically update all variables using $H thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?
@Radoslav, I took some time today to look through your patch. It would make this function very easy to implement. It would take the form of a keypress event with ctrlkey=true and the necessary keyCode and charCode values. What is it's status? Will it make it into a future version of Prototype anytime soon? If not, what is the recommended way of using a patch like this? (I assume including it as a seperate js file on each page override the original function definition of fire, but that's not completely clear.) It took a little time for me to realize but I think it's the best way to go for a cross-browser compatible ZOOM solution. Thanks for the reply. On Oct 1, 7:47 am, Radoslav Stankov rstan...@gmail.com wrote: A time ago I have created ticket and a patch for making Event.fire to fire event (https://prototype.lighthouseapp.com/projects/8886/tickets/697-eventfi... ) Here is a git forhttp://gist.github.com/121011 I hope it's useful --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] New API Doc
Am I the only one that missed the old online api docs? This new one seems hard to use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New API Doc
I agree with you as it seems less documented (read: less examples seem to be provided). I'm sure though that since it's only a relatively new release of the documentation system, more information and examples will probably be added soon. Either way - we should all be thankful to anyone investing their time into this project :) On Oct 8, 7:21 pm, louis w louiswa...@gmail.com wrote: Am I the only one that missed the old online api docs? This new one seems hard to use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: select elements
I guess the thread I started may help you: http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/e7ab39d744d6dfb9/17370bb6381fdad9?hl=en#17370bb6381fdad9 On Oct 8, 1:01 pm, clicforw...@googlemail.com clicforw...@googlemail.com wrote: Hello anyone, i try to select a label for=options_10_2 like this: $('options-10-list').select('[for=options_10_2!]').each(function(e) { e.addClassName('highlight'); }); or this: $('options-10-list').down(3).each(function(e) { e.addClassName('highlight'); }); But its doing nothing. What wrong on this snippets? Thanks for Help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: 1.5.1 Hash to 1.6.1 Hash compatibility
just thinking out loud here, when you $H ur array object, is it hashing all the extra functions prototype put in Array.prototype like find(), findAll(), etc? cuz if i do var hash1 = $H([1,2,3]) hash1.size() is not equal to hash1.length because length is an array property and size is a hash method On Oct 8, 7:16 am, Romain Dequidt dequidt.rom...@gmail.com wrote: Would that be a relevant wrapper? function hash_wrapper(var) { if (var (var.constructor == Array) (var.length == 0)) { return; } return $H(var); } On 8 oct, 15:55, Romain Dequidt dequidt.rom...@gmail.com wrote: My problem (http://groups.google.fr/group/prototype-scriptaculous/t/ 313d3a8b674d5b28?hl=fr) comes from that issue. The errors object is actually a empty array when there is no error. But when I try to create my hash by doing: $H(transport.responseJSON.errors) the result is a weird hash (size() == 38!) yoshi, how do you fixed it? what kind of test should I do before the hash creation? On 8 oct, 00:34, yoshi yosh...@hotmail.com wrote: i m trying to upgrade prototype 1.5.1 to 1.6.1, then realized that the $H changed, and not compatible with '[]' anymore. the code base is huge, and $H is used very often. i m wondering if theres a smarter way then 1) writing my own wrapper around $H, so it works with old code, or 2) surgically update all variables using $H thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?
So just as a recap, you're looking to simulate the ctrl + mouse wheel event such that the native processing for zoom magnification applies? This is a highly useful feature, I would love to add some widgets type icons (magnifier glasses with a + and -) on my site that allows people to rescale the document image using it. It would very intuitive (just click the +magnifier icon to make it bigger and visa versa). So really you want a control on your page that increases font size? My approach would be to design everything I want to be scalable using the em unit so that everything is relative. Set a modest em level at the body level such that everything else is relative to this value. Then the control simply modifies the value for this to propagate the zoom in/out effect. http://pastie.org/647201 -- http://positionabsolute.net On Oct 8, 12:16 pm, tcupolo tcup...@afsincorporated.biz wrote: @Radoslav, I took some time today to look through your patch. It would make this function very easy to implement. It would take the form of a keypress event with ctrlkey=true and the necessary keyCode and charCode values. What is it's status? Will it make it into a future version of Prototype anytime soon? If not, what is the recommended way of using a patch like this? (I assume including it as a seperate js file on each page override the original function definition of fire, but that's not completely clear.) It took a little time for me to realize but I think it's the best way to go for a cross-browser compatible ZOOM solution. Thanks for the reply. On Oct 1, 7:47 am, Radoslav Stankov rstan...@gmail.com wrote: A time ago I have created ticket and a patch for making Event.fire to fire event (https://prototype.lighthouseapp.com/projects/8886/tickets/697-eventfi... ) Here is a git forhttp://gist.github.com/121011 I hope it's useful --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: New API Doc
It's also just plain hard to navigate and understand all of the different methods available. An example. If I select Event there is no longer the list of available methods appearing in the sidebar menu. Then I need to scroll down a page which is visually hard to scan to be able to pick out 'isRightClick' in light grey text buried in a sea of bright blue boxes. Usability should be a key factor when redesigning a documentation system. The amount of times a developer will be using this site is high. They should be able to pop in, find what they want quickly and leave. Not get lost poking around the site. I sure hope this is all to do with it's infancy. On Oct 8, 1:26 pm, DJ Mangus d.man...@gmail.com wrote: No. You aren't. Sent from my phone so pardon the spelling errors. On Oct 8, 2009, at 10:22 AM, louis w louiswa...@gmail.com wrote: Am I the only one that missed the old online api docs? This new one seems hard to use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?
You failed to see his point. Ctrl + mouse wheel scales the page not the text - it scales images, elements, text and everything LOL Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Matt Foster mattfoste...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, October 08, 2009 6:58 PM Subject: [Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event? So just as a recap, you're looking to simulate the ctrl + mouse wheel event such that the native processing for zoom magnification applies? This is a highly useful feature, I would love to add some widgets type icons (magnifier glasses with a + and -) on my site that allows people to rescale the document image using it. It would very intuitive (just click the +magnifier icon to make it bigger and visa versa). So really you want a control on your page that increases font size? My approach would be to design everything I want to be scalable using the em unit so that everything is relative. Set a modest em level at the body level such that everything else is relative to this value. Then the control simply modifies the value for this to propagate the zoom in/out effect. http://pastie.org/647201 -- http://positionabsolute.net On Oct 8, 12:16 pm, tcupolo tcup...@afsincorporated.biz wrote: @Radoslav, I took some time today to look through your patch. It would make this function very easy to implement. It would take the form of a keypress event with ctrlkey=true and the necessary keyCode and charCode values. What is it's status? Will it make it into a future version of Prototype anytime soon? If not, what is the recommended way of using a patch like this? (I assume including it as a seperate js file on each page override the original function definition of fire, but that's not completely clear.) It took a little time for me to realize but I think it's the best way to go for a cross-browser compatible ZOOM solution. Thanks for the reply. On Oct 1, 7:47 am, Radoslav Stankov rstan...@gmail.com wrote: A time ago I have created ticket and a patch for making Event.fire to fire event (https://prototype.lighthouseapp.com/projects/8886/tickets/697-eventfi... ) Here is a git forhttp://gist.github.com/121011 I hope it's useful --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?
@MattAlex, Yes, a page zoom scales everything not just text. Early testing showed just changing text size is OK most of the time but can lead to page mis-alignment issues in some cases. A synthetic event that replicates either (1) a mouse scroll wheel movement while cntrl key is held down or, (2) a + or - key press while control key is held down, will do the trick. I think (2) is simpler, at least with Radoslav's patch. Also, even today not all mice used have a scroll wheel, so I'm not sure if simulating a scroll wheel event in those systems is a good idea. This is a trivial feature in the sense that all browsers support page zoom, so why bother? Most users don't know the necessary control functions to do it easily - so they have to go into the chrome. This means in practice most simply don't. I know I never did (until I learned the cntrl+scroll wheel trick). So, any site that offers a simple widget tool that can be clicked on overcomes all obstacles and allows any visitor to view a page at the most pleasing scale, quite easily. It's very fast. I do have a version of this implemented on my site using Alex's document.body.style.zoom approach. But, as I shared above that approach only works in IE and Google Chrome, nothing else. My thinking is it at least reminds visitors (using the non-supported browsers) that they could zoom if they wanted to. After a while a lot of users even forget that zooming is an option. Clicking on the icons in the unsupported browsers does nothing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Submit form on select for autosuggest
Hello, Thanks for the reply. I tried doing that but it didn't work for me.If you point out the mistake in following code, it will be great.Thanks again. script type="text/_javascript_" new Ajax.Autocompleter("search","hint","server_class.php", {afterUpdateElement : getSelectedId, minChars:1}); function getSelectedId(text, li) { $('class_id').value=li.id; document.forms['searchcustomerform'].submit(); } /script Thanks, Yogesh Matt Foster wrote: http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter afterUpdateElement function... you receive an input object and some element that was representing the field. At this point you could execute form.submit.. -- http://positionabsolute.net On Oct 7, 11:19am, Yogesh yogesh.aga...@gmail.com wrote: Hello, I am using Ajax.autocompleter in one of my forms. I am calling a custom function getSelectedId after update element to get an ID of the selected list item. I need a functionality such that form should get submitted whenever : 1) a user clicks a item using mouse from the autosuggest list. 2) Whenever user presses enter key while a list item is selected. (This I have achieved through a hack as shown in code below. I call .submit() after getSelectedId function) I don't know how to submit the form on mouse click. Any help on this issue will be really helpful to me. script type="text/_javascript_" new Ajax.Autocompleter("search","hint","server_class.php", {afterUpdateElement : getSelectedId, minChars:1}); function getSelectedId(text, li) { $('class_id').value=li.id; document.forms['searchcustomerform'].submit(); } /script Thank you. Sincerely, Yogesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---