Changeset 29561 for other-projects


Ignore:
Timestamp:
12/08/14 20:44:27 (6 years ago)
Author:
davidb
Message:

Restructured so a NZ flag is produced if page is requested through a non-JSP active web server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nz-flag-design/trunk/similarity-2d/index.jsp

    r29537 r29561  
    11<html>
    22  <head>
    3   </head>
     3
     4  <script>
     5    // Set up a fallback position in case this page is accessed outside of a JSP context
     6    // (i.e., the JSP blocks aren't executed)
     7    var img_list = [ "Images/nz.gif" ];
     8  </script>
     9
    410  <%@ page import="java.io.*,java.util.*,java.awt.image.*,javax.imageio.*" %>
    511
     
    6470
    6571   %>
     72
    6673
    6774  <%
     
    132139      }
    133140      else {
    134  
     141          out.println("<script>");
     142          out.println("var dynamic_img_list = [ ");
     143          boolean first_entry = true;
    135144          for (final File fileEntry : imageFileList) {
    136145            String flagImageUrl = imageUrlBase + "/" + fileEntry.getName();
    137146
    138             out.println("<img src=\"" + flagImageUrl + "\">");
     147            //out.println("<img src=\"" + flagImageUrl + "\">");
     148            if (first_entry) {
     149              out.println("\"" + flagImageUrl + "\"");
     150              first_entry = false;
     151            }
     152            else {
     153              out.println(",\"" + flagImageUrl + "\"");
     154            }
     155          }
     156          out.println("];");
    139157
    140           }
     158          out.println("img_list = dynamic_img_list;");
     159
     160          out.println("</script>");
    141161    }
    142162
     
    144164   %>
    145165
     166 
     167  </head>
     168
     169
    146170  <body>
     171
     172  <script>
     173
     174    var i;
     175    for (i=0; i<img_list.length; i++) {
     176      document.write("<img src=\"" + img_list[i] + "\" style=\"padding: 4px;\">\n");
     177    }
     178
     179  </script>
     180
    147181  </body>
    148182
Note: See TracChangeset for help on using the changeset viewer.