(url:string)
| 2341 | } |
| 2342 | |
| 2343 | loadFromGist(url:string) { |
| 2344 | if(!url) { |
| 2345 | this.injectNotice("warning", "Unable to open gist: No URL provided."); |
| 2346 | return; |
| 2347 | } |
| 2348 | readFromGist(url, (err, gist) => { |
| 2349 | if(err) { |
| 2350 | this.injectNotice("error", "Unable to read gist. Check the developer console for more information."); |
| 2351 | console.error(err); |
| 2352 | } else { |
| 2353 | //console.log(content); |
| 2354 | // @FIXME: Need the filename metadata here. |
| 2355 | // @FIXME: Should really be more flexible and provide all the files attached (can load a workspace from gist). |
| 2356 | for(let filename in gist.files) { |
| 2357 | let content = gist.files[filename].content; |
| 2358 | let docId = `gist:${gist.id}-${filename}`; |
| 2359 | this.loadFile(docId, content); |
| 2360 | } |
| 2361 | } |
| 2362 | }); |
| 2363 | } |
| 2364 | |
| 2365 | createDocument(folder:string) { |
| 2366 | let newId:string|undefined; |
no test coverage detected