Stackedit/public/res/settings.js

72 lines
1.8 KiB
JavaScript
Raw Normal View History

2013-05-27 19:45:33 +00:00
define([
2014-04-27 12:43:57 +00:00
"underscore",
"constants",
"storage"
], function(_, constants, storage) {
2013-05-29 19:55:23 +00:00
2014-04-27 12:43:57 +00:00
var settings = {
layoutOrientation: "horizontal",
editMode: 'ltr',
lazyRendering: true,
editorFontClass: 'font-rich',
fontSizeRatio: 1,
maxWidthRatio: 1,
cursorFocusRatio: 0.5,
defaultContent: "\n\n\n> Written with [StackEdit](" + constants.MAIN_URL + ").",
commitMsg: "Published with " + constants.MAIN_URL,
conflictMode: 'merge',
markdownMimeType: 'text/x-markdown',
gdriveMultiAccount: 1,
gdriveFullAccess: true,
dropboxFullAccess: true,
githubFullAccess: true,
template: [
'<!DOCTYPE html>\n',
'<html>\n',
'<head>\n',
'<meta charset="utf-8">\n',
'<title><%= documentTitle %></title>\n',
'<link rel="stylesheet" href="',
constants.MAIN_URL,
'res-min/themes/base.css" />\n',
'<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(""),
pdfTemplate: [
'<!DOCTYPE html>\n',
'<html>\n',
'<head>\n',
'<meta charset="utf-8">\n',
'<title><%= documentTitle %></title>\n',
'<link rel="stylesheet" href="',
constants.MAIN_URL,
'res-min/themes/base.css" />\n',
'<script type="text/x-mathjax-config">\n',
'MathJax.Hub.Config({ messageStyle: "none" });\n',
'</script>\n',
'<script type="text/javascript" src="',
constants.MAIN_URL,
'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
'</head>\n',
'<body class="pdf"><%= documentHTML %></body>\n',
'</html>'
].join(""),
pdfPageSize: 'A4',
sshProxy: constants.SSH_PROXY_URL,
extensionSettings: {}
};
2013-05-29 19:55:23 +00:00
2014-04-27 12:43:57 +00:00
try {
_.extend(settings, JSON.parse(storage.settings));
}
catch(e) {
// Ignore parsing error
}
2013-05-29 19:55:23 +00:00
2014-04-27 12:43:57 +00:00
return settings;
2014-03-20 00:24:56 +00:00
});