Commit Graph

334 Commits

Author SHA1 Message Date
David Baumgold
404c36b8f4 PDF textbooks: namespace JS variables for URLs 2013-07-09 19:16:07 -04:00
David Baumgold
696a795c12 Don't remove all chapters on closing EditTextbook view
Previously, the code would dynamically add a chapter on render() if the textbook
had no chapters, and would remove all empty chapters when the edit view was closed.
Now, the render method doesn't modify the model at all anymore (yay!) and when the
edit view is closed, remove all empty chapters but be sure to leave at least one
left.
2013-07-09 19:16:07 -04:00
David Baumgold
5836286fda PDF textbooks: unified naming conventions 2013-07-09 19:16:06 -04:00
David Baumgold
a861e01536 Reorganize Jasmine uploader tests 2013-07-09 19:16:06 -04:00
David Baumgold
c2ef6a53f5 PDF textbook upload: show success message for 2 seconds following successful upload 2013-07-09 19:16:06 -04:00
David Baumgold
cae5c324a6 modifications to Backbone textbook structure
Textbooks now have an empty chapterset by default, instead of one with one empty
chapter. The TextbookEdit view dynamically adds an empty chapter if the chapterset
is empty; the close button removes all empty chapters from the chapterset.
2013-07-09 19:16:06 -04:00
David Baumgold
7b02932fea Add tests for CMS.Views.ChapterEdit, save content before opening upload dialog 2013-07-09 19:16:06 -04:00
David Baumgold
e8b79dc696 PDF textbooks only accept PDF files
All other file types will trigger a validation error
2013-07-09 19:16:05 -04:00
David Baumgold
77db1f8a5a Fixups and test fixes post-rebase 2013-07-09 19:16:04 -04:00
David Baumgold
c59d515cdf Added unit tests for file upload widget 2013-07-09 19:16:04 -04:00
David Baumgold
7bb86b6cd2 Fix showSpies and editSpies resetting in tests 2013-07-09 19:16:04 -04:00
David Baumgold
27398a5c6f Added tests for CMS.Views.ListTextbooks 2013-07-09 19:16:04 -04:00
David Baumgold
8ba21ca34a More backbone view tests 2013-07-09 19:16:04 -04:00
David Baumgold
3f0efe70cf Added jasmine-stealth library, v0.0.12 2013-07-09 19:16:03 -04:00
David Baumgold
8227a8c3db Started adding tests for textbook backbone views 2013-07-09 19:16:03 -04:00
David Baumgold
609c299f48 Finished backbone model tests for textbooks 2013-07-09 19:16:03 -04:00
David Baumgold
207453a37c Further basic tests for Backbone models 2013-07-09 19:16:03 -04:00
David Baumgold
001cd5d004 First few unit tests 2013-07-09 19:16:03 -04:00
David Baumgold
e0eec89e09 Truncate AJAX error messages in notification 2013-07-09 19:15:59 -04:00
David Baumgold
ace8914a53 Set up Backbone models/views to construct logic of adding textbooks/chapters 2013-07-09 19:15:58 -04:00
David Baumgold
7824b8c8f2 Fix coffeescript issue on Linux
On Linux, coffeescript refuses to compile unless the `catch` keyword has an error
variable to bind to. On Mac, it works just fine either way. Go figure.
2013-07-01 15:09:41 -04:00
David Baumgold
1fee805c9a Adjust indentation to make coffeescript happy 2013-07-01 15:09:41 -04:00
David Baumgold
8bfcbb6675 Make notifyOnError handler try to parse response as JSON 2013-07-01 15:09:41 -04:00
David Baumgold
ddc986f775 Call event.preventDefault() on notification action buttons
But allow you to specify that the event should not be prevented
2013-06-25 11:29:42 -04:00
David Baumgold
72ffe2d8f2 Backbone notifications secondary actions
Handle secondary actions on notifications either specified as a single object,
or as a list of objects. Under the hood, the initialize method converts a single
object to a list containing a single object.
2013-06-24 13:44:50 -04:00
David Baumgold
02626ffda7 Removed unused test code 2013-06-18 11:27:13 -04:00
David Baumgold
fb0d16afe2 Only show at most 300 chars in AJAX error notification 2013-06-18 10:23:44 -04:00
David Baumgold
aa24508024 Add underscore.string library
http://epeli.github.io/underscore.string/
2013-06-18 10:23:18 -04:00
David Baumgold
b6e3b0ee03 Refactor Backbone Notifications
Models are extraneous for something as temporary as a notifaction -- this change
moves all the configuration into the views, and removes the models entirely.
2013-06-18 10:20:31 -04:00
cahrens
21dc4d863e Put back in some older code to save source_code property. 2013-06-14 14:10:40 -04:00
Peter Fogg
8a67454f98 Prevent creation of unnecessary template divs, and rename .single_templates to .single-templates for convention. 2013-06-03 15:36:55 -04:00
Peter Fogg
ff0c56b7fb Cleaning up code -- removed unnecessary lines, fixed indentation, renamed method. 2013-06-03 14:21:50 -04:00
Peter Fogg
cce65ce9ae Merge branch 'master' of github.com:edx/edx-platform into peter-fogg/single-click-video-creation 2013-06-03 09:15:52 -04:00
Peter Fogg
68581610a4 Allow single-click creation of course components that only have one template. 2013-05-31 16:22:51 -04:00
cahrens
a82daf0710 Change to Backbone collection. 2013-05-31 15:59:53 -04:00
Peter Fogg
56ed47b37f Allow single-click video creation. 2013-05-31 12:52:53 -04:00
cahrens
c0c5e920a3 Go back to setFixtures. 2013-05-30 12:56:55 -04:00
cahrens
f0260757c5 Cleanup. 2013-05-29 16:50:22 -04:00
cahrens
7d07309f9d Don't call setFixtures. Can stomp on other tests. 2013-05-29 14:03:16 -04:00
cahrens
24707f8f85 Jasmine test for views. 2013-05-29 12:09:42 -04:00
cahrens
625c6b518c Cleanup, change how we load templates. 2013-05-28 14:07:35 -04:00
cahrens
c95b44d851 Merge branch 'master' into feature/christina/metadata-ui
Conflicts:
	cms/envs/common.py
	cms/templates/base.html
	common/lib/xmodule/xmodule/combined_open_ended_module.py
2013-05-23 11:41:12 -04:00
David Baumgold
c26edbd631 jasmine-jquery compatiblity post-backport 2013-05-23 10:14:47 -04:00
David Baumgold
4736527952 Add Jasmine tests to cover AJAX error notifications 2013-05-22 15:55:56 -04:00
David Baumgold
0a7222b123 Allow an AJAX call to specify that it should not notify on error
Because there are some cases where it's OK to fail, and it's not the user's fault
2013-05-22 15:55:56 -04:00
David Baumgold
3738078ce9 Load system feedback template for SectionEdit tests 2013-05-22 15:55:56 -04:00
David Baumgold
dc2acb18ee Moved global AJAX Error handler definition to main.coffee 2013-05-22 15:55:55 -04:00
David Baumgold
9e864834bd Unify system feedback templates
Also, a SystemFeedback model no longer has a `type`, it has an `intent`. This is
because SystemFeedback views have `type`, as well, and this prevents a naming
collision.
2013-05-22 15:55:55 -04:00
David Baumgold
5a06c69289 Add toBeShown and toBeHiding matchers for Jasmine
To reduce redundancy in tests
2013-05-22 15:55:54 -04:00
David Baumgold
0052eaacbc Backbone section: don't save name on validation error 2013-05-22 15:55:54 -04:00