if(confirm('Are you sure you want to publish all your files anonymously as a public gist on github.com?')){
packageFiles((error,packaged)=>{
if(error){
console.log(error)
}else{
vardescription='Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version='+queryParams.get().version+'&optimize='+queryParams.get().optimize+'&gist='
$.ajax({
url:'https://api.github.com/gists',
type:'POST',
data:JSON.stringify({
description:description,
public:true,
files:packaged
})
}).done(function(response){
if(response.html_url&&confirm('Created a gist at '+response.html_url+' Would you like to open it in a new window?')){
window.open(response.html_url,'_blank')
}
}).fail(function(xhr,text,err){
alert('Failed to create gist: '+(err||'Unknown transport error'))
})
}
})
}
})
$('#copyOver').click(function(){
vartarget=prompt(
'To which other browser-solidity instance do you want to copy over all files?',
if(confirm('Are you sure you want to publish all your files anonymously as a public gist on github.com?')){
appAPI.packageFiles((error,packaged)=>{
if(error){
console.log(error)
}else{
vardescription='Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version='+queryParams.get().version+'&optimize='+queryParams.get().optimize+'&gist='
console.log(packaged)
$.ajax({
url:'https://api.github.com/gists',
type:'POST',
data:JSON.stringify({
description:description,
public:true,
files:packaged
})
}).done(function(response){
if(response.html_url&&confirm('Created a gist at '+response.html_url+' Would you like to open it in a new window?')){
window.open(response.html_url,'_blank')
}
}).fail(function(xhr,text,err){
console.log('fail',text)
alert('Failed to create gist: '+(err||'Unknown transport error'))