Hello everyone, I tried to import the Konva <https://konvajs.github.io/docs/overview.html> library into my web activity (it is at least 500 ko unminified : is it a trouble ?) following the RequireJS shim section tutorial (I put it in the lib folder of my activity)
---------------------------- [ACTIVITY]/js/loader.js requirejs.config({ baseUrl: "lib", paths: { activity: "../js" }, shim: { 'konva': { exports: 'Konva' } } }); requirejs(["activity/activity"]); ----------------------------- [ACTIVITY]/js/activity.js define(["sugar-web/activity/activity"], function (activity) { // Manipulate the DOM only when it is ready. require(['domReady!'], function (doc) { // Initialize the activity. activity.setup(); var stage = new Konva.stage({ container: 'canvas', width: 200, height: 200 }); console.log(stage); var layer = new Konva.layer(); var circle = new Konva.circle({ x: stage.getWidth() / 2, y: stage.getHeight() / 2, radius: 70, fill: 'red', stroke: 'black', strokeWidth: 4 }); layer.add(circle); stage.add(layer); }); }); But I got Konva is undefined in my console.log() call. So, what did I misunderstood ? -- Regards, Laurent Bernabé laurent.bern...@gmail.com
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel