diff --git a/customize.dist/loading.js b/customize.dist/loading.js index 11a82f770..600f3e8d4 100644 --- a/customize.dist/loading.js +++ b/customize.dist/loading.js @@ -118,6 +118,16 @@ define([], function () { #cp-loading-password-prompt .cp-password-form button:hover { background-color: #326599; } +#cp-loading-password-prompt ::placeholder { + color: #d9d9d9; + opacity: 1; +} +#cp-loading-password-prompt :-ms-input-placeholder { + color: #d9d9d9; +} +#cp-loading-password-prompt ::-ms-input-placeholder { + color: #d9d9d9; +} #cp-loading .cp-loading-spinner-container { position: relative; height: 100px; diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 0832d3317..142cc2509 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -116,7 +116,7 @@ }*/ } - .dialog, .alert { + .dialog { & > div { background-color: @alertify-dialog-bg; &.half { @@ -205,6 +205,16 @@ } } + ::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ + color: darken(@alertify-input-fg, 15%); + opacity: 1; /* Firefox */ + } + :-ms-input-placeholder { /* Internet Explorer 10-11 */ + color: darken(@alertify-input-fg, 15%); + } + ::-ms-input-placeholder { /* Microsoft Edge */ + color: darken(@alertify-input-fg, 15%); + } input:not(.form-control), textarea { background-color: @alertify-input-bg; color: @alertify-input-fg; diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index db4565ed3..4a8b53006 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -466,6 +466,7 @@ padding: 0.25em 0.75em; margin: 1em; background: @drive_info-box-bg; + cursor: default; span { cursor: pointer; float: right; @@ -978,5 +979,28 @@ flex: 1; } } + + #cp-app-drive-edition-state { + height: @variables_bar-height; + display: flex; + align-items: center; + justify-content: center; + background-color: lighten(@colortheme_drive-bg, 32%); + color: black; + font-weight: bold; + text-transform: uppercase; + cursor: default; + } + #cp-app-drive-connection-state { + height: @variables_bar-height; + display: flex; + align-items: center; + justify-content: center; + background-color: #eb675e; + color: white; + font-weight: bold; + text-transform: uppercase; + cursor: default; + } } diff --git a/rpc.js b/rpc.js index d4bd41c9c..c3d44e86c 100644 --- a/rpc.js +++ b/rpc.js @@ -857,6 +857,7 @@ var removeOwnedChannel = function (Env, channelId, unsafeKey, cb) { if (err) { return void cb("E_PROOF_REMOVAL"); } + cb(); }); } @@ -869,6 +870,7 @@ var removeOwnedChannel = function (Env, channelId, unsafeKey, cb) { if (err) { return void cb("E_PROOF_REMOVAL"); } + cb(); }); }); } diff --git a/storage/blob.js b/storage/blob.js index 759839fd8..c9396d12a 100644 --- a/storage/blob.js +++ b/storage/blob.js @@ -144,7 +144,10 @@ var upload_cancel = function (Env, safeKey, fileSize, cb) { var session = Env.getSession(safeKey); session.pendingUploadSize = fileSize; session.currentUploadSize = 0; - if (session.blobstage) { session.blobstage.close(); } + if (session.blobstage) { + session.blobstage.close(); + delete session.blobstage; + } var path = makeStagePath(Env, safeKey); diff --git a/www/common/common-hash.js b/www/common/common-hash.js index fa9feb7e1..98330367f 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -420,68 +420,6 @@ Version 1 }; // STORAGE - Hash.findWeaker = function (href, channel, recents) { - var parsed = parsePadUrl(href); - if (!parsed.hash) { return false; } - // We can't have a weaker hash if we're already in view mode - if (parsed.hashData && parsed.hashData.mode === 'view') { return; } - var weaker; - Object.keys(recents).some(function (id) { - var pad = recents[id]; - if (pad.href || !pad.roHref) { - // This pad has an edit link, so it can't be weaker - return; - } - var p = parsePadUrl(pad.roHref); - if (p.type !== parsed.type) { return; } // Not the same type - if (p.hash === parsed.hash) { return; } // Same hash, not stronger - if (channel !== pad.channel) { return; } // Not the same channel - - var pHash = p.hashData; - var parsedHash = parsed.hashData; - if (!parsedHash || !pHash) { return; } - - // We don't have stronger/weaker versions of files or users - if (pHash.type !== 'pad' && parsedHash.type !== 'pad') { return; } - - if (pHash.version !== parsedHash.version) { return; } - if (pHash.mode === 'view' && parsedHash.mode === 'edit') { - weaker = pad; - return true; - } - return; - }); - return weaker; - }; - Hash.findStronger = function (href, channel, recents) { - var parsed = parsePadUrl(href); - if (!parsed.hash) { return false; } - var parsedHash = parsed.hashData; - - // We can't have a stronger hash if we're already in edit mode - if (!parsedHash || parsedHash.mode === 'edit') { return; } - - // We don't have stronger/weaker versions of files or users - if (parsedHash.type !== 'pad') { return; } - - var stronger; - Object.keys(recents).some(function (id) { - var pad = recents[id]; - - // Not the same channel? reject - if (channel !== pad.channel) { return; } - - // If this pad doesn't have an edit link, it can't be stronger - if (!pad.href || !pad.roHref) { return; } - - // This is a pad with an EDIT href and using the same channel as our target - // ==> it is stronger - stronger = pad; - return true; - }); - return stronger; - }; - Hash.hrefToHexChannelId = function (href, password) { var parsed = Hash.parsePadUrl(href); if (!parsed || !parsed.hash) { return; } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index ffaefa45d..23af78474 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -79,8 +79,10 @@ define([ waitFor.abort(); return void cb(err || 'EEMPTY'); } - delete val.owners; - delete val.expire; + if (!val.fileType) { + delete val.owners; + delete val.expire; + } Util.extend(data, val); if (data.href) { data.href = base + data.href; } if (data.roHref) { data.roHref = base + data.roHref; } @@ -434,6 +436,7 @@ define([ } else { Object.keys(priv.teams || {}).some(function (id) { var team = priv.teams[id] || {}; + if (team.viewer) { return; } if (data.owners.indexOf(team.edPublic) === -1) { return; } owned = id; return true; @@ -492,7 +495,7 @@ define([ data: _owners, large: true }, function () {}); - if (_ownersGrid) { + if (_ownersGrid && Object.keys(_owners).length) { $d.append(_ownersGrid.div); } else { $d.append([ @@ -548,13 +551,17 @@ define([ $d.append(password); } - if (!data.noEditPassword && owned && parsed.hashData.type === 'pad' && parsed.type !== "sheet") { // FIXME SHEET fix password change for sheets + if (!data.noEditPassword && owned && parsed.type !== "sheet") { // FIXME SHEET fix password change for sheets var sframeChan = common.getSframeChannel(); + + var isFile = parsed.hashData.type === 'file'; + var isSharedFolder = parsed.type === 'drive'; + var changePwTitle = Messages.properties_changePassword; - var changePwConfirm = Messages.properties_confirmChange; + var changePwConfirm = isFile ? Messages.properties_confirmChangeFile : Messages.properties_confirmChange; if (!hasPassword) { changePwTitle = Messages.properties_addPassword; - changePwConfirm = Messages.properties_confirmNew; + changePwConfirm = isFile ? Messages.properties_confirmNewFile : Messages.properties_confirmNew; } $('