Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-34677

Cleanup Samigo JavaScript and use jQuery where possible

    Details

    • Previous Issue Keys:
      SAM-1277

      Description

      There is a lot of legacy, custom JavaScript in Samigo. We can reduce the amount of code by replacing a lot of these functions with jQuery code.

      jQuery also takes care of a lot of cross-browser compatability issues for us. So instead of having to add conditional statements to Samigo, we can depend on jQuery to do it for us.

      Here is an example of custom JavaScript in Samigo code:

      84 function checkRadio()
      85 {
      86 for (i=0; i<document.forms[0].elements.length; i++)
      87 {
      88 if (document.forms[0].elements[i].type == "radio")
      89 {
      90 if (document.forms[0].elements[i].defaultChecked == true)
      91

      { 92 document.forms[0].elements[i].click(); 93 }

      94 }
      95 }
      96 }

      Here is the equivalent code with jQuery:

      $('form input[type="radio"]:checked').each().click();

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                samigoteam SAMIGO TEAM (Inactive)
                Reporter:
                ottenhoff Sam Ottenhoff
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    Git Integration