• 2
    • 2
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      Steps to reproduce:

      1. Create a page and add the HTML Macro with the following script:
        <script type="text/javascript">
        function workingDaysBetweenDates(startDate, endDate)
        { // Validate input if (endDate < startDate) return 0; // Calculate days between dates var millisecondsPerDay = 86400 * 1000; // Day in milliseconds startDate.setHours(0,0,0,1); // Start just after midnight endDate.setHours(23,59,59,999); // End just before midnight var diff = endDate - startDate; // Milliseconds between datetime objects var days = Math.ceil(diff / millisecondsPerDay); // Subtract two weekend days for every week in between var weeks = Math.floor(days / 7); var days = days - (weeks * 2); // Handle special cases var startDay = startDate.getDay(); var endDay = endDate.getDay(); // Remove weekend not previously removed. if (startDay - endDay > 1) days = days - 2; // Remove start day if span starts on Sunday but ends before Saturday if (startDay == 0 && endDay != 6) days = days - 1 // Remove end day if span ends on Saturday but starts after Sunday if (endDay == 6 && startDay != 0) days = days - 1 return days; }
        
        var FC = new Date("April 24, 2015");
        var Ship = new Date("May 30, 2015");
        var today = new Date();
        FCDaysLeft = workingDaysBetweenDates(today, FC);
        ShipDaysLeft = workingDaysBetweenDates(today, Ship);
        document.write("<H3>");
        document.write("Today is: " + today.toString().split(' ').splice(1,3).join(' ') +"<br />");
        document.write("There are " + FCDaysLeft + " working days left to FC <br />" );
        document.write("There are "+ ShipDaysLeft + " working days left to Ship <br />");
        document.write("</H3>");
        </script>
        
      2. Save.
      3. Now try to edit the page again.

      Workaround:

      Get the edit link manually, and add to the URL bar.

            [CONFSERVER-35001] A javascript into a HTML macro breaks the edit function

            Thank you for raising this suggestion.
            We regret to inform you that due to limited demand, we have no plans to implement it in the foreseeable future. In order to set expectations, we're closing this request now. Sometimes potentially valuable tickets do get closed where the Summary or Description has not caught the attention of the community. If you feel that this suggestion is valuable, consider describing in more detail or outlining how this request will help you achieve your goals. We may then be able to provide better guidance.
            For more context, check out our Community blog on our updated workflow for Suggestions
            Cheers,

            Confluence Product Management

            Adam Barnes (Inactive) added a comment - Thank you for raising this suggestion. We regret to inform you that due to limited demand, we have no plans to implement it in the foreseeable future. In order to set expectations, we're closing this request now. Sometimes potentially valuable tickets do get closed where the Summary or Description has not caught the attention of the community. If you feel that this suggestion is valuable, consider describing in more detail or outlining how this request will help you achieve your goals. We may then be able to provide better guidance. For more context, check out our Community blog on our updated workflow for Suggestions Cheers, Confluence Product Management

            I have the same issue with Confluence 6.2.3.

            The javascript console reports:

            TypeError: b.Rte.getEditor(...) is null (batch.js:2881:412)

            Michel Hartmann added a comment - I have the same issue with Confluence 6.2.3. The javascript console reports: TypeError: b.Rte.getEditor(...) is null (batch.js:2881:412)

            I also have this issue.

            If I just create a blank page, and I add a html macro with the content:

            <script>
            document.write("ABC");
            </script>

             

            The edit button is broken. If I right click on it and select open in new tab it works.

            Robert Metcalf added a comment - I also have this issue. If I just create a blank page, and I add a html macro with the content: <script> document.write("ABC"); </script>   The edit button is broken. If I right click on it and select open in new tab it works.

            Hi wzanchet

            Thanks for taking the time to raise this issue. It looks like the code that you've added in is broken. It's missing a closing parentheses. If you fix the code does the error continue to happen?

            As an aside functionality such as this should really be placed into a plugin rather than being dropped into an html macro.

            Regards
            Steve Haffenden
            Confluence Bugmaster

            Steve Haffenden (Inactive) added a comment - Hi wzanchet Thanks for taking the time to raise this issue. It looks like the code that you've added in is broken. It's missing a closing parentheses. If you fix the code does the error continue to happen? As an aside functionality such as this should really be placed into a plugin rather than being dropped into an html macro. Regards Steve Haffenden Confluence Bugmaster

              Unassigned Unassigned
              wzanchet William Zanchet (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: