Creating bundle for home.html

This commit is contained in:
Tim Mickel 2016-01-13 16:04:29 -05:00
parent 667e1d4e62
commit b7b1520a55
5 changed files with 50 additions and 37 deletions

View file

@ -29,7 +29,6 @@
"ScratchJr": true,
"Runtime": true,
"Localization": true,
"iOS": true,
"Settings": true,
"BlockSpecs": true,
"Block": true,
@ -39,7 +38,6 @@
"Scroll": true,
"Thread": true,
"Scripts": true,
"ScratchAudio": true,
"Library": true,
"Paint": true,
"Record": true,
@ -60,7 +58,6 @@
"Matrix": true,
"Page": true,
"Home": true,
"Lobby": true,
"Samples": true,
"Camera": true,
"Ghost": true,

View file

@ -7,24 +7,24 @@
<head>
<title>Scratch Jr</title>
<script type="text/javascript" src="./Settings.js"></script>
<script type="text/javascript" src="jssource/build/bundles/home.bundle.js"></script>
<!--
<script type="text/javascript" src="./Settings.js"></script>
<script type="text/javascript" src="jssource/utils/Cookie.js"></script>
<script type="text/javascript" src="jssource/utils/lib.js"></script>
<!-- Localization includes -->
-->
<!-- Localization includes --><!--
<script type="text/javascript" src="jssource/external/Intl/Intl.min.js"></script>
<script type="text/javascript" src="jssource/external/intl-messageformat/intl-messageformat.min.js"></script>
<script type="text/javascript" src="jssource/utils/Localization.js"></script>
<script>
Localization.includeLocales();
</script>
</script>-->
<!-- End localization includes -->
<!--
<script type="text/javascript">
preprocessAndLoadCss("css", "css/font.css");
preprocessAndLoadCss("css", "css/base.css");
preprocessAndLoadCss("css", "css/lobby.css");
preprocessAndLoadCss("css", "css/thumbs.css");
</script>
<script type="text/javascript" src="jssource/lobby/Lobby.js"></script>
@ -52,28 +52,13 @@
<script type="text/javascript" src="jssource/painteditor/Transform.js"></script>
<script type="text/javascript" src="jssource/painteditor/SVGTools.js"></script>
<script language="javascript">
function startup(){
iOS.getsettings(doNext);
function doNext (str){
var list = str.split(",");
iOS.path =list[1] == "0" ? list[0] + "/" : undefined ;
Lobby.appinit(Settings.scratchJrVersion);
}
}
function goBack(){window.location.href = "index.html?back=yes";}
</script>
-->
</head>
<body onload="iOS.waitForInterface(startup);">
<body>
<div class="frame" id="frame">
<div class="topbar" id="topbar">
<ul class="topbar-nav" id="nav">
<li class="logo" id="logotab" ontouchend="goBack();">
<li class="logo" id="logotab">
<span class="logo-icon"></span>
</li>
<div></div>
@ -113,19 +98,19 @@ function goBack(){window.location.href = "index.html?back=yes";}
<ul class="footer-nav" id="footernav">
<li class="tab" id="abouttab" >
<div class="about-icon"></div>
<span><script>document.write(Localization.localize("ABOUT_SCRATCHJR"));</script></span>
<span id="abouttab-text"></span>
</li>
<li class="tab" id="interfacetab">
<div class="interface-icon"></div>
<span><script>document.write(Localization.localize("INTERFACE_GUIDE"));</script></span>
<span id="interfacetab-text"></span>
</li>
<li class="tab" id="painttab">
<div class="paint-icon"></div>
<span><script>document.write(Localization.localize("PAINT_EDITOR_GUIDE"));</script></span>
<span id="painttab-text"></span>
</li>
<li class="tab2" id="blockstab">
<div class="blocks-icon"></div>
<span><script>document.write(Localization.localize("BLOCKS_GUIDE"));</script></span>
<span id="blockstab-text"></span>
</li>
<div></div>
</ul>

View file

@ -19,9 +19,6 @@
<!--<script type="text/javascript" src="jssource/external/Intl/Intl.min.js"></script>
<script type="text/javascript" src="jssource/external/intl-messageformat/intl-messageformat.min.js"></script>
<script type="text/javascript" src="jssource/utils/Localization.js"></script>
<script>
Localization.includeLocales();
</script>-->
<!-- End localization includes -->
<!--
<script type="text/javascript" src="jssource/utils/DrawPath.js"></script>

33
src/entry/home.js Normal file
View file

@ -0,0 +1,33 @@
import {gn, preprocessAndLoadCss} from '../utils/lib';
import iOS from '../iPad/iOS';
function startup () {
homeStrings();
iOS.getsettings(doNext);
function doNext (str) {
var list = str.split(',');
iOS.path = list[1] == '0' ? list[0] + '/' : undefined;
Lobby.appinit(Settings.scratchJrVersion);
}
}
function goBack () {
window.location.href = 'index.html?back=yes';
}
function homeStrings () {
gn('abouttab-text').textContent = Localization.localize('ABOUT_SCRATCHJR');
gn('interfacetab-text').textContent = Localization.localize('INTERFACE_GUIDE');
gn('painttab-text').textContent = Localization.localize('PAINT_EDITOR_GUIDE');
gn('blockstab-text').textContent = Localization.localize('BLOCKS_GUIDE');
}
window.onload = () => {
Localization.includeLocales();
preprocessAndLoadCss('css', 'css/font.css');
preprocessAndLoadCss('css', 'css/base.css');
preprocessAndLoadCss('css', 'css/lobby.css');
preprocessAndLoadCss('css', 'css/thumbs.css');
gn('logotab').ontouchend = goBack;
iOS.waitForInterface(startup);
};

View file

@ -2,7 +2,8 @@ module.exports = {
devtool: 'source-map',
entry: {
index: './src/entry/index.js',
editor: './src/entry/editor.js'
editor: './src/entry/editor.js',
home: './src/entry/home.js'
},
output: {
path: './src/build/bundles',