From: <jes...@us...> - 2009-05-29 12:02:54
|
Revision: 4161 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=4161&view=rev Author: jesseeichar Date: 2009-05-29 12:02:48 +0000 (Fri, 29 May 2009) Log Message: ----------- clearn up endlines and focus to textarea on language change combo Modified Paths: -------------- sandbox/geocat.ch/trunk/web/geonetwork/xsl/extent-edit.xsl sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl sandbox/geocat.ch/trunk/web/geonetwork/xsl/thesaurus-edit-element.xsl sandbox/geocat.ch/trunk/web/geonetwork/xsl/translate-widget.xsl Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/extent-edit.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/extent-edit.xsl 2009-05-29 12:02:33 UTC (rev 4160) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/extent-edit.xsl 2009-05-29 12:02:48 UTC (rev 4161) @@ -16,9 +16,9 @@ <xsl:call-template name="mapfish_includes"/> <script type="text/javascript" src="{/root/gui/url}/scripts/translation_edit.js"/> <script language="JavaScript1.2" type="text/javascript"> - Ext.onReady(init) + Ext.onReady(init); - var currentCrs = 0 + var currentCrs = 0; var latlong= new OpenLayers.Projection("EPSG:4326"); var ch03= new OpenLayers.Projection("EPSG:21781"); Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl 2009-05-29 12:02:33 UTC (rev 4160) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl 2009-05-29 12:02:48 UTC (rev 4161) @@ -205,7 +205,7 @@ function validateMetadataFields() { $$('input,textarea').each(function(input) { - if (input.onkeyup) input.onkeyup() + if (input.onkeyup) input.onkeyup(); }); } @@ -215,19 +215,22 @@ var nodes = parent.getElementsByTagName("input"); var textarea = parent.getElementsByTagName("textarea"); - show(nodes,ref) - show(textarea,ref) + show(nodes,ref); + show(textarea,ref); }; function show(nodes,ref){ for ( index in nodes ) { - var input = nodes[index] + var input = nodes[index]; if( input.style!=null && input.style.display != "none" ) input.style.display = "none"; } for ( index in nodes ) { var input = nodes[index]; - if( input.name == ref ) input.style.display = "block"; + if( input.name == ref ){ + input.style.display = "block"; + input.focus(); + } } } /** Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/thesaurus-edit-element.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/thesaurus-edit-element.xsl 2009-05-29 12:02:33 UTC (rev 4160) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/thesaurus-edit-element.xsl 2009-05-29 12:02:48 UTC (rev 4161) @@ -4,6 +4,7 @@ <xsl:include href="banner.xsl"/> <xsl:include href="utils.xsl"/> <xsl:include href="thesaurus-util.xsl"/> +<xsl:include href="translate-widget.xsl" /> <xsl:template match="/"> @@ -28,8 +29,13 @@ <!--additional scripts--> <xsl:template mode="script" match="/"> + +<script type="text/javascript" src="{/root/gui/url}/scripts/translation_edit.js"/> +<script src="{/root/gui/url}/scripts/mapfishIntegration/ext-small.js" type="text/javascript"/> <script type="text/javascript" language="JavaScript1.2"> +Ext.onReady(function() {editI18n.init('prefLab', '<xsl:value-of select="/root/gui/language"/>');}); + refreshParent = function(){ if(window.opener) { @@ -42,9 +48,6 @@ if (checkString(form.newid,"<xsl:value-of select="/root/gui/strings/code"/>",false)==false){ return false }; - if (checkString(form.prefLab,"<xsl:value-of select="/root/response/prefLab"/>",false)==false){ - return false; - }; <xsl:if test="string(/root/response/thesaType)='place'"> if (checkString(form.west,"<xsl:value-of select="/root/gui/strings/westLon"/>",false)==false){ @@ -180,13 +183,25 @@ <th class="md" valign="top" width="10%"> <xsl:value-of select="/root/gui/strings/label"/>   </th> - <td class="padded" valign="top"> <xsl:choose> <xsl:when test="$mode='consult'"> + <td class="padded" valign="top"> <xsl:value-of select="/root/response/prefLab"/> (<xsl:value-of select="/root/gui/strings/child::*[name() = /root/gui/language]"/>) + </td> </xsl:when> <xsl:otherwise> - <input class="md" name="prefLab" id="prefLab" type="text"> + <td class="padded" valign="top"> + <xsl:call-template name="translationWidgetInputs"> + <xsl:with-param name="key" select="'prefLab'"/> + <xsl:with-param name="root" select="/root/response/prefLab"/> + </xsl:call-template> + </td><td> + <xsl:call-template name="translationWidgetSelect"> + <xsl:with-param name="key" select="'prefLab'"/> + </xsl:call-template> + + + <!--<input class="md" name="prefLab" id="prefLab" type="text"> <xsl:attribute name="value"><xsl:value-of select="/root/response/prefLab"/></xsl:attribute> </input>  @@ -195,20 +210,20 @@ <xsl:variable name="langId" select="id"/> <xsl:if test="$langId = /root/gui/language"> - <!-- TODO : Add multilingual thesaurus editing. Actually, Geonetwork provide only - editing in the current GUI interface language --> + TODO : Add multilingual thesaurus editing. Actually, Geonetwork provide only + editing in the current GUI interface language <option> - <xsl:attribute name="selected">selected</xsl:attribute> - <xsl:attribute name="value"><xsl:value-of select="substring($langId, 1, 2)"/></xsl:attribute> - <xsl:value-of select="name"/> - </option> + <xsl:attribute name="selected">selected</xsl:attribute> + <xsl:attribute name="value"><xsl:value-of select="substring($langId, 1, 2)"/></xsl:attribute> + <xsl:value-of select="name"/> + </option> </xsl:if> </xsl:for-each> - </select> + </select>--> + </td> </xsl:otherwise> </xsl:choose> - </td> </tr> <tr> <th class="md" valign="top" width="15%"> Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/translate-widget.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/translate-widget.xsl 2009-05-29 12:02:33 UTC (rev 4160) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/translate-widget.xsl 2009-05-29 12:02:48 UTC (rev 4161) @@ -69,6 +69,7 @@ <option id="option{$key}EN" ><xsl:value-of select="$EN"/></option> </select> </xsl:template> + <xsl:template name="translations" > <xsl:param name="root" /> <xsl:param name="langCode" /> @@ -77,6 +78,9 @@ <xsl:when test="$root/node()[substring(translate(name(),$LOWER, $UPPER),1,2)=$langCode]"> <xsl:value-of select="$root/node()[substring(translate(name(),$LOWER, $UPPER),1,2)=$langCode]"/> </xsl:when> + <xsl:when test="$root/node()[substring(translate(name(),$UPPER, $LOWER),1,2)=$langCode]"> + <xsl:value-of select="$root/node()[substring(translate(name(),$UPPER, $LOWER),1,2)=$langCode]"/> + </xsl:when> <xsl:otherwise> <xsl:value-of select="$root/text()"/> </xsl:otherwise> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |