Set default settings for v4
This commit is contained in:
parent
143e90cedd
commit
1231b26710
@ -178,7 +178,7 @@ catch(e) {
|
|||||||
window.viewerMode = /(^| )viewer($| )/.test(document.body.className);
|
window.viewerMode = /(^| )viewer($| )/.test(document.body.className);
|
||||||
|
|
||||||
// Keep the theme in a global variable
|
// Keep the theme in a global variable
|
||||||
window.theme = localStorage.themeV3 || 'default';
|
window.theme = localStorage.themeV4 || 'default';
|
||||||
var themeModule = "less!themes/" + window.theme;
|
var themeModule = "less!themes/" + window.theme;
|
||||||
if(window.baseDir.indexOf('-min') !== -1) {
|
if(window.baseDir.indexOf('-min') !== -1) {
|
||||||
themeModule = "css!themes/" + window.theme;
|
themeModule = "css!themes/" + window.theme;
|
||||||
|
@ -21,41 +21,41 @@ define([
|
|||||||
dropboxFullAccess: true,
|
dropboxFullAccess: true,
|
||||||
githubFullAccess: true,
|
githubFullAccess: true,
|
||||||
template: [
|
template: [
|
||||||
'<!DOCTYPE html>\n',
|
'<!DOCTYPE html>',
|
||||||
'<html>\n',
|
'<html>',
|
||||||
'<head>\n',
|
'<head>',
|
||||||
'<meta charset="utf-8">\n',
|
'<meta charset="utf-8">',
|
||||||
'<title><%= documentTitle %></title>\n',
|
'<title><%= documentTitle %></title>',
|
||||||
'<link rel="stylesheet" href="',
|
'<link rel="stylesheet" href="' + constants.MAIN_URL + 'res-min/themes/base.css" />',
|
||||||
constants.MAIN_URL,
|
'<script type="text/javascript" src="' + constants.MAIN_URL + 'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',
|
||||||
'res-min/themes/base.css" />\n',
|
'</head>',
|
||||||
'<script type="text/javascript" src="',
|
'<body><div class="container"><%= documentHTML %></div></body>',
|
||||||
constants.MAIN_URL,
|
|
||||||
'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
|
|
||||||
'</head>\n',
|
|
||||||
'<body><div class="container"><%= documentHTML %></div></body>\n',
|
|
||||||
'</html>'
|
'</html>'
|
||||||
].join(""),
|
].join('\n'),
|
||||||
pdfTemplate: [
|
pdfTemplate: [
|
||||||
'<!DOCTYPE html>\n',
|
'<!DOCTYPE html>',
|
||||||
'<html>\n',
|
'<html>',
|
||||||
'<head>\n',
|
'<head>',
|
||||||
'<meta charset="utf-8">\n',
|
'<meta charset="utf-8">',
|
||||||
'<title><%= documentTitle %></title>\n',
|
'<title><%= documentTitle %></title>',
|
||||||
'<link rel="stylesheet" href="',
|
'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />',
|
||||||
constants.MAIN_URL,
|
'<script type="text/x-mathjax-config">',
|
||||||
'res-min/themes/base.css" />\n',
|
'MathJax.Hub.Config({ messageStyle: "none" });',
|
||||||
'<script type="text/x-mathjax-config">\n',
|
'</script>',
|
||||||
'MathJax.Hub.Config({ messageStyle: "none" });\n',
|
'<script type="text/javascript" src="http://localhost/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',
|
||||||
'</script>\n',
|
'</head>',
|
||||||
'<script type="text/javascript" src="',
|
'<body><%= documentHTML %></body>',
|
||||||
constants.MAIN_URL,
|
|
||||||
'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n',
|
|
||||||
'</head>\n',
|
|
||||||
'<body><%= documentHTML %></body>\n',
|
|
||||||
'</html>'
|
'</html>'
|
||||||
].join(""),
|
].join('\n'),
|
||||||
pdfOptions: '{}',
|
pdfOptions: [
|
||||||
|
'{',
|
||||||
|
' "marginTop": 25,',
|
||||||
|
' "marginRight": 25,',
|
||||||
|
' "marginBottom": 25,',
|
||||||
|
' "marginLeft": 25,',
|
||||||
|
' "pageSize": "A4"',
|
||||||
|
'}'
|
||||||
|
].join('\n'),
|
||||||
sshProxy: constants.SSH_PROXY_URL,
|
sshProxy: constants.SSH_PROXY_URL,
|
||||||
extensionSettings: {}
|
extensionSettings: {}
|
||||||
};
|
};
|
||||||
|
@ -239,6 +239,21 @@ define([
|
|||||||
version = "v19";
|
version = "v19";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(version == 'v19') {
|
||||||
|
// Force new theme by using themeV4 variable
|
||||||
|
localStorage.removeItem("themeV3");
|
||||||
|
// Force welcome tour
|
||||||
|
localStorage.removeItem("welcomeTour");
|
||||||
|
if(_.has(localStorage, 'settings')) {
|
||||||
|
settings = JSON.parse(localStorage.settings);
|
||||||
|
// Remove PDF settings as it's a new web service
|
||||||
|
delete settings.pdfTemplate;
|
||||||
|
delete settings.pdfPageSize;
|
||||||
|
localStorage.settings = JSON.stringify(settings);
|
||||||
|
}
|
||||||
|
version = "v20";
|
||||||
|
}
|
||||||
|
|
||||||
localStorage.version = version;
|
localStorage.version = version;
|
||||||
return localStorage;
|
return localStorage;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user