[jboss-cvs] jboss-seam/examples/wiki/view/includes ...

Christian Bauer christian at hibernate.org
Fri Aug 17 09:00:25 EDT 2007


  User: cbauer  
  Date: 07/08/17 09:00:25

  Modified:    examples/wiki/view/includes            
                        deleteConfirmation.xhtml commentsDisplay.xhtml
                        pluginPreferencesForm.xhtml popupDialog.xhtml
                        commentForm.xhtml attachmentDisplay.xhtml
                        breadcrumb.xhtml userControl.xhtml mainMenu.xhtml
  Added:       examples/wiki/view/includes             previewPopup.xhtml
                        wikiTextEditor.xhtml mainMenuItem.xhtml
  Log:
  Major refactoring of core data schema and some new features
  
  Revision  Changes    Path
  1.6       +5 -3      jboss-seam/examples/wiki/view/includes/deleteConfirmation.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: deleteConfirmation.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/deleteConfirmation.xhtml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- deleteConfirmation.xhtml	21 Jun 2007 11:05:50 -0000	1.5
  +++ deleteConfirmation.xhtml	17 Aug 2007 13:00:25 -0000	1.6
  @@ -23,9 +23,11 @@
       <ui:define name="dialogTitle">Delete confirmation</ui:define>
       <ui:define name="dialogContent"><p align="center">Are you sure you want to delete <br/>'#{home.instance}'?</p></ui:define>
       <ui:define name="dialogControls">
  +        <h:form style="display:inline">
           <a:commandLink id="delete" action="#{home.remove}" accesskey="O" styleClass="button" reRender="#{reRender}">
               <span class="buttonLabel"><u>O</u>k</span>
           </a:commandLink>
  +        </h:form>
       </ui:define>
   
   
  
  
  
  1.7       +6 -5      jboss-seam/examples/wiki/view/includes/commentsDisplay.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: commentsDisplay.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/commentsDisplay.xhtml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- commentsDisplay.xhtml	6 Jul 2007 14:38:36 -0000	1.6
  +++ commentsDisplay.xhtml	17 Aug 2007 13:00:25 -0000	1.7
  @@ -1,12 +1,13 @@
  -<s:div styleClass="shadowContainer" style="margin-top:25px"
  -     rendered="#{not empty commentHome.comments and currentDocument.enableComments}"
  +<s:span id="commentsDisplay"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:a="https://ajax4jsf.dev.java.net/ajax"
  -     xmlns:s="http://jboss.com/products/seam/taglib"><div class="shadow1"><div class="shadow2">
  -<s:div id="commentsDisplay">
  +     xmlns:s="http://jboss.com/products/seam/taglib">
  +
  +<s:div styleClass="shadowContainer" style="margin-top:25px"
  +     rendered="#{not empty commentHome.comments and currentDocument.enableComments}"><div class="shadow1"><div class="shadow2">
   
       <h:dataTable value="#{commentHome.comments}" var="c"
                    styleClass="datatable rightBorder leftBorder topBorder bottomBorder"
  @@ -51,5 +52,5 @@
           </h:column>
       </h:dataTable>
   
  -</s:div>
   </div></div></s:div>
  +</s:span>
  
  
  
  1.4       +4 -1      jboss-seam/examples/wiki/view/includes/pluginPreferencesForm.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: pluginPreferencesForm.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/pluginPreferencesForm.xhtml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- pluginPreferencesForm.xhtml	12 Jun 2007 12:30:04 -0000	1.3
  +++ pluginPreferencesForm.xhtml	17 Aug 2007 13:00:25 -0000	1.4
  @@ -6,7 +6,10 @@
           xmlns:wiki="http://jboss.com/products/seam/wiki"
           xmlns:s="http://jboss.com/products/seam/taglib">
   
  -    <h:panelGrid columns="2" style="margin-bottom:10px;" cellpadding="0" cellspacing="0" border="0">
  +
  +    #{pluginPreferencesEditor.preferenceComponent.description}
  +
  +    <h:panelGrid columns="2" style="margin-top:10px;margin-bottom:10px;" cellpadding="0" cellspacing="0" border="0">
   
           <h:dataTable var="v" style="width:10%;"
                        value="#{pluginPreferencesEditor.preferenceValues}"
  
  
  
  1.4       +8 -8      jboss-seam/examples/wiki/view/includes/popupDialog.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: popupDialog.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/popupDialog.xhtml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- popupDialog.xhtml	4 May 2007 19:30:33 -0000	1.3
  +++ popupDialog.xhtml	17 Aug 2007 13:00:25 -0000	1.4
  @@ -9,7 +9,9 @@
       xmlns:s="http://jboss.com/products/seam/taglib">
       <j4j:idProxy id="#{dialogId}Popup"/>
   
  +    <s:span id="#{dialogId}Init">
       <ui:insert name="dialogInit"/>
  +    </s:span>
   
       <script type="text/javascript">jQuery(function() {
           jsf('#{dialogId}Popup').Resizable({
  @@ -26,13 +28,11 @@
       </s:div>
   
       <s:div styleClass="popupDialogControls" id="#{dialogId}Controls">
  -        <h:form>
               <h:panelGroup>
                   <ui:insert name="dialogControls"/>
  -                <h:outputLink id="cancel" value="#" rendered="#{!hideCancelButton}"
  +            <h:outputLink value="#" rendered="#{!hideCancelButton}"
                                 styleClass="buttonNonpersistent closeDialog"><span class="buttonLabel"><u>C</u>ancel</span></h:outputLink>
               </h:panelGroup>
  -        </h:form>
       </s:div>
   
       <div class="popupDialogResizeHandle" id="#{dialogId}ResizeHandle"/>
  
  
  
  1.7       +30 -18    jboss-seam/examples/wiki/view/includes/commentForm.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: commentForm.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/commentForm.xhtml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- commentForm.xhtml	6 Jul 2007 14:38:36 -0000	1.6
  +++ commentForm.xhtml	17 Aug 2007 13:00:25 -0000	1.7
  @@ -7,12 +7,23 @@
        xmlns:a="https://ajax4jsf.dev.java.net/ajax"
        xmlns:s="http://jboss.com/products/seam/taglib"><div class="shadow1"><div class="shadow2">
   
  -<div id="commentForm">
  -    <h:form styleClass="commentForm">
  +<div>
  +    <h:form id="commentForm" styleClass="commentForm">
           <div class="form">
  -            <div class="formHead">Post new comment:</div>
  +            <div class="formHead bottomBorder">
   
  -            <div class="formFields formBorder wideLabels">
  +                <a:commandLink tabindex="102" rendered="#{!param.showCommentForm}" accesskey="T"
  +                               onclick="jQuery('.hiddenCommentForm').show();jQuery('#commentForm\\:commentTextArea').focus();">
  +                    <span>Pos<u>t</u> Comment</span>
  +                </a:commandLink>
  +
  +                <s:fragment rendered="#{param.showCommentForm}">
  +                    Post Comment
  +                </s:fragment>
  +
  +            </div>
  +
  +            <div style="#{!param.showCommentForm ? 'display:none;' : ''}" class="hiddenCommentForm formFields formBorder wideLabels">
   
                   <s:decorate id="userNameDecorate" template="formFieldDecorate.xhtml">
                       <ui:define name="label">Name</ui:define>
  @@ -44,16 +55,16 @@
                       </h:inputText>
                   </s:decorate>
   
  -                <s:decorate id="commentDecorate" template="formFieldDecorate.xhtml">
  -                    <ui:define name="label">Comment</ui:define>
  -                    <h:inputTextarea tabindex="102" required="true"
  -                                     cols="40"
  -                                     rows="10"
  -                                     id="commentTextInput"
  -                                     value="#{commentHome.comment.text}">
  -                        <a:support event="onblur" reRender="commentDecorate"/>
  -                    </h:inputTextarea>
  -                </s:decorate>
  +                <ui:include src="wikiTextEditor.xhtml">
  +                    <ui:param name="textEditorId" value="comment"/>
  +                    <ui:param name="namingContainer" value="commentForm"/>
  +                    <ui:param name="label" value="Comment"/>
  +                    <ui:param name="valueBinding" value="#{commentHome.comment.text}"/>
  +                    <ui:param name="valueMaxLength" value="8000"/>
  +                    <ui:param name="valueRequired" value="true"/>
  +                    <ui:param name="previewBaseDocument" value="#{currentDocument}"/>
  +                    <ui:param name="previewBaseDirectory" value="#{currentDirectory}"/>
  +                </ui:include>
   
                   <s:div rendered="#{!identity.loggedIn}">
                       <s:div styleClass="entry">
  @@ -64,7 +75,7 @@
                       </s:div>
   
                       <s:decorate id="verifyCaptchaDecorate" template="formFieldDecorate.xhtml">
  -                        <ui:define name="label">Enter repsonse</ui:define>
  +                        <ui:define name="label">Enter respsonse</ui:define>
                           <h:inputSecret tabindex="102" size="5" maxlength="5" required="true"
                                          redisplay="true" id="verifyCaptcha" value="#{captcha.response}">
                           </h:inputSecret>
  @@ -73,13 +84,14 @@
   
               </div>
   
  -            <div class="formControls wideLabels">
  +            <div style="#{!param.showCommentForm ? 'display:none;' : ''}" class="hiddenCommentForm formControls wideLabels">
                   <div class="entry">
                       <div class="label">&#160;</div>
                       <div class="input">
   
  -                        <a:commandLink action="#{commentHome.persist}" tabindex="102" reRender="content"
  -                                       styleClass="button"><span class="buttonLabel">Post Comment</span></a:commandLink>
  +                        <a:commandLink action="#{commentHome.persist}" tabindex="102" reRender="commentsDisplay, commentForm" accesskey="S"
  +                                       oncomplete="jQuery('.hiddenCommentForm').show();jQuery('#commentForm\\:userNameDecorate\\:userName').focus();"
  +                                       styleClass="button"><span class="buttonLabel">Po<u>s</u>t Comment</span></a:commandLink>
   
                       </div>
                   </div>
  
  
  
  1.11      +2 -3      jboss-seam/examples/wiki/view/includes/attachmentDisplay.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: attachmentDisplay.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/attachmentDisplay.xhtml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- attachmentDisplay.xhtml	6 Jul 2007 14:38:36 -0000	1.10
  +++ attachmentDisplay.xhtml	17 Aug 2007 13:00:25 -0000	1.11
  @@ -9,7 +9,6 @@
   <s:div id="attachmentDisplay" styleClass="attachmentDisplay">
   
       <h:dataTable value="#{wikiTextAttachments}" var="link"
  -         binding="#{wikiUtil.datatable}"
            styleClass="datatable rightBorder leftBorder topBorder bottomBorder"
            headerClass="regularHeader alignLeft"
            columnClasses="fivePercentColumn alignLeft, defaultColumn alignLeft"
  @@ -18,8 +17,8 @@
           <h:column>
               <f:facet name="header">Attachments:</f:facet>
               <h:panelGrid columns="3" columnClasses="onePercentColumn alignRight, onePercentColumn alignLeft, onePercentColumn alignRight">
  -                <s:span><a name="attachment#{wikiUtil.datatable.rowIndex + 1}"/></s:span>
  -                <h:outputText value="#&#160;#{wikiUtil.datatable.rowIndex + 1}"/>
  +                <s:span><a name="attachment#{uiComponent['directoryEditForm:menuItemTable'].rowIndex + 1}"/></s:span>
  +                <h:outputText value="#&#160;#{uiComponent['directoryEditForm:menuItemTable'].rowIndex + 1}"/>
                   <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/#{fileMetaMap[link.node.contentType].displayIcon}"
                                   width="18" height="20"/>
               </h:panelGrid>
  
  
  
  1.3       +1 -1      jboss-seam/examples/wiki/view/includes/breadcrumb.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: breadcrumb.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/breadcrumb.xhtml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- breadcrumb.xhtml	6 Jul 2007 14:38:36 -0000	1.2
  +++ breadcrumb.xhtml	17 Aug 2007 13:00:25 -0000	1.3
  @@ -16,7 +16,7 @@
                             rendered="#{!empty currentDocument and !empty directory.parent}"/>
           </ui:repeat>
   
  -        <h:outputText styleClass="itemText" value="#{wiki:truncateString(currentDocument.name, 40, '...')}"/>
  +        <h:outputText styleClass="itemText" value="#{wiki:truncateString(currentDocument.name, 30, '...')}"/>
   
       </h:panelGroup>
   
  
  
  
  1.10      +48 -49    jboss-seam/examples/wiki/view/includes/userControl.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: userControl.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/userControl.xhtml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- userControl.xhtml	4 May 2007 12:35:29 -0000	1.9
  +++ userControl.xhtml	17 Aug 2007 13:00:25 -0000	1.10
  @@ -1,4 +1,4 @@
  -<div id="userControl"
  +<h:form id="userControl"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
  @@ -7,7 +7,7 @@
        xmlns:s="http://jboss.com/products/seam/taglib">
   
       <s:div rendered="#{not identity.loggedIn}">
  -        <h:form>
  +
               <h:panelGroup>
                   <h:outputLabel styleClass="userControlLabel" for="loginUsername" value="Username:"/>
                   <h:inputText styleClass="userControlInput" id="loginUsername" value="#{identity.username}" size="8" tabindex="50"/>
  @@ -27,12 +27,11 @@
                   </s:link>
   
               </h:panelGroup>
  -        </h:form>
  +
       </s:div>
   
       <s:div rendered="#{identity.loggedIn}">
   
  -        <h:form>
               <h:panelGroup>
                   <h:outputText styleClass="userControlLabel" value="(#{currentUser.fullname})"/>
   
  @@ -59,7 +58,7 @@
                   </s:link>
   
               </h:panelGroup>
  -        </h:form>
  +
       </s:div>
   
  -</div>
  +</h:form>
  
  
  
  1.4       +6 -36     jboss-seam/examples/wiki/view/includes/mainMenu.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: mainMenu.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/view/includes/mainMenu.xhtml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- mainMenu.xhtml	8 Apr 2007 15:10:34 -0000	1.3
  +++ mainMenu.xhtml	17 Aug 2007 13:00:25 -0000	1.4
  @@ -3,43 +3,13 @@
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
  +     xmlns:wiki="http://jboss.com/products/seam/wiki"
  +     xmlns:a="https://ajax4jsf.dev.java.net/ajax"
  +     xmlns:rich="http://richfaces.ajax4jsf.org/rich"
        xmlns:s="http://jboss.com/products/seam/taglib">
   
  -    <h:dataTable id="menuList" var="menuItem"
  -                 value="#{menu.items}"
  -                 styleClass="menuTable"
  -                 cellpadding="0" cellspacing="0" border="0"
  -                 columnClasses="firstLevelItem"
  -                 rendered="#{!empty menu.items}">
  -
  -        <h:column>
  -            <h:outputLink styleClass="firstLevelItemLink"
  -                          value="#{menuItem.url}">#{menuItem.node.name}
  -            </h:outputLink>
  -
  -            <h:dataTable id="subMenuList" var="subMenuItem"
  -                         value="#{menuItem.subItems}"
  -                         styleClass="subMenuTable"
  -                         cellpadding="0" cellspacing="0" border="0"
  -                         columnClasses="secondLevelItem"
  -                         rendered="#{!empty menuItem.subItems}">
  -                <h:column>
  -                    <h:outputLink styleClass="secondLevelItemLink"
  -                                  value="#{subMenuItem.url}">
  -                        #{subMenuItem.node.name}
  -                    </h:outputLink>
  -                </h:column>
  -            </h:dataTable>
  -
  -        </h:column>
  -
  -    </h:dataTable>
  -
  -    <s:div styleClass="feeds">
  -        <h:outputLink value="#{facesContext.externalContext.request.contextPath}/servlets/feeds/atom.seam?feedId=#{wikiRoot.feed.id}">
  -            <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.atom.gif" width="18" height="18"/>
  -            <span class="feedText">Subscribe to site</span>
  -        </h:outputLink>
  -    </s:div>
  +    <ui:include src="mainMenuItem.xhtml">
  +        <ui:param name="node" value="#{menu.root}"/>
  +    </ui:include>
   
   </div>
  
  
  
  1.1      date: 2007/08/17 13:00:25;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/includes/previewPopup.xhtml
  
  Index: previewPopup.xhtml
  ===================================================================
  <ui:decorate template="popupDialog.xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:a="https://ajax4jsf.dev.java.net/ajax"
           xmlns:wiki="http://jboss.com/products/seam/wiki">
  
      <ui:param  name="hideCancelButton" value="true"/>
      <ui:define name="dialogInit">
              <script type="text/javascript">jQuery(function() {
                  var showPopupAndHideTrigger = function(hash) {
                      hash.w.show();
                      jQuery(".closeDialog", hash.w).attr("accesskey", "C"); // Dynamically assign accesskey to .closeDialog buttons
                      jQuery("##{namingContainer}\\:#{dialogId}TriggerContainer").hide();
                      jQuery('##{namingContainer}\\:#{dialogId}TextArea').focus();
                  };
  
                  var hidePopupAndShowTrigger = function(hash) {
                      hash.w.hide();
                      jQuery("##{namingContainer}\\:#{dialogId}TriggerContainer").show();
                      jQuery('##{namingContainer}\\:#{dialogId}TextArea').focus();
                  };
  
                  jsf('#{dialogId}Popup')
                      .css({ minWidth: "350px", width: "350px",
                             minHeight: jQuery("##{namingContainer}\\:#{dialogId}Content").height()+115+"px",
                             height: jQuery("##{namingContainer}\\:#{dialogId}Content").height()+115+"px",
                             top: "#{positionTop}", left: "#{positionLeft}"})
                      .jqm({
                          trigger: jQuery("##{namingContainer}\\:#{dialogId}Trigger"),
                          closeClass: "closeDialog",
                          onShow: showPopupAndHideTrigger,
                          onHide: hidePopupAndShowTrigger,
                          overlay: 0
                      });
              });</script>
      </ui:define>
      <ui:define name="dialogTitle">Automatic Preview</ui:define>
      <ui:define name="dialogContent">
          <wiki:formattedText value="#{previewWikiText}"
                              linkStyleClass="regularLink"
                              brokenLinkStyleClass="brokenLink"
                              attachmentLinkStyleClass="regularLink"
                              thumbnailLinkStyleClass="regularLink"
                              renderBaseDocument="#{previewBaseDocument}"
                              renderBaseDirectory="#{previewBaseDirectory}"
                              enablePlugins="false"/>
          <script type="text/javascript">jQuery(function() {
              jsf('#{dialogId}Popup')
                  .css({ minHeight: jQuery("##{namingContainer}\\:#{dialogId}Content").height()+115+"px",
                         height: jQuery("##{namingContainer}\\:#{dialogId}Content").height()+115+"px"
                      })
          });</script>
      </ui:define>
      <ui:define name="dialogControls">
          <h:outputLink styleClass="buttonNonpersistent closeDialog"
                        accesskey="C"><span class="buttonLabel"><u>C</u>lose Preview</span></h:outputLink>
      </ui:define>
  
  </ui:decorate>
  
  
  1.1      date: 2007/08/17 13:00:25;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/includes/wikiTextEditor.xhtml
  
  Index: wikiTextEditor.xhtml
  ===================================================================
  <s:fragment
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a="https://ajax4jsf.dev.java.net/ajax"
          xmlns:wiki="http://jboss.com/products/seam/wiki">
  
  <!-- TODO: Most of this Javascript could be made generic and not rendered for each and every text editor... -->
  
  <script type="text/javascript">if (!$.browser.safari) {
      /* Assign resize handle to text area */
      jQuery(function() {
          jQuery("##{namingContainer}\\:#{textEditorId}TextEditDiv").Resizable({
              minHeight: 50,
              handlers: {
                  s: '##{namingContainer}\\:#{textEditorId}TextEditResizeHandle'
              },
              onResize: function(size) {
                  jQuery("##{namingContainer}\\:#{textEditorId}TextArea").css({ height: size.height + "px" });
              }
          });
      })
  }
  ;
  jQuery(function() {
      /* Switch access keys to currently active text editor and preview window when the user tabs through several editors */
      jQuery("##{namingContainer}\\:#{textEditorId}TextArea").focus(
          function() {
              jQuery(".closeDialog", "##{namingContainer}\\:#{textEditorId}Preview").attr("accesskey", "C");
              jQuery('##{namingContainer}\\:#{textEditorId}PreviewTrigger').attr("accesskey", "O");
          }
      );
  });
  </script>
  
  <div class="entry">
  
      <s:div id="#{textEditorId}Message" styleClass="#{wiki:hasMessage(namingContainer, wiki:concat(textEditorId, 'TextArea'))?'errorDiv':''}">
          <h:panelGrid columns="2" rendered="#{wiki:hasMessage(namingContainer, wiki:concat(textEditorId, 'TextArea'))}">
              <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/attention.gif"
                              width="18" height="18"
                              styleClass="attentionImage"/>
              <s:span styleClass="attentionMessage">&#160;<h:message for="#{textEditorId}TextArea"/></s:span>
          </h:panelGrid>
      </s:div>
  
      <div class="label">
  
          <s:div id="#{textEditorId}TabErrors">
  
              <s:div rendered="#{!empty tabId}">
                  <s:span rendered="#{wiki:hasMessage(namingContainer, wiki:concat(textEditorId, 'TextArea'))}">
                      <script type="text/javascript">jQuery(function() {
                          formTabRaiseError("#{tabId}", "#{textEditorId}TextArea", '#{label}:&#160; <h:message for="#{textEditorId}TextArea"/>');
                      });</script>
                  </s:span>
                  <s:span rendered="#{!wiki:hasMessage(namingContainer, wiki:concat(textEditorId, 'TextArea'))}">
                      <script type="text/javascript">jQuery(function() {
                          formTabClearError("#{tabId}", "#{textEditorId}TextArea");
                      });</script>
                  </s:span>
              </s:div>
          </s:div>
  
          <s:div id="#{textEditorId}Label" styleClass="#{wiki:hasMessage(namingContainer, wiki:concat(textEditorId, 'TextArea'))?'errorDiv':''}">
              #{label}&#160;(#{valueMaxLength - wiki:length(valueBinding)} wiki text characters):
          </s:div>
  
          <s:div id="#{textEditorId}PreviewTriggerContainer">
              <a:commandLink id="#{textEditorId}PreviewTrigger" onclick="setPreviewPopupPosition#{textEditorId}()"
                             reRender="#{textEditorId}Label, #{textEditorId}Message, #{textEditorId}TabErrors, #{textEditorId}PreviewContent"
                             styleClass="buttonNonpersistent" tabindex="1"><span class="buttonLabel"><u>O</u>pen Preview</span></a:commandLink>
          </s:div>
      </div>
  
      <script type="text/javascript">
          function setPreviewPopupPosition#{textEditorId}() {
  
              /* Set the default or custom position of the preview popup */
  
              var defaultTopOffset = jQuery('##{namingContainer}\\:#{textEditorId}TextEditDiv').position().top + 30;
              var defaultLeftOffset = jQuery('##{namingContainer}\\:#{textEditorId}TextEditDiv').position().left - 100;
  
              var customOffsetTop = "#{previewOffsetTop}";
              var customOffsetLeft = "#{previewOffsetLeft}";
  
              var topOffset   = (customOffsetTop.length > 0 ? customOffsetTop : defaultTopOffset) + "px";
              var leftOffset  = (customOffsetLeft.length > 0 ? customOffsetLeft : defaultLeftOffset) + "px";
  
              jsf('#{textEditorId}PreviewPopup').css({
                  top: topOffset,
                  left: leftOffset
              });
          }
     </script>
  
      <div class="input">
          <s:validateAll>
  
          <s:div id="#{textEditorId}TextEditDiv" styleClass="textEditResizable wideLabels">
              <h:inputTextarea tabindex="1"
                               cols="#{empty textEditorColumns ? '58' : textEditorColumns}"
                               rows="#{empty textEditorRows ? 5 : textEditorRows}"
                               id="#{textEditorId}TextArea"
                               required="#{valueRequired}"
                               value="#{valueBinding}">
                  <!-- TODO: Ideally this should only fire when the preview popup is open... maybe use jquery.bind()/unbind() event handling-->
                  <a:support event="onkeyup" reRender="#{textEditorId}Label, #{textEditorId}Message, #{textEditorId}TabErrors, #{textEditorId}PreviewContent"
                             requestDelay="3000" ajaxSingle="true"
                             eventsQueue="editKeyPress"/>
              </h:inputTextarea>
              <s:div id="#{textEditorId}TextEditResizeHandle" styleClass="textEditResizeHandle"/>
          </s:div>
  
          </s:validateAll>
      </div>
  </div>
  
  
  <ui:decorate template="popupDialog.xhtml"
               xmlns:s="http://jboss.com/products/seam/taglib"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:a="https://ajax4jsf.dev.java.net/ajax"
               xmlns:wiki="http://jboss.com/products/seam/wiki">
  
      <ui:param name="dialogId" value="#{textEditorId}Preview"/>
      <ui:param name="hideCancelButton" value="true"/>
  
      <ui:define name="dialogInit">
          <script type="text/javascript">jQuery(function() {
  
              /* Create the preview popup and assign the open/close triggers */
  
              var defaultWidth = 350;
              var defaultHeight = 350;
              var customWidth = "#{previewWidth}";
              var customHeight = "#{previewHeight}";
              var width       = (customWidth.length > 0 ? customWidth : defaultWidth) + "px";
              var height      = (customHeight.length > 0 ? customHeight: defaultHeight) + "px";
  
              var showPopupAndHideTrigger = function(hash) {
                  hash.w.show();
                  jQuery("##{namingContainer}\\:#{textEditorId}PreviewTriggerContainer").hide();
                  jQuery("##{namingContainer}\\:#{textEditorId}TextArea").focus();
              };
  
              var hidePopupAndShowTrigger = function(hash) {
                  hash.w.hide();
                  jQuery("##{namingContainer}\\:#{textEditorId}PreviewTriggerContainer").show();
                  jQuery('##{namingContainer}\\:#{textEditorId}TextArea').focus();
              };
  
              jsf('#{textEditorId}PreviewPopup')
                  .css({
                      minWidth: height, width: width,
                      minHeight: jQuery("##{namingContainer}\\:#{textEditorId}PreviewContent").height() + 115 + "px",
                      height: jQuery("##{namingContainer}\\:#{textEditorId}PreviewContent").height() + 115 + "px",
                  })
                  .jqm({
                      trigger: jQuery("##{namingContainer}\\:#{textEditorId}PreviewTrigger"),
                      closeClass: "closeDialog",
                      onShow: showPopupAndHideTrigger,
                      onHide: hidePopupAndShowTrigger,
                      overlay: 0
                  });
          });</script>
      </ui:define>
      <ui:define name="dialogTitle">Automatic Preview: #{label}</ui:define>
      <ui:define name="dialogContent">
          <wiki:formattedText value="#{valueBinding}"
                              linkStyleClass="regularLink"
                              brokenLinkStyleClass="brokenLink"
                              attachmentLinkStyleClass="regularLink"
                              thumbnailLinkStyleClass="regularLink"
                              renderBaseDocument="#{previewBaseDocument}"
                              renderBaseDirectory="#{previewBaseDirectory}"
                              enablePlugins="false"/>
          <script type="text/javascript">jQuery(function() {
              jsf('#{textEditorId}PreviewPopup').css({
                  minHeight: jQuery("##{namingContainer}\\:#{textEditorId}PreviewContent").height() + 115 + "px",
                  height: jQuery("##{namingContainer}\\:#{textEditorId}PreviewContent").height() + 115 + "px"
              })
          });</script>
          <s:div rendered="#{empty valueBinding}" style="text-align:center">(Please enter some wiki markup, this preview window will refresh automatically.)</s:div>
      </ui:define>
      <ui:define name="dialogControls">
          <h:outputLink styleClass="buttonNonpersistent closeDialog" tabindex="1"><span class="buttonLabel"><u>C</u>lose Preview</span></h:outputLink>
      </ui:define>
  
  </ui:decorate>
  
  </s:fragment>
  
  
  
  
  1.1      date: 2007/08/17 13:00:25;  author: cbauer;  state: Exp;jboss-seam/examples/wiki/view/includes/mainMenuItem.xhtml
  
  Index: mainMenuItem.xhtml
  ===================================================================
  <ui:composition
          xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:wiki="http://jboss.com/products/seam/wiki"
          xmlns:c="http://java.sun.com/jstl/core"
          xmlns:s="http://jboss.com/products/seam/taglib">
  
  <c:forEach var="childWrapper" items="#{node.wrappedChildren}">
      <s:div styleClass="level#{childWrapper.level}">
          <s:div styleClass="level#{childWrapper.level}Body">
              <h:outputText styleClass="level#{childWrapper.level}Marker" value="&#183;"/>
              <h:outputLink styleClass="level#{childWrapper.level}Link"
                            value="#{wiki:renderURL(childWrapper.wrappedNode)}">#{childWrapper.wrappedNode.name}</h:outputLink>
          </s:div>
          <s:div styleClass="level#{childWrapper.level}Children" style="padding-left: #{childWrapper.level*7}px;">
              <ui:include src="mainMenuItem.xhtml">
                  <ui:param name="node" value="#{childWrapper}"/>
              </ui:include>
          </s:div>
      </s:div>
  </c:forEach>
  
  </ui:composition>
  
  
  



More information about the jboss-cvs-commits mailing list