From 561b514b8494de93787e875f42ba7765a65bb63f Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 29 Aug 2018 22:28:58 +0200 Subject: [PATCH] refactored promoted attribute change handler --- db/main_attributes.sql | 50 +++++++++++++- db/main_branches.sql | 67 +++++++++++++------ db/main_notes.sql | 23 +++++-- .../javascripts/services/note_detail.js | 45 +++++++------ 4 files changed, 135 insertions(+), 50 deletions(-) diff --git a/db/main_attributes.sql b/db/main_attributes.sql index 953f09f89..2eb91387a 100644 --- a/db/main_attributes.sql +++ b/db/main_attributes.sql @@ -90,10 +90,7 @@ INSERT INTO attributes VALUES('9bwMbu66bibw','WkdQrYTnsgxP','label','person','', INSERT INTO attributes VALUES('6oj5nftjfbBC','HgaAwBX5zVcP','label','originalFileName','chart.js',1,'2018-08-28T20:50:36.164Z','2018-08-28T20:50:36.164Z',0,'6nDd6oTR6B',0); INSERT INTO attributes VALUES('gZgmYZ9C4foc','HgaAwBX5zVcP','label','fileSize','211133',2,'2018-08-28T20:50:36.171Z','2018-08-28T20:50:36.171Z',0,'hHlFlDfuQP',0); INSERT INTO attributes VALUES('Fb8UazsIiOk5','Dyahpf7LroQY','label','taskLocationRoot','',0,'2018-08-28T20:50:48.604Z','2018-08-28T20:50:48.604Z',0,'DM2/m1t5TR',0); -INSERT INTO attributes VALUES('OVBlO7u40JOB','y4T7SoDx38PF','label','taskLocationNote','grocery',1,'2018-08-28T20:50:48.608Z','2018-08-28T20:50:48.608Z',0,'B0roTkAF/K',0); -INSERT INTO attributes VALUES('HbEbSPVo8Vio','fkkjOqepOiT6','label','taskLocationNote','tesco',1,'2018-08-28T20:50:48.612Z','2018-08-28T20:50:48.612Z',0,'SKe84zRWxF',0); INSERT INTO attributes VALUES('f0Ow5PJyhbYY','nUgD4SYx2gt7','label','taskTagRoot','',0,'2018-08-28T20:50:48.618Z','2018-08-28T20:50:48.618Z',0,'5MQeVb7i0Z',0); -INSERT INTO attributes VALUES('1zS3GmzvQEUa','UzutkVKVydIs','label','taskTagNote','groceries',1,'2018-08-28T20:50:48.621Z','2018-08-28T20:50:48.621Z',0,'InxlEEeVku',0); INSERT INTO attributes VALUES('6or0Gr0hFW2t','9HHqPxJkLAkl','label','taskDoneRoot','',0,'2018-08-28T20:50:48.626Z','2018-08-28T20:50:48.626Z',0,'e8MjtXx+UD',0); INSERT INTO attributes VALUES('pSVR4p5EM3i1','XVlWndK4Oh6A','label','run','frontendStartup',0,'2018-08-28T20:50:48.630Z','2018-08-28T20:50:48.630Z',0,'/Og2vneotj',0); INSERT INTO attributes VALUES('uSj6vDAaM3Z8','gYNJtGEPGW95','label','appCss','',0,'2018-08-28T20:50:48.636Z','2018-08-28T20:50:48.636Z',0,'TssM5mauP3',0); @@ -169,3 +166,50 @@ INSERT INTO attributes VALUES('cjrMaMByU8d7','Iha4YwchR413','label','weight','76 INSERT INTO attributes VALUES('06pEZahjSI3k','sXti7HgialF2','label','weight','76.1',2,'2018-08-29T17:32:36.358Z','2018-08-29T17:32:36.358Z',0,'d2oQY/Lj1b',0); INSERT INTO attributes VALUES('VdwPmuaTpT0T','MG0wntwILQW6','label','weight','75.9',2,'2018-08-29T17:32:18.592Z','2018-08-29T17:42:14.520Z',0,'tjceaSy8hu',0); INSERT INTO attributes VALUES('bPDbyj7wXvma','rUsGgtpohm7T','label','weight','75.6',2,'2018-08-29T17:32:24.677Z','2018-08-29T17:46:17.548Z',0,'uicNUs05DG',0); +INSERT INTO attributes VALUES('T9S7wfp2FvFV','uP3V8BqwXC05','label','task','',1,'2018-08-29T19:42:32.724Z','2018-08-29T19:42:32.724Z',0,'1I/LdG1tOp',0); +INSERT INTO attributes VALUES('Rlvwcmprsvq5','uP3V8BqwXC05','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:42:32.731Z','2018-08-29T19:42:32.731Z',0,'OzTsnqPj78',0); +INSERT INTO attributes VALUES('K6edZDy1VBTi','uP3V8BqwXC05','label','location','tesco',3,'2018-08-29T19:42:47.815Z','2018-08-29T19:42:47.815Z',0,'kevp3B5qMM',0); +INSERT INTO attributes VALUES('LTGKKLNRYSM6','Z4CC9azzMNhg','label','taskLocationNote','tesco',1,'2018-08-29T19:42:47.863Z','2018-08-29T19:42:47.863Z',0,'VXA4YOEPpK',0); +INSERT INTO attributes VALUES('J0g9ODCjbAOD','uP3V8BqwXC05','label','cssClass','todo',4,'2018-08-29T19:42:47.875Z','2018-08-29T19:42:47.875Z',0,'0mfYyV3m0Y',0); +INSERT INTO attributes VALUES('OmZAhWAt2bIe','uP3V8BqwXC05','label','tag','groceries',5,'2018-08-29T19:42:51.115Z','2018-08-29T19:42:51.115Z',0,'9CP3TeprnT',0); +INSERT INTO attributes VALUES('n2RHZ8Sl0lQF','q6A62bZE2R1r','label','taskTagNote','groceries',1,'2018-08-29T19:42:51.152Z','2018-08-29T19:42:51.152Z',0,'ke/5NXvA5v',0); +INSERT INTO attributes VALUES('01UuzuSR78Kj','uP3V8BqwXC05','label','todoDate','2017-12-22',6,'2018-08-29T19:43:01.973Z','2018-08-29T19:43:01.974Z',0,'EutrqW3a5b',0); +INSERT INTO attributes VALUES('ch6YD8XTrUr5','XoLNnnlwdjBi','label','task','',1,'2018-08-29T19:43:06.412Z','2018-08-29T19:43:06.412Z',0,'jQHXfhklXB',0); +INSERT INTO attributes VALUES('TZkneA5u23Kw','XoLNnnlwdjBi','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:43:06.432Z','2018-08-29T19:43:06.432Z',0,'0ePfOmtYfE',0); +INSERT INTO attributes VALUES('4TPlivzsoHPv','XoLNnnlwdjBi','label','location','mall',3,'2018-08-29T19:43:40.276Z','2018-08-29T19:43:40.276Z',0,'vh+2pYyK3U',0); +INSERT INTO attributes VALUES('FMUuvj9EqQaH','tQmqkQOMHgQJ','label','taskLocationNote','mall',1,'2018-08-29T19:43:40.327Z','2018-08-29T19:43:40.327Z',0,'BN9MF6o9qm',0); +INSERT INTO attributes VALUES('axCS9DyjSRmo','XoLNnnlwdjBi','label','cssClass','todo',4,'2018-08-29T19:43:40.339Z','2018-08-29T19:43:40.339Z',0,'HLfCqLKAbE',0); +INSERT INTO attributes VALUES('FPm7iK5b179Z','XoLNnnlwdjBi','label','tag','christmas',5,'2018-08-29T19:43:43.973Z','2018-08-29T19:43:43.973Z',0,'LSaUBtMo8z',0); +INSERT INTO attributes VALUES('Li7MCkVJwtoe','Lom0LEnCes1l','label','taskTagNote','christmas',1,'2018-08-29T19:43:44.030Z','2018-08-29T19:43:44.030Z',0,'3yDGaK13Ey',0); +INSERT INTO attributes VALUES('7hNexvifrZ9F','XoLNnnlwdjBi','label','todoDate','2017-12-20',6,'2018-08-29T19:43:50.837Z','2018-08-29T19:43:50.837Z',0,'+nJtkDbMMG',0); +INSERT INTO attributes VALUES('OllsfdAN2wCw','prjUbW6QtsL4','label','task','',1,'2018-08-29T19:46:42.152Z','2018-08-29T19:46:42.152Z',0,'TCfgA6DVBv',0); +INSERT INTO attributes VALUES('VjUlZR2yv2Vs','prjUbW6QtsL4','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:46:42.158Z','2018-08-29T19:46:42.158Z',0,'eFW+ARGCQN',0); +INSERT INTO attributes VALUES('yc58HTwoM3b0','prjUbW6QtsL4','label','todoDate','2017-12-20',3,'2018-08-29T19:47:53.123Z','2018-08-29T19:47:53.123Z',0,'UnKvGyVk7X',0); +INSERT INTO attributes VALUES('JVlFEQPYUiCR','prjUbW6QtsL4','label','doneDate','2017-12-18',5,'2018-08-29T19:48:00.928Z','2018-08-29T19:48:00.928Z',0,'nSVv39kafi',0); +INSERT INTO attributes VALUES('PwkDmazJTPAM','prjUbW6QtsL4','label','cssClass','done',6,'2018-08-29T19:48:00.986Z','2018-08-29T19:48:00.986Z',0,'JQ5wGmAqdM',0); +INSERT INTO attributes VALUES('Q3u9O4u2utP3','prjUbW6QtsL4','label','location','mall',7,'2018-08-29T19:49:13.815Z','2018-08-29T19:49:13.816Z',0,'JkBPyNcdpA',0); +INSERT INTO attributes VALUES('SMyP8V9L8vBj','prjUbW6QtsL4','label','tag','christmas',8,'2018-08-29T19:49:35.716Z','2018-08-29T19:49:35.717Z',0,'polIDXvbFh',0); +INSERT INTO attributes VALUES('T2HBEaDedUkK','EluAg7EiealE','label','task','',1,'2018-08-29T19:53:44.535Z','2018-08-29T19:53:44.535Z',0,'qLcD7/Sxu/',0); +INSERT INTO attributes VALUES('uXxiBvaawSxB','EluAg7EiealE','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:53:44.545Z','2018-08-29T19:53:44.546Z',0,'LYDxqtQ0oj',0); +INSERT INTO attributes VALUES('rPKq1auqgjne','EluAg7EiealE','label','location','gym',3,'2018-08-29T19:54:19.526Z','2018-08-29T19:54:19.527Z',0,'3D6MY7txSx',0); +INSERT INTO attributes VALUES('OlQapDHmPsvE','vkoNZlNO5TO4','label','taskLocationNote','gym',1,'2018-08-29T19:54:19.623Z','2018-08-29T19:54:19.624Z',0,'JjIloRX8Lj',0); +INSERT INTO attributes VALUES('isgI18Da7raL','EluAg7EiealE','label','cssClass','todo',4,'2018-08-29T19:54:19.645Z','2018-08-29T19:54:19.645Z',0,'oSAy7WDTd/',0); +INSERT INTO attributes VALUES('bueAaBOZaPR1','EluAg7EiealE','label','todoDate','2017-12-28',5,'2018-08-29T19:54:38.485Z','2018-08-29T19:55:04.592Z',0,'h8K/66xrrB',0); +INSERT INTO attributes VALUES('o9VzDlKJm2Wv','cUWgYJfpp8G8','relation','template','Lt8IUldw7d7H',2,'2018-08-29T19:55:04.668Z','2018-08-29T19:55:04.668Z',0,'mU4NSX5SfY',0); +INSERT INTO attributes VALUES('aAAKUP8Xzk84','cUWgYJfpp8G8','label','dateNote','2017-12-28',3,'2018-08-29T19:55:04.681Z','2018-08-29T19:55:04.681Z',0,'KkDCxAsM5x',0); +INSERT INTO attributes VALUES('Ts6QDZqcbOWK','cmYy3Z22F4MY','label','task','',1,'2018-08-29T19:56:35.634Z','2018-08-29T19:56:35.634Z',0,'9XyxVqr+mR',0); +INSERT INTO attributes VALUES('mi8JlZzzDMvf','cmYy3Z22F4MY','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:56:35.640Z','2018-08-29T19:56:35.640Z',0,'l8tpnd26SZ',0); +INSERT INTO attributes VALUES('xCrm8cWEAERo','cmYy3Z22F4MY','label','tag','health',3,'2018-08-29T19:57:02.217Z','2018-08-29T19:57:02.218Z',0,'gkz91AYO7M',0); +INSERT INTO attributes VALUES('EQgv8jgBGDeO','2V9Zg9CXdNvn','label','taskTagNote','health',1,'2018-08-29T19:57:02.276Z','2018-08-29T19:57:02.276Z',0,'T1LboUFYwM',0); +INSERT INTO attributes VALUES('2CLl7F07nrUX','cmYy3Z22F4MY','label','cssClass','done',7,'2018-08-29T19:57:11.866Z','2018-08-29T19:57:11.866Z',0,'U+xrckPbD4',0); +INSERT INTO attributes VALUES('L8QbHBtuWocN','cmYy3Z22F4MY','label','todoDate','2017-12-19',5,'2018-08-29T19:57:09.347Z','2018-08-29T19:57:33.998Z',0,'P+niQLnqtT',0); +INSERT INTO attributes VALUES('HWw4Q01cb9Re','cmYy3Z22F4MY','label','doneDate','2017-12-19',6,'2018-08-29T19:57:11.798Z','2018-08-29T19:57:39.255Z',0,'jGSCX/QklX',0); +INSERT INTO attributes VALUES('qwtBFzh0wmpe','XoLNnnlwdjBi','label','tag','shopping',7,'2018-08-29T19:58:59.083Z','2018-08-29T19:58:59.084Z',0,'Hw2zrl2NtD',0); +INSERT INTO attributes VALUES('AX3w15mAFRoB','d04CnuZxPXj2','label','taskTagNote','shopping',1,'2018-08-29T19:58:59.142Z','2018-08-29T19:58:59.142Z',0,'e0BBJ30IQ1',0); +INSERT INTO attributes VALUES('1cermfHB24bp','ve3Ib30x9nGf','label','task','',1,'2018-08-29T19:59:04.352Z','2018-08-29T19:59:04.352Z',0,'vFv8J/h5qJ',0); +INSERT INTO attributes VALUES('QlSQJcHlt3ZQ','ve3Ib30x9nGf','relation','template','HbtlYiMvmm4V',2,'2018-08-29T19:59:04.359Z','2018-08-29T19:59:04.360Z',0,'263XZD0Xpd',0); +INSERT INTO attributes VALUES('UPvlXSBXxRJv','ve3Ib30x9nGf','label','location','work',3,'2018-08-29T19:59:38.832Z','2018-08-29T19:59:38.832Z',0,'GufZy7QNVn',0); +INSERT INTO attributes VALUES('YngESU7G6T62','TTl2nD4CqzC9','label','taskLocationNote','work',1,'2018-08-29T19:59:38.890Z','2018-08-29T19:59:38.890Z',0,'FTH7CxVaB1',0); +INSERT INTO attributes VALUES('PEbrAcRaFOXE','ve3Ib30x9nGf','label','cssClass','todo',4,'2018-08-29T19:59:38.915Z','2018-08-29T19:59:38.915Z',0,'Xepyx9jFGP',0); +INSERT INTO attributes VALUES('cdSIp3FJ50vX','ve3Ib30x9nGf','label','todoDate','2017-12-18',5,'2018-08-29T19:59:46.829Z','2018-08-29T20:00:18.351Z',0,'TWZfKhjpe3',0); +INSERT INTO attributes VALUES('TZa1McDCnNHj','uP3V8BqwXC05','label','tag','shopping',7,'2018-08-29T20:01:47.691Z','2018-08-29T20:01:47.691Z',0,'kH6CGtIT/r',0); diff --git a/db/main_branches.sql b/db/main_branches.sql index acac34791..55b9fe985 100644 --- a/db/main_branches.sql +++ b/db/main_branches.sql @@ -1,8 +1,7 @@ INSERT INTO branches VALUES('root','root','none',0,NULL,1,0,'2018-01-01T00:00:00.000Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('dLgtLUFn3GoN','1Heh2acXfPNt','root',21,NULL,1,0,'2017-12-23T00:46:39.304Z','','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('QLfS835GSfIh','3RkyK9LI18dO','1Heh2acXfPNt',2,NULL,1,0,'2017-12-23T01:20:04.181Z','','1970-01-01T00:00:00.000Z'); +INSERT INTO branches VALUES('QLfS835GSfIh','3RkyK9LI18dO','1Heh2acXfPNt',2,NULL,0,0,'2017-12-23T01:20:04.181Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('wLTa2l3lYi83','HJusZTbBU494','3RkyK9LI18dO',1,NULL,1,0,'2017-12-23T01:20:50.709Z','','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',5,NULL,0,0,'2017-12-23T01:21:10.517Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('jvhKcwz4pYTr','ZC78NlmdXeC6','WdWZFuWNVDZk',0,NULL,1,0,'2017-12-23T04:06:21.579Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('CarTrwkGVcPz','NncfGH8dyNjJ','WdWZFuWNVDZk',1,NULL,0,0,'2017-12-23T04:06:24.012Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('6M7qPlr7at6N','eouCLkjbruai','NncfGH8dyNjJ',0,NULL,0,0,'2017-12-23T01:23:28.291Z','','1970-01-01T00:00:00.000Z'); @@ -20,9 +19,9 @@ INSERT INTO branches VALUES('C5ipVqeDWySp','9zSwD89vgzNO','8nRNDJGyGs2Z',0,NULL, INSERT INTO branches VALUES('uSitzbGcSATJ','u5t1EvWa3CMO','TjWEndYCCg7g',1,NULL,0,0,'2017-12-23T03:39:21.918Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('GZ6aRI8rdSJt','8nRNDJGyGs2Z','MG0wntwILQW6',1,'',0,0,'2017-12-23T03:42:28.310Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('uipfvAfwWRgx','6ZuXjCSWgjB4','HJusZTbBU494',0,NULL,0,0,'2017-12-23T03:44:54.096Z','','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('nMRpPWWH8WRk','GpGnjmcAPeWG','6ZuXjCSWgjB4',1,NULL,1,0,'2017-12-23T03:44:57.036Z','','1970-01-01T00:00:00.000Z'); +INSERT INTO branches VALUES('nMRpPWWH8WRk','GpGnjmcAPeWG','6ZuXjCSWgjB4',1,NULL,0,0,'2017-12-23T03:44:57.036Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('c4wt27WNjepw','21K84UqGhqlt','GpGnjmcAPeWG',0,NULL,0,0,'2017-12-23T03:45:10.933Z','','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('d8L8zYlLTbym','R6pheWjdwmNU','rz5t0r9Qr2WC',0,NULL,1,0,'2017-12-23T03:45:28.002Z','','1970-01-01T00:00:00.000Z'); +INSERT INTO branches VALUES('d8L8zYlLTbym','R6pheWjdwmNU','rz5t0r9Qr2WC',0,NULL,0,0,'2017-12-23T03:45:28.002Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('T4USGzfllu5t','5v5Dx6LMHXIO','Iha4YwchR413',0,NULL,0,0,'2017-12-23T03:45:44.184Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('c4JgFNIobvQW','MLQjmREtcnJ3','R6pheWjdwmNU',0,NULL,0,0,'2017-12-23T03:47:48.208Z','','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('nfWjptAU2ZDg','pTTjrxgnvURB','R6pheWjdwmNU',1,NULL,0,0,'2017-12-23T03:47:55.932Z','','1970-01-01T00:00:00.000Z'); @@ -61,19 +60,15 @@ INSERT INTO branches VALUES('vWch9vHEIsKw','OZKicr536m7U','YULCKCrWJJZ6',8,NULL, INSERT INTO branches VALUES('p07f522OT9FP','oato1D7kuNU2','YULCKCrWJJZ6',9,NULL,0,0,'2018-08-28T20:50:22.231Z','LQlWJmL3RR','2018-08-28T20:50:22.231Z'); INSERT INTO branches VALUES('03YszmiIfe8B','C1I7GPA8ORO4','YULCKCrWJJZ6',10,NULL,0,0,'2018-08-28T20:50:22.236Z','uNgEmMMv59','2018-08-28T20:50:22.236Z'); INSERT INTO branches VALUES('iZJMJE9v4caq','gQNQaMBzRYdb','YULCKCrWJJZ6',11,NULL,0,0,'2018-08-28T20:50:22.242Z','OIMswfv8u0','2018-08-28T20:50:22.242Z'); -INSERT INTO branches VALUES('BgakZWX2NSoa','8LOr7xUMuWD4','1Heh2acXfPNt',17,NULL,1,0,'2018-08-28T20:50:36.080Z','l6e868XpLw','2018-08-28T20:50:36.079Z'); +INSERT INTO branches VALUES('BgakZWX2NSoa','8LOr7xUMuWD4','1Heh2acXfPNt',17,NULL,0,0,'2018-08-28T20:50:36.080Z','l6e868XpLw','2018-08-28T20:50:36.079Z'); INSERT INTO branches VALUES('iRvWmIBZPmBV','NGSqsVZkg0Fb','kV2NwNNvepGF',0,NULL,1,0,'2018-08-28T20:50:36.107Z','TnumCb1pF9','2018-08-28T20:50:36.107Z'); INSERT INTO branches VALUES('9zW6GNyUrSwj','HgaAwBX5zVcP','kV2NwNNvepGF',1,NULL,0,0,'2018-08-28T20:50:36.140Z','IsmvjdfKeM','2018-08-28T20:50:36.139Z'); INSERT INTO branches VALUES('6yEXb5xSww7E','qEi5St9PBPCP','8LOr7xUMuWD4',3,NULL,0,0,'2018-08-28T20:50:36.154Z','wiqkXVJhDQ','2018-08-28T20:50:36.154Z'); -INSERT INTO branches VALUES('WFBrWWGubT8N','IYKhW6LTUpwP','1Heh2acXfPNt',19,NULL,1,0,'2018-08-28T20:50:48.458Z','KaPAe+LyvC','2018-08-28T20:50:48.458Z'); +INSERT INTO branches VALUES('WFBrWWGubT8N','IYKhW6LTUpwP','1Heh2acXfPNt',19,NULL,0,0,'2018-08-28T20:50:48.458Z','KaPAe+LyvC','2018-08-28T20:50:48.458Z'); INSERT INTO branches VALUES('VEq36SudFqDe','L9qettZi0csz','IYKhW6LTUpwP',0,NULL,1,0,'2018-08-28T20:50:48.471Z','74RNaEVH/C','2018-08-28T20:50:48.470Z'); -INSERT INTO branches VALUES('cnL65jQZPFng','Dyahpf7LroQY','IYKhW6LTUpwP',1,NULL,0,0,'2018-08-28T20:50:48.481Z','uY3Jzm+34n','2018-08-28T20:50:48.480Z'); -INSERT INTO branches VALUES('n8qX7Q64oDGk','y4T7SoDx38PF','Dyahpf7LroQY',0,NULL,0,0,'2018-08-28T20:50:48.488Z','FHwozkkN5A','2018-08-28T20:50:48.488Z'); -INSERT INTO branches VALUES('DouEcYR08fjx','fkkjOqepOiT6','Dyahpf7LroQY',1,NULL,0,0,'2018-08-28T20:50:48.501Z','M0tKNYjQCq','2018-08-28T20:50:48.501Z'); -INSERT INTO branches VALUES('jj5QAGAl31lB','nUgD4SYx2gt7','IYKhW6LTUpwP',2,NULL,0,0,'2018-08-28T20:50:48.507Z','sxhKcIO0Fo','2018-08-28T20:50:48.507Z'); -INSERT INTO branches VALUES('OliB53xAkLNj','UzutkVKVydIs','nUgD4SYx2gt7',0,NULL,0,0,'2018-08-28T20:50:48.520Z','VG+y2b7NdI','2018-08-28T20:50:48.520Z'); -INSERT INTO branches VALUES('NnybbW5xPPHO','9HHqPxJkLAkl','IYKhW6LTUpwP',3,NULL,0,0,'2018-08-28T20:50:48.529Z','y8vyVvJT4b','2018-08-28T20:50:48.529Z'); -INSERT INTO branches VALUES('H4uX5U8UA3Fb','hL4rychNFWZs','IYKhW6LTUpwP',4,NULL,1,0,'2018-08-28T20:50:48.539Z','8/KA289XO5','2018-08-28T20:50:48.539Z'); +INSERT INTO branches VALUES('cnL65jQZPFng','Dyahpf7LroQY','IYKhW6LTUpwP',2,NULL,1,0,'2018-08-28T20:50:48.481Z','uY3Jzm+34n','2018-08-28T20:50:48.480Z'); +INSERT INTO branches VALUES('jj5QAGAl31lB','nUgD4SYx2gt7','IYKhW6LTUpwP',4,NULL,0,0,'2018-08-28T20:50:48.507Z','sxhKcIO0Fo','2018-08-28T20:50:48.507Z'); +INSERT INTO branches VALUES('H4uX5U8UA3Fb','hL4rychNFWZs','IYKhW6LTUpwP',6,NULL,0,0,'2018-08-28T20:50:48.539Z','8/KA289XO5','2018-08-28T20:50:48.539Z'); INSERT INTO branches VALUES('r6XUe41mCgPY','gYVdjKAJeImD','hL4rychNFWZs',0,NULL,0,0,'2018-08-28T20:50:48.546Z','B8Zx5cyTRW','2018-08-28T20:50:48.546Z'); INSERT INTO branches VALUES('UPdB517CCSC6','vVhlPtM5YgWe','gYVdjKAJeImD',0,NULL,0,0,'2018-08-28T20:50:48.556Z','Ydd3hXIn5h','2018-08-28T20:50:48.556Z'); INSERT INTO branches VALUES('2lLNmlPp32DT','XVlWndK4Oh6A','hL4rychNFWZs',2,NULL,0,0,'2018-08-28T20:50:48.575Z','7KpHQIqICP','2018-08-28T20:50:48.575Z'); @@ -90,11 +85,43 @@ INSERT INTO branches VALUES('FIurtaYkU3mn','gDrEI7LFWqrP','1Heh2acXfPNt',18,NULL INSERT INTO branches VALUES('bryQseMhyzaI','IlULcDiOTI4K','1Heh2acXfPNt',1,NULL,0,0,'2018-08-29T17:10:47.987Z','wX6dY3pq/D','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('u84s3tBBB92g','TlGCAdcfxkOT','eXHZAKsMYgur',2,NULL,0,0,'2018-08-29T17:11:16.550Z','Ei4ozqDMWi','2018-08-29T17:11:16.550Z'); INSERT INTO branches VALUES('yMhwsE7uvEij','3oldoiMUPOlr','HJusZTbBU494',1,NULL,1,0,'2018-08-29T17:20:59.012Z','7U4pIRsbwO','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('NTlSXCbgt5Va','Lt8IUldw7d7H','3RkyK9LI18dO',2,NULL,0,0,'2018-08-29T17:23:45.198Z','QjebjIeHUj','2018-08-29T17:23:45.198Z'); -INSERT INTO branches VALUES('0fpnraUGs9Kl','rz5t0r9Qr2WC','HJusZTbBU494',2,NULL,1,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',4,NULL,0,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z'); -INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',3,NULL,0,0,'2018-08-29T17:29:02.035Z','FG9AB3f0/7','2018-08-29T17:29:02.035Z'); -INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,0,0,'2018-08-29T17:29:16.635Z','BhOH32oS5o','2018-08-29T17:29:16.635Z'); +INSERT INTO branches VALUES('NTlSXCbgt5Va','Lt8IUldw7d7H','3RkyK9LI18dO',3,NULL,0,0,'2018-08-29T17:23:45.198Z','QjebjIeHUj','2018-08-29T17:23:45.198Z'); +INSERT INTO branches VALUES('0fpnraUGs9Kl','rz5t0r9Qr2WC','HJusZTbBU494',2,NULL,0,0,'2018-08-29T17:26:27.928Z','rw9k0n9SUb','1970-01-01T00:00:00.000Z'); INSERT INTO branches VALUES('uMt25KxpV45Y','tX80udgxnW5n','3oldoiMUPOlr',1,NULL,0,0,'2018-08-29T17:29:24.554Z','XlDqz7PX7X','2018-08-29T17:29:24.554Z'); -INSERT INTO branches VALUES('IsCUFfM1QzHl','rUsGgtpohm7T','3oldoiMUPOlr',6,NULL,0,0,'2018-08-29T17:29:32.942Z','o8ZNDOfGSB','2018-08-29T17:29:32.942Z'); -INSERT INTO branches VALUES('UozNcoXYDovC','sXti7HgialF2','3oldoiMUPOlr',7,NULL,0,0,'2018-08-29T17:29:43.138Z','mDyppB0lkz','2018-08-29T17:29:43.138Z'); +INSERT INTO branches VALUES('IsCUFfM1QzHl','rUsGgtpohm7T','3oldoiMUPOlr',21,NULL,0,0,'2018-08-29T17:29:32.942Z','o8ZNDOfGSB','2018-08-29T17:29:32.942Z'); +INSERT INTO branches VALUES('UozNcoXYDovC','sXti7HgialF2','3oldoiMUPOlr',23,NULL,0,0,'2018-08-29T17:29:43.138Z','mDyppB0lkz','2018-08-29T17:29:43.138Z'); +INSERT INTO branches VALUES('3B2q1J0jymcC','uP3V8BqwXC05','L9qettZi0csz',0,NULL,0,0,'2018-08-29T19:42:32.718Z','fgHfgNl00Y','2018-08-29T19:42:32.718Z'); +INSERT INTO branches VALUES('tznJp79kaw59','Z4CC9azzMNhg','Dyahpf7LroQY',0,NULL,0,0,'2018-08-29T19:42:47.857Z','GPgoswIB8x','2018-08-29T19:42:47.856Z'); +INSERT INTO branches VALUES('akqrs7gHmh5t','uP3V8BqwXC05','Z4CC9azzMNhg',0,NULL,0,0,'2018-08-29T19:42:47.872Z','aoLg0gFrd/','2018-08-29T19:42:47.872Z'); +INSERT INTO branches VALUES('acVSG5Mau4XN','q6A62bZE2R1r','nUgD4SYx2gt7',0,NULL,0,0,'2018-08-29T19:42:51.139Z','V1TNeMyqD5','2018-08-29T19:42:51.139Z'); +INSERT INTO branches VALUES('Gd1QxgTLiOQx','uP3V8BqwXC05','q6A62bZE2R1r',0,NULL,0,0,'2018-08-29T19:42:51.161Z','FC79qQkyC3','2018-08-29T19:42:51.161Z'); +INSERT INTO branches VALUES('aCAgcqpOKx7z','XoLNnnlwdjBi','L9qettZi0csz',1,NULL,0,0,'2018-08-29T19:43:06.394Z','5tETh0Khcc','2018-08-29T19:43:06.394Z'); +INSERT INTO branches VALUES('ofME2yjEstZT','tQmqkQOMHgQJ','Dyahpf7LroQY',1,NULL,0,0,'2018-08-29T19:43:40.323Z','bRdu27+7TZ','2018-08-29T19:43:40.323Z'); +INSERT INTO branches VALUES('LfV9Vuv2KOYi','XoLNnnlwdjBi','tQmqkQOMHgQJ',0,NULL,0,0,'2018-08-29T19:43:40.335Z','blImjibA2C','2018-08-29T19:43:40.334Z'); +INSERT INTO branches VALUES('7XqFyRCCbbFR','Lom0LEnCes1l','nUgD4SYx2gt7',1,NULL,0,0,'2018-08-29T19:43:44.024Z','/4YLa/r5CT','2018-08-29T19:43:44.024Z'); +INSERT INTO branches VALUES('mSyNlVSA6WRX','XoLNnnlwdjBi','Lom0LEnCes1l',0,NULL,0,0,'2018-08-29T19:43:44.040Z','kQy9lC8qmF','2018-08-29T19:43:44.039Z'); +INSERT INTO branches VALUES('q735AeBxPj1T','ydix6JqjXiUm','XoLNnnlwdjBi',0,NULL,0,0,'2018-08-29T19:46:03.357Z','5eoW9KyskY','2018-08-29T19:46:03.356Z'); +INSERT INTO branches VALUES('fmm6YcEBxv8T','prjUbW6QtsL4','9HHqPxJkLAkl',0,NULL,0,0,'2018-08-29T19:48:00.972Z','JMdLMCDy2J','2018-08-29T19:48:00.972Z'); +INSERT INTO branches VALUES('NnybbW5xPPHO','9HHqPxJkLAkl','IYKhW6LTUpwP',1,NULL,0,0,'2018-08-29T19:48:05.277Z','FirAueCkjs','2018-08-28T20:50:48.529Z'); +INSERT INTO branches VALUES('KgPU7QD19kBk','prjUbW6QtsL4','tX80udgxnW5n',0,'DONE',NULL,0,'2018-08-29T19:48:00.995Z','HPvrpaEQO7','2018-08-29T19:48:00.995Z'); +INSERT INTO branches VALUES('Fq4TqKTo93aK','EluAg7EiealE','L9qettZi0csz',2,NULL,0,0,'2018-08-29T19:53:44.530Z','mJCxaZ1mlW','2018-08-29T19:53:44.530Z'); +INSERT INTO branches VALUES('2dac99oNkdH3','vkoNZlNO5TO4','Dyahpf7LroQY',2,NULL,0,0,'2018-08-29T19:54:19.618Z','fN3DqnjcUb','2018-08-29T19:54:19.618Z'); +INSERT INTO branches VALUES('8aSc0sibmCZm','EluAg7EiealE','vkoNZlNO5TO4',0,NULL,0,0,'2018-08-29T19:54:19.637Z','RpUFzJs2RD','2018-08-29T19:54:19.637Z'); +INSERT INTO branches VALUES('uMnwVhwtdXZg','cUWgYJfpp8G8','3oldoiMUPOlr',24,NULL,0,0,'2018-08-29T19:55:04.661Z','ZMEYWKhIhB','2018-08-29T19:55:04.661Z'); +INSERT INTO branches VALUES('kS7GsSvztE1J','EluAg7EiealE','cUWgYJfpp8G8',0,'TODO',NULL,0,'2018-08-29T19:55:04.691Z','72zbNyyFRw','2018-08-29T19:54:38.626Z'); +INSERT INTO branches VALUES('EjQTcVVHFmmZ','MG0wntwILQW6','3oldoiMUPOlr',19,NULL,0,0,'2018-08-29T19:55:53.824Z','bx2z9074Vi','1970-01-01T00:00:00.000Z'); +INSERT INTO branches VALUES('HsN4600rQoL9','Iha4YwchR413','3oldoiMUPOlr',17,NULL,0,0,'2018-08-29T17:26:52.528Z','GBlVZxHhto','1970-01-01T00:00:00.000Z'); +INSERT INTO branches VALUES('fQ2BsgDWdqoE','1Fi3MpUkZkLk','3oldoiMUPOlr',16,NULL,0,0,'2018-08-29T19:56:00.793Z','tk6763xjRL','2018-08-29T17:29:02.035Z'); +INSERT INTO branches VALUES('Sv77hHzVZvdw','cwPuYRAGKtUi','3oldoiMUPOlr',2,NULL,0,0,'2018-08-29T19:56:04.404Z','Uwn3W1Q8py','2018-08-29T17:29:16.635Z'); +INSERT INTO branches VALUES('kPZLi2VKVjQ1','2V9Zg9CXdNvn','nUgD4SYx2gt7',2,NULL,0,0,'2018-08-29T19:57:02.270Z','v0dB+4MnXy','2018-08-29T19:57:02.270Z'); +INSERT INTO branches VALUES('9nEK1jBKqdL7','cmYy3Z22F4MY','9HHqPxJkLAkl',1,NULL,0,0,'2018-08-29T19:57:11.828Z','P7AvZh6VlN','2018-08-29T19:57:11.828Z'); +INSERT INTO branches VALUES('HVvl5lR3Db7p','cmYy3Z22F4MY','cwPuYRAGKtUi',1,'DONE',NULL,0,'2018-08-29T19:57:39.314Z','dZK0rWy9IN','2018-08-29T19:57:11.876Z'); +INSERT INTO branches VALUES('iTtVoNfVBdex','d04CnuZxPXj2','nUgD4SYx2gt7',3,NULL,1,0,'2018-08-29T19:58:59.136Z','AWKJ2Bzv6u','2018-08-29T19:58:59.136Z'); +INSERT INTO branches VALUES('bPQksNkJmvLR','XoLNnnlwdjBi','d04CnuZxPXj2',0,NULL,0,0,'2018-08-29T19:58:59.150Z','bMHPa6tOOV','2018-08-29T19:58:59.150Z'); +INSERT INTO branches VALUES('eoWt4fWm0sW3','XoLNnnlwdjBi','1Fi3MpUkZkLk',0,'TODO',NULL,0,'2018-08-29T19:43:50.887Z','Dq9p08n0+S','2018-08-29T19:43:50.887Z'); +INSERT INTO branches VALUES('lMn7U8E3HcM8','ve3Ib30x9nGf','L9qettZi0csz',3,NULL,0,0,'2018-08-29T19:59:04.336Z','9uxcfSBqQm','2018-08-29T19:59:04.336Z'); +INSERT INTO branches VALUES('No0w47P6V5NU','TTl2nD4CqzC9','Dyahpf7LroQY',3,NULL,0,0,'2018-08-29T19:59:38.884Z','Po5wJqpzvR','2018-08-29T19:59:38.884Z'); +INSERT INTO branches VALUES('0TOuqT1KIYRZ','ve3Ib30x9nGf','TTl2nD4CqzC9',0,NULL,0,0,'2018-08-29T19:59:38.901Z','jjfsd5sCg4','2018-08-29T19:59:38.901Z'); +INSERT INTO branches VALUES('5dNoZxDbyGLR','ve3Ib30x9nGf','tX80udgxnW5n',0,'TODO',NULL,0,'2018-08-29T20:00:18.428Z','YrUH6cdlZO','2018-08-29T19:59:47.032Z'); +INSERT INTO branches VALUES('mTe83gvO9fsQ','uP3V8BqwXC05','d04CnuZxPXj2',1,NULL,0,0,'2018-08-29T20:01:47.773Z','2uPfZok3xo','2018-08-29T20:01:47.772Z'); +INSERT INTO branches VALUES('5OwmqXXREhwW','uP3V8BqwXC05','MG0wntwILQW6',2,'TODO',NULL,0,'2018-08-29T19:43:02.012Z','y+j8i/4GSy','2018-08-29T19:43:02.012Z'); diff --git a/db/main_notes.sql b/db/main_notes.sql index 3c2b4d315..4f6259618 100644 --- a/db/main_notes.sql +++ b/db/main_notes.sql @@ -54,10 +54,7 @@ INSERT INTO notes VALUES('HgaAwBX5zVcP','chartjs',X'2f2a210a202a2043686172742e6a INSERT INTO notes VALUES('IYKhW6LTUpwP','Task manager',replace('

Intro

\n

This is a simple example of 

','\n',char(10)),0,0,'2018-08-28T20:50:48.441Z','2018-08-28T20:50:48.441Z','text','text/html','xffZ47OsiP'); INSERT INTO notes VALUES('L9qettZi0csz','TODO','',0,0,'2018-08-28T20:50:48.468Z','2018-08-28T20:50:48.468Z','text','text/html','pYhbMrsilQ'); INSERT INTO notes VALUES('Dyahpf7LroQY','Locations','',0,0,'2018-08-28T20:50:48.478Z','2018-08-28T20:50:48.478Z','text','text/html','T5ttXvR2+2'); -INSERT INTO notes VALUES('y4T7SoDx38PF','grocery','',0,0,'2018-08-28T20:50:48.486Z','2018-08-28T20:50:48.486Z','text','text/html','vob1eTuqMJ'); -INSERT INTO notes VALUES('fkkjOqepOiT6','tesco','',0,0,'2018-08-28T20:50:48.499Z','2018-08-28T20:50:48.499Z','text','text/html','ijhqgaquSu'); INSERT INTO notes VALUES('nUgD4SYx2gt7','Tags','',0,0,'2018-08-28T20:50:48.506Z','2018-08-28T20:50:48.506Z','text','text/html','f5a1WP0Pz5'); -INSERT INTO notes VALUES('UzutkVKVydIs','groceries','',0,0,'2018-08-28T20:50:48.518Z','2018-08-28T20:50:48.518Z','text','text/html','1S5rmr2hVm'); INSERT INTO notes VALUES('9HHqPxJkLAkl','Done','',0,0,'2018-08-28T20:50:48.527Z','2018-08-28T20:50:48.527Z','text','text/html','3M1b9ysLaG'); INSERT INTO notes VALUES('hL4rychNFWZs','Implementation','',0,0,'2018-08-28T20:50:48.537Z','2018-08-28T20:50:48.537Z','text','text/html','8fnUKl/ty7'); INSERT INTO notes VALUES('vVhlPtM5YgWe','reconcileAssignments',replace('module.exports = async function(note, categoryRootNote, assignedCategories, labelName, isTaskDone) {\n const found = {};\n \n for (const categoryNote of await categoryRootNote.getChildNotes()) {\n const label = await categoryNote.getLabel(labelName);\n \n if (label) {\n found[label.value] = !isTaskDone && assignedCategories.includes(label.value);\n\n await api.toggleNoteInParent(found[label.value], note.noteId, categoryNote.noteId);\n }\n }\n \n if (!isTaskDone) {\n for (const assignedCategory of assignedCategories) {\n if (!found[assignedCategory]) {\n const categoryNote = (await api.createNote(categoryRootNote.noteId, assignedCategory, "", {\n attributes: [ { type: "label", name: labelName, value: assignedCategory } ]\n })).note;\n\n await api.ensureNoteIsPresentInParent(note.noteId, categoryNote.noteId);\n }\n }\n }\n}','\n',char(10)),0,0,'2018-08-28T20:50:48.554Z','2018-08-28T20:50:48.554Z','code','application/javascript;env=backend','4jq+oVoENR'); @@ -82,8 +79,6 @@ INSERT INTO notes VALUES('eXHZAKsMYgur','Books','

Expand note on the left pane INSERT INTO notes VALUES('Lt8IUldw7d7H','Day template','',0,0,'2018-08-29T17:23:45.189Z','2018-08-29T17:23:52.521Z','text','text/html','1V3BTW/Qzw'); INSERT INTO notes VALUES('GpGnjmcAPeWG','28 - Tuesday','',0,0,'2017-12-23T03:44:57.036Z','2018-08-29T17:28:22.525Z','text','text/html','JdiPCl+HVd'); INSERT INTO notes VALUES('Iha4YwchR413','21 - Thursday','',0,0,'2017-12-23T03:44:21.176Z','2018-08-29T17:28:27.526Z','text','text/html','nf9l6wd8vt'); -INSERT INTO notes VALUES('MG0wntwILQW6','22 - Friday','

Daily summary

',0,0,'2017-12-23T01:21:10.517Z','2018-08-29T17:28:32.520Z','text','text/html','OkviiLoTGu'); -INSERT INTO notes VALUES('cwPuYRAGKtUi','19 - Tuesday','',0,0,'2018-08-29T17:29:16.628Z','2018-08-29T17:29:24.733Z','text','text/html','zzBNYSR1hq'); INSERT INTO notes VALUES('tX80udgxnW5n','18 - Monday','',0,0,'2018-08-29T17:29:24.548Z','2018-08-29T17:29:30.389Z','text','text/html','pADkQHkGIg'); INSERT INTO notes VALUES('rUsGgtpohm7T','23 - Saturday','',0,0,'2018-08-29T17:29:32.934Z','2018-08-29T17:29:42.287Z','text','text/html','BugaZKKDJ+'); INSERT INTO notes VALUES('sXti7HgialF2','24 - Sunday - Christmas Eve!','',0,0,'2018-08-29T17:29:43.127Z','2018-08-29T17:29:57.523Z','text','text/html','RfShVwTOAB'); @@ -91,3 +86,21 @@ INSERT INTO notes VALUES('1Fi3MpUkZkLk','20 - Wednesday','',0,0,'2018-08-29T17:2 INSERT INTO notes VALUES('kV2NwNNvepGF','js',replace('const ctx = $("#canvas")[0].getContext("2d");\n\nnew chartjs.Chart(ctx, {\n type: ''line'',\n data: await getChartData()\n});','\n',char(10)),0,0,'2018-08-28T20:50:36.092Z','2018-08-29T17:33:52.529Z','code','application/javascript;env=frontend','agNnVWkuJY'); INSERT INTO notes VALUES('NGSqsVZkg0Fb','getChartData',replace('module.exports = async function() {\n const days = await api.runOnServer(async () => {\n const notes = await api.getNotesWithLabel(''weight'');\n const days = [];\n\n for (const note of notes) {\n const date = await note.getLabelValue(''dateNote'');\n const weight = parseFloat(await note.getLabelValue(''weight''));\n\n if (date && weight) {\n days.push({ date, weight });\n }\n }\n\n days.sort((a, b) => a.date > b.date ? 1 : -1);\n\n return days;\n });\n\n const datasets = [\n {\n label: "Weight (kg)",\n backgroundColor: ''red'',\n borderColor: ''red'',\n data: days.map(day => day.weight),\n fill: false,\n spanGaps: true,\n datalabels: {\n display: false\n }\n }\n ];\n\n return {\n datasets: datasets,\n labels: days.map(day => day.date)\n };\n}','\n',char(10)),0,0,'2018-08-28T20:50:36.105Z','2018-08-29T17:46:00.512Z','code','application/javascript;env=frontend','+Qo8EFUUf9'); INSERT INTO notes VALUES('yK4SBJfwD3tY','Work','

Expand note on the left pane to see content.

 

 

',0,0,'2017-12-23T04:06:32.833Z','2018-08-29T18:23:35.049Z','text','text/html','my57OxteKd'); +INSERT INTO notes VALUES('uP3V8BqwXC05','Buy milk','',0,0,'2018-08-29T19:42:32.712Z','2018-08-29T19:42:38.958Z','text','text/html','PGFo1+haU8'); +INSERT INTO notes VALUES('Z4CC9azzMNhg','tesco','',0,0,'2018-08-29T19:42:47.853Z','2018-08-29T19:42:47.853Z','text','text/html','I6EArEtFH/'); +INSERT INTO notes VALUES('q6A62bZE2R1r','groceries','',0,0,'2018-08-29T19:42:51.137Z','2018-08-29T19:42:51.137Z','text','text/html','mSbxrm1pq+'); +INSERT INTO notes VALUES('tQmqkQOMHgQJ','mall','',0,0,'2018-08-29T19:43:40.321Z','2018-08-29T19:43:40.321Z','text','text/html','tRORZ6Y92z'); +INSERT INTO notes VALUES('Lom0LEnCes1l','christmas','',0,0,'2018-08-29T19:43:44.020Z','2018-08-29T19:43:44.020Z','text','text/html','V8diNwZGLR'); +INSERT INTO notes VALUES('ydix6JqjXiUm','Maybe Black Swan?','

https://en.wikipedia.org/wiki/The_Black_Swan:_The_Impact_of_the_Highly_Improbable

 

The Black Swan: The Impact of the Highly Improbable is a 2007 book by author and former options trader Nassim Nicholas Taleb. The book focuses on the extreme impact of rare and unpredictable outlier events — and the human tendency to find simplistic explanations for these events, retrospectively. Taleb calls this the Black Swan theory.

',0,0,'2018-08-29T19:46:03.348Z','2018-08-29T19:46:18.965Z','text','text/html','ma55jm1LJ6'); +INSERT INTO notes VALUES('XoLNnnlwdjBi','Buy some book for Bob','

Bob likes to read popular science books so something like that ..

',0,0,'2018-08-29T19:43:06.385Z','2018-08-29T19:46:33.959Z','text','text/html','/8VtxyCmab'); +INSERT INTO notes VALUES('prjUbW6QtsL4','Buy a board game for Alice','',0,0,'2018-08-29T19:46:42.135Z','2018-08-29T19:47:43.954Z','text','text/html','c0hI1KRILc'); +INSERT INTO notes VALUES('EluAg7EiealE','Get a gym membership','

Just in time for new years resolution!

',0,0,'2018-08-29T19:53:44.526Z','2018-08-29T19:54:18.702Z','text','text/html','/UwbTs3YGO'); +INSERT INTO notes VALUES('vkoNZlNO5TO4','gym','',0,0,'2018-08-29T19:54:19.614Z','2018-08-29T19:54:19.614Z','text','text/html','6ZdjkVrgjU'); +INSERT INTO notes VALUES('cUWgYJfpp8G8','28 - Thursday','',0,0,'2018-08-29T19:55:04.659Z','2018-08-29T19:55:04.659Z','text','text/html','g96BaV8SGj'); +INSERT INTO notes VALUES('cmYy3Z22F4MY','Dentist appointment','',0,0,'2018-08-29T19:56:35.605Z','2018-08-29T19:56:43.698Z','text','text/html','rNyV4tYv7n'); +INSERT INTO notes VALUES('2V9Zg9CXdNvn','health','',0,0,'2018-08-29T19:57:02.268Z','2018-08-29T19:57:02.268Z','text','text/html','QQYGpa/4DF'); +INSERT INTO notes VALUES('d04CnuZxPXj2','shopping','',0,0,'2018-08-29T19:58:59.133Z','2018-08-29T19:58:59.133Z','text','text/html','wWU276L2X9'); +INSERT INTO notes VALUES('TTl2nD4CqzC9','work','',0,0,'2018-08-29T19:59:38.878Z','2018-08-29T19:59:38.878Z','text','text/html','hIuAZE3DRY'); +INSERT INTO notes VALUES('ve3Ib30x9nGf','Send invites for christmas party','',0,0,'2018-08-29T19:59:04.328Z','2018-08-29T19:59:39.777Z','text','text/html','d1/wzQEAwD'); +INSERT INTO notes VALUES('MG0wntwILQW6','22 - Friday','',0,0,'2017-12-23T01:21:10.517Z','2018-08-29T20:01:14.789Z','text','text/html','Jus3ysHko7'); +INSERT INTO notes VALUES('cwPuYRAGKtUi','19 - Tuesday','',0,0,'2018-08-29T17:29:16.628Z','2018-08-29T17:29:24.733Z','text','text/html','zzBNYSR1hq'); diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index 7a449f10b..c07c9b84e 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -265,7 +265,8 @@ async function showAttributes() { .prop("attribute-name", valueAttr.name) .prop("value", valueAttr.value) .addClass("form-control") - .addClass("promoted-attribute-input"); + .addClass("promoted-attribute-input") + .change(promotedAttributeChanged); idx++; @@ -463,27 +464,7 @@ async function showAttributes() { return attributes; } -async function loadNote(noteId) { - const row = await server.get('notes/' + noteId); - - return new NoteFull(treeCache, row); -} - -function focus() { - const note = getCurrentNote(); - - getComponent(note.type).focus(); -} - -messagingService.subscribeToSyncMessages(syncData => { - if (syncData.some(sync => sync.entityName === 'notes' && sync.entityId === getCurrentNoteId())) { - infoService.showMessage('Reloading note because of background changes'); - - reload(); - } -}); - -$promotedAttributesContainer.on('change', '.promoted-attribute-input', async event => { +async function promotedAttributeChanged(event) { const $attr = $(event.target); let value; @@ -510,6 +491,26 @@ $promotedAttributesContainer.on('change', '.promoted-attribute-input', async eve $attr.prop("attribute-id", result.attributeId); infoService.showMessage("Attribute has been saved."); +} + +async function loadNote(noteId) { + const row = await server.get('notes/' + noteId); + + return new NoteFull(treeCache, row); +} + +function focus() { + const note = getCurrentNote(); + + getComponent(note.type).focus(); +} + +messagingService.subscribeToSyncMessages(syncData => { + if (syncData.some(sync => sync.entityName === 'notes' && sync.entityId === getCurrentNoteId())) { + infoService.showMessage('Reloading note because of background changes'); + + reload(); + } }); $(document).ready(() => {