Switch from Prototype to jQuery

This commit is contained in:
Tom Hughes 2011-11-21 09:15:41 +00:00
parent 4368ba9f11
commit 13289d4041
40 changed files with 1160 additions and 1218 deletions

View file

@ -28,11 +28,6 @@ class GeocoderController < ApplicationController
@sources.push "osm_nominatim"
@sources.push "geonames"
end
render :update do |page|
page.replace_html :sidebar_content, :partial => "search"
page.call "openSidebar"
end
end
def search_latlon
@ -264,9 +259,9 @@ class GeocoderController < ApplicationController
end
render :action => "results"
rescue Exception => ex
@error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}"
render :action => "error"
# rescue Exception => ex
# @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}"
# render :action => "error"
end
def search_geonames
@ -302,11 +297,6 @@ class GeocoderController < ApplicationController
@sources.push({ :name => "osm_nominatim" })
@sources.push({ :name => "geonames" })
render :update do |page|
page.replace_html :sidebar_content, :partial => "description"
page.call "openSidebar"
end
end
def description_osm_namefinder

View file

@ -103,7 +103,7 @@ class MessageController < ApplicationController
def mark
if params[:message_id]
id = params[:message_id]
message = Message.where(:id => id).where("to_user_id = ? OR from_user_id = ?", @user.id, @user.id).first
@message = Message.where(:id => id).where("to_user_id = ? OR from_user_id = ?", @user.id, @user.id).first
if params[:mark] == 'unread'
message_read = false
notice = t 'message.mark.as_unread'
@ -111,15 +111,9 @@ class MessageController < ApplicationController
message_read = true
notice = t 'message.mark.as_read'
end
message.message_read = message_read
if message.save
if request.xhr?
render :update do |page|
page.replace "inboxanchor", :partial => "layouts/inbox"
page.replace "inbox-count", :partial => "message_count"
page.replace "inbox-#{message.id}", :partial => "message_summary", :object => message
end
else
@message.message_read = message_read
if @message.save
if not request.xhr?
flash[:notice] = notice
redirect_to :controller => 'message', :action => 'inbox', :display_name => @user.display_name
end

View file

@ -23,9 +23,7 @@ class UserController < ApplicationController
@text = OSM.legal_text_for_country(@legale)
if request.xhr?
render :update do |page|
page.replace_html "contributorTerms", :partial => "terms"
end
render :partial => "terms"
elsif using_open_id?
# The redirect from the OpenID provider reenters here
# again and we need to pass the parameters through to