App Todo - Init and HTML

This commit is contained in:
Nicolas Lemoine 2017-07-24 15:35:29 +03:00
parent 4345fc0662
commit a61faebb2b
2 changed files with 24 additions and 10 deletions

View File

@ -8,6 +8,15 @@
</head> </head>
<body class="loading-hidden"> <body class="loading-hidden">
<div id="toolbar" class="toolbar-container"></div> <div id="toolbar" class="toolbar-container"></div>
<div id="container">
<div class="create-form">
<input type="text" id="newTodoName" />
<button class="btn btn-success">Add the task</button>
</div>
<div class="tasks-list">
</div>
</div>
</body> </body>
</html> </html>

View File

@ -18,23 +18,28 @@ define([
var APP = window.APP = {}; var APP = window.APP = {};
$(function () { $(function () {
var andThen = function () { var $iframe = $('#pad-iframe').contents();
var ifrw = $('#pad-iframe')[0].contentWindow; var $body = $iframe.find('body');
var $iframe = $('#pad-iframe').contents(); var ifrw = $('#pad-iframe')[0].contentWindow;
var addTask = function () {}; var onReady = function () {
var addTask = function () {
};
var editTask = function () {}; var editTask = function () {};
var display = function () { var display = function () {
}; };
Cryptpad.removeLoadingScreen();
}; };
var onInit = function () { var onInit = function () {
Cryptpad.addLoadingScreen(); Cryptpad.addLoadingScreen();
var $body = $iframe.find('body');
$body.on('dragover', function (e) { e.preventDefault(); }); $body.on('dragover', function (e) { e.preventDefault(); });
$body.on('drop', function (e) { e.preventDefault(); }); $body.on('drop', function (e) { e.preventDefault(); });
@ -54,10 +59,6 @@ define([
APP.toolbar = Toolbar.create(configTb); APP.toolbar = Toolbar.create(configTb);
APP.toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar APP.toolbar.$rightside.html(''); // Remove the drawer if we don't use it to hide the toolbar
// we're in upload mode
Cryptpad.removeLoadingScreen();
andThen();
}; };
var createTodo = function() { var createTodo = function() {
@ -79,8 +80,12 @@ define([
userName: 'todo', userName: 'todo',
logLevel: 1, logLevel: 1,
}; };
var lm = APP.lm = Listmap.create(listmapConfig); var lm = APP.lm = Listmap.create(listmapConfig);
}
lm.proxy.on('create', onInit)
.on('ready', onReady);
};
Cryptpad.ready(function () { Cryptpad.ready(function () {
createTodo(); createTodo();