diff --git a/cms/static/cms/js/require-config.js b/cms/static/cms/js/require-config.js index c4f9092123..18f86f355c 100644 --- a/cms/static/cms/js/require-config.js +++ b/cms/static/cms/js/require-config.js @@ -52,7 +52,7 @@ "text": 'js/vendor/requirejs/text', "underscore": "common/js/vendor/underscore", "underscore.string": "common/js/vendor/underscore.string", - "backbone": "js/vendor/backbone-min", + "backbone": "common/js/vendor/backbone-min", "backbone-relational" : "js/vendor/backbone-relational.min", "backbone.associations": "js/vendor/backbone-associations-min", "backbone.paginator": "js/vendor/backbone.paginator.min", diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index 0aa0e96687..a3b8eb237c 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -29,7 +29,7 @@ requirejs.config({ "text": "xmodule_js/common_static/js/vendor/requirejs/text", "underscore": "xmodule_js/common_static/common/js/vendor/underscore", "underscore.string": "xmodule_js/common_static/common/js/vendor/underscore.string", - "backbone": "xmodule_js/common_static/js/vendor/backbone-min", + "backbone": "xmodule_js/common_static/common/js/vendor/backbone-min", "backbone.associations": "xmodule_js/common_static/js/vendor/backbone-associations-min", "backbone.paginator": "xmodule_js/common_static/js/vendor/backbone.paginator.min", "backbone-relational": "xmodule_js/common_static/js/vendor/backbone-relational.min", diff --git a/cms/static/coffee/spec/main_squire.coffee b/cms/static/coffee/spec/main_squire.coffee index 1a537b4d64..b155a0e667 100644 --- a/cms/static/coffee/spec/main_squire.coffee +++ b/cms/static/coffee/spec/main_squire.coffee @@ -26,7 +26,7 @@ requirejs.config({ "text": "xmodule_js/common_static/js/vendor/requirejs/text", "underscore": "common/js/vendor/underscore", "underscore.string": "common/js/vendor/underscore.string", - "backbone": "xmodule_js/common_static/js/vendor/backbone-min", + "backbone": "xmodule_js/common_static/common/js/vendor/backbone-min", "backbone.associations": "xmodule_js/common_static/js/vendor/backbone-associations-min", "backbone.paginator": "xmodule_js/common_static/js/vendor/backbone.paginator.min", "tinymce": "xmodule_js/common_static/js/vendor/tinymce/js/tinymce/tinymce.full.min", diff --git a/cms/static/coffee/src/views/tabs.coffee b/cms/static/coffee/src/views/tabs.coffee index 2a854504b4..9d00bd425a 100644 --- a/cms/static/coffee/src/views/tabs.coffee +++ b/cms/static/coffee/src/views/tabs.coffee @@ -1,9 +1,9 @@ -define ["jquery", "jquery.ui", "backbone", "common/js/components/views/feedback_prompt", +define ["underscore", "jquery", "jquery.ui", "backbone", "common/js/components/views/feedback_prompt", "common/js/components/views/feedback_notification", "coffee/src/views/module_edit", "js/models/module_info", "js/utils/module"], -($, ui, Backbone, PromptView, NotificationView, ModuleEditView, ModuleModel, ModuleUtils) -> +(_, $, ui, Backbone, PromptView, NotificationView, ModuleEditView, ModuleModel, ModuleUtils) -> class TabsEdit extends Backbone.View - initialize: => + initialize: (options) => @$('.component').each((idx, element) => model = new ModuleModel({ id: $(element).data('locator') @@ -15,7 +15,7 @@ define ["jquery", "jquery.ui", "backbone", "common/js/components/views/feedback_ model: model ) ) - + @options = _.extend({}, options) @options.mast.find('.new-tab').on('click', @addNewTab) $('.add-pages .new-tab').on('click', @addNewTab) $('.toggle-checkbox').on('click', @toggleVisibilityOfTab) diff --git a/cms/static/js/views/baseview.js b/cms/static/js/views/baseview.js index a0b1975e04..a7813cc7dd 100644 --- a/cms/static/js/views/baseview.js +++ b/cms/static/js/views/baseview.js @@ -26,6 +26,14 @@ define(["jquery", "underscore", "backbone", "gettext", "js/utils/handle_iframe_b //override the constructor function constructor: function(options) { _.bindAll(this, 'beforeRender', 'render', 'afterRender'); + + // Merge passed options and view's options property and + // attach to the view's options property + if (this.options) { + options = _.extend({}, _.result(this, 'options'), options); + } + this.options = options; + var _this = this; this.render = _.wrap(this.render, function (render, options) { _this.beforeRender(); diff --git a/cms/static/js/views/manage_users_and_roles.js b/cms/static/js/views/manage_users_and_roles.js index f9d154696e..e2b065ffab 100644 --- a/cms/static/js/views/manage_users_and_roles.js +++ b/cms/static/js/views/manage_users_and_roles.js @@ -100,8 +100,8 @@ define(['jquery', 'underscore', 'gettext', "js/views/baseview", }; var roleEvents = {}; var self = this; - for (var i = 0; i < self.roles.length; i++) { - var role_name = self.roles[i].key; + for (var i = 0; i < self.options.roles.length; i++) { + var role_name = self.options.roles[i].key; var role_selector = 'click .user-actions .make-' + role_name; (function (role) { diff --git a/cms/static/js/views/modals/base_modal.js b/cms/static/js/views/modals/base_modal.js index e8f8696d59..61b6c5c15f 100644 --- a/cms/static/js/views/modals/base_modal.js +++ b/cms/static/js/views/modals/base_modal.js @@ -26,7 +26,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview"], 'click .action-cancel': 'cancel' }, - options: $.extend({}, BaseView.prototype.options, { + options: _.extend({}, BaseView.prototype.options, { type: 'prompt', closeIcon: false, icon: false, diff --git a/cms/static/js/views/modals/course_outline_modals.js b/cms/static/js/views/modals/course_outline_modals.js index 28a4fa9aa4..a08a7097df 100644 --- a/cms/static/js/views/modals/course_outline_modals.js +++ b/cms/static/js/views/modals/course_outline_modals.js @@ -17,9 +17,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', VerificationAccessEditor, TimedExaminationPreferenceEditor, AccessEditor; CourseOutlineXBlockModal = BaseModal.extend({ - events : { + events : _.extend({}, BaseModal.prototype.events, { 'click .action-save': 'save' - }, + }), options: $.extend({}, BaseModal.prototype.options, { modalName: 'course-outline', @@ -32,7 +32,6 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', initialize: function() { BaseModal.prototype.initialize.call(this); - this.events = $.extend({}, BaseModal.prototype.events, this.events); this.template = this.loadTemplate('course-outline-modal'); this.options.title = this.getTitle(); }, @@ -154,10 +153,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', } }, - events: { + events: _.extend({}, CourseOutlineXBlockModal.prototype.events, { 'click .action-save': 'save', - 'click .settings-tab-button': 'handleShowTab', - }, + 'click .settings-tab-button': 'handleShowTab' + }), /** * Return request data. @@ -185,9 +184,9 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview', PublishXBlockModal = CourseOutlineXBlockModal.extend({ - events : { + events : _.extend({}, CourseOutlineXBlockModal.prototype.events, { 'click .action-publish': 'save' - }, + }), initialize: function() { CourseOutlineXBlockModal.prototype.initialize.call(this); diff --git a/cms/static/js/views/modals/edit_xblock.js b/cms/static/js/views/modals/edit_xblock.js index ea10dabd09..c4f6b1044e 100644 --- a/cms/static/js/views/modals/edit_xblock.js +++ b/cms/static/js/views/modals/edit_xblock.js @@ -9,10 +9,10 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "common "strict mode"; var EditXBlockModal = BaseModal.extend({ - events : { + events: _.extend({}, BaseModal.prototype.events, { "click .action-save": "save", "click .action-modes a": "changeMode" - }, + }), options: $.extend({}, BaseModal.prototype.options, { modalName: 'edit-xblock', @@ -25,7 +25,6 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "common initialize: function() { BaseModal.prototype.initialize.call(this); - this.events = _.extend({}, BaseModal.prototype.events, this.events); this.template = this.loadTemplate('edit-xblock-modal'); this.editorModeButtonTemplate = this.loadTemplate('editor-mode-button'); }, diff --git a/cms/static/js/views/modals/validation_error_modal.js b/cms/static/js/views/modals/validation_error_modal.js index 545fed566d..dc759a5a2b 100644 --- a/cms/static/js/views/modals/validation_error_modal.js +++ b/cms/static/js/views/modals/validation_error_modal.js @@ -38,7 +38,7 @@ define(['jquery', 'underscore', 'gettext', 'js/views/modals/base_modal'], return this.template({ response: this.response, - num_errors: this.response.length, + num_errors: this.response.length }); }, @@ -57,7 +57,7 @@ define(['jquery', 'underscore', 'gettext', 'js/views/modals/base_modal'], // hide the modal BaseModal.prototype.hide.call(this); - }, + } }); return ValidationErrorModal; diff --git a/cms/static/js/views/pages/paged_container.js b/cms/static/js/views/pages/paged_container.js index a3f7cfd3f2..2c1227825e 100644 --- a/cms/static/js/views/pages/paged_container.js +++ b/cms/static/js/views/pages/paged_container.js @@ -6,12 +6,14 @@ define(["jquery", "underscore", "gettext", "js/views/pages/container", "js/views 'use strict'; var PagedXBlockContainerPage = XBlockContainerPage.extend({ - events: {"click .toggle-preview-button": "toggleChildrenPreviews"}, + events: _.extend({}, XBlockContainerPage.prototype.events, { + 'click .toggle-preview-button': 'toggleChildrenPreviews' + }), + defaultViewClass: PagedContainerView, components_on_init: false, - initialize: function (options){ - this.events = _.extend({}, XBlockContainerPage.prototype.events, this.events); + initialize: function (options) { this.page_size = options.page_size || 10; this.showChildrenPreviews = options.showChildrenPreviews || true; XBlockContainerPage.prototype.initialize.call(this, options); diff --git a/cms/static/js/views/uploads.js b/cms/static/js/views/uploads.js index 4b2cd0d620..42dc7d88ec 100644 --- a/cms/static/js/views/uploads.js +++ b/cms/static/js/views/uploads.js @@ -1,10 +1,10 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "jquery.form"], function($, _, gettext, BaseModal) { var UploadDialog = BaseModal.extend({ - events: { + events: _.extend({}, BaseModal.prototype.events, { "change input[type=file]": "selectFile", "click .action-upload": "upload" - }, + }), options: $.extend({}, BaseModal.prototype.options, { modalName: 'assetupload', @@ -15,7 +15,6 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal", "jquery initialize: function() { BaseModal.prototype.initialize.call(this); - this.events = _.extend({}, BaseModal.prototype.events, this.events); this.template = this.loadTemplate("upload-dialog"); this.listenTo(this.model, "change", this.renderContents); this.options.title = this.model.get('title'); diff --git a/cms/static/js/views/video/transcripts/file_uploader.js b/cms/static/js/views/video/transcripts/file_uploader.js index 41f69dd3b7..13f95dc039 100644 --- a/cms/static/js/views/video/transcripts/file_uploader.js +++ b/cms/static/js/views/video/transcripts/file_uploader.js @@ -17,11 +17,11 @@ function($, Backbone, _, Utils) { uploadTpl: '#file-upload', - initialize: function () { + initialize: function (options) { _.bindAll(this, 'changeHandler', 'clickHandler', 'xhrResetProgressBar', 'xhrProgressHandler', 'xhrCompleteHandler' ); - + this.options = _.extend({}, options); this.file = false; this.render(); }, diff --git a/cms/static/js/views/video/transcripts/message_manager.js b/cms/static/js/views/video/transcripts/message_manager.js index d405b713e2..3f27f79b57 100644 --- a/cms/static/js/views/video/transcripts/message_manager.js +++ b/cms/static/js/views/video/transcripts/message_manager.js @@ -28,11 +28,13 @@ function($, Backbone, _, Utils, FileUploader, gettext) { choose: '#transcripts-choose' }, - initialize: function () { + initialize: function (options) { _.bindAll(this, 'importHandler', 'replaceHandler', 'chooseHandler', 'useExistingHandler', 'showError', 'hideError' ); + this.options = _.extend({}, options); + this.component_locator = this.$el.closest('[data-locator]').data('locator'); this.fileUploader = new FileUploader({ diff --git a/cms/static/js/views/video/transcripts/metadata_videolist.js b/cms/static/js/views/video/transcripts/metadata_videolist.js index 2cf79aa511..bfa51808d8 100644 --- a/cms/static/js/views/video/transcripts/metadata_videolist.js +++ b/cms/static/js/views/video/transcripts/metadata_videolist.js @@ -25,9 +25,10 @@ function($, Backbone, _, AbstractEditor, Utils, MessageManager) { 'youtube': 'http://youtube.com/' }, - initialize: function () { + initialize: function (options) { // Initialize MessageManager that is responsible for // status messages and errors. + this.options = _.extend({}, options); var Messenger = this.options.MessageManager || MessageManager; this.messenger = new Messenger({ diff --git a/cms/static/js_test.yml b/cms/static/js_test.yml index 22a4e5685f..ed014993eb 100644 --- a/cms/static/js_test.yml +++ b/cms/static/js_test.yml @@ -37,7 +37,7 @@ lib_paths: - xmodule_js/common_static/js/vendor/jquery.simulate.js - xmodule_js/common_static/common/js/vendor/underscore.js - xmodule_js/common_static/common/js/vendor/underscore.string.js - - xmodule_js/common_static/js/vendor/backbone-min.js + - xmodule_js/common_static/common/js/vendor/backbone-min.js - xmodule_js/common_static/js/vendor/backbone-associations-min.js - xmodule_js/common_static/js/vendor/backbone.paginator.min.js - xmodule_js/common_static/js/vendor/backbone-relational.min.js diff --git a/cms/static/js_test_squire.yml b/cms/static/js_test_squire.yml index d65f44e30f..eca7ae1d34 100644 --- a/cms/static/js_test_squire.yml +++ b/cms/static/js_test_squire.yml @@ -36,7 +36,7 @@ lib_paths: - xmodule_js/common_static/js/vendor/jquery.cookie.js - xmodule_js/common_static/common/js/vendor/underscore.js - xmodule_js/common_static/common/js/vendor/underscore.string.js - - xmodule_js/common_static/js/vendor/backbone-min.js + - xmodule_js/common_static/common/js/vendor/backbone-min.js - xmodule_js/common_static/js/vendor/backbone-associations-min.js - xmodule_js/common_static/js/vendor/backbone.paginator.min.js - xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker.js diff --git a/cms/static/karma_cms.conf.js b/cms/static/karma_cms.conf.js index 8be90301eb..f86da7cc51 100644 --- a/cms/static/karma_cms.conf.js +++ b/cms/static/karma_cms.conf.js @@ -35,7 +35,7 @@ var libraryFiles = [ {pattern: 'xmodule_js/common_static/js/vendor/jquery.simulate.js', included: false}, {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js', included: false}, {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.string.js', included: false}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone-min.js', included: false}, + {pattern: 'xmodule_js/common_static/common/js/vendor/backbone-min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/backbone-associations-min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/backbone.paginator.min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/backbone-relational.min.js', included: false}, diff --git a/cms/static/karma_cms_squire.conf.js b/cms/static/karma_cms_squire.conf.js index 7ac88b65a2..7e23b748a9 100644 --- a/cms/static/karma_cms_squire.conf.js +++ b/cms/static/karma_cms_squire.conf.js @@ -35,7 +35,7 @@ var libraryFiles = [ {pattern: 'xmodule_js/common_static/js/vendor/jquery.cookie.js', included: false}, {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.js', included: false}, {pattern: 'xmodule_js/common_static/common/js/vendor/underscore.string.js', included: false}, - {pattern: 'xmodule_js/common_static/js/vendor/backbone-min.js', included: false}, + {pattern: 'xmodule_js/common_static/common/js/vendor/backbone-min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/backbone-associations-min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/backbone.paginator.min.js', included: false}, {pattern: 'xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker.js', included: false}, diff --git a/common/djangoapps/pipeline_mako/tests/test_render.py b/common/djangoapps/pipeline_mako/tests/test_render.py index d505cee33c..d99d337572 100644 --- a/common/djangoapps/pipeline_mako/tests/test_render.py +++ b/common/djangoapps/pipeline_mako/tests/test_render.py @@ -15,7 +15,7 @@ class RequireJSPathOverridesTest(TestCase): OVERRIDES = { 'jquery': 'js/vendor/jquery.min.js', - 'backbone': 'js/vendor/backbone-min.js', + 'backbone': 'common/js/vendor/backbone-min.js', 'text': 'js/vendor/text.js' } @@ -26,7 +26,7 @@ class RequireJSPathOverridesTest(TestCase): "paths: {", "'jquery': 'js/vendor/jquery.min',", "'text': 'js/vendor/text',", - "'backbone': 'js/vendor/backbone-min'", + "'backbone': 'common/js/vendor/backbone-min'", "}", "});", "}).call(this, require || RequireJS.require);", diff --git a/common/lib/xmodule/xmodule/js/js_test.yml b/common/lib/xmodule/xmodule/js/js_test.yml index 73403b619b..515101ab03 100644 --- a/common/lib/xmodule/xmodule/js/js_test.yml +++ b/common/lib/xmodule/xmodule/js/js_test.yml @@ -46,7 +46,7 @@ lib_paths: - common_static/js/vendor/jquery.cookie.js - common_static/js/vendor/json2.js - common_static/common/js/vendor/underscore.js - - common_static/js/vendor/backbone-min.js + - common_static/common/js/vendor/backbone-min.js - common_static/js/vendor/jquery.leanModal.js - common_static/js/vendor/CodeMirror/codemirror.js - common_static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js diff --git a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js index c183cdeb68..5ec46545ce 100644 --- a/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js +++ b/common/lib/xmodule/xmodule/js/karma_xmodule.conf.js @@ -45,7 +45,7 @@ var libraryFiles = [ {pattern: 'common_static/js/vendor/jquery.cookie.js', included: true}, {pattern: 'common_static/js/vendor/json2.js', included: true}, {pattern: 'common_static/common/js/vendor/underscore.js', included: true}, - {pattern: 'common_static/js/vendor/backbone-min.js', included: true}, + {pattern: 'common_static/common/js/vendor/backbone-min.js', included: true}, {pattern: 'common_static/js/vendor/jquery.leanModal.js', included: true}, {pattern: 'common_static/js/vendor/CodeMirror/codemirror.js', included: true}, {pattern: 'common_static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', included: true}, diff --git a/common/static/coffee/src/discussion/views/discussion_thread_view.coffee b/common/static/coffee/src/discussion/views/discussion_thread_view.coffee index 6ee84303bb..9f092fd686 100644 --- a/common/static/coffee/src/discussion/views/discussion_thread_view.coffee +++ b/common/static/coffee/src/discussion/views/discussion_thread_view.coffee @@ -20,6 +20,7 @@ if Backbone? super() @mode = options.mode or "inline" # allowed values are "tab" or "inline" @context = options.context or "course" # allowed values are "course" or "standalone" + @course_settings = options.course_settings if @mode not in ["tab", "inline"] throw new Error("invalid mode: " + @mode) @@ -307,7 +308,7 @@ if Backbone? model: @model mode: @mode context: @context - course_settings: @options.course_settings + course_settings: @course_settings ) @editView.bind "thread:updated thread:cancel_edit", @closeEditView @editView.bind "comment:endorse", @endorseThread diff --git a/common/static/common/js/components/collections/paging_collection.js b/common/static/common/js/components/collections/paging_collection.js index 3acb1e033d..b556a86bee 100644 --- a/common/static/common/js/components/collections/paging_collection.js +++ b/common/static/common/js/components/collections/paging_collection.js @@ -20,7 +20,12 @@ 'use strict'; define(['backbone.paginator'], function (BackbonePaginator) { var PagingCollection = BackbonePaginator.requestPager.extend({ - initialize: function () { + initialize: function (models, options) { + options = options || {}; + if (options.url) { + this.url = options.url; + } + var self = this; // These must be initialized in the constructor because otherwise all PagingCollections would point // to the same object references for sortableFields and filterableFields. diff --git a/common/static/common/js/components/views/feedback.js b/common/static/common/js/components/views/feedback.js index 0656b59458..7eccd32889 100644 --- a/common/static/common/js/components/views/feedback.js +++ b/common/static/common/js/components/views/feedback.js @@ -59,7 +59,8 @@ */ }, - initialize: function() { + initialize: function(options) { + this.options = _.extend({}, this.options, options); if (!this.options.type) { throw "SystemFeedback: type required (given " + JSON.stringify(this.options) + ")"; diff --git a/common/static/common/js/components/views/paginated_view.js b/common/static/common/js/components/views/paginated_view.js index 947ce83088..2a716a73dd 100644 --- a/common/static/common/js/components/views/paginated_view.js +++ b/common/static/common/js/components/views/paginated_view.js @@ -31,7 +31,7 @@ className: this.type + '-container', itemViewClass: this.itemViewClass }); - this.listView = new ItemListView({collection: this.options.collection}); + this.listView = new ItemListView({collection: this.collection}); this.headerView = this.createHeaderView(); this.footerView = this.createFooterView(); this.collection.on('page_changed', function () { @@ -46,12 +46,12 @@ paginationLabel: gettext("Pagination"), createHeaderView: function() { - return new PagingHeader({collection: this.options.collection, srInfo: this.srInfo}); + return new PagingHeader({collection: this.collection, srInfo: this.srInfo}); }, createFooterView: function() { return new PagingFooter({ - collection: this.options.collection, hideWhenOnePage: true, + collection: this.collection, hideWhenOnePage: true, paginationLabel: this.paginationLabel }); }, diff --git a/common/static/common/js/spec/components/search_field_spec.js b/common/static/common/js/spec/components/search_field_spec.js index 3464ef1036..2bd7dba4f2 100644 --- a/common/static/common/js/spec/components/search_field_spec.js +++ b/common/static/common/js/spec/components/search_field_spec.js @@ -21,8 +21,7 @@ define([ current_page: 1, start: 0, results: _.first(results, perPage) - }, - {parse: true} + } ); collection.start = 0; collection.totalCount = results.length; diff --git a/common/static/common/js/spec/main_requirejs.js b/common/static/common/js/spec/main_requirejs.js index 1601d8a0a0..c6fb079f91 100644 --- a/common/static/common/js/spec/main_requirejs.js +++ b/common/static/common/js/spec/main_requirejs.js @@ -25,7 +25,7 @@ 'text': 'js/vendor/requirejs/text', 'underscore': 'common/js/vendor/underscore', 'underscore.string': 'common/js/vendor/underscore.string', - 'backbone': 'js/vendor/backbone-min', + 'backbone': 'common/js/vendor/backbone-min', 'backbone.associations': 'js/vendor/backbone-associations-min', 'backbone.paginator': 'js/vendor/backbone.paginator.min', 'backbone-super': 'js/vendor/backbone-super', diff --git a/common/static/js/vendor/backbone-min.js b/common/static/js/vendor/backbone-min.js deleted file mode 100644 index bce4fbc1b1..0000000000 --- a/common/static/js/vendor/backbone-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=k[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var S=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var $=/\((.*?)\)/g;var T=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(S.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace($,"(?:$1)?").replace(T,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var P=/^\/+|\/+$/g;var O=/msie [\w.]+/;var C=/\/$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.substr(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({},{root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=O.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(P,"/");if(r&&this._wantsHashChange){this.iframe=a.$('