added today script into demo document

This commit is contained in:
azivner
2018-09-11 00:02:25 +02:00
parent 15610626f1
commit 947e875b6c
3 changed files with 4 additions and 1 deletions

View File

@@ -105,3 +105,4 @@ INSERT INTO notes VALUES('ZC78NlmdXeC6','Linux','',0,0,'2017-12-23T01:22:55.255Z
INSERT INTO notes VALUES('h4OfLEAYspud','Security','',0,0,'2017-12-23T04:04:00.715Z','2018-09-03T18:12:28.613Z','text','text/html','BiMTeajSw5');
INSERT INTO notes VALUES('QbL3pTvhgzM8','Processes','<p>bla bla ...</p>',0,0,'2017-12-23T04:06:43.841Z','2018-09-03T18:12:37.910Z','text','text/html','3ZbW13jHCM');
INSERT INTO notes VALUES('yK4SBJfwD3tY','Work','<p>Expand note on the left pane to see content.</p><p>&nbsp;</p><p>&nbsp;</p>',0,0,'2017-12-23T04:06:32.833Z','2018-08-29T18:23:35.049Z','text','text/html','my57OxteKd');
INSERT INTO notes VALUES('7YEYLSrnFpIi','Today',replace('api.addButtonToToolbar({\n title: ''Today'',\n icon: ''calendar'',\n shortcut: ''alt+t'',\n action: async function() {\n const todayDateStr = api.formatDateISO(new Date());\n\n const todayNote = await api.runOnServer(async todayDateStr => {\n return await api.getDateNote(todayDateStr);\n }, [todayDateStr]);\n\n const dateCreated = api.parseDate(todayNote.dateCreated);\n\n // newly created note isn''t in the tree cache yet\n if (new Date().getTime() - dateCreated.getTime() < 60 * 1000) {\n await api.refreshTree();\n }\n\n api.activateNote(todayNote.noteId);\n }\n});','\n',char(10)),0,0,'2018-09-10T22:00:30.550Z','2018-09-10T22:00:30.550Z','code','application/javascript;env=frontend','DsEGPQTtA3');