Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
explosurf
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent Nivoliers
explosurf
Commits
365d01d6
Commit
365d01d6
authored
8 years ago
by
Vincent Nivoliers
Browse files
Options
Downloads
Patches
Plain Diff
fixed localStorage key prefix with innerHTML
parent
56be2a13
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/explorer.js
+1
-2
1 addition, 2 deletions
js/explorer.js
js/notes.js
+1
-1
1 addition, 1 deletion
js/notes.js
js/pgm_construction.js
+2
-36
2 additions, 36 deletions
js/pgm_construction.js
with
4 additions
and
39 deletions
js/explorer.js
+
1
−
2
View file @
365d01d6
...
...
@@ -134,12 +134,11 @@ function openXML(filename, handler) {
}
/* exploration */
var
planet
=
{}
;
var
center_map
=
null
;
var
storage_prefix
=
'
Explosurf:
'
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
.
replace
(
/
\s
+/mg
,
''
)
+
'
:explorer
'
;
...
...
This diff is collapsed.
Click to expand it.
js/notes.js
+
1
−
1
View file @
365d01d6
...
...
@@ -11,7 +11,7 @@
/* local storage prefix */
var
storage_prefix
=
'
Explosurf:
'
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
.
replace
(
/
\s
+/mg
,
''
)
+
'
:notes
'
;
...
...
This diff is collapsed.
Click to expand it.
js/pgm_construction.js
+
2
−
36
View file @
365d01d6
...
...
@@ -60,7 +60,7 @@ var has_absolute_fixed_bug = (function() {
/*prefix for local storage*/
var
storage_prefix
=
'
Explosurf:
'
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
+
document
.
getElementById
(
'
planet-name
'
).
innerHTML
.
toLowerCase
()
.
replace
(
/
\s
+/mg
,
''
)
+
'
:pgm
'
;
...
...
@@ -203,47 +203,13 @@ document.getElementById('pgm-load-local').addEventListener(
}
)
;
/* pack the full Explosurf data in a blob */
var
file_blob
=
null
;
function
generate_blob
()
{
local_save
()
;
var
data
=
new
Blob
(
[
JSON
.
stringify
(
localStorage
)],
{
type
:
'
application/json
'
}
)
;
if
(
file_blob
!==
null
)
{
window
.
URL
.
revokeObjectURL
(
file_blob
)
;
}
file_blob
=
window
.
URL
.
createObjectURL
(
data
)
;
return
file_blob
;
}
/* propose the blob for download : save all data */
/* save all data using filesaver.js */
function
blob_download
()
{
var
blob
=
new
Blob
(
[
JSON
.
stringify
(
localStorage
)],
{
type
:
'
application/json
'
}
)
;
saveAs
(
blob
,
'
explosurf.json
'
)
;
/*
var link = document.createElement('a') ;
link.setAttribute('download', 'explosurf.json') ;
link.href = generate_blob() ;
document.body.appendChild(link) ;
setTimeout(function () {
var event ;
if(typeof MouseEvent !== 'function') {
event = document.createEvent("MouseEvent");
event.initMouseEvent("click",true,false,window,0,0,0,0,0,false,false,false,false,0,null);
} else {
event = new MouseEvent('click');
}
link.dispatchEvent(event);
document.body.removeChild(link);
}, 66);
*/
}
/* load the saved data */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment