r4300 printPageHeaders(): also use static proxy for JS files
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Mar 2011 11:05:14 +0000 (11:05 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Mar 2011 11:05:14 +0000 (11:05 +0000)
CodePress: fix to access its bits through static proxy

wwwroot/inc/functions.php
wwwroot/js/codepress/codepress.css
wwwroot/js/codepress/codepress.html
wwwroot/js/codepress/codepress.js

index 80ef1bb67f0db08f33cbf5d46f13e7d64978a6dc..6c8389e866cff1fc7b664a0dda745bf58edb3d84 100644 (file)
@@ -3744,7 +3744,7 @@ function printPageHeaders ()
                        if ($item['type'] == 'inline')
                                echo '<script type="text/javascript">' . "\n" . trim ($item['script'], "\r\n") . "\n</script>\n";
                        elseif ($item['type'] == 'file')
-                               echo '<script type="text/javascript" src="' . htmlspecialchars ($item['script']) . "\"></script>\n";
+                               echo "<script type='text/javascript' src='?module=chrome&uri=${item['script']}'></script>\n";
 }
 
 function strerror8021Q ($errno)
index 21868201aa582f85f4ac8e145fb3b66d44989430..42e6dbd78908393715b430e45124573e10ea39e4 100644 (file)
@@ -6,7 +6,7 @@ body {
        font-family:monospace;\r
        font-size:13px;\r
        white-space:pre;\r
-       background-image:url("images/line-numbers.png");\r
+       background-image:url("index.php?module=chrome&uri=js/codepress/images/line-numbers.png");\r
        background-repeat:repeat-y;\r
        background-position:0 3px;\r
        line-height:16px;\r
@@ -18,4 +18,4 @@ P {margin:0;padding:0;border:0;outline:0;display:block;white-space:pre;}
 b, i, s, u, a, em, tt, ins, big, cite, strong, var, dfn {text-decoration:none;font-weight:normal;font-style:normal;font-size:13px;}\r
 \r
 body.hide-line-numbers {background:white;margin-left:16px;}\r
-body.show-line-numbers {background-image:url("images/line-numbers.png");margin-left:32px;}
\ No newline at end of file
+body.show-line-numbers {background-image:url("index.php?module=chrome&uri=js/codepress/images/line-numbers.png");margin-left:32px;}\r
index 99209bf88a81ee98918c879a9b05279cfcabde9e..1f563e293b0d61c4791868a43f9728b75a5c87f2 100644 (file)
 \r
        if(lh.match('language=')) language = lh.replace(/.*language=(.*?)(&.*)?$/,'$1');\r
 \r
-       document.write('<link type="text/css" href="codepress.css?ts='+ts+'" rel="stylesheet" />');\r
-       document.write('<link type="text/css" href="languages/'+language+'.css?ts='+ts+'" rel="stylesheet" id="cp-lang-style" />');\r
-       document.write('<scr'+'ipt type="text/javascript" src="engines/'+engine+'.js?ts='+ts+'"></scr'+'ipt>');\r
-       document.write('<scr'+'ipt type="text/javascript" src="languages/'+language+'.js?ts='+ts+'"></scr'+'ipt>');\r
+       document.write('<link type="text/css" href="index.php?module=chrome&uri=js/codepress/codepress.css&ts='+ts+'" rel="stylesheet" />');\r
+       document.write('<link type="text/css" href="index.php?module=chrome&uri=js/codepress/languages/'+language+'.css&ts='+ts+'" rel="stylesheet" id="cp-lang-style" />');\r
+       document.write('<scr'+'ipt type="text/javascript" src="index.php?module=chrome&uri=js/codepress/engines/'+engine+'.js&ts='+ts+'"></scr'+'ipt>');\r
+       document.write('<scr'+'ipt type="text/javascript" src="index.php?module=chrome&uri=js/codepress/languages/'+language+'.js&ts='+ts+'"></scr'+'ipt>');\r
        </script>\r
 \r
 </head>\r
index 39107187248bc69355ef8d1c553126a54545f677..fbc2251e4b88eb4a77658b7251218e1f208dcd07 100644 (file)
@@ -40,7 +40,7 @@ CodePress = function(obj) {
                if(obj) self.textarea.value = document.getElementById(obj) ? document.getElementById(obj).value : obj;\r
                if(!self.textarea.disabled) return;\r
                self.language = language ? language : self.getLanguage();\r
-               self.src = CodePress.path+'codepress.html?language='+self.language+'&ts='+(new Date).getTime();\r
+               self.src = CodePress.path+'codepress.html&language='+self.language+'&ts='+(new Date).getTime();\r
                if(self.attachEvent) self.attachEvent('onload',self.initialize);\r
                else self.addEventListener('load',self.initialize,false);\r
        }\r