diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 16:49:36 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-28 16:49:36 +0000 |
commit | a7a8f4f9c9bbbd3bd16605235440dec29f581ad7 (patch) | |
tree | f01ccb8694da3d6207302a09eac725094b243d3f /sca-cpp/trunk/modules/js/htdocs/util.js | |
parent | 7519724a171bb85246bb86bce453cbdd408691d9 (diff) |
Improvements to the hosted composite management app. Simplify and optimize the Web UI a bit. Add test cases and fix some of the logic in the management components.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343316 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/util.js | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js index 677132d2a8..0f7de94289 100644 --- a/sca-cpp/trunk/modules/js/htdocs/util.js +++ b/sca-cpp/trunk/modules/js/htdocs/util.js @@ -170,11 +170,11 @@ function tokens(path) { } /** - * Log a value. + * Debug log a value. */ var rconsole; -function log(v) { +function debug(v) { try { var s = ''; for (i = 0; i < arguments.length; i++) { @@ -196,13 +196,13 @@ function log(v) { } /** - * Dump an object to the debug console. + * Dump an object to the console. */ -function debug(o) { +function dump(o) { try { for (f in o) { try { - log('debug ' + f + '=' + o[f]); + debug('dump ' + f + '=' + o[f]); } catch (e) {} } } catch (e) {} @@ -302,6 +302,51 @@ function unmemo(obj) { } /** + * Local storage. + */ +var lstorage = {}; +lstorage.enabled = true; + +/** + * Get an item. + */ +lstorage.getItem = function(k) { + if (!lstorage.enabled) + return null; + try { + return localStorage.getItem(k); + } catch(e) { + return null; + } +} + +/** + * Set an item. + */ +lstorage.setItem = function(k, v) { + if (!lstorage.enabled) + return null; + try { + return localStorage.setItem(k, v); + } catch(e) { + return null; + } +} + +/** + * Remove an item. + */ +lstorage.removeItem = function(k) { + if (!lstorage.enabled) + return null; + try { + return localStorage.removeItem(k); + } catch(e) { + return null; + } +} + +/** * Returns a list of the properties of an object. */ function properties(o) { |