diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 4f77432be..a0473e60a 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -365,5 +365,62 @@ define([ ])]; }; + var appToolbar = function () { + return h('div#toolbar.toolbar-container'); + }; + + Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () { + return [ + appToolbar(), + h('div#canvas-area', h('canvas#canvas', { + width: 600, + height: 600 + })), + h('div#controls', { + style: { + display: 'block', + } + }, [ + h('button#clear', Msg.canvas_clear), ' ', + h('button#toggleDraw', Msg.canvas_disable), + h('button#delete', { + style: { + display: 'none', + } + }), + h('input#width', { + type: 'range', + value: "5", + min: "1", + max: "100" + }), + h('label', { + 'for': 'width' + }, Msg.canvas_width), + h('input#opacity', { + type: 'range', + value: "1", + min: "0.1", + max: "1", + step: "0.1" + }), + h('label', { + 'for': 'width', + }), + h('span.selected') + ]), + setHTML(h('div#colors'), ' '), + loadingScreen(), + h('div#cursors', { + style: { + display: 'none', + background: 'white', + 'text-align': 'center', + } + }), + h('div#pickers'), + ]; + }; + return Pages; }); diff --git a/customize.dist/template.js b/customize.dist/template.js index 0fd412a03..24d859633 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -6,11 +6,13 @@ define([ 'css!/customize/main.css', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', - 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', ], function ($, h, Cryptpad, Pages) { $(function () { var Messages = Cryptpad.Messages; var $body = $('body'); + var isMainApp = function () { + return /^\/(pad|code|slide|poll|whiteboard)\//.test(location.pathname); + }; var rightLink = function (ref, loc, txt) { return h('span.link.right', [ @@ -113,11 +115,24 @@ $(function () { ])); var pathname = location.pathname; - if (/^\/(pad|code|slide|poll|whiteboard)\//.test(pathname)) { - // TODO load apps - return; + + + if (isMainApp()) { + if (typeof(Pages[pathname]) === 'function') { + $('body').html(h('body', Pages[pathname]()).innerHTML); + setTimeout(function () { + require(['/whiteboard/main.js'], function () { + $('body').removeClass('noscroll'); + }); + }); + return; + } } + require([ + 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', + ], function () {}); + $body.append($topbar).append($main).append($footer); if (/^\/settings\//.test(pathname)) { diff --git a/www/whiteboard/index.html b/www/whiteboard/index.html index 7311e5973..418a2aae5 100644 --- a/www/whiteboard/index.html +++ b/www/whiteboard/index.html @@ -3,43 +3,14 @@
- + - - + - - + -