returnmodal('Rename File Failed',`A file or folder ${extractNameFromKey(newFolderPath)} already exists at this location. Please choose a different name.`,{
label:'Close',
fn:()=>{}
},null)
returnmodal('Rename File Failed',`A file or folder ${extractNameFromKey(newFolderPath)} already exists at this location. Please choose a different name.`,'Close',()=>{})
modal('Rename File Failed',`A file or folder ${extractNameFromKey(newPath)} already exists at this location. Please choose a different name.`,{
label:'Close',
fn:()=>{}
},null)
modal('Rename File Failed',`A file or folder ${extractNameFromKey(newPath)} already exists at this location. Please choose a different name.`,'Close',()=>{})
}else{
awaitfileManager.rename(oldPath,newPath)
}
}catch(error){
modal('Rename File Failed','Unexpected error while renaming: '+typeoferror==='string'?error : error.message,{
label:'Close',
fn: async()=>{}
},null)
modal('Rename File Failed','Unexpected error while renaming: '+typeoferror==='string'?error : error.message,'Close',async()=>{})
modal('Create a public gist',`Are you sure you want to anonymously publish all your files in the ${name} workspace as a public gist on github.com?`,{
label:'OK',
fn: toGist
},{
label:'Cancel',
fn:()=>{}
})
modal('Create a public gist',`Are you sure you want to anonymously publish all your files in the ${name} workspace as a public gist on github.com?`,'OK',toGist,'Cancel',()=>{})
}
consttoGist=(id?: string)=>{
constfilesProvider=fileSystem.provider.provider
constproccedResult=function(error,data){
if(error){
modal('Publish to gist Failed','Failed to manage gist: '+error,{
label:'Close',
fn: async()=>{}
},null)
modal('Publish to gist Failed','Failed to manage gist: '+error,'Close',()=>{})
}else{
if(data.html_url){
modal('Gist is ready',`The gist is at ${data.html_url}. Would you like to open it in a new window?`,{
label:'OK',
fn:()=>{
modal('Gist is ready',`The gist is at ${data.html_url}. Would you like to open it in a new window?`,'OK',()=>{
modal('Authorize Token','Remix requires an access token (which includes gists creation permission). Please go to the settings tab to create one.',{
label:'Close',
fn: async()=>{}
},null)
modal('Authorize Token','Remix requires an access token (which includes gists creation permission). Please go to the settings tab to create one.','Close',()=>{})
}else{
constdescription='Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version='+