fill image fields with selection in tinymce embed image dialog

allows users to edit the alt fields for images by clicking
on them and then clicking the "embed image" button

test plan:
* use the tinymce editor to insert an image
* click on the image
* click on the "embed image" tinymce editor button
* should be able to see the current src and alt filled in
 the fields, so you can edit them

fixes #CNVS-4011

Change-Id: Icd0150299a3dbe8f0d144b38681be0adaffbc6fd
Reviewed-on: https://gerrit.instructure.com/17967
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
lti change domain method

a convenience method for changing the domain for all configured urls

Change-Id: I601c891e66fff476f8f743cc4519a6fecb432d12
Reviewed-on: https://gerrit.instructure.com/18094
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
remove birthdate from UI, fixes CNVS-4191

test plan:
1. go to /register
2. you should not be prompted to enter a birthdate in any of the flows
3. the forms should work
4. go to your (user) settings
5. you should not see your birthdate nor be able to enter one
6. the form should work
7. go to the self enrollment page for a course as a new user
8. you should not be prompted to enter a birthdate
9. the form should work

Change-Id: I9bf92d27e208696b2aed74b4a6396d434494679c
Reviewed-on: https://gerrit.instructure.com/18143
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
replace help text for allowable file extensions

Notes:
* Help text should be visible under Allowed File Extensions text
  field when editing an assignment
* Submission Type must be "Online" and "Allow File Uploads" and
  "Restrict Upload File Types" must be checked for text field and
  help text to be visible

fixes CNVS-4209

Change-Id: I57d713e457c2336628908cd5f323286a838124c9
Reviewed-on: https://gerrit.instructure.com/18149
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
prevent error when google docs plugin not configured

refs #CNVS-3196

simon noted that if the google docs plugin was
not configured, trying to access the config hash
for the google docs library would result in 
a "no such method [] on nil" error.  I placed
specs at the controller level and at the library
level to reproduce the problem and put in a fix
that checks for a google docs config and fails
early if there is not one with a nil return.

Tested manually locally to confirm this solves it.

TEST PLAN:

1) login as any student to a canvas instance
where the google docs plugin is NOT enabled.

2) navigate to the show page for any assignment

3) you should not experience any server errors

Change-Id: I25f90ded428a5a6a9c15ddd625b1a690f6d9077f
Reviewed-on: https://gerrit.instructure.com/18177
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
remove stray debugger statement from editorAccessibility

test plan:
  - debugger should not run for the removed line when you open the page!

Change-Id: I65f83515e5e6c32770673fb4895bddb5e242abf1
Reviewed-on: https://gerrit.instructure.com/18181
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
use standard font color in discussions.

fixes CNVS-4242

test plan:
  * create a discussion;
  * post to the discussion;
  * verify that the post text is in the standard canvas
    dark grey color (#333);

Change-Id: I06a3f874ba1a3358a00eacf09dbfc49128c69031
Reviewed-on: https://gerrit.instructure.com/18150
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Revert "spec: fixing calendar2_spec.rb should render assignments due before midnight"

This reverts commit 6edea3dbd1d3cdb152bba7aa480d8403f257a8c6

Change-Id: Ia980994df87fc39131a502a4668db57c0164a0ac
Reviewed-on: https://gerrit.instructure.com/18192
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
add privacy policy links, fixes CNVS-3713

adds privacy policy link in the following places:
1. "Add a New User" dialog (on account pages)
2. /register now has a footer w/ a link to the privacy policy
3. /register dialogs (student/parent/teacher signups) now prompt the user
   to agree to the privacy policy in addition to the terms
4. self enrollment dialogs (can be seen via "Join this Course" button or
   via canvas.net "Enroll" button) now have a link to the privacy policy
   for all flows (i.e. even if already authenticated)... previously there
   was only a checkbox/link for new users

test plan:
1. confirm privacy policy links appear in the places listed above

Change-Id: I1ad48eee7fc116901c901673ca985bbc354b5c13
Reviewed-on: https://gerrit.instructure.com/18107
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
fix back button on discussion - fixes CNVS-2763

Change-Id: If32593aaf99da7e434c7040dffa50130e65a8c5b
Reviewed-on: https://gerrit.instructure.com/18127
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Fully adopt Bootstrap & update css to work with it, closes: #CNVS-1344

this commit does the following:
* upgrade bootstrap-sass gem to most recent version
* switches to using bootstrap's normalize.css and forms.css
  which fixes a whole bunch of misformatting of how bootstrap
  stuff is supposed to look, but changing those 2 affects
  a lot of our old stylesheets.
* gets rid of unified_buttons.sass and just uses bootstraps buttons.
  .ui-button @extends these because we still have to support .ui-button
  for modals & buttonsets. but .button is no longer supported.
* a lot of css file reorganization (there's no more 'blue' and
  'normal canvas', there's just canvas)
* a bunch of files had to be tweaked to look good with these changes.

test plan:
This change touches every page in canvas so, no kidding, we need to make
sure every page looks OK. In order to do that:
1. each sprint team needs to give a +1 after they make sure all the
   pages in the features they are over look good.
2. the QA person on each team needs to look at the pages for their
   teams features for a QA +1

things to look for specifically when testing:
* buttons: this gets rid of all those red 'cancel' links
  that are actually buttons, make sure all the buttons you see
  look right.  if you see 2 plain gray buttons next to each other
  like [Save] [Cancel], we should make the primary one blue (by
  adding the .btn-primary class)
* Forms: a lot of this change has to do with how form elements look,
  especially <select>s, <input>s and <label>s. look at the diffs
  for the ones that have the most changes and make sure those look
  good, but also check for the ones I missed and make sure those
  look good too.
* and just random style changes, if something looks ugly or broken
  (and it didn't before), we should fix that.

Also:
just use a link instead of a drop-menu for adding event from sidebar

we used to have a drop down menu for adding events
to cal2 from the sidebar where you'd hit a cog
and it'd ask you if you wanted to add an event or
an assignment.  this just simplifies it to an add
icon.

this: http://cl.ly/image/133a2A3q3q1M
instead of: http://cl.ly/image/46463o2s3W0g

Change-Id: I384fe273934bca96bf28423afb1402c7792d8766
Reviewed-on: https://gerrit.instructure.com/15422
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
spec: fix this series of tests in ruby 1.8

A bad interaction between 1.8, mocha and alias_method_chain seems to be
preventing transaction_without_cassandra_check from properly unstubbing
after this test, making subsequent tests all fail. So I changed which
method we expect on. (verified by changing the code to be incorrect and
making sure the test fails as expected)

Change-Id: Iff921a66acd562543d62536667d8fbc60b59d159
Reviewed-on: https://gerrit.instructure.com/18165
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
override automatic readonly-ness from AR

refs CNVS-3980

test plan:
 * using this scope should not return readonly objects

Change-Id: I60db54bcedebf3e045aac3f168c241676608eff0
Reviewed-on: https://gerrit.instructure.com/18077
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
add assignment options to discussion edit page

closes CNVS-3987

discussion new/edit pages now provide full assignment
options for discussions that have assignment details.

test plan:
  * attempt to create a new discussion assignment and
    verify that new options can be set/save properly;
  * edit an existing discussion assignment and verify that
    previously set assignment options display properly and
    that changes are properly persisted.
  * also make sure that announcements still work properly

Change-Id: I773bf1dd1c4f8feb4a3df9bf374c6b0b5436a963
Reviewed-on: https://gerrit.instructure.com/17863
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
add varied due dates to discussions

closes CNVS-505

this adds the multiple due dates widget to the discussions edit interface.  as
a side effect it allows for setting lock dates for discussions, which was
previously unavailable.

test plan:
- in a course with multiple sections
- make sure discussions with a single due date still work
- make sure you can add different due/lock/unlock dates to different sections

Change-Id: I4a12168051b1ddffee1180e623573e7d367d2051
Reviewed-on: https://gerrit.instructure.com/17950
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
load courses from all shards in load_all_contexts

fixes CNVS-4289

test-plan:
 * create a user on shard 1
 * create a course on shard 2 with multiple sections
 * enroll the user in the course as a teacher (so he can see both
   sections)
 * go to the user's inbox
 * should not get a page error

Change-Id: I9d584835f697ddef1e59a44d11797add51367b6c
Reviewed-on: https://gerrit.instructure.com/18189
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
remember column sort order in gradebook2

fixes CNVS-4155

test plan:
 - Create some assignment groups and some assignments in those
   groups. Make sure their due date order does not match the
   order of the assignments on the assignments index.
 - Open gradebook2. By default the assignments should appear in
   the same order as they appear on the assignments index.
 - Give some students some scores so column sorting will be
   more visible.
 - Open the gear menu. The option "Arrange columns by due date"
   should be visible. Select it.
 - The assignment columns should rearrange so the assignments
   appear in the order of their due date.
 - Refresh the page. The assignment columns should still appear
   in due date order.
 - Open the gear menu. The option "Arrange columns by
   assignment group" should be visible, while the "Arrange
   columns by due date" should be invisible. Sort the columns
   by assignment group.
 - The assignment columns should rearrange themselves into
   their original ordering.
 - Refresh the page. The assignments should retain the original
   ordering.
 - Rearrange the assignment columns into an arbitrary order by
   dragging and dropping the assignment column headers.
 - Refresh the page. The assignments should retain their custom
   ordering.
 - Open the gear menu. Both "Arrange columns by assignment
   group", and "Arrange columns by due date" should be visible.
   Selecting either should rearrange the assignment columns
   into the specified order.

Change-Id: I1190898a272f8c3207a54525778ef518d4b49676
Reviewed-on: https://gerrit.instructure.com/18159
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
interpret shard-aware user_ids in context_controller

User IDs with shard id are not properly interpreted by
context_controller and therefore show the wrong user when viewing from
a shard different from the user's shard.

Test Plan:
  - visit /courses/[course-id]/users/ and add shard-aware user_id. The
    user's profile should be viewable (from any shard)

fixes CNVS-3847

Change-Id: Ida03893668a3ff5d1695e881569bfc5da2aba136
Reviewed-on: https://gerrit.instructure.com/17965
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
set correct due_date for teachers on vdd assignments

closes CNVS-3756

Test plan:
  make sure assignment show up in the correct section of the page in
  /assignments for the following configurations:
    * no overrides
    * has a section override due date before the assignment due date
    * has a section override due date after the assignment due date

Change-Id: I7681416a102c9d8078f433fb03f8667cf2647e98
Reviewed-on: https://gerrit.instructure.com/17968
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
cache wiki page body rendering

adds a fragment cache to wiki_pages#show designed to
save on the user_content parsing of a wiki page's body

test plan:
* the easiest way to visibly demonstrate this is to create
a wiki page with many, many equation images or video embeds
* the first time you visit it in non-edit mode, it should take a
noticably long time to render (because it's parsing the html
of the page)
* but on refresh (again in non-edit mode), it should take
a much shorter time to render

fixes #CNVS-3298

Change-Id: Idf05b2401face65aab38cc70cf2aae3f5333fc66
Reviewed-on: https://gerrit.instructure.com/18124
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>