diff --git a/config.example.js b/config.example.js index bcc7a6773..a075b7bb2 100644 --- a/config.example.js +++ b/config.example.js @@ -91,6 +91,8 @@ module.exports = { // cross-domain iframe. It can simply host the same content as CryptPad. // httpSafeOrigin: "https://some-other-domain.xyz", + httpUnsafeOrigin: domain, + /* your server's websocket url is configurable * (default: '/cryptpad_websocket') * diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 6ec3c615b..194b780d1 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -268,6 +268,14 @@ } } + &.primary { + background-color: @colortheme_alertify-primary; + color: @colortheme_alertify-primary-text; + &:hover, &:active { + background-color: darken(@colortheme_alertify-primary, 10%); + } + } + &:hover, &:active { background-color: @alertify-btn-bg-hover; } diff --git a/customize.dist/src/less2/include/colortheme.less b/customize.dist/src/less2/include/colortheme.less index afa40cfd4..c8848d02b 100644 --- a/customize.dist/src/less2/include/colortheme.less +++ b/customize.dist/src/less2/include/colortheme.less @@ -28,6 +28,8 @@ @colortheme_alertify-red: #E55236; @colortheme_alertify-green: #77C825; +@colortheme_alertify-primary: #fff; +@colortheme_alertify-primary-text: #000; @colortheme_notification-log: rgba(0, 0, 0, 0.8); @colortheme_notification-warn: rgba(205, 37, 50, 0.8); diff --git a/server.js b/server.js index 771d055af..a51c94343 100644 --- a/server.js +++ b/server.js @@ -150,6 +150,7 @@ app.get('/api/config', function(req, res){ websocketPath: config.useExternalWebsocket ? undefined : config.websocketPath, websocketURL:'ws' + ((useSecureWebsockets) ? 's' : '') + '://' + host + ':' + websocketPort + '/cryptpad_websocket', + httpUnsafeOrigin: config.httpUnsafeOrigin, }, null, '\t'), 'obj.httpSafeOrigin = ' + (function () { if (config.httpSafeOrigin) { return config.httpSafeOrigin; } diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 2e067613a..c256d2656 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -112,7 +112,7 @@ define([ }; dialog.okButton = function (content) { - return h('button.ok', { tabindex: '2', }, content || Messages.okButton); + return h('button.ok.primary', { tabindex: '2', }, content || Messages.okButton); }; dialog.cancelButton = function (content) { @@ -324,7 +324,7 @@ define([ var navs = []; opt.buttons.forEach(function (b) { if (!b.name || !b.onClick) { return; } - var button = h('button', { tabindex: '1' }, b.name); + var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name); $(button).click(function () { b.onClick(); close($(this).parents('.alertify').first()); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 0100be3f8..e43a66176 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -302,6 +302,7 @@ define([ onClick: function () {}, keys: [27] }, { + className: 'primary', name: Messages.share_linkCopy, onClick: function () { saveValue(); @@ -311,6 +312,7 @@ define([ }, keys: [13] }, { + className: 'primary', name: Messages.share_linkOpen, onClick: function () { saveValue(); @@ -340,6 +342,7 @@ define([ onClick: function () {}, keys: [27] }, { + className: 'primary', name: Messages.share_linkCopy, onClick: function () { var v = getEmbedValue(); @@ -396,6 +399,7 @@ define([ onClick: function () {}, keys: [27] }, { + className: 'primary', name: Messages.share_linkCopy, onClick: function () { var v = getLinkValue(); @@ -421,6 +425,7 @@ define([ onClick: function () {}, keys: [27] }, { + className: 'primary', name: Messages.share_mediatagCopy, onClick: function () { var v = common.getMediatagFromHref(url);