   'jquery.instructure_misc_plugins'
   'vendor/jquery.ba-tinypubsub'
   'jqueryui/button'
-], (I18n, $, _, hsvToRgb, calendarAppTemplate, EventDataSource, commonEventFactory, ShowEventDetailsDialog, EditEventDetailsDialog, Scheduler, calendarDefaults) ->
+], (I18n, $, _, userSettings, hsvToRgb, calendarAppTemplate, EventDataSource, commonEventFactory, ShowEventDetailsDialog, EditEventDetailsDialog, Scheduler, calendarDefaults) ->
 
   class Calendar
     constructor: (selector, @contexts, @manageContexts, @dataSource, @options) ->

  'i18n!calendar'
  'jquery'
  'underscore'
  'compiled/util/hsvToRgb'
  'jst/calendar/calendarApp'
  'compiled/calendar/EventDataSource'

        return

      # create a new dummy event
      allowedContexts = userSettings.get('checked_calendar_codes') or _.pluck(@contexts, 'asset_string')
      activeContexts  = _.filter @contexts, (c) -> _.contains(allowedContexts, c.asset_string)
      event = commonEventFactory(null, activeContexts)
      event.allDay = allDay
      event.date = date

