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
d74cb8e5
Commit
d74cb8e5
authored
Jan 17, 2017
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use the set/getCacheFile abstraction
parent
0857b30a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
editor.js
src/app/editor.js
+7
-6
No files found.
src/app/editor.js
View file @
d74cb8e5
...
@@ -29,7 +29,7 @@ function Editor (doNotLoadStorage, storage) {
...
@@ -29,7 +29,7 @@ function Editor (doNotLoadStorage, storage) {
while
(
storage
.
exists
(
'Untitled'
+
untitledCount
))
{
while
(
storage
.
exists
(
'Untitled'
+
untitledCount
))
{
untitledCount
=
(
untitledCount
-
0
)
+
1
untitledCount
=
(
untitledCount
-
0
)
+
1
}
}
SOL_CACHE_FILE
=
'Untitled'
+
untitledCount
this
.
setCacheFile
(
'Untitled'
+
untitledCount
)
this
.
setCacheFileContent
(
''
)
this
.
setCacheFileContent
(
''
)
}
}
...
@@ -37,9 +37,10 @@ function Editor (doNotLoadStorage, storage) {
...
@@ -37,9 +37,10 @@ function Editor (doNotLoadStorage, storage) {
var
fileReader
=
new
FileReader
()
var
fileReader
=
new
FileReader
()
var
name
=
file
.
name
var
name
=
file
.
name
var
self
=
this
fileReader
.
onload
=
function
(
e
)
{
fileReader
.
onload
=
function
(
e
)
{
s
torage
.
set
(
name
,
e
.
target
.
result
)
s
elf
.
setCacheFile
(
name
)
SOL_CACHE_FILE
=
name
self
.
setCacheFileContent
(
e
.
target
.
result
)
callback
()
callback
()
}
}
fileReader
.
readAsText
(
file
)
fileReader
.
readAsText
(
file
)
...
@@ -67,7 +68,7 @@ function Editor (doNotLoadStorage, storage) {
...
@@ -67,7 +68,7 @@ function Editor (doNotLoadStorage, storage) {
}
}
this
.
resetSession
=
function
()
{
this
.
resetSession
=
function
()
{
editor
.
setSession
(
sessions
[
SOL_CACHE_FILE
])
editor
.
setSession
(
sessions
[
this
.
getCacheFile
()
])
editor
.
focus
()
editor
.
focus
()
}
}
...
@@ -185,13 +186,13 @@ function Editor (doNotLoadStorage, storage) {
...
@@ -185,13 +186,13 @@ function Editor (doNotLoadStorage, storage) {
storage
.
set
(
examples
.
ballot
.
name
,
examples
.
ballot
.
content
)
storage
.
set
(
examples
.
ballot
.
name
,
examples
.
ballot
.
content
)
}
}
SOL_CACHE_FILE
=
files
[
0
]
this
.
setCacheFile
(
files
[
0
])
for
(
var
x
in
files
)
{
for
(
var
x
in
files
)
{
sessions
[
files
[
x
]]
=
newEditorSession
(
files
[
x
])
sessions
[
files
[
x
]]
=
newEditorSession
(
files
[
x
])
}
}
editor
.
setSession
(
sessions
[
SOL_CACHE_FILE
])
editor
.
setSession
(
sessions
[
this
.
getCacheFile
()
])
editor
.
resize
(
true
)
editor
.
resize
(
true
)
}
}
}
}
...
...
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