Stackedit/public/res/settings.js

70 lines
2.2 KiB
JavaScript
Raw Normal View History

2013-05-27 19:45:33 +00:00
define([
2013-05-27 22:13:41 +00:00
"underscore",
2013-11-05 23:03:38 +00:00
"constants",
"storage",
], function (_, constants, storage) {
2013-05-29 19:55:23 +00:00
var settings = {
layoutOrientation: "horizontal",
2014-04-17 23:41:35 +00:00
editMode: 'ltr',
2013-05-29 19:55:23 +00:00
lazyRendering: true,
2014-04-15 23:16:08 +00:00
editorFontClass: 'font-rich',
fontSizeRatio: 1,
maxWidthRatio: 1,
2013-11-05 23:03:38 +00:00
defaultContent: "\n\n\n> Written with [StackEdit](" + constants.MAIN_URL + ").",
commitMsg: "Published with " + constants.MAIN_URL,
2014-03-28 00:49:49 +00:00
conflictMode: 'merge',
gdriveMultiAccount: 1,
2013-10-06 14:34:40 +00:00
gdriveFullAccess: true,
dropboxFullAccess: true,
githubFullAccess: true,
2013-05-29 19:55:23 +00:00
template: [
2013-11-05 23:03:38 +00:00
'<!DOCTYPE html>\n',
'<html>\n',
'<head>\n',
'<meta charset="utf-8">\n',
'<title><%= documentTitle %></title>\n',
'<link rel="stylesheet" href="',
constants.MAIN_URL,
2013-12-06 22:15:51 +00:00
'res-min/themes/base.css" />\n',
2013-11-05 23:03:38 +00:00
'<script type="text/javascript" src="',
constants.MAIN_URL,
'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
'</head>\n',
'<body><div class="container"><%= documentHTML %></div></body>\n',
'</html>'
].join(""),
2013-09-22 22:16:59 +00:00
pdfTemplate: [
2013-11-05 23:03:38 +00:00
'<!DOCTYPE html>\n',
'<html>\n',
'<head>\n',
'<meta charset="utf-8">\n',
'<title><%= documentTitle %></title>\n',
2014-01-13 18:57:59 +00:00
'<link rel="stylesheet" href="',
constants.MAIN_URL,
'res-min/themes/base.css" />\n',
2013-11-05 23:03:38 +00:00
'<script type="text/x-mathjax-config">\n',
'MathJax.Hub.Config({ messageStyle: "none" });\n',
'</script>\n',
2014-01-13 18:57:59 +00:00
'<script type="text/javascript" src="',
constants.MAIN_URL,
'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
2013-11-05 23:03:38 +00:00
'</head>\n',
'<body class="pdf"><%= documentHTML %></body>\n',
'</html>'
2013-05-29 19:55:23 +00:00
].join(""),
2013-10-27 19:19:56 +00:00
pdfPageSize: 'A4',
2013-11-05 23:03:38 +00:00
sshProxy: constants.SSH_PROXY_URL,
2013-05-29 19:55:23 +00:00
extensionSettings: {}
};
2013-06-03 22:19:52 +00:00
try {
2013-11-05 23:03:38 +00:00
_.extend(settings, JSON.parse(storage.settings));
2013-05-29 19:55:23 +00:00
}
2013-11-05 23:03:38 +00:00
catch (e) {
2013-06-03 22:19:52 +00:00
// Ignore parsing error
}
2013-05-29 19:55:23 +00:00
return settings;
2014-03-20 00:24:56 +00:00
});