1

I am trying to use a custom Aikau widget to load some css and javascripts:

/**
 *
 * @module /JQueryPlugins
 * @extends dijit/_WidgetBase
 * @mixes module:alfresco/core/Core
 * @mixes module:alfresco/core/CoreWidgetProcessing
 */
define(["dojo/_base/declare",
        "dijit/_WidgetBase", 
        "alfresco/core/Core",
        "alfresco/core/CoreWidgetProcessing",
        "jquery",
        "jqueryui",
        "jquery-chosen",
        "custom-namespace",
        "custom-global",
        ], 
        function(declare, _WidgetBase, AlfCore, CoreWidgetProcessing, $) {
    console.log("initialising");
    return declare([_WidgetBase, AlfCore, CoreWidgetProcessing, $], {
      cssRequirements: [
          { cssFile: "./css/chosen.css" }
      ]
    });
});

The packages jquery-chosen, custom-namespace and custom-global are defined in a share extension module:

<module>
    <id>jQuery Plugins</id>
    <version>1.0</version>
    <auto-deploy>true</auto-deploy>
    <configurations>
        <config evaluator="string-compare" condition="WebFramework" replace="false">
            <web-framework>
                <dojo-pages>
                    <packages>
                        <package name="jquery-chosen" location="js/aikau/custom/jquery/chosen" main="chosen.jquery"/>
                        <package name="custom-namespace" location="js" main="custom-namespace"/>
                        <package name="custom-global" location="js" main="custom-global"/>
                    </packages>
                </dojo-pages>
            </web-framework>
        </config>
    </configurations>
</module>

The javascripts are loaded as expected and the jquery plugin "chosen" works, but its css is not loaded.

Given that this cssRequeriments import is used often in the aikau code, I am sure that it works, but I cannot see what is wrong in my code.

Do you see anything wrong ?

I was also trying to investigate why the css requirements is ignored looking the aikau source code, but I do not find there where the inclusion of the cssRequirements is implemented. Can someone tell me where to look?

Marco Altieri
  • 3,726
  • 2
  • 33
  • 47

1 Answers1

1

File Structure of Aikau widget

Aikau widget file structure should be same as defined in image

Sanjay
  • 2,481
  • 1
  • 13
  • 28