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
f92f5bb4
Commit
f92f5bb4
authored
Sep 27, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed upload gist
parent
2c0e911e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
file-explorer.js
src/app/files/file-explorer.js
+9
-18
No files found.
src/app/files/file-explorer.js
View file @
f92f5bb4
...
...
@@ -218,12 +218,12 @@ function fileExplorer (localRegistry, files, menuItems) {
}
else
{
const
folderPath
=
extractExternalFolder
(
key
)
if
(
folderPath
===
'browser/gists'
)
{
const
id
=
key
.
substr
(
key
.
lastIndexOf
(
'/'
),
key
.
length
-
1
)
actions
[
'Push changes to gist'
]
=
()
=>
{
const
id
=
key
.
substr
(
key
.
lastIndexOf
(
'/'
)
+
1
,
key
.
length
-
1
)
modalDialogCustom
.
confirm
(
'Push back to Gist'
,
'Are you sure you want to push all your changes back to Gist?'
,
()
=>
{
this
.
toGist
(
id
)
},
()
=>
{
self
.
toGist
(
id
)
},
()
=>
{}
)
}
...
...
@@ -430,6 +430,7 @@ fileExplorer.prototype.toGist = function (id) {
let
proccedResult
=
function
(
error
,
data
)
{
if
(
error
)
{
modalDialogCustom
.
alert
(
'Failed to manage gist: '
+
error
)
console
.
log
(
'Failed to manage gist: '
+
error
)
}
else
{
if
(
data
.
html_url
)
{
modalDialogCustom
.
confirm
(
'Gist is ready'
,
`The gist is at
${
data
.
html_url
}
. Would you like to open it in a new window?`
,
()
=>
{
...
...
@@ -513,13 +514,13 @@ fileExplorer.prototype.packageFiles = function (filesProvider, callback) {
else
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
filesProvider
.
get
(
path
,
(
error
,
content
)
=>
{
if
(
/^
\s
+$/
.
test
(
content
)
||
!
content
.
length
)
{
content
=
'// this line is added to create a gist. Empty file is not allowed.'
}
if
(
error
)
cb
(
error
)
else
{
ret
[
path
]
=
{
content
}
cb
()
else
if
(
/^
\s
+$/
.
test
(
content
)
||
!
content
.
length
)
{
content
=
'// this line is added to create a gist. Empty file is not allowed.'
if
(
!
error
)
{
ret
[
path
]
=
{
content
}
cb
()
}
}
})
},
(
error
)
=>
{
...
...
@@ -559,16 +560,6 @@ fileExplorer.prototype.copyFiles = function () {
}
}
// ------------------ gist publish --------------
fileExplorer
.
prototype
.
updateGist
=
function
()
{
const
gistId
=
this
.
files
.
id
if
(
!
gistId
)
{
tooltip
(
'no gist content is currently loaded.'
)
}
else
{
this
.
toGist
(
gistId
)
}
}
fileExplorer
.
prototype
.
createNewFile
=
function
()
{
let
self
=
this
modalDialogCustom
.
prompt
(
'Create new file'
,
'File Path (Untitled.sol, Folder1/Untitled.sol)'
,
'Untitled.sol'
,
(
input
)
=>
{
...
...
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