From 5465bda5f3e10efbcd59bb451e5ca2c84860c38a Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Wed, 29 May 2013 17:00:25 -0400 Subject: [PATCH] Use MITX_FEATURES to tell if we're in the CMS; this is much cleaner. Also use $.data instead of a hidden div. --- cms/envs/common.py | 5 ++++- .../xmodule/js/src/video/display/video_player.coffee | 2 +- common/lib/xmodule/xmodule/video_module.py | 3 +-- lms/templates/video.html | 8 +------- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 90e15186d7..3f322b5001 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -40,7 +40,10 @@ MITX_FEATURES = { 'SEGMENT_IO': True, # Enable URL that shows information about the status of various services - 'ENABLE_SERVICE_STATUS': False + 'ENABLE_SERVICE_STATUS': False, + + # We're in the CMS. + 'IN_CMS': True } ENABLE_JASMINE = False diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index f02386dc43..47f822bd92 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -66,7 +66,7 @@ class @VideoPlayer extends Subview at: 'top center' onReady: (event) => - unless onTouchBasedDevice() or $('#in_lms').hasClass('false') + unless onTouchBasedDevice() or $('.video:first').data('in-cms') $('.video-load-complete:first').data('video').player.play() onStateChange: (event) => diff --git a/common/lib/xmodule/xmodule/video_module.py b/common/lib/xmodule/xmodule/video_module.py index 9e2ca892e2..f902a9665b 100644 --- a/common/lib/xmodule/xmodule/video_module.py +++ b/common/lib/xmodule/xmodule/video_module.py @@ -139,8 +139,7 @@ class VideoModule(VideoFields, XModule): 'show_captions': self.show_captions, 'start': self.start_time, 'end': self.end_time, - 'normal_speed_video_id': normal_speed_video_id, - 'in_lms': not self.system.debug + 'normal_speed_video_id': normal_speed_video_id }) diff --git a/lms/templates/video.html b/lms/templates/video.html index 558c7acec2..0bbcf046cd 100644 --- a/lms/templates/video.html +++ b/lms/templates/video.html @@ -16,7 +16,7 @@ width="640" height="390"> %else: -
+
@@ -39,9 +39,3 @@

Download subtitles here.

% endif - -%if in_lms: - -%else: - -%endif