From 3dbdeec7a2e945ea1856adbcf344cb3a5e917dc6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 14 Aug 2017 10:25:07 +0200 Subject: [PATCH] remove files-tab --- src/app/tabs/files-tab.js | 108 -------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 src/app/tabs/files-tab.js diff --git a/src/app/tabs/files-tab.js b/src/app/tabs/files-tab.js deleted file mode 100644 index b71d04ca14..0000000000 --- a/src/app/tabs/files-tab.js +++ /dev/null @@ -1,108 +0,0 @@ -/* global confirm, prompt */ -var yo = require('yo-yo') -var $ = require('jquery') -var modalDialogCustom = require('../ui/modal-dialog-custom') -var QueryParams = require('../../lib/query-params') -var queryParams = new QueryParams() - -// -------------- styling ---------------------- -var csjs = require('csjs-inject') -var styleGuide = require('../../style-guide') -var styles = styleGuide() - -var css = csjs` - .filesTabView { - padding: 2%; - } - .crow extends ${styles.displayBox} { - margin-bottom: 1%; - display: flex; - flex-wrap: wrap; - } - .infoBox extends ${styles.infoTextBox} { - margin-top: 2em; - } - .button extends ${styles.button} { - background-color: ${styles.colors.blue}; - margin-bottom: .5em; - margin-right: 1em; - } -` - -module.exports = filesTab - -function filesTab (container, appAPI, events, opts) { - var el = yo` -
-
- - Publish all open files to an anonymous github gist.
-
-
- - Copy all files to another instance of Browser-solidity. -
-
You can also load a gist by adding the following - #gist=GIST_ID - to your url, where GIST_ID is the id of the gist to load. -
-
- ` - // ------------------ gist publish -------------- - - el.querySelector('#gist').addEventListener('click', function () { - 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 { - var description = '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) - modalDialogCustom.alert('Failed to create gist: ' + (err || 'Unknown transport error')) - }) - } - }) - } - }) - el.querySelector('#copyOver').addEventListener('click', function () { - var target = prompt( - 'To which other browser-solidity instance do you want to copy over all files?', - 'https://ethereum.github.io/browser-solidity/' - ) - if (target === null) { - return - } - appAPI.packageFiles((error, packaged) => { - if (error) { - console.log(error) - } else { - $('