Firefox compatibility fixes, be more aware of problems in authentication

This commit is contained in:
Tom MacWright
2012-11-30 15:59:16 -05:00
parent 9ec9e9b6b3
commit bdf47e4a80
5 changed files with 12 additions and 12 deletions

View File

@@ -53,6 +53,7 @@ button {
line-height:18px;
margin:5px 5px 0 0;
cursor:pointer;
border-radius:2px;
}
button.cancel {
@@ -285,7 +286,8 @@ input#geocode-location {
.commit-pane .changeset-comment {
width:630px;
font-size:12px;
/* firefox uses monospace in textareas */
font:normal 12px/20px 'Helvetica Neue', Arial, sans-serif;
}
.commit-section {

View File

@@ -66,11 +66,11 @@ var iD = function(container) {
bar.append('button')
.attr('class', 'save')
.html("Save<small id='as-username'></small>")
.html("Upload<small id='as-username'></small>")
.on('click', function() {
function save(e) {
d3.select('.shaded').remove();
var l = iD.loading('committing changes to openstreetmap');
var l = iD.loading('uploading changes to openstreetmap');
connection.putChangeset(map.history.changes(), e.comment, function() {
l.remove();
map.history = iD.History();

View File

@@ -11,8 +11,8 @@ iD.OAuth = function() {
function keyclean(x) { return x.replace(/\W/g, ''); }
if (localStorage.oauth_token) {
o.oauth_token = localStorage.oauth_token;
if (token('oauth_token')) {
o.oauth_token = token('oauth_token');
}
function timenonce(o) {
@@ -36,6 +36,7 @@ iD.OAuth = function() {
oauth.logout = function() {
token('oauth_token', '');
token('oauth_token_secret', '');
token('oauth_request_token_secret', '');
return oauth;
};
@@ -55,8 +56,8 @@ iD.OAuth = function() {
};
oauth.authenticate = function(callback) {
// TODO: deal with changing the api endpoint
if (oauth.authenticated()) return callback();
oauth.logout();
var shaded = d3.select(document.body)
.append('div')

View File

@@ -116,11 +116,7 @@ iD.Map = function(elem, connection) {
function(d) { return only[d.id]; } : function() { return true; };
if (all.length > 2000) {
d3.select('.messages').text('Zoom in to edit the map');
hideVector();
return;
} else {
d3.select('.messages').text('Zoom in to edit the map');
return hideVector();
}
for (var i = 0; i < all.length; i++) {

View File

@@ -6,7 +6,8 @@ iD.commit = function() {
header = selection.append('div').attr('class', 'header'),
body = selection.append('div').attr('class', 'body');
header.append('h2').text('Save Changes to OpenStreetMap');
header.append('h2').text('Upload Changes to OpenStreetMap');
header.append('p').text('the changes you upload will be visible on all maps using OpenStreetMap data');
var section = body.selectAll('div.commit-section')
.data(['modify', 'delete', 'create'].filter(function(d) {