|
|
|
@ -494,7 +494,23 @@ define([
|
|
|
|
|
var parsed = Hash.parsePadUrl(pathname);
|
|
|
|
|
var canPresent = ['code', 'slide'].indexOf(parsed.type) !== -1;
|
|
|
|
|
var versionHash = hashes.viewHash && opts.versionHash;
|
|
|
|
|
var canBAR = parsed.type !== 'drive' && !versionHash;
|
|
|
|
|
var isForm = parsed.type === "form"; // && opts.auditorHash;
|
|
|
|
|
var canBAR = parsed.type !== 'drive' && !versionHash && !isForm;
|
|
|
|
|
|
|
|
|
|
var labelEdit = Messages.share_linkEdit;
|
|
|
|
|
var labelView = Messages.share_linkView;
|
|
|
|
|
|
|
|
|
|
var auditor;
|
|
|
|
|
if (isForm) {
|
|
|
|
|
Messages.share_formEdit = "Author"; // XXX
|
|
|
|
|
Messages.share_formView = "Participant"; // XXX
|
|
|
|
|
Messages.share_formAuditor = "Auditor"; // XXX
|
|
|
|
|
labelEdit = Messages.share_formEdit;
|
|
|
|
|
labelView = Messages.share_formView;
|
|
|
|
|
auditor = UI.createRadio('accessRights', 'cp-share-form', Messages.share_formAuditor, false, {
|
|
|
|
|
mark: {tabindex:1},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var burnAfterReading = (hashes.viewHash && canBAR) ?
|
|
|
|
|
UI.createRadio('accessRights', 'cp-share-bar', Messages.burnAfterReading_linkBurnAfterReading, false, {
|
|
|
|
@ -505,12 +521,13 @@ define([
|
|
|
|
|
h('label', Messages.share_linkAccess),
|
|
|
|
|
h('div.radio-group',[
|
|
|
|
|
UI.createRadio('accessRights', 'cp-share-editable-false',
|
|
|
|
|
Messages.share_linkView, true, { mark: {tabindex:1} }),
|
|
|
|
|
labelView, true, { mark: {tabindex:1} }),
|
|
|
|
|
canPresent ? UI.createRadio('accessRights', 'cp-share-present',
|
|
|
|
|
Messages.share_linkPresent, false, { mark: {tabindex:1} }) : undefined,
|
|
|
|
|
UI.createRadio('accessRights', 'cp-share-editable-true',
|
|
|
|
|
Messages.share_linkEdit, false, { mark: {tabindex:1} })]),
|
|
|
|
|
burnAfterReading
|
|
|
|
|
labelEdit, false, { mark: {tabindex:1} }),
|
|
|
|
|
auditor]),
|
|
|
|
|
burnAfterReading,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// Burn after reading
|
|
|
|
@ -553,6 +570,7 @@ define([
|
|
|
|
|
var embed = val.embed;
|
|
|
|
|
var present = val.present !== undefined ? val.present : Util.isChecked($rights.find('#cp-share-present'));
|
|
|
|
|
var burnAfterReading = Util.isChecked($rights.find('#cp-share-bar'));
|
|
|
|
|
var formAuditor = Util.isChecked($rights.find('#cp-share-form'));
|
|
|
|
|
if (versionHash) {
|
|
|
|
|
edit = false;
|
|
|
|
|
present = false;
|
|
|
|
@ -569,6 +587,9 @@ define([
|
|
|
|
|
}
|
|
|
|
|
var hash = (!hashes.viewHash || (edit && hashes.editHash)) ? hashes.editHash
|
|
|
|
|
: hashes.viewHash;
|
|
|
|
|
if (formAuditor && opts.auditorHash) {
|
|
|
|
|
hash = opts.auditorHash;
|
|
|
|
|
}
|
|
|
|
|
var href = burnAfterReading ? opts.burnAfterReadingUrl
|
|
|
|
|
: (origin + pathname + '#' + hash);
|
|
|
|
|
var parsed = Hash.parsePadUrl(href);
|
|
|
|
@ -594,6 +615,9 @@ define([
|
|
|
|
|
$rights.find('#cp-share-present').removeAttr('checked').attr('disabled', true);
|
|
|
|
|
$rights.find('#cp-share-editable-true').attr('checked', true);
|
|
|
|
|
}
|
|
|
|
|
if (isForm && !opts.auditorHash) {
|
|
|
|
|
$rights.find('#cp-share-form').removeAttr('checked').attr('disabled', true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var getLink = function () {
|
|
|
|
|
return $rights.parent().find('#cp-share-link-preview');
|
|
|
|
|