mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
Merge pull request #2 from tmickel/disable-share-setting
Add setting for disabling sharing UI
This commit is contained in:
commit
3893b187cf
2 changed files with 33 additions and 30 deletions
|
@ -2,6 +2,7 @@ window.Settings = {
|
|||
edition: 'free',
|
||||
scratchJrVersion: 'iOSv01',
|
||||
useStoryStarters: false,
|
||||
shareEnabled: true,
|
||||
defaultSprite: 'Star.svg',
|
||||
spriteOutlineColor: 'white',
|
||||
stageColor: '#F5F2F7',
|
||||
|
|
|
@ -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