Author Topic: B3: Beautification of xhtml files doesn't work  (Read 1840 times)

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
B3: Beautification of xhtml files doesn't work
« on: September 09, 2017, 03:20:31 PM »
Beautification of xhtml files with embedded javascript elements is supposed to switch from the XML to the JS beautifier for the outputscript elements. Well, it doesn't.  As an aside, it doesn't do context tagging and symbol coloring for those embedded snippets either.

Code: [Select]
<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:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core">

  <div class="actionButtonContainer">
    <div class="actionButtons">
      <ui:insert name="actionButtons"/>
    </div>

    <p:outputPanel layout="block" id="exportContainer"
      rendered="#{not context.protected}">
      <h:panelGroup layout="block" id="exportMessage"
        rendered="#{backingBean.state gt 0}">
        <h:outputScript>
          if (!(typeof document.statusInterval === 'undefined')) {
          clearInterval(document.statusInterval); } document.statusInterval =
          setInterval(function(){ repaintExportContainer(); }, 5000);
        </h:outputScript>
      </h:panelGroup>
      <h:panelGroup layout="block"
        rendered="#{backingBean.state eq 0 or backingBean.state eq 4}">
        <h:outputScript type="text/javascript">
          if (!(typeof document.statusInterval === 'undefined')) {
          clearInterval(document.statusInterval); document.statusInterval =
          null; }
        </h:outputScript>
      </h:panelGroup>

      <h:outputScript>
        /* <![CDATA[ */
            function repaintExportContainer() {
  updateExportContainerStatus();
            }
            function exportComplete() {
                      if ($("#exportPage").length && $("#exportCompletedPanel").length) {
                        updateExportCompletedStatsPanel();
                    }
                    updateExportState();
            }
    function updateExportState() {
            // TODO
            }
/* ]]> */
      </h:outputScript>
    </p:outputPanel>
  </div>

</ui:composition>


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: B3: Beautification of xhtml files doesn't work
« Reply #1 on: September 11, 2017, 01:18:09 PM »
Well, XHTML, yes, but we do not currently recognize JSF tags.  I'd need to look more carefully at the JSF namespace, but I suspect it won't be too different from what we do for inline <script type="javascript"> tags in HTML.  But it probably won't make it for v22 though.