-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use Webpack Encore to manage assets #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| var $ = require('jquery'); | ||
|
||
| window.$ = $; | ||
| window.jQuery = $; | ||
|
||
|
|
||
| require('bootstrap-sass'); | ||
|
||
| require('moment'); | ||
|
||
| require('eonasdan-bootstrap-datetimepicker'); | ||
|
|
||
| require('imports-loader?define=>false!typeahead.js/dist/typeahead.jquery.min.js'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why using the imports-loader ? The dist files are using UMD, so they should work fine with CommonJS requirements. I think all your issues about defining global variables are actually related to the weird loading you do here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea ... I spent a lot of time trying to make typeahead/bloodhound work. Nothing worked. This was one of the tests that I did after reading some of the issues reported about this library (there are like a lot of issues reported!) |
||
| const Bloodhound = require('imports-loader?define=>false!typeahead.js/dist/bloodhound.js'); | ||
| window.Bloodhound = Bloodhound; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this shouldn't be needed (in theory), but it's possible there's some legacy library that isn't requiring this correctly. We'll need to make sure each line is needed, and document which lines are needed and why
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remove those, I see this error:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a lot of errors related to this library. Maybe we can replace it with some simpler alternative library? After all, our needs are super basic.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add something like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might decide to change: twitter/typeahead.js#1618 |
||
| require('bootstrap-tagsinput'); | ||
|
|
||
| $(document).ready(function () { | ||
|
||
| // Datetime picker initialization. | ||
| // See http://eonasdan.github.io/bootstrap-datetimepicker/ | ||
| $('[data-toggle="datetimepicker"]').datetimepicker({ | ||
| icons: { | ||
| time: 'fa fa-clock-o', | ||
| date: 'fa fa-calendar', | ||
| up: 'fa fa-chevron-up', | ||
| down: 'fa fa-chevron-down', | ||
| previous: 'fa fa-chevron-left', | ||
| next: 'fa fa-chevron-right', | ||
| today: 'fa fa-check-circle-o', | ||
| clear: 'fa fa-trash', | ||
| close: 'fa fa-remove' | ||
| } | ||
| }); | ||
|
|
||
| // Bootstrap-tagsinput initialization | ||
| // http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ | ||
| var $input = $('input[data-toggle="tagsinput"]'); | ||
| if ($input.length) { | ||
| var source = new Bloodhound({ | ||
| local: $input.data('tags'), | ||
| queryTokenizer: Bloodhound.tokenizers.whitespace, | ||
| datumTokenizer: Bloodhound.tokenizers.whitespace | ||
| }); | ||
| $input.tagsinput({ | ||
| trimValue: true, | ||
| focusClass: 'focus', | ||
| typeahead: { | ||
| name: 'tags', | ||
| source: source | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| // Handling the modal confirmation message. | ||
| $(document).on('submit', 'form[data-confirmation]', function (event) { | ||
| var $form = $(this), | ||
| $confirm = $('#confirmationModal'); | ||
|
|
||
| if ($confirm.data('result') !== 'yes') { | ||
| //cancel submit event | ||
| event.preventDefault(); | ||
|
|
||
| $confirm | ||
| .off('click', '#btnYes') | ||
| .on('click', '#btnYes', function () { | ||
| $confirm.data('result', 'yes'); | ||
| $form.find('input[type="submit"]').attr('disabled', 'disabled'); | ||
| $form.submit(); | ||
| }) | ||
| .modal('show'); | ||
| } | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| var $ = require('jquery'); | ||
| window.$ = $; | ||
| window.jQuery = $; | ||
|
||
|
|
||
| require('bootstrap-sass/assets/javascripts/bootstrap/dropdown.js'); | ||
| require('bootstrap-sass/assets/javascripts/bootstrap/modal.js'); | ||
| require('bootstrap-sass/assets/javascripts/bootstrap/transition.js'); | ||
|
|
||
| var hljs = require('highlight.js'); | ||
| hljs.registerLanguage('php', require('highlight.js/lib/languages/php')); | ||
| hljs.registerLanguage('twig', require('highlight.js/lib/languages/twig')); | ||
| window.hljs = hljs; | ||
|
||
| hljs.initHighlightingOnLoad(); | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| @import "~bootswatch/flatly/variables"; | ||
| @import "~eonasdan-bootstrap-datetimepicker/src/sass/bootstrap-datetimepicker-build.scss"; | ||
| @import "~bootstrap-tagsinput/src/bootstrap-tagsinput.css"; | ||
|
||
|
|
||
| /* Page: 'Backend post index' | ||
| ------------------------------------------------------------------------- */ | ||
| body#admin_post_index .item-actions { | ||
| white-space: nowrap | ||
| } | ||
|
|
||
| body#admin_post_index .item-actions a.btn + a.btn { | ||
| margin-left: 4px | ||
| } | ||
|
|
||
| /* Page: 'Backend post show' | ||
| ------------------------------------------------------------------------- */ | ||
| body#admin_post_show .post-tags .label-default { | ||
| background-color: #e9ecec; | ||
| color: #6D8283; | ||
| font-size: 16px; | ||
| margin-right: 10px; | ||
| padding: .4em 1em .5em; | ||
| } | ||
| body#admin_post_show .post-tags .label-default i { | ||
| color: #95A6A7; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this rule about ? AFAIK, it does not do anything, as the folder is not excluded before (
/build/does not match it AFAIK, unlikebuild/would do)