address notes

pull/1/head
David Benqué 5 years ago
parent 718fdb556b
commit 33b16ffcdf

@ -877,7 +877,7 @@ define([
return friends[c].curvePublic.slice(0,8); return friends[c].curvePublic.slice(0,8);
}); });
var div = h('div.cp-share-column.contains-nav'); var div = h('div.contains-nav');
var $div = $(div); var $div = $(div);
// Replace "copy link" by "share with friends" if at least one friend is selected // Replace "copy link" by "share with friends" if at least one friend is selected
// Also create the "share with friends" button if it doesn't exist // Also create the "share with friends" button if it doesn't exist
@ -1067,6 +1067,7 @@ define([
// XXX remove LESS code for cp-share-columns if not using anymore // XXX remove LESS code for cp-share-columns if not using anymore
//var mainShareColumn = h('div.cp-share-column.contains-nav', content); //var mainShareColumn = h('div.cp-share-column.contains-nav', content);
var link = h('div.cp-share-modal', content); var link = h('div.cp-share-modal', content);
var saveValue = function () { var saveValue = function () {
var edit = Util.isChecked($(link).find('#cp-share-editable-true')); var edit = Util.isChecked($(link).find('#cp-share-editable-true'));
var embed = Util.isChecked($(link).find('#cp-share-embed')); var embed = Util.isChecked($(link).find('#cp-share-embed'));
@ -1090,27 +1091,17 @@ define([
return origin + parsed.getUrl({embed: embed, present: present}); return origin + parsed.getUrl({embed: embed, present: present});
}; };
var cancelButton = { var makeCancelButton = function() {
className: 'cancel', return {className: 'cancel',
name: Messages.cancel, name: Messages.cancel,
onClick: function () {}, onClick: function () {},
keys: [27] keys: [27]};
}; };
var linkButtons = [cancelButton]; var linkButtons = [makeCancelButton()];
var shareButtons = [{
className: 'primary',
name: Messages.share_linkCopy,
onClick: function () {
saveValue();
var v = getLinkValue();
var success = Clipboard.copy(v);
if (success) { UI.log(Messages.shareSuccess); }
},
keys: [13]
}];
if (!config.sharedFolder) { if (!config.sharedFolder) {
shareButtons.unshift({ linkButtons.push({
className: 'secondary', // XXX style this diferently than cancel className: 'secondary', // XXX style this diferently than cancel
name: Messages.share_linkOpen, name: Messages.share_linkOpen,
onClick: function () { onClick: function () {
@ -1120,7 +1111,19 @@ define([
}, },
keys: [[13, 'ctrl']] keys: [[13, 'ctrl']]
}); });
} };
linkButtons.push({
className: 'primary',
name: Messages.share_linkCopy,
onClick: function () {
saveValue();
var v = getLinkValue();
var success = Clipboard.copy(v);
if (success) { UI.log(Messages.shareSuccess); }
},
keys: [13]}
);
var $link = $(link); var $link = $(link);
@ -1138,10 +1141,6 @@ define([
}); });
// $link.append(UI.dialog.getButtons(shareButtons, config.onClose)); // $link.append(UI.dialog.getButtons(shareButtons, config.onClose));
shareButtons.forEach(function(button){
linkButtons.push(button);
});
console.log(linkButtons);
var frameLink = UI.dialog.customModal(link, { var frameLink = UI.dialog.customModal(link, {
buttons: linkButtons, buttons: linkButtons,
@ -1163,7 +1162,7 @@ define([
$(friendsList).appendTo($contacts); $(friendsList).appendTo($contacts);
var contactButtons = [cancelButton] var contactButtons = [makeCancelButton()]
var frameContacts = UI.dialog.customModal(contacts, { var frameContacts = UI.dialog.customModal(contacts, {
buttons: contactButtons, buttons: contactButtons,
@ -1184,7 +1183,7 @@ define([
UI.dialog.selectable(getEmbedValue()) UI.dialog.selectable(getEmbedValue())
]); ]);
var embedButtons = [ var embedButtons = [
cancelButton, { makeCancelButton(), {
className: 'primary', className: 'primary',
name: Messages.share_linkCopy, name: Messages.share_linkCopy,
onClick: function () { onClick: function () {

@ -4120,9 +4120,7 @@ define([
modal = padType === 'file' ? UIElements.createFileShareModal(padData) modal = padType === 'file' ? UIElements.createFileShareModal(padData)
: UIElements.createShareModal(padData); : UIElements.createShareModal(padData);
modal = UI.dialog.tabs(modal); modal = UI.dialog.tabs(modal);
UI.openCustomModal(modal, { UI.openCustomModal(modal);
wide: _wide
});
} }
} }
else if ($this.hasClass('cp-app-drive-context-savelocal')) { else if ($this.hasClass('cp-app-drive-context-savelocal')) {

@ -533,7 +533,7 @@ MessengerUI, Messages) {
Common.getSframeChannel().event('EV_SHARE_OPEN', { Common.getSframeChannel().event('EV_SHARE_OPEN', {
hidden: true hidden: true
}); });
$shareBlock.ready(function () { $shareBlock.ready(function () { // XXX put .click back when done
var title = (config.title && config.title.getTitle && config.title.getTitle()) var title = (config.title && config.title.getTitle && config.title.getTitle())
|| (config.title && config.title.defaultName) || (config.title && config.title.defaultName)
|| ""; || "";

Loading…
Cancel
Save