Changeset 23255


Ignore:
Timestamp:
11/01/10 10:03:17 (10 years ago)
Author:
sjb48
Message:
 
Location:
main/trunk/greenstone3/web/interfaces/oran
Files:
4 edited

Legend:

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

    r23135 r23255  
    4747    });
    4848   
    49     $(".element_type_gsf_choose_metadata").draggable({
     49    $(".draggable_gsf_choose_metadata").draggable({
    5050            cursor: 'crosshair',
    5151            connectToSortable: '.td-div',
     
    7070
    7171    // switch, when, otherwise, icon
    72     $(".element_type_gsf_switch").draggable({
     72    $(".draggable_gsf_switch").draggable({
    7373            cursor: 'crosshair',
    7474            connectToSortable: '.td-div',
     
    7777    });
    7878
    79     $(".element_type_gsf_when").draggable({
     79    $(".draggable_gsf_when").draggable({
    8080            cursor: 'crosshair',
    8181            connectToSortable: '.gsf_switch',
     
    8484    });
    8585
    86     $(".element_type_gsf_otherwise").draggable({
     86    $(".draggable_gsf_otherwise").draggable({
    8787            cursor: 'crosshair',
    8888            connectToSortable: '.gsf_switch',
     
    9191    });
    9292
    93     $(".element_type_gsf_icon").draggable({
     93    $(".draggable_gsf_icon").draggable({
    9494            cursor: 'crosshair',
    9595            connectToSortable: '.gsf_link',
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl

    r23135 r23255  
    187187    <td width="25%" valign="top">
    188188        <h2> Elements to add </h2>
    189         <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div>
    190         <!-- <script type="text/javascript">
    191         <xsl:text disable-output-escaping="yes">
    192         var index = gsf_template_element.indexOf("<div class=\"");
    193         var a = gsf_template_element.slice(0, index + "<div class=\"".length);
    194         var b = gsf_template_element.slice(index + "<div class=\"".length + 1);
    195         var c = a.concat(".element_type_gsf_template", b);
    196         document.write(c);
    197         </xsl:text>
    198         </script> -->
    199         <div class="header element_type_gsf_choose_metadata css_gsf_choose_metadata" title="gsf:choose-metadata">CHOOSE-METADATA</div>
    200         <div class="draggable_gsf_metadata gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
     189        <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
     190        <div class="draggable_gsf_template css_gsf_template block" title="gsf:template"><table class="header"><tbody><tr><td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table><table border="1"><tr class="tr"><td class="droppable" width="10px"></td></tr></table></div><br/>
     191
     192        <div class="draggable_gsf_choose css_gsf_choose_metadata block" title="gsf:choose-metadata"><table class="header"><tbody><tr><td class="header">CHOOSE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" 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></div>
     193
     194        <div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
    201195                        <xsl:with-param name="metadataSets" select="//metadataSetList"/>
    202196                        <xsl:with-param name="current" select="ex.Title"/>
    203197                     </xsl:call-template></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
    204         <!-- <div class="header element_type_gsf_metadata css_gsf_metadata" title="gsf:metadata">METADATA</div> -->
    205         <!-- <div class="header element_type_gsf_link css_gsf_link" title="gsf:link">LINK</div> -->
     198
    206199        <div class="draggable_gsf_link css_gsf_link block" title="gsf:link"><table class="header"><tbody><tr><td class="header">LINK<select>
    207200                            <option value = "document" selected = "document">Document</option>
     
    210203                            <option value = "horizontal">Horizontal</option>
    211204                </select></td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
    212         <div class="header element_type_gsf_switch css_gsf_switch" title="gsf:switch">SWITCH</div>
    213         <div class="header element_type_gsf_when css_gsf_when" title="gsf:when">WHEN</div>
    214         <div class="header element_type_gsf_otherwise css_gsf_otherwise" title="gsf:otherwise">OTHERWISE</div>
    215         <div class="header element_type_gsf_icon css_gsf_icon" title="gsf:icon">ICON</div>
     205
     206        <div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch"><table class="header"><tbody><tr><td class="header">SWITCH</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
     207
     208        <div class="draggable_gsf_when css_gsf_when block" title="gsf:when"><table class="header"><tbody><tr><td class="header">WHEN<xsl:value-of select="@test"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
     209
     210        <div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise"><table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td><a href="#" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table></div>
     211
     212        <div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon"><table class="header"><tbody><tr><td class="header">ICON<select><option value = "document" selected = "document">Document</option><option value = "classifier">Classifier</option><option value = "source">Source</option></select></td><td><a href="#" class="remove ui-icon ui-icon-closethick">[x]</a></td></tr></tbody></table></div>
    216213        <br/>
    217214        <div class="element_type_text css_text" title="text">TEXT</div>
     
    222219    </td>
    223220    </table>
    224 
    225     <!-- <xsl:variable name="tok" select="fn:tokenize($fmt,'/s+')"/> -->
    226221
    227222    <div id="format">
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui-templates.xsl

    r23046 r23255  
    3636    <!-- ********** GSF:CHOOSE-METADATA ********** -->
    3737        <xsl:variable name="choose_metadata">
    38             <table class="header"><tbody><tr><td>CHOOSE</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td><td><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
    3938            <div class="gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata"><table class="header"><tbody><tr><td class="header">CHOOSE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" 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></div>
    4039        </xsl:variable>
     
    4746    <!-- ********** GSF:METADATA ********** -->
    4847        <xsl:variable name="metadata">
    49         <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata"><table class="header"><tbody><tr><td class="header"><xsl:call-template name="meta-to-combo">
     48        <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata">
     49            <xsl:variable name="combo">
     50                <xsl:call-template name="meta-to-combo">
    5051                        <xsl:with-param name="metadataSets" select="$metadataSets"/>
    51                         <xsl:with-param name="current" select="ex.title"/>
    52                      </xsl:call-template></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table></div>
    53                     <!-- <a href="#" class="remove">[x]</a></div> -->
    54         </xsl:variable>
     52                        <xsl:with-param name="current"/>
     53                     </xsl:call-template>
     54            </xsl:variable>
     55        <table class="header"><tbody><tr><td class="header"><xsl:copy-of select="$combo"/></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
     56        </div>
     57       
     58        </xsl:variable>
    5559
    5660        <script type="text/javascript">
  • main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl

    r23135 r23255  
    5454    <xsl:template name="meta-to-combo">
    5555        <xsl:param name="metadataSets" select='.'/>
    56         <xsl:param name="current" select='.'/>
     56        <xsl:param name="current" select='.'/> 
    5757
    5858        <xsl:variable name="current_mod">
    5959            <xsl:choose>
    6060                <xsl:when test="contains($current,'.')"><xsl:value-of select="$current"/></xsl:when>
    61                 <xsl:otherwise>ex.<xsl:value-of select="$current"/></xsl:otherwise>
     61                <xsl:when test="$current!=''">ex.<xsl:value-of select="$current"/></xsl:when>
     62                <xsl:otherwise>ex.Title</xsl:otherwise>
    6263            </xsl:choose>
    6364        </xsl:variable>
    6465
    65         <select>
    66             <!-- <option value ="{$current_mod}" disabled="disabled" selected="{$current_mod}"><xsl:value-of select="$current_mod"/></option> -->
    67 
    68             <xsl:apply-templates select="$metadataSets" mode="meta-to-combo">
    69                 <xsl:with-param name="current" select="$current_mod"/>
    70             </xsl:apply-templates>
    71         </select>
     66        <xsl:variable name="exists">
     67        <xsl:apply-templates select="$metadataSets" mode="search-meta-to-combo">
     68            <xsl:with-param name="current" select="$current_mod"/> <!--<xsl:copy-of select="$current_mod"/></xsl:with-param> -->
     69        </xsl:apply-templates>
     70        </xsl:variable>
     71
     72        <xsl:choose>
     73            <xsl:when test="$exists='TRUE'">
     74                <select>
     75                    <xsl:apply-templates select="$metadataSets" mode="meta-to-combo">
     76                        <xsl:with-param name="current" select="$current_mod"/>
     77                    </xsl:apply-templates>
     78                </select>
     79            </xsl:when>
     80            <xsl:otherwise>
     81                <xsl:value-of select="$current_mod"/>
     82            </xsl:otherwise>
     83        </xsl:choose>
     84
     85    </xsl:template>
     86
     87    <xsl:template match="metadataSet" mode="search-meta-to-combo">
     88        <xsl:param name="current"/>
     89
     90        <xsl:variable name="set"><xsl:value-of select="substring-before($current, '.')"/></xsl:variable>
     91
     92        <xsl:if test="@name=$set">
     93        <xsl:apply-templates select="metadata" mode="search-meta-to-combo">
     94            <!-- <xsl:with-param name="set" select="@name"/> --> <!-- name of the set -->
     95            <xsl:with-param name="current" select="$current"/>
     96        </xsl:apply-templates>
     97        </xsl:if>
     98    </xsl:template>
     99
     100    <xsl:template match="metadata" mode="search-meta-to-combo">
     101        <xsl:param name="current"/>
     102        <xsl:variable name="cur"><xsl:value-of select="substring-after($current, '.')"/></xsl:variable>
     103        <xsl:if test="@name=$cur">TRUE</xsl:if>
     104    </xsl:template>
     105
     106    <xsl:template match="*" mode="search-meta-to-combo">
     107        <xsl:param name="current"/>
     108        <xsl:apply-templates mode="search-meta-to-combo">
     109            <xsl:with-param name="current" select="$current"/>
     110        </xsl:apply-templates>
    72111    </xsl:template>
    73112
     
    76115
    77116        <xsl:apply-templates mode="meta-to-combo">
    78             <xsl:with-param name="set" select="@name"/>
     117            <xsl:with-param name="set" select="@name"/> <!-- name of the set -->
    79118            <xsl:with-param name="current" select="$current"/>
    80119        </xsl:apply-templates>
     
    87126        <xsl:variable name="meta"><xsl:value-of select="$set"/>.<xsl:value-of select="@name"/></xsl:variable>
    88127
    89         <!-- if this is the current value, then set combo box to this value -->
    90128        <xsl:choose>
    91129            <xsl:when test="$current = $meta">
     
    134172        <xsl:param name="metadataSets"/>
    135173
     174        <!-- DEBUG metadata: <xsl:value-of select="@name"/>eol -->
     175
    136176        <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata">
    137177            <xsl:variable name="combo">
     
    192232        <xsl:param name="depth"/>
    193233        <xsl:param name="metadataSets"/>
    194 
    195             <!-- CHILD = <xsl:value-of select="child[1]/@name"/> -->
    196             <!-- CHILD = <xsl:value-of select="child::*[name()][1]"/> -->
    197 
    198 
    199             <!-- <xsl:for-each select="child::*"> -->
    200             <!-- <xsl:value-of select="name()"/> -->
    201             <!-- </xsl:for-each> -->
    202 
    203234
    204235        <div class="gsf_template css_gsf_template block" title="gsf:template">
     
    211242            </xsl:variable>
    212243   
    213                     <!-- <a href="#" class="minmax">[+]</a><a href="#" class="remove">[x]</a><a href="#" class="remove"><img src="interfaces/oran/images/green_button_close.png" alt="[x]" title="Click me to remove"/></a><a href="[myhref]" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-home" style="float:left;"></span>Home</a> -->
    214244            <table class="header"><tbody><tr><td class="header">MATCH=<input 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>
    215245
     
    264294
    265295        <div class="gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise">
    266                 <table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="#" class="remove">[x]</a></td><td><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
     296                <table class="header"><tbody><tr><td class="header">OTHERWISE</td><td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td><td class="header"><a href="#" class="remove">[x]</a></td><td><a href="#" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
    267297                <xsl:apply-templates mode="xml-to-gui">
    268298                    <xsl:with-param name="depth" select="$depth"/>
Note: See TracChangeset for help on using the changeset viewer.