Changeset 181:72ac6d762718
- Timestamp:
- 08/31/08 20:14:37 (2 years ago)
- Author:
- rgrp
- Branch:
- default
- convert_revision:
- svn:10edda23-d834-0410-9182-b00384516d49/trunk@193
- Message:
-
[js][s]: stub console object when it does not exist so that js works even when firebug is not running.
- Location:
- microfacts/public/behaviour
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r169
|
r181
|
|
| 27 | 27 | |
| 28 | 28 | if (Environment != "test") { |
| | 29 | // stub a console if it does not exist (so work if firebug is not available) |
| | 30 | if (!console) { |
| | 31 | var console = { |
| | 32 | 'log': function() { |
| | 33 | }, |
| | 34 | 'error': function() { |
| | 35 | } |
| | 36 | }; |
| | 37 | } |
| 29 | 38 | window.addEvent('domready', function () { |
| 30 | 39 | new GeochronoPageController(document); |
| 31 | 40 | }); |
| 32 | 41 | } |
| | 42 | |
| | 43 | // setupPageController(GeochronoPageController); |
-
|
r176
|
r181
|
|
| 139 | 139 | }); |
| 140 | 140 | |
| | 141 | var setupPageController = function(controllerClass) { |
| | 142 | if (Environment != "test") { |
| | 143 | // define a non-functional console function for when firebug is not available |
| | 144 | if (!console) { |
| | 145 | var console = { |
| | 146 | 'log': function() { |
| | 147 | }, |
| | 148 | 'error': function() { |
| | 149 | } |
| | 150 | }; |
| | 151 | } |
| | 152 | window.addEvent('domready', function () { |
| | 153 | new controllerClass(document); |
| | 154 | }); |
| | 155 | } |
| | 156 | }; |