xlawrence    2005/10/05 17:48:51 CEST

  Modified files:
    core/src/webapp/jsp/jahia/engines/shared smalltext_field.jsp 
  Log:
  Fix javascript problem
  
  Revision  Changes    Path
  1.11      +18 -27    
jahia/core/src/webapp/jsp/jahia/engines/shared/smalltext_field.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/engines/shared/smalltext_field.jsp.diff?r1=1.10&r2=1.11&f=h
  
  
  
  Index: smalltext_field.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/engines/shared/smalltext_field.jsp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- smalltext_field.jsp       29 Sep 2005 15:02:06 -0000      1.10
  +++ smalltext_field.jsp       5 Oct 2005 15:48:51 -0000       1.11
  @@ -24,9 +24,11 @@
   
   <!-- Begin Smalltext_field.jsp -->
   
  +<%!
  +    final static private org.apache.log4j.Logger logger =
  +            
org.apache.log4j.Logger.getLogger("jsp.jahia.engines.shared.smalltext_field");  
%>
  +
   <%
  -    final org.apache.log4j.Logger logger =
  -            org.apache.log4j.Logger.getLogger(getClass());
       try {
           final HashMap engineMap = (HashMap) 
request.getAttribute("org.jahia.engines.EngineHashMap");
           final String fieldsEditCallingEngineName = (String) 
engineMap.get("fieldsEditCallingEngineName");
  @@ -70,11 +72,11 @@
       </ul>
   </logic:present>
   
  -<%  if (theField.getValue().indexOf("#") == 0 && 
theField.getValue().length() > 6 && theField.getValue().length() < 10) {
  -%>
  +<%  if (theField.getValue().indexOf("#") == 0 && 
theField.getValue().length() > 6 && theField.getValue().length() < 10) { %>
  +
   <logic:notEqual name="dynapiInitialized" value="true">
       <bean:define id="dynapiInitialized" value='true' toScope="request"/>
  -    <script type="text/javascript" 
src="<%=theURL%>jahiatools/javascript/dynapi.js"></SCRIPT>
  +    <script type="text/javascript" 
src="<%=theURL%>jahiatools/javascript/dynapi.js"></script>
   
       <script type="text/javascript">
           DynAPI.setLibraryPath('<%=theURL%>jahiatools/javascript/lib/');
  @@ -87,12 +89,10 @@
               else
                   return el.offsetTop;
           }
  -    </SCRIPT>
  +    </script>
   </logic:notEqual>
   
   <script type="text/javascript">
  -
  -
       var ViewColorBG_<%=contextID%>;
       var ViewColorPick_<%=contextID%>;
   
  @@ -174,10 +174,9 @@
   </table>
   
   <% } else if (defValue != null &&
  -        !defValue.equals("") &&
  -        defValue.toUpperCase().indexOf("JAHIA_MULTIVALUE") != -1) { %>
  +        ! defValue.equals("") &&
  +        defValue.toUpperCase().indexOf("JAHIA_MULTIVALUE") != -1) {
   
  -<%
       String theSelectedField = theField.getValue();
       final boolean multipleChoice = 
(defValue.toUpperCase().indexOf("JAHIA_MULTIVALUE_MULTIPLE") != -1);
   
  @@ -221,9 +220,6 @@
           }
       }
   
  -%>
  -
  -<%
       if (defValue.indexOf("[") != -1) {
           int startStr = defValue.indexOf("[") + 1;
           int endStr = defValue.lastIndexOf("]");
  @@ -253,22 +249,21 @@
   
               if (fieldValuesList.contains(resourceMarker)) { %>
       <option 
value="<%=FormDataManager.getInstance().formEncode(resourceMarker)%>"
  -            selected><%=GuiBean.glueTitle(marker.getValue(), 70)%></option>
  +            selected="selected"><%=GuiBean.glueTitle(marker.getValue(), 
70)%></option>
       <% } else { %>
       <option 
value="<%=FormDataManager.getInstance().formEncode(resourceMarker)%>"><%=GuiBean.glueTitle(marker.getValue(),
 70)%></option>
       <% }
       }
       %>
   </select>
  -<%
  -} else {
  +<% } else {
       // Expression markers found, we must evaluate them.
       Vector markers = ExpressionMarker.buildExpressionMarkers(theList, 
jParams);
   
   %>
   <select name="listSelection_<%=contextID%>"
  -        
onChange="handleListSelectionChange(document.mainForm.listSelection_<%=contextID%>,document.mainForm.elements['_<%=theField.getID()%>']);"
  <% if (multipleChoice) {%>
  -        multiple size="15"<% } %> >
  +        
onchange="handleListSelectionChange(document.mainForm.listSelection_<%=contextID%>,document.mainForm.elements['_<%=theField.getID()%>']);"
  <% if (multipleChoice) {%>
  +        multiple="multiple" size="15"<% } %> >
       <%
           int size = markers.size();
           ExpressionMarker marker;
  @@ -283,7 +278,7 @@
   
               if 
(fieldValuesList.contains(FormDataManager.getInstance().formDecode(expressionMarker)))
 { %>
       <option 
value="<%=FormDataManager.getInstance().formEncode(expressionMarker)%>"
  -            selected><%=GuiBean.glueTitle(marker.getValue(), 70)%></option>
  +            selected="selected"><%=GuiBean.glueTitle(marker.getValue(), 
70)%></option>
       <% } else { %>
       <option 
value="<%=FormDataManager.getInstance().formEncode(expressionMarker)%>"><%=GuiBean.glueTitle(marker.getValue(),
 70)%></option>
       <% }
  @@ -294,11 +289,9 @@
           }
       }
   %>
  -<input name="_<%=theField.getID()%>" type="hidden" 
value="<%=theField.getValue()%>" />
  +<input name="_<%=theField.getID()%>" type="hidden" 
value="<%=theField.getValue()%>"/>
   <script type="text/javascript">
   
  -    document.mainForm._<%=theField.getID()%>.focus();
  -
       function concatMultipleFieldValues(selectBox) {
   
           var sep = "<%=JahiaField.MULTIPLE_VALUES_SEP%>";
  @@ -324,19 +317,17 @@
       document.mainForm.elements['_<%=theField.getID()%>'].value = 
concatMultipleFieldValues(document.mainForm.listSelection_<%=contextID%>);
   </script>
   
  -<%
  -} else { %>
  +<% } else { %>
   <%
       final String val = JahiaTools.replacePattern(theField.getValue(), "\"", 
"\\\"");
   %>
   <input type="text" class="smalltext" name="_<%=theField.getID()%>" 
maxlength="250" value="<%=val%>"
  -<% if ( readOnly ){%> disabled<%}%> >
  +<% if ( readOnly ){%> disabled="disabled"<% } %> >
   <%
           }
       } catch (JahiaException je) {
           logger.fatal("Error displaying SmallText: " + je.getMessage(), je);
       }
  -
   %>
   
   <!-- End Smalltext_field.jsp -->
  

Reply via email to