From 1a0801b74df127d888c71cbe0962251a927df4d8 Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Tue, 2 Feb 2016 18:19:06 -0500 Subject: [PATCH] Reconciliation of PBS KIDS edition splash page --- editions/free/src/index.html | 12 +++++++- src/entry/app.js | 2 ++ src/entry/index.js | 59 ++++++++++++++++++++++++++++++++---- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/editions/free/src/index.html b/editions/free/src/index.html index ca64e75..28b5e2e 100644 --- a/editions/free/src/index.html +++ b/editions/free/src/index.html @@ -16,14 +16,24 @@
+
+
+
+ +
+
-
+
+ +
+
+
diff --git a/src/entry/app.js b/src/entry/app.js index b63d173..a65f5bb 100644 --- a/src/entry/app.js +++ b/src/entry/app.js @@ -39,6 +39,8 @@ window.onload = () => { preprocessAndLoadCss('css', 'css/base.css'); preprocessAndLoadCss('css', 'css/start.css'); preprocessAndLoadCss('css', 'css/thumbs.css'); + /* For parental gate. These CSS properties should be refactored */ + preprocessAndLoadCss('css', 'css/editor.css'); entryFunction = () => iOS.waitForInterface(indexMain); break; case 'home': diff --git a/src/entry/index.js b/src/entry/index.js index 431d28f..0a96bb6 100644 --- a/src/entry/index.js +++ b/src/entry/index.js @@ -1,6 +1,8 @@ import ScratchAudio from '../utils/ScratchAudio'; import {gn, getUrlVars, isAndroid, isiOS} from '../utils/lib'; import iOS from '../iPad/iOS'; +import UI from '../editor/ui/UI'; +import Localization from '../utils/Localization'; export function indexMain () { gn('gettings').ontouchend = indexGettingstarted; @@ -12,6 +14,19 @@ export function indexMain () { } else { indexFirstTime(); } + + if (window.Settings.edition == 'PBS') { + gn('topbar-moreapps').textContent = Localization.localize('PBS_MORE_APPS'); + gn('startButton').textContent = Localization.localize('PBS_START'); + gn('gettings').textContent = Localization.localize('PBS_HOW_TO'); + + gn('startButton').ontouchend = indexGohome; + gn('pbschars').ontouchend = indexGohome; + + gn('topbar-moreapps').ontouchstart = indexMoreApps; + gn('topbar-info').ontouchstart = indexInfo; + } + setTimeout(function () { gn('rays').className = 'rays spinme'; }, 250); @@ -20,9 +35,16 @@ export function indexMain () { function indexFirstTime () { gn('authors').className = 'credits show'; gn('authorsText').className = 'creditsText show'; - gn('purpleguy').className = 'purple show'; - gn('blueguy').className = 'blue show'; - gn('redguy').className = 'red show'; + if (window.Settings.edition == 'PBS') { + gn('pbschars').className = 'characters hide'; + gn('startcode').className = 'catlogo show'; + gn('topbar').className = 'topbar hide'; + gn('startButton').className = 'startButton hide'; + } else { + gn('purpleguy').className = 'purple show'; + gn('blueguy').className = 'blue show'; + gn('redguy').className = 'red show'; + } iOS.askpermission(); // ask for sound recording setTimeout(function () { iOS.hidesplash(doit); @@ -41,9 +63,16 @@ function indexFirstTime () { function indexLoadOptions () { gn('authors').className = 'credits hide'; gn('authorsText').className = 'creditsText hide'; - gn('purpleguy').className = 'purple hide'; - gn('blueguy').className = 'blue hide'; - gn('redguy').className = 'red hide'; + + if (window.Settings.edition == 'PBS') { + gn('pbschars').className = 'characters show'; + gn('topbar').className = 'topbar show'; + gn('startButton').className = 'startButton show'; + } else { + gn('purpleguy').className = 'purple hide'; + gn('blueguy').className = 'blue hide'; + gn('redguy').className = 'red hide'; + } gn('gettings').className = 'gettings show'; gn('startcode').className = 'startcode show'; document.ontouchmove = function (e) { @@ -74,3 +103,21 @@ function indexGettingstarted () { ScratchAudio.sndFX('tap.wav'); window.location.href = 'gettingstarted.html?place=home'; } + +// For PBS KIDS edition only +function indexInfo () { + ScratchAudio.sndFX('tap.wav'); + window.location.href = 'home.html?place=book'; +} + +function indexMoreApps () { + ScratchAudio.sndFX('tap.wav'); + + UI.parentalGate(null, function () { + if (isiOS) { + window.location.href = 'https://itunes.apple.com/us/developer/pbs-kids/id324323339?mt=8'; + } else { + window.location.href = 'http://to.pbs.org/ScJr_GPlay'; + } + }); +}