diff --git a/.travis.yml b/.travis.yml index 59f2aa1da..9c4f88b67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ notifications: secure: ezESiG7JnuSLZc2/PPhOvWUv5BHBCr+g86MsuLLw+S+zz3DUfzWHMQ1g5tUvkeSDTPmfEIX41EnPkaoWtsD3OGO0PGXgseAfA8+6Z4N1rICNZZrhXZB2s6UdwRK1e+0Jol4W3kHmt96BHyN2scLNgJYeWMgSJllVsuPhMTlKBZIXI9u540NH8Nxjl3f2WvoIg64Q1mZvMxkpPbw4xssx6U4HSFE8kTTE6+EFsSxzombFX0cLGjPiJ9QZgGVUk4UkIjyiFLQQDfQlLllCaUpqJ9+qbuCNoMSKA2yty/qyZ8Y+r4OlMberjmBzR9GRLLyXWWcaAfMIgwlRhjtLYIDAUSsGM1iwUWCgyB9maG2IiXuYLSueuMx8DcDwbpUepoDgnqBYnM2AJmT8gcsxqlKYzJpYpHDgZgBlLZQgMXqjrVJHs/Tf9XVcLS6HAn1Ww0OOT01jThfy4gClpAuqLayYexsXOoL+RaFg25E2NzuTtaFWgRfWZgcAeqYNDiUzwun2D4vZ5I+NtdRP0gzpbG2fxhFz05vAqyf1Kp6ZYb17Li3A38dIm6Lsvv3qawAIAgNaZpIZX3f89+uq6jHU8kJy1Iv823JK2Xac3vEz3SHUKJnuXFF0LO07om9AcNEXhP/JrJ617S8nfvDtZRJODMFhz8qQwie+65Ql1I871goBpVs= env: global: + - CXX=g++-4.8 - API_HOST_master=https://api.scratch.mit.edu - API_HOST_STAGING=https://api-staging.scratch.mit.edu - API_HOST_VAR=API_HOST_$TRAVIS_BRANCH @@ -57,6 +58,12 @@ env: - SKIP_CLEANUP=true - NODE_ENV=production - WWW_VERSION=${TRAVIS_COMMIT:0:5} +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 install: - sudo -H pip install -r requirements.txt - npm --production=false install diff --git a/.tx/config b/.tx/config index a3fda83b8..7e6f49722 100644 --- a/.tx/config +++ b/.tx/config @@ -68,12 +68,6 @@ source_file = src/views/developers/l10n.json source_lang = en type = KEYVALUEJSON -[scratch-website.things-to-try-l10njson] -file_filter = localizations/things-to-try/.json -source_file = src/views/thingstotry/l10n.json -source_lang = en -type = KEYVALUEJSON - [scratch-website.guidelines-l10njson] file_filter = localizations/guidelines/.json source_file = src/views/guidelines/l10n.json @@ -110,3 +104,14 @@ source_file = src/views/credits/l10n.json source_lang = en type = KEYVALUEJSON +[scratch-website.tips-l10njson] +file_filter = localizations/tips/.json +source_file = src/views/tips/l10n.json +source_lang = en +type = KEYVALUEJSON + +[scratch-website.download-l10njson] +file_filter = localizations/download/.json +source_file = src/views/download/l10n.json +source_lang = en +type = KEYVALUEJSON diff --git a/Makefile b/Makefile index 345b15c37..65a57a3ac 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ deploy: @make sync translations: + ./bin/get-localized-urls localized-urls.json ./bin/build-locales node_modules/scratchr2_translations/www/translations intl webpack: diff --git a/README.md b/README.md index de28c6d78..a340e4b50 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ make deploy ### Current issues with the development We're currently in the process of transitioning into this web client from Scratch's existing structure. As we transition, there are going to be some issues along the way that relate to how this client needs to interact with the existing infrastructure to work properly in production. +#### FALLBACK On top of migrating to using this as our web client, Scratch is also transitioning into using a new API backend, Scratch REST API. As that is also currently in development and incomplete, we are set up to fall back to using existing Scratch endpoints if an API endpoint does not exist – which is where the `FALLBACK` comes in. Most of the issues we have currently revolve around the use of `FALLBACK`. This variable is used to specify what url to fall back onto should a request fail within the context of this webclient, or when using the `API_HOST`. If not specified in the process, it will not be used, and any request that is not made through the web client or the API will be unreachable. @@ -112,3 +113,5 @@ Setting `FALLBACK=https://scratch.mit.edu` allows the web client to retrieve dat Additionally, if you set `FALLBACK=https://scratch.mit.edu`, be aware that clicking on links to parts of the website not yet migrated over (currently such as `Explore`, `Discuss`, `Profile`, etc.) will take you to the Scratch website itself. +#### Windows +Some users have experienced difficulties when trying to get our web client to work on Windows. One solution could be to use [Cygwin](https://www.cygwin.com/). If that doesn't work, you might want to use [Wubi](https://wiki.ubuntu.com/WubiGuide) (Windows XP, Vista, 7) or [Wubiuefi](https://github.com/hakuna-m/wubiuefi) (Windows 8 or higher). Wubi(uefi) is a Windows Installer for Ubuntu that allows you to have Ubuntu and Windows on one disk, without the need of an extra partition. \ No newline at end of file diff --git a/bin/build-locales b/bin/build-locales index 9be275d33..6b30eb5e3 100755 --- a/bin/build-locales +++ b/bin/build-locales @@ -156,16 +156,17 @@ for (var v in routes) { var l10nStatic = path.resolve(__dirname, '../src/views/' + subdir.join('/') + '/l10n-static.json'); localizedAssetUrls[routes[v].name] = {}; - var assetUrls = require(l10nStatic); - localizedAssetUrls[routes[v].name]['en'] = assetUrls; + var viewUrls = require(l10nStatic); + localizedAssetUrls[routes[v].name]['en'] = viewUrls; + var defaultUrls = localizedUrls['en']; for (var lang in languages) { localizedAssetUrls[routes[v].name][lang] = {}; var langUrls = localizedUrls[lang] || {}; - for (var key in assetUrls) { + for (var key in viewUrls) { if (langUrls.hasOwnProperty(key)) { localizedAssetUrls[routes[v].name][lang][key] = langUrls[key]; } else { - localizedAssetUrls[routes[v].name][lang][key] = assetUrls[key]; + localizedAssetUrls[routes[v].name][lang][key] = defaultUrls[key]; } } } @@ -205,7 +206,7 @@ async.forEachLimit(views, 5, function (view, cb) { if (err.code === 'ENOENT') { if (isoCode !== 'en') { if (defaultLocales.hasOwnProperty(view)) { - process.stdout.write('No translations for ' + view + isoCode + ', using english\n'); + process.stdout.write('No translations for ' + view + ' ' + isoCode + ', using english\n'); } viewLocales[isoCode] = merge({}, generalLocales[isoCode], defaultLocales[view]); defaults(viewLocales[isoCode], generalLocales['en']); diff --git a/bin/get-localized-urls b/bin/get-localized-urls new file mode 100755 index 000000000..116b60517 --- /dev/null +++ b/bin/get-localized-urls @@ -0,0 +1,48 @@ +#!/usr/bin/env node + +/* +Get localized-urls.json from resources.scratch.mit.edu + */ + +var https = require('https'); +var fs = require('fs'); +var path = require('path'); +var urlData = ''; + +var args = process.argv.slice(2); + +if (!args.length) { + process.stdout.write('A output filename must be specified.\n'); + process.exit(1); +} +var filename = path.resolve(__dirname, 'lib', args.shift()); + +https.get('https://resources.scratch.mit.edu/localized-urls.json', (res) => { + var statusCode = res && res.statusCode; + + var error; + if (statusCode !== 200) { + error = new Error('Request Failed.\n' + + `Status Code: ${statusCode}`); + } + if (error) { + process.stdout.write(`${error.message}\n`); + // consume response data to free up memory + res.resume(); + return; + } + res.setEncoding('utf8'); + res.on('data', (chunk) => { urlData += chunk; }); + res.on('end', () => { + try { + var urlJson = JSON.parse(urlData); + fs.writeFile(filename, JSON.stringify(urlJson, null, ' ')); + } catch (e) { + process.stdout.write(`Failed parsing url data: ${e.message}\n`); + process.exit(1); + } + }); +}).on('error', (e) => { + process.stdout.write(`Got error: ${e.message}\n`); + process.exit(1); +}); diff --git a/bin/lib/localized-urls.json b/bin/lib/localized-urls.json index 40e99b709..ddccf3e18 100644 --- a/bin/lib/localized-urls.json +++ b/bin/lib/localized-urls.json @@ -1,151 +1,113 @@ { - "en": { - "cards.starterLink": "/pdfs/cards/Scratch2Cards.pdf", - "cards.nameLink": "/pdfs/cards/AnimateYourNameCards.pdf", - "cards.flyLink": "/pdfs/cards/FlyCards.pdf", - "cards.raceLink": "/pdfs/cards/RaceGameCards.pdf", - "cards.musicLink": "/pdfs/cards/MusicCards.pdf", - "cards.hideLink": "/pdfs/cards/Hide-and-Seek-Cards.pdf", - "cards.storyLink": "/pdfs/cards/StoryCards.pdf", - "cards.dressupLink": "/pdfs/cards/DressupCards.pdf", - "cards.pongLink": "/pdfs/cards/PongCards.pdf", - "cards.danceLink": "/pdfs/cards/DanceCards.pdf", - "cards.catchLink": "/pdfs/cards/CatchCards.pdf", - "cards.petLink": "/pdfs/cards/PetCards.pdf", - "ttt.MakeItFlyActivityLoc": "/pdfs/cards/FlyCards.pdf", - "ttt.MakeItFlyGuideLoc": "/pdfs/guides/FlyGuide.pdf", - "ttt.AnimateYourNameActivityLoc": "/pdfs/cards/AnimateYourNameCards.pdf", - "ttt.AnimateYourNameGuideLoc": "/pdfs/guides/NameGuide.pdf", - "ttt.MakeMusicActivityLoc": "/pdfs/cards/MusicCards.pdf", - "ttt.MakeMusicGuideLoc": "/pdfs/guides/MusicGuide.pdf", - "ttt.RaceActivityLoc": "/pdfs/cards/RaceGameCards.pdf", - "ttt.RaceGuideLoc": "/pdfs/guides/RaceGuide.pdf", - "ttt.DanceActivityLoc": "/pdfs/cards/DanceCards.pdf", - "ttt.DanceGuideLoc": "/pdfs/guides/DanceGuide.pdf", - "ttt.PongActivityLoc": "/pdfs/cards/PongCards.pdf", - "ttt.PongGuideLoc": "/pdfs/guides/PongGuide.pdf", - "ttt.CatchActivityLoc": "/pdfs/cards/CatchCards.pdf", - "ttt.CatchGuideLoc": "/pdfs/guides/CatchGuide.pdf", - "ttt.HideAndSeekActivityLoc": "/pdfs/cards/Hide-and-Seek-Cards.pdf", - "ttt.HideAndSeekGuideLoc": "/pdfs/guides/Hide-and-Seek-Guide.pdf", - "ttt.VirtualPetActivityLoc": "/pdfs/cards/PetCards.pdf", - "ttt.VirtualPetGuideLoc": "/pdfs/guides/PetGuide.pdf", - "ttt.DressupActivityLoc": "/pdfs/cards/DressupCards.pdf", - "ttt.DressupGuideLoc": "/pdfs/guides/DressupGuide.pdf", - "ttt.StoryActivityLoc": "/pdfs/cards/StoryCards.pdf", - "ttt.StoryGuideLoc": "/pdfs/guides/StoryGuide.pdf" - }, - "ar": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/ar/Scratch2Cards.pdf" - }, - "ca": { - "cards.nameLink": "/pdfs/cards/ca/AnimateYourNameCards.pdf", - "cards.catchLink": "/pdfs/cards/ca/CatchCards.pdf", - "cards.danceLink": "/pdfs/cards/ca/DanceCards.pdf", - "cards.dressupLink": "/pdfs/cards/ca/DressupCards.pdf", - "cards.flyLink": "/pdfs/cards/ca/FlyCards.pdf", - "cards.hideLink": "/pdfs/cards/ca/Hide-and-Seek-Cards.pdf", - "cards.musicLink": "/pdfs/cards/ca/MusicCards.pdf", - "cards.petLink": "/pdfs/cards/ca/PetCards.pdf", - "cards.pongLink": "/pdfs/cards/ca/PongCards.pdf", - "cards.raceLink": "/pdfs/cards/ca/RaceGameCards.pdf", - "cards.starterLink": "/pdfs/cards/ca/Scratch2Cards.pdf", - "cards.storyLink": "/pdfs/cards/ca/StoryCards.pdf", - "ttt.MakeItFlyActivityLoc": "/pdfs/cards/ca/FlyCards.pdf", - "ttt.AnimateYourNameActivityLoc": "/pdfs/cards/ca/AnimateYourNameCards.pdf", - "ttt.MakeMusicActivityLoc": "/pdfs/cards/ca/MusicCards.pdf", - "ttt.RaceActivityLoc": "/pdfs/cards/ca/RaceGameCards.pdf", - "ttt.DanceActivityLoc": "/pdfs/cards/ca/DanceCards.pdf", - "ttt.PongActivityLoc": "/pdfs/cards/ca/PongCards.pdf", - "ttt.CatchActivityLoc": "/pdfs/cards/ca/CatchCards.pdf", - "ttt.HideAndSeekActivityLoc": "/pdfs/cards/ca/Hide-and-Seek-Cards.pdf", - "ttt.VirtualPetActivityLoc": "/pdfs/cards/ca/PetCards.pdf", - "ttt.DressupActivityLoc": "/pdfs/cards/ca/DressupCards.pdf", - "ttt.StoryActivityLoc": "/pdfs/cards/ca/StoryCards.pdf" - }, - "cs": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/cs/Scratch2Cards.pdf" - }, - "de": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/de/Scratch2Cards.pdf" - }, - "es": { - "cards.nameLink": "/pdfs/cards/es/AnimateYourNameCards.pdf", - "cards.catchLink": "/pdfs/cards/es/CatchCards.pdf", - "cards.danceLink": "/pdfs/cards/es/DanceCards.pdf", - "cards.dressupLink": "/pdfs/cards/es/DressupCards.pdf", - "cards.flyLink": "/pdfs/cards/es/FlyCards.pdf", - "cards.hideLink": "/pdfs/cards/es/Hide-and-Seek-Cards.pdf", - "cards.musicLink": "/pdfs/cards/es/MusicCards.pdf", - "cards.petLink": "/pdfs/cards/es/PetCards.pdf", - "cards.pongLink": "/pdfs/cards/es/PongCards.pdf", - "cards.raceLink": "/pdfs/cards/es/RaceGameCards.pdf", - "cards.starterLink": "/pdfs/cards/es/Scratch2Cards.pdf", - "cards.storyLink": "/pdfs/cards/es/StoryCards.pdf", - "ttt.MakeItFlyActivityLoc": "/pdfs/cards/es/FlyCards.pdf", - "ttt.AnimateYourNameActivityLoc": "/pdfs/cards/es/AnimateYourNameCards.pdf", - "ttt.MakeMusicActivityLoc": "/pdfs/cards/es/MusicCards.pdf", - "ttt.RaceActivityLoc": "/pdfs/cards/es/RaceGameCards.pdf", - "ttt.DanceActivityLoc": "/pdfs/cards/es/DanceCards.pdf", - "ttt.PongActivityLoc": "/pdfs/cards/es/PongCards.pdf", - "ttt.CatchActivityLoc": "/pdfs/cards/es/CatchCards.pdf", - "ttt.HideAndSeekActivityLoc": "/pdfs/cards/es/Hide-and-Seek-Cards.pdf", - "ttt.VirtualPetActivityLoc": "/pdfs/cards/es/PetCards.pdf", - "ttt.DressupActivityLoc": "/pdfs/cards/es/DressupCards.pdf", - "ttt.StoryActivityLoc": "/pdfs/cards/es/StoryCards.pdf" - }, - "fr": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/fr/Scratch2Cards.pdf" - }, - "hr": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/hr/Scratch2Cards.pdf" - }, - "it": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/it/Scratch2Cards.pdf" - }, - "ja": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/ja/Scratch2Cards.pdf" - }, - "ja-hr": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/ja-hr/Scratch2Cards.pdf" - }, - "ko": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/ko/Scratch2Cards.pdf" - }, - "nl": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/nl/Scratch2Cards.pdf" - }, - "pt-br": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/pt-br/Scratch2Cards.pdf" - }, - "sl": { - "cards.starterLink": "//cdn.scratch.mit.edu/scratchr2/static/pdfs/help/sl/Scratch2Cards.pdf" - }, - "sv": { - "cards.starterLink": "/pdfs/cards/sv/Scratch2Cards.pdf" - }, - "zh-tw": { - "cards.nameLink": "/pdfs/cards/zh-tw/AnimateYourNameCards.pdf", - "cards.catchLink": "/pdfs/cards/zh-tw/CatchCards.pdf", - "cards.danceLink": "/pdfs/cards/zh-tw/DanceCards.pdf", - "cards.dressupLink": "/pdfs/cards/zh-tw/DressupCards.pdf", - "cards.flyLink": "/pdfs/cards/zh-tw/FlyCards.pdf", - "cards.hideLink": "/pdfs/cards/zh-tw/Hide-and-Seek-Cards.pdf", - "cards.musicLink": "/pdfs/cards/zh-tw/MusicCards.pdf", - "cards.petLink": "/pdfs/cards/zh-tw/PetCards.pdf", - "cards.pongLink": "/pdfs/cards/zh-tw/PongCards.pdf", - "cards.raceLink": "/pdfs/cards/zh-tw/RaceGameCards.pdf", - "cards.storyLink": "/pdfs/cards/zh-tw/StoryCards.pdf", - "ttt.MakeItFlyActivityLoc": "/pdfs/cards/zh-tw/FlyCards.pdf", - "ttt.AnimateYourNameActivityLoc": "/pdfs/cards/zh-tw/AnimateYourNameCards.pdf", - "ttt.MakeMusicActivityLoc": "/pdfs/cards/zh-tw/MusicCards.pdf", - "ttt.RaceActivityLoc": "/pdfs/cards/zh-tw/RaceGameCards.pdf", - "ttt.DanceActivityLoc": "/pdfs/cards/zh-tw/DanceCards.pdf", - "ttt.PongActivityLoc": "/pdfs/cards/zh-tw/PongCards.pdf", - "ttt.CatchActivityLoc": "/pdfs/cards/zh-tw/CatchCards.pdf", - "ttt.HideAndSeekActivityLoc": "/pdfs/cards/zh-tw/Hide-and-Seek-Cards.pdf", - "ttt.VirtualPetActivityLoc": "/pdfs/cards/zh-tw/PetCards.pdf", - "ttt.DressupActivityLoc": "/pdfs/cards/zh-tw/DressupCards.pdf", - "ttt.StoryActivityLoc": "/pdfs/cards/zh-tw/StoryCards.pdf" - } -} + "ar": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/ar/Scratch2Cards.pdf" + }, + "ca": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/ca/Scratch2Cards.pdf", + "cards.ScratchCardsAllLink": "https://resources.scratch.mit.edu/www/cards/ca/ScratchCardsAll.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/danceCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/ca/storyCards.pdf" + }, + "cs": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/cs/Scratch2Cards.pdf" + }, + "de": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/de/Scratch2Cards.pdf" + }, + "en": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf", + "cards.ScratchCardsAllLink": "https://resources.scratch.mit.edu/www/cards/en/ScratchCardsAll.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf", + "cards.dressupCardsLink": "https://resources.scratch.mit.edu/www/cards/en/dressupCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/en/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf", + "guides.AnimateYourNameGuideLink": "https://resources.scratch.mit.edu/www/guides/en/AnimateYourNameGuide.pdf", + "guides.CatchGuideLink": "https://resources.scratch.mit.edu/www/guides/en/CatchGuide.pdf", + "guides.DanceGuideLink": "https://resources.scratch.mit.edu/www/guides/en/DanceGuide.pdf", + "guides.FashionGuideLink": "https://resources.scratch.mit.edu/www/guides/en/FashionGuide.pdf", + "guides.FlyGuideLink": "https://resources.scratch.mit.edu/www/guides/en/FlyGuide.pdf", + "guides.Getting-Started-Guide-Scratch2Link": "https://resources.scratch.mit.edu/www/guides/en/Getting-Started-Guide-Scratch2.pdf", + "guides.HideandSeekGuideLink": "https://resources.scratch.mit.edu/www/guides/en/HideandSeekGuide.pdf", + "guides.MusicGuideLink": "https://resources.scratch.mit.edu/www/guides/en/MusicGuide.pdf", + "guides.NameGuideLink": "https://resources.scratch.mit.edu/www/guides/en/NameGuide.pdf", + "guides.PetGuideLink": "https://resources.scratch.mit.edu/www/guides/en/PetGuide.pdf", + "guides.PongGuideLink": "https://resources.scratch.mit.edu/www/guides/en/PongGuide.pdf", + "guides.RaceGuideLink": "https://resources.scratch.mit.edu/www/guides/en/RaceGuide.pdf", + "guides.StoryGuideLink": "https://resources.scratch.mit.edu/www/guides/en/StoryGuide.pdf" + }, + "es": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/es/Scratch2Cards.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/es/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/es/danceCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/es/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/es/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/es/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/es/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/es/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/es/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/es/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/es/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/es/storyCards.pdf" + }, + "fr": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/fr/Scratch2Cards.pdf" + }, + "hr": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/hr/Scratch2Cards.pdf" + }, + "it": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/it/Scratch2Cards.pdf" + }, + "ja": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/ja/Scratch2Cards.pdf" + }, + "ja-hr": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/ja-hr/Scratch2Cards.pdf" + }, + "ko": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/ko/Scratch2Cards.pdf" + }, + "nl": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/nl/Scratch2Cards.pdf" + }, + "pt-br": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/pt-br/Scratch2Cards.pdf" + }, + "sl": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/sl/Scratch2Cards.pdf" + }, + "sv": { + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/sv/Scratch2Cards.pdf" + }, + "zh-tw": { + "cards.ScratchCardsAllLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/ScratchCardsAll.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/danceCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/zh-tw/storyCards.pdf" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 3b59d4cc7..564509c2d 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "lodash.omit": "3.1.0", "lodash.range": "3.0.1", "minilog": "2.0.8", + "node-dir": "0.1.16", "node-sass": "3.3.3", "pako": "0.2.8", "po2icu": "0.0.2", diff --git a/src/components/footer/www/footer.jsx b/src/components/footer/www/footer.jsx index 2e930cef9..0cfaa46cd 100644 --- a/src/components/footer/www/footer.jsx +++ b/src/components/footer/www/footer.jsx @@ -127,8 +127,8 @@ var Footer = React.createClass({
- - + +
@@ -137,7 +137,7 @@ var Footer = React.createClass({
- +
@@ -146,6 +146,11 @@ var Footer = React.createClass({ +
+ + + +
diff --git a/src/components/navigation/www/navigation.jsx b/src/components/navigation/www/navigation.jsx index 74dce2b80..b7ab808f0 100644 --- a/src/components/navigation/www/navigation.jsx +++ b/src/components/navigation/www/navigation.jsx @@ -202,9 +202,9 @@ var Navigation = React.createClass({ -
  • - - +
  • + +
  • @@ -212,11 +212,6 @@ var Navigation = React.createClass({
  • -
  • - - - -
  • diff --git a/src/components/title-banner/title-banner.scss b/src/components/title-banner/title-banner.scss index 83c55e864..52e364b2a 100644 --- a/src/components/title-banner/title-banner.scss +++ b/src/components/title-banner/title-banner.scss @@ -30,4 +30,13 @@ .title-banner.mod-blue-bg { background-color: $ui-blue; + + // override link color if background in ui-blue + a { + color: $ui-white; + } + + a.mod-underline { + text-decoration: underline; + } } diff --git a/src/components/ttt-tile/ttt-tile.scss b/src/components/ttt-tile/ttt-tile.scss index d5ed1033d..9a244bcc1 100644 --- a/src/components/ttt-tile/ttt-tile.scss +++ b/src/components/ttt-tile/ttt-tile.scss @@ -7,9 +7,9 @@ // at the bottom of the previous column. margin-top: 1px; margin-bottom: calc(1.25rem - 1px); - border-radius: 1rem; box-shadow: 0 0 0 1px $active-gray; + background-color: $ui-white; width: $cols4; text-align: center; } diff --git a/src/l10n.json b/src/l10n.json index 9c11a92df..078c4646a 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -62,11 +62,13 @@ "general.scratchEd": "ScratchEd", "general.scratchFoundation": "Scratch Foundation", "general.scratchJr": "ScratchJr", + "general.scratchStore": "Scratch Store", "general.search": "Search", "general.signIn": "Sign in", "general.statistics": "Statistics", "general.studios": "Studios", "general.support": "Support", + "general.tips": "Tips", "general.tipsWindow": "Tips Window", "general.termsOfUse": "Terms of Use", "general.username": "Username", diff --git a/src/routes.json b/src/routes.json index 9ed1774ea..d78eeabe4 100644 --- a/src/routes.json +++ b/src/routes.json @@ -136,7 +136,7 @@ "name": "hoc", "pattern": "^/hoc/?(\\?.*)?$", "routeAlias": "/hoc/?\\??", - "redirect": "/go" + "redirect": "/tips" }, { "name": "cards", @@ -149,8 +149,26 @@ "name": "things-to-try", "pattern": "^/go/?(\\?.*)?$", "routeAlias": "/go/?\\??", - "view": "thingstotry/thingstotry", - "title": "Things to Try" + "redirect": "/tips" + }, + { + "name": "help", + "pattern": "^/help/?(\\?.*)?$", + "routeAlias": "/help/?(\\?.*)?$", + "redirect": "/tips" + }, + { + "name": "info-redirect", + "pattern": "^/info/?(\\?.*)?$", + "routeAlias": "/info/?(\\?.*)?$", + "redirect": "/tips" + }, + { + "name": "tips", + "pattern": "^/tips/?(\\?.*)?$", + "routeAlias": "/tips/?\\??", + "view": "tips/tips", + "title": "Tips" }, { "name": "communityblocks-interviews", @@ -162,10 +180,17 @@ { "name": "credits", "pattern": "^/info/credits/?$", - "routeAlias": "/info/(cards|communityblocks-interviews|credits|faq)/?$", + "routeAlias": "/info/(cards|communityblocks-interviews|credits|faq|donate)/?$", "view": "credits/credits", "title": "Credits" }, + { + "name": "download", + "pattern": "^/download/?$", + "routeAlias": "/download", + "view": "download/download", + "title": "Scratch Offline Editor" + }, { "name": "faq", "pattern": "^/info/faq/?$", @@ -251,6 +276,12 @@ "routeAlias": "/explore(?!/ajax)", "redirect": "/explore/studios/all" }, + { + "name": "download-redirect", + "pattern": "^/scratch2download/?$", + "routeAlias": "/scratch2download", + "redirect": "/download" + }, { "name": "microworld-art", "pattern": "^/microworlds/art", diff --git a/src/views/cards/cards.jsx b/src/views/cards/cards.jsx index 1c47dfd82..76824d5c6 100644 --- a/src/views/cards/cards.jsx +++ b/src/views/cards/cards.jsx @@ -21,32 +21,32 @@ var Cards = injectIntl(React.createClass({ var locale = this.props.intl.locale || 'en'; var formatMessage = this.props.intl.formatMessage; var englishLinks = { - 'cards.starterLink': '/pdfs/cards/Scratch2Cards.pdf', - 'cards.nameLink': '/pdfs/cards/AnimateYourNameCards.pdf', - 'cards.flyLink': '/pdfs/cards/FlyCards.pdf', - 'cards.raceLink': '/pdfs/cards/RaceGameCards.pdf', - 'cards.musicLink': '/pdfs/cards/MusicCards.pdf', - 'cards.hideLink': '/pdfs/cards/Hide-and-Seek-Cards.pdf', - 'cards.storyLink': '/pdfs/cards/StoryCards.pdf', - 'cards.dressupLink': '/pdfs/cards/DressupCards.pdf', - 'cards.pongLink': '/pdfs/cards/PongCards.pdf', - 'cards.danceLink': '/pdfs/cards/DanceCards.pdf', - 'cards.catchLink': '/pdfs/cards/CatchCards.pdf', - 'cards.petLink': '/pdfs/cards/PetCards.pdf' + 'cards.starterLink': 'https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf', + 'cards.nameLink': 'https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf', + 'cards.flyLink': 'https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf', + 'cards.raceLink': 'https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf', + 'cards.musicLink': 'https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf', + 'cards.hideLink': 'https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf', + 'cards.storyLink': 'https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf', + 'cards.dressupLink': 'https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf', + 'cards.pongLink': 'https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf', + 'cards.danceLink': 'https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf', + 'cards.catchLink': 'https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf', + 'cards.petLink': 'https://resources.scratch.mit.edu/www/cards/en/petCards.pdf' }; var formattedLinks = { - 'cards.starterLink': formatMessage({id: 'cards.starterLink'}), - 'cards.nameLink': formatMessage({id: 'cards.nameLink'}), - 'cards.flyLink': formatMessage({id: 'cards.flyLink'}), - 'cards.raceLink': formatMessage({id: 'cards.raceLink'}), - 'cards.musicLink': formatMessage({id: 'cards.musicLink'}), - 'cards.hideLink': formatMessage({id: 'cards.hideLink'}), - 'cards.storyLink': formatMessage({id: 'cards.storyLink'}), - 'cards.dressupLink': formatMessage({id: 'cards.dressupLink'}), - 'cards.pongLink': formatMessage({id: 'cards.pongLink'}), - 'cards.danceLink': formatMessage({id: 'cards.danceLink'}), - 'cards.catchLink': formatMessage({id: 'cards.catchLink'}), - 'cards.petLink': formatMessage({id: 'cards.petLink'}) + 'cards.starterLink': formatMessage({id: 'cards.Scratch2CardsLink'}), + 'cards.nameLink': formatMessage({id: 'cards.nameCardsLink'}), + 'cards.flyLink': formatMessage({id: 'cards.flyCardsLink'}), + 'cards.raceLink': formatMessage({id: 'cards.raceCardsLink'}), + 'cards.musicLink': formatMessage({id: 'cards.musicCardsLink'}), + 'cards.hideLink': formatMessage({id: 'cards.hide-seekCardsLink'}), + 'cards.storyLink': formatMessage({id: 'cards.storyCardsLink'}), + 'cards.dressupLink': formatMessage({id: 'cards.fashionCardsLink'}), + 'cards.pongLink': formatMessage({id: 'cards.pongCardsLink'}), + 'cards.danceLink': formatMessage({id: 'cards.danceCardsLink'}), + 'cards.catchLink': formatMessage({id: 'cards.catchCardsLink'}), + 'cards.petLink': formatMessage({id: 'cards.petCardsLink'}) }; return (
    diff --git a/src/views/cards/l10n-static.json b/src/views/cards/l10n-static.json index 3dcb2acf5..fc062b007 100644 --- a/src/views/cards/l10n-static.json +++ b/src/views/cards/l10n-static.json @@ -1,14 +1,15 @@ { - "cards.starterLink": "/pdfs/cards/Scratch2Cards.pdf", - "cards.nameLink": "/pdfs/cards/AnimateYourNameCards.pdf", - "cards.flyLink": "/pdfs/cards/FlyCards.pdf", - "cards.raceLink": "/pdfs/cards/RaceGameCards.pdf", - "cards.musicLink": "/pdfs/cards/MusicCards.pdf", - "cards.hideLink": "/pdfs/cards/Hide-and-Seek-Cards.pdf", - "cards.storyLink": "/pdfs/cards/StoryCards.pdf", - "cards.dressupLink": "/pdfs/cards/DressupCards.pdf", - "cards.pongLink": "/pdfs/cards/PongCards.pdf", - "cards.danceLink": "/pdfs/cards/DanceCards.pdf", - "cards.catchLink": "/pdfs/cards/CatchCards.pdf", - "cards.petLink": "/pdfs/cards/PetCards.pdf" -} + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf", + "cards.dressupCardsLink": "https://resources.scratch.mit.edu/www/cards/en/dressupCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/en/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf" +} \ No newline at end of file diff --git a/src/views/credits/credits.jsx b/src/views/credits/credits.jsx index 810abdfbb..6f9fbfae6 100644 --- a/src/views/credits/credits.jsx +++ b/src/views/credits/credits.jsx @@ -32,6 +32,11 @@ var Credits = React.createClass({ Kasia Chmielinski
  • +
  • + Mark Avatar + Mark Ferrell +
  • +
  • Chris Avatar Chris Garrity @@ -141,11 +146,6 @@ var Credits = React.createClass({ Mark Goff
  • -
  • - Christina Avatar - Christina Huang -
  • -
  • Connor Avatar Connor Hudson diff --git a/src/views/credits/l10n.json b/src/views/credits/l10n.json index 01c3d92b8..59a4b0c14 100644 --- a/src/views/credits/l10n.json +++ b/src/views/credits/l10n.json @@ -3,7 +3,7 @@ "credits.developers": "Scratch is designed and developed by the Lifelong Kindergarten Group at MIT Media Lab:", "credits.moderators": "The team of Scratch moderators manages, supports, and improves the Scratch online community:", "credits.previousTitle": "Previous MIT Scratch Team Members", - "credits.previousBody": "Many important contributions have been made by previous Scratch Team members, including John Maloney (who led software development for the first decade of Scratch), Andrés Monroy-Hernández (who led the development of the first Scratch community website), Ben Berg, Amos Blanton, Karen Brennan, Juanita Buitrago, Leo Burd, Gaia Carini, Michelle Chung, Shane Clements, Hannah Cole, Sayamindu Dasgupta, Margarita Dekoli, Evelyn Eastmond, Dave Feinberg, Champika Fernando, Chris Graves, Megan Haddadi, Tony Hwang, Abdulrahman Idlbi, Randy Jou, Di Liu, Tim Mickel, Amon Millner, Ricarose Roque, Andrea Saxman, Jay Silver, Tammy Stern, Lis Sylvan, Claudia Urrea, and Oren Zuckerman.", + "credits.previousBody": "Many important contributions have been made by previous Scratch Team members, including John Maloney (who led software development for the first decade of Scratch), Andrés Monroy-Hernández (who led the development of the first Scratch community website), Ben Berg, Amos Blanton, Karen Brennan, Juanita Buitrago, Leo Burd, Gaia Carini, Michelle Chung, Shane Clements, Hannah Cole, Sayamindu Dasgupta, Margarita Dekoli, Evelyn Eastmond, Dave Feinberg, Champika Fernando, Chris Graves, Megan Haddadi, Christina Huang, Tony Hwang, Abdulrahman Idlbi, Randy Jou, Di Liu, Tim Mickel, Amon Millner, Ricarose Roque, Andrea Saxman, Jay Silver, Tammy Stern, Lis Sylvan, Claudia Urrea, and Oren Zuckerman.", "credits.partnersTitle": "Design and Development Partners", "credits.partnersBody": "Paula Bontá and Brian Silverman, Playful Invention Company (who started contributing to the design of Scratch even before it was called Scratch).", "credits.researchersTitle": "Scratch Researchers", diff --git a/src/views/download/download.jsx b/src/views/download/download.jsx new file mode 100644 index 000000000..8eca5196b --- /dev/null +++ b/src/views/download/download.jsx @@ -0,0 +1,236 @@ +var React = require('react'); +var render = require('../../lib/render.jsx'); + +var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; +var FormattedMessage = require('react-intl').FormattedMessage; + +var api = require('../../lib/api'); +var Page = require('../../components/page/www/page.jsx'); +var TitleBanner = require('../../components/title-banner/title-banner.jsx'); +var FlexRow = require('../../components/flex-row/flex-row.jsx'); +var SubNavigation = require('../../components/subnavigation/subnavigation.jsx'); + +require('./download.scss'); +require('../../components/forms/button.scss'); + +var Download = React.createClass({ + type: 'Download', + getInitialState: function () { + return { + swfVersion: '' + }; + }, + componentDidMount: function () { + api({ + host: '', + uri: '/scratchr2/static/sa/version.xml', + responseType: 'string' + }, function (err, body, res) { + if (err || res.statusCode >= 400) { + return this.setState({ + swfVersion: -1 + }); + } + + var doc = new DOMParser().parseFromString(body, 'text/xml'); + return this.setState({ + swfVersion: doc.getElementsByTagName('versionNumber')[0].childNodes[0].nodeValue + }); + }.bind(this)); + }, + render: function () { + if (this.state.swfVersion.length > 0 && this.state.swfVersion !== -1) { + var downloadUrls = { + mac: '/scratchr2/static/sa/Scratch-'+ this.state.swfVersion + '.dmg', + mac105: '/scratchr2/static/sa/Scratch-'+ this.state.swfVersion + '.air', + windows: '/scratchr2/static/sa/Scratch-'+ this.state.swfVersion + '.exe', + linux: '/scratchr2/static/sa/Scratch-'+ this.state.swfVersion + '.air' + }; + } + + return ( +
    + +
    +

    + +

    +

    + +

    +
    +
    + + +
  • + +
  • + + +
  • + +
  • +
    + +
  • + +
  • +
    + +
  • + +
  • +
    + + + +
    +
    +
    +

    + +

    + +
    +
    +

    {'1'}

    +
    +

    +

    + +
    +
    +
    +

    {'2'}

    +
    +

    +

    + {downloadUrls ? [ + + ] : []} + {this.state.swfVersion === -1 ? [ +

    + ] : []} +
    +
    +
    +

    {'3'}

    +
    +

    +

    + +
    +
    +
    +
    +
    +
    + +

    +

    + {this.state.swfVersion !== -1 ? [ +

    + +

    + ] : []} +
    + +
    + +

    +

    +

    +
    + +
    + +

    +

    +

    +

    + + + +
    +
    +
    + + ); + } +}); + +render(, document.getElementById('app')); diff --git a/src/views/download/download.scss b/src/views/download/download.scss new file mode 100644 index 000000000..7a82a04ae --- /dev/null +++ b/src/views/download/download.scss @@ -0,0 +1,124 @@ +@import "../../colors"; +@import "../../frameless"; + +$developer-spot: $splash-blue; + +#view { + padding: 0; +} + +.download { + .title-banner { + &.masthead { + margin-bottom: 0; + background-color: $developer-spot; + padding-bottom: 0; + + h1 { + margin: 0 0 2rem 0; + text-align: left; + color: $ui-white; + } + + p { + margin: 0; + text-align: left; + color: $ui-white; + + a { + border-bottom: 1px solid $ui-white; + color: $ui-white; + } + } + + .band { + $band-color: #3baddd; + + margin-top: 2rem; + background-color: $band-color; + padding: 1rem 0; + } + + .sub-nav { + text-align: left; + justify-content: flex-start; + + li { + margin: 0 .5rem 0 0; + } + } + } + } + + .sub-nav-item { + margin: .5rem; + } + + .download-content { + padding-bottom: 2rem; + } + + .three-col-row { + align-items: flex-start; + } + + .installation { + background-color: $ui-gray; + padding: 2rem; + } + + .installation-column { + max-width: $cols4; + text-align: center; + } + + .installation-column-number { + margin: 2rem auto; + border: 2px solid $active-gray; + border-radius: 2rem; + box-shadow: 0 0 0 .5rem lighten($ui-blue, 35); + background-color: $ui-blue; + width: 3.75rem; + height: 3.75rem; + } + + .installation-column-number-text { + text-align: center; + line-height: 1.8em; + color: $type-white; + } + + .installation-downloads { + padding-left: 0; + list-style: none; + } + + .installation-downloads-item { + margin: .25rem; + padding: 0; + text-align: center; + } + + section { + margin-bottom: 2rem; + } + + .mod-link { + color: $ui-white; + } + + @media only screen and (max-width: $mobile - 1) { + .inner { + .installation-column { + max-width: 100%; + } + } + } + + @media only screen and (max-width: $desktop - 1) { + .three-col-row { + flex-direction: column; + align-items: center; + } + } +} diff --git a/src/views/download/l10n.json b/src/views/download/l10n.json new file mode 100644 index 000000000..0a68a4f15 --- /dev/null +++ b/src/views/download/l10n.json @@ -0,0 +1,32 @@ +{ + "download.title": "Scratch 2 Offline Editor", + "download.intro": "You can install the Scratch 2.0 editor to work on projects without an internet connection. This version will work on Mac, Windows, and some versions of Linux (32 bit).", + "download.introMac": "Note for Mac Users: the latest version of Scratch 2.0 Offline requires Adobe Air 20. To upgrade to Adobe Air 20 manually, go here.", + "download.installation": "Installation", + "download.airTitle": "Adobe AIR", + "download.airBody": "If you don't already have it, download and install the latest Adobe AIR", + "download.macOSX": "Mac OS X", + "download.macOlder": "Mac OS 10.5 & Older", + "download.windows": "Windows", + "download.linux": "Linux", + "download.download": "Download", + "download.offlineEditorTitle": "Scratch Offline Editor", + "download.offlineEditorBody": "Next download and install the Scratch 2.0 Offline Editor", + "download.supportMaterialsTitle": "Support Materials", + "download.supportMaterialsBody": "Need some help getting started? Here are some helpful resources.", + "download.starterProjects": "Starter Projects", + "download.gettingStarted": "Getting Started Guide", + "download.scratchCards": "Scratch Cards", + "download.updatesTitle": "Updates", + "download.updatesBody": "The Offline Editor can update itself (with user permission). It will check for updates at startup or you can use the \"Check for updates\" command in the file menu.", + "download.currentVersion": "The current version is {version}.", + "download.otherVersionsTitle": "Other Versions of Scratch", + "download.otherVersionsOlder": "If you have an older computer, or cannot install the Scratch 2.0 offline editor, you can try installing Scratch 1.4.", + "download.otherVersionsAdmin": "If you are a network administrator: a Scratch 2.0 MSI has been created and maintained by a member of the community and hosted for public download here.", + "download.knownIssuesTitle": "Known issues", + "download.knownIssuesOne": "If your offline editor is crashing directly after Scratch is opened, install the Scratch 2 offline editor again (see step 2 above.) This issue is due to a bug introduced in Adobe Air version 14. (released April 2014).", + "download.knownIssuesTwo": "Graphic effects blocks (in \"Looks\") may slow down projects due to a known Flash bug.", + "download.knownIssuesThree": "The backpack is not yet available.", + "download.reportBugs": "Report Bugs and Glitches", + "download.notAvailable": "Hmm, editor downloads are not available right now - please refresh the page to try again." +} diff --git a/src/views/faq/l10n.json b/src/views/faq/l10n.json index 746cbd48f..ca69a514a 100644 --- a/src/views/faq/l10n.json +++ b/src/views/faq/l10n.json @@ -11,7 +11,7 @@ "faq.aboutScratchTitle":"What is Scratch, and what can I do with it?", "faq.aboutScratchBody":"Scratch is a programming language and online community where you can create your own interactive stories, games, and animations -- and share your creations with others around the world. In the process of designing and programming Scratch projects, young people learn to think creatively, reason systematically, and work collaboratively. To learn more about Scratch, check out the About Scratch page.", "faq.makeGameTitle":"How do I make a game or animation with Scratch?", - "faq.makeGameBody":"Check out the help page to see lots of ways to get started with Scratch. Or just dive in to the project editor.", + "faq.makeGameBody":"Check out the tips page to see lots of ways to get started with Scratch. Or just dive in to the project editor.", "faq.requirementsTitle":"What are the system requirements for Scratch?", "faq.requirementsBody":"To run Scratch 2, you need to be using (1) a Windows, ChromeOS, Mac, or Linux computer; (2) a version of Adobe Flash Player released on or after June 15, 2016; (3) a relatively recent web browser: one of the latest two versions of Chrome (Windows, ChromeOS, Mac or Linux), Firefox (Windows or Mac only), Safari (Mac only), Edge (Windows only), or Internet Explorer 11 (Windows only). If your computer doesn’t meet these requirements, you can try downloading and installing Scratch 1.4, which you can still use to share projects to the Scratch 2 website.", "faq.offlineTitle":"Do you have a downloadable version so I can create and view projects offline?", diff --git a/src/views/privacypolicy/privacypolicy.jsx b/src/views/privacypolicy/privacypolicy.jsx index 21890ccc5..69ab4eac7 100644 --- a/src/views/privacypolicy/privacypolicy.jsx +++ b/src/views/privacypolicy/privacypolicy.jsx @@ -55,7 +55,7 @@ var Privacypolicy = React.createClass({ Scratch Team is responsible for moderation, we have access to all content stored on the Scratch website, including unshared projects. If you prefer to work on projects in complete privacy, you can use - either the Scratch 2 offline editor{' '} + either the Scratch 2 offline editor{' '} or Scratch 1.4.
    Usage Information:
    diff --git a/src/views/thingstotry/l10n-static.json b/src/views/thingstotry/l10n-static.json deleted file mode 100644 index dad185ae0..000000000 --- a/src/views/thingstotry/l10n-static.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ttt.MakeItFlyActivityLoc": "/pdfs/cards/FlyCards.pdf", - "ttt.MakeItFlyGuideLoc": "/pdfs/guides/FlyGuide.pdf", - "ttt.AnimateYourNameActivityLoc": "/pdfs/cards/AnimateYourNameCards.pdf", - "ttt.AnimateYourNameGuideLoc": "/pdfs/guides/NameGuide.pdf", - "ttt.MakeMusicActivityLoc": "/pdfs/cards/MusicCards.pdf", - "ttt.MakeMusicGuideLoc": "/pdfs/guides/MusicGuide.pdf", - "ttt.RaceActivityLoc": "/pdfs/cards/RaceGameCards.pdf", - "ttt.RaceGuideLoc": "/pdfs/guides/RaceGuide.pdf", - "ttt.DanceActivityLoc": "/pdfs/cards/DanceCards.pdf", - "ttt.DanceGuideLoc": "/pdfs/guides/DanceGuide.pdf", - "ttt.PongActivityLoc": "/pdfs/cards/PongCards.pdf", - "ttt.PongGuideLoc": "/pdfs/guides/PongGuide.pdf", - "ttt.CatchActivityLoc": "/pdfs/cards/CatchCards.pdf", - "ttt.CatchGuideLoc": "/pdfs/guides/CatchGuide.pdf", - "ttt.HideAndSeekActivityLoc": "/pdfs/cards/Hide-and-Seek-Cards.pdf", - "ttt.HideAndSeekGuideLoc": "/pdfs/guides/Hide-and-Seek-Guide.pdf", - "ttt.VirtualPetActivityLoc": "/pdfs/cards/PetCards.pdf", - "ttt.VirtualPetGuideLoc": "/pdfs/guides/PetGuide.pdf", - "ttt.FashionActivityLoc": "/pdfs/cards/FashionCards.pdf", - "ttt.FashionGuideLoc": "/pdfs/guides/FashionGuide.pdf", - "ttt.StoryActivityLoc": "/pdfs/cards/StoryCards.pdf", - "ttt.StoryGuideLoc": "/pdfs/guides/StoryGuide.pdf" -} diff --git a/src/views/thingstotry/thingstotry.jsx b/src/views/thingstotry/thingstotry.jsx deleted file mode 100644 index 35189f3b0..000000000 --- a/src/views/thingstotry/thingstotry.jsx +++ /dev/null @@ -1,90 +0,0 @@ -var React = require('react'); -var injectIntl = require('react-intl').injectIntl; -var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; -var FormattedMessage = require('react-intl').FormattedMessage; -var render = require('../../lib/render.jsx'); - -var MasonryGrid = require('../../components/masonrygrid/masonrygrid.jsx'); -var Page = require('../../components/page/www/page.jsx'); -var TitleBanner = require('../../components/title-banner/title-banner.jsx'); -var TTTTile = require('../../components/ttt-tile/ttt-tile.jsx'); -var TTTModal = require('../../components/modal/ttt/modal.jsx'); -var Tiles = require('./ttt.json'); - -require('./thingstotry.scss'); - -var ThingsToTry = injectIntl(React.createClass({ - type: 'ThingsToTry', - getInitialState: function () { - return { - currentTile: Tiles[0], - TTTModalOpen: false - }; - }, - showTTTModal: function (tile) { - // expects translated tile - this.setState({currentTile: tile}); - this.setState({TTTModalOpen: true}); - }, - hideTTTModal: function () { - this.setState({TTTModalOpen: false}); - }, - renderTTTTiles: function () { - var formatMessage = this.props.intl.formatMessage; - var translatedTiles = []; - var translatedTile = {}; - - Tiles.map(function (tile, key) { - translatedTile = { - title: formatMessage({id: tile.title}), - description: formatMessage({id: tile.description}), - tutorialLoc: tile.tutorialLoc, - activityLoc: formatMessage({id: tile.activityLoc}), - guideLoc: formatMessage({id: tile.guideLoc}), - thumbUrl: tile.thumbUrl, - bannerUrl: tile.bannerUrl - }; - translatedTiles.push( - - ); - }, this); // don't forget to pass 'this' into map function - return translatedTiles; - }, - render: function () { - return ( -
    - -
    - -
    -

    - -

    -

    - -

    -
    - -
    -
    - - {this.renderTTTTiles()} - - -
    - -
    -
    - ); - } -})); - -render(, document.getElementById('app')); diff --git a/src/views/thingstotry/thingstotry.scss b/src/views/thingstotry/thingstotry.scss deleted file mode 100644 index 244dc0a30..000000000 --- a/src/views/thingstotry/thingstotry.scss +++ /dev/null @@ -1,86 +0,0 @@ -@import "../../colors"; -@import "../../frameless"; - -$base-bg: $ui-white; - -#view { - padding: 0; -} - -.ttt-section { - display: flex; - margin: 0 auto; - text-align: center; - justify-content: center; - flex-wrap: wrap; - align-items: center; -} - -.ttt-banner-image { - max-width: calc(100% - 2rem); -} - -//4 columns -@media only screen and (max-width: $mobile - 1) { - - .title-banner { - &.masthead { - padding-bottom: 1.25rem; - - p { - max-width: $cols4; - } - } - } - - .ttt-section.mod-title-banner { - max-width: $mobile; - } -} - -//6 columns -@media only screen and (min-width: $mobile) and (max-width: $tablet - 1) { - .title-banner { - &.masthead { - - p { - max-width: $cols6; - } - } - } - - .ttt-section.mod-title-banner { - max-width: $mobile; - } -} - - -//8 columns -@media only screen and (min-width: $tablet) and (max-width: $desktop - 1) { - .title-banner { - &.masthead { - padding-bottom: 2rem; - - p { - max-width: $cols8; - } - } - } - - .ttt-section.mod-title-banner { - max-width: $tablet; - } -} - -// 12 columns -@media only screen and (min-width: $desktop) { - .title-banner { - &.masthead { - padding-bottom: 1.25rem; - - p { - max-width: $cols8; - } - } - } -} diff --git a/src/views/tips/l10n-static.json b/src/views/tips/l10n-static.json new file mode 100644 index 000000000..19d5ca096 --- /dev/null +++ b/src/views/tips/l10n-static.json @@ -0,0 +1,29 @@ +{ + "cards.Scratch2CardsLink": "https://resources.scratch.mit.edu/www/cards/en/Scratch2Cards.pdf", + "cards.ScratchCardsAllLink": "https://resources.scratch.mit.edu/www/cards/en/ScratchCardsAll.pdf", + "cards.catchCardsLink": "https://resources.scratch.mit.edu/www/cards/en/catchCards.pdf", + "cards.danceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/danceCards.pdf", + "cards.dressupCardsLink": "https://resources.scratch.mit.edu/www/cards/en/dressupCards.pdf", + "cards.fashionCardsLink": "https://resources.scratch.mit.edu/www/cards/en/fashionCards.pdf", + "cards.flyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/flyCards.pdf", + "cards.hide-seekCardsLink": "https://resources.scratch.mit.edu/www/cards/en/hide-seekCards.pdf", + "cards.musicCardsLink": "https://resources.scratch.mit.edu/www/cards/en/musicCards.pdf", + "cards.nameCardsLink": "https://resources.scratch.mit.edu/www/cards/en/nameCards.pdf", + "cards.petCardsLink": "https://resources.scratch.mit.edu/www/cards/en/petCards.pdf", + "cards.pongCardsLink": "https://resources.scratch.mit.edu/www/cards/en/pongCards.pdf", + "cards.raceCardsLink": "https://resources.scratch.mit.edu/www/cards/en/raceCards.pdf", + "cards.storyCardsLink": "https://resources.scratch.mit.edu/www/cards/en/storyCards.pdf", + "guides.AnimateYourNameGuideLink": "https://resources.scratch.mit.edu/www/guides/en/AnimateYourNameGuide.pdf", + "guides.CatchGuideLink": "https://resources.scratch.mit.edu/www/guides/en/CatchGuide.pdf", + "guides.DanceGuideLink": "https://resources.scratch.mit.edu/www/guides/en/DanceGuide.pdf", + "guides.FashionGuideLink": "https://resources.scratch.mit.edu/www/guides/en/FashionGuide.pdf", + "guides.FlyGuideLink": "https://resources.scratch.mit.edu/www/guides/en/FlyGuide.pdf", + "guides.Getting-Started-Guide-Scratch2Link": "https://resources.scratch.mit.edu/www/guides/en/Getting-Started-Guide-Scratch2.pdf", + "guides.HideandSeekGuideLink": "https://resources.scratch.mit.edu/www/guides/en/HideandSeekGuide.pdf", + "guides.MusicGuideLink": "https://resources.scratch.mit.edu/www/guides/en/MusicGuide.pdf", + "guides.NameGuideLink": "https://resources.scratch.mit.edu/www/guides/en/NameGuide.pdf", + "guides.PetGuideLink": "https://resources.scratch.mit.edu/www/guides/en/PetGuide.pdf", + "guides.PongGuideLink": "https://resources.scratch.mit.edu/www/guides/en/PongGuide.pdf", + "guides.RaceGuideLink": "https://resources.scratch.mit.edu/www/guides/en/RaceGuide.pdf", + "guides.StoryGuideLink": "https://resources.scratch.mit.edu/www/guides/en/StoryGuide.pdf" +} diff --git a/src/views/thingstotry/l10n.json b/src/views/tips/l10n.json similarity index 57% rename from src/views/thingstotry/l10n.json rename to src/views/tips/l10n.json index d6697049b..7100094b5 100644 --- a/src/views/thingstotry/l10n.json +++ b/src/views/tips/l10n.json @@ -1,10 +1,24 @@ { + "tips.title": "Getting Started", + "tips.subTitle": "Start making projects in Scratch by trying the online tutorial or downloading the PDF Guide.", + "tips.tryGettingStarted": "Try the Getting Started tutorial", + "tips.tttHeader": "Things to Try", + "tips.tttBody": "What do you want to make with Scratch? For each activity, you can try the Tutorial, download a set of Activity Cards, or view the Educator Guide.", + "tips.cardsHeader": "Get the Entire Collection of Activity Cards", + "tips.cardsBody": "With the Scratch Activity Cards, you can learn to create interactive games, stories, music, animations, and more!", + "tips.cardsDownload": "Download PDF", + "tips.cardsPurchase": "Purchase Printed Set", + "tips.starterProjectsHeader": "Starter Projects", + "tips.starterProjectsBody": "You can play with Starter Projects to get ideas for making your own projects.", + "tips.starterProjectsPlay": "Play with Starter Projects", + "tips.offlineEditorHeader": "Offline Editor", + "tips.offlineEditorBody": "To create projects without an Internet connection, you can download the offline editor.", + "tips.questionsHeader": "Questions", + "tips.questionsBody": "Have more questions? See the Frequently Asked Questions or visit the Help with Scripts Forum.", "ttt.tutorial": "Tutorial", "tile.guides": "See Cards and Guides", "tile.tryIt": "Try It", "ttt.placeholder": "Placeholder text", - "ttt.title": "Things to Try", - "ttt.subTitle": "You can get started with Scratch in a variety of ways. Click a picture to try the Tutorial. You can also download a set of Activity Cards and Educator Guide for each theme.", "ttt.tutorialSubtitle": "Find out how to make this project using a step-by-step tutorial in Scratch.", "ttt.activityTitle": "Activity Cards", "ttt.activitySubtitle": "Explore new coding ideas using this set of illustrated cards you can print out.", diff --git a/src/views/tips/tips.jsx b/src/views/tips/tips.jsx new file mode 100644 index 000000000..da9295b50 --- /dev/null +++ b/src/views/tips/tips.jsx @@ -0,0 +1,191 @@ +var React = require('react'); +var injectIntl = require('react-intl').injectIntl; +var FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage; +var FormattedMessage = require('react-intl').FormattedMessage; +var render = require('../../lib/render.jsx'); + +var MasonryGrid = require('../../components/masonrygrid/masonrygrid.jsx'); +var Page = require('../../components/page/www/page.jsx'); +var Button = require('../../components/forms/button.jsx'); +var TitleBanner = require('../../components/title-banner/title-banner.jsx'); +var FlexRow = require('../../components/flex-row/flex-row.jsx'); +var TTTTile = require('../../components/ttt-tile/ttt-tile.jsx'); +var TTTModal = require('../../components/modal/ttt/modal.jsx'); +var Tiles = require('./ttt.json'); + +require('./tips.scss'); + +var Tips = injectIntl(React.createClass({ + type: 'Tips', + getInitialState: function () { + return {currentTile: Tiles[0], TTTModalOpen: false}; + }, + showTTTModal: function (tile) { + // expects translated tile + this.setState({currentTile: tile, TTTModalOpen: true}); + }, + hideTTTModal: function () { + this.setState({TTTModalOpen: false}); + }, + renderTTTTiles: function () { + var formatMessage = this.props.intl.formatMessage; + var translatedTile = {}; + + return Tiles.map(function (tile, key) { + translatedTile = { + title: formatMessage({id: tile.title}), + description: formatMessage({id: tile.description}), + tutorialLoc: tile.tutorialLoc, + activityLoc: formatMessage({id: tile.activityLoc}), + guideLoc: formatMessage({id: tile.guideLoc}), + thumbUrl: tile.thumbUrl, + bannerUrl: tile.bannerUrl + }; + return (); + }, this); // don't forget to pass 'this' into map function + }, + render: function () { + var formatMessage = this.props.intl.formatMessage; + return ( +
    + +

    + +

    +

    + +

    +

    + + + +

    + +
    +
    +
    +
    +

    + +

    +

    + +

    +
    + + {this.renderTTTTiles()} + + +
    +
    +
    +
    + +
    +

    + +

    +

    + +

    +

    + + + + + + +

    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +

    + +

    +

    + +

    +

    + + + +

    +
    +
    +
    +
    +
    + +
    + +

    + +

    +

    + +

    +
    +
    + +

    + +

    +

    + +

    +
    +
    +
    +
    + ); + } +})); + +render( + , document.getElementById('app')); diff --git a/src/views/tips/tips.scss b/src/views/tips/tips.scss new file mode 100644 index 000000000..4dcbe1419 --- /dev/null +++ b/src/views/tips/tips.scss @@ -0,0 +1,222 @@ +@import "../../colors"; +@import "../../frameless"; + +$base-bg: $ui-white; + +#view { + background-color: $ui-gray; + padding: 0; +} + +.tips-resources { + background-color: $ui-white; + overflow: hidden; +} + +.ttt-section { + display: flex; + margin: 0 auto; + text-align: center; + justify-content: center; + flex-wrap: wrap; + align-items: center; +} + +.tips-divider { + border-top: 1px solid $ui-gray; + width: 100%; +} + +.tips-banner-image { + max-width: calc(100% - 2rem); +} + +$darken-button: rgba(0, 0, 0, .1); + +.tips-button { + margin-right: .75rem; + background-color: $ui-blue; + color: $ui-white; + font-size: 1rem; + + &.getting-started-button { + margin-right: 0; + background-color: $darken-button; + } + + img { + margin-right: 1rem; + height: 1.25rem; + vertical-align: middle; + } + + a { + color: $ui-white; + } +} + +.purchase-button { + img { + margin-right: 0; + margin-left: .75rem; + width: 1rem; + vertical-align: baseline; + } +} + +.tips-info-section { + padding: 2.5rem 0; + width: 100%; + justify-content: space-between; +} + +.tips-info-body { + text-align: left; +} + +.tips-cards-buttons { + a { + white-space: normal; + } +} + +img.tips-icon { + height: 1.75rem; +} +//4 columns +@media only screen and (max-width: $mobile - 1) { + + .title-banner { + &.masthead { + padding-bottom: 1.25rem; + + p { + max-width: $cols4; + } + } + } + + .ttt-head { + + p { + max-width: $cols4; + } + } + + //put the image first if in 4-column + .tips-info-body { + max-width: $cols4; + text-align: center; + + &.tips-illustration { + order: -1; + img { + width: $cols4; + } + } + + .button { + width: 100%; + } + } +} + +//6 columns +@media only screen and (min-width: $mobile) and (max-width: $tablet - 1) { + .title-banner { + &.masthead { + + p { + max-width: $cols6; + } + } + } + + .ttt-head { + p { + max-width: $cols6; + } + } + + .tips-info-body.tips-illustration { + order: -1; + img { + width: $cols4; + } + } + + .tips-info-body { + max-width: $cols4; + text-align: center; + } +} + + +//8 columns +@media only screen and (min-width: $tablet) and (max-width: $desktop - 1) { + .title-banner { + &.masthead { + padding-bottom: 2rem; + + p { + max-width: $cols6; + } + } + } + + .ttt-head { + p { + max-width: $cols6; + } + } + + .tips-info-section { + &.mod-align-top { + align-items: flex-start; + } + } + + .tips-info-body { + max-width: $cols4; + } + + .tips-button { + width: 100%; + } + + img.mod-flow-left { + transform: translate(-1*$cols2); + } +} + +// 12 columns +@media only screen and (min-width: $desktop) { + .title-banner { + &.masthead { + padding-bottom: 1.25rem; + + p { + max-width: $cols8; + } + } + } + + .ttt-head { + p { + max-width: $cols8; + } + } + + .tips-info-section { + &.mod-align-top { + align-items: flex-start; + } + } + + .tips-info-body { + max-width: $cols6; + &.mod-narrow { + max-width: $cols5; + } + } +} diff --git a/src/views/thingstotry/ttt.json b/src/views/tips/ttt.json similarity index 74% rename from src/views/thingstotry/ttt.json rename to src/views/tips/ttt.json index f39fb04e0..bdfdb9502 100644 --- a/src/views/thingstotry/ttt.json +++ b/src/views/tips/ttt.json @@ -5,8 +5,8 @@ "thumbUrl": "/images/ttt/animate-your-name.jpg", "bannerUrl": "/images/ttt/animate-your-name-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=name", - "activityLoc": "ttt.AnimateYourNameActivityLoc", - "guideLoc": "ttt.AnimateYourNameGuideLoc" + "activityLoc": "cards.nameCardsLink", + "guideLoc": "guides.AnimateYourNameGuideLink" }, { "title": "ttt.MakeItFlyTitle", @@ -14,8 +14,8 @@ "thumbUrl": "/images/ttt/make-it-fly.jpg", "bannerUrl": "/images/ttt/make-it-fly-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=fly", - "activityLoc": "ttt.MakeItFlyActivityLoc", - "guideLoc": "ttt.MakeItFlyGuideLoc" + "activityLoc": "cards.flyCardsLink", + "guideLoc": "guides.FlyGuideLink" }, { "title": "ttt.MakeMusicTitle", @@ -23,8 +23,8 @@ "thumbUrl": "/images/ttt/make-music.jpg", "bannerUrl": "/images/ttt/make-music-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=music", - "activityLoc": "ttt.MakeMusicActivityLoc", - "guideLoc": "ttt.MakeMusicGuideLoc" + "activityLoc": "cards.musicCardsLink", + "guideLoc": "guides.MusicGuideLink" }, { "title": "ttt.RaceTitle", @@ -32,8 +32,8 @@ "thumbUrl": "/images/ttt/race-to-the-finish.jpg", "bannerUrl": "/images/ttt/race-to-the-finish-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=racegame", - "activityLoc": "ttt.RaceActivityLoc", - "guideLoc": "ttt.RaceGuideLoc" + "activityLoc": "cards.raceCardsLink", + "guideLoc": "guides.RaceGuideLink" }, { "title": "ttt.HideAndSeekTitle", @@ -41,8 +41,8 @@ "thumbUrl": "/images/ttt/hide-and-seek.jpg", "bannerUrl": "/images/ttt/hide-and-seek-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=hide", - "activityLoc": "ttt.HideAndSeekActivityLoc", - "guideLoc": "ttt.HideAndSeekGuideLoc" + "activityLoc": "cards.hide-seekCardsLink", + "guideLoc": "guides.HideandSeekGuideLink" }, { "title": "ttt.FashionTitle", @@ -50,8 +50,8 @@ "thumbUrl": "/images/ttt/fashion-game.jpg", "bannerUrl": "/images/ttt/fashion-game-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=fashion", - "activityLoc": "ttt.FashionActivityLoc", - "guideLoc": "ttt.FashionGuideLoc" + "activityLoc": "cards.fashionCardsLink", + "guideLoc": "guides.FashionGuideLink" }, { "title": "ttt.StoryTitle", @@ -59,8 +59,8 @@ "thumbUrl": "/images/ttt/create-a-story.jpg", "bannerUrl": "/images/ttt/create-a-story-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=story", - "activityLoc": "ttt.StoryActivityLoc", - "guideLoc": "ttt.StoryGuideLoc" + "activityLoc": "cards.storyCardsLink", + "guideLoc": "guides.StoryGuideLink" }, { "title": "ttt.PongTitle", @@ -68,8 +68,8 @@ "thumbUrl": "/images/ttt/pong-game.jpg", "bannerUrl": "/images/ttt/pong-game-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=pong", - "activityLoc": "ttt.PongActivityLoc", - "guideLoc": "ttt.PongGuideLoc" + "activityLoc": "cards.pongCardsLink", + "guideLoc": "guides.PongGuideLink" }, { "title": "ttt.DanceTitle", @@ -77,8 +77,8 @@ "thumbUrl": "/images/ttt/lets-dance.jpg", "bannerUrl": "/images/ttt/lets-dance-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=dance", - "activityLoc": "ttt.DanceActivityLoc", - "guideLoc": "ttt.DanceGuideLoc" + "activityLoc": "cards.danceCardsLink", + "guideLoc": "guides.DanceGuideLink" }, { "title": "ttt.CatchTitle", @@ -86,8 +86,8 @@ "thumbUrl": "/images/ttt/catch-game.jpg", "bannerUrl": "/images/ttt/catch-game-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=catch", - "activityLoc": "ttt.CatchActivityLoc", - "guideLoc": "ttt.CatchGuideLoc" + "activityLoc": "cards.catchCardsLink", + "guideLoc": "guides.CatchGuideLink" }, { "title": "ttt.VirtualPetTitle", @@ -95,7 +95,7 @@ "thumbUrl": "/images/ttt/virtual-pet.jpg", "bannerUrl": "/images/ttt/virtual-pet-banner.jpg", "tutorialLoc": "/projects/editor/?tip_bar=pet", - "activityLoc": "ttt.VirtualPetActivityLoc", - "guideLoc": "ttt.VirtualPetGuideLoc" + "activityLoc": "cards.petCardsLink", + "guideLoc": "guides.PetGuideLink" } ] diff --git a/static/images/tips/arrow-icon.svg b/static/images/tips/arrow-icon.svg new file mode 100644 index 000000000..fe55548d1 --- /dev/null +++ b/static/images/tips/arrow-icon.svg @@ -0,0 +1,23 @@ + + + + arrow-icon + Created with Sketch. + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/tips/blocks-icon.svg b/static/images/tips/blocks-icon.svg new file mode 100644 index 000000000..2c9d7914f --- /dev/null +++ b/static/images/tips/blocks-icon.svg @@ -0,0 +1,22 @@ + + + + blocks icon + Created with Sketch. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/tips/cards-illustration.svg b/static/images/tips/cards-illustration.svg new file mode 100644 index 000000000..bdc54e189 --- /dev/null +++ b/static/images/tips/cards-illustration.svg @@ -0,0 +1,396 @@ + + + + cards + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/tips/download-icon.svg b/static/images/tips/download-icon.svg new file mode 100644 index 000000000..7521eddc3 --- /dev/null +++ b/static/images/tips/download-icon.svg @@ -0,0 +1,16 @@ + + + + download-icon + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/tips/project-illustration.svg b/static/images/tips/project-illustration.svg new file mode 100644 index 000000000..b926bf274 --- /dev/null +++ b/static/images/tips/project-illustration.svg @@ -0,0 +1,140 @@ + + + + illustration + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/tips/question-icon.svg b/static/images/tips/question-icon.svg new file mode 100644 index 000000000..eabc014a2 --- /dev/null +++ b/static/images/tips/question-icon.svg @@ -0,0 +1,18 @@ + + + + question icon + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/pdfs/cards/AnimateYourNameCards.pdf b/static/pdfs/cards/AnimateYourNameCards.pdf deleted file mode 100644 index 615efc76d..000000000 Binary files a/static/pdfs/cards/AnimateYourNameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/CatchCards.pdf b/static/pdfs/cards/CatchCards.pdf deleted file mode 100644 index 88581881c..000000000 Binary files a/static/pdfs/cards/CatchCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/DanceCards.pdf b/static/pdfs/cards/DanceCards.pdf deleted file mode 100644 index e86245521..000000000 Binary files a/static/pdfs/cards/DanceCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/DressupCards.pdf b/static/pdfs/cards/DressupCards.pdf deleted file mode 100644 index 3266d29da..000000000 Binary files a/static/pdfs/cards/DressupCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/FashionCards.pdf b/static/pdfs/cards/FashionCards.pdf deleted file mode 100644 index f163a95ab..000000000 Binary files a/static/pdfs/cards/FashionCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/FlyCards.pdf b/static/pdfs/cards/FlyCards.pdf deleted file mode 100644 index 525ecd1ff..000000000 Binary files a/static/pdfs/cards/FlyCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/Hide-and-Seek-Cards.pdf b/static/pdfs/cards/Hide-and-Seek-Cards.pdf deleted file mode 100644 index 9824977c6..000000000 Binary files a/static/pdfs/cards/Hide-and-Seek-Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/MusicCards.pdf b/static/pdfs/cards/MusicCards.pdf deleted file mode 100644 index e0cc2e9fe..000000000 Binary files a/static/pdfs/cards/MusicCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/PetCards.pdf b/static/pdfs/cards/PetCards.pdf deleted file mode 100644 index 9a93c9219..000000000 Binary files a/static/pdfs/cards/PetCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/PongCards.pdf b/static/pdfs/cards/PongCards.pdf deleted file mode 100644 index 20802708d..000000000 Binary files a/static/pdfs/cards/PongCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/RaceGameCards.pdf b/static/pdfs/cards/RaceGameCards.pdf deleted file mode 100644 index d3ae6b702..000000000 Binary files a/static/pdfs/cards/RaceGameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/Scratch2Cards.pdf b/static/pdfs/cards/Scratch2Cards.pdf deleted file mode 100644 index d74547780..000000000 Binary files a/static/pdfs/cards/Scratch2Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/StoryCards.pdf b/static/pdfs/cards/StoryCards.pdf deleted file mode 100644 index 4a7e6644c..000000000 Binary files a/static/pdfs/cards/StoryCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/AnimateYourNameCards.pdf b/static/pdfs/cards/ca/AnimateYourNameCards.pdf deleted file mode 100755 index e85c2155d..000000000 Binary files a/static/pdfs/cards/ca/AnimateYourNameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/CatchCards.pdf b/static/pdfs/cards/ca/CatchCards.pdf deleted file mode 100755 index 525d14b86..000000000 Binary files a/static/pdfs/cards/ca/CatchCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/DanceCards.pdf b/static/pdfs/cards/ca/DanceCards.pdf deleted file mode 100755 index d928b297d..000000000 Binary files a/static/pdfs/cards/ca/DanceCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/DressupCards.pdf b/static/pdfs/cards/ca/DressupCards.pdf deleted file mode 100755 index 76b497a6b..000000000 Binary files a/static/pdfs/cards/ca/DressupCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/FlyCards.pdf b/static/pdfs/cards/ca/FlyCards.pdf deleted file mode 100755 index 688e9a459..000000000 Binary files a/static/pdfs/cards/ca/FlyCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/Hide-and-Seek-Cards.pdf b/static/pdfs/cards/ca/Hide-and-Seek-Cards.pdf deleted file mode 100755 index b144b4d1e..000000000 Binary files a/static/pdfs/cards/ca/Hide-and-Seek-Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/MusicCards.pdf b/static/pdfs/cards/ca/MusicCards.pdf deleted file mode 100755 index f73661145..000000000 Binary files a/static/pdfs/cards/ca/MusicCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/PetCards.pdf b/static/pdfs/cards/ca/PetCards.pdf deleted file mode 100755 index 3ce55427f..000000000 Binary files a/static/pdfs/cards/ca/PetCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/PongCards.pdf b/static/pdfs/cards/ca/PongCards.pdf deleted file mode 100755 index 5abf5d8cb..000000000 Binary files a/static/pdfs/cards/ca/PongCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/RaceGameCards.pdf b/static/pdfs/cards/ca/RaceGameCards.pdf deleted file mode 100755 index 2e8c3c588..000000000 Binary files a/static/pdfs/cards/ca/RaceGameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/Scratch2Cards.pdf b/static/pdfs/cards/ca/Scratch2Cards.pdf deleted file mode 100644 index 6d1eac270..000000000 Binary files a/static/pdfs/cards/ca/Scratch2Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/ca/StoryCards.pdf b/static/pdfs/cards/ca/StoryCards.pdf deleted file mode 100755 index 548d751cb..000000000 Binary files a/static/pdfs/cards/ca/StoryCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/AnimateYourNameCards.pdf b/static/pdfs/cards/es/AnimateYourNameCards.pdf deleted file mode 100755 index 56631af00..000000000 Binary files a/static/pdfs/cards/es/AnimateYourNameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/CatchCards.pdf b/static/pdfs/cards/es/CatchCards.pdf deleted file mode 100644 index ff6181cea..000000000 Binary files a/static/pdfs/cards/es/CatchCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/DanceCards.pdf b/static/pdfs/cards/es/DanceCards.pdf deleted file mode 100755 index ec6164e15..000000000 Binary files a/static/pdfs/cards/es/DanceCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/DressupCards.pdf b/static/pdfs/cards/es/DressupCards.pdf deleted file mode 100755 index c3cd689bc..000000000 Binary files a/static/pdfs/cards/es/DressupCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/FlyCards.pdf b/static/pdfs/cards/es/FlyCards.pdf deleted file mode 100644 index c3d6b6f79..000000000 Binary files a/static/pdfs/cards/es/FlyCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/Hide-and-Seek-Cards.pdf b/static/pdfs/cards/es/Hide-and-Seek-Cards.pdf deleted file mode 100755 index cc04ac9b1..000000000 Binary files a/static/pdfs/cards/es/Hide-and-Seek-Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/MusicCards.pdf b/static/pdfs/cards/es/MusicCards.pdf deleted file mode 100644 index 86bdd57fd..000000000 Binary files a/static/pdfs/cards/es/MusicCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/PetCards.pdf b/static/pdfs/cards/es/PetCards.pdf deleted file mode 100755 index 90111aa07..000000000 Binary files a/static/pdfs/cards/es/PetCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/PongCards.pdf b/static/pdfs/cards/es/PongCards.pdf deleted file mode 100755 index 64438b635..000000000 Binary files a/static/pdfs/cards/es/PongCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/RaceGameCards.pdf b/static/pdfs/cards/es/RaceGameCards.pdf deleted file mode 100755 index 9b1c8df23..000000000 Binary files a/static/pdfs/cards/es/RaceGameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/Scratch2Cards.pdf b/static/pdfs/cards/es/Scratch2Cards.pdf deleted file mode 100644 index 9c4a09340..000000000 Binary files a/static/pdfs/cards/es/Scratch2Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/es/StoryCards.pdf b/static/pdfs/cards/es/StoryCards.pdf deleted file mode 100755 index 898488bd6..000000000 Binary files a/static/pdfs/cards/es/StoryCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/sv/Scratch2Cards.pdf b/static/pdfs/cards/sv/Scratch2Cards.pdf deleted file mode 100644 index e3d073531..000000000 Binary files a/static/pdfs/cards/sv/Scratch2Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/AnimateYourNameCards.pdf b/static/pdfs/cards/zh-tw/AnimateYourNameCards.pdf deleted file mode 100755 index 042135fc2..000000000 Binary files a/static/pdfs/cards/zh-tw/AnimateYourNameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/CatchCards.pdf b/static/pdfs/cards/zh-tw/CatchCards.pdf deleted file mode 100755 index 33cdae555..000000000 Binary files a/static/pdfs/cards/zh-tw/CatchCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/DanceCards.pdf b/static/pdfs/cards/zh-tw/DanceCards.pdf deleted file mode 100755 index 0f33e863d..000000000 Binary files a/static/pdfs/cards/zh-tw/DanceCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/DressupCards.pdf b/static/pdfs/cards/zh-tw/DressupCards.pdf deleted file mode 100755 index 71ddb6636..000000000 Binary files a/static/pdfs/cards/zh-tw/DressupCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/FlyCards.pdf b/static/pdfs/cards/zh-tw/FlyCards.pdf deleted file mode 100755 index 9afad280a..000000000 Binary files a/static/pdfs/cards/zh-tw/FlyCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/Hide-and-Seek-Cards.pdf b/static/pdfs/cards/zh-tw/Hide-and-Seek-Cards.pdf deleted file mode 100755 index 6d2fc1f03..000000000 Binary files a/static/pdfs/cards/zh-tw/Hide-and-Seek-Cards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/MusicCards.pdf b/static/pdfs/cards/zh-tw/MusicCards.pdf deleted file mode 100755 index 954732956..000000000 Binary files a/static/pdfs/cards/zh-tw/MusicCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/PetCards.pdf b/static/pdfs/cards/zh-tw/PetCards.pdf deleted file mode 100644 index a19d1d05d..000000000 Binary files a/static/pdfs/cards/zh-tw/PetCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/PongCards.pdf b/static/pdfs/cards/zh-tw/PongCards.pdf deleted file mode 100644 index b03e2828f..000000000 Binary files a/static/pdfs/cards/zh-tw/PongCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/RaceGameCards.pdf b/static/pdfs/cards/zh-tw/RaceGameCards.pdf deleted file mode 100644 index 74effb0a2..000000000 Binary files a/static/pdfs/cards/zh-tw/RaceGameCards.pdf and /dev/null differ diff --git a/static/pdfs/cards/zh-tw/StoryCards.pdf b/static/pdfs/cards/zh-tw/StoryCards.pdf deleted file mode 100755 index 48fd34f1b..000000000 Binary files a/static/pdfs/cards/zh-tw/StoryCards.pdf and /dev/null differ diff --git a/static/pdfs/guides/AnimateYourNameGuide.pdf b/static/pdfs/guides/AnimateYourNameGuide.pdf deleted file mode 100644 index a4ac28367..000000000 Binary files a/static/pdfs/guides/AnimateYourNameGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/CatchGuide.pdf b/static/pdfs/guides/CatchGuide.pdf deleted file mode 100644 index 20ac3fbca..000000000 Binary files a/static/pdfs/guides/CatchGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/DanceGuide.pdf b/static/pdfs/guides/DanceGuide.pdf deleted file mode 100644 index 6a75034be..000000000 Binary files a/static/pdfs/guides/DanceGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/FashionGuide.pdf b/static/pdfs/guides/FashionGuide.pdf deleted file mode 100644 index 82ec7820e..000000000 Binary files a/static/pdfs/guides/FashionGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/FlyGuide.pdf b/static/pdfs/guides/FlyGuide.pdf deleted file mode 100644 index aaa1c99b8..000000000 Binary files a/static/pdfs/guides/FlyGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/Getting-Started-Guide-Scratch2.pdf b/static/pdfs/guides/Getting-Started-Guide-Scratch2.pdf deleted file mode 100644 index d18c0a228..000000000 Binary files a/static/pdfs/guides/Getting-Started-Guide-Scratch2.pdf and /dev/null differ diff --git a/static/pdfs/guides/Hide-and-Seek-Guide.pdf b/static/pdfs/guides/Hide-and-Seek-Guide.pdf deleted file mode 100644 index 974f35c2b..000000000 Binary files a/static/pdfs/guides/Hide-and-Seek-Guide.pdf and /dev/null differ diff --git a/static/pdfs/guides/MusicGuide.pdf b/static/pdfs/guides/MusicGuide.pdf deleted file mode 100644 index 3b1eb53a2..000000000 Binary files a/static/pdfs/guides/MusicGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/NameGuide.pdf b/static/pdfs/guides/NameGuide.pdf deleted file mode 100644 index a1a707b47..000000000 Binary files a/static/pdfs/guides/NameGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/PetGuide.pdf b/static/pdfs/guides/PetGuide.pdf deleted file mode 100644 index 3274e7535..000000000 Binary files a/static/pdfs/guides/PetGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/PongGuide.pdf b/static/pdfs/guides/PongGuide.pdf deleted file mode 100644 index 9cfde378b..000000000 Binary files a/static/pdfs/guides/PongGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/RaceGuide.pdf b/static/pdfs/guides/RaceGuide.pdf deleted file mode 100644 index e95ca18ba..000000000 Binary files a/static/pdfs/guides/RaceGuide.pdf and /dev/null differ diff --git a/static/pdfs/guides/StoryGuide.pdf b/static/pdfs/guides/StoryGuide.pdf deleted file mode 100644 index 8b8f6426f..000000000 Binary files a/static/pdfs/guides/StoryGuide.pdf and /dev/null differ diff --git a/test/integration/smoke-testing/test_statistics_page.js b/test/integration/smoke-testing/test_statistics_page.js new file mode 100644 index 000000000..e6ce40693 --- /dev/null +++ b/test/integration/smoke-testing/test_statistics_page.js @@ -0,0 +1,69 @@ +var tap = require('tap'); +const test = tap.test; +const webdriver = require('selenium-webdriver'); +const By = webdriver.By; +const until = webdriver.until; + +const driver = new webdriver.Builder() + .forBrowser('chrome') + .build(); + +const findByXpath = (xpath) => { + return driver.wait(until.elementLocated(By.xpath(xpath), 1000 * 5)); +}; + +const findByCss = (css) => { + return driver.wait(until.elementLocated(By.css(css), 1000 * 5)); +}; + +const clickXpath = (xpath) => { + return findByXpath(xpath).then(el => el.click()); +}; + +const clickText = (text) => { + return clickXpath(`//*[contains(text(), '${text}')]`); +}; + +tap.plan(2); + +tap.tearDown(function () { + driver.quit(); +}); + +tap.beforeEach(function () { + /* + * load the page with the driver + * note that for now this is not testable on Staging, + * so I left it pointing to Production - + * we can at least use it post-deploy. + * + * var stagingURL = 'https://scratch.ly/statistics'; + */ + var productionURL = 'https://scratch.mit.edu/statistics'; + return driver.get(productionURL); +}); + +test('check that Monthly Activity Trends title is present & correct', t => { + var chartTitle = 'Monthly Activity Trends'; + findByCss('div.box-head h3') + .then((element) => element.getText('h3')) + .then((text) => t.equal(text, chartTitle, 'chart title should be Monthly Activity Trends')) + .then(() => t.end()); +}); + +test('check that Monthly Activity Trends chart > New Projects label is toggleable', t => { + var classXpath = `(//div[@id="activity_chart"]/*[name()='svg']/*[name()='g']/*[name()='g']/*` + + `[name()='g'])[4]/*[name()='g']/*[name()='g']/*[name()='g']`; + findByXpath(classXpath) + .then((element) => element.getAttribute('class')) + .then((classtext) => t.equal(classtext, 'nv-series', 'by default, New Projects should be enabled')) + .then(() => clickText('New Projects')) + .then(() => findByXpath(classXpath)) + .then((element) => element.getAttribute('class')) + .then((classtext) => t.equal(classtext, 'nv-series nv-disabled', 'when clicked, New Projects should be disabled')) + .then(() => clickText('New Projects')) + .then(() => findByXpath(classXpath)) + .then((element) => element.getAttribute('class')) + .then((classtext) => t.equal(classtext, 'nv-series', 'when clicked again, New Projects should be enabled')) + .then(() => t.end()); +}); diff --git a/webpack.config.js b/webpack.config.js index 12e3530d3..e908c0ec5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -105,11 +105,11 @@ module.exports = { ].concat(routes .filter(function (route) {return !route.redirect;}) .map(function (route) { - return new HtmlWebpackPlugin(defaults({}, require('./src/template-config.js'), { + return new HtmlWebpackPlugin(defaults({}, { title: route.title, filename: route.name + '.html', route: route - })); + }, require('./src/template-config.js'))); }) ).concat([ new CopyWebpackPlugin([