Hi,

about http://jira.xwiki.org/browse/XWIKI-13470

I can use https://silviomoreto.github.io/bootstrap-select/ JS if I copy js 
content in a JSX object between this stuff:
require(['jquery'], function ($) {
});

To PullRequesting I need to writing cleaner code: I mean "use RequireJS and 
WebJars API to load and use the bootstrap-select widget"

Then I copied bootstrap-select JAR to WEB-INF/lib and add add this 2 lines in 
./skins/flamingo/javascript.vm:
(bootstrap-select requires jQuery v1.8.0+, Bootstrap’s dropdown.js component, 
and Bootstrap's CSS.)
------------------------------
require.config({
  paths: {
    'jquery': '#removeJsSuffix($services.webjars.url("jquery", 
"jquery${jsExtension}"))',
    'bootstrap': '#removeJsSuffix($services.webjars.url("bootstrap", 
"js/bootstrap${jsExtension}"))',
    'bootstrap-select': 
'#removeJsSuffix($services.webjars.url("bootstrap-select/1.10.0/js/bootstrap-select.js"))',

<cut>
 shim: {
    'bootstrap' : ['jquery'],
    'bootstrap-select' : ['jquery'],
(or 'bootstrap-select' : ['jquery', 'bootstrap'],
<cut>

I tested with minify version too with
shim: {
    'bootstrap' : ['jquery'],
    'bootstrap-select': {
      deps: ['jquery', 'bootstrap'],
      exports: 'bootstrap-select'
      },
http://requirejs.org/docs/api.html#config-shim
------------------------------

Unfortunaly when I use the webjar with this config, bootstrap-select doesn't 
work.

Do I miss something? 

(Source Page generated contain:
'bootstrap-select': 
'/xwiki/webjars/wiki%3Axwiki/bootstrap-select/1.10.0/js/bootstrap-select.js?r=1',
and my browser can read bootstrap-select.js content at this URL.)


(I tried to enables this too:

pluginsToDisable = ['collapse', 'dropdown', 'modal', 'tooltip', 'tab', 
'popover'] => pluginsToDisable = ['collapse',  'modal', 'tooltip', 'tab', 
'popover'] 

Any help are welcome.
Thxs


Pascal B
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to