Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from russ666/master
Browse files Browse the repository at this point in the history
theme property added
  • Loading branch information
giovdk21 committed Nov 2, 2014
2 parents 0d776f2 + f7495da commit 99193f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions SyntaxHighlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

class SyntaxHighlighter extends Widget
{
public $theme = 'default';

public $brushes = [];
public $brushAliases = [
Expand Down Expand Up @@ -52,6 +53,8 @@ public function publishAssets() {
*/
public function run() {

SyntaxHighlighterAsset::$extraCss[] = 'styles/shCore' . ucfirst($this->theme) . '.css';

foreach ($this->brushes as $brushName) {
$brushFile = (!empty($this->brushAliases[$brushName]) ? $this->brushAliases[$brushName] : ucfirst($brushName));
SyntaxHighlighterAsset::$extraJs[] = 'scripts/shBrush' . $brushFile . '.js';
Expand Down
10 changes: 6 additions & 4 deletions SyntaxHighlighterAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ class SyntaxHighlighterAsset extends AssetBundle
// public $baseUrl = '@web';
public $sourcePath = '@yii2SyntaxHighlighter/assets';

public static $extraCss = [];
public static $extraJs = [];

public $css = [
'styles/shCore.css',
'styles/shThemeDefault.css',
];
public $css = [];

public $js = [
'scripts/shCore.js',
Expand All @@ -30,6 +28,10 @@ public function init(){

Yii::setAlias('@yii2SyntaxHighlighter', __DIR__);

foreach (static::$extraCss as $css) {
$this->css[] = $css;
}

foreach (static::$extraJs as $js) {
$this->js[] = $js;
}
Expand Down

0 comments on commit 99193f2

Please sign in to comment.