diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de4d1f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/index.html b/index.html index dc946d3..a7612c3 100644 --- a/index.html +++ b/index.html @@ -9,15 +9,30 @@ - + + +
Add Config
- + +
@@ -71,44 +86,27 @@
- - - + + - - - - - - - - - - - - - - - diff --git a/package.json b/package.json index 990f870..8f828e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PaperArxiv", - "version": "0.0.3", + "version": "0.0.4", "description": "A paper management tool", "main": "main.js", "scripts": { diff --git a/src/database.js b/src/database.js index 4ce9a1e..eebb993 100644 --- a/src/database.js +++ b/src/database.js @@ -93,7 +93,7 @@ function DBManager(ctx) { var regEx = new RegExp('(' + searchText + ')', "ig"); function searchAndReplace(attrList, newRow){ for (let key in ctx.showKeys){ - newRow[attrList[key]] = '

' + newRow[attrList[key]].toString().replace(regEx, '$1') + '

'; + newRow[attrList[key]] = '' + newRow[attrList[key]].toString().replace(regEx, '$1') + ''; } return newRow; } diff --git a/src/index.js b/src/index.js index 31933d9..4c1f4aa 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ ctx.dbManager = new DBManager(ctx); ctx.dbManager.loadFullData(); ctx.fullKeys = ['name', 'title', 'year', 'authors', 'tags', 'comment', 'comment', 'addTime', 'updateTime']; -ctx.showKeys = ['name', 'title', 'year', 'authors', 'tags', 'comment', 'updateTime']; +ctx.showKeys = ['name', 'title', 'year', 'authors', 'tags', 'comment', 'addTime','updateTime']; var emptyData = {} ctx.fullKeys.forEach(x => emptyData[x] = ""); var ItemEdit = { @@ -79,12 +79,16 @@ var ItemEdit = { shell.openItem(path.join(this.ctx.configSettings.libpath, val.replace(/<\/?[^>]+(>|$)/g, ""))); }, searchContent: function(value){ + this.userInputSearchText = value; if(this.userInputSearchText.length == 0){ ctx.ctor.tableData = utils.partialCopyArray(ctx.tableData, ctx.showKeys); }else{ ctx.dbManager.searchItemInfo(this.userInputSearchText); } }, + sortTableItem: function(x, y){ + return x.updateTime > y.updateTime; + }, editRowInfo: function(row){ ctx.ctor.itemEditFormVisible = true; ctx.updatePreviousItemName = row.name.replace(/<\/?[^>]+(>|$)/g, ""); @@ -115,6 +119,11 @@ document.addEventListener('keyup', function (e){ if (e.ctrlKey && e.keyCode == 82) { location.reload(true); }}, false); +document.addEventListener('keydown', function (e){ + if (e.keyCode == 27) { + document.getElementById("el-input-search").value = ""; + document.getElementById("el-input-clear-search").click(); + }}, false); // ======= set table size function updateWindowSize(){ var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;