Changeset 182:39d1a7f22f60
- Timestamp:
- 08/31/08 21:06:04 (2 years ago)
- Author:
- rgrp
- Branch:
- default
- convert_revision:
- svn:10edda23-d834-0410-9182-b00384516d49/trunk@194
- Message:
-
[js/controllers][s]: fixes to get controllers working when 'console' not available.
- Location:
- microfacts/public/behaviour
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r181
|
r182
|
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | | // setupPageController(GeochronoPageController); |
| | 43 | // for some reason just does not work ... |
| | 44 | // BaseController.createPageController('GeochronoPageController'); |
-
|
r174
|
r182
|
|
| 93 | 93 | |
| 94 | 94 | if (Environment != "test") { |
| | 95 | // stub a console if it does not exist (so work if firebug is not available) |
| | 96 | if (!console) { |
| | 97 | var console = { |
| | 98 | 'log': function() { |
| | 99 | }, |
| | 100 | 'error': function() { |
| | 101 | } |
| | 102 | }; |
| | 103 | } |
| 95 | 104 | window.addEvent('domready', function () { |
| 96 | 105 | // using document as argument causes problems |
-
|
r169
|
r182
|
|
| 37 | 37 | // Substitute native 'show bubble' behaviour. |
| 38 | 38 | eventPainter = this.band.getEventPainter(); |
| | 39 | this._oldShowBubble = eventPainter._showBubble.bind(eventPainter); |
| 39 | 40 | eventPainter._showBubble = this.onEventSelect.bind(this); |
| 40 | 41 | }, |
| … |
… |
|
| 63 | 64 | }, |
| 64 | 65 | |
| | 66 | // underlying simile timeline handler |
| 65 | 67 | onEventSelect: function(x, y, timelineEvent) { |
| 66 | 68 | var factletObject = this.findFactletFromEvent(timelineEvent); |
| … |
… |
|
| 68 | 70 | this.log("factlet object:"); |
| 69 | 71 | this.log(factletObject); |
| 70 | | this.fireEvent('factletSelect', factletObject, x, y); |
| | 72 | this.fireEvent('factletSelect', factletObject, x, y, timelineEvent); |
| 71 | 73 | }, |
| 72 | 74 | |
| 73 | | onFactletSelect: function(factletObject, x, y) { |
| | 75 | onFactletSelect: function(factletObject, x, y, timelineEvent) { |
| 74 | 76 | this.log("TimelineView: saw factletSelect event"); |
| 75 | 77 | this.log("factlet object:"); |
-
|
r181
|
r182
|
|
| 3 | 3 | |
| 4 | 4 | log: function(message) { |
| 5 | | // console.log(message); |
| | 5 | console.log(message); |
| 6 | 6 | }, |
| 7 | 7 | |
| 8 | 8 | error: function(message) { |
| 9 | | // console.error(message); |
| | 9 | console.error(message); |
| 10 | 10 | } |
| 11 | 11 | |
| … |
… |
|
| 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 | | }; |
| | 141 | |
| | 142 | // for some reason just does not work ... |
| | 143 | BaseController.createPageController = function(controllerClassName) { |
| | 144 | if (Environment != "test") { |
| | 145 | // define a non-functional console function for when firebug is not available |
| | 146 | if (!console) { |
| | 147 | var console = { |
| | 148 | 'log': function() { |
| | 149 | }, |
| | 150 | 'error': function() { |
| | 151 | } |
| | 152 | }; |
| | 153 | } |
| | 154 | window.addEvent('domready', function () { |
| | 155 | eval("var constructor = " + controllerClassName); |
| | 156 | new constructor(document) |
| | 157 | }); |
| 151 | 158 | } |
| 152 | | window.addEvent('domready', function () { |
| 153 | | new controllerClass(document); |
| 154 | | }); |
| 155 | | } |
| 156 | 159 | }; |