<p><buttonid="gist"title="Publish all files as public gist on github.com"><iclass="fa fa-github"></i> Publish Gist</button> Publish all open files to an anonymous github gist.</p>
<p>You can also load a gist by adding the following <spanclass="pre">#gist=GIST_ID</span> to your url, where GIST_ID is the id of the gist to load.</p>
<labelfor="web3"title="Execution environment connects to node at localhost, transactions will be sent to the network and can cause loss of money or worse!">
<p><buttonid="gist"title="Publish all files as public gist on github.com"><iclass="fa fa-github"></i> Publish Gist</button> Publish all open files to an anonymous github gist.</p>
<p>You can also load a gist by adding the following <spanclass="pre">#gist=GIST_ID</span> to your url, where GIST_ID is the id of the gist to load.</p>
</div>
<divid="envView">
<spanid="executionContext">
<labelfor="vm"title="Execution environment does not connect to any node, everything is local and in memory only.">
<labelfor="web3"title="Execution environment connects to node at localhost, transactions will be sent to the network and can cause loss of money or worse!">
if(ev.target.value=='web3'&&!confirm("Are you sure you want to connect to a local ethereum node?")){
$vmToggle.get(0).checked=true;
executionContext='vm';
}elseexecutionContext=ev.target.value;
compile();
}
functionexecutionContextChange(ev){
if(ev.target.value=='web3'&&!confirm("Are you sure you want to connect to a local ethereum node?")){
$vmToggle.get(0).checked=true;
executionContext='vm';
}elseexecutionContext=ev.target.value;
compile();
}
// ------------------ gist publish --------------
// ------------------ gist publish --------------
$('#gist').click(function(){
if(confirm("Are you sure you want to publish all your files anonymously as a public gist on github.com")){
varfiles={};
varfilesArr=getFiles();
vardescription="Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity#gist=";
for(varfinfilesArr){
files[fileNameFromKey(filesArr[f])]={
content:localStorage[filesArr[f]]
};
}
$('#gist').click(function(){
if(confirm("Are you sure you want to publish all your files anonymously as a public gist on github.com?")){
varfiles={};
varfilesArr=getFiles();
vardescription="Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity#gist=";
for(varfinfilesArr){
files[fileNameFromKey(filesArr[f])]={
content:localStorage[filesArr[f]]
};
}
$.ajax({
url:'https://api.github.com/gists',
type:'POST',
data:JSON.stringify({
description:description,
public:true,
files:files
})
}).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');
$.ajax({
url:'https://api.github.com/gists',
type:'POST',
data:JSON.stringify({
description:description,
public:true,
files:files
})
}).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?")){