diff options
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/css.php | 25 | ||||
-rw-r--r-- | lib/exe/js.php | 7 |
2 files changed, 6 insertions, 26 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php index 60e17ae82..afba5fc02 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -148,9 +148,6 @@ function css_out(){ // parse less $css = css_parseless($css); - // place all remaining @import statements at the top of the file - $css = css_moveimports($css); - // compress whitespace and comments if($conf['compress']){ $css = css_compress($css); @@ -460,28 +457,6 @@ function css_pluginstyles($mediatype='screen'){ } /** - * Move all @import statements in a combined stylesheet to the top so they - * aren't ignored by the browser. - * - * @author Gabriel Birke <birke@d-scribe.de> - */ -function css_moveimports($css) { - if(!preg_match_all('/@import\s+(?:url\([^)]+\)|"[^"]+")\s*[^;]*;\s*/', $css, $matches, PREG_OFFSET_CAPTURE)) { - return $css; - } - $newCss = ""; - $imports = ""; - $offset = 0; - foreach($matches[0] as $match) { - $newCss .= substr($css, $offset, $match[1] - $offset); - $imports .= $match[0]; - $offset = $match[1] + strlen($match[0]); - } - $newCss .= substr($css, $offset); - return $imports.$newCss; -} - -/** * Very simple CSS optimizer * * @author Andreas Gohr <andi@splitbrain.org> diff --git a/lib/exe/js.php b/lib/exe/js.php index 76238a81b..040b8874d 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -86,15 +86,20 @@ function js_out(){ // start output buffering and build the script ob_start(); + $json = new JSON(); // add some global variables print "var DOKU_BASE = '".DOKU_BASE."';"; print "var DOKU_TPL = '".tpl_basedir()."';"; + print "var DOKU_COOKIE_PARAM = " . $json->encode( + array( + 'path' => empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir'], + 'secure' => $conf['securecookie'] && is_ssl() + )).";"; // FIXME: Move those to JSINFO print "var DOKU_UHN = ".((int) useHeading('navigation')).";"; print "var DOKU_UHC = ".((int) useHeading('content')).";"; // load JS specific translations - $json = new JSON(); $lang['js']['plugins'] = js_pluginstrings(); $templatestrings = js_templatestrings(); if(!empty($templatestrings)) { |