diff --git a/CHANGELOG.md b/CHANGELOG.md index a47f5e760..84c8e6cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +# Thylacine's revenge (3.19.1) + +Our upcoming 3.20.0 release is planned for July 7th, 2020, but we are once again releasing a minor version featuring some nice bug fixes and usability improvements which are ready to be deployed now. In case you missed [our announcement](https://social.weho.st/@cryptpad/104360490068671089) we are phasing out our usage of the `master` and basing our releases on the `main` branch. For best results we recommend explicitly checking out code by its tag. + +New features: + +* We've spent a little time making support tickets a little bit easier for both users and admins. + * Users can now label their tickets with a set of predefined categories, making it easier for admins to sort through related reports. + * Users and admins can both attach encrypted uploads to their messages, making it easier to demonstrate a problem with an image, video, or other example file. +* Teams now take advantage of the same "mailbox" functionality that powers user accounts' notification center. Team members with the "viewer" role can now use this feature to share documents with their team using the "share menu" as they already can with other users. Anyone with the ability to add a document to the team's drive will then be able to receive the notification and add the document to the team's drive for them. Going forward we'll use this functionality to implement more behaviour to make teams function more like shared user accounts. +* The "pad creation screen" which is displayed to registered users when they first create a pad will no longer remember the settings used when they last created a pad. While this behaviour was intended to streamline the process of creating documents, in practice it led to some user's documents getting deleted because they didn't realize they were set to automatically expire. If you prefer not to use the defaults (owned, non-expiring) then you'll have to click a few more times to create a document, but we think that's a worthwhile tradeoff to avoid data loss. + +Bug fixes: + +* Hitting _ctrl-A_ in the drive used to select lots of the page's elements which had no business being selected. Now it will select the contents of the directory currently being displayed. +* Due to some complications in OnlyOffice (which we use for spreadsheets) remote updates made to a sheet were not displayed for users who had opened the document in "view mode". We still don't have the means to apply these remote changes in real-time, but we now prompt users to click a button to refresh the editor (not the full page) to display the latest document state. +* A recent update set the text color of the team chat input to 'white', matching the input's background and making the text unreadable. We patched it to make it black text on a white background. +* We're slowly working on improving keyboard shortcuts for a variety of actions. This time around we fixed a bug that prevented "ESC" from closing an open "tag prompt" interface. +* We noticed that the zip file constructed in the browser when you downloaded a subtree of a shared folder in your drive contained the correct directory structure but did not contain the files that were supposed to be there. This has been fixed. +* Finally, we've tweaked our styles to use more specific CSS selectors to prevent a variety of styles from being accidentally applied to the wrong elements. This should make the platform a little easier to maintain and help us improve the visual consistency of a variety of elements on different pages. + +To update from 3.19.0 to 3.19.1: + +1. Stop your server +2. Get the latest code with `git checkout 3.19.1` +3. Restart your server + +If you're updating from anything other than 3.19.0 you may need other clientside dependencies (available with `bower update` and `npm i`). + # Thylacine release (3.19.0) ## Goals diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 0e42b9a3a..c37e4b2f5 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -62,7 +62,7 @@ define([ var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ? '/imprint.html' : AppConfig.imprint); - Pages.versionString = "CryptPad v3.19.0 (Thylacine)"; + Pages.versionString = "CryptPad v3.19.1 (Thylacine's revenge)"; // used for the about menu Pages.imprintLink = AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined; diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index f9c63215c..2a7fd3761 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -3,7 +3,6 @@ @import (reference) "./variables.less"; @import (reference) "./avatar.less"; @import (reference) "./tools.less"; -@import (reference) "./buttons.less"; .alertify_main() { --LessLoader_require: LessLoader_currentFile(); @@ -272,7 +271,6 @@ } } - .buttons_main(); input:not(.form-control), textarea { margin-bottom: 15px; } diff --git a/customize.dist/src/less2/include/comments.less b/customize.dist/src/less2/include/comments.less index becc56f54..479609580 100644 --- a/customize.dist/src/less2/include/comments.less +++ b/customize.dist/src/less2/include/comments.less @@ -1,7 +1,6 @@ @import (reference) "./colortheme-all.less"; @import (reference) "./variables.less"; @import (reference) "./avatar.less"; -@import (reference) "./buttons.less"; @import (reference) "./tools.less"; .comments_main() { @@ -22,8 +21,6 @@ } - .buttons_main(); - .cp-comment-reply { margin-left: 30px; } diff --git a/customize.dist/src/less2/include/buttons.less b/customize.dist/src/less2/include/forms.less similarity index 98% rename from customize.dist/src/less2/include/buttons.less rename to customize.dist/src/less2/include/forms.less index 87fe9b050..96f419310 100644 --- a/customize.dist/src/less2/include/buttons.less +++ b/customize.dist/src/less2/include/forms.less @@ -1,7 +1,7 @@ @import (reference) "./colortheme-all.less"; @import (reference) "./variables.less"; -.buttons_main() { +.forms_main() { @alertify-fore: @colortheme_modal-fg; @alertify-btn-fg: @alertify-fore; @alertify-light-bg: fade(@alertify-fore, 25%); @@ -30,7 +30,7 @@ div.cp-alertify-type { display: flex; input { - margin: 0; + margin: 0 !important; flex: 1; min-width: 0; } @@ -83,7 +83,7 @@ margin-bottom: 3px !important; } - button:not(.pure-button):not(.md-button):not(.mdl-button) { + button.btn { background-color: @colortheme_alertify-cancel; box-sizing: border-box; diff --git a/customize.dist/src/less2/include/framework.less b/customize.dist/src/less2/include/framework.less index 94532d5c7..c698b91b9 100644 --- a/customize.dist/src/less2/include/framework.less +++ b/customize.dist/src/less2/include/framework.less @@ -16,6 +16,7 @@ @import (reference) "./cursor.less"; @import (reference) "./usergrid.less"; @import (reference) "./mentions.less"; +@import (reference) "./forms.less"; @import (reference) "./modals-ui-elements.less"; .framework_main(@bg-color, @warn-color, @color) { @@ -48,6 +49,7 @@ ); .cursor_main(); .usergrid_main(); + .forms_main(); .mentions_main(); .creation_main( @bg-color: @bg-color, @@ -84,6 +86,7 @@ .checkmark_main(20px); .password_main(); .usergrid_main(); + .forms_main(); font: @colortheme_app-font; } diff --git a/customize.dist/src/less2/include/modal.less b/customize.dist/src/less2/include/modal.less index 12d3c908c..8ed10a1b2 100644 --- a/customize.dist/src/less2/include/modal.less +++ b/customize.dist/src/less2/include/modal.less @@ -1,8 +1,5 @@ @import (reference) "./colortheme-all.less"; @import (reference) "./variables.less"; -@import (reference) './buttons.less'; - - .modal_base() { font-family: @colortheme_font; @@ -39,8 +36,6 @@ background-color: @colortheme_modal-dim; .cp-modal { - .buttons_main(); - background-color: @colortheme_modal-bg; color: @colortheme_modal-fg; box-shadow: @variables_shadow; diff --git a/customize.dist/src/less2/include/sidebar-layout.less b/customize.dist/src/less2/include/sidebar-layout.less index 7961e1bee..ace7350df 100644 --- a/customize.dist/src/less2/include/sidebar-layout.less +++ b/customize.dist/src/less2/include/sidebar-layout.less @@ -1,6 +1,5 @@ @import (reference) "/customize/src/less2/include/colortheme-all.less"; @import (reference) "/customize/src/less2/include/leftside-menu.less"; -@import (reference) "/customize/src/less2/include/buttons.less"; @import (reference) "/customize/src/less2/include/browser.less"; @sidebar_button-width: 400px; @@ -98,7 +97,6 @@ } } margin-bottom: 20px; - .buttons_main(); } [type="text"], [type="password"], button { vertical-align: middle; diff --git a/customize.dist/src/less2/include/support.less b/customize.dist/src/less2/include/support.less index 890ba810d..d83746b51 100644 --- a/customize.dist/src/less2/include/support.less +++ b/customize.dist/src/less2/include/support.less @@ -4,6 +4,9 @@ @msg-bg: #eee; @fromme-bg: #ddd; .cp-support-form-container { + div { + margin-bottom: 10px; + } [type="text"] { width: @sidebar_button-width; margin-bottom: 10px; @@ -15,6 +18,18 @@ height: 300px; } } + .cp-support-attachments { + display: flex; + .fa { + cursor: pointer; + margin-right: 10px; + } + &> span { + border: 1px solid #ddd; + margin-right: 5px; + padding: 10px; + } + } .cp-support-container { .cp-support-list-ticket { display: flex; diff --git a/customize.dist/src/less2/include/tokenfield.less b/customize.dist/src/less2/include/tokenfield.less index 358f0d18b..42a06624c 100644 --- a/customize.dist/src/less2/include/tokenfield.less +++ b/customize.dist/src/less2/include/tokenfield.less @@ -84,7 +84,6 @@ width: 100%; min-width: 100% !important; &:focus { - border-color: transparent; outline: 0; box-shadow: none; } diff --git a/customize.dist/src/less2/pages/page-register.less b/customize.dist/src/less2/pages/page-register.less index 314ad7236..cc319a0e4 100644 --- a/customize.dist/src/less2/pages/page-register.less +++ b/customize.dist/src/less2/pages/page-register.less @@ -2,9 +2,11 @@ @import (reference) "../include/colortheme-all.less"; @import (reference) "../include/alertify.less"; @import (reference) "../include/checkmark.less"; +@import (reference) "../include/forms.less"; &.cp-page-register { .infopages_main(); + .forms_main(); .alertify_main(); .checkmark_main(20px); diff --git a/package-lock.json b/package-lock.json index ed2097eff..dcced0ee4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cryptpad", - "version": "3.19.0", + "version": "3.19.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index be6f77978..8b9bc912c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "3.19.0", + "version": "3.19.1", "license": "AGPL-3.0+", "repository": { "type": "git", diff --git a/www/admin/inner.js b/www/admin/inner.js index 2ff62cf1f..90048e76d 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -185,6 +185,20 @@ define([ var $container = makeBlock('support-list'); var $div = $(h('div.cp-support-container')).appendTo($container); + var catContainer = h('div.cp-dropdown-container'); + $div.append(catContainer); + var category = 'all'; + var $drop = APP.support.makeCategoryDropdown(catContainer, function (key) { + category = key; + if (key === 'all') { + $div.find('.cp-support-list-ticket').show(); + return; + } + $div.find('.cp-support-list-ticket').hide(); + $div.find('.cp-support-list-ticket[data-cat="'+key+'"]').show(); + }, true); + $drop.setValue('all'); + var metadataMgr = common.getMetadataMgr(); var privateData = metadataMgr.getPrivateData(); var cat = privateData.category || ''; @@ -277,6 +291,9 @@ define([ UI.alert(Messages.error); }); }); + if (category !== 'all' && $ticket.attr('data-cat') !== category) { + $ticket.hide(); + } } $ticket.append(APP.support.makeMessage(content, hash)); reorder(); diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 4eba3755c..d406eccaf 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -145,12 +145,12 @@ define([ }; dialog.okButton = function (content, classString) { - var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.ok.primary'; + var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.btn.ok.primary'; return h(sel, { tabindex: '2', }, content || Messages.okButton); }; dialog.cancelButton = function (content, classString) { - var sel = typeof(classString) === 'string'? 'button.' + classString:'button.cancel'; + var sel = typeof(classString) === 'string'? 'button.' + classString:'button.btn.cancel'; return h(sel, { tabindex: '1'}, content || Messages.cancelButton); }; @@ -356,11 +356,15 @@ define([ var $cancel = findCancelButton(tagger).click(function (e) { close(null, e); }); - listener = listenForKeys(function () { - $ok.click(); - }, function () { - $cancel.click(); - }, tagger); + $(tagger).on('keydown', function (e) { + if (e.which === 27) { + $cancel.click(); + return; + } + if (e.which === 13) { + $ok.click(); + } + }); $(tagger).on('click submit', function (e) { e.stopPropagation(); @@ -392,6 +396,7 @@ define([ buttons.forEach(function (b) { if (!b.name || !b.onClick) { return; } var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); + button.classList.add('btn'); var todo = function () { var noClose = b.onClick(); if (noClose) { return; } @@ -642,9 +647,6 @@ define([ var $ok = $(ok).click(function (ev) { close(true, ev); }); var $cancel = $(cancel).click(function (ev) { close(false, ev); }); - if (opt.cancelClass) { $cancel.addClass(opt.cancelClass); } - if (opt.okClass) { $ok.addClass(opt.okClass); } - listener = listenForKeys(function () { $ok.click(); }, function () { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 4f8ee71c5..386353339 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -313,26 +313,30 @@ define([ var $friends = $div.find('.cp-usergrid-user.cp-selected'); $friends.each(function (i, el) { var curve = $(el).attr('data-curve'); - // Check if the selected element is a friend or a team - if (curve) { // Friend - if (!curve || !friends[curve]) { return; } - var friend = friends[curve]; - if (!friend.notifications || !friend.curvePublic) { return; } - common.mailbox.sendTo("SHARE_PAD", { - href: href, - password: config.password, - isTemplate: config.isTemplate, - name: myName, - title: title - }, { - channel: friend.notifications, - curvePublic: friend.curvePublic - }); - return; - } - // Team var ed = $(el).attr('data-ed'); + var friend = curve && friends[curve]; var team = teams[ed]; + // If the selected element is a friend or a team without edit right, + // send a notification + var mailbox = friend || ((team && team.viewer) ? team : undefined); + if (mailbox) { // Friend + if (friends[curve] && !mailbox.notifications) { return; } + if (mailbox.notifications && mailbox.curvePublic) { + common.mailbox.sendTo("SHARE_PAD", { + href: href, + password: config.password, + isTemplate: config.isTemplate, + name: myName, + title: title + }, { + viewed: team && team.id, + channel: mailbox.notifications, + curvePublic: mailbox.curvePublic + }); + return; + } + } + // If it's a team with edit right, add the pad directly if (!team) { return; } sframeChan.query('Q_STORE_IN_TEAM', { href: href, @@ -450,10 +454,11 @@ define([ // config.teamId only exists when we're trying to share a pad from a team drive // In this case, we don't want to share the pad with the current team if (config.teamId && config.teamId === id) { return; } - if (!teamsData[id].hasSecondaryKey) { return; } var t = teamsData[id]; teams[t.edPublic] = { - notifications: true, + viewer: !teamsData[id].hasSecondaryKey, + notifications: t.notifications, + curvePublic: t.curvePublic, displayName: t.name, edPublic: t.edPublic, avatar: t.avatar, @@ -2150,6 +2155,11 @@ define([ 'class': 'fa fa-caret-down', }).prependTo($button); } + if (config.angleDown) { + $('', { + 'class': 'fa fa-angle-down', + }).prependTo($button); + } // Menu var $innerblock = $('
', {'class': 'cp-dropdown-content'}); @@ -2203,7 +2213,9 @@ define([ if (config.isSelect && value) { var $val = $innerblock.find('[data-value="'+value+'"]'); setActive($val); - $innerblock.scrollTop($val.position().top + $innerblock.scrollTop()); + try { + $innerblock.scrollTop($val.position().top + $innerblock.scrollTop()); + } catch (e) {} } if (config.feedback) { Feedback.send(config.feedback); } }; @@ -2849,6 +2861,7 @@ define([ }); }; + /* UIElements.setExpirationValue = function (val, $expire) { if (val && typeof (val) === "number") { $expire.find('#cp-creation-expire').attr('checked', true).trigger('change'); @@ -2872,6 +2885,7 @@ define([ $expire.find('#cp-creation-expire-false').attr('checked', true); } }; + */ UIElements.getPadCreationScreen = function (common, cfg, appCfg, cb) { appCfg = appCfg || {}; if (!common.isLoggedIn()) { return void cb(); } @@ -3184,10 +3198,12 @@ define([ // Initial values + /* if (!cfg.owned && typeof cfg.owned !== "undefined") { $creation.find('#cp-creation-owned').prop('checked', false); } UIElements.setExpirationValue(cfg.expire, $creation); + */ // Create the pad var getFormValues = function () { @@ -3537,6 +3553,11 @@ define([ link ]); + var dismiss = function () { + common.mailbox.dismiss(data, function (err) { + console.log(err); + }); + }; var answer = function (yes) { common.mailbox.sendTo("ADD_OWNER_ANSWER", { channel: msg.content.channel, @@ -3548,9 +3569,7 @@ define([ channel: msg.content.user.notifications, curvePublic: msg.content.user.curvePublic }); - common.mailbox.dismiss(data, function (err) { - console.log(err); - }); + dismiss(); }; var todo = function (yes) { @@ -3565,6 +3584,8 @@ define([ if (err) { var text = err === "INSUFFICIENT_PERMISSIONS" ? Messages.fm_forbidden : Messages.error; + console.error(err); + dismiss(); return void UI.warn(text); } UI.log(Messages.saved); diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index f3960f3b5..c8a78e054 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -945,6 +945,7 @@ define([ // Ctrl+A select all if (e.which === 65 && (e.ctrlKey || (e.metaKey && APP.isMac))) { + e.preventDefault(); $content.find('.cp-app-drive-element:not(.cp-app-drive-element-selected)') .each(function (idx, element) { selectElement($(element)); @@ -4204,7 +4205,8 @@ define([ if (!manager.isSharedFolder(el)) { name = path.path[path.path.length - 1]; folderEl = el; - downloadFolder(folderEl, name); + var sfId = manager.isInSharedFolder(path.path); + downloadFolder(folderEl, name, sfId); } // shared folder else { diff --git a/www/common/inner/access.js b/www/common/inner/access.js index d3084dbe6..f17767b61 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -804,7 +804,7 @@ define([ id: 'cp-app-prop-change-password', style: 'flex: 1;' }); - var passwordOk = h('button', Messages.properties_changePasswordButton); + var passwordOk = h('button.btn', Messages.properties_changePasswordButton); var changePass = h('span.cp-password-change-container', [ newPassword, passwordOk diff --git a/www/common/migrate-user-object.js b/www/common/migrate-user-object.js index 231c39ebd..b13aacb1c 100644 --- a/www/common/migrate-user-object.js +++ b/www/common/migrate-user-object.js @@ -499,7 +499,7 @@ define([ }, 500); progress(0, 0);*/ }).nThen(function () { - Realtime.whenRealtimeSyncs(store.realtime, Util.bake(cb)); + Realtime.whenRealtimeSyncs(store.realtime, Util.mkAsync(Util.bake(cb))); }); }; }); diff --git a/www/common/notifications.js b/www/common/notifications.js index fc72517fd..d1fbbaff9 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -83,7 +83,6 @@ define([ }; // Share pad - handlers['SHARE_PAD'] = function(common, data) { var content = data.content; var msg = content.msg; @@ -91,10 +90,22 @@ define([ var key = type === 'drive' ? 'notification_folderShared' : (type === 'file' ? 'notification_fileShared' : 'notification_padShared'); + + var teamNotification = /^team-/.test(data.type) && Number(data.type.slice(5)); + var teamName = ''; + if (teamNotification) { + var privateData = common.getMetadataMgr().getPrivateData(); + var teamsData = Util.tryParse(JSON.stringify(privateData.teams)) || {}; + var team = teamsData[teamNotification]; + if (!team || !team.name) { return; } + key += "Team"; + teamName = Util.fixHTML(team.name); + } + var name = Util.fixHTML(msg.content.name) || Messages.anonymous; var title = Util.fixHTML(msg.content.title); content.getFormatText = function() { - return Messages._getKey(key, [name, title]); + return Messages._getKey(key, [name, title, teamName]); }; content.handler = function() { var todo = function() { @@ -105,6 +116,9 @@ define([ if (msg.content.isTemplate) { common.sessionStorage.put(Constants.newPadPathKey, ['template'], waitFor()); } + if (teamNotification) { + common.sessionStorage.put(Constants.newPadTeamKey, teamNotification, waitFor()); + } common.sessionStorage.put('newPadPassword', msg.content.password || '', waitFor()); }).nThen(function() { todo(); diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6f9c74f27..8e43e42b1 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -56,6 +56,7 @@ define([ var DISPLAY_RESTORE_BUTTON = false; var NEW_VERSION = 2; var PENDING_TIMEOUT = 30000; + var READ_ONLY_REFRESH_DATA_DELAY = 15000; var debug = function (x) { if (!window.CP_DEV_MODE) { return; } @@ -122,7 +123,6 @@ define([ if (!state && !readOnly) { $('#cp-app-oo-editor').append(h('div#cp-app-oo-offline')); } - debug(state); }; var deleteOffline = function () { @@ -506,6 +506,87 @@ define([ }, to); }; + var loadInitDocument = function (type, useNewDefault) { + var newText; + switch (type) { + case 'sheet' : + newText = EmptyCell(useNewDefault); + break; + case 'oodoc': + newText = EmptyDoc(); + break; + case 'ooslide': + newText = EmptySlide(); + break; + default: + newText = ''; + } + return new Blob([newText], {type: 'text/plain'}); + }; + var loadLastDocument = function (lastCp, onCpError, cb) { + ooChannel.cpIndex = lastCp.index || 0; + var parsed = Hash.parsePadUrl(lastCp.file); + var secret = Hash.getSecrets('file', parsed.hash); + if (!secret || !secret.channel) { return; } + var hexFileName = secret.channel; + var fileHost = privateData.fileHost || privateData.origin; + var src = fileHost + Hash.getBlobPathFromHex(hexFileName); + var key = secret.keys && secret.keys.cryptKey; + var xhr = new XMLHttpRequest(); + xhr.open('GET', src, true); + xhr.responseType = 'arraybuffer'; + xhr.onload = function () { + if (/^4/.test('' + this.status)) { + onCpError(); + return void console.error('XHR error', this.status); + } + var arrayBuffer = xhr.response; + if (arrayBuffer) { + var u8 = new Uint8Array(arrayBuffer); + FileCrypto.decrypt(u8, key, function (err, decrypted) { + if (err) { return void console.error(err); } + var blob = new Blob([decrypted.content], {type: 'plain/text'}); + if (cb) { + return cb(blob, getFileType()); + } + startOO(blob, getFileType()); + }); + } + }; + xhr.onerror = function () { + onCpError(); + }; + xhr.send(null); + }; + + var refreshReadOnly = function () { + var cancel = h('button.cp-corner-cancel', Messages.cancel); + var reload = h('button.cp-corner-primary', [ + h('i.fa.fa-refresh'), + Messages.oo_refresh + ]); + + var actions = h('div', [cancel, reload]); + var m = UI.cornerPopup(Messages.oo_refreshText, actions, ''); + $(reload).click(function () { + ooChannel.ready = false; + var lastCp = getLastCp(); + loadLastDocument(lastCp, function () { + var file = getFileType(); + var type = common.getMetadataMgr().getPrivateData().ooType; + var blob = loadInitDocument(type, true); + resetData(blob, file); + }, function (blob, file) { + resetData(blob, file); + }); + delete APP.refreshPopup; + m.delete(); + }); + $(cancel).click(function () { + delete APP.refreshPopup; + m.delete(); + }); + }; var openRtChannel = function (cb) { if (rtChannel.ready) { return void cb(); } @@ -529,6 +610,18 @@ define([ break; case 'MESSAGE': if (ooChannel.ready) { + // In read-only mode, push the message to the queue and prompt + // the user to refresh OO (without reloading the page) + if (readOnly) { + ooChannel.queue.push(obj.data); + if (APP.refreshPopup) { return; } + APP.refreshPopup = true; + + // Don't "spam" the user instantly and no more than + // 1 popup every 15s + setTimeout(refreshReadOnly, READ_ONLY_REFRESH_DATA_DELAY); + return; + } ooChannel.send(obj.data.msg); ooChannel.lastHash = obj.data.hash; ooChannel.cpIndex++; @@ -986,8 +1079,10 @@ define([ ooChannel.queue.forEach(function (data) { ooChannel.send(data.msg); }); - var last = ooChannel.queue.pop(); - if (last) { ooChannel.lastHash = last.hash; } + if (!readOnly) { + var last = ooChannel.queue.pop(); + if (last) { ooChannel.lastHash = last.hash; } + } ooChannel.cpIndex += ooChannel.queue.length; // Apply existing locks deleteOfflineLocks(); @@ -1018,7 +1113,7 @@ define([ UI.openCustomModal(UI.dialog.customModal(div, {buttons: []})); setTimeout(function () { makeCheckpoint(true); - }, 1000); + }, 5000); } } } @@ -1028,6 +1123,9 @@ define([ if (ifr) { ifr.remove(); } }; + APP.UploadImageFiles = function (files, type, id, jwt, cb) { + cb('NO'); + }; APP.AddImage = function(cb1, cb2) { APP.AddImageSuccessCallback = cb1; APP.AddImageErrorCallback = cb2; @@ -1447,41 +1545,6 @@ define([ }, 100); }; - var loadLastDocument = function (lastCp, onCpError, cb) { - ooChannel.cpIndex = lastCp.index || 0; - var parsed = Hash.parsePadUrl(lastCp.file); - var secret = Hash.getSecrets('file', parsed.hash); - if (!secret || !secret.channel) { return; } - var hexFileName = secret.channel; - var fileHost = privateData.fileHost || privateData.origin; - var src = fileHost + Hash.getBlobPathFromHex(hexFileName); - var key = secret.keys && secret.keys.cryptKey; - var xhr = new XMLHttpRequest(); - xhr.open('GET', src, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = function () { - if (/^4/.test('' + this.status)) { - onCpError(); - return void console.error('XHR error', this.status); - } - var arrayBuffer = xhr.response; - if (arrayBuffer) { - var u8 = new Uint8Array(arrayBuffer); - FileCrypto.decrypt(u8, key, function (err, decrypted) { - if (err) { return void console.error(err); } - var blob = new Blob([decrypted.content], {type: 'plain/text'}); - if (cb) { - return cb(blob, getFileType()); - } - startOO(blob, getFileType()); - }); - } - }; - xhr.onerror = function () { - onCpError(); - }; - xhr.send(null); - }; var loadDocument = function (noCp, useNewDefault, i) { if (ooLoaded) { return; } var type = common.getMetadataMgr().getPrivateData().ooType; @@ -1511,7 +1574,7 @@ define([ default: newText = ''; } - var blob = new Blob([newText], {type: 'text/plain'}); + var blob = loadInitDocument(type, useNewDefault); startOO(blob, file); }; @@ -1788,10 +1851,10 @@ define([ var latest = getLastCp(true); var newLatest = getLastCp(); if (newLatest.index > latest.index) { + ooChannel.queue = []; var hasDrawings = checkDrawings(); if (hasDrawings) { ooChannel.ready = false; - ooChannel.queue = []; } // New checkpoint sframeChan.query('Q_OO_SAVE', { diff --git a/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js b/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js index 895f49624..32aeb5823 100644 --- a/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js +++ b/www/common/onlyoffice/v2a/sdkjs/cell/sdk-all-min.js @@ -624,10 +624,10 @@ url+'" method="POST" enctype="multipart/form-data">0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$12){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,base64FromWord:base64FromWord, -base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64, +base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;ic_oAscMaxCellOrCommentLength){isChange=true;var text=currentCellData[i].text;var format=currentCellData[i].format;var lengthOfText=text.length;var iterCount=Math.ceil(lengthOfText/c_oAscMaxCellOrCommentLength);var splitText; for(var j=0;j0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$17){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i0&&indexHtml>0&&index0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls= -[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt); -xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId, -jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, +return}}catch(err$2){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]); +var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+= +"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files, +documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i, url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type", file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i').html(data.content.getFormatText()).text(); @@ -173,20 +175,23 @@ define([ execCommand('SUBSCRIBE', null, function () {}); subscribed = true; } + var teams = types.indexOf('team') !== -1; if (typeof(cfg.onViewed) === "function") { onViewedHandlers.push(function (data) { - if (types.indexOf(data.type) === -1) { return; } + var type = data.type; + if (types.indexOf(type) === -1 && !(teams && /^team-/.test(type))) { return; } cfg.onViewed(data); }); } if (typeof(cfg.onMessage) === "function") { onMessageHandlers.push(function (data, el) { - if (types.indexOf(data.type) === -1) { return; } + var type = data.type; + if (types.indexOf(type) === -1 && !(teams && /^team-/.test(type))) { return; } cfg.onMessage(data, el); }); } Object.keys(history).forEach(function (type) { - if (types.indexOf(type) === -1) { return; } + if (types.indexOf(type) === -1 && !(teams && /^team-/.test(type))) { return; } history[type].forEach(function (data) { pushMessage({ type: type, diff --git a/www/common/toolbar.js b/www/common/toolbar.js index a4683a884..e55cdcf82 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -1025,7 +1025,7 @@ MessengerUI, Messages) { $button.addClass('fa-bell'); }; - Common.mailbox.subscribe(['notifications'], { + Common.mailbox.subscribe(['notifications', 'team'], { onMessage: function (data, el) { if (el) { $(div).prepend(el); diff --git a/www/common/translations/messages.ca.json b/www/common/translations/messages.ca.json index a10a9fffd..7bff4cb27 100644 --- a/www/common/translations/messages.ca.json +++ b/www/common/translations/messages.ca.json @@ -148,7 +148,6 @@ "or": "o", "tags_title": "Etiquetes (només vostres)", "tags_add": "Actualitza les etiquetes d'aquesta pàgina", - "tags_searchHint": "Inicieu una cerca amb # al vostre CryptDrive per trobar els vostres documents etiquetats.", "tags_notShared": "Les vostres etiquetes no es comparteixen amb altres persones usuàries", "tags_duplicate": "Etiquetes duplicades: {0}", "tags_noentry": "No podeu etiquetar un document esborrat!", diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 0ed8f0f91..3ab3680ea 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -21,7 +21,7 @@ "button_newslide": "Neue Präsentation", "button_newwhiteboard": "Neues Whiteboard", "button_newkanban": "Neues Kanban", - "common_connectionLost": "Die Verbindung zum Server ist abgebrochen
Du verwendest jetzt das Dokument schreibgeschützt, bis die Verbindung wieder funktioniert.", + "common_connectionLost": "Die Verbindung zum Server ist abgebrochen
Du kannst das Dokument nicht bearbeiten, bis die Verbindung wieder funktioniert.", "websocketError": "Verbindung zum Websocket fehlgeschlagen...", "typeError": "Dieses Dokument ist nicht mit der ausgewählten Anwendung kompatibel", "onLogout": "Du bist ausgeloggt. {0}Klicke hier{1}, um dich wieder einzuloggen,
oder drücke Escape, um dein Pad schreibgeschützt zu benutzen.", @@ -146,7 +146,6 @@ "or": "oder", "tags_title": "Tags (nur für dich)", "tags_add": "Tags der ausgewählten Pads bearbeiten", - "tags_searchHint": "Beginne die Suche in deinem CryptDrive mit #, um getaggte Dokumente zu finden.", "tags_notShared": "Deine Tags werden nicht mit anderen Benutzern geteilt", "tags_duplicate": "Doppeltes Tag: {0}", "tags_noentry": "Du kannst keine Tags zu einem gelöschten Pad hinzufügen!", @@ -1088,7 +1087,7 @@ "support_disabledTitle": "Support ist nicht aktiviert", "support_disabledHint": "Diese CryptPad-Instanz wurde noch nicht für die Verwendung eines Support-Formulars konfiguriert.", "support_cat_new": "Neues Ticket", - "support_formTitle": "Titel des Tickets", + "support_formTitle": "Neues Ticket", "support_formHint": "Mit diesem Formular kann ein neues Support-Ticket eröffnet werden. Es erlaubt die sichere Kontaktaufnahme mit den Administratoren zur Lösung von Problemen oder Beantwortung von Fragen. Bitte eröffne kein neues Ticket, wenn du bereits ein offenes Ticket bezüglich des gleichen Problems hast. Verwende stattdessen die Antworten-Schaltfläche, um weitere Informationen hinzuzufügen.", "support_formButton": "Absenden", "support_formTitleError": "Fehler: Titel ist leer", @@ -1124,7 +1123,7 @@ "properties_unknownUser": "{0} unbekannte(r) Benutzer", "fm_morePads": "Mehr", "fc_openInCode": "Im Code-Editor öffnen", - "uploadFolder_modal_title": "Optionen für Ordnerupload", + "uploadFolder_modal_title": "Optionen für Hochladen des Ordners", "uploadFolder_modal_filesPassword": "Passwort für Dateien", "uploadFolder_modal_owner": "Eigene Dateien", "uploadFolder_modal_forceSave": "Dateien im CryptDrive speichern", @@ -1182,7 +1181,7 @@ "team_rosterPromote": "Befördern", "team_rosterDemote": "Degradieren", "team_rosterKick": "Aus dem Team entfernen", - "team_inviteButton": "Kontakte einladen", + "team_inviteButton": "Mitglieder einladen", "team_leaveButton": "Dieses Team verlassen", "team_leaveConfirm": "Wenn du dieses Team verlässt, verlierst du den Zugriff auf das dazugehörige CryptDrive, den Chatverlauf und andere Inhalte. Bist du sicher?", "team_owner": "Eigentümer", @@ -1382,5 +1381,18 @@ "settings_safeLinkDefault": "Sichere Links sind nun standardmäßig aktiviert. Bitte verwende zum Kopieren von Links das Menü Teilen und nicht die Adressleiste des Browsers.", "info_imprintFlavour": "Rechtliche Informationen über die Administratoren dieses Servers.", "info_privacyFlavour": "Unsere Datenschutzerklärung beschreibt, wie wir deine Daten verarbeiten.", - "user_about": "Über CryptPad" + "user_about": "Über CryptPad", + "support_cat_all": "Alle", + "support_cat_other": "Anderes", + "support_cat_account": "Benutzerkonto", + "support_cat_data": "Datenverlust", + "notification_folderSharedTeam": "{0} hat einen Ordner mit dem Team {2} geteilt: {1}", + "notification_fileSharedTeam": "{0} hat eine Datei mit dem Team {2} geteilt: {1}", + "notification_padSharedTeam": "{0} hat ein Pad mit dem Team {2} geteilt: {1}", + "support_addAttachment": "Anhang hinzufügen", + "support_attachments": "Anhänge", + "support_cat_bug": "Fehlerbericht", + "oo_refresh": "Neu laden", + "support_category": "Wähle eine Kategorie", + "oo_refreshText": "Dieses Dokument wurde aktualisiert" } diff --git a/www/common/translations/messages.el.json b/www/common/translations/messages.el.json index 5f3f455c1..406a445f2 100644 --- a/www/common/translations/messages.el.json +++ b/www/common/translations/messages.el.json @@ -119,7 +119,6 @@ "or": "ή", "tags_title": "Ετικέτες (για εσάς μόνο)", "tags_add": "Ενημερώστε τις ετικέτες αυτής της σελίδας", - "tags_searchHint": "Ξεκινήστε μια αναζήτηση με το σύμβολο # στο CryptDrive σας για να βρείτε pads με ετικέτες.", "tags_notShared": "Οι ετικέτες σας δεν μοιράζονται με άλλους χρήστες", "tags_duplicate": "Διπλή ετικέτα: {0}", "tags_noentry": "Δεν μπορείτε να βάλετε ετικέτα σε διεγραμένο pad!", diff --git a/www/common/translations/messages.es.json b/www/common/translations/messages.es.json index 83ccb01e5..bc526986d 100644 --- a/www/common/translations/messages.es.json +++ b/www/common/translations/messages.es.json @@ -472,7 +472,6 @@ "printBackgroundRemove": "Eliminar este fondo de pantalla", "tags_title": "Etiquetas (sólo para tí)", "tags_add": "Actualizar las etiquetas de esta página", - "tags_searchHint": "Comenzar una búsqueda con # en tú CryptDrive para encontrar las notas etiquetadas.", "tags_notShared": "Tus etiquetas no están compartidas con otros usuarios", "tags_duplicate": "Duplicar etiquetas:{0}", "tags_noentry": "No puedes etiquetar una nota eliminada!", diff --git a/www/common/translations/messages.fi.json b/www/common/translations/messages.fi.json index 8a4e36139..0022dc74c 100644 --- a/www/common/translations/messages.fi.json +++ b/www/common/translations/messages.fi.json @@ -151,7 +151,6 @@ "or": "tai", "tags_title": "Tunnisteet (vain sinulle)", "tags_add": "Päivitä sivun tunnisteet", - "tags_searchHint": "Aloita hakusi CryptDrivessa #-merkillä löytääksesi tunnisteita sisältävät padit.", "tags_notShared": "Tunnisteitasi ei jaeta muiden käyttäjien kanssa", "tags_duplicate": "Kaksinkertainen tunniste: {0}", "tags_noentry": "Et voi lisätä tunnistetta poistettuun padiin!", diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index f38f3f5ef..f4272d26a 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -148,7 +148,6 @@ "or": "ou", "tags_title": "Mots-clés du pad (pour vous uniquement)", "tags_add": "Modifier les mots-clés de la sélection", - "tags_searchHint": "Commencez une recherche par # dans votre CryptDrive pour retrouver vos pads par mot-clé.", "tags_notShared": "Vos mots-clés ne sont pas partagés avec les autres utilisateurs", "tags_duplicate": "Mot-clé déjà présent : {0}", "tags_noentry": "Vous ne pouvez pas ajouter de mots-clés à un pad supprimé !", @@ -1087,7 +1086,7 @@ "support_disabledTitle": "Le support n'est pas activé", "support_disabledHint": "Cette instance de CryptPad n'est pas encore configurée pour utiliser le formulaire de support.", "support_cat_new": "Nouveau ticket", - "support_formTitle": "Titre du ticket", + "support_formTitle": "Nouveau Ticket", "support_formButton": "Envoyer", "support_formTitleError": "Erreur : le titre est vide", "support_formContentError": "Erreur : le contenu est vide", @@ -1165,7 +1164,7 @@ "team_inviteModalButton": "Inviter", "team_pcsSelectLabel": "Sauver dans", "team_pcsSelectHelp": "Créer un pad dans le drive d'une équipe rend cette équipe propriétaire du pad si l'option est cochée.", - "team_invitedToTeam": "{0} vous à inviter à rejoindre l'équipe : {1}", + "team_invitedToTeam": "{0} vous a invité à rejoindre l'équipe : {1}", "team_kickedFromTeam": "{0} vous a exclu de l'équipe : {1}", "team_acceptInvitation": "{0} a accepté votre offre de rejoindre l'équipe : {1}", "team_declineInvitation": "{0} a refusé votre offre de rejoindre l'équipe : {1}", @@ -1184,7 +1183,7 @@ "team_rosterPromote": "Promouvoir", "team_rosterDemote": "Rétrograder", "team_rosterKick": "Expulser de l'équipe", - "team_inviteButton": "Inviter des contacts", + "team_inviteButton": "Inviter des membres", "team_leaveButton": "Quitter cette équipe", "team_leaveConfirm": "Si vous quittez cette équipe, vous perdrez l'accès à son CryptDrive, son chat et les autres contenus. Êtes-vous sûr ?", "team_owner": "Propriétaires", @@ -1382,5 +1381,18 @@ "support_languagesPreamble": "L'équipe de support parle les langues suivantes :", "info_privacyFlavour": "Description de la confidentialité de vos données.", "user_about": "À propos de CryptPad", - "info_imprintFlavour": "Informations légales sur les administateurs de cette instance." + "info_imprintFlavour": "Informations légales sur les administateurs de cette instance.", + "support_cat_all": "Tout", + "support_cat_other": "Autre", + "support_cat_bug": "Rapport de bug", + "support_cat_data": "Perte de données", + "support_cat_account": "Compte utilisateur", + "notification_folderSharedTeam": "{0} a partagé un dossier avec l'équipe {2} : {1}", + "notification_fileSharedTeam": "{0} a partagé un fichier avec l'équipe {2} : {1}", + "notification_padSharedTeam": "{0} a partagé un pad avec l'équipe {2} : {1}", + "support_addAttachment": "Ajouter une pièce jointe", + "support_attachments": "Pièces jointes", + "oo_refreshText": "Ce document a été mis à jour", + "oo_refresh": "Recharger", + "support_category": "Choisir une catégorie" } diff --git a/www/common/translations/messages.it.json b/www/common/translations/messages.it.json index 16fca3d13..5c654c94d 100644 --- a/www/common/translations/messages.it.json +++ b/www/common/translations/messages.it.json @@ -148,7 +148,6 @@ "or": "o", "tags_title": "Tag (mostrati solo a te)", "tags_add": "Aggiorna i tag di questa pagina", - "tags_searchHint": "Inizia una ricerca con # nel tuo CryptDrive per trovare i pad taggati.", "tags_notShared": "I tuoi tag non sono condivisi con altri utenti", "tags_duplicate": "Duplica tag: {0}", "tags_noentry": "Non puoi taggare un pad eliminato!", diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index 5cad912da..d99fd8d18 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -151,7 +151,6 @@ "or": "or", "tags_title": "Tags (for you only)", "tags_add": "Update the tags for selected pads", - "tags_searchHint": "Start a search with # in your CryptDrive to find your tagged pads.", "tags_notShared": "Your tags are not shared with other users", "tags_duplicate": "Duplicate tag: {0}", "tags_noentry": "You can't tag a deleted pad!", @@ -1109,7 +1108,7 @@ "support_disabledTitle": "Support is not enabled", "support_disabledHint": "This CryptPad instance is not yet configured to use a support form.", "support_cat_new": "New ticket", - "support_formTitle": "Ticket title", + "support_formTitle": "New Ticket", "support_formHint": "This form can be used to create a new support ticket. Use it to contact the administrators to solve issues or ask any question in a secure way. Please don't create a new ticket if you already have an open ticket about the same issue, but use the reply button to provide more information.", "support_formButton": "Send", "support_formTitleError": "Error: title is empty", @@ -1188,7 +1187,7 @@ "team_rosterPromote": "Promote", "team_rosterDemote": "Demote", "team_rosterKick": "Kick from the team", - "team_inviteButton": "Invite contacts", + "team_inviteButton": "Invite members", "team_leaveButton": "Leave this team", "team_leaveConfirm": "If you leave this team you will lose access to its CryptDrive, chat history, and other contents. Are you sure?", "team_owner": "Owners", @@ -1382,5 +1381,18 @@ "settings_safeLinkDefault": "Safe Links are now turned on by default. Please use the Share menu to copy links rather than your browser's address bar.", "info_imprintFlavour": "Legal information about the administrators of this instance.", "user_about": "About CryptPad", - "info_privacyFlavour": "Our privacy policy describes how we treat your data." + "info_privacyFlavour": "Our privacy policy describes how we treat your data.", + "support_cat_account": "User account", + "support_cat_data": "Loss of content", + "support_cat_bug": "Bug report", + "support_cat_other": "Other", + "support_cat_all": "All", + "support_attachments": "Attachments", + "support_addAttachment": "Add attachment", + "notification_padSharedTeam": "{0} has shared a pad with the team {2}: {1}", + "notification_fileSharedTeam": "{0} has shared a file with the team {2}: {1}", + "notification_folderSharedTeam": "{0} has shared a folder with the team {2}: {1}", + "oo_refresh": "Refresh", + "oo_refreshText": "This document has been updated", + "support_category": "Choose a category" } diff --git a/www/common/translations/messages.nb.json b/www/common/translations/messages.nb.json index 881bcc8df..5a59a7829 100644 --- a/www/common/translations/messages.nb.json +++ b/www/common/translations/messages.nb.json @@ -140,7 +140,6 @@ "or": "eller", "tags_title": "Tags (kun for ditt bruk)", "tags_add": "Oppdater tags for denne sida", - "tags_searchHint": "Søk med # i CryptDriven din for å finne pads med slike tags.", "tags_notShared": "Dine tags deles ikke med andre brukerer", "tags_duplicate": "Dupliser tag:{0}", "tags_noentry": "Du kan ikke tagge en sletta pad!", diff --git a/www/common/translations/messages.nl.json b/www/common/translations/messages.nl.json index e2da9e201..124e3dc0c 100644 --- a/www/common/translations/messages.nl.json +++ b/www/common/translations/messages.nl.json @@ -74,7 +74,6 @@ "tags_noentry": "U kunt een verwijderde werkomgeving niet markeren!", "tags_duplicate": "Gedupliceerde markering: {0}", "tags_notShared": "Uw markeringen worden niet gedeeld met andere gebruikers", - "tags_searchHint": "Begin een zoekopdracht met # in uw CryptDrive om gemarkeerde werkomgevingen te vinden.", "tags_add": "Werk de markeringen van deze pagina bij", "tags_title": "Markeringen (alleen voor u)", "or": "of", diff --git a/www/common/translations/messages.pt-br.json b/www/common/translations/messages.pt-br.json index f0747694d..e10f3e3c7 100644 --- a/www/common/translations/messages.pt-br.json +++ b/www/common/translations/messages.pt-br.json @@ -392,7 +392,6 @@ "or": "", "tags_title": "", "tags_add": "", - "tags_searchHint": "", "tags_notShared": "", "tags_duplicate": "", "tags_noentry": "", diff --git a/www/common/translations/messages.ro.json b/www/common/translations/messages.ro.json index 190f3250a..14c4aefe0 100644 --- a/www/common/translations/messages.ro.json +++ b/www/common/translations/messages.ro.json @@ -382,7 +382,6 @@ "or": "sau", "tags_title": "Etichete (doar pentru tine)", "tags_add": "Updatează etichetele acestei pagini", - "tags_searchHint": "Începe o căutare cu # în CryptDrive-ul tău pentru a găsi pad-uri etichetate", "tags_notShared": "Etichetele tale nu sunt împărțite cu alți utilizatori", "tags_duplicate": "Duplică eticheta: {0}", "tags_noentry": "Nu poți eticheta un pad șters", diff --git a/www/common/translations/messages.ru.json b/www/common/translations/messages.ru.json index 865394b94..b0b1dbe1b 100644 --- a/www/common/translations/messages.ru.json +++ b/www/common/translations/messages.ru.json @@ -140,7 +140,6 @@ "or": "или", "tags_title": "Теги (только для вас)", "tags_add": "Обновить теги страницы", - "tags_searchHint": "Начните поиск в вашем CryptDrive при помощи # чтобы найти пэды с тегами.", "tags_notShared": "Ваши теги не разделяются с другими пользователями", "button_newsheet": "Новый Лист", "newButtonTitle": "создать новую запись", diff --git a/www/common/translations/messages.sv.json b/www/common/translations/messages.sv.json index 85a199284..8876beebf 100644 --- a/www/common/translations/messages.sv.json +++ b/www/common/translations/messages.sv.json @@ -38,7 +38,6 @@ "tags_noentry": "Du kan inte tagga ett raderat dokument!", "tags_duplicate": "Duplicera tagg: {0}", "tags_notShared": "Dina taggar är inte delade med andra användare", - "tags_searchHint": "Påbörja en sökning med # i din CryptDrive för att hitta dina taggade dokument.", "tags_add": "Uppdatera taggar för denna sida", "tags_title": "Taggar (endast för dig)", "or": "eller", diff --git a/www/contacts/app-contacts.less b/www/contacts/app-contacts.less index 88a93ae9d..99b927b6c 100644 --- a/www/contacts/app-contacts.less +++ b/www/contacts/app-contacts.less @@ -1,7 +1,6 @@ @import (reference) '../../customize/src/less2/include/framework.less'; @import (reference) '../../customize/src/less2/include/messenger.less'; @import (reference) '../../customize/src/less2/include/avatar.less'; -@import (reference) '../../customize/src/less2/include/buttons.less'; // body &.cp-app-contacts { @@ -19,9 +18,6 @@ display: flex; // We need this to remove a 3px border at the bottom of the toolbar } - .cp-app-contacts-friends { - .buttons_main(); - } .cp-contacts-muted-table { .avatar_main(50px); .cp-contacts-muted-user { @@ -33,8 +29,6 @@ } } - - .messenger_main(); } diff --git a/www/kanban/app-kanban.less b/www/kanban/app-kanban.less index f0af6eeca..879121be7 100644 --- a/www/kanban/app-kanban.less +++ b/www/kanban/app-kanban.less @@ -3,7 +3,6 @@ @import (reference) "../../customize/src/less2/include/tools.less"; @import (reference) "../../customize/src/less2/include/markdown.less"; @import (reference) "../../customize/src/less2/include/avatar.less"; -@import (reference) "../../customize/src/less2/include/buttons.less"; // body &.cp-app-kanban { @@ -142,6 +141,8 @@ .kanban-edit-item { padding: 5px; + border: 0; + background: transparent; align-self: flex-start; } @@ -310,7 +311,6 @@ position: relative; min-height: 50px; .cp-kanban-filterTags { - .buttons_main(); display: inline-flex; align-items: center; flex: 1; @@ -346,7 +346,7 @@ margin-left: 10px; display: flex; flex-wrap: wrap; - &:not(:empty) { + &:not(.cp-empty) { margin-top: -5px; } em { diff --git a/www/kanban/inner.js b/www/kanban/inner.js index 10db6261b..f328c3bc8 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -503,7 +503,7 @@ define([ $container.find('.kanban-item').each(function (i, el) { var itemId = $(el).attr('data-eid'); $('