From d13885bb0883bc0c666cb246982bd94f4b46e794 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 28 Apr 2021 18:21:11 +0200 Subject: [PATCH 01/14] Add XXX --- www/common/sframe-common-file.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/sframe-common-file.js b/www/common/sframe-common-file.js index 2a6f4fea3..4274a5538 100644 --- a/www/common/sframe-common-file.js +++ b/www/common/sframe-common-file.js @@ -129,6 +129,7 @@ define([ var l = privateData.plan ? ApiConfig.premiumUploadSize : false; l = l || ApiConfig.maxUploadSize || "?"; var maxSizeStr = Util.bytesToMegabytes(l); + // XXX blob.byteLength is wrong: we should use the lenght of the encrypted content (see whiteboard) if (blob && blob.byteLength && typeof(l) === "number" && blob.byteLength > l) { $pv.text(Messages.error); queue.inProgress = false; From db65659afb0b8ef03bb6467ef76eda8c785fd840 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 28 Apr 2021 18:21:28 +0200 Subject: [PATCH 02/14] Fix small OO bugs --- www/common/cryptpad-common.js | 5 +++++ www/common/onlyoffice/inner.js | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 7d6fee8b7..63ca53f1c 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -2374,9 +2374,14 @@ define([ }; postMsg('INIT'); + /* window.addEventListener('beforeunload', function () { postMsg('CLOSE'); }); + */ + window.addEventListener('unload', function () { + postMsg('CLOSE'); + }); } else if (false && !noWorker && !noSharedWorker && 'serviceWorker' in navigator) { var initializing = true; var stopWaiting = waitFor2(); // Call this function when we're ready diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 120b07e46..b88d98617 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -2202,20 +2202,22 @@ define([ } }; + var wasEditing = false; var setStrictEditing = function () { if (APP.isFast) { return; } var editor = getEditor(); - var isModified = editor.asc_isDocumentModified || editor.isDocumentModified; - var editing = isModified(); + var editing = editor.asc_isDocumentModified ? editor.asc_isDocumentModified() : editor.isDocumentModified(); if (editing) { evOnPatch.fire(); } else { evOnSync.fire(); } + wasEditing = Boolean(editing); }; APP.onFastChange = function (isFast) { APP.isFast = isFast; if (isFast) { + wasEditing = false; if (APP.hasChangedInterval) { window.clearInterval(APP.hasChangedInterval); } @@ -2562,6 +2564,7 @@ define([ sframeChan.event("EV_CORRUPTED_CACHE"); }; + var firstReady = true; config.onReady = function (info) { if (APP.realtime !== info.realtime) { APP.realtime = info.realtime; @@ -2671,8 +2674,12 @@ define([ setMyId(); oldHashes = JSON.parse(JSON.stringify(content.hashes)); initializing = false; - common.openPadChat(APP.onLocal); + // Only execute the following code the first time we call onReady + if (!firstReady) { return void setEditable(!readOnly); } + firstReady = false; + + common.openPadChat(APP.onLocal); if (!readOnly) { var cursors = {}; From ec05bd8e176076669cc97f45d2d53f62495fb43b Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 29 Apr 2021 07:09:38 +0530 Subject: [PATCH 03/14] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8cd7e208..7b6a59683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ * /report/ page * broadcast channel included in pin list * fix package-lock to use server update +* code app present mode fix +* sheets + * lock sheets faster when applying checkpoints + * guard against undefined checkpoints + * don't spam users with prompts to checkpoints when they can't # 4.4.0 From 79f49fd847f067ae43ee619ffb511be5c134f9fe Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 29 Apr 2021 14:51:24 +0530 Subject: [PATCH 04/14] remove XXX notes concerning color overrides --- www/calendar/app-calendar.less | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www/calendar/app-calendar.less b/www/calendar/app-calendar.less index 1ec6c295b..d48914532 100644 --- a/www/calendar/app-calendar.less +++ b/www/calendar/app-calendar.less @@ -74,23 +74,23 @@ color: @cp_calendar-now-fg !important; } .tui-full-calendar-weekday-schedule-time .tui-full-calendar-weekday-schedule-title { - color: @cryptpad_text_col !important; // XXX + color: @cryptpad_text_col !important; } .tui-full-calendar-extra-date { .tui-full-calendar-weekday-grid-date { - color: @cp_sidebar-hint !important; // XXX + color: @cp_sidebar-hint !important; opacity: 0.5; } } .tui-full-calendar-weekday-grid-date { - color: @cryptpad_text_col !important; // XXX + color: @cryptpad_text_col !important; } .tui-full-calendar-month-dayname-item span { - color: @cryptpad_text_col !important; // XXX + color: @cryptpad_text_col !important; } } .tui-full-calendar-dayname * { - color: @cryptpad_text_col !important; // XXX + color: @cryptpad_text_col !important; } .tui-full-calendar-month-more { background-color: @cp_sidebar-right-bg !important; From a603b7b365a9271112ac94386571e5a4045ea1bf Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 29 Apr 2021 15:02:28 +0530 Subject: [PATCH 05/14] reenable rich text links PR settings --- www/settings/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index 758b90069..00956fc67 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -84,7 +84,7 @@ define([ 'cp-settings-pad-width', 'cp-settings-pad-spellcheck', 'cp-settings-pad-notif', - //'cp-settings-pad-openlink', // XXX test, translate and re-enable + 'cp-settings-pad-openlink', // XXX test, translate and re-enable ], 'code': [ // Msg.settings_cat_code 'cp-settings-code-indent-unit', From 9598ffcc4410f61eee3ea5110d82a73c2b3f837e Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 29 Apr 2021 13:11:32 +0200 Subject: [PATCH 06/14] Translated using Weblate (French) Currently translated at 100.0% (1227 of 1227 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 48 +++++++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index dab1481dd..fe6183ee0 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -1165,7 +1165,7 @@ "admin_broadcastCancel": "Effacer le message", "admin_broadcastActive": "Message actif", "admin_broadcastButton": "Envoyer", - "admin_broadcastHint": "Envoyez un message à tous les utilisateurs de cette instance. Tous les utilisateurs existants et nouveaux le recevront sous forme de notification. Prévisualisez les messages avant de les envoyer avec Aperçu de la notification. Les aperçus de notifications ont une icône rouge et ne sont visibles que par vous.", + "admin_broadcastHint": "Envoyez un message à tous les utilisateurs de cette instance. Tous les utilisateurs existants et nouveaux le recevront sous forme de notification. Prévisualisez les messages avant de les envoyer avec \"Aperçu de la notification\". Les aperçus de notifications ont une icône rouge et ne sont visibles que par vous.", "admin_broadcastTitle": "Message d'annonce", "broadcast_surveyURL": "Lien vers l'enquête", "admin_surveyActive": "Ouvrir l'enquête", @@ -1183,5 +1183,49 @@ "admin_maintenanceTitle": "Maintenance", "admin_cat_broadcast": "Annonces", "oo_cantMigrate": "Ce tableur dépasse la taille maximale de téléchargement et est trop grand pour être mis à jour.", - "footer_roadmap": "Feuille de route" + "footer_roadmap": "Feuille de route", + "calendar_noNotification": "Aucun", + "calendar_addNotification": "Ajouter rappel", + "calendar_notifications": "Rappels", + "settings_notifCalendarCheckbox": "Activer les notifications d'agenda", + "settings_notifCalendarHint": "Activer/désactiver les notifications pour les évenements à venir.", + "settings_notifCalendarTitle": "Notifications de calendrier", + "reminder_date": "{0} le {1}", + "reminder_time": "{0} aujourd'hui à {1}", + "reminder_minutes": "{0} commencera dans {1} minute(s)", + "reminder_inProgressAllDay": "Aujourd'hui : {0}", + "reminder_inProgress": "{0} a commencé à {1}", + "reminder_now": "{0} a commencé", + "reminder_missed": "{0} a eu lieu le {1}", + "calendar_more": "{0} de plus", + "calendar_days": "Jours", + "calendar_hours": "Heures", + "calendar_minutes": "Minutes", + "calendar_allDay": "Journée entière", + "calendar_location": "Lieu : {0}", + "calendar_loc": "Lieu", + "calendar_title": "Titre", + "calendar_update": "Modifier", + "calendar_dateTimeRange": "{0} {1} - {2}", + "calendar_dateRange": "{0} - {1}", + "calendar_newEvent": "Nouvel évènement", + "calendar_import": "Ajouter à mes calendriers", + "calendar_errorNoCalendar": "Aucun agenda modifiable sélectionné", + "calendar_deleteOwned": "Il restera accessible pour les autres utilisateurs avec qui il a été partagé.", + "calendar_deleteTeamConfirm": "Êtes-vous sûr de vouloir supprimer ce calendrier de l'équipe ?", + "calendar_deleteConfirm": "Êtes-vous sûr de vouloir supprimer ce calendrier de votre compte ?", + "calendar_today": "Aujourd'hui", + "calendar_month": "Mois", + "calendar_week": "Semaine", + "calendar_day": "Jour", + "calendar_new": "Nouvel agenda", + "calendar_default": "Mon agenda", + "calendar": "Agenda", + "calendar_before": "avant", + "calendar_weekNumber": "Semaine {0}", + "calendar_import_temp": "Importer ce calendrier", + "pad_goToAnchor": "Aller à cette ancre", + "settings_padOpenLinkLabel": "Activer l'ouverture directe des liens", + "settings_padOpenLinkHint": "Cette option permet d'ouvrir les liens dans un document texte sans fenêtre d’aperçu", + "settings_padOpenLinkTitle": "Ouvrir les lien avec un seul clic" } From 234b148bf5ca8f4007bb70aa19253455e6eee245 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 29 Apr 2021 13:11:32 +0200 Subject: [PATCH 07/14] Translated using Weblate (English) Currently translated at 100.0% (1227 of 1227 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1227 of 1227 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1226 of 1226 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1225 of 1225 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1224 of 1224 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1223 of 1223 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1222 of 1222 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1221 of 1221 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1220 of 1220 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1219 of 1219 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1218 of 1218 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1217 of 1217 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1216 of 1216 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1215 of 1215 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1214 of 1214 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1213 of 1213 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1212 of 1212 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1211 of 1211 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1210 of 1210 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1209 of 1209 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1208 of 1208 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1207 of 1207 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1206 of 1206 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1205 of 1205 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1204 of 1204 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1203 of 1203 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1202 of 1202 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1201 of 1201 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1200 of 1200 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1199 of 1199 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1198 of 1198 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1197 of 1197 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1196 of 1196 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1195 of 1195 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1194 of 1194 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1193 of 1193 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1192 of 1192 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1191 of 1191 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1190 of 1190 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1189 of 1189 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1188 of 1188 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1187 of 1187 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1187 of 1187 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 47 +++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index a725cb012..7ac2ed880 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -436,7 +436,7 @@ "settings_padSpellcheckLabel": "Enable spell check in rich text pads", "settings_padOpenLinkTitle": "Open links on first click", "settings_padOpenLinkHint": "With this option you can open embedded links on click without the preview popup", - "settings_padOpenLinkLabel": "Enable direct link opening rich text pads", + "settings_padOpenLinkLabel": "Enable direct link opening", "settings_ownDriveTitle": "Update Account", "settings_ownDriveHint": "Older accounts do not have access to the latest features, due to technical reasons. A free update will enable current features, and prepare your CryptDrive for future updates.", "settings_ownDriveButton": "Upgrade your account", @@ -1174,7 +1174,7 @@ "admin_surveyActive": "Open survey", "broadcast_surveyURL": "Survey link", "admin_broadcastTitle": "Broadcast message", - "admin_broadcastHint": "Send a message to all users on this instance. All existing and new users will receive it as a notification. Preview messages before sending them with Preview notification. Preview notifications have a red icon and are visible only to you.", + "admin_broadcastHint": "Send a message to all users on this instance. All existing and new users will receive it as a notification. Preview messages before sending them with \"Preview notification\". Preview notifications have a red icon and are visible only to you.", "admin_broadcastButton": "Send", "admin_broadcastActive": "Active message", "admin_broadcastCancel": "Delete message", @@ -1186,5 +1186,46 @@ "settings_deleteContinue": "Delete my account", "settings_deleteSubscription": "Manage my subscription", "footer_roadmap": "Roadmap", - "oo_cantMigrate": "This sheet exceeds the maximum upload size and is too large to be migrated." + "oo_cantMigrate": "This sheet exceeds the maximum upload size and is too large to be migrated.", + "pad_goToAnchor": "Go to anchor", + "calendar_import_temp": "Import this calendar", + "calendar_weekNumber": "Week {0}", + "calendar_before": "before", + "calendar": "Calendar", + "calendar_default": "My calendar", + "calendar_new": "New calendar", + "calendar_day": "Day", + "calendar_week": "Week", + "calendar_month": "Month", + "calendar_today": "Today", + "calendar_deleteConfirm": "Are you sure you want to delete this calendar from your account?", + "calendar_deleteTeamConfirm": "Are you sure you want to delete this calendar from the team?", + "calendar_deleteOwned": "It will remain visible to other users it has been shared with.", + "calendar_errorNoCalendar": "No editable calendar selected", + "calendar_import": "Add to my calendars", + "calendar_newEvent": "New event", + "calendar_dateRange": "{0} - {1}", + "calendar_dateTimeRange": "{0} {1} - {2}", + "calendar_update": "Update", + "calendar_title": "Title", + "calendar_loc": "Location", + "calendar_location": "Location: {0}", + "calendar_allDay": "All day", + "calendar_minutes": "Minutes", + "calendar_hours": "Hours", + "calendar_days": "Days", + "calendar_more": "{0} more", + "reminder_missed": "{0} took place on {1}", + "reminder_now": "{0} has started", + "reminder_inProgress": "{0} has started on {1}", + "reminder_inProgressAllDay": "Today: {0}", + "reminder_minutes": "{0} will start in {1} minute(s)", + "reminder_time": "{0} today at {1}", + "reminder_date": "{0} on {1}", + "settings_notifCalendarTitle": "Calendar notifications", + "settings_notifCalendarHint": "Enable/disable all notifications for upcoming calendar events.", + "settings_notifCalendarCheckbox": "Enable calendar notifications", + "calendar_notifications": "Reminders", + "calendar_addNotification": "Add reminder", + "calendar_noNotification": "None" } From 7e8d26e66835c1070cd44ea8f349070b52d3d32d Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 29 Apr 2021 17:04:37 +0200 Subject: [PATCH 08/14] Store in CryptDrive from File menu --- www/common/common-interface.js | 2 +- www/common/common-ui-elements.js | 33 ++++++++++++++++++++++++++++++ www/common/sframe-app-framework.js | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 9711de3fa..dbcb089f3 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1434,13 +1434,13 @@ define([ */ UI.createDrawer = function ($button, $content) { $button.click(function () { + var topPos = $button[0].getBoundingClientRect().bottom; $content.toggle(); $button.removeClass('cp-toolbar-button-active'); if ($content.is(':visible')) { $button.addClass('cp-toolbar-button-active'); $content.focus(); var wh = $(window).height(); - var topPos = $button[0].getBoundingClientRect().bottom; $content.css('max-height', Math.floor(wh - topPos - 1)+'px'); } }); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 471bd5011..5cac87c97 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -788,6 +788,30 @@ define([ h('span.cp-toolbar-name.cp-toolbar-drawer-element', Messages.toolbar_savetodrive) ])).click(common.prepareFeedback(type)); break; + case 'storeindrive': + Messages.toolbar_storeInDrive = "Store in CryptDrive"; // XXX + button = $(h('button.cp-toolbar-storeindrive', { + style: 'display:none;' + }, [ + h('i.fa.fa-hdd-o'), + h('span.cp-toolbar-name.cp-toolbar-drawer-element', Messages.toolbar_storeInDrive) + ])).click(common.prepareFeedback(type)).click(function () { + $(button).hide(); + common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) { + waitingForStoringCb = false; + var error = err || (obj && obj.error); + if (error) { + $(button).show(); + if (error === 'E_OVER_LIMIT') { + return void UI.warn(Messages.pinLimitReached); + } + return void UI.warn(Messages.autostore_error); + } + $(document).trigger('cpPadStored'); + UI.log(Messages.autostore_saved); + }); + }); + break; case 'hashtag': button = $('