Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9810

Clicking on "Select All" of code tag on print page results in a javascript error when using prosilver

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Viewing posts
    • Labels:
      None
    • Environment:
      PHP 5.2.12, MySQL(i) 5.0.67-community-log, Firefox 3.6

      Description

      If you open the print page (print view) of a topic, the code bbcode still shows the "Select All" feature, which shouldn't be a problem. But once you click on that, you will get a javascript error:

      selectCode is not defined

      Additionally, the browser will jump to the top of the page.

      I was able to fix it this way:
      Open styles/prosilver/template/viewtopic_print.html
      Find:

      <link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />

      Add before:

      <script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>

        Activity

        Hide
        ToonArmy Chris Smith added a comment -

        Or hide the select all link with CSS. Thoughts?

        Show
        ToonArmy Chris Smith added a comment - Or hide the select all link with CSS. Thoughts?
        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment -

        Yep, agreed. Doesn't make sense on that page anyway.

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - Yep, agreed. Doesn't make sense on that page anyway.
        Hide
        marc1706 marc1706 added a comment - - edited

        Open styles/prosilver/theme/print.css
        Find:

        /* Accessibility tweaks: Mozilla.org */
        .skip_link { display: none; }

        After add:

        dl.codebox dt { display: none; }

        Tested with Firefox 3.6, IE8 and Chrome 6

        Show
        marc1706 marc1706 added a comment - - edited Open styles/prosilver/theme/print.css Find: /* Accessibility tweaks: Mozilla.org */ .skip_link { display: none; } After add: dl.codebox dt { display: none; } Tested with Firefox 3.6, IE8 and Chrome 6
        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment -

        Looks good, will test this later.

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - Looks good, will test this later.
        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment - - edited

        Sam-T tested it on Windows as well and it worked for him.

        I tested it with several browsers (safari, chrome, firefox, opera) and it simply ignored print.css in all of them.

        I propose adding the JavaScript in addition to the CSS hiding to prevent this. Thoughts?

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - - edited Sam-T tested it on Windows as well and it worked for him. I tested it with several browsers (safari, chrome, firefox, opera) and it simply ignored print.css in all of them. I propose adding the JavaScript in addition to the CSS hiding to prevent this. Thoughts?
        Hide
        marc1706 marc1706 added a comment - - edited

        Could you try if it works better if you add this:

        .codebox dt { display: none; }

        I had a similar issue and after removing the dt in front of .codebox it worked without isses. Weird enough, it also worked afterwards after adding the dt again.

        My test results with the proposed patch (including dt):
        Windows 7: Works with Firefox 3.6.9, IE8, Chrome 6

        Ubuntu 10.04: Works with Opera 10.6, Firefox 3,6,9

        Windows XP: Works with IE6, Firefox 3.6.9, Opera 10.6

        edit: I made some screenshots: http://browsershots.org/http://area51.m-a-styles.de/viewtopic.php?f=2&t=4&start=0&view=print#

        Show
        marc1706 marc1706 added a comment - - edited Could you try if it works better if you add this: .codebox dt { display: none; } I had a similar issue and after removing the dt in front of .codebox it worked without isses. Weird enough, it also worked afterwards after adding the dt again. My test results with the proposed patch (including dt): Windows 7: Works with Firefox 3.6.9, IE8, Chrome 6 Ubuntu 10.04: Works with Opera 10.6, Firefox 3,6,9 Windows XP: Works with IE6, Firefox 3.6.9, Opera 10.6 edit: I made some screenshots: http://browsershots.org/http://area51.m-a-styles.de/viewtopic.php?f=2&t=4&start=0&view=print#
        Hide
        RMcGirr83 Rich McGirr added a comment -

        Validated as fixed.

        Show
        RMcGirr83 Rich McGirr added a comment - Validated as fixed.

          People

          • Assignee:
            igorw Igor Wiedler [X] (Inactive)
            Reporter:
            marc1706 marc1706
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development