xlawrence    2005/06/06 17:03:59 CEST

  Modified files:
    core/src/webapp/jsp/jahia/engines/shared bigtext_field.jsp 
  Log:
  Tidy up the html generated
  
  Revision  Changes    Path
  1.6       +36 -36    
jahia/core/src/webapp/jsp/jahia/engines/shared/bigtext_field.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/engines/shared/bigtext_field.jsp.diff?r1=1.5&r2=1.6&f=h
  
  
  
  Index: bigtext_field.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/engines/shared/bigtext_field.jsp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- bigtext_field.jsp 17 Aug 2004 10:01:11 -0000      1.5
  +++ bigtext_field.jsp 6 Jun 2005 15:03:59 -0000       1.6
  @@ -15,38 +15,38 @@
   <jahia:i18n />
   
   <%
  -    HashMap engineMap = (HashMap) request.getAttribute( 
"org.jahia.engines.EngineHashMap" );
  -     String engineUrl    = (String) engineMap.get( "engineUrl" );
  -    String URLSep       = (engineUrl.indexOf("?") == -1) ? "?" : "&" ;
  -     String theScreen        = (String)engineMap.get("screen");
  -
  -    String fieldsEditCallingEngineName = (String) engineMap.get( 
"fieldsEditCallingEngineName" );
  -
  -    JahiaField  theField    = (JahiaField) engineMap.get( 
fieldsEditCallingEngineName + "." + "theField" );
  -    ParamBean jParams   = (ParamBean) request.getAttribute( 
"org.jahia.params.ParamBean" );
  -    String      theURL              = (String) 
jParams.settings().getJahiaEnginesHttpPath();
  -    Boolean          isSelectedField         = (Boolean) engineMap.get( 
fieldsEditCallingEngineName + "." +"isSelectedField" );
  -    HtmlEditorsViewHelper heViewHelper = (HtmlEditorsViewHelper) 
engineMap.get(BigText_Field.HTMLEDITOR_VIEW_HELPER_ATTRIBUTE);
  -    HtmlEditor defaultEditor                 = 
heViewHelper.getDefaultEditor(true);
  -
  -    Hashtable cssList = new Hashtable();
  -    if ( defaultEditor != null && defaultEditor.enableCSS()){
  -        cssList = heViewHelper.getEnabledCSSs();
  -    }
  +HashMap engineMap   = (HashMap) request.getAttribute( 
"org.jahia.engines.EngineHashMap" );
  +String engineUrl    = (String) engineMap.get( "engineUrl" );
  +String URLSep       = (engineUrl.indexOf("?") == -1) ? "?" : "&" ;
  +String theScreen    = (String)engineMap.get("screen");
  +
  +String fieldsEditCallingEngineName = (String) engineMap.get( 
"fieldsEditCallingEngineName" );
  +
  +JahiaField  theField    = (JahiaField) engineMap.get( 
fieldsEditCallingEngineName + "." + "theField" );
  +ParamBean jParams   = (ParamBean) request.getAttribute( 
"org.jahia.params.ParamBean" );
  +String      theURL              = (String) 
jParams.settings().getJahiaEnginesHttpPath();
  +Boolean              isSelectedField         = (Boolean) engineMap.get( 
fieldsEditCallingEngineName + "." +"isSelectedField" );
  +HtmlEditorsViewHelper heViewHelper = (HtmlEditorsViewHelper) 
engineMap.get(BigText_Field.HTMLEDITOR_VIEW_HELPER_ATTRIBUTE);
  +HtmlEditor defaultEditor             = heViewHelper.getDefaultEditor(true);
  +
  +Hashtable cssList = new Hashtable();
  +if ( defaultEditor != null && defaultEditor.enableCSS()){
  +    cssList = heViewHelper.getEnabledCSSs();
  +}
   
  -    String theOldField = theField.getValue();
  -    String theNewField = "";
  -    String strToRemove[] = {"&lt;jahia", "_htmleditor>", "&lt;empty>"};
  -
  -    for (int i = 0; i < strToRemove.length; i++) {
  -        String lowerCaseField = theOldField.toLowerCase();
  -        int index = lowerCaseField.indexOf(strToRemove[i]);
  -        if (index != -1) {
  -            theNewField = theOldField.substring(0, index) +
  -                          theOldField.substring(index + 
strToRemove[i].length(), theOldField.length());
  -            theOldField = theNewField;
  -        }
  +String theOldField = theField.getValue();
  +String theNewField = "";
  +String strToRemove[] = {"&lt;jahia", "_htmleditor>", "&lt;empty>"};
  +
  +for (int i = 0; i < strToRemove.length; i++) {
  +    String lowerCaseField = theOldField.toLowerCase();
  +    int index = lowerCaseField.indexOf(strToRemove[i]);
  +    if (index != -1) {
  +        theNewField = theOldField.substring(0, index) +
  +                theOldField.substring(index + strToRemove[i].length(), 
theOldField.length());
  +        theOldField = theNewField;
       }
  +}
   %>
   
   <SCRIPT type="text/javascript">
  @@ -94,12 +94,13 @@
       <%
           Enumeration editors = heViewHelper.getEditors();
           HtmlEditor editor = null;
  -        while ( editors.hasMoreElements() )
  -        {
  +        while ( editors.hasMoreElements() ) {
               editor = (HtmlEditor)editors.nextElement();
           %>
       <option value="<%=editor.getId()%>"
  -            <% if ( defaultEditor !=null && 
editor.getId().equals(defaultEditor.getId())){%>selected<% }%>>
  +        <% if ( defaultEditor != null && 
editor.getId().equals(defaultEditor.getId())) { 
  +                %>selected<% 
  +           }%>>
           <%=editor.getDisplayName()%>
       </option>
       <%       } %>
  @@ -118,8 +119,7 @@
   <select name="htmlEditorCSS" class="input" 
onChange="changeCSS('<%=theScreen%>');">
       <%
           Iterator iterator = cssList.values().iterator();
  -        while ( iterator.hasNext() )
  -        {
  +        while ( iterator.hasNext() ) {
               HtmlEditorCSS css = (HtmlEditorCSS)iterator.next();
               if ( !selectedCSS ){
                   defaultCSS = css.getId();
  @@ -131,7 +131,7 @@
               <% if ( css.getId().equals(defaultCSS)){%>selected<% }%>>
           <%=css.getName()%>
       </option>
  -    <%       } %>
  +    <%}%>
   </select>
   </span>
   <%}%>
  

Reply via email to