]> git.openstreetmap.org Git - rails.git/commitdiff
adapt for larger fonts on Linux; fix indexing with renumbered nodes
authorRichard Fairhurst <richard@systemed.net>
Fri, 22 May 2009 19:43:56 +0000 (19:43 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 22 May 2009 19:43:56 +0000 (19:43 +0000)
app/controllers/amf_controller.rb
app/views/site/edit.rhtml
public/potlatch/potlatch.swf

index 13f7423816d117eb4f6ceeb96278db3f59f89eb2..f903e1ce408508f42b72fb73d2dbd525ca67eb0c 100644 (file)
@@ -127,8 +127,10 @@ class AmfController < ApplicationController
           results[index]=[-5,nil]
         else
           case message
           results[index]=[-5,nil]
         else
           case message
-            when 'putway';                       r=putway(renumberednodes,*args)
-                                                               renumberednodes=r[4]
+            when 'putway';                       orn=renumberednodes.dup
+                                  r=putway(renumberednodes,*args)
+                                                               renumberednodes=r[4].dup
+                                                               r[4].delete_if { |k,v| orn.has_key?(k) }
                                                                if r[2] != r[3] then renumberedways[r[2]] = r[3] end
                                                                results[index]=AMF.putdata(index,r)
             when 'putrelation';                results[index]=AMF.putdata(index,putrelation(renumberednodes, renumberedways, *args))
                                                                if r[2] != r[3] then renumberedways[r[2]] = r[3] end
                                                                results[index]=AMF.putdata(index,r)
             when 'putrelation';                results[index]=AMF.putdata(index,putrelation(renumberednodes, renumberedways, *args))
@@ -477,7 +479,7 @@ class AmfController < ApplicationController
         rels.push([rel.id, rel.tags, rel.members, rel.version])
       end
     else
         rels.push([rel.id, rel.tags, rel.members, rel.version])
       end
     else
-      RelationTag.find(:all, :limit => 11, :conditions => ["match(v) against (?)", searchterm] ).each do |t|
+      RelationTag.find(:all, :limit => 11, :conditions => ["v like ?", "%#{searchterm}%"] ).each do |t|
       if t.relation.visible then
              rels.push([t.relation.id, t.relation.tags, t.relation.members, t.relation.version])
            end
       if t.relation.visible then
              rels.push([t.relation.id, t.relation.tags, t.relation.members, t.relation.version])
            end
@@ -592,9 +594,7 @@ class AmfController < ApplicationController
     if pointlist.length < 2 then return -2,"Server error - way is only #{points.length} points long." end
 
     originalway = originalway.to_i
     if pointlist.length < 2 then return -2,"Server error - way is only #{points.length} points long." end
 
     originalway = originalway.to_i
-logger.info("received #{pointlist} for #{originalway}")
        pointlist.collect! {|a| a.to_i }
        pointlist.collect! {|a| a.to_i }
-logger.info("converted to #{pointlist}")
 
     way=nil    # this is returned, so scope it outside the transaction
     nodeversions = {}
 
     way=nil    # this is returned, so scope it outside the transaction
     nodeversions = {}
@@ -634,11 +634,9 @@ logger.info("converted to #{pointlist}")
 
       # -- Save revised way
 
 
       # -- Save revised way
 
-logger.info("renumberednodes is #{renumberednodes.inspect}")
          pointlist.collect! {|a|
              renumberednodes[a] ? renumberednodes[a]:a
          } # renumber nodes
          pointlist.collect! {|a|
              renumberednodes[a] ? renumberednodes[a]:a
          } # renumber nodes
-logger.info("saving with #{pointlist}")
       new_way = Way.new
       new_way.tags = attributes
       new_way.nds = pointlist
       new_way = Way.new
       new_way.tags = attributes
       new_way.nds = pointlist
index 372a70d3bdff204d48128cccf1ea7e85c71b0a5e..0080fa8d7a7ee1161788d7687ab7a28d49de7389 100644 (file)
@@ -71,7 +71,7 @@ zoom='14' if zoom.nil?
   
   window.onbeforeunload=function() {
        if (!changesaved && !winie) {
   
   window.onbeforeunload=function() {
        if (!changesaved && !winie) {
-           return "You have unsaved changes. (To save in Potlatch, you should deselect the current way or point.)";
+           return "You have unsaved changes.";
        }
   }
 
        }
   }
 
index ad60cd4851a414e187d4aac8138b8a4e8c4075e4..25ae1cf7c9c35e0826c2bcf7304abf9a1aee7102 100755 (executable)
Binary files a/public/potlatch/potlatch.swf and b/public/potlatch/potlatch.swf differ