From 4345fc0662748f5eb6845ab65443204ef01546cf Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 24 Jul 2017 14:13:47 +0200 Subject: [PATCH] Todo app --- www/todo/main.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/www/todo/main.js b/www/todo/main.js index 9df26de86..a6b57f3e7 100644 --- a/www/todo/main.js +++ b/www/todo/main.js @@ -21,22 +21,26 @@ define([ var andThen = function () { var ifrw = $('#pad-iframe')[0].contentWindow; var $iframe = $('#pad-iframe').contents(); - var $body = $iframe.find('body'); + var addTask = function () {}; + + var editTask = function () {}; + + var display = function () { + + }; + }; + + var onInit = function () { + Cryptpad.addLoadingScreen(); + + var $body = $iframe.find('body'); $body.on('dragover', function (e) { e.preventDefault(); }); $body.on('drop', function (e) { e.preventDefault(); }); - Cryptpad.addLoadingScreen(); - var Title; var $bar = $iframe.find('.toolbar-container'); - var secret; - if (window.location.hash) { - secret = Cryptpad.getSecrets(); - if (!secret.keys) { throw new Error("You need a hash"); } // TODO - } - Title = Cryptpad.createTitle({}, function(){}, Cryptpad); var configTb = { @@ -53,6 +57,7 @@ define([ // we're in upload mode Cryptpad.removeLoadingScreen(); + andThen(); }; var createTodo = function() { @@ -63,7 +68,7 @@ define([ hash = obj.todo; } - Cryptpad.getSecrets('todo', hash); + var secret = Cryptpad.getSecrets('todo', hash); var listmapConfig = { data: {}, @@ -74,12 +79,12 @@ define([ userName: 'todo', logLevel: 1, }; - var lm = Listmap.create(listmapConfig); + var lm = APP.lm = Listmap.create(listmapConfig); } Cryptpad.ready(function () { - andThen(); - //Cryptpad.reportAppUsage(); + createTodo(); + Cryptpad.reportAppUsage(); }); });