mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2024-11-28 18:45:49 -05:00
Revert "Trigger page changes with hashchange. Fix back button"
This reverts commit b184d78c3f
.
Conflicts:
js/scratchx.js
This commit is contained in:
parent
8b748a9604
commit
4507777c36
2 changed files with 16 additions and 21 deletions
20
index.html
20
index.html
|
@ -12,7 +12,7 @@
|
|||
<main>
|
||||
<header>
|
||||
<div>
|
||||
<a href="#home"><h1 class="scratchx-logo"><span>ScratchX</span></h1></a>
|
||||
<a href="#home" data-action="show"><h1 class="scratchx-logo"><span>ScratchX</span></h1></a>
|
||||
<nav class="main-nav">
|
||||
Related Sites:
|
||||
<ul>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<article id="home">
|
||||
<header>
|
||||
<div>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq">Please read the FAQ before trying them.</a></aside>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq" data-action="show">Please read the FAQ before trying them.</a></aside>
|
||||
|
||||
<h1>About ScratchX</h1>
|
||||
<p>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<section>
|
||||
<h2>Open an Extension File</h2>
|
||||
<p>Choose a .sbx file from your local drive</p>
|
||||
<p><a href="#faq-sbx-file">What is a .sbx file?</a></p>
|
||||
<p><a href="#faq-sbx-file" data-action="show">What is a .sbx file?</a></p>
|
||||
</section>
|
||||
<section>
|
||||
<button data-action="load-file">Browse for local file</button>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<section>
|
||||
<h2>Open an Extension URL</h2>
|
||||
<p>Paste the web address below</p>
|
||||
<p><a href="#faq-scratchx-url">What is a ScratchX URL?</a></p>
|
||||
<p><a href="#faq-scratchx-url" data-action="show">What is a ScratchX URL?</a></p>
|
||||
</section>
|
||||
<section>
|
||||
<form class="input-plus-button url-load-form">
|
||||
|
@ -93,14 +93,14 @@
|
|||
<div>
|
||||
<h2>Developer Documentation</h2>
|
||||
<p>Developers can create new Experimental Extensions using Javascript. To learn more, read the <a href="http://llk.github.io/scratch-extension-docs/">Developer Documentation</a>.</p>
|
||||
<p><button data-action="show" data-target="#scratch">Open editor</button></p>
|
||||
<p><a href="#scratch" data-action="show"><button>Open editor</button></a></p>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
<article id="privacy-policy">
|
||||
<section>
|
||||
<div>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq">Please read the FAQ before trying them.</a></aside>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq" data-action="show">Please read the FAQ before trying them.</a></aside>
|
||||
<div>
|
||||
<section class="main">
|
||||
<h1>Privacy Policy</h1>
|
||||
|
@ -139,7 +139,7 @@
|
|||
<article id="faq">
|
||||
<section>
|
||||
<div>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq">Please read the FAQ before trying them.</a></aside>
|
||||
<aside class="warning message"><strong>Warning:</strong> These extensions are experimental. <a href="#faq" data-action="show">Please read the FAQ before trying them.</a></aside>
|
||||
<div>
|
||||
<section class="main">
|
||||
<h1><abbr title="Frequently Asked Questions">FAQ</abbr></h1>
|
||||
|
@ -166,7 +166,7 @@
|
|||
<p>Click the 'Save' button at the top of the page to download your project as an .sbx file on to your local computer. You can then send this file to other people, and they can upload your file onto ScratchX to play with your project.</p>
|
||||
|
||||
<h2 id="faq-examples">Where can I find example Experimental Extensions to play around with?</h2>
|
||||
<p>We have linked to a few example extensions on the <a href="#home">ScratchX</a> homepage. We plan to highlight additional extensions in the coming months.</p>
|
||||
<p>We have linked to a few example extensions on the <a href="#home" data-action="show">ScratchX</a> homepage. We plan to highlight additional extensions in the coming months.</p>
|
||||
|
||||
<h2 id="faq-scratchx-url">What is a ScratchX URL?</h2>
|
||||
<p>Developers who make extensions for ScratchX can choose to create a custom web address or URL that points to their extension and/or demo project. Clicking on a ScratchX extension URL will take you directly to a project with an extension loaded.</p>
|
||||
|
@ -213,9 +213,9 @@
|
|||
<h2>ScratchX</h2>
|
||||
<ul>
|
||||
<li><a href="https://scratch.mit.edu/terms_of_use/">Terms of Service</a></li>
|
||||
<li><a href="#privacy-policy">Privacy Policy</a></li>
|
||||
<li><a href="#privacy-policy" data-action="show">Privacy Policy</a></li>
|
||||
<li><a href="mailto:scratch-extensions@media.mit.edu">Contact Us</a></li>
|
||||
<li><a href="#faq">FAQ</a></li>
|
||||
<li><a href="#faq" data-action="show">FAQ</a></li>
|
||||
<li><a href="https://scratch.mit.edu/discuss/41/">Forums</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -289,23 +289,18 @@ function JSshowWarning(extensionData) {
|
|||
|
||||
var showClickListener = function(e) {
|
||||
/*
|
||||
* Anything with data-action="show" should switch the view
|
||||
* Links with data-action="static-link" should switch the view
|
||||
* to that page. Works like tabs sort of. Use like...
|
||||
* <!-- Makes a link to the Privacy Policy section -->
|
||||
* <button data-target="#privacy-policy" data-action="show">Privacy Policy</button>
|
||||
* <a href="#privacy-policy" data-action="static-link">Privacy Policy</a>
|
||||
*
|
||||
*/
|
||||
window.location.hash = $(this).data("target");
|
||||
}
|
||||
var path = $(this).attr("href").substring(1);
|
||||
showPage(path);
|
||||
};
|
||||
|
||||
$(window).bind('hashchange', function(e) {
|
||||
var page = '';
|
||||
if (document.location.hash == '') {
|
||||
page = 'home';
|
||||
} else {
|
||||
page = window.location.hash.substr(1);
|
||||
}
|
||||
showPage(page);
|
||||
if (document.location.hash == '') showPage('home');
|
||||
});
|
||||
|
||||
function showPage(path) {
|
||||
|
|
Loading…
Reference in a new issue