2024-10-02 23:45:29 +00:00
|
|
|
import $ from 'jquery'
|
|
|
|
import 'jquery.shorten/src/jquery.shorten.min.js'
|
2024-09-17 21:42:05 +00:00
|
|
|
|
|
|
|
// We ship jquery-ui with jquery because when standalone with webpack
|
|
|
|
// JQuery is also included in the jquery-ui package. We do gain space by doing this
|
|
|
|
// We require jquery-ui components manually and not in a loop
|
|
|
|
// Otherwise it increases the output files by a x2 factor !
|
2024-10-02 23:45:29 +00:00
|
|
|
require('jquery-ui/ui/widgets/accordion.js')
|
|
|
|
require('jquery-ui/ui/widgets/autocomplete.js')
|
|
|
|
require('jquery-ui/ui/widgets/button.js')
|
|
|
|
require('jquery-ui/ui/widgets/dialog.js')
|
|
|
|
require('jquery-ui/ui/widgets/tabs.js')
|
2024-09-17 21:42:05 +00:00
|
|
|
|
2024-10-02 23:45:29 +00:00
|
|
|
require('jquery-ui/themes/base/all.css')
|
2024-09-17 21:42:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Simple wrapper to solve shorten not being able on legacy pages
|
|
|
|
* @param {string} selector to be passed to jQuery
|
|
|
|
* @param {Object} options object to pass to the shorten function
|
|
|
|
**/
|
2024-10-02 23:45:29 +00:00
|
|
|
export function shorten (selector, options) {
|
|
|
|
$(selector).shorten(options)
|
2024-09-17 21:42:05 +00:00
|
|
|
}
|
|
|
|
|
2024-10-02 23:45:29 +00:00
|
|
|
window.shorten = shorten
|