Stackedit/public/res/settings.js

73 lines
2.0 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',
2014-08-27 23:11:08 +00:00
markdownMimeType: 'text/plain',
2014-04-27 12:43:57 +00:00
gdriveMultiAccount: 1,
gdriveFullAccess: true,
dropboxFullAccess: true,
githubFullAccess: true,
template: [
2014-08-19 08:17:27 +00:00
'<!DOCTYPE html>',
'<html>',
'<head>',
'<meta charset="utf-8">',
'<meta name="viewport" content="width=device-width, initial-scale=1.0">',
2014-08-19 08:17:27 +00:00
'<title><%= documentTitle %></title>',
2014-09-06 00:11:06 +00:00
'<link rel="stylesheet" href="' + constants.MAIN_URL + 'res-min/themes/base.css" />',
2014-09-01 22:37:46 +00:00
'<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',
2014-08-19 08:17:27 +00:00
'</head>',
'<body><div class="container"><%= documentHTML %></div></body>',
2014-04-27 12:43:57 +00:00
'</html>'
2014-08-19 08:17:27 +00:00
].join('\n'),
2014-04-27 12:43:57 +00:00
pdfTemplate: [
2014-08-19 08:17:27 +00:00
'<!DOCTYPE html>',
'<html>',
'<head>',
'<meta charset="utf-8">',
'<title><%= documentTitle %></title>',
'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />',
'<script type="text/x-mathjax-config">',
'MathJax.Hub.Config({ messageStyle: "none" });',
'</script>',
2014-09-06 00:11:06 +00:00
'<script type="text/javascript" src="http://localhost/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',
2014-08-19 08:17:27 +00:00
'</head>',
'<body><%= documentHTML %></body>',
2014-04-27 12:43:57 +00:00
'</html>'
2014-08-19 08:17:27 +00:00
].join('\n'),
pdfOptions: [
'{',
' "marginTop": 25,',
' "marginRight": 25,',
' "marginBottom": 25,',
' "marginLeft": 25,',
' "pageSize": "A4"',
'}'
].join('\n'),
couchdbUrl: constants.COUCHDB_URL,
2014-04-27 12:43:57 +00:00
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
});