Skip to content

Commit

Permalink
new file testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabino3 committed Jul 26, 2012
1 parent a1f3759 commit 3db983e
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions js/geocamMaps.js
Expand Up @@ -72,6 +72,9 @@ GeocamResponderMaps.MapOverlay = Em.Object.extend({
if (Ember.typeOf(v) === 'function') {
continue;
}
if (Ember.typeOf(v) === 'object')
continue;

ret.push(key);
}
}
Expand Down Expand Up @@ -722,10 +725,10 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
var metaUrl;
var externalCopy = this.externalCopy;
console.log(externalCopy);
$.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify({externalUrl: externalCopy, hosting: "external"}), function(data){
metaUrl = data.result.metaUrl;
});
this.metaUrl = metaUrl;
// $.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify({externalUrl: externalCopy, hosting: "external"}), function(data){
// metaUrl = data.result.metaUrl;
// });
// this.metaUrl = metaUrl;
},
create: function(){
if(this.name == ''){
Expand Down Expand Up @@ -760,9 +763,9 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
acceptTerms: this.acceptTerms
});
console.log(newOverlay.getJson());
$.post(GeocamResponderMaps.HOST+'layer/new/', JSON.stringify(newOverlay.getJson()), function(data){
$.post(GeocamResponderMaps.HOST+'api/layers/', JSON.stringify(newOverlay.getJson()), function(data){
console.log(data);
});
}, 'json');
GeocamResponderMaps.LibController.library.add(newOverlay);
GeocamResponderMaps.LibController.updateLibrary();

Expand Down Expand Up @@ -830,16 +833,21 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
document.getElementById('fileUploadButton').value='';
},
localFileSelect: function() {
this.file = document.getElementById("fileUploadButton").files[0]; // FileList object
var file = document.getElementById("fileUploadButton").files[0]; // FileList object
var type = "application/vnd.google-earth.kml+xml";
if(!type==this.file.type){
if(!type==file.type){
alert("Please choose a kml file");
document.getElementById('fileUploadButton').value='';
return ;
}
var reader = new FileReader();
localCopy = this.file;

this.localCopy = file;


// this.file = new FormData();

// this.file.append('', file);


},
fileUpload: function() {
Expand Down

0 comments on commit 3db983e

Please sign in to comment.