Some more poll changes <3

pull/1/head
Pierre Bondoerffer 8 years ago
parent 05785e96ea
commit 7a05462eb3
No known key found for this signature in database
GPG Key ID: C0C7C0C5063F2236

@ -356,5 +356,10 @@ define(function () {
out.register_warning = "Zero Knowledge significa que no podemos recuperar tus datos si pierdes tu contraseña."; out.register_warning = "Zero Knowledge significa que no podemos recuperar tus datos si pierdes tu contraseña.";
out.register_alreadyRegistered = "Este usuario ya existe, ¿iniciar sesión?"; out.register_alreadyRegistered = "Este usuario ya existe, ¿iniciar sesión?";
out.poll_remove = "Quitar";
out.poll_edit = "Editar";
out.poll_locked = "Cerrado";
out.poll_unlocked = "Abierto";
return out; return out;
}); });

@ -151,6 +151,11 @@ define(function () {
out.poll_titleHint = "Title"; out.poll_titleHint = "Title";
out.poll_descriptionHint = "Describe your poll, and use the 'publish' button when you're done. Anyone with the link can change the description, but this is discouraged."; out.poll_descriptionHint = "Describe your poll, and use the 'publish' button when you're done. Anyone with the link can change the description, but this is discouraged.";
out.poll_remove = "Remove";
out.poll_edit = "Edit";
out.poll_locked = "Locked";
out.poll_unlocked = "Unlocked";
// Canvas // Canvas
out.canvas_clear = "Clear"; out.canvas_clear = "Clear";
out.canvas_delete = "Delete selection"; out.canvas_delete = "Delete selection";

@ -114,7 +114,7 @@ define([
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled'); $('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled'); $('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
$('[data-rt-id="' + id + '"] ~ .edit').css('visibility', 'hidden'); $('[data-rt-id="' + id + '"] ~ .edit').css('visibility', 'hidden');
$('.lock[data-rt-id="' + id + '"]').html(unlockHTML); $('.lock[data-rt-id="' + id + '"]').html(unlockHTML).attr('title', Messages.poll_unlocked);
if (isOwnColumnCommitted()) { return; } if (isOwnColumnCommitted()) { return; }
$('[data-rt-id^="' + id + '"]').closest('td').addClass("uncommitted"); $('[data-rt-id^="' + id + '"]').closest('td').addClass("uncommitted");
@ -132,7 +132,7 @@ define([
$('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled'); $('input[disabled="disabled"][data-rt-id^="' + id + '"]').removeAttr('disabled');
$('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled'); $('input[type="checkbox"][data-rt-id^="' + id + '"]').addClass('enabled');
$('span.edit[data-rt-id="' + id + '"]').css('visibility', 'hidden'); $('span.edit[data-rt-id="' + id + '"]').css('visibility', 'hidden');
$('.lock[data-rt-id="' + id + '"]').html(unlockHTML); $('.lock[data-rt-id="' + id + '"]').html(unlockHTML).attr('title', Messages.poll_unlocked);
}); });
}; };
@ -369,7 +369,7 @@ define([
if (!isKeyup && $(e.target).is('[type="text"]')) { if (!isKeyup && $(e.target).is('[type="text"]')) {
return; return;
} }
$('.lock[data-rt-id!="' + APP.userid + '"]').html(lockHTML); $('.lock[data-rt-id!="' + APP.userid + '"]').html(lockHTML).attr('title', Messages.poll_lock);
var $cells = APP.$table.find('thead td:not(.uncommitted), tbody td'); var $cells = APP.$table.find('thead td:not(.uncommitted), tbody td');
$cells.find('[type="text"][data-rt-id!="' + APP.userid + '"]').attr('disabled', true); $cells.find('[type="text"][data-rt-id!="' + APP.userid + '"]').attr('disabled', true);
$('.edit[data-rt-id!="' + APP.userid + '"]').css('visibility', 'visible'); $('.edit[data-rt-id!="' + APP.userid + '"]').css('visibility', 'visible');

@ -33,7 +33,7 @@ textarea[disabled] {
border: 0px; border: 0px;
} }
input[type="text"]::placeholder { input[type="text"]::placeholder {
color: #333; color: #666;
} }
table#table { table#table {
margin: 0px; margin: 0px;
@ -69,7 +69,7 @@ table#table {
#tableScroll { #tableScroll {
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
margin-left: calc(30% - 50px + 29px); margin-left: calc(30% - 50px + 31px);
max-width: 70%; max-width: 70%;
width: auto; width: auto;
display: inline-block; display: inline-block;
@ -107,6 +107,9 @@ table {
tbody { tbody {
border: 1px solid #555; border: 1px solid #555;
} }
tbody * {
box-sizing: border-box;
}
tbody tr { tbody tr {
text-align: center; text-align: center;
} }
@ -299,9 +302,13 @@ div.realtime table tbody .text-cell .remove {
float: left; float: left;
margin: 0 0 0 10px; margin: 0 0 0 10px;
} }
form.realtime table tbody td label, form.realtime table tbody tr td:nth-child(2),
div.realtime table tbody td label { div.realtime table tbody tr td:nth-child(2) {
border: 0.5px solid #555; border-left: 1px solid #555;
}
form.realtime table tbody tr:not(:first-child) td:not(:first-child) label,
div.realtime table tbody tr:not(:first-child) td:not(:first-child) label {
border-top: 1px solid #555;
} }
form.realtime table .edit, form.realtime table .edit,
div.realtime table .edit { div.realtime table .edit {

@ -83,7 +83,7 @@ table#table {
#tableScroll { #tableScroll {
overflow-y: hidden; overflow-y: hidden;
overflow-x: auto; overflow-x: auto;
margin-left: calc(~"30% - 50px + 29px"); margin-left: calc(~"30% - 50px + 31px");
max-width: 70%; max-width: 70%;
width: auto; width: auto;
display: inline-block; display: inline-block;
@ -126,6 +126,9 @@ table {
} }
tbody { tbody {
border: 1px solid @poll-border-color; border: 1px solid @poll-border-color;
* {
box-sizing: border-box;
}
tr { tr {
text-align: center; text-align: center;
&:first-of-type th{ &:first-of-type th{
@ -326,9 +329,11 @@ form.realtime, div.realtime {
margin: 0 0 0 10px; margin: 0 0 0 10px;
} }
} }
td { tr:not(:first-child) {
td:not(:first-child) {
label { label {
border: .5px solid @poll-border-color; border-top: 1px solid @poll-border-color;
}
} }
} }
} }

@ -252,6 +252,7 @@ var Renderer = function (Cryptpad) {
var makeRemoveElement = Render.makeRemoveElement = function (id) { var makeRemoveElement = Render.makeRemoveElement = function (id) {
return ['SPAN', { return ['SPAN', {
'data-rt-id': id, 'data-rt-id': id,
'title': Cryptpad.Messages.poll_remove,
class: 'remove', class: 'remove',
}, ['✖']]; }, ['✖']];
}; };
@ -259,6 +260,7 @@ var Renderer = function (Cryptpad) {
var makeEditElement = Render.makeEditElement = function (id) { var makeEditElement = Render.makeEditElement = function (id) {
return ['SPAN', { return ['SPAN', {
'data-rt-id': id, 'data-rt-id': id,
'title': Cryptpad.Messages.poll_edit,
class: 'edit', class: 'edit',
}, ['✐']]; }, ['✐']];
}; };
@ -266,6 +268,7 @@ var Renderer = function (Cryptpad) {
var makeLockElement = Render.makeLockElement = function (id) { var makeLockElement = Render.makeLockElement = function (id) {
return ['SPAN', { return ['SPAN', {
'data-rt-id': id, 'data-rt-id': id,
'title': Cryptpad.Messages.poll_locked,
class: 'lock', class: 'lock',
}, [['i', { }, [['i', {
class: 'fa fa-lock', class: 'fa fa-lock',
@ -277,14 +280,11 @@ var Renderer = function (Cryptpad) {
var makeHeadingCell = Render.makeHeadingCell = function (cell, readOnly) { var makeHeadingCell = Render.makeHeadingCell = function (cell, readOnly) {
if (!cell) { return ['TD', {}, []]; } if (!cell) { return ['TD', {}, []]; }
if (cell.type === 'text') { if (cell.type === 'text') {
var removeElement = makeRemoveElement(cell['data-rt-id']);
var editElement = makeEditElement(cell['data-rt-id']);
var lockElement = makeLockElement(cell['data-rt-id']);
var elements = [['INPUT', cell, []]]; var elements = [['INPUT', cell, []]];
if (!readOnly) { if (!readOnly) {
elements.unshift(removeElement); elements.unshift(makeRemoveElement(cell['data-rt-id']));
elements.unshift(lockElement); elements.unshift(makeLockElement(cell['data-rt-id']));
elements.unshift(editElement); elements.unshift(makeEditElement(cell['data-rt-id']));
} }
return ['TD', {}, elements]; return ['TD', {}, elements];
} }
@ -321,12 +321,10 @@ var Renderer = function (Cryptpad) {
var makeBodyCell = Render.makeBodyCell = function (cell, readOnly) { var makeBodyCell = Render.makeBodyCell = function (cell, readOnly) {
if (cell && cell.type === 'text') { if (cell && cell.type === 'text') {
var removeElement = makeRemoveElement(cell['data-rt-id']);
var editElement = makeEditElement(cell['data-rt-id']);
var elements = [['INPUT', cell, []]]; var elements = [['INPUT', cell, []]];
if (!readOnly) { if (!readOnly) {
elements.push(removeElement); elements.push(makeRemoveElement(cell['data-rt-id']));
elements.push(editElement); elements.push(makeEditElement(cell['data-rt-id']));
} }
return ['TD', {}, [ return ['TD', {}, [
['DIV', {class: 'text-cell'}, elements] ['DIV', {class: 'text-cell'}, elements]

Loading…
Cancel
Save