File tree 6 files changed +34
-20
lines changed
6 files changed +34
-20
lines changed Original file line number Diff line number Diff line change 1
- require ( 'eonasdan-bootstrap-datetimepicker' ) ;
2
-
3
- require ( 'imports-loader?define=>false!typeahead.js/dist/typeahead.jquery.min.js' ) ;
4
- const Bloodhound = require ( 'imports-loader?define=>false!typeahead.js/dist/bloodhound.js' ) ;
5
- window . Bloodhound = Bloodhound ;
6
- require ( '../scss/bootstrap-tagsinput.scss' ) ;
7
- require ( 'bootstrap-tagsinput' ) ;
1
+ import 'eonasdan-bootstrap-datetimepicker' ;
2
+ import 'typeahead.js' ;
3
+ import Bloodhound from "bloodhound-js" ;
4
+ import 'bootstrap-tagsinput' ;
8
5
9
6
$ ( function ( ) {
10
7
// Datetime picker initialization.
@@ -33,16 +30,17 @@ $(function() {
33
30
datumTokenizer : Bloodhound . tokenizers . whitespace
34
31
} ) ;
35
32
source . initialize ( ) ;
33
+
36
34
$input . tagsinput ( {
37
35
trimValue : true ,
38
36
focusClass : 'focus' ,
39
- typeahead : {
37
+ typeaheadjs : {
40
38
name : 'tags' ,
41
39
source : source . ttAdapter ( )
42
40
}
43
41
} ) ;
44
42
}
45
- } )
43
+ } ) ;
46
44
47
45
// Handling the modal confirmation message.
48
46
$ ( document ) . on ( 'submit' , 'form[data-confirmation]' , function ( event ) {
Original file line number Diff line number Diff line change 1
1
// loads the Bootstrap jQuery plugins
2
- require ( 'bootstrap-sass/assets/javascripts/bootstrap/dropdown.js' ) ;
3
- require ( 'bootstrap-sass/assets/javascripts/bootstrap/modal.js' ) ;
4
- require ( 'bootstrap-sass/assets/javascripts/bootstrap/transition.js' ) ;
2
+ import 'bootstrap-sass/assets/javascripts/bootstrap/dropdown.js' ;
3
+ import 'bootstrap-sass/assets/javascripts/bootstrap/modal.js' ;
4
+ import 'bootstrap-sass/assets/javascripts/bootstrap/transition.js' ;
5
5
6
6
// loads the code syntax highlighting library
7
- require ( './highlight.js' ) ;
7
+ import './highlight.js' ;
Original file line number Diff line number Diff line change 1
- var hljs = require ( 'highlight.js/lib/highlight.js' ) ;
1
+ import hljs from 'highlight.js/lib/highlight' ;
2
+ import php from 'highlight.js/lib/languages/php' ;
3
+ import twig from 'highlight.js/lib/languages/twig' ;
2
4
3
- hljs . configure ( {
4
- languages : [ 'twig' , 'php' ]
5
- } ) ;
5
+ hljs . registerLanguage ( 'php' , php ) ;
6
+ hljs . registerLanguage ( 'twig' , twig ) ;
6
7
7
8
hljs . initHighlightingOnLoad ( ) ;
8
-
9
- module . exports = hljs ;
Original file line number Diff line number Diff line change 1
1
@import " ~bootswatch/flatly/variables" ;
2
2
@import " ~eonasdan-bootstrap-datetimepicker/src/sass/bootstrap-datetimepicker-build.scss" ;
3
+ @import " bootstrap-tagsinput.scss" ;
3
4
4
5
/* Page: 'Backend post index'
5
6
------------------------------------------------------------------------- */
Original file line number Diff line number Diff line change 14
14
"node-sass" : " ^4.5.3" ,
15
15
"sass-loader" : " ^6.0.5" ,
16
16
"typeahead.js" : " ^0.11.1"
17
+ },
18
+ "scripts" : {
19
+ "dev-server" : " ./node_modules/.bin/encore dev-server" ,
20
+ "dev" : " ./node_modules/.bin/encore dev" ,
21
+ "watch" : " ./node_modules/.bin/encore dev --watch" ,
22
+ "build" : " ./node_modules/.bin/encore production"
17
23
}
18
24
}
Original file line number Diff line number Diff line change 1
1
var Encore = require ( '@symfony/webpack-encore' ) ;
2
+ var webpack = require ( 'webpack' ) ;
2
3
3
4
Encore
4
5
. setOutputPath ( 'web/build/' )
5
6
. setPublicPath ( '/build' )
6
7
. cleanupOutputBeforeBuild ( )
7
8
. autoProvidejQuery ( )
9
+ . autoProvideVariables ( {
10
+ "window.jQuery" : "jquery" ,
11
+ "window.Bloodhound" : require . resolve ( 'bloodhound-js' ) ,
12
+ "jQuery.tagsinput" : "bootstrap-tagsinput"
13
+ } )
8
14
. enableSassLoader ( )
9
15
. enableVersioning ( false )
10
16
. createSharedEntry ( 'js/common' , [ 'jquery' ] )
15
21
. addStyleEntry ( 'css/admin' , [ './app/Resources/assets/scss/admin.scss' ] )
16
22
;
17
23
18
- module . exports = Encore . getWebpackConfig ( ) ;
24
+ var config = Encore . getWebpackConfig ( ) ;
25
+
26
+ config . plugins . push ( new webpack . IgnorePlugin ( / ^ \. \/ l o c a l e $ / , / m o m e n t $ / ) ) ;
27
+
28
+ module . exports = config ;
You can’t perform that action at this time.
0 commit comments