domains/remove_print_css.js
[app.webkitpdf] / inliner.js
index 1a33bb5..f079dd8 100644 (file)
@@ -1,4 +1,17 @@
-
+/**
+ *
+ * could this work by findind all the visible text,
+ * then making them hidden..
+ *
+ * -- make a snapshot of the background..
+ *
+ * -- delete the whole page...
+ * -- show the image as the background.
+ * -- then overlay all the text given their calculated positions..
+ * 
+ *
+ *
+ */
 
 
 (function(){
@@ -9,7 +22,7 @@
     
      
     
-    var fillStyle = function(dom)
+    var fillStyle = function(dom, pstyle)
     {
         if (!dom || dom.nodeType != 1) {
             //console.log("SKIP: " + dom.nodeName);
@@ -39,7 +52,7 @@
         for (var i = 0;i < cn.length;i++) {
             
             //console.log( i + ':'+ cn[i].nodeName);
-            fillStyle(cn[i]);
+            fillStyle(cn[i], style);
         }    
               
         
@@ -48,7 +61,9 @@
         //    pstyle = window.getComputedStyle(dom.parentElement, null);
         //}
          
-        
+        if (dom.nodeName == 'SPAM') {
+            pstyle = false; //?? others??
+        }
         
         //if (dom.nodeName == 'LI') {            throw 'done';        }
         
@@ -60,9 +75,9 @@
             //returns[camel] = val;
             
             // idea... if the parent has the same style.. then do not apply it to the child?
-            //if (pstyle && pstyle[prop] == val) {
-            //    continue;
-            //}
+            if (pstyle && pstyle[prop] == val) {
+                continue;
+            }
             //console.log(prop + '=' + val);
             
             dom.style[camel] = val;
@@ -80,7 +95,7 @@
         
         
         var el = document.querySelector('body');
-        fillStyle(el);
+        fillStyle(el), false;
         
         var matches = document.getElementsByTagName('style');
         var rm = [];
         
     }
     changeit();
+    console.log("done");
     
 })();
\ No newline at end of file