Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
938d03b6
Unverified
Commit
938d03b6
authored
Mar 07, 2018
by
yann300
Committed by
GitHub
Mar 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1136 from ethereum/updateGist
change gist explorer to be non read only && redeploy to gist
parents
ceeeea8d
d8975cf4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
6 deletions
+48
-6
app.js
src/app.js
+2
-1
NotPersistedExplorer.js
src/app/files/NotPersistedExplorer.js
+39
-0
basicReadOnlyExplorer.js
src/app/files/basicReadOnlyExplorer.js
+0
-1
file-panel.js
src/app/panels/file-panel.js
+7
-4
No files found.
src/app.js
View file @
938d03b6
...
@@ -40,6 +40,7 @@ var FileManager = require('./app/files/fileManager')
...
@@ -40,6 +40,7 @@ var FileManager = require('./app/files/fileManager')
var
ContextualListener
=
require
(
'./app/editor/contextualListener'
)
var
ContextualListener
=
require
(
'./app/editor/contextualListener'
)
var
ContextView
=
require
(
'./app/editor/contextView'
)
var
ContextView
=
require
(
'./app/editor/contextView'
)
var
BasicReadOnlyExplorer
=
require
(
'./app/files/basicReadOnlyExplorer'
)
var
BasicReadOnlyExplorer
=
require
(
'./app/files/basicReadOnlyExplorer'
)
var
NotPersistedExplorer
=
require
(
'./app/files/NotPersistedExplorer'
)
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
CommandInterpreter
=
require
(
'./lib/cmdInterpreter'
)
var
CommandInterpreter
=
require
(
'./lib/cmdInterpreter'
)
...
@@ -128,7 +129,7 @@ class App {
...
@@ -128,7 +129,7 @@ class App {
self
.
_api
.
filesProviders
[
'localhost'
]
=
new
SharedFolder
(
remixd
)
self
.
_api
.
filesProviders
[
'localhost'
]
=
new
SharedFolder
(
remixd
)
self
.
_api
.
filesProviders
[
'swarm'
]
=
new
BasicReadOnlyExplorer
(
'swarm'
)
self
.
_api
.
filesProviders
[
'swarm'
]
=
new
BasicReadOnlyExplorer
(
'swarm'
)
self
.
_api
.
filesProviders
[
'github'
]
=
new
BasicReadOnlyExplorer
(
'github'
)
self
.
_api
.
filesProviders
[
'github'
]
=
new
BasicReadOnlyExplorer
(
'github'
)
self
.
_api
.
filesProviders
[
'gist'
]
=
new
BasicReadOnly
Explorer
(
'gist'
)
self
.
_api
.
filesProviders
[
'gist'
]
=
new
NotPersisted
Explorer
(
'gist'
)
self
.
_api
.
filesProviders
[
'ipfs'
]
=
new
BasicReadOnlyExplorer
(
'ipfs'
)
self
.
_api
.
filesProviders
[
'ipfs'
]
=
new
BasicReadOnlyExplorer
(
'ipfs'
)
self
.
_view
=
{}
self
.
_view
=
{}
self
.
_components
=
{}
self
.
_components
=
{}
...
...
src/app/files/NotPersistedExplorer.js
0 → 100644
View file @
938d03b6
'use strict'
var
ReadOnlyExplorer
=
require
(
'./basicReadOnlyExplorer'
)
var
toolTip
=
require
(
'../ui/tooltip'
)
class
NotPersistedExplorer
extends
ReadOnlyExplorer
{
constructor
(
type
)
{
super
(
type
)
this
.
readonly
=
false
}
remove
(
path
)
{
var
unprefixedPath
=
this
.
removePrefix
(
path
)
var
folderPath
=
path
.
substring
(
0
,
path
.
lastIndexOf
(
'/'
))
if
(
this
.
paths
[
folderPath
])
{
delete
this
.
paths
[
folderPath
][
unprefixedPath
]
delete
this
.
files
[
path
]
}
this
.
event
.
trigger
(
'fileRemoved'
,
[
this
.
type
+
'/'
+
unprefixedPath
])
return
true
}
rename
(
oldPath
,
newPath
,
isFolder
)
{
if
(
isFolder
)
{
return
toolTip
(
'folder renaming is not handled by this explorer'
)
}
var
unprefixedoldPath
=
this
.
removePrefix
(
oldPath
)
var
unprefixednewPath
=
this
.
removePrefix
(
newPath
)
this
.
get
(
oldPath
,
(
error
,
content
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
this
.
remove
(
oldPath
)
this
.
set
(
newPath
,
content
)
this
.
event
.
trigger
(
'fileRenamed'
,
[
this
.
type
+
'/'
+
unprefixedoldPath
,
this
.
type
+
'/'
+
unprefixednewPath
,
isFolder
])
})
}
isReadOnly
(
path
)
{
return
false
}
}
module
.
exports
=
NotPersistedExplorer
src/app/files/basicReadOnlyExplorer.js
View file @
938d03b6
...
@@ -76,7 +76,6 @@ class BasicReadOnlyExplorer {
...
@@ -76,7 +76,6 @@ class BasicReadOnlyExplorer {
}
}
remove
(
path
)
{
remove
(
path
)
{
delete
this
.
files
[
path
]
}
}
rename
(
oldPath
,
newPath
,
isFolder
)
{
rename
(
oldPath
,
newPath
,
isFolder
)
{
...
...
src/app/panels/file-panel.js
View file @
938d03b6
...
@@ -80,7 +80,10 @@ function filepanel (appAPI, filesProvider) {
...
@@ -80,7 +80,10 @@ function filepanel (appAPI, filesProvider) {
</label>
</label>
</span>
</span>
`
:
''
}
`
:
''
}
<span class="
${
css
.
gist
}
" title="Publish all open files to an anonymous github gist" onclick=
${()
=>
publishToGist
(
appAPI
)}
>
<span class="
${
css
.
gist
}
" title="Publish all [browser] explorer open files to an anonymous github gist" onclick=
${()
=>
publishToGist
(
'browser'
)}
>
<i class="fa fa-github"></i>
</span>
<span class="
${
css
.
gist
}
" title="Publish all [gist] explorer open files to an anonymous github gist" onclick=
${()
=>
publishToGist
(
'gist'
)}
>
<i class="fa fa-github"></i>
<i class="fa fa-github"></i>
</span>
</span>
<span class="
${
css
.
copyFiles
}
" title="Copy all files to another instance of Remix IDE" onclick=
${
copyFiles
}
>
<span class="
${
css
.
copyFiles
}
" title="Copy all files to another instance of Remix IDE" onclick=
${
copyFiles
}
>
...
@@ -270,7 +273,7 @@ function filepanel (appAPI, filesProvider) {
...
@@ -270,7 +273,7 @@ function filepanel (appAPI, filesProvider) {
// ------------------ gist publish --------------
// ------------------ gist publish --------------
function
publishToGist
()
{
function
publishToGist
(
fileProviderName
)
{
function
cb
(
data
)
{
function
cb
(
data
)
{
if
(
data
instanceof
Error
)
{
if
(
data
instanceof
Error
)
{
console
.
log
(
'fail'
,
data
.
message
)
console
.
log
(
'fail'
,
data
.
message
)
...
@@ -288,7 +291,7 @@ function filepanel (appAPI, filesProvider) {
...
@@ -288,7 +291,7 @@ function filepanel (appAPI, filesProvider) {
}
}
function
toGist
()
{
function
toGist
()
{
packageFiles
(
filesProvider
[
'browser'
],
(
error
,
packaged
)
=>
{
packageFiles
(
filesProvider
[
fileProviderName
],
(
error
,
packaged
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
)
...
@@ -338,7 +341,7 @@ function filepanel (appAPI, filesProvider) {
...
@@ -338,7 +341,7 @@ function filepanel (appAPI, filesProvider) {
// return all the files, except the temporary/readonly ones..
// return all the files, except the temporary/readonly ones..
function
packageFiles
(
filesProvider
,
callback
)
{
function
packageFiles
(
filesProvider
,
callback
)
{
var
ret
=
{}
var
ret
=
{}
filesProvider
.
resolveDirectory
(
'browser'
,
(
error
,
files
)
=>
{
filesProvider
.
resolveDirectory
(
filesProvider
.
type
,
(
error
,
files
)
=>
{
if
(
error
)
callback
(
error
)
if
(
error
)
callback
(
error
)
else
{
else
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment