adapt for larger fonts on Linux; fix indexing with renumbered nodes
This commit is contained in:
parent
cdbfc1e341
commit
a3a792e137
3 changed files with 6 additions and 8 deletions
|
@ -127,8 +127,10 @@ class AmfController < ApplicationController
|
||||||
results[index]=[-5,nil]
|
results[index]=[-5,nil]
|
||||||
else
|
else
|
||||||
case message
|
case message
|
||||||
when 'putway'; r=putway(renumberednodes,*args)
|
when 'putway'; orn=renumberednodes.dup
|
||||||
renumberednodes=r[4]
|
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
|
if r[2] != r[3] then renumberedways[r[2]] = r[3] end
|
||||||
results[index]=AMF.putdata(index,r)
|
results[index]=AMF.putdata(index,r)
|
||||||
when 'putrelation'; results[index]=AMF.putdata(index,putrelation(renumberednodes, renumberedways, *args))
|
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])
|
rels.push([rel.id, rel.tags, rel.members, rel.version])
|
||||||
end
|
end
|
||||||
else
|
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
|
if t.relation.visible then
|
||||||
rels.push([t.relation.id, t.relation.tags, t.relation.members, t.relation.version])
|
rels.push([t.relation.id, t.relation.tags, t.relation.members, t.relation.version])
|
||||||
end
|
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
|
if pointlist.length < 2 then return -2,"Server error - way is only #{points.length} points long." end
|
||||||
|
|
||||||
originalway = originalway.to_i
|
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
|
way=nil # this is returned, so scope it outside the transaction
|
||||||
nodeversions = {}
|
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|
|
pointlist.collect! {|a|
|
||||||
renumberednodes[a] ? renumberednodes[a]:a
|
renumberednodes[a] ? renumberednodes[a]:a
|
||||||
} # renumber nodes
|
} # renumber nodes
|
||||||
logger.info("saving with #{pointlist}")
|
|
||||||
new_way = Way.new
|
new_way = Way.new
|
||||||
new_way.tags = attributes
|
new_way.tags = attributes
|
||||||
new_way.nds = pointlist
|
new_way.nds = pointlist
|
||||||
|
|
|
@ -71,7 +71,7 @@ zoom='14' if zoom.nil?
|
||||||
|
|
||||||
window.onbeforeunload=function() {
|
window.onbeforeunload=function() {
|
||||||
if (!changesaved && !winie) {
|
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.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue