Set default settings for v4

This commit is contained in:
benweet 2014-08-19 09:17:27 +01:00
parent 143e90cedd
commit 1231b26710
3 changed files with 48 additions and 33 deletions

View File

@ -178,7 +178,7 @@ catch(e) {
window.viewerMode = /(^| )viewer($| )/.test(document.body.className);
// Keep the theme in a global variable
window.theme = localStorage.themeV3 || 'default';
window.theme = localStorage.themeV4 || 'default';
var themeModule = "less!themes/" + window.theme;
if(window.baseDir.indexOf('-min') !== -1) {
themeModule = "css!themes/" + window.theme;

View File

@ -21,41 +21,41 @@ define([
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',
'<!DOCTYPE html>',
'<html>',
'<head>',
'<meta charset="utf-8">',
'<title><%= documentTitle %></title>',
'<link rel="stylesheet" href="' + constants.MAIN_URL + 'res-min/themes/base.css" />',
'<script type="text/javascript" src="' + constants.MAIN_URL + 'libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',
'</head>',
'<body><div class="container"><%= documentHTML %></div></body>',
'</html>'
].join(""),
].join('\n'),
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><%= documentHTML %></body>\n',
'<!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>',
'<script type="text/javascript" src="http://localhost/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',
'</head>',
'<body><%= documentHTML %></body>',
'</html>'
].join(""),
pdfOptions: '{}',
].join('\n'),
pdfOptions: [
'{',
' "marginTop": 25,',
' "marginRight": 25,',
' "marginBottom": 25,',
' "marginLeft": 25,',
' "pageSize": "A4"',
'}'
].join('\n'),
sshProxy: constants.SSH_PROXY_URL,
extensionSettings: {}
};

View File

@ -239,6 +239,21 @@ define([
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;
return localStorage;
});