From 2286366c904b5c975fee036b833d5e4b97df1568 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 2 Oct 2014 13:21:14 -0400 Subject: [PATCH] Remove unused files, add missing spec file. --- cms/static/coffee/spec/main.coffee | 2 + cms/static/js/main.js | 85 ------------------------- cms/static/js/views/section_edit.js | 66 ------------------- cms/static/js/views/section_show.js | 28 -------- common/djangoapps/terrain/ui_helpers.py | 3 +- 5 files changed, 3 insertions(+), 181 deletions(-) delete mode 100644 cms/static/js/main.js delete mode 100644 cms/static/js/views/section_edit.js delete mode 100644 cms/static/js/views/section_show.js diff --git a/cms/static/coffee/spec/main.coffee b/cms/static/coffee/spec/main.coffee index 5ad1e24b36..10a277b28c 100644 --- a/cms/static/coffee/spec/main.coffee +++ b/cms/static/coffee/spec/main.coffee @@ -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", diff --git a/cms/static/js/main.js b/cms/static/js/main.js deleted file mode 100644 index 2d72edc4bf..0000000000 --- a/cms/static/js/main.js +++ /dev/null @@ -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; - }); - -}); - diff --git a/cms/static/js/views/section_edit.js b/cms/static/js/views/section_edit.js deleted file mode 100644 index e5cbd2869b..0000000000 --- a/cms/static/js/views/section_edit.js +++ /dev/null @@ -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; -}); diff --git a/cms/static/js/views/section_show.js b/cms/static/js/views/section_show.js deleted file mode 100644 index 802826d0d2..0000000000 --- a/cms/static/js/views/section_show.js +++ /dev/null @@ -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('" class="section-name-span"><%= name %>'), - 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; - -}); diff --git a/common/djangoapps/terrain/ui_helpers.py b/common/djangoapps/terrain/ui_helpers.py index cb05ef051f..09028a7fc5 100644 --- a/common/djangoapps/terrain/ui_helpers.py +++ b/common/djangoapps/terrain/ui_helpers.py @@ -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 \|'): [