Remove unused files, add missing spec file.
This commit is contained in:
@@ -229,6 +229,8 @@ define([
|
||||
"js/spec/views/xblock_editor_spec",
|
||||
"js/spec/views/xblock_string_field_editor_spec",
|
||||
|
||||
"js/spec/views/utils/view_utils_spec",
|
||||
|
||||
"js/spec/views/pages/container_spec",
|
||||
"js/spec/views/pages/container_subviews_spec",
|
||||
"js/spec/views/pages/group_configurations_spec",
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
$('section.main-content').children().hide();
|
||||
|
||||
$(function(){
|
||||
$('.editable').inlineEdit();
|
||||
$('.editable-textarea').inlineEdit({control: 'textarea'});
|
||||
});
|
||||
|
||||
var heighest = 0;
|
||||
$('.cal ol > li').each(function(){
|
||||
heighest = ($(this).height() > heighest) ? $(this).height() : heighest;
|
||||
|
||||
});
|
||||
|
||||
$('.cal ol > li').css('height',heighest + 'px');
|
||||
|
||||
$('.add-new-section').click(function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.new-week .close').click( function(){
|
||||
$(this).parents('.new-week').hide();
|
||||
$('p.add-new-week').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-update').click(function(){
|
||||
$(this).parent().parent().hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
setHeight = function(){
|
||||
var windowHeight = $(this).height();
|
||||
var contentHeight = windowHeight - 29;
|
||||
|
||||
$('section.main-content > section').css('min-height', contentHeight);
|
||||
$('body.content .cal').css('height', contentHeight);
|
||||
|
||||
$('.edit-week').click( function() {
|
||||
$('body').addClass('content');
|
||||
$('body.content .cal').css('height', contentHeight);
|
||||
$('section.week-new').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cal ol li header h1 a').click( function() {
|
||||
$('body').addClass('content');
|
||||
$('body.content .cal').css('height', contentHeight);
|
||||
$('section.week-edit').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.sequence-edit').click(function(){
|
||||
$('body').addClass('content');
|
||||
$('body.content .cal').css('height', contentHeight);
|
||||
$('section.sequence-edit').show();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(setHeight);
|
||||
$(window).bind('resize', setHeight);
|
||||
|
||||
$('.video-new a').click(function(){
|
||||
$('section.video-new').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.video-edit').click(function(){
|
||||
$('section.video-edit').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.problem-new a').click(function(){
|
||||
$('section.problem-new').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.problem-edit').click(function(){
|
||||
$('section.problem-edit').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
define(["js/views/baseview", "underscore", "js/views/feedback_prompt", "js/views/section_show", "require"], function(BaseView, _, PromptView, SectionShowView, require) {
|
||||
var SectionEdit = BaseView.extend({
|
||||
render: function() {
|
||||
var attrs = {
|
||||
name: this.model.escape('name')
|
||||
};
|
||||
this.$el.html(this.template(attrs));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
initialize: function() {
|
||||
this.template = this.loadTemplate('section-name-edit');
|
||||
this.listenTo(this.model, "invalid", this.showInvalidMessage);
|
||||
this.render();
|
||||
},
|
||||
events: {
|
||||
"click .save-button": "saveName",
|
||||
"submit": "saveName",
|
||||
"click .cancel-button": "switchToShowView"
|
||||
},
|
||||
saveName: function(e) {
|
||||
if (e) { e.preventDefault(); }
|
||||
var name = this.$("input[type=text]").val();
|
||||
var that = this;
|
||||
this.model.save("name", name, {
|
||||
success: function() {
|
||||
analytics.track('Edited Section Name', {
|
||||
'course': course_location_analytics,
|
||||
'display_name': that.model.get('name'),
|
||||
'id': that.model.get('id')
|
||||
});
|
||||
that.switchToShowView();
|
||||
}
|
||||
});
|
||||
},
|
||||
switchToShowView: function() {
|
||||
if(!this.showView) {
|
||||
SectionShowView = require('js/views/section_show');
|
||||
this.showView = new SectionShowView({
|
||||
model: this.model, el: this.el, editView: this});
|
||||
}
|
||||
this.undelegateEvents();
|
||||
this.stopListening();
|
||||
this.showView.render();
|
||||
},
|
||||
showInvalidMessage: function(model, error, options) {
|
||||
model.set("name", model.previous("name"));
|
||||
var that = this;
|
||||
var prompt = new PromptView.Error({
|
||||
title: gettext("Your change could not be saved"),
|
||||
message: error,
|
||||
actions: {
|
||||
primary: {
|
||||
text: gettext("Return and resolve this issue"),
|
||||
click: function(view) {
|
||||
view.hide();
|
||||
that.$("input[type=text]").focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
prompt.show();
|
||||
}
|
||||
});
|
||||
return SectionEdit;
|
||||
});
|
||||
@@ -1,28 +0,0 @@
|
||||
define(["js/views/baseview", "underscore", "gettext", "js/views/section_edit", "require"], function(BaseView, _, gettext, SectionEditView, require) {
|
||||
|
||||
var SectionShow = BaseView.extend({
|
||||
template: _.template('<span data-tooltip="<%= gettext("Edit this section\'s name") %>" class="section-name-span"><%= name %></span>'),
|
||||
render: function() {
|
||||
var attrs = {
|
||||
name: this.model.escape('name')
|
||||
};
|
||||
this.$el.html(this.template(attrs));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
events: {
|
||||
"click": "switchToEditView"
|
||||
},
|
||||
switchToEditView: function() {
|
||||
if(!this.editView) {
|
||||
SectionEditView = require('js/views/section_edit');
|
||||
this.editView = new SectionEditView({
|
||||
model: this.model, el: this.el, showView: this});
|
||||
}
|
||||
this.undelegateEvents();
|
||||
this.editView.render();
|
||||
}
|
||||
});
|
||||
return SectionShow;
|
||||
|
||||
});
|
||||
@@ -45,8 +45,7 @@ REQUIREJS_WAIT = {
|
||||
# Content - Outline
|
||||
# Note that calling your org, course number, or display name, 'course' will mess this up
|
||||
re.compile('^Course Outline \|'): [
|
||||
"js/base", "js/models/course", "js/models/location", "js/models/section",
|
||||
"js/views/section_edit"],
|
||||
"js/base", "js/models/course", "js/models/location", "js/models/section"],
|
||||
|
||||
# Dashboard
|
||||
re.compile('^My Courses \|'): [
|
||||
|
||||
Reference in New Issue
Block a user