-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/1.1.0: Raise the version number Improve the documentation Render the params into the SQL query Writes file in typo3conf/ext folder Adding jQuery.noConflict() to the header to avoid problems with other jQuery instances Extend the JavaScriptRenderer and move all asset related code there Rename Fonts folder to lowercase to match the font awesome lib folder naming
- Loading branch information
Showing
20 changed files
with
1,930 additions
and
5,737 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php namespace Konafets\TYPO3DebugBar; | ||
|
||
use DebugBar\DebugBar; | ||
use DebugBar\JavascriptRenderer; | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
|
||
class AssetsRenderer extends JavascriptRenderer | ||
{ | ||
|
||
const PATH_TO_STYLES = 'Resources/Public/Css'; | ||
const PATH_TO_JAVASCRIPT = 'Resources/Public/JavaScript'; | ||
const CUSTOM_CSS_STYLE_FILENAME = '/typo3_debugbar.css'; | ||
|
||
/** @var string */ | ||
protected $pathToCssAssetFile = ''; | ||
|
||
/** @var string */ | ||
protected $pathToJsAssetFile = ''; | ||
|
||
/** | ||
* @param DebugBar $debugBar | ||
* @param null $baseUrl | ||
* @param null $basePath | ||
*/ | ||
public function __construct(DebugBar $debugBar, $baseUrl = null, $basePath = null) | ||
{ | ||
parent::__construct($debugBar, $baseUrl, $basePath); | ||
$extensionPath = ExtensionManagementUtility::extPath(Typo3DebugBar::EXTENSION_KEY); | ||
|
||
$this->pathToCssAssetFile = 'typo3temp/tx_typo3_debugbar_styles.css'; | ||
$this->pathToJsAssetFile = 'typo3temp/tx_typo3_debugbar_javascript.js'; | ||
|
||
$this->cssVendors['fontawesome'] = $extensionPath . 'Resources/Public/vendor/font-awesome/style.css'; | ||
$this->cssFiles['typo3'] = $extensionPath . self::PATH_TO_STYLES . self::CUSTOM_CSS_STYLE_FILENAME; | ||
} | ||
|
||
/** | ||
* Renders the html to include needed assets | ||
* | ||
* Only useful if Assetic is not used | ||
* | ||
* @return string | ||
*/ | ||
public function renderHead() | ||
{ | ||
$this->dumpCssAssets($this->pathToCssAssetFile); | ||
$this->dumpJsAssets($this->pathToJsAssetFile); | ||
|
||
$html = ''; | ||
$html .= "<link href='{$this->pathToCssAssetFile}' rel='stylesheet' type='text/css'>\n"; | ||
$html .= "<script src='{$this->pathToJsAssetFile}' type='text/javascript'></script>\n"; | ||
|
||
if ($this->isJqueryNoConflictEnabled()) { | ||
$html .= '<script type="text/javascript">jQuery.noConflict(true);</script>' . "\n"; | ||
} | ||
|
||
return $html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.