summaryrefslogtreecommitdiffstats
path: root/webclients/novnc/include/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'webclients/novnc/include/util.js')
-rw-r--r--webclients/novnc/include/util.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/webclients/novnc/include/util.js b/webclients/novnc/include/util.js
index ddc1914..57ccb54 100644
--- a/webclients/novnc/include/util.js
+++ b/webclients/novnc/include/util.js
@@ -1,6 +1,6 @@
/*
* noVNC: HTML5 VNC client
- * Copyright (C) 2011 Joel Martin
+ * Copyright (C) 2012 Joel Martin
* Licensed under LGPL-3 (see LICENSE.txt)
*
* See README.md for usage and integration instructions.
@@ -57,6 +57,21 @@ if (!Array.prototype.map)
};
}
+//
+// requestAnimationFrame shim with setTimeout fallback
+//
+
+window.requestAnimFrame = (function(){
+ return window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function(callback){
+ window.setTimeout(callback, 1000 / 60);
+ };
+})();
+
/*
* ------------------------------------------------------
* Namespaced in Util
@@ -131,6 +146,8 @@ Util.conf_default = function(cfg, api, defaults, v, mode, type, defval, desc) {
}
} else if (type in {'integer':1, 'int':1}) {
val = parseInt(val, 10);
+ } else if (type === 'str') {
+ val = String(val);
} else if (type === 'func') {
if (!val) {
val = function () {};