admin.js fails in IE8

XMLWordPrintable

      Clicking on "Administration" -> Users, the following error is displayed:

      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C)
      Timestamp: Tue, 18 Oct 2011 05:54:05 UTC
      
      Message: Object doesn't support this property or method
      Line: 32
      Char: 13
      Code: 0
      URI: http://crucible-dev.goharvey.com.au/static/lrss5f/admin.js
      

      We're using a feature that IE8 doesn't supportin admin.js:

              AJS.$(".checkTrailingWhiteSpace").each(function() {
                  var text = AJS.$(this).text();
                  if (text != text.trim()) {
                      AJS.$(this).addClass("trailingWhiteSpace");
                      showWhiteSpaceWarning = true;
                  }
              });
      

      The trim is the problem. We should use jQuery's trim instead.

      The problem code for that one is when GWT does this:

      function __gwt_initWindowCloseHandler(beforeunload, unload) {
        var wnd = window
        , oldOnBeforeUnload = wnd.onbeforeunload
        , oldOnUnload = wnd.onunload;
        
        wnd.onbeforeunload = function(evt) {
          var ret, oldRet;
          try {
            ret = beforeunload();
          } finally {
            oldRet = oldOnBeforeUnload && oldOnBeforeUnload(evt);
          }
          // Avoid returning null as IE6 will coerce it into a string.
          // Ensure that "" gets returned properly.
          if (ret != null) {
            return ret;
          }
          if (oldRet != null) {
            return oldRet;
          }
          // returns undefined.
        };
        
        wnd.onunload = function(evt) {
          try {
            unload();
          } finally {
            oldOnUnload && oldOnUnload(evt);
            wnd.onresize = null;
            wnd.onscroll = null;
            wnd.onbeforeunload = null;
            wnd.onunload = null;
          }
        };
        
        // Remove the reference once we've initialize the handler
        wnd.__gwt_initWindowCloseHandler = undefined;
      }
      

      oldOnBeforeUnload is a jQuery function, evt is undefined, and jQuery flips out
      would have to spend some time on it to figure out how to fix jQuery

            Assignee:
            Pierre-Etienne Poirot (Inactive)
            Reporter:
            Renan Battaglin (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: