devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From re...@apache.org
Subject svn commit: r1694220 - in /devicemap/trunk/clients/2.0/javascript: ./ devicemap.js index.html
Date Wed, 05 Aug 2015 14:03:12 GMT
Author: rezan
Date: Wed Aug  5 14:03:12 2015
New Revision: 1694220

URL: http://svn.apache.org/r1694220
Log:
base

Modified:
    devicemap/trunk/clients/2.0/javascript/   (props changed)
    devicemap/trunk/clients/2.0/javascript/devicemap.js
    devicemap/trunk/clients/2.0/javascript/index.html

Propchange: devicemap/trunk/clients/2.0/javascript/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Aug  5 14:03:12 2015
@@ -0,0 +1 @@
+nbproject

Modified: devicemap/trunk/clients/2.0/javascript/devicemap.js
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/javascript/devicemap.js?rev=1694220&r1=1694219&r2=1694220&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/javascript/devicemap.js (original)
+++ devicemap/trunk/clients/2.0/javascript/devicemap.js Wed Aug  5 14:03:12 2015
@@ -1,3 +1,13 @@
 var devicemap = devicemap || {};
 
 devicemap.version = "2.0.0";
+devicemap.debugLevel = devicemap.debugLevel || 2;
+
+devicemap.debug = devicemap.debug || function(level, s) {
+  if(level <= devicemap.debugLevel) {
+    var params = Array.prototype.slice.call(arguments, 1);
+    console.log.apply(console, params);
+  }
+};
+
+devicemap.debug(1, "DeviceMap Javascript Client", devicemap.version);

Modified: devicemap/trunk/clients/2.0/javascript/index.html
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/javascript/index.html?rev=1694220&r1=1694219&r2=1694220&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/javascript/index.html (original)
+++ devicemap/trunk/clients/2.0/javascript/index.html Wed Aug  5 14:03:12 2015
@@ -1,10 +1,40 @@
 <html>
 <head>
   <title>Apache DeviceMap</title>
-  <script src="devicemap.js"></script>
-  <script src="devicemaptest.js"></script>
 </head>
 <body>
-Apache DeviceMap 2.0 Javascript Client
+  <h1>Apache DeviceMap 2.0 Javascript Client</h1>
+  <div class="out">
+    <textarea id="out" rows="6" cols="80" disabled></textarea>
+  </div>
+  <script>
+    if(document.body.clientWidth < 800) {
+      document.getElementById('out').cols = Math.floor(((document.body.clientWidth - 40)
/ 8));
+    }
+
+    var devicemap = devicemap || {};
+
+    devicemap.debug = function(level, s) {
+      if(level <= devicemap.debugLevel) {
+        var params = Array.prototype.slice.call(arguments, 1);
+        console.log.apply(console, params);
+        
+        var out = document.getElementById('out');
+        var line = out.value ? '\n' : '';
+        
+        for(var i = 1; i < arguments.length; i++) {
+          if(i > 1) {
+            line += ' ';
+          }
+          line += arguments[i];
+        }
+        
+        out.value += line;
+        out.scrollTop = out.scrollHeight;
+      }
+    };
+  </script>
+  <script src="devicemap.js"></script>
+  <script src="devicemaptest.js"></script>
 </body>
 </html>



Mime
View raw message