-
Notifications
You must be signed in to change notification settings - Fork 1
Adding a new page
-
Find the page where you want to add a link to a new page (example http://switchcalc.com/want.html)
-
Right click on the page and select "Save as.." to save the html
-
Open the html file in a text editor
-
Find the button you want to change. For example, in:
<a href="javascript:location.replace('break.html')" class="btn a" tabindex="2">I want a break</a>
<div class="btn b eat" tabindex="3">I want to eat</div>
<div class="btn c drink" tabindex="4">I want a drink</div>
<div class="btn d listen" tabindex="5">I want to listen to music</div>
<div class="btn e watch" tabindex="6">I want to watch something</div>
you have a link to the "break" page, followed by several buttons that say "I want to eat" etc. Let's say you want to change "I want to watch something" from just a button that says something to a link to a new page. Copy the code for the "break" section, and replace the code for the "I want to watch something" section with that, giving the new page a unique name like "watch" (update the btn and tabindex values as appropriate):
<a href="javascript:location.replace('watch.html')" class="btn e" tabindex="6">I want to watch something</a>
- Remove the code that plays the "watch"
.mp3because that's for buttons, not links to other pages. Remove:
<audio id="watch" controls style="display:none"><source src="sounds/watch.mp3" type="audio/mpeg"> Your browser does not support the audio element.</audio>
-
Go to a page that looks like what you're trying to create for your new page. For example, http://switchcalc.com/break.html. Save that page, open it in a text editor, and save it with the name of your new page (e.g.
watch.html). -
Update the title of your new page, e.g. from
<title>Break</title>to<title>Watch</title> -
Update the
alttext forinfo, e.g. from<img src="images/info.jpg" alt="You are on Break">to<img src="images/info.jpg" alt="You are on Watch Something"> -
Update the buttons to match the content you want, e.g. from
<div class="btn a rest" tabindex="2">I want to rest</div>to<div class="btn a test_kitchen" tabindex="2">America's Test Kitchen</div> -
Update the
audiotags, e.g. from<audio id="rest" controls style="display:none"><source src="sounds/rest.mp3" type="audio/mpeg"> Your browser does not support the audio element.</audio>to<audio id="test_kitchen" controls style="display:none"><source src="sounds/test_kitchen.mp3" type="audio/mpeg"> Your browser does not support the audio element.</audio> -
Update
talker.js. This file is available from switchcalc.com/cpanel. Login > File Manager > public_html > js, right click on talker.js and download. -
Open you local
talker.jsin your text editor and go to the section where all of the lines like this are:
if ($(':focus').hasClass('leg')) {document.getElementById('leg').play()}
if ($(':focus').hasClass('feet')) {document.getElementById('feet').play()}
At the end of this list, enter lines for your new buttons, e.g. if ($(':focus').hasClass('test_kitchen')) {document.getElementById('test_kitchen').play()}
-
Create the
mp3files to go with your new buttons (do this like you would for updatingdailyandweekendaudio files -- create the filestest_kitchen.mp3, etc.) -
Upload your new content using
cpanel, e.g.want.html,watch.html,talker.js,mp3files.