40 lines
916 B
PHP
40 lines
916 B
PHP
@include('boilerplate::load.codemirror', ['theme' => 'storm'])
|
|
|
|
@push('js')
|
|
<script>
|
|
$(function () {
|
|
$('#code').codemirror();
|
|
})
|
|
</script>
|
|
@endpush
|
|
|
|
@component('boilerplate::card', ['color' => 'warning', 'title' => 'CodeMirror'])
|
|
Usage :
|
|
<pre>
|
|
@include('boilerplate::load.codemirror', ['theme' => 'storm'])
|
|
@push('js')
|
|
<script>
|
|
var myCode = $('#code').codemirror();
|
|
// To get the value : myCode.getValue();
|
|
</script>
|
|
@endpush</pre>
|
|
<textarea id="code"><h1>CodeMirror demo</h1>
|
|
<style>
|
|
.color {
|
|
color: red;
|
|
}
|
|
</style>
|
|
<script>
|
|
$(function () {
|
|
alert('demo');
|
|
});
|
|
</script>
|
|
</textarea>
|
|
|
|
@slot('footer')
|
|
<div class="small text-muted text-right">
|
|
<a href="https://codemirror.net/" target="_blank">CodeMirror</a>
|
|
</div>
|
|
@endslot
|
|
@endcomponent
|