when you require ['jquery'] you are now getting the
version of jquery that has our patches applied to it
you should not need to think about the patching as
you write code.
this also applies to jqueryui/dialog, that will return
the patched version of it.
test plan:
make sure javascript still works on our site ;)
Change-Id: I237fa8da5f93167140c4d42b80eb3ef17d95c1e6
Reviewed-on: https://gerrit.instructure.com/9878
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
need to get rid of webkit flashing thing
and fix it sometimes appearing incrementally
to the right and bottom of where it should
Change-Id: I4fdd535fe6c0521e431477dff6046f8c2147043c
Reviewed-on: https://gerrit.instructure.com/9513
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
"Trivial" JavaScript / CoffeeScript changes
--------------------------------------------------
For the most part, all javascript was simply
wrapped in `require` or `define`. The dependencies
were found with a script that matched regexes in
the files, it errs on the side of listing too many
dependencies, so its worth double checking each
file's dependencies (over time, anyway).
i18n API changes
--------------------------------------------------
No longer have to do I18n.scoped calls, just
list i18n as a dependency with the scope and it's
imported already scoped
require ['i18n!some_scope'], (I18n) ->
I18n.t 'im_scoped', 'I'm scoped!'
JS bundling now done with r.js, not Jammit
--------------------------------------------------
We don't use jammit to bundle JS anymore. Simply
list dependencies for your JS modules in the file
and RequireJS handles the rest.
To optimize the JavaScript, first make sure you
have node.js 0.4.12+ installed and then run:
$ rake js:build
The app defaults to the optimized build in
production. You can use non-optimized in
production by putting ?debug_assets=true in the
url just like before.
You can also test the optimized JavaScript in
development with ?optimized_js=true.
Significant changes
--------------------------------------------------
These files have "real" changes to them (unlike
the JavaScript that is simply wrapped in require
and define). Worth taking a really close look at:
- app/helpers/application_helper.rb
- app/views/layouts/application.html.erb
- config/assets.yml
- config/build.js
- lib/handlebars/handlebars.rb
- lib/i18n_extraction/js_extractor.rb
- lib/tasks/canvas.rake
- lib/tasks/i18n.rake
- lib/tasks/js.rake
Change-Id: I4bc5ecb1231f331aaded0fef2bcc1f3a9fe482a7
Reviewed-on: https://gerrit.instructure.com/6986
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Configured external tools can show up as buttons in the
rich editor. If you click the button then it'll pop up
a dialog that uses basic lti to load a page for the
external tool. The user can pick a resource in that
tool and the tool will then redirect back to a Canvas
url that will fire a callback and embed the content
into the editor.
See spec/selenium/external_tool_buttons_sel.rb for an
example of how to manually configure one of these tools.
Adding configuration to the UI will come in another
commit.
testing notes:
to configure an external tool to show up in the editor:
tool.settings = {
:editor_button => {
:url => "http://<canvas_domain>/selection_test",
:text => <button_label>,
:selection_width => <width_of_iframe>,
:selection_height => <height_of_iframe>,
:icon_url => <url_of_button_icon>
}
}
test plan:
- configure an external tool in the course with an editor button
- check to see if the button shows up in the rich editor in that course
- configure an external tool in the account with an editor button
- check to see if the button shows up for courses in that account
- configure more than 3 external tools
- check to see if the "more tools" dropdown works correctly
Change-Id: I681db0af578df6a9c7a2c840d293703937d81c46
Reviewed-on: https://gerrit.instructure.com/5429
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
In current BLTI there are two options for adding links:
- know the URL beforehand
- know a "naked" URL that can be associated with a resource
but not until after embed
Neither of these are great for the end-user. This commit
adds a third option, as discussed with some other users of
BLTI, where instead the user can click a link in the UI
to load an iframe where they can then find the specific
resource they want to embed. They never need to know
any URLs to make this happen.
to configure an external tool:
tool.settings = {
:resource_selection => {
:url => "http://<canvas_domain>/selection_test",
:text => <label>,
:selection_width => <iframe_width>,
:selection_height => <iframe_height>
}
}
test plan:
- configure an external tool on the course
- click to add an item to a course module
- select "external tools"
- pick the tool from the list
- select a link from the dialog
- make sure the link was inserted correctly
- try clicking the first "bad" link in the tool and confirm error is caught
- try clicking the second "bad" link in the tool and confirm error is caught
- try clicking the this "bad" link in the tool and confirm no errors occur
- make sure an account-level tool also appears
Change-Id: I47fd8461f1050c332e5cae32d9a3141a8de5b38d
Reviewed-on: https://gerrit.instructure.com/6326
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
as it was before, the second time you opened a dialog
it would not look "modal" because .ui-widget-overlay
was opacity: 0.
Change-Id: Id650767ace6977cfa303e1374580bd8382c14864
Reviewed-on: https://gerrit.instructure.com/6006
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
NOTE: a previous commit tried to do this, but it
broke specs, so it was reverted
this was to introduce sanity where we don't have
one file with ~3600 lines of javascript:
* if something looked like it was worthy of its own
plugin file, or should have been one in the first
place, it got it. (ex: jquery.keycodes.js)
* if there were a bunch of methods that obviously
belong together, I put them all together in their
own file (ex: jquery.instructure_forms.js)
* all of our monkeypatching of jQuery went into one
file so it is easier to see where that is happening
when we choose to upgrade.
* move the remaining jQuery helpers (things like $.blah)
into jquery.instructure_misc_helpers.js
* move remaining jQuery plugins (things like $.fn.blah)
into jquery.instructure_misc_plugins.js
Change-Id: I2978c79299ec8b73e5e14d941c20ffe35c4bba99
Reviewed-on: https://gerrit.instructure.com/5862
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
this was to introduce sanity where we don't have
one file with ~3600 lines of javascript:
* if something looked like it was worthy of its own
plugin file, or should have been one in the first
place, it got it. (ex: jquery.keycodes.js)
* if there were a bunch of methods that obviously
belong together, I put them all together in their
own file (ex: jquery.instructure_forms.js)
* all of our monkeypatching of jQuery went into one
file so it is easier to see where that is happening
when we choose to upgrade.
* move the remaining jQuery helpers (things like $.blah)
into jquery.instructure_misc_helpers.js
* move remaining jQuery plugins (things like $.fn.blah)
into jquery.instructure_misc_plugins.js
Change-Id: I7ef9b39de424bb187665cacb6a96a8f869dc9994
Reviewed-on: https://gerrit.instructure.com/5524
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
As of jQuery 1.6, the .attr() method returns undefined
for attributes that have not been set
Change-Id: Ibc2301735bb038ee2f897dfc12049012211d1620
Reviewed-on: https://gerrit.instructure.com/5452
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Firefox sends 191 for / like it should until the
shift key is pressed, then it sends 0. Mapped
0 to 191 (will cause < and > and perhaps some
other keys to also pull up the dialog. Same
behavior can be found on github).
Change-Id: I1759132f2b628dc40f15f5d1b778b7769d6446e4
Reviewed-on: https://gerrit.instructure.com/5722
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
this is a fix for the speedGrader typing becoming
really unresponsive after time.
fixes#5171
Change-Id: I87771b11f926761b17d69645bede899b7caaecec
Reviewed-on: https://gerrit.instructure.com/5475
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
need to ensure that the element always has the
class name applied so the css animation takes effect.
Change-Id: I26d9dbcbce8520f12223d293278bf197dabf8b53
Reviewed-on: https://gerrit.instructure.com/5470
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
The wait_for_ajax at the end of every test was failing on pages that didn't
have a Canvas page loaded at the end of the test.
Fixed a bug that was causing us to wait longer than necessary for the forked
servers to start up.
Also did some other cleanup.
Change-Id: Ia8a2cdc2dcb2967427a698ff200ed75485a495ef
Reviewed-on: https://gerrit.instructure.com/5397
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
* Daily job to evaluate alerts
* Spawns a new job for each root account (for parallelization).
It could be broken down to per-course level if needed (i.e.
if there is a *huge* root account).
* Evaluating criteria at a course level using efficient queries.
* UI for CRUD on alerts
* Render existing alerts
* Delete existing alerts
* Create a new alert
* CRUD for criteria, recipients, repetition
* Validations
* Improve instructure_helper's formErrors to support passing errors
for specific elements
* Improve Rails' :include to be able to :exclude an :include
inherited from a named scope
* Specs!!
* Note that we want to slowly roll this out, so there is a setting on
root accounts to enable it
So I ran an alert with just an interaction criterion on a test
cluster against 50,000 courses, and it took less than 10 minutes
without any parallelization. That seems like acceptable
performance to me (since there are only just over 3000 courses
in production that would even be elligible to have alerts sent
right now). Of course, that's probably skewed because I'm sure
a bunch of those 50,000 courses were essentially empty.
Change-Id: Ie028ef206c9155b9a72fb2a820f3e0e516de562a
Reviewed-on: https://gerrit.instructure.com/4799
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
There are some places where we might call datetime_field() on a field twice.
That causes the field to double its date when it's submitted. We can also just
be careful when calling datetime_field(), but I'm not sure there's a valid use
case for calling it twice, given how much it jacks up the control.
fixes#3818
Change-Id: I79987486efeb5c77497183a41251a6990747fd52
Reviewed-on: https://gerrit.instructure.com/2291
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
Conflicts:
app/controllers/context_controller.rb
config/assets.yml
spec/integration/files_spec.rb
spec/models/user_spec.rb
also removed test "ContextController GET 'inbox_item' should exclude
recipients if protect_recipients" since ContextMessage inbox items
aren't used any more on this branch.
Change-Id: I99d0e4914cb1bf9617993c1cb1afdbca0e9ba32f
instead of just one pair
Change-Id: Ic37621e2d4746e883b58a71c5d9b841cea726924
Reviewed-on: https://gerrit.instructure.com/5073
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
also removed some dead code. still need to do dates and times
Change-Id: Iac2e036d839cb0a2ae7c53c95ee05ff59cb3684f
Reviewed-on: https://gerrit.instructure.com/4924
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
ordinalization doesn't localize well, and the new version ("student n of
m") will be clearer for translators as well. kill now unused and
problematic $.ordinalize
Change-Id: Ie8f4169d385ffa1e8c4ea5beac18e5f429ea2c59
Reviewed-on: https://gerrit.instructure.com/4922
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
changes:
* a little i18n work
* show only a certain section
* show attendance
* include ungraded assigments in score
* don't wait for first xhr to fire second
* cool drop down menu thing
Change-Id: Ie93fd06e20aec399710e32441f8d35c686fbbaf2
Reviewed-on: https://gerrit.instructure.com/4868
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
This reverts commit 7eb99b681f.
Commit wasn't behaving well with 11:59pm dates. Will revisit as part of
my datetime revamp WIP.
Change-Id: I5dc6396f79201349409cc86f7398712469ec9248
Reviewed-on: https://gerrit.instructure.com/4662
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Most of this code was actually getting completely
bypassed because of some bad logic. This now tries
to enforce storage quota limits with exceptions for
things like turning in homework.
Change-Id: Id025bcdcd40c560a22368dc84686a1307296e053
Reviewed-on: https://gerrit.instructure.com/4452
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
also fixed escaped html in dialog title, double popup issue, and
sentbox check not working
Change-Id: Ie5aae6ff1d07fd89fcb0a0648f2c0a7d55498db4
Reviewed-on: https://gerrit.instructure.com/4448
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
uses coffeescript, slickgrid, actual canvas APIs
reachable at /courses/x/gradebook2
does not include commenting or things external
to the grid like filtering and sorting options
Change-Id: I6967c2dbdd16f7ea4d8c1ad1995511d7c498226a
Reviewed-on: https://gerrit.instructure.com/4371
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
this also refactors out the functionality of
filling the viewport with an element (but leaving
room for anything above or below that element).
also, I styled the Iframe container so it looks a
little better.
Change-Id: I608f745d01f09d6091a3f8ee04f43314c25feaf8
fixes: #4078
Reviewed-on: https://gerrit.instructure.com/2737
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>