Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
88d2eacf
Commit
88d2eacf
authored
Aug 25, 2015
by
Amanda Ghassaei
Browse files
save two files for machine config
parent
2c19b398
Changes
1
Show whitespace changes
Inline
Side-by-side
js/models/FileSaver.js
View file @
88d2eacf
...
...
@@ -9,12 +9,15 @@ define(['underscore', 'fileSaverLib', 'lattice', 'materials', 'ribbon', 'menuWra
// require(['jsonFn'], function(JSONfn){
// console.log(data.toString());
var
jsonString
=
JSON
.
stringify
(
data
,
null
,
'
\t
'
);
if
(
data
.
assembler
){
// jsonString.replace(/\\"/g,"\uFFFF"); //U+ FFFF
// jsonString = jsonString.replace(/\"([^"]+)\":/g,"$1:").replace(/\uFFFF/g,"\\\"");
}
var
blob
=
new
Blob
([
jsonString
],
{
type
:
"
text/plain;charset=utf-8
"
});
saveAs
(
blob
,
name
+
extension
);
if
(
data
.
assembler
){
jsonString
.
replace
(
/
\\
"/g
,
"
\
uFFFF
"
);
//U+ FFFF
jsonString
=
jsonString
.
replace
(
/
\"([^
"
]
+
)\"
:/g
,
"
$1:
"
).
replace
(
/
\u
FFFF/g
,
"
\\\"
"
);
var
blob
=
new
Blob
([
jsonString
],
{
type
:
"
text/plain;charset=utf-8
"
});
saveAs
(
blob
,
name
+
"
-forAmanda
"
+
extension
);
}
// });
}
...
...
Write
Preview
Supports
Markdown
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