cryptpad/www/common/requireconfig.js

36 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-08-07 14:27:57 +00:00
define([
'/api/config'
], function (ApiConfig) {
var out = {
// fix up locations so that relative urls work.
baseUrl: window.location.pathname,
2017-08-21 08:34:49 +00:00
paths: {
2019-01-30 13:38:21 +00:00
// json plugin
text: '/bower_components/requirejs-plugins/lib/text',
json: '/bower_components/requirejs-plugins/src/json',
optional: '/lib/optional/optional',
2017-08-07 14:27:57 +00:00
// jquery declares itself as literally "jquery" so it cannot be pulled by path :(
"jquery": "/bower_components/jquery/dist/jquery.min",
2021-11-19 12:00:51 +00:00
"mermaid": "/lib/mermaid/mermaid.min",
2017-08-07 14:27:57 +00:00
// json.sortify same
"json.sortify": "/bower_components/json.sortify/dist/JSON.sortify",
2021-04-02 11:44:28 +00:00
cm: '/bower_components/codemirror',
'tui-code-snippet': '/lib/calendar/tui-code-snippet.min',
'tui-date-picker': '/lib/calendar/date-picker',
'netflux-client': '/bower_components/netflux-websocket/netflux-client',
'chainpad-netflux': '/bower_components/chainpad-netflux/chainpad-netflux',
'chainpad-listmap': '/bower_components/chainpad-listmap/chainpad-listmap',
2017-08-07 14:27:57 +00:00
},
map: {
'*': {
'css': '/bower_components/require-css/css.js',
'less': '/common/RequireLess.js',
}
}
};
Object.keys(ApiConfig.requireConf).forEach(function (k) { out[k] = ApiConfig.requireConf[k]; });
2017-08-22 13:50:10 +00:00
return function () {
return JSON.parse(JSON.stringify(out));
};
2017-08-07 14:27:57 +00:00
});