mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-13 22:57:22 +00:00
@@ -18,9 +18,9 @@
|
||||
<link href="public/css-libs/ztree/zTreeStyle.css" rel="stylesheet" />
|
||||
|
||||
<!-- mdeditor -->
|
||||
<link href="public/md/themes/mdeditor.css" rel="stylesheet" />
|
||||
<link href="public/themes/markdown/meditor.css" rel="stylesheet" />
|
||||
<!-- markdown theme -->
|
||||
<link rel="stylesheet" href="public/md/themes/themes/default/theme.css" type="text/css" id="md-theme"/>
|
||||
<link rel="stylesheet" href="public/themes/markdown/default/index.css" type="text/css" id="md-theme"/>
|
||||
|
||||
<!-- theme -->
|
||||
<link rel="stylesheet" href="public/themes/default.css" type="text/css"/>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
var Config = {
|
||||
"plugins": [
|
||||
"theme",
|
||||
"md_theme",
|
||||
"import_leanote",
|
||||
"import_evernote",
|
||||
"export_pdf",
|
||||
|
@@ -27,20 +27,19 @@ define(function() {
|
||||
_themes: [],
|
||||
getThemes: function() {
|
||||
var me = this;
|
||||
|
||||
// 遍历主题目录, 得到主题
|
||||
var themeBasePath = __dirname + "/public/md/themes/themes";
|
||||
var dirs = Api.nodeFs.readdirSync(themeBasePath);
|
||||
for(var i = 0; i < dirs.length; ++i) {
|
||||
var dir = dirs[i]; // 名称
|
||||
|
||||
me._themeMap[dir] = {
|
||||
name: dir, // 主题名称
|
||||
dir: dir
|
||||
};
|
||||
|
||||
me._themes.push(me._themeMap[dir]);
|
||||
}
|
||||
// 遍历主题目录, 得到主题列表
|
||||
var themeFolder = __dirname + "/public/themes/markdown";
|
||||
Api.nodeFs.readdirSync(themeFolder)
|
||||
.filter(function(theme) {
|
||||
return Api.nodeFs.statSync(themeFolder + "/" + theme).isDirectory();
|
||||
})
|
||||
.forEach(function(theme) {
|
||||
me._themeMap[theme] = {
|
||||
name: theme, // 主题名称
|
||||
dir: theme
|
||||
};
|
||||
me._themes.push(me._themeMap[theme]);
|
||||
});
|
||||
},
|
||||
|
||||
// 改变主题
|
||||
@@ -48,7 +47,7 @@ define(function() {
|
||||
var me = this;
|
||||
themeDir || (themeDir = 'default');
|
||||
themeDir = themeDir.toLowerCase();
|
||||
$('#md-theme').attr('href', 'public/md/themes/themes/' + themeDir + '/theme.css');
|
||||
$('#md-theme').attr('href', 'public/themes/markdown/' + themeDir + '/index.css');
|
||||
|
||||
Config.mdTheme = themeDir;
|
||||
var ok = Api.writeConfig(Config);
|
||||
|
Reference in New Issue
Block a user