From 81ee044fdaf7b0ea15b4c646fa46947f71da00fe Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Sat, 19 May 2007 00:23:42 +0000 Subject: Update edge to script.aculo.us to 1.7.1_beta3 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 2 + railties/html/javascripts/controls.js | 76 ++++++++++++++++----- railties/html/javascripts/dragdrop.js | 56 +++++++++++---- railties/html/javascripts/effects.js | 124 ++++++++++++++++++---------------- 4 files changed, 165 insertions(+), 93 deletions(-) (limited to 'railties') diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 408253cb6e..ce9c861101 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Update to script.aculo.us 1.7.1_beta3. [Thomas Fuchs] + * Generators use *.html.erb view template naming. #8278 [Tim Pope] * Updated resource_scaffold and model generators to use short-hand style migrations [DHH] diff --git a/railties/html/javascripts/controls.js b/railties/html/javascripts/controls.js index 8c273f874f..bc9beea3c1 100644 --- a/railties/html/javascripts/controls.js +++ b/railties/html/javascripts/controls.js @@ -1,6 +1,6 @@ -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) // Contributors: // Richard Livsey // Rahul Bhargava @@ -41,7 +41,8 @@ var Autocompleter = {} Autocompleter.Base = function() {}; Autocompleter.Base.prototype = { baseInitialize: function(element, update, options) { - this.element = $(element); + element = $(element) + this.element = element; this.update = $(update); this.hasFocus = false; this.changed = false; @@ -81,15 +82,20 @@ Autocompleter.Base.prototype = { Element.hide(this.update); - Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keypress', this.onKeyPress.bindAsEventListener(this)); + + // Turn autocomplete back on when the user leaves the page, so that the + // field's value will be remembered on Mozilla-based browsers. + Event.observe(window, 'beforeunload', function(){ + element.setAttribute('autocomplete', 'on'); + }); }, show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && - (navigator.appVersion.indexOf('MSIE')>0) && - (navigator.userAgent.indexOf('Opera')<0) && + (Prototype.Browser.IE) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '