You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2022/04/14 15:20:57 UTC

Javascript module can't access css / image urls

Hi, I upgraded to Tapestry 5.8.1 and I moved all my js, css and modules to
the webapp directory. I have a ckeditor module that is trying to load some
ckeditor css and image files. In older versions of tapestry I resolved this
with ClasspathAssetAliasManager, but that seems to be deprecated and no
longer functional. "configuration.add("ck", "META-INF/modules/vendor");".
My package structure is webapp/modules/editor.js
webapp/modules/vendor/ckeditor

My editor.js file looks like this.

requirejs.config({
    shim: {
        'ckeditor-jquery': ['jquery', 'ckeditor-core']
    },
    paths: {
        'ckeditor-core': 'vendor/ckeditor/ckeditor',
        'ckeditor-jquery': 'vendor/ckeditor/adapters/jquery'
    }
});
define(["jquery", "ckeditor-jquery"], function($) {

    init = function(spec) {
        $('#' + spec.id).ckeditor();
    };

    return init;
});

How is this achieved in 5.8?