diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 7bc03f71a..de0a9968a 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -99,7 +99,7 @@ define([ h('button.navbar-toggler.navbar-toggler-right', {'type':'button'}, {'data-toggle':'collapse'}, {'data-target':'#menuCollapse'}, {'aria-controls': 'menuCollapse'}, {'aria-expanded':'false'}, {'aria-label':'Toggle navigation'}, [h('i.fa.fa-bars ') ]), - h('a.navbar-brand', { href: '/'}), + h('a.navbar-brand', { href: '/index.html'}), h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [ h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.topbar_whatIsCryptpad), h('a.nav-item.nav-link', { href: 'https://blog.cryptpad.fr/'}, Msg.blog), diff --git a/www/code/main.js b/www/code/main.js index ebdd52ede..36f734d0f 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -61,6 +61,20 @@ define([ $iframe.find('.CodeMirror').addClass('fullPage'); editor = CodeMirror.editor; + var setIndentation = APP.setIndentation = function (units) { + if (typeof(units) !== 'number') { return; } + editor.setOption('indentUnit', units); + editor.setOption('tabSize', units); + //editor.setOption('indentWithTabs', true); + }; + + var indentKey = 'cryptpad.indentUnit'; + var proxy = Cryptpad.getProxy(); + proxy.on('change', [indentKey], function (o, n) { + APP.setIndentation(n); + }); + setIndentation(proxy[indentKey]); + var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); var isHistoryMode = false; diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index ffb0fe75e..8a846482a 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -60,6 +60,7 @@ define([ common.whenRealtimeSyncs(common.getRealtime(), cb); }; + // TODO set this up as an observable data structure var getFriendList = Msg.getFriendList = function (common) { var proxy = common.getProxy(); if (!proxy.friends) { proxy.friends = {}; } @@ -83,6 +84,132 @@ define([ var channels = Msg.channels = window.channels = {}; var UI = Msg.UI = {}; + + // TODO extract into UI method + var createChatBox = function (common, $container, curvePublic, ui) { + var data = getFriend(common, curvePublic); + + // Input + var channel = channels[data.channel]; + + var $header = $('