Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67632

Stop using Onclick event for link

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Component/s: JavaScript
    • Labels:

      Description

      The link to download files from a course use "onclick" javascript event. This is not good practices and makes it hard to use an extension like "download them all".

       

      The onclick is not visible in the source:

      <div class="mod-indent-outer">
      <div class="mod-indent"></div><div><div class="activityinstance">
      <a class="" onclick="" href="https://moodle.taltech.ee/mod/resource/view.php?id=116563"><img src="https://moodle.taltech.ee/theme/image.php/taltech/core/1576505905/f/pdf-24" class="iconlarge activityicon" alt="" role="presentation" aria-hidden="true">
        <span class="instancename">Jünger I<span class="accesshide "> File</span></span>
      </a>
      </div>
      </div>
      </div>

       

      Yet it's binded trough JS:

       

      Only href should be used. If we want to direct people the resource page we can use an extra link "(info)".

       

      If the target is to open a new windows. Then create a small link beside the normal one "open in new windows". The normal one should directly link to the PDF so right click "download" would works.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            gagarine gagarine
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m