mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
Don't show sharing UI if sharing is disabled
This commit is contained in:
parent
06fc748595
commit
ec70e18959
1 changed files with 32 additions and 30 deletions
|
@ -93,44 +93,46 @@ UI.addProjectInfo = function () {
|
|||
var author = newHTML('div', 'infolabel', staticinfo);
|
||||
author.setAttribute('id', 'deviceName');
|
||||
|
||||
// Sharing
|
||||
var shareButtons = newHTML('div', 'infoboxShareButtons', infobox);
|
||||
if (!Settings.shareEnabled) {
|
||||
// Sharing
|
||||
var shareButtons = newHTML('div', 'infoboxShareButtons', infobox);
|
||||
|
||||
var shareEmail = newHTML('div', 'infoboxShareButton', shareButtons);
|
||||
shareEmail.id = 'infoboxShareButtonEmail';
|
||||
shareEmail.textContent = Localization.localize('SHARING_BY_EMAIL');
|
||||
var shareEmail = newHTML('div', 'infoboxShareButton', shareButtons);
|
||||
shareEmail.id = 'infoboxShareButtonEmail';
|
||||
shareEmail.textContent = Localization.localize('SHARING_BY_EMAIL');
|
||||
|
||||
if (UI.isAndroid) {
|
||||
shareEmail.style.margin = 'auto';
|
||||
} else {
|
||||
shareEmail.style.float = 'left';
|
||||
}
|
||||
if (UI.isAndroid) {
|
||||
shareEmail.style.margin = 'auto';
|
||||
} else {
|
||||
shareEmail.style.float = 'left';
|
||||
}
|
||||
|
||||
if (!UI.isAndroid) {
|
||||
var shareAirdrop = newHTML('div', 'infoboxShareButton', shareButtons);
|
||||
shareAirdrop.id = 'infoboxShareButtonAirdrop';
|
||||
shareAirdrop.textContent = Localization.localize('SHARING_BY_AIRDROP');
|
||||
shareAirdrop.style.float = 'right';
|
||||
shareAirdrop.ontouchstart = function (e) {
|
||||
if (!UI.isAndroid) {
|
||||
var shareAirdrop = newHTML('div', 'infoboxShareButton', shareButtons);
|
||||
shareAirdrop.id = 'infoboxShareButtonAirdrop';
|
||||
shareAirdrop.textContent = Localization.localize('SHARING_BY_AIRDROP');
|
||||
shareAirdrop.style.float = 'right';
|
||||
shareAirdrop.ontouchstart = function (e) {
|
||||
UI.parentalGate(e, function (e) {
|
||||
UI.infoDoShare(e, nameField, shareLoadingGif, 1);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
iOS.deviceName(function (name) {
|
||||
gn('deviceName').textContent = name;
|
||||
});
|
||||
|
||||
var shareLoadingGif = newHTML('img', 'infoboxShareLoading', shareButtons);
|
||||
shareLoadingGif.src = './assets/ui/loader.png';
|
||||
|
||||
shareEmail.ontouchstart = function (e) {
|
||||
UI.parentalGate(e, function (e) {
|
||||
UI.infoDoShare(e, nameField, shareLoadingGif, 1);
|
||||
UI.infoDoShare(e, nameField, shareLoadingGif, 0);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
iOS.deviceName(function (name) {
|
||||
gn('deviceName').textContent = name;
|
||||
});
|
||||
|
||||
var shareLoadingGif = newHTML('img', 'infoboxShareLoading', shareButtons);
|
||||
shareLoadingGif.src = './assets/ui/loader.png';
|
||||
|
||||
shareEmail.ontouchstart = function (e) {
|
||||
UI.parentalGate(e, function (e) {
|
||||
UI.infoDoShare(e, nameField, shareLoadingGif, 0);
|
||||
});
|
||||
};
|
||||
|
||||
UI.info.ontouchend = UI.showInfoBox;
|
||||
UI.okclicky.ontouchstart = UI.hideInfoBox;
|
||||
UI.okclicky.ontouchstart = function (evt) {
|
||||
|
|
Loading…
Reference in a new issue