inliner.js
authorAlan Knowles <alan@roojs.com>
Thu, 12 Nov 2015 05:08:18 +0000 (13:08 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 12 Nov 2015 05:08:18 +0000 (13:08 +0800)
inliner.js

index 83fdae4..05730fb 100644 (file)
      *                 (1) css input textarea for the css to apply
      *                 (2) html content for the css to apply TO
      */
-    function inlinify (input) {
-       var tmpWindow = window.open("", "tmpHtml", "width=0,height=0");
-       window.blur(); // re focus on main window
-       var tmpDoc = tmpWindow.document; // create a window that we can use 
-       var $tmpDoc = jQuery(tmpDoc); // jquerify the temp window 
-
-       tmpDoc.write(input); // write the HTML out to a new window doc
-       interpritAppendedStylesheet($tmpDoc); // apply styles to the document just created
+    function inlinify () {
+       
+       interpritAppendedStylesheet(document); // apply styles to the document just created
        $tmpDoc.find("style").remove(); // sanitize all style tags present prior to the transformation
        
        var newHTML = $tmpDoc.find("html").html();