Aleksander Machniak
2015-12-17 c67e7e8f85ae9c05d1a04715d2a9ce7e84a50a45
Fix PDF support detection in Firefox > 19 (#1490610)

Conflicts:
CHANGELOG
1 files added
2 files modified
32 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/js/app.js 31 ●●●●● patch | view | raw | blame | history
program/resources/dummy.pdf patch | view | raw | blame | history
CHANGELOG
@@ -16,6 +16,7 @@
- Fix invalid LDAP query in ACL user autocompletion (#1490591)
- Fix regression in displaying contents of message/rfc822 parts (#1490606)
- Fix handling of message/rfc822 attachments on replies and forwards (#1490607)
- Fix PDF support detection in Firefox > 19 (#1490610)
RELEASE 1.1.3
-------------
program/js/app.js
@@ -8155,14 +8155,10 @@
    if (!this.env.browser_capabilities)
      this.env.browser_capabilities = {};
    if (this.env.browser_capabilities.pdf === undefined)
      this.env.browser_capabilities.pdf = this.pdf_support_check();
    if (this.env.browser_capabilities.flash === undefined)
      this.env.browser_capabilities.flash = this.flash_support_check();
    if (this.env.browser_capabilities.tif === undefined)
      this.tif_support_check();
    $.each(['pdf', 'flash', 'tif'], function() {
      if (ref.env.browser_capabilities[this] === undefined)
        ref.env.browser_capabilities[this] = ref[this + '_support_check']();
    });
  };
  // Returns browser capabilities string
@@ -8181,11 +8177,14 @@
  this.tif_support_check = function()
  {
    var img = new Image();
    window.setTimeout(function() {
      var img = new Image();
      img.onload = function() { ref.env.browser_capabilities.tif = 1; };
      img.onerror = function() { ref.env.browser_capabilities.tif = 0; };
      img.src = ref.assets_path('program/resources/blank.tif');
    }, 10);
    img.onload = function() { ref.env.browser_capabilities.tif = 1; };
    img.onerror = function() { ref.env.browser_capabilities.tif = 0; };
    img.src = this.assets_path('program/resources/blank.tif');
    return 0;
  };
  this.pdf_support_check = function()
@@ -8221,6 +8220,14 @@
        return 1;
    }
    window.setTimeout(function() {
      $('<object>').css({position: 'absolute', left: '-10000px'})
        .attr({data: ref.assets_path('program/resources/dummy.pdf'), width: 1, height: 1, type: 'application/pdf'})
        .load(function() { ref.env.browser_capabilities.pdf = 1; })
        .error(function() { ref.env.browser_capabilities.pdf = 0; })
        .appendTo($('body'));
      }, 10);
    return 0;
  };
program/resources/dummy.pdf
Binary files differ