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
5eb10e84
Commit
5eb10e84
authored
Oct 02, 2015
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix multiple files bugs
parent
06310659
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
index.html
index.html
+7
-11
browser-solidity.css
stylesheets/browser-solidity.css
+0
-3
No files found.
index.html
View file @
5eb10e84
...
@@ -93,8 +93,9 @@ THE SOFTWARE.
...
@@ -93,8 +93,9 @@ THE SOFTWARE.
var
solFiles
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
SOL_CACHE_FILES_KEY
)
)
||
[
SOL_CACHE_FILE
];
var
solFiles
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
SOL_CACHE_FILES_KEY
)
)
||
[
SOL_CACHE_FILE
];
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
var
solCache
=
window
.
localStorage
.
getItem
(
SOL_CACHE_FILE
);
var
solCache
=
window
.
localStorage
.
getItem
(
SOL_CACHE_FILE
)
||
BALLOT_EXAMPLE
;
editor
.
setValue
(
solCache
||
BALLOT_EXAMPLE
,
1
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILE
,
solCache
)
editor
.
setValue
(
solCache
,
1
);
session
.
setMode
(
"ace/mode/javascript"
);
session
.
setMode
(
"ace/mode/javascript"
);
...
@@ -113,7 +114,6 @@ THE SOFTWARE.
...
@@ -113,7 +114,6 @@ THE SOFTWARE.
SOL_CACHE_FILE
=
name
;
SOL_CACHE_FILE
=
name
;
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILE
,
''
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILE
,
''
);
console
.
log
(
'new file added: '
,
solFiles
)
updateFiles
();
updateFiles
();
})
})
...
@@ -122,7 +122,6 @@ THE SOFTWARE.
...
@@ -122,7 +122,6 @@ THE SOFTWARE.
$filesEl
.
on
(
'click'
,
'.file.active'
,
function
(
ev
){
$filesEl
.
on
(
'click'
,
'.file.active'
,
function
(
ev
){
var
$fileTabEl
=
$
(
this
)
var
$fileTabEl
=
$
(
this
)
var
originalName
=
$fileTabEl
.
find
(
'.name'
).
text
()
var
originalName
=
$fileTabEl
.
find
(
'.name'
).
text
()
console
.
log
(
"click active: "
,
originalName
)
ev
.
preventDefault
()
ev
.
preventDefault
()
if
(
$
(
this
).
find
(
'input'
).
length
>
0
)
return
false
;
if
(
$
(
this
).
find
(
'input'
).
length
>
0
)
return
false
;
var
$fileNameInputEl
=
$
(
'<input value="'
+
originalName
+
'"/>'
);
var
$fileNameInputEl
=
$
(
'<input value="'
+
originalName
+
'"/>'
);
...
@@ -135,10 +134,10 @@ THE SOFTWARE.
...
@@ -135,10 +134,10 @@ THE SOFTWARE.
var
$new
=
null
var
$new
=
null
if
(
confirm
(
"Are you sure you want to rename: "
+
originalName
+
" to "
+
newName
+
'?'
))
{
if
(
confirm
(
"Are you sure you want to rename: "
+
originalName
+
" to "
+
newName
+
'?'
))
{
solFiles
[
solFiles
.
indexOf
(
originalName
)]
=
newName
solFiles
.
splice
(
solFiles
.
indexOf
(
originalName
),
1
,
newName
);
window
.
localStorage
.
setItem
(
newName
,
window
.
localStorage
.
getItem
(
originalName
)
);
window
.
localStorage
.
setItem
(
newName
,
window
.
localStorage
.
getItem
(
originalName
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
originalName
,
''
)
window
.
localStorage
.
removeItem
(
originalName
)
SOL_CACHE_FILE
=
newName
;
SOL_CACHE_FILE
=
newName
;
updateFiles
()
updateFiles
()
}
}
...
@@ -154,12 +153,11 @@ THE SOFTWARE.
...
@@ -154,12 +153,11 @@ THE SOFTWARE.
var
name
=
$
(
this
).
parent
().
find
(
'.name'
).
text
()
var
name
=
$
(
this
).
parent
().
find
(
'.name'
).
text
()
if
(
confirm
(
"Are you sure you want to remove: "
+
name
+
" from local storage?"
))
{
if
(
confirm
(
"Are you sure you want to remove: "
+
name
+
" from local storage?"
))
{
console
.
log
(
"remove file, "
,
ev
.
target
)
var
index
=
solFiles
.
indexOf
(
name
);
var
index
=
solFiles
.
indexOf
(
name
);
solFiles
[
index
]
=
undefined
;
solFiles
.
splice
(
index
,
1
)
;
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILES_KEY
,
JSON
.
stringify
(
solFiles
)
);
SOL_CACHE_FILE
=
solFiles
[
Math
.
max
(
0
,
index
-
1
)]
SOL_CACHE_FILE
=
solFiles
[
Math
.
max
(
0
,
index
-
1
)]
window
.
localStorage
.
setItem
(
name
,
null
)
window
.
localStorage
.
removeItem
(
name
)
updateFiles
()
updateFiles
()
}
}
return
false
;
return
false
;
...
@@ -168,7 +166,6 @@ THE SOFTWARE.
...
@@ -168,7 +166,6 @@ THE SOFTWARE.
function
showFileHandler
(
ev
)
{
function
showFileHandler
(
ev
)
{
ev
.
preventDefault
()
ev
.
preventDefault
()
SOL_CACHE_FILE
=
$
(
this
).
find
(
'.name'
).
text
();
SOL_CACHE_FILE
=
$
(
this
).
find
(
'.name'
).
text
();
console
.
log
(
'click normal'
,
SOL_CACHE_FILE
,
typeof
window
.
localStorage
.
getItem
(
SOL_CACHE_FILE
))
updateFiles
()
updateFiles
()
return
false
;
return
false
;
}
}
...
@@ -178,7 +175,6 @@ THE SOFTWARE.
...
@@ -178,7 +175,6 @@ THE SOFTWARE.
}
}
function
updateFiles
()
{
function
updateFiles
()
{
console
.
log
(
"Update files"
,
solFiles
,
SOL_CACHE_FILE
,
typeof
window
.
localStorage
.
getItem
(
SOL_CACHE_FILE
)
)
$filesEl
.
find
(
'.file'
).
remove
()
$filesEl
.
find
(
'.file'
).
remove
()
for
(
var
f
in
solFiles
)
{
for
(
var
f
in
solFiles
)
{
if
(
solFiles
[
f
])
$filesEl
.
append
(
fileTabTemplate
(
solFiles
[
f
])
);
if
(
solFiles
[
f
])
$filesEl
.
append
(
fileTabTemplate
(
solFiles
[
f
])
);
...
...
stylesheets/browser-solidity.css
View file @
5eb10e84
...
@@ -39,9 +39,6 @@ body {
...
@@ -39,9 +39,6 @@ body {
#files
.file.active
{
#files
.file.active
{
font-weight
:
bold
;
font-weight
:
bold
;
background-color
:
#F0F0F0
;
border
:
1px
solid
#BFBFBF
;
box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
0.25
);
border-bottom
:
0
none
;
border-bottom
:
0
none
;
padding-right
:
2.5em
;
padding-right
:
2.5em
;
}
}
...
...
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