diff --git a/bower.json b/bower.json index 3ad7d88d2..9fd787c20 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,7 @@ "ckeditor": "4.14.0", "codemirror": "^5.19.0", "requirejs": "2.3.5", - "marked": "0.5.0", + "marked": "1.1.0", "rangy": "rangy-release#~1.3.0", "json.sortify": "~2.1.0", "secure-fabric.js": "secure-v1.7.9", diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index a7ad90f11..0187cf74b 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -9,5 +9,7 @@ define(['/common/application_config_internal.js'], function (AppConfig) { // Example: If you want to remove the survey link in the menu: // AppConfig.surveyURL = ""; + AppConfig.supportLanguages = [ 'en', 'fr' ]; // XXX + return AppConfig; }); diff --git a/customize.dist/fonts/cptools/fonts/cptools.svg b/customize.dist/fonts/cptools/fonts/cptools.svg index 93eef8d38..3540c5d06 100644 --- a/customize.dist/fonts/cptools/fonts/cptools.svg +++ b/customize.dist/fonts/cptools/fonts/cptools.svg @@ -26,4 +26,6 @@ + + \ No newline at end of file diff --git a/customize.dist/fonts/cptools/fonts/cptools.ttf b/customize.dist/fonts/cptools/fonts/cptools.ttf index 18338a9ee..2788cf010 100644 Binary files a/customize.dist/fonts/cptools/fonts/cptools.ttf and b/customize.dist/fonts/cptools/fonts/cptools.ttf differ diff --git a/customize.dist/fonts/cptools/fonts/cptools.woff b/customize.dist/fonts/cptools/fonts/cptools.woff index d8f56ba86..64b641b9d 100644 Binary files a/customize.dist/fonts/cptools/fonts/cptools.woff and b/customize.dist/fonts/cptools/fonts/cptools.woff differ diff --git a/customize.dist/fonts/cptools/style.css b/customize.dist/fonts/cptools/style.css index 349b62f2b..85ed350f5 100644 --- a/customize.dist/fonts/cptools/style.css +++ b/customize.dist/fonts/cptools/style.css @@ -1,11 +1,12 @@ @font-face { font-family: 'cptools'; src: - url('fonts/cptools.ttf?cljhos') format('truetype'), - url('fonts/cptools.woff?cljhos') format('woff'), - url('fonts/cptools.svg?cljhos#cptools') format('svg'); + url('fonts/cptools.ttf?da4x1y') format('truetype'), + url('fonts/cptools.woff?da4x1y') format('woff'), + url('fonts/cptools.svg?da4x1y#cptools') format('svg'); font-weight: normal; font-style: normal; + font-display: block; } .cptools { @@ -24,6 +25,12 @@ -moz-osx-font-smoothing: grayscale; } +.cptools-add-bottom:before { + content: "\e913"; +} +.cptools-add-top:before { + content: "\e914"; +} .cptools-folder-upload:before { content: "\e912"; } diff --git a/customize.dist/src/less2/include/app-print.less b/customize.dist/src/less2/include/app-print.less index 6ff8964eb..e4c344b20 100644 --- a/customize.dist/src/less2/include/app-print.less +++ b/customize.dist/src/less2/include/app-print.less @@ -21,7 +21,6 @@ } * { visibility: hidden; - height: auto; max-height: none; } .cp-app-slide-viewer #cp-app-slide-print { diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 61a114a68..50249baa8 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -20,7 +20,7 @@ define(function() { * users and these users will be redirected to the login page if they still try to access * the app */ - config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications']; + config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications', 'support']; /* CryptPad is available is multiple languages, but only English and French are maintained * by the developers. The other languages may be outdated, and any missing string for a langauge diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 79951c3c5..6ddf0a320 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -377,6 +377,14 @@ define([ field.focus(); }); + var $field = field.tokenfield.closest('.tokenfield').find('.token-input'); + $field.on('keypress', function (e) { + if (!$field.val() && e.which === 13) { return void $ok.click(); } + }); + $field.on('keydown', function (e) { + if (!$field.val() && e.which === 27) { return void $cancel.click(); } + }); + return tagger; }; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 9b15659d6..b3ab9ee53 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -46,28 +46,69 @@ define([ return mB + Messages.MB; }; - UIElements.updateTags = function (common, href) { + UIElements.updateTags = function (common, hrefs) { var existing, tags; + var allTags = {}; + if (!hrefs || typeof (hrefs) === "string") { + hrefs = [hrefs]; + } NThen(function(waitFor) { common.getSframeChannel().query("Q_GET_ALL_TAGS", null, waitFor(function(err, res) { if (err || res.error) { return void console.error(err || res.error); } existing = Object.keys(res.tags).sort(); })); }).nThen(function (waitFor) { - common.getPadAttribute('tags', waitFor(function (err, res) { - if (err) { - if (err === 'NO_ENTRY') { - UI.alert(Messages.tags_noentry); + var _err; + hrefs.forEach(function (href) { + common.getPadAttribute('tags', waitFor(function (err, res) { + if (err) { + if (err === 'NO_ENTRY') { + UI.alert(Messages.tags_noentry); + } + waitFor.abort(); + _err = err; + return void console.error(err); } - waitFor.abort(); - return void console.error(err); - } - tags = res || []; - }), href); + allTags[href] = res || []; + + if (tags) { + // Intersect with tags from previous pads + tags = (res || []).filter(function (tag) { + return tags.indexOf(tag) !== -1; + }); + } else { + tags = res || []; + } + }), href); + }); }).nThen(function () { UI.dialog.tagPrompt(tags, existing, function (newTags) { if (!Array.isArray(newTags)) { return; } - common.setPadAttribute('tags', newTags, null, href); + var added = []; + var removed = []; + newTags.forEach(function (tag) { + if (tags.indexOf(tag) === -1) { + added.push(tag); + } + }); + tags.forEach(function (tag) { + if (newTags.indexOf(tag) === -1) { + removed.push(tag); + } + }); + var update = function (oldTags) { + Array.prototype.push.apply(oldTags, added); + removed.forEach(function (tag) { + var idx = oldTags.indexOf(tag); + oldTags.splice(idx, 1); + }); + }; + + hrefs.forEach(function (href) { + var oldTags = allTags[href] || []; + update(oldTags); + common.setPadAttribute('tags', Util.deduplicateString(oldTags), null, href); + }); }); }); }; @@ -1323,6 +1364,7 @@ define([ case 'import': button = $('