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
c485283f
Unverified
Commit
c485283f
authored
Apr 03, 2020
by
yann300
Committed by
GitHub
Apr 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2703 from ethereum/publishG
Publish to Gist
parents
3ec73779
bbb29e8f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
file-explorer.js
src/app/files/file-explorer.js
+13
-4
fileProvider.js
src/app/files/fileProvider.js
+4
-0
settings-tab.js
src/app/tabs/settings-tab.js
+2
-2
No files found.
src/app/files/file-explorer.js
View file @
c485283f
...
...
@@ -488,7 +488,7 @@ fileExplorer.prototype.toGist = function (id) {
this
.
packageFiles
(
this
.
files
,
folder
,
(
error
,
packaged
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
.
message
)
}
else
{
// check for token
var
tokenAccess
=
this
.
_deps
.
config
.
get
(
'settings/gist-access-token'
)
...
...
@@ -550,11 +550,14 @@ fileExplorer.prototype.toGist = function (id) {
// return all the files, except the temporary/readonly ones..
fileExplorer
.
prototype
.
packageFiles
=
function
(
filesProvider
,
directory
,
callback
)
{
var
ret
=
{}
let
ret
=
{}
filesProvider
.
resolveDirectory
(
directory
,
(
error
,
files
)
=>
{
if
(
error
)
callback
(
error
)
else
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
if
(
filesProvider
.
isDirectory
(
path
))
{
cb
()
}
else
{
filesProvider
.
get
(
path
,
(
error
,
content
)
=>
{
if
(
error
)
return
cb
(
error
)
if
(
/^
\s
+$/
.
test
(
content
)
||
!
content
.
length
)
{
...
...
@@ -563,6 +566,7 @@ fileExplorer.prototype.packageFiles = function (filesProvider, directory, callba
ret
[
path
]
=
{
content
}
cb
()
})
}
},
(
error
)
=>
{
callback
(
error
,
ret
)
})
...
...
@@ -617,12 +621,17 @@ fileExplorer.prototype.renderMenuItems = function () {
items
=
this
.
menuItems
.
map
(({
action
,
title
,
icon
})
=>
{
if
(
action
===
'uploadFile'
)
{
return
yo
`
<label id=
${
action
}
class="
${
icon
}
${
css
.
newFile
}
" title="
${
title
}
">
<span
id=
${
action
}
data-id="fileExplorerUploadFile
${
action
}
"
class="
${
icon
}
${
css
.
newFile
}
"
title="
${
title
}
"
>
<input type="file" onchange=
${(
event
)
=>
{
event
.
stopPropagation
()
this
.
uploadFile
(
event
)
}}
multiple
/>
<
/
label
>
<
/
span
>
`
} else {
return yo`
...
...
src/app/files/fileProvider.js
View file @
c485283f
...
...
@@ -133,6 +133,10 @@ class FileProvider {
return
false
}
isDirectory
(
path
)
{
return
window
.
remixFileSystem
.
statSync
(
path
).
isDirectory
()
}
/**
* Removes the folder recursively
* @param {*} path is the folder to be removed
...
...
src/app/tabs/settings-tab.js
View file @
c485283f
...
...
@@ -69,11 +69,11 @@ module.exports = class SettingsTab extends ViewPlugin {
// Gist settings
const
token
=
this
.
config
.
get
(
'settings/gist-access-token'
)
const
gistAccessToken
=
yo
`<input id="gistaccesstoken" data-id="settingsTabGistAccessToken" type="password" class="border form-control mb-2
${
css
.
inline
}
" placeholder="Token">`
const
gistAccessToken
=
yo
`<input id="gistaccesstoken" data-id="settingsTabGistAccessToken" type="password" class="border form-control
-sm
mb-2
${
css
.
inline
}
" placeholder="Token">`
if
(
token
)
gistAccessToken
.
value
=
token
const
removeToken
=
()
=>
{
self
.
config
.
set
(
'settings/gist-access-token'
,
''
);
gistAccessToken
.
value
=
''
;
tooltip
(
'Access token removed'
)
}
const
saveToken
=
()
=>
{
this
.
config
.
set
(
'settings/gist-access-token'
,
gistAccessToken
.
value
);
tooltip
(
'Access token saved'
)
}
const
gistAddToken
=
yo
`<input class="btn btn-s
econdary mx-1
" id="savegisttoken" data-id="settingsTabSaveGistToken" onclick=
${()
=>
saveToken
()}
value="Save" type="button">`
const
gistAddToken
=
yo
`<input class="btn btn-s
m btn-primary
" id="savegisttoken" data-id="settingsTabSaveGistToken" onclick=
${()
=>
saveToken
()}
value="Save" type="button">`
const
gistRemoveToken
=
yo
`<i class="mx-1 fas fa-trash-alt" id="removegisttoken" data-id="settingsTabRemoveGistToken" title="Delete Github access token" onclick=
${()
=>
removeToken
()}
" type="button"></i>`
this
.
_view
.
gistToken
=
yo
`<div class="text-secondary mb-0 h6">
${
gistAccessToken
}${
gistAddToken
}${
copyToClipboard
(()
=>
gistAccessToken
.
value
)}${
gistRemoveToken
}
</div>`
this
.
_view
.
optionVM
=
yo
`<input onchange=
${
onchangeOption
}
class="align-middle form-check-input" id="alwaysUseVM" data-id="settingsTabAlwaysUseVM" type="checkbox">`
...
...
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