diff options
Diffstat (limited to 'java/sca/modules/domain-manager/src/main/resources/utils.js')
-rw-r--r-- | java/sca/modules/domain-manager/src/main/resources/utils.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/java/sca/modules/domain-manager/src/main/resources/utils.js b/java/sca/modules/domain-manager/src/main/resources/utils.js index c382ab9e5a..611aaceadc 100644 --- a/java/sca/modules/domain-manager/src/main/resources/utils.js +++ b/java/sca/modules/domain-manager/src/main/resources/utils.js @@ -184,3 +184,33 @@ function array(obj) { return a; } } + +/** + * Utility function thats dumps a Javascript object to the console + */ +function dump(o) { + for (f in o) { + try { + console.log(f + '=' + o[f]); + } catch (e) {} + } +} + +function content(win) { + if (win.document != 'undefined' && win.document != null) { + return win.document; + } else if (win.contentDocument != 'undefined' && win.contentDocument != null) { + return win.contentDocument; + } else { + return null; + } +} + +function gadget(win, doc) { + if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') { + return win.parent.ongadget(win, doc); + } else { + return doc; + } +} +
\ No newline at end of file |