Share with friends from sframe and drive
This commit is contained in:
@@ -1,85 +1,8 @@
|
||||
@import (reference) '../../customize/src/less2/include/colortheme-all.less';
|
||||
@import (reference) '../../customize/src/less2/include/modal.less';
|
||||
@import (reference) '../../customize/src/less2/include/alertify.less';
|
||||
@import (reference) '../../customize/src/less2/include/tippy.less';
|
||||
@import (reference) '../../customize/src/less2/include/avatar.less';
|
||||
@import (reference) '../../customize/src/less2/include/checkmark.less';
|
||||
@import (reference) '../../customize/src/less2/include/password-input.less';
|
||||
@import (reference) '../../customize/src/less2/include/share.less';
|
||||
|
||||
&.cp-app-share {
|
||||
.alertify_main();
|
||||
.tippy_main();
|
||||
.checkmark_main(20px);
|
||||
.password_main();
|
||||
.modal_main();
|
||||
|
||||
.cp-share-columns {
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
|
||||
.cp-share-column {
|
||||
width: 50%;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
.cp-share-grid, .cp-share-list {
|
||||
.avatar_main(50px);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.cp-share-list {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.cp-share-grid {
|
||||
height: 228px;
|
||||
max-height: 228px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.cp-recent-only {
|
||||
.cp-share-grid, .cp-share-grid-filter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.cp-share-grid-filter {
|
||||
display: flex;
|
||||
input {
|
||||
flex: 1;
|
||||
margin-bottom: 0 !important;
|
||||
&::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
|
||||
color: @colortheme_alertify-primary-text;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
}
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.cp-share-friend {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 5px;
|
||||
margin-bottom: 6px;
|
||||
cursor: default;
|
||||
transition: order 0.5s, background-color 0.5s;
|
||||
|
||||
&.cp-selected {
|
||||
background-color: @colortheme_alertify-primary;
|
||||
color: @colortheme_alertify-primary-text;
|
||||
order: -1 !important;
|
||||
}
|
||||
.cp-share-friend-name {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
border: 1px solid @colortheme_alertify-primary;
|
||||
&.cp-fake-friend {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
.share_main();
|
||||
}
|
||||
|
||||
@@ -24,14 +24,6 @@ define([
|
||||
var hideShareDialog = function () {
|
||||
sframeChan.event('EV_SHARE_CLOSE');
|
||||
};
|
||||
/*
|
||||
var onShareAction = function (data) {
|
||||
hideShareDialog();
|
||||
sframeChan.event("EV_SHARE_ACTION", {
|
||||
// XXX data
|
||||
});
|
||||
};
|
||||
*/
|
||||
|
||||
var createShareDialog = function (data) {
|
||||
var priv = metadataMgr.getPrivateData();
|
||||
@@ -40,11 +32,16 @@ define([
|
||||
var pathname = priv.pathname;
|
||||
var f = (data && data.file) ? UIElements.createFileShareModal
|
||||
: UIElements.createShareModal;
|
||||
|
||||
var friends = common.getFriends();
|
||||
|
||||
var modal = f({
|
||||
origin: origin,
|
||||
pathname: pathname,
|
||||
hashes: hashes,
|
||||
common: common,
|
||||
title: data.title,
|
||||
friends: friends,
|
||||
onClose: function () {
|
||||
hideShareDialog();
|
||||
},
|
||||
@@ -53,15 +50,14 @@ define([
|
||||
password: priv.password
|
||||
}
|
||||
});
|
||||
UI.findCancelButton().click();
|
||||
UI.openCustomModal(UI.dialog.tabs(modal), {
|
||||
wide: true
|
||||
wide: Object.keys(friends).length !== 0
|
||||
});
|
||||
};
|
||||
sframeChan.on('EV_SHARE_REFRESH', function (data) {
|
||||
createShareDialog(data);
|
||||
});
|
||||
|
||||
//UI.removeLoadingScreen();
|
||||
};
|
||||
|
||||
var main = function () {
|
||||
@@ -70,7 +66,6 @@ define([
|
||||
nThen(function (waitFor) {
|
||||
$(waitFor(function () {
|
||||
UI.removeLoadingScreen();
|
||||
//UI.addLoadingScreen({hideTips: true, hideLogo: true});
|
||||
}));
|
||||
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));
|
||||
}).nThen(function (/*waitFor*/) {
|
||||
|
||||
Reference in New Issue
Block a user