Changeset 292

Show
Ignore:
Timestamp:
05/19/08 22:41:59 (8 months ago)
Author:
chris
Message:

Fix transliteration table on search page.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lex/trunk/jsp/search.jsp

    r255 r292  
    144144                from the set: 
    145145        </p> 
    146         <% 
    147                 String latin  = ">BGDHWZXVJKLMNS<PYQRFCT"; 
    148                 String hebrew = HebrewConverter.toHebrew(latin); 
    149                 String trans  = HebrewConverter.toTranslit(latin); 
    150         %> 
    151146        <table class="grid"> 
    152147                <tr> 
    153148                        <th>Consonants</th> 
    154149                        <% 
     150                                String latin  = ">BGDHWZXVJKLMNS<PYQRFCT"; 
     151                                 
    155152                                for (int i = 0; i < latin.length()      ; i++) 
    156153                                { 
     
    165162                        <th>Hebrew</th> 
    166163                        <% 
    167                                 for (int i = 0; i < hebrew.length(); i++) 
     164                                for (int i = 0; i < latin.length()     ; i++) 
    168165                                { 
    169                                         String c = hebrew.substring(i, i + 1); 
     166                                        String c = latin.substring(i, i + 1); 
     167                                        String h = HebrewConverter.toHebrew(c); 
    170168                                        %> 
    171                                         <td class="hebrew"><%= c %></td> 
     169                                        <td class="hebrew"><%= h %></td> 
    172170                                        <% 
    173171                                } 
     
    177175                        <th>Transliteration</th> 
    178176                        <% 
    179                                 for (int i = 0; i < trans.length(); i++) 
     177                                for (int i = 0; i < latin.length()     ; i++) 
    180178                                { 
    181                                         String c = trans.substring(i, i + 1); 
     179                                        String c = latin.substring(i, i + 1); 
     180                                        String h = HebrewConverter.toTranslit(c); 
    182181                                        %> 
    183                                         <td><%= c %></td> 
     182                                        <td><%= h %></td> 
    184183                                        <% 
    185184                                } 
  • lex/trunk/test/com/qwirx/lex/SearchTest.java

    r259 r292  
    235235        i.assertStart("h1"); 
    236236        i.assertText("Lex"); 
    237         i.assertStart("font",  
     237        i.assertStart("span",  
    238238            new Attributes().style("font-size: medium")); 
    239239        i.assertText("by"); 
    240240        i.assertSimple("a", "Chris Wilson",  
    241241            new Attributes().href("http://www.qwirx.com")); 
    242         i.assertEnd("font"); 
     242        i.assertEnd("span"); 
    243243        i.assertEnd("h1"); 
    244244         
     
    270270            new Attributes().clazz("dump_jsp").href("dump.jsp")); 
    271271        */ 
     272        i.assertSimple("a", "Wordnet",  
     273            new Attributes().clazz("wordnet_jsp").href("wordnet.jsp")); 
    272274        i.assertSimple("a", "Login",  
    273275            new Attributes().clazz("login_jsp").href("login.jsp?next=search.jsp")); 
     
    278280         
    279281        i.assertStart("form", new Attributes().method("GET").clazz("bigborder")); 
    280         i.assertSimple("p", "Search for Hebrew word by root " + 
    281                 "(surface consonants):"); 
     282        i.assertSimple("p", "Simple search (enter surface consonants " + 
     283                "for a Hebrew word):"); 
    282284        i.assertStart("p"); 
    283285        i.assertEmpty("input", new Attributes().name("q")); 
    284286        i.assertEmpty("input", new Attributes().type("submit").value("Search")); 
    285287        i.assertEnd("p"); 
     288         
     289        i.assertEmpty("hr"); 
     290         
     291        i.assertSimple("p", "Advanced search (enter an MQL query to nest " + 
     292            "within [clause]):");  
     293        i.assertStart("p"); 
     294        i.assertEmpty("input", new Attributes().name("aq").add("size", "40")); 
     295        i.assertSubmit("advanced", "Search"); 
     296        i.assertEnd("p"); 
     297         
     298        i.assertEmpty("hr"); 
     299         
     300        i.assertStart("div",  
     301            new Attributes().add("id", "simple_adv_div").clazz("advanced")); 
     302         
    286303        i.assertStart("p"); 
    287304        i.assertEmpty("input", new Attributes().type("checkbox") 
     
    320337        i.assertStart("tr"); 
    321338        i.assertSimple("th", "Hebrew"); 
    322         for (int j = 0; j < hebrew.length(); j++) 
    323         { 
    324             String c = hebrew.substring(j, j + 1); 
    325             i.assertSimple("td", c); 
     339        for (int j = 0; j < latin.length(); j++) 
     340        { 
     341            String c = latin.substring(j, j + 1); 
     342            String h = HebrewConverter.toHebrew(c); 
     343            i.assertSimple("td", h, new Attributes().clazz("hebrew")); 
    326344        } 
    327345        i.assertEnd("tr"); 
     
    329347        i.assertStart("tr"); 
    330348        i.assertSimple("th", "Transliteration"); 
    331         for (int j = 0; j < trans.length(); j++) 
    332         { 
    333             String c = trans.substring(j, j + 1); 
    334             i.assertSimple("td", c); 
     349        for (int j = 0; j < latin.length(); j++) 
     350        { 
     351            String c = latin.substring(j, j + 1); 
     352            String h = HebrewConverter.toTranslit(c); 
     353            i.assertSimple("td", h); 
    335354        } 
    336355        i.assertEnd("tr"); 
    337356 
    338357        i.assertEnd("table"); 
     358        i.assertEnd("div", new Attributes().clazz("advanced")); 
     359         
     360        i.assertStart("div"); 
     361        i.assertInput("simple_adv_btn", "Advanced Options ") 
     362            .assertAttribute("type", "button") 
     363            .assertAttribute("onclick", "toggle(this, 'simple_adv_div')"); 
     364        i.assertEnd("div"); 
    339365        i.assertEnd("form"); 
    340366         
     
    346372        i.assertSimple("a", "Lex Project",  
    347373            new Attributes().href("http://rrg.qwirx.com/trac/lex")); 
    348         i.assertText("2005-2007."); 
     374        i.assertText("2005-2008."); 
    349375        i.assertEnd("p"); 
    350376        i.assertEnd("body");