Ignore:
Timestamp:
2010-11-22T17:32:16+13:00 (13 years ago)
Author:
sjb48
Message:

Continued work on XHTML parsing for format statement saving. Found js code for ensuring XHTML (innerXHTML). Removed a few unneccessary bits of code from default servlet that were lingering around from when we first started playing with format statements.

Location:
main/trunk/greenstone3/web/interfaces/oran
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js

    r23333 r23336  
    77{
    88
    9     var formatStatement = document.getElementById('formatStatement').innerHTML;
    10     //console.log(formatStatement);
     9    var formatDiv = document.getElementById('formatStatement');
     10    var formatStatement = innerXHTML(formatDiv);
     11    console.log(formatStatement);
     12
    1113
    1214    //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
     
    1517
    1618    $.post("http://localhost:8080/greenstone3/format?a=s&sa=s", {data: formatStatement}, function(data) {
    17         $('.result').innerHTML = data; //html(data);
     19        //$('.result').innerHTML = data; //html(data);
    1820        console.log("Success, we have received data");
    1921        console.log(data);
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl

    r23333 r23336  
    22<xsl:stylesheet version="1.0"
    33    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     4
    45    xmlns:java="http://xml.apache.org/xslt/java"
    56    xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
     
    2324
    2425    <!-- the output format for this layout is html -->
    25     <xsl:output method="html" omit-xml-declaration="yes"/> 
     26    <!-- <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes" omit-xml-declaration="yes"/> -->
     27    <xsl:output method="html" omit-xml-declaration="yes"/>
    2628
    2729    <!-- the main layout is defined here -->
     
    130132<!-- Sam2's div code -->
    131133
     134    <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
    132135    <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
    133136   
     
    177180
    178181    <div id="formatStatement">
    179 
     182        <div id="formatRoot">
     183   
    180184    <xsl:call-template name="xml-to-gui">
    181185        <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/>  -->
    182186        <xsl:with-param name="metadataSets" select="//metadataSetList"/>
    183187    </xsl:call-template>
    184 
     188        </div>
    185189    </div>
    186190    </td>   
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl

    r23333 r23336  
    196196                    <xsl:choose>
    197197                        <xsl:when test="@type='document'">
    198                             <option value = "document" selected = "document">Document</option>
     198                            <option value = "document" selected = "selected">Document</option>
    199199                            <option value = "classifier">Classifier</option>
    200200                            <option value = "source">Source</option>
    201201                        </xsl:when>
    202202                        <xsl:when test="@type='classifier'">
    203                             <option value = "classifier" selected = "classifier">Classifier</option>
     203                            <option value = "classifier" selected = "selected">Classifier</option>
    204204                            <option value = "document">Document</option>
    205205                            <option value = "source">Source</option>
    206206                        </xsl:when>
    207207                        <xsl:when test="@type='source'">
    208                             <option value = "source" selected = "source">Source</option>
     208                            <option value = "source" selected = "selected">Source</option>
    209209                            <option value ="document">Document</option>
    210210                            <option value ="classifier">Classifier</option>
    211211                        </xsl:when>
    212212                        <xsl:when test="@type='horizontal'">
    213                             <option value = "horizontal" selected = "horizontal">Horizontal</option>
    214                             <option value = "source" selected = "source">Source</option>
     213                            <option value = "horizontal" selected = "selected">Horizontal</option>
     214                            <option value = "source">Source</option>
    215215                            <option value ="document">Document</option>
    216216                            <option value ="classifier">Classifier</option>
     
    236236            <xsl:variable name="mode">
    237237                <xsl:choose>
    238                     <xsl:when test="not(@mode)">MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="vertical"></input></xsl:when>
    239                     <xsl:otherwise>MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="{@mode}"></input></xsl:otherwise>
     238                    <xsl:when test="not(@mode)">MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="vertical"><xsl:text></xsl:text></input></xsl:when>
     239                    <xsl:otherwise>MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="{@mode}"/></xsl:otherwise>
    240240                </xsl:choose>
    241241            </xsl:variable>
    242242   
    243             <table class="header"><tbody><tr><td class="header">MATCH=<input class="match" type="text" name="rawtextinput" size="10" value="{@match}"></input></td><td class="header"><xsl:copy-of select="$mode"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-plusthick" title="Click me to expand">[+]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
     243            <table class="header"><tbody><tr><td class="header">MATCH=<input class="match" type="text" name="rawtextinput" size="10" value="{@match}"/></td><td class="header"><xsl:copy-of select="$mode"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-plusthick" title="Click me to expand">[+]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
    244244
    245245                <table class="table" border="1">
     
    254254                </tbody>
    255255                </table>
    256         </div><br/>
     256        </div>
    257257    </xsl:template>
    258258
     
    312312                    <xsl:choose>
    313313                        <xsl:when test="@type='document'">
    314                             <option value = "document" selected = "document">Document</option>
     314                            <option value = "document" selected = "selected">Document</option>
    315315                            <option value = "classifier">Classifier</option>
    316316                            <option value = "source">Source</option>
    317317                        </xsl:when>
    318318                        <xsl:when test="@type='classifier'">
    319                             <option value = "classifier" selected = "classifier">Classifier</option>
     319                            <option value = "classifier" selected = "selected">Classifier</option>
    320320                            <option value = "document">Document</option>
    321321                            <option value = "source">Source</option>
    322322                        </xsl:when>
    323323                        <xsl:when test="@type='source'">
    324                             <option value = "source" selected = "source">Source</option>
     324                            <option value = "source" selected = "selected">Source</option>
    325325                            <option value ="document">Document</option>
    326326                            <option value ="classifier">Classifier</option>
Note: See TracChangeset for help on using the changeset viewer.