Skip to content

Commit

Permalink
treesame commit of origin/stable/2016-08-27
Browse files Browse the repository at this point in the history
Treesame-Commit-Id: 0424e7a
  • Loading branch information
mcwqy9 committed Aug 27, 2016
3 parents ac20d40 + 0424e7a + f857e16 commit 2f7557f
Show file tree
Hide file tree
Showing 510 changed files with 19,390 additions and 12,786 deletions.
4 changes: 2 additions & 2 deletions .fontcustom-manifest.json
@@ -1,7 +1,7 @@
{
"checksum": {
"previous": "72e85d758fd8bd6ee724d67cc1497748aa0fcde2e2c06ca5fd15bc5fd37a60c1",
"current": "72e85d758fd8bd6ee724d67cc1497748aa0fcde2e2c06ca5fd15bc5fd37a60c1"
"previous": "7f2a69615c29c0381ac9f641bb58f24f753d87d7b0feb9dde9148cf4f180abb4",
"current": "7f2a69615c29c0381ac9f641bb58f24f753d87d7b0feb9dde9148cf4f180abb4"
},
"fonts": [
"public/fonts/canvas/canvas-icons.ttf",
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.d/app.rb
Expand Up @@ -7,7 +7,7 @@
gem 'tzinfo', '0.3.43'
gem 'foreigner', '0.9.2'
else
gem 'rails', '4.2.6'
gem 'rails', '4.2.7.1'
gem 'rack', '1.6.4'
gem 'builder', '3.1.4'
gem 'protected_attributes', '1.1.3'
Expand All @@ -25,7 +25,7 @@
gem 'active_model-better_errors', '1.6.7', require: 'active_model/better_errors'
gem 'dynamic_form', '1.1.4', require: false
gem 'rails-patch-json-encode', '0.0.1'
gem 'switchman', '1.5.13'
gem 'switchman', '1.5.18'
gem 'folio-pagination', '0.0.11', require: 'folio/rails'
# for folio, see the folio README
gem 'will_paginate', '3.0.7', require: false
Expand Down Expand Up @@ -56,7 +56,7 @@
gem 'icalendar', '1.5.4', require: false
gem 'ims-lti', '2.1.0.beta.3', require: 'ims'
gem 'json', '1.8.2'
gem 'oj', '2.14.1'
gem 'oj', '2.17.1'
gem 'jwt', '1.2.1', require: false
gem 'json-jwt', '1.5.1', require: false
gem 'twilio-ruby', '4.2.1'
Expand Down
37 changes: 24 additions & 13 deletions app/coffeescripts/behaviors/SyllabusBehaviors.coffee
Expand Up @@ -44,11 +44,19 @@ define [
if !$mini_month or !$syllabus
return

$mini_month.find('.day.has_event').removeClass 'has_event'
events = $mini_month.find('.day.has_event')
events.removeClass 'has_event'
wrapper = events.find('.day_wrapper')
wrapper.removeAttr 'role'
wrapper.removeAttr 'tabindex'

$syllabus.find('tr.date:visible').each ->
date = $(this).find('.day_date').attr('data-date')
$mini_month.find("#mini_day_#{date}").addClass 'has_event'
events = $mini_month.find("#mini_day_#{date}")
events.addClass 'has_event'
wrapper = events.find('.day_wrapper')
wrapper.attr 'role', 'link'
wrapper.attr 'tabindex', '0'

# Sets highlighting on a given date
# Removes all highlighting then highlights the given
Expand Down Expand Up @@ -116,7 +124,7 @@ define [
todayString = $.datepicker.formatDate 'yy_mm_dd', new Date
highlightDate todayString

selectRow = ($row, e) ->
selectRow = ($row) ->
if $row.length > 0
$('tr.selected').removeClass('selected')
$row.addClass('selected')
Expand All @@ -132,26 +140,29 @@ define [
$mini_month = $('.mini_month')

prev_next_links = $mini_month.find('.next_month_link, .prev_month_link')
prev_next_links.on 'click', false
prev_next_links.on 'mousedown', (ev) ->
prev_next_links.on 'click', (ev) ->
ev.preventDefault()
calendarMonths.changeMonth $mini_month, if $(this).hasClass('next_month_link') then 1 else -1
highlightDaysWithEvents()

$mini_month.on 'click', '.mini_calendar_day', (ev) ->
miniCalendarDayClick = (ev) ->
ev.preventDefault()
date = this.id.slice(9)
date = $(ev.target).closest('.mini_calendar_day')[0].id.slice(9)
[year, month, day] = date.split('_')

calendarMonths.changeMonth $mini_month, "#{month}/#{day}/#{year}"
highlightDaysWithEvents()
selectDate(date)

$(".events_#{date}").ifExists ($events) ->
selectRow($events, ev)
setTimeout (=> selectRow($events)), 0 # focus race condition hack. why do you do this to me, IE?

$mini_month.on 'keypress', '.day_wrapper', (ev) ->
if ev.which == 13 || ev.which == 32
miniCalendarDayClick(ev)

$mini_month.on 'click', '.day_wrapper', miniCalendarDayClick

$mini_month.on 'mouseover mouseout', '.mini_calendar_day', (ev) ->
date = this.id.slice(9) unless ev.type == 'mouseout'
$mini_month.on 'focus blur mouseover mouseout', '.day_wrapper', (ev) ->
date = $(ev.target).closest('.mini_calendar_day')[0].id.slice(9) unless ev.type == 'mouseout' or ev.type == 'blur'
highlightDate date

$('.jump_to_today_link').on 'click', (ev) ->
Expand All @@ -168,7 +179,7 @@ define [

$lastBefore ||= $('tr.date:first')
selectDate(todayString)
selectRow($lastBefore, ev)
selectRow($lastBefore)

# Binds to edit syllabus dom events
bindToEditSyllabus = ->
Expand Down
Expand Up @@ -21,7 +21,7 @@ require [
options =
permissions: ENV.PERMISSIONS,
accountId: ENV.ACCOUNT_ID.toString()
roles: ENV.ALL_ROLES
roles: ENV.COURSE_ROLES
addUserUrls: ENV.URLS
store: store

Expand Down
17 changes: 14 additions & 3 deletions app/coffeescripts/bundles/account_settings.coffee
@@ -1,7 +1,18 @@
require [
'compiled/views/feature_flags/FeatureFlagAdminView'
'account_settings'
'react',
'react-dom',
'compiled/views/feature_flags/FeatureFlagAdminView',
'jsx/custom_help_link_settings/CustomHelpLinkSettings',
'account_settings',
'compiled/bundles/modules/account_quota_settings'
], (FeatureFlagAdminView) ->
], (React, ReactDOM, FeatureFlagAdminView, CustomHelpLinkSettings) ->
featureFlags = new FeatureFlagAdminView(el: '#tab-features')
featureFlags.collection.fetchAll()

if document.getElementById('custom_help_link_settings')
ReactDOM.render(React.createElement(CustomHelpLinkSettings, {
name: window.ENV.help_link_name,
icon: window.ENV.help_link_icon,
links: window.ENV.CUSTOM_HELP_LINKS,
defaultLinks: window.ENV.DEFAULT_HELP_LINKS
}), document.getElementById('custom_help_link_settings'))
2 changes: 1 addition & 1 deletion app/coffeescripts/bundles/conferences.coffee
Expand Up @@ -80,7 +80,7 @@ require [

if conference.get('permissions').update
@editConferenceId = conference.get('id')
@editView.show(conference)
@editView.show(conference, isEditing: true)
else
# reached when a user without edit permissions navigates
# to a specific conference's url directly
Expand Down
3 changes: 2 additions & 1 deletion app/coffeescripts/bundles/course_settings.coffee
Expand Up @@ -30,6 +30,7 @@ require [
React.render(
React.createElement(CourseImageSelector, {
store: courseImageStore,
name: "course[image]"
name: "course[image]",
courseId: window.ENV.COURSE_ID
}), $('.CourseImageSelector__Container')[0]
)
5 changes: 3 additions & 2 deletions app/coffeescripts/bundles/discussion.coffee
Expand Up @@ -9,6 +9,7 @@ require [
'underscore'
'Backbone'
'react'
'react-dom'
'jsx/discussion_topics/DiscussionTopicKeyboardShortcutModal'
'compiled/models/Entry'
'compiled/models/Topic'
Expand All @@ -20,7 +21,7 @@ require [
'rubricEditBinding' # sets up event listener for 'rubricEditDataReady'
'compiled/jquery/sticky'
'compiled/jquery/ModuleSequenceFooter'
], (I18n, EntryView, DiscussionFilterState, DiscussionToolbarView, DiscussionFilterResultsView, MarkAsReadWatcher, $, _, Backbone, React, DiscussionTopicKeyboardShortcutModal, Entry, MaterializedDiscussionTopic, SideCommentDiscussionTopic, EntryCollection, DiscussionTopicToolbarView, TopicView, EntriesView) ->
], (I18n, EntryView, DiscussionFilterState, DiscussionToolbarView, DiscussionFilterResultsView, MarkAsReadWatcher, $, _, Backbone, React, ReactDOM, DiscussionTopicKeyboardShortcutModal, Entry, MaterializedDiscussionTopic, SideCommentDiscussionTopic, EntryCollection, DiscussionTopicToolbarView, TopicView, EntriesView) ->

descendants = 5
children = 10
Expand All @@ -40,7 +41,7 @@ require [

discussionTopicToolbarView = new DiscussionTopicToolbarView(el: '#discussion-managebar')

React.render(
ReactDOM.render(
React.createElement(DiscussionTopicKeyboardShortcutModal),
document.getElementById('keyboard-shortcut-modal')
)
Expand Down
18 changes: 11 additions & 7 deletions app/coffeescripts/calendar/Calendar.coffee
Expand Up @@ -174,6 +174,7 @@ define [

# FullCalendar callbacks
getEvents: (start, end, timezone, donecb, datacb) =>
@gettingEvents = true
@dataSource.getEvents start, end, @visibleContextList, (events) =>
if @displayAppointmentEvents
@dataSource.getEventsForAppointmentGroup @displayAppointmentEvents, (aEvents) =>
Expand All @@ -185,8 +186,10 @@ define [
event.removeClass('current-appointment-group')
for event in aEvents
event.addClass('current-appointment-group')
@gettingEvents = false
donecb(calendarEventFilter(@displayAppointmentEvents, events.concat(aEvents)))
else
@gettingEvents = false
if (datacb?)
donecb([])
else
Expand Down Expand Up @@ -246,7 +249,7 @@ define [
.find('.ui-resizable-handle').remove()
if event.eventType.match(/assignment/) && event.isDueAtMidnight() && view.name == "month"
element.find('.fc-time').empty()
if event.eventType == 'calendar_event' && @options?.activateEvent && event.id == "calendar_event_#{@options?.activateEvent}"
if event.eventType == 'calendar_event' && @options?.activateEvent && !@gettingEvents && event.id == "calendar_event_#{@options?.activateEvent}"
@options.activateEvent = null
@eventClick event,
# fake up the jsEvent
Expand Down Expand Up @@ -295,22 +298,25 @@ define [
eventResize: ( event, delta, revertFunc, jsEvent, ui, view ) =>
event.saveDates(null, revertFunc)

activeContexts: () ->
allowedContexts = userSettings.get('checked_calendar_codes') or _.pluck(@contexts, 'asset_string')
_.filter @contexts, (c) -> _.contains(allowedContexts, c.asset_string)

addEventClick: (event, jsEvent, view) =>
if @displayAppointmentEvents
# Don't allow new event creation while in scheduler mode
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 = commonEventFactory(null, @activeContexts())
event.date = @getCurrentDate()

new EditEventDetailsDialog(event).show()

eventClick: (event, jsEvent, view) =>
$event = $(jsEvent.currentTarget)
if !$event.hasClass('event_pending')
event.allPossibleContexts = @activeContexts() if event.can_change_context
detailsDialog = new ShowEventDetailsDialog(event)
$event.data('showEventDetailsDialog', detailsDialog)
detailsDialog.show jsEvent
Expand All @@ -321,9 +327,7 @@ define [
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 = commonEventFactory(null, @activeContexts())
event.date = date
event.allDay = not date.hasTime()
(new EditEventDetailsDialog(event)).show()
Expand Down
16 changes: 14 additions & 2 deletions app/coffeescripts/calendar/EditCalendarEventDetails.coffee
Expand Up @@ -32,9 +32,15 @@ define [
@$form.find("#duplicate_event").change @duplicateCheckboxChanged
@$form.find("select.context_id").triggerHandler('change', false)

# Context can't be changed, and duplication only works on create
# show context select if the event allows moving between calendars
if @event.can_change_context
@setContext(@event.object.context_code) unless @event.isNewEvent()
else
@$form.find(".context_select").hide()

# duplication only works on create
unless @event.isNewEvent()
@$form.find(".context_select, .duplicate_event_row, .duplicate_event_toggle_row").hide()
@$form.find(".duplicate_event_row, .duplicate_event_toggle_row").hide()

contextInfoForCode: (code) ->
for context in @event.possibleContexts()
Expand Down Expand Up @@ -184,6 +190,12 @@ define [
@event.start = fcUtil.wrap(data.start_at)
@event.end = fcUtil.wrap(data.end_at)
@event.location_name = location_name
if @event.can_change_context && data.context_code != @event.object.context_code
@event.old_context_code = @event.object.context_code
@event.removeClass "group_#{@event.old_context_code}"
@event.object.context_code = data.context_code
@event.contextInfo = @contextInfoForCode(data.context_code)
params['calendar_event[context_code]'] = data.context_code
@event.save(params)

@closeCB()
4 changes: 4 additions & 0 deletions app/coffeescripts/calendar/EventDataSource.coffee
Expand Up @@ -107,6 +107,10 @@ define [
false

addEventToCache: (event) =>
if event.old_context_code
delete @cache.contexts[event.old_context_code].events[event.id]
delete event.old_context_code

contextCode = event.contextCode()
contextInfo = @cache.contexts[contextCode]

Expand Down
9 changes: 9 additions & 0 deletions app/coffeescripts/calendar/commonEventFactory.coffee
Expand Up @@ -11,6 +11,7 @@ define [
if data == null
obj = new CommonEvent()
obj.allPossibleContexts = contexts
obj.can_change_context = true
return obj

actualContextCode = data.context_code
Expand Down Expand Up @@ -59,6 +60,8 @@ define [
# the following assumptions:
obj.can_edit = false
obj.can_delete = false
obj.can_change_context = false

# If the user can create an event in a context, they can also edit/delete
# any events in that context.
if contextInfo.can_create_calendar_events
Expand All @@ -78,6 +81,12 @@ define [
if obj.assignment?.frozen
obj.can_delete = false

# events can be moved to a different calendar in limited circumstances
if type == 'calendar_event'
unless obj.object.appointment_group_id || obj.object.parent_event_id ||
obj.object.child_events_count || obj.object.effective_context_code
obj.can_change_context = true

# disable fullcalendar.js dragging unless the user has permissions
obj.editable = false unless obj.can_edit

Expand Down
2 changes: 1 addition & 1 deletion app/coffeescripts/discussions/Reply.coffee
Expand Up @@ -106,7 +106,6 @@ define [
error: @onPostReplyError
multipart: entry.get('attachment')
proxyAttachment: true
@hide()
@removeAttachments()

##
Expand Down Expand Up @@ -146,6 +145,7 @@ define [
else
@view.model.set 'notification', ''
@trigger 'save', entry
@textArea.val ''

##
# Callback when the model fails to save
Expand Down
@@ -1,6 +1,6 @@
define [
'i18n!grading_cell'
'compiled/gradebook2/GRADEBOOK_TRANSLATIONS'
'compiled/gradebook2/GradebookTranslations'
'compiled/gradebook2/GradebookHelpers'
'underscore'
'ember'
Expand Down
4 changes: 1 addition & 3 deletions app/coffeescripts/gradebook2/Gradebook.coffee
Expand Up @@ -10,7 +10,7 @@ define [
'compiled/util/round'
'compiled/views/InputFilterView'
'i18n!gradebook2'
'compiled/gradebook2/GRADEBOOK_TRANSLATIONS'
'compiled/gradebook2/GradebookTranslations'
'jquery'
'underscore'
'Backbone'
Expand Down Expand Up @@ -1165,10 +1165,8 @@ define [
$('#download_csv').prop('disabled', true)
$('.icon-import').parent().focus()
loading_interval = self.exportingGradebookStatus()
include_priors = $('#show_concluded_enrollments').prop('checked')

params =
include_priors: include_priors
grading_period_id: @getGradingPeriodToShow()

$.ajaxJSON(
Expand Down
2 changes: 1 addition & 1 deletion app/coffeescripts/gradebook2/GradebookKeyboardNav.coffee
Expand Up @@ -18,7 +18,7 @@

define [
'i18n!gradebook2'
'compiled/gradebook2/GRADEBOOK_TRANSLATIONS'
'compiled/gradebook2/GradebookTranslations'
'jquery.keycodes' # keycodes
], (I18n, GRADEBOOK_TRANSLATIONS) ->
class GradebookKeyboardNav
Expand Down
2 changes: 1 addition & 1 deletion app/coffeescripts/gradebook2/ReactGradebook.coffee
Expand Up @@ -3,7 +3,7 @@ define [
'compiled/util/round'
'compiled/views/InputFilterView'
'i18n!gradebook2'
'compiled/gradebook2/GRADEBOOK_TRANSLATIONS'
'compiled/gradebook2/GradebookTranslations'
'jquery'
'underscore'
'compiled/userSettings'
Expand Down

0 comments on commit 2f7557f

Please sign in to comment.