Merge branch 'staging' into pad2

pull/1/head
Caleb James DeLisle 7 years ago
commit a612f02be2

@ -349,20 +349,26 @@ define([
}), }),
h('div.checkbox-container', [ h('div.checkbox-container', [
h('input#import-recent', { h('input#import-recent', {
name: 'import-recent',
type: 'checkbox', type: 'checkbox',
checked: true checked: true
}), }),
h('label', { // hscript doesn't generate for on label for some
// reason... use jquery as a temporary fallback
setHTML($('<label for="import-recent"></label>')[0], Msg.register_importRecent)
/*h('label', {
'for': 'import-recent', 'for': 'import-recent',
}, Msg.register_importRecent), }, Msg.register_importRecent),*/
]), ]),
h('div.checkbox-container', [ h('div.checkbox-container', [
h('input#accept-terms', { h('input#accept-terms', {
name: 'accept-terms',
type: 'checkbox' type: 'checkbox'
}), }),
setHTML(h('label', { setHTML($('<label for="accept-terms"></label>')[0], Msg.register_acceptTerms)
/*setHTML(h('label', {
'for': 'accept-terms', 'for': 'accept-terms',
}), Msg.register_acceptTerms), }), Msg.register_acceptTerms),*/
]), ]),
h('button#register.btn.btn-primary', Msg.login_register) h('button#register.btn.btn-primary', Msg.login_register)
]) ])

@ -2,25 +2,25 @@
@import (once) "./browser.less"; @import (once) "./browser.less";
.alertify_main () { .alertify_main () {
@alertify-fore: @colortheme_old-fore; @alertify-fore: @colortheme_modal-fg;
@alertify-base: @colortheme_old-base; @alertify-base: @colortheme_modal-bg;
@alertify-dialog-bg: #222; @alertify-dialog-bg: @alertify-base;
@alertify-dialog-fg: @colortheme_old-fore; @alertify-dialog-fg: @alertify-fore;
@alertify-btn-fg: @colortheme_old-fore; @alertify-btn-fg: @alertify-fore;
@alertify-btn-bg: rgba(200, 200, 200, 0.1); @alertify-btn-bg: rgba(200, 200, 200, 0.1);
@alertify-btn-bg-hover: rgba(200, 200, 200, .3); @alertify-btn-bg-hover: rgba(200, 200, 200, .3);
@alertify-bg: rgba(0, 0, 0, .4); @alertify-bg: @colortheme_modal-dim;
@alertify-fg: @colortheme_old-fore; @alertify-fg: @alertify-fore;
@alertify-input-bg: @colortheme_old-base; @alertify-input-bg: @colortheme_modal-input;
@alertify-input-fg: @colortheme_old-fore; @alertify-input-fg: @colortheme_modal-fg;
@alertify_padding-base: 12px; @alertify_padding-base: @colortheme_modal-padding;
@alertify_box-shadow: 0 2px 5px 0 rgba(0,0,0,.2); @alertify_box-shadow: @colortheme_modal-shadow;
// Logs to show that something has happened // Logs to show that something has happened
// These show only once // These show only once
@ -33,7 +33,7 @@
padding: @alertify_padding-base @alertify_padding-base * 4; padding: @alertify_padding-base @alertify_padding-base * 4;
color: @alertify-fore; color: @alertify-fore;
font-weight: bold; font-family: @colortheme_font;
font-size: large; font-size: large;
box-shadow: @alertify_box-shadow; box-shadow: @alertify_box-shadow;
@ -42,10 +42,11 @@
background: rgba(0, 0, 0, .8); background: rgba(0, 0, 0, .8);
} }
&.error { &.error {
font-weight: bold;
background: @colortheme_cp-red; background: @colortheme_cp-red;
} }
&.success { &.success {
background: @colortheme_cp-green; background: rgba(0, 0, 0, .8);
} }
} }
} }
@ -123,7 +124,7 @@
margin: 0; margin: 0;
} }
input:not(.form-control){ input:not(.form-control), textarea {
background-color: @alertify-input-bg; background-color: @alertify-input-bg;
color: @alertify-input-fg; color: @alertify-input-fg;
border: 0px; border: 0px;
@ -136,6 +137,13 @@
//outline-offset: -2px; //outline-offset: -2px;
} }
} }
input[type="checkbox"] {
padding: 0;
margin: 0;
margin-right: 0.5em;
}
nav { nav {
text-align: right; text-align: right;

@ -13,9 +13,19 @@
@colortheme_cp-red: #FA5858; // remove red @colortheme_cp-red: #FA5858; // remove red
@colortheme_cp-green: #46E981; @colortheme_cp-green: #46E981;
@colortheme_modal-bg: #222;
@colortheme_modal-fg: #fff;
@colortheme_modal-dim: rgba(0, 0, 0, 0.4);
@colortheme_modal-padding: 12px;
@colortheme_modal-shadow: 0 8px 32px 0 rgba(0,0,0,.4);
@colortheme_modal-input: #111;
@colortheme_alertify-red: #E55236; @colortheme_alertify-red: #E55236;
@colortheme_alertify-green: #77C825; @colortheme_alertify-green: #77C825;
// Apps
@colortheme_pad-bg: #1c4fa0; @colortheme_pad-bg: #1c4fa0;
@colortheme_pad-color: #fff; @colortheme_pad-color: #fff;

@ -1397,23 +1397,42 @@ define([
} }
}; };
// This is duplicated in drive/main.js, it should be unified
var getFileIcon = function (data) {
var $icon = common.getIcon();
if (!data) { return $icon; }
var href = data.href;
if (!href) { return $icon; }
if (href.indexOf('/pad/') !== -1) { $icon = common.getIcon('pad'); }
else if (href.indexOf('/code/') !== -1) { $icon = common.getIcon('code'); }
else if (href.indexOf('/slide/') !== -1) { $icon = common.getIcon('slide'); }
else if (href.indexOf('/poll/') !== -1) { $icon = common.getIcon('poll'); }
else if (href.indexOf('/whiteboard/') !== -1) { $icon = common.getIcon('whiteboard'); }
else if (href.indexOf('/file/') !== -1) { $icon = common.getIcon('file'); }
return $icon;
};
common.createFileDialog = function (cfg) { common.createFileDialog = function (cfg) {
var $body = cfg.$body || $('body'); var $body = cfg.$body || $('body');
var $block = $body.find('#fileDialog'); var $blockContainer = $body.find('#fileDialog');
if (!$block.length) { if (!$blockContainer.length) {
$block = $('<div>', {id: "fileDialog"}).appendTo($body); $blockContainer = $('<div>', {id: "fileDialog"}).appendTo($body);
} }
$block.html(''); $blockContainer.html('');
var $block = $('<div>', {'class': 'cp-modal'}).appendTo($blockContainer);
$('<span>', { $('<span>', {
'class': 'close fa fa-times', 'class': 'close fa fa-times',
'title': Messages.filePicker_close 'title': Messages.filePicker_close
}).click(function () { }).click(function () {
$block.hide(); $blockContainer.hide();
}).appendTo($block); }).appendTo($block);
var $description = $('<p>').text(Messages.filePicker_description); var $description = $('<p>').text(Messages.filePicker_description);
$block.append($description); $block.append($description);
var $filter = $('<p>').appendTo($block); var $filter = $('<p>', {'class': 'cp-form'}).appendTo($block);
var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block); var $container = $('<span>', {'class': 'fileContainer'}).appendTo($block);
var updateContainer = function () { var updateContainer = function () {
$container.html(''); $container.html('');
@ -1426,11 +1445,15 @@ define([
if (filter && name.toLowerCase().indexOf(filter.toLowerCase()) === -1) { if (filter && name.toLowerCase().indexOf(filter.toLowerCase()) === -1) {
return; return;
} }
var $span = $('<span>', {'class': 'element'}).appendTo($container); var $span = $('<span>', {
var $inner = $('<span>').text(name); 'class': 'element',
$span.append($inner).click(function () { 'title': name,
}).appendTo($container);
$span.append(getFileIcon(data));
$span.append(name);
$span.click(function () {
if (typeof cfg.onSelect === "function") { cfg.onSelect(data.href); } if (typeof cfg.onSelect === "function") { cfg.onSelect(data.href); }
$block.hide(); $blockContainer.hide();
}); });
}); });
}; };
@ -1446,13 +1469,13 @@ define([
//$filter.append(' '+Messages.or+' '); //$filter.append(' '+Messages.or+' ');
var data = {FM: cfg.data.FM}; var data = {FM: cfg.data.FM};
$filter.append(common.createButton('upload', false, data, function () { $filter.append(common.createButton('upload', false, data, function () {
$block.hide(); $blockContainer.hide();
})); }));
updateContainer(); updateContainer();
$body.keydown(function (e) { $body.keydown(function (e) {
if (e.which === 27) { $block.hide(); } if (e.which === 27) { $blockContainer.hide(); }
}); });
$block.show(); $blockContainer.show();
}; };

@ -1,39 +1,101 @@
@import (once) '../customize/src/less2/include/colortheme.less';
#fileDialog { #fileDialog {
display: none;
z-index: 100000;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: @colortheme_modal-dim;
.cp-modal {
background-color: @colortheme_modal-bg;
color: @colortheme_modal-fg;
box-shadow: @colortheme_modal-shadow;
padding: @colortheme_modal-padding;
position: absolute; position: absolute;
background-color: rgba(200, 200, 200, 0.8);
top: 15vh; bottom: 15vh; top: 15vh; bottom: 15vh;
left: 10vw; right: 10vw; left: 10vw; right: 10vw;
border: 1px solid black;
z-index: 100000;
overflow: auto; overflow: auto;
display: none;
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; font-family: @colortheme_font;
font-size: 16px;
text-align: center; text-align: center;
& > p {
margin-bottom: 1em;
}
.cp-form {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
input {
background-color: @colortheme_modal-input;
color: @colortheme_modal-fg;
border: 0;
padding: 8px 12px;
margin: 1em;
}
.close { .close {
text-shadow: none;
color: inherit;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: 5px; margin: @colortheme_modal-padding;
cursor: pointer; cursor: pointer;
} }
.fileContainer {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
}
.element { .element {
cursor: pointer; @darker: darken(@colortheme_modal-fg, 30%);
display: inline-flex;
width: 100px; width: 200px;
height: 100px; min-width: 200px;
border: 1px solid #ccc; height: 1em;
padding: 0.5em;
margin: 5px; margin: 5px;
box-sizing: content-box;
text-align: left;
line-height: 1em;
cursor: pointer;
background-color: #111;
color: @darker;
transition: all 0.1s;
&:hover {
color: @colortheme_modal-fg;
}
overflow: hidden; overflow: hidden;
word-wrap: break-word; text-overflow: ellipsis;
background-color: white; white-space: nowrap;
padding: 5px;
align-items: center; align-items: center;
span {
width: 100px; .fa {
text-align: center; cursor: pointer;
margin-right: 0.5em;
}
} }
} }
} }

@ -1146,6 +1146,7 @@ define([
$span.append($name).append($subfolders).append($files); $span.append($name).append($subfolders).append($files);
}; };
// This is duplicated in cryptpad-common, it should be unified
var getFileIcon = function (id) { var getFileIcon = function (id) {
var $icon = Cryptpad.getIcon(); var $icon = Cryptpad.getIcon();

@ -621,6 +621,12 @@ var ready = function (info, userid, readOnly) {
.on('change', ['table'], change) .on('change', ['table'], change)
.on('remove', [], change); .on('remove', [], change);
var userInput = $('.uncommitted > input');
if (userInput.val() === '')
{
userInput.val(Cryptpad.getProxy()[Cryptpad.displayNameKey]);
}
UserList.addToUserData(APP.proxy.info.userData); UserList.addToUserData(APP.proxy.info.userData);
APP.ready = true; APP.ready = true;

@ -29,6 +29,7 @@ body {
flex: 1; flex: 1;
#poll { #poll {
flex: 1; flex: 1;
overflow-y: auto;
} }
} }

Loading…
Cancel
Save