incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [2/3] git commit: override console object for browsers that do not have it built in
Date Thu, 29 May 2014 11:37:23 GMT
override console object for browsers that do not have it built in

Signed-off-by: Chris Rohr <crohr@nearinfinity.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/748ef4d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/748ef4d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/748ef4d1

Branch: refs/heads/console-v2
Commit: 748ef4d1822c5c8dc9584c5550b4b5df3c0cea1a
Parents: ba22835
Author: Andrew Avenoso <andrew.va@gmail.com>
Authored: Wed May 28 16:25:42 2014 -0400
Committer: Chris Rohr <crohr@nearinfinity.com>
Committed: Thu May 29 07:21:32 2014 -0400

----------------------------------------------------------------------
 contrib/blur-console/src/main/webapp/index.html |  2 +-
 .../src/main/webapp/js/blurconsole.overrides.js | 23 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/748ef4d1/contrib/blur-console/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/index.html b/contrib/blur-console/src/main/webapp/index.html
index 455671a..437a0c4 100644
--- a/contrib/blur-console/src/main/webapp/index.html
+++ b/contrib/blur-console/src/main/webapp/index.html
@@ -60,7 +60,7 @@ under the License.
             </ul>
         </nav>
         <div id="blurconsole"></div>
-
+        <script src="js/blurconsole.overrides.js"></script>
         <script src="libs/jquery/dist/jquery.js"></script>
         <script src="js/utils/jquery.uriAnchor.js"></script>
         <script src="js/utils/jquery.event.gevent.js"></script>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/748ef4d1/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js b/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js
new file mode 100644
index 0000000..55cf3ba
--- /dev/null
+++ b/contrib/blur-console/src/main/webapp/js/blurconsole.overrides.js
@@ -0,0 +1,23 @@
+alert(typeof console)
+if (typeof console == 'undefined') {
+  console = {
+    log: function() {
+      if(typeof blurconsole != 'undefined' && typeof blurconsole.model != 'undefined'
&& typeof blurconsole.model.logs != 'undefined') {
+        var args = Array.prototype.slice.call(arguments);
+        blurconsole.model.logs.logError(args.join(' '), 'javascript');
+      }
+    },
+    info: function() {
+      return console.log.apply(null, arguments);
+    },
+    warn: function() {
+      return console.log.apply(null, arguments);
+    },
+    error: function() {
+      return console.log.apply(null, arguments);
+    },
+    debug: function() {
+      return console.log.apply(null, arguments);
+    }
+  }
+}
\ No newline at end of file


Mime
View raw message