-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added stimulus & controllers to a landing page (#954)
* Added stimulus & controllers to a landing page * removed tab controller & packages json
- Loading branch information
Showing
11 changed files
with
145 additions
and
11 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,3 @@ | ||
import '@fontsource-variable/cabin/index.min.css'; | ||
import 'highlight.js/styles/github-dark.min.css'; | ||
import './bootstrap.js'; |
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,6 @@ | ||
import { startStimulusApp } from '@symfony/stimulus-bundle'; | ||
|
||
const app = startStimulusApp(); | ||
|
||
// register any custom, 3rd party controllers here | ||
// app.register('some_controller_name', SomeImportedController); |
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,4 @@ | ||
{ | ||
"controllers": [], | ||
"entrypoints": [] | ||
} |
16 changes: 16 additions & 0 deletions
16
src/web/landing/assets/controllers/syntax_highlight_controller.js
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,16 @@ | ||
import {Controller} from '@hotwired/stimulus'; | ||
import hljs from 'highlight.js/lib/core'; | ||
import php from 'highlight.js/lib/languages/php'; | ||
|
||
export default class extends Controller | ||
{ | ||
static afterLoad(identifier, application) | ||
{ | ||
hljs.registerLanguage('php', php); | ||
} | ||
|
||
connect() | ||
{ | ||
hljs.highlightElement(this.element); | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
return [ | ||
'app' => [ | ||
'path' => 'app.js', | ||
'entrypoint' => true, | ||
], | ||
'@symfony/stimulus-bundle' => [ | ||
'path' => '@symfony/stimulus-bundle/loader.js', | ||
], | ||
'@hotwired/stimulus' => [ | ||
'version' => '3.2.1', | ||
], | ||
'highlight.js/lib/core' => [ | ||
'version' => '11.9.0', | ||
], | ||
'highlight.js/lib/languages/php' => [ | ||
'version' => '11.9.0', | ||
], | ||
'highlight.js/styles/github-dark.min.css' => [ | ||
'version' => '11.9.0', | ||
'type' => 'css', | ||
], | ||
'@fontsource-variable/cabin/index.min.css' => [ | ||
'version' => '5.0.17', | ||
'type' => 'css', | ||
], | ||
]; |
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