diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 55945ccd2..5fac0939b 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -570,15 +570,12 @@ define([ }; var appToolbar = function () { - return h('div#toolbar.cryptpad-toolbar'); - }; - var appToolbar3 = function () { return h('div#cp-toolbar.cp-toolbar-container'); }; Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () { return [ - appToolbar3(), + appToolbar(), h('div#cp-app-whiteboard-canvas-area', h('canvas#cp-app-whiteboard-canvas', { width: 600, height: 600 @@ -639,47 +636,49 @@ define([ Pages['/poll/'] = Pages['/poll/index.html'] = function () { return [ appToolbar(), - h('div#content', [ - h('div#poll', [ - h('div#howItWorks', [ + h('div#cp-app-poll-content', [ + h('div#cp-app-poll-form', [ + h('div#cp-app-poll-help', [ h('h1', 'CryptPoll'), setHTML(h('h2'), Msg.poll_subtitle), h('p', Msg.poll_p_save), h('p', Msg.poll_p_encryption) ]), - h('div.upper', [ - h('button#publish.btn.btn-success', { - style: { display: 'none' } - }, Msg.poll_publish_button), - h('button#admin.btn.btn-primary', { - style: { display: 'none' }, - title: Msg.poll_admin_button - }, Msg.poll_admin_button), - h('button#help.btn.btn-secondary', { - title: Msg.poll_show_help_button - }, Msg.poll_show_help_button) - ]), - h('div.realtime', [ + h('div.cp-app-poll-realtime', [ h('br'), - h('center', [ - h('textarea#description', { + h('div', [ + h('textarea#cp-app-poll-description', { rows: "5", cols: "50", + placeholder: Msg.poll_descriptionHint, disabled: true }), + h('div#cp-app-poll-description-published'), h('br') ]), - h('div#tableContainer', [ - h('div#tableScroll'), - h('button#create-user.btn.btn-secondary', { + h('div#cp-app-poll-table-container', [ + h('div#cp-app-poll-table-scroll'), + h('button#cp-app-poll-create-user.btn.btn-secondary', { title: Msg.poll_create_user }, h('span.fa.fa-plus')), - h('button#create-option.btn.btn-secondary', { + h('button#cp-app-poll-create-option.btn.btn-secondary', { title: Msg.poll_create_option }, h('span.fa.fa-plus')), - h('button#commit.btn.btn-secondary', { - title: Msg.poll_commit - }, h('span.fa.fa-check')) + ]), + h('div#cp-app-poll-comments', [ + h('h2#cp-app-poll-comments-add-title', Msg.poll_comment_add), + h('div#cp-app-poll-comments-add', [ + h('input.cp-app-poll-comments-add-name', { + type: 'text' + }), + h('textarea.cp-app-poll-comments-add-msg'), + h('button.cp-app-poll-comments-add-submit.btn.btn-secondary', + Msg.poll_comment_submit), + h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary', + Msg.cancel) + ]), + h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list), + h('div#cp-app-poll-comments-list') ]) ]) ]) diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index 8f53ecab5..812da47a8 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -29,6 +29,6 @@ body.cp-app-slide { @import "../../../slide/app-slide.less"; } body.cp-app-file { @import "../../../file/app-file.less"; } body.cp-app-filepicker { @import "../../../filepicker/app-filepicker.less"; } body.cp-app-contacts { @import "../../../contacts/app-contacts.less"; } -//body.cp-app-poll { @import "../../../poll/app-poll.less"; } +body.cp-app-poll { @import "../../../poll/app-poll.less"; } body.cp-app-whiteboard { @import "../../../whiteboard/app-whiteboard.less"; } diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 118eb6f7b..91bba1fbf 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -246,7 +246,9 @@ define(function () { out.poll_removeUser = "Êtes-vous sûr de vouloir supprimer cet utilisateur ?"; out.poll_titleHint = "Titre"; - out.poll_descriptionHint = "Description"; + out.poll_descriptionHint = "Décrivez votre sondage puis cliquer sur le bouton ✓ (Publier).\n" + + "La description peut contenir de la syntaxe markdown, et vous pouvez y ajouter des images stockées dans votre CryptDrive.\n" + + "Toutes les personnes possédant le lien d'édition de ce sondage peuvent modifier la description, bien que ce soit déconseillé."; out.poll_remove = "Supprimer"; out.poll_edit = "Modifier"; @@ -256,6 +258,15 @@ define(function () { out.poll_show_help_button = "Afficher l'aide"; out.poll_hide_help_button = "Cacher l'aide"; + out.poll_bookmark_col = "Marquer cette colonne comme favorite pour qu'elle soit toujours déverouillée et affichée en première position."; + out.poll_bookmarked_col = "Voici votre colonne favorite; elle sera toujours dévérouillée et affichée en première position."; + out.poll_total = 'TOTAL'; + + out.poll_comment_list = "Commentaires"; + out.poll_comment_add = "Ajouter un commentaire"; + out.poll_comment_submit = "Envoyer"; + out.poll_comment_remove = "Supprimer ce commentaire"; + // Canvas out.canvas_clear = "Nettoyer"; out.canvas_delete = "Supprimer la sélection"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index b4aadd799..f7bb3ffca 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -250,7 +250,9 @@ define(function () { out.poll_removeUser = "Are you sure you'd like to remove this user?"; 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.\n" + + "The description can be written using markdown syntax and you can embed media elements from your CryptDrive.\n" + + "Anyone with the link can change the description, but this is discouraged."; out.poll_remove = "Remove"; out.poll_edit = "Edit"; @@ -260,6 +262,15 @@ define(function () { out.poll_show_help_button = "Show help"; out.poll_hide_help_button = "Hide help"; + out.poll_bookmark_col = 'Bookmark this column so that it is always unlocked and displayed at the beginning for you'; + out.poll_bookmarked_col = 'This is your bookmarked column. It will always be unlocked and displayed at the beginning for you.'; + out.poll_total = 'TOTAL'; + + out.poll_comment_list = "Comments"; + out.poll_comment_add = "Add a comment"; + out.poll_comment_submit = "Send"; + out.poll_comment_remove = "Delete this comment"; + // Canvas out.canvas_clear = "Clear"; out.canvas_delete = "Delete selection"; diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 6686a9a55..098972161 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -9,6 +9,58 @@ define([ var saveAs = window.saveAs; var module = {}; + var cursorToPos = function(cursor, oldText) { + var cLine = cursor.line; + var cCh = cursor.ch; + var pos = 0; + var textLines = oldText.split("\n"); + for (var line = 0; line <= cLine; line++) { + if(line < cLine) { + pos += textLines[line].length+1; + } + else if(line === cLine) { + pos += cCh; + } + } + return pos; + }; + + var posToCursor = function(position, newText) { + var cursor = { + line: 0, + ch: 0 + }; + var textLines = newText.substr(0, position).split("\n"); + cursor.line = textLines.length - 1; + cursor.ch = textLines[cursor.line].length; + return cursor; + }; + + module.setValueAndCursor = function (editor, oldDoc, remoteDoc, TextPatcher) { + var scroll = editor.getScrollInfo(); + //get old cursor here + var oldCursor = {}; + oldCursor.selectionStart = cursorToPos(editor.getCursor('from'), oldDoc); + oldCursor.selectionEnd = cursorToPos(editor.getCursor('to'), oldDoc); + + editor.setValue(remoteDoc); + editor.save(); + + var op = TextPatcher.diff(oldDoc, remoteDoc); + var selects = ['selectionStart', 'selectionEnd'].map(function (attr) { + return TextPatcher.transformCursor(oldCursor[attr], op); + }); + + if(selects[0] === selects[1]) { + editor.setCursor(posToCursor(selects[0], remoteDoc)); + } + else { + editor.setSelection(posToCursor(selects[0], remoteDoc), posToCursor(selects[1], remoteDoc)); + } + + editor.scrollTo(scroll.left, scroll.top); + }; + module.create = function (Common, defaultMode, CMeditor) { var exp = {}; var Messages = Cryptpad.Messages; @@ -253,56 +305,8 @@ define([ onLocal(); }; - var cursorToPos = function(cursor, oldText) { - var cLine = cursor.line; - var cCh = cursor.ch; - var pos = 0; - var textLines = oldText.split("\n"); - for (var line = 0; line <= cLine; line++) { - if(line < cLine) { - pos += textLines[line].length+1; - } - else if(line === cLine) { - pos += cCh; - } - } - return pos; - }; - - var posToCursor = function(position, newText) { - var cursor = { - line: 0, - ch: 0 - }; - var textLines = newText.substr(0, position).split("\n"); - cursor.line = textLines.length - 1; - cursor.ch = textLines[cursor.line].length; - return cursor; - }; - exp.setValueAndCursor = function (oldDoc, remoteDoc, TextPatcher) { - var scroll = editor.getScrollInfo(); - //get old cursor here - var oldCursor = {}; - oldCursor.selectionStart = cursorToPos(editor.getCursor('from'), oldDoc); - oldCursor.selectionEnd = cursorToPos(editor.getCursor('to'), oldDoc); - - editor.setValue(remoteDoc); - editor.save(); - - var op = TextPatcher.diff(oldDoc, remoteDoc); - var selects = ['selectionStart', 'selectionEnd'].map(function (attr) { - return TextPatcher.transformCursor(oldCursor[attr], op); - }); - - if(selects[0] === selects[1]) { - editor.setCursor(posToCursor(selects[0], remoteDoc)); - } - else { - editor.setSelection(posToCursor(selects[0], remoteDoc), posToCursor(selects[1], remoteDoc)); - } - - editor.scrollTo(scroll.left, scroll.top); + return module.setValueAndCursor(editor, oldDoc, remoteDoc, TextPatcher); }; return exp; diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index e145fc4a9..6913f7ef5 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -65,6 +65,7 @@ define([ Cryptpad.ready(waitFor()); })); }).nThen(function (waitFor) { + $('#sbox-iframe').focus(); sframeChan.on('EV_CACHE_PUT', function (x) { Object.keys(x).forEach(function (k) { diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index f07da43fa..6e0712011 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -17,6 +17,7 @@ define(['jquery'], function ($) { var $title; exp.setToolbar = function (toolbar) { $title = toolbar && (toolbar.title || toolbar.pageTitle); + console.log('SET TOOLBAR'); }; exp.getTitle = function () { return exp.title; }; diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 3218f40f4..6433906d6 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -228,7 +228,7 @@ define([ $span.append($rightCol); } else { Common.displayAvatar($span, data.avatar, name, function ($img) { - if (data.avatar && $img) { + if (data.avatar && $img.length) { avatars[data.avatar] = $img[0].outerHTML; } $span.append($rightCol); @@ -448,7 +448,7 @@ define([ var $content = $('
').text(Messages.fileEmbedTag).appendTo($content); + var $tag = $('
').text(Messages.viewEmbedTag).appendTo($content); $('').appendTo($tag); var iframeId = uid(); var iframeEmbed = ''; diff --git a/www/drive/inner.js b/www/drive/inner.js index a16c0d8f2..4b673a997 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -1,6 +1,5 @@ define([ 'jquery', - '/bower_components/chainpad-crypto/crypto.js', '/bower_components/textpatcher/TextPatcher.js', '/common/toolbar3.js', 'json.sortify', @@ -12,7 +11,6 @@ define([ '/common/common-realtime.js', '/common/userObject.js', '/customize/application_config.js', - '/common/mergeDrive.js', '/common/sframe-chainpad-listmap.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', @@ -20,7 +18,6 @@ define([ 'less!/customize/src/less2/main.less', ], function ( $, - Crypto, TextPatcher, Toolbar, JSONSortify, @@ -32,7 +29,6 @@ define([ CommonRealtime, FO, AppConfig, - Merge, Listmap) { var Messages = Cryptpad.Messages; diff --git a/www/oldpoll/index.html b/www/oldpoll/index.html new file mode 100644 index 000000000..3f4b53dbd --- /dev/null +++ b/www/oldpoll/index.html @@ -0,0 +1,11 @@ + + +