Changeset 181:72ac6d762718

Show
Ignore:
Timestamp:
08/31/08 20:14:37 (19 months 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:
2 modified

Legend:

Unmodified
Added
Removed
  • microfacts/public/behaviour/app/controllers/geochronopage_controller.js

    r169 r181  
    2727 
    2828if (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    } 
    2938    window.addEvent('domready', function () { 
    3039        new GeochronoPageController(document); 
    3140    }); 
    3241} 
     42 
     43// setupPageController(GeochronoPageController); 
  • microfacts/public/behaviour/lib/moovc.js

    r176 r181  
    139139}); 
    140140 
     141var setupPageController = function(controllerClass) { 
     142if (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};