examples: usable with Crosswalk extension and web socket
authorPatrick Ohly <patrick.ohly@intel.com>
Fri, 20 Jun 2014 07:57:58 +0000 (09:57 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Mon, 30 Jun 2014 09:55:58 +0000 (11:55 +0200)
When the browser already provides the "cloudeebus" module, then the
examples do not need (and shouldn't) import the cloudeebus .js again,
because that would replace the browser extension implementation with
the web socket version.

doc/agent/client.html
doc/agent/server.html
doc/sample/cloudeebus.html

index 625d3a1..e7c5404 100644 (file)
@@ -1,8 +1,11 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <script src="../../lib/autobahn.min.js"></script>
-        <script src="../../cloudeebus/cloudeebus.js"></script>
+        <!-- Do not load autobahn or cloudeebus if already provided by Crosswalk browser extensions. -->
+        <script type="text/javascript">
+          typeof cloudeebus != 'undefined' ||
+          document.write(unescape('%3Cscript src=%27../../lib/autobahn.min.js%27%3E %3C/script%3E %3Cscript src=%27../../cloudeebus/cloudeebus.js%27%3E%3C/script%3E'));
+        </script>
         <script type="text/javascript">
                function evalScript() {
                        eval(
index 7952612..f410249 100644 (file)
@@ -1,8 +1,11 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <script src="../../lib/autobahn.min.js"></script>
-        <script src="../../cloudeebus/cloudeebus.js"></script>
+        <!-- Do not load autobahn or cloudeebus if already provided by Crosswalk browser extensions. -->
+        <!-- script type="text/javascript">
+          typeof cloudeebus != 'undefined' ||
+          document.write(unescape('%3Cscript src=%27../../lib/autobahn.min.js%27%3E %3C/script%3E %3Cscript src=%27../../cloudeebus/cloudeebus.js%27%3E%3C/script%3E'));
+        </script -->
         <script type="text/javascript">
                function evalScript(field) {
                        eval(
index b03391c..ab0983f 100644 (file)
@@ -1,8 +1,11 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <script src="../../lib/autobahn.min.js"></script>
-        <script src="../../cloudeebus/cloudeebus.js"></script>
+        <!-- Do not load autobahn or cloudeebus if already provided by Crosswalk browser extensions. -->
+        <script type="text/javascript">
+          typeof cloudeebus != 'undefined' ||
+          document.write(unescape('%3Cscript src=%27../../lib/autobahn.min.js%27%3E %3C/script%3E %3Cscript src=%27../../cloudeebus/cloudeebus.js%27%3E%3C/script%3E'));
+        </script>
         <script type="text/javascript">
                function evalScript() {
                        eval(