Initial approach to a widget based plugin system
Change-Id: I8ad07c817248a0d205ec9eb66f0dc579fbcd7160
diff --git a/dev/demo/plugin-client.html b/dev/demo/plugin-client.html
new file mode 100644
index 0000000..e06b38f
--- /dev/null
+++ b/dev/demo/plugin-client.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Plugin demo</title>
+ <link type="text/css" rel="stylesheet" href="/css/kalamar.css" />
+
+ <!-- load client javascript library -->
+ <script src="/js/src/plugin/client.js"></script>
+ </head>
+ <body>
+ <h2>Example Widget!</h2>
+ <a onclick="KorAPlugin.log(333, 'Huhu!')">Send log!</a>
+ </body>
+</html>
diff --git a/dev/demo/plugin-server.html b/dev/demo/plugin-server.html
new file mode 100644
index 0000000..f513b46
--- /dev/null
+++ b/dev/demo/plugin-server.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Plugin demo</title>
+ <link type="text/css" rel="stylesheet" href="/css/kalamar.css" />
+ <script data-main="/demo/plugin-serverdemo.js" src="/js/lib/require.js" async="async"></script>
+ </head>
+ <body>
+ <p>Start the demo server with <code>morbo -l 'http://*:3003' t/plugin-server.pl</code> and open <a href="http://localhost:3003/demo/plugin-server.html"><code>this website</code></a>.</p>
+ <main>
+ <div id="container"></div>
+ </main>
+ </body>
+</html>
diff --git a/dev/demo/plugin-serverdemo.js b/dev/demo/plugin-serverdemo.js
new file mode 100644
index 0000000..d1e6e20
--- /dev/null
+++ b/dev/demo/plugin-serverdemo.js
@@ -0,0 +1,16 @@
+requirejs.config({
+ baseUrl: '/js/src',
+ paths : {
+ 'lib': '../lib'
+ }
+});
+
+define(['app/en','plugin/server','lib/domReady','init','hint/foundries/cnx'], function (lang, pluginClass, domReady) {
+ domReady(function () {
+ console.log("Los geht's");
+ var p = pluginClass.create();
+
+ // Open widget!
+ p.addWidget(document.getElementById('container'), 'http://localhost:3003/demo/plugin-client.html');
+ });
+});