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
372f3f26
Commit
372f3f26
authored
Feb 15, 2017
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder storage file
parent
9d37e90f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
storage.js
src/app/storage.js
+13
-13
No files found.
src/app/storage.js
View file @
372f3f26
...
@@ -18,19 +18,6 @@ function Storage () {
...
@@ -18,19 +18,6 @@ function Storage () {
return
true
return
true
}
}
function
safeKeys
()
{
// NOTE: this is a workaround for some browsers
return
Object
.
keys
(
window
.
localStorage
).
filter
(
function
(
item
)
{
return
item
!==
null
&&
item
!==
undefined
})
}
this
.
keys
=
function
()
{
return
safeKeys
()
// filter any names not including sol:
.
filter
(
function
(
item
)
{
return
item
.
indexOf
(
'sol:'
,
0
)
===
0
})
// remove sol: from filename
.
map
(
function
(
item
)
{
return
item
.
replace
(
/^sol:/
,
''
)
})
}
this
.
remove
=
function
(
name
)
{
this
.
remove
=
function
(
name
)
{
window
.
localStorage
.
removeItem
(
'sol:'
+
name
)
window
.
localStorage
.
removeItem
(
'sol:'
+
name
)
return
true
return
true
...
@@ -45,6 +32,19 @@ function Storage () {
...
@@ -45,6 +32,19 @@ function Storage () {
return
true
return
true
}
}
function
safeKeys
()
{
// NOTE: this is a workaround for some browsers
return
Object
.
keys
(
window
.
localStorage
).
filter
(
function
(
item
)
{
return
item
!==
null
&&
item
!==
undefined
})
}
this
.
keys
=
function
()
{
return
safeKeys
()
// filter any names not including sol:
.
filter
(
function
(
item
)
{
return
item
.
indexOf
(
'sol:'
,
0
)
===
0
})
// remove sol: from filename
.
map
(
function
(
item
)
{
return
item
.
replace
(
/^sol:/
,
''
)
})
}
// on startup, upgrade the old storage layout
// on startup, upgrade the old storage layout
safeKeys
().
forEach
(
function
(
name
)
{
safeKeys
().
forEach
(
function
(
name
)
{
if
(
name
.
indexOf
(
'sol-cache-file-'
,
0
)
===
0
)
{
if
(
name
.
indexOf
(
'sol-cache-file-'
,
0
)
===
0
)
{
...
...
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