2013-05-27 19:45:33 +00:00
|
|
|
define([
|
2013-05-27 22:13:41 +00:00
|
|
|
"underscore",
|
2013-09-15 14:14:42 +00:00
|
|
|
"config",
|
|
|
|
"storage"
|
2013-05-27 19:45:33 +00:00
|
|
|
], function(_) {
|
2013-05-29 19:55:23 +00:00
|
|
|
|
|
|
|
var settings = {
|
|
|
|
layoutOrientation: "horizontal",
|
|
|
|
lazyRendering: true,
|
2013-09-09 00:08:55 +00:00
|
|
|
editorFontFamily: 'Menlo, Consolas, "Courier New", Courier, monospace',
|
|
|
|
editorFontSize: 12,
|
2013-09-15 01:35:58 +00:00
|
|
|
maxWidth: 960,
|
2013-06-02 19:35:44 +00:00
|
|
|
defaultContent: "\n\n\n> Written with [StackEdit](" + MAIN_URL + ").",
|
|
|
|
commitMsg: "Published with " + MAIN_URL,
|
2013-05-29 19:55:23 +00:00
|
|
|
template: [
|
2013-09-22 22:16:59 +00:00
|
|
|
'<!DOCTYPE html>\n',
|
|
|
|
'<html>\n',
|
|
|
|
'<head>\n',
|
|
|
|
'<meta charset="utf-8">\n',
|
|
|
|
'<title><%= documentTitle %></title>\n',
|
|
|
|
'<link rel="stylesheet" href="',
|
|
|
|
MAIN_URL,
|
|
|
|
'res-min/themes/default.css" />\n',
|
|
|
|
'<script type="text/javascript" src="',
|
|
|
|
MAIN_URL,
|
|
|
|
'lib/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
|
|
|
|
'</head>\n',
|
|
|
|
'<body><div class="container"><%= documentHTML %></div></body>\n',
|
|
|
|
'</html>'
|
|
|
|
].join(""),
|
|
|
|
pdfTemplate: [
|
2013-05-27 19:45:33 +00:00
|
|
|
'<!DOCTYPE html>\n',
|
2013-05-29 19:55:23 +00:00
|
|
|
'<html>\n',
|
|
|
|
'<head>\n',
|
2013-06-02 19:35:44 +00:00
|
|
|
'<meta charset="utf-8">\n',
|
2013-05-29 19:55:23 +00:00
|
|
|
'<title><%= documentTitle %></title>\n',
|
2013-06-02 19:35:44 +00:00
|
|
|
'<link rel="stylesheet" href="',
|
|
|
|
MAIN_URL,
|
2013-09-15 16:46:23 +00:00
|
|
|
'res-min/themes/default.css" />\n',
|
2013-09-22 22:16:59 +00:00
|
|
|
'<style type="text/css">\n',
|
|
|
|
"@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf') format('opentype')}\n",
|
|
|
|
"@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf') format('opentype'); font-weight: bold}\n",
|
|
|
|
"@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf') format('opentype'); font-style: italic}\n",
|
|
|
|
"@font-face {font-family: MathJax_Math; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf') format('opentype'); font-style: italic}\n",
|
|
|
|
"@font-face {font-family: MathJax_Caligraphic; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf') format('opentype')}\n",
|
|
|
|
"@font-face {font-family: MathJax_Size1; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf') format('opentype')}\n",
|
|
|
|
"@font-face {font-family: MathJax_Size2; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf') format('opentype')}\n",
|
|
|
|
"@font-face {font-family: MathJax_Size3; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf') format('opentype')}\n",
|
|
|
|
"@font-face {font-family: MathJax_Size4; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf') format('opentype')}\n",
|
|
|
|
'</style>\n',
|
2013-05-29 19:55:23 +00:00
|
|
|
'</head>\n',
|
2013-09-22 22:16:59 +00:00
|
|
|
'<body class="pdf"><%= documentHTML %></body>\n',
|
2013-05-29 19:55:23 +00:00
|
|
|
'</html>'
|
|
|
|
].join(""),
|
|
|
|
sshProxy: SSH_PROXY_URL,
|
|
|
|
extensionSettings: {}
|
|
|
|
};
|
|
|
|
|
2013-06-03 22:19:52 +00:00
|
|
|
try {
|
2013-05-29 19:55:23 +00:00
|
|
|
_.extend(settings, JSON.parse(localStorage.settings));
|
|
|
|
}
|
2013-06-03 22:19:52 +00:00
|
|
|
catch(e) {
|
|
|
|
// Ignore parsing error
|
|
|
|
}
|
2013-05-29 19:55:23 +00:00
|
|
|
|
|
|
|
return settings;
|
2013-05-27 19:45:33 +00:00
|
|
|
});
|