Skip to content

Commit

Permalink
Merge pull request #379 from stanfieldr/1.8
Browse files Browse the repository at this point in the history
Delegate cache busting query string to the UrlGenerator
  • Loading branch information
barryvdh committed Jul 21, 2015
2 parents 673a9c5 + 48d7f86 commit 8833c88
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/JavascriptRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class JavascriptRenderer extends BaseJavascriptRenderer
// Use XHR handler by default, instead of jQuery
protected $ajaxHandlerBindToJquery = false;
protected $ajaxHandlerBindToXHR = true;

/** @var \Illuminate\Routing\UrlGenerator */
protected $url;

Expand Down Expand Up @@ -43,20 +43,17 @@ public function renderHead()
return parent::renderHead();
}

$jsModified = $this->getModifiedTime('js');
$cssModified = $this->getModifiedTime('css');

$html = '';
$html .= sprintf(
'<link rel="stylesheet" type="text/css" href="%s?%s">' . "\n",
$this->url->route('debugbar.assets.css'),
$cssModified
);
$html .= sprintf(
'<script type="text/javascript" src="%s?%s"></script>' . "\n",
$this->url->route('debugbar.assets.js'),
$jsModified
);
$cssRoute = $this->url->route('debugbar.assets.css', [
'v' => $this->getModifiedTime('css')
]);

$jsRoute = $this->url->route('debugbar.assets.js', [
'v' => $this->getModifiedTime('js')
]);

$html = '';
$html .= "<link rel='stylesheet' type='text/css' href='{$cssRoute}'>";
$html .= "<script type='text/javascript' src='{$jsRoute}'></script>";

if ($this->isJqueryNoConflictEnabled()) {
$html .= '<script type="text/javascript">jQuery.noConflict(true);</script>' . "\n";
Expand Down

0 comments on commit 8833c88

Please sign in to comment.