]> git.parisson.com Git - pdf.js.git/commitdiff
Fixing font loading hack for IE9.. and some styles
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 28 Aug 2011 20:10:14 +0000 (15:10 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 28 Aug 2011 20:10:14 +0000 (15:10 -0500)
web/compatibility.js [changed mode: 0644->0755]
web/viewer.css [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index d286692..878bf53
 
   Function.prototype.bind = function(obj) {
     var fn = this, headArgs = Array.prototype.slice.call(arguments, 1);
-    var binded = function(tailArgs) {
-      var args = headArgs.concat(tailArgs);
+    var binded = function() {
+      var args = Array.prototype.concat.apply(headArgs, arguments);
       return fn.apply(obj, args);
     };
     return binded;
   };
 })();
+
+// IE9 text/html data URI
+(function() {
+  if (document.documentMode !== 9)
+    return;
+  // overriding the src property
+  var originalSrcDescriptor = Object.getOwnPropertyDescriptor(
+    HTMLIFrameElement.prototype, 'src');
+  Object.defineProperty(HTMLIFrameElement.prototype, 'src', {
+    get: function() { return this.$src; },
+    set: function(src) {
+      this.$src = src;
+      if (src.substr(0, 14) != 'data:text/html') {
+        originalSrcDescriptor['set'].call(this, src);
+        return;
+      }
+      // for text/html, using blank document and then
+      // document's open, write, and close operations
+      originalSrcDescriptor['set'].call(this, 'about:blank');
+      setTimeout((function() {
+        var doc = this.contentDocument;
+        doc.open('text/html');
+        doc.write(src.substr(src.indexOf(',') + 1));
+        doc.close();
+      }).bind(this), 0);
+    },
+    enumerable: true
+  });
+})();
old mode 100644 (file)
new mode 100755 (executable)
index bb7da00..a8578eb
@@ -36,6 +36,11 @@ body {
   line-height: 32px;
 }
 
+#controls > button > img {
+  width: 32px;
+  height: 32px;
+}
+
 #controls > button[disabled] > img {
   opacity: 0.5;
 }
@@ -159,6 +164,11 @@ span#info {
   -webkit-box-shadow: 0px 4px 10px #000;
 }
 
+#sidebarControls > button > img {
+  width: 32px;
+  height: 32px;
+}
+
 #sidebarControls > button[disabled] > img {
   opacity: 0.5;
 }