Commit c9b0568a by Gabe Mulley

Merge branch 'release'

Conflicts:
	cms/djangoapps/contentstore/views/item.py
parents 39105f76 0ad53f60
...@@ -145,8 +145,7 @@ define(["jquery", "underscore", "jquery.ajaxQueue"], function($, _) { ...@@ -145,8 +145,7 @@ define(["jquery", "underscore", "jquery.ajaxQueue"], function($, _) {
} }
var link = document.createElement('a'), var link = document.createElement('a'),
allowedProtocols = ['https'], match;
match, protocol;
link.href = url; link.href = url;
match = link.pathname match = link.pathname
...@@ -154,8 +153,7 @@ define(["jquery", "underscore", "jquery.ajaxQueue"], function($, _) { ...@@ -154,8 +153,7 @@ define(["jquery", "underscore", "jquery.ajaxQueue"], function($, _) {
.pop() .pop()
.match(/(.+)\.(mp4|webm)$/); .match(/(.+)\.(mp4|webm)$/);
protocol = link.protocol.slice(0, -1); if (match) {
if (match && $.inArray(protocol, allowedProtocols) !== -1) {
cache[url] = { cache[url] = {
video: match[1], video: match[1],
type: match[2] type: match[2]
......
...@@ -18,8 +18,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -18,8 +18,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
type: MetadataModel.VIDEO_LIST_TYPE, type: MetadataModel.VIDEO_LIST_TYPE,
value: [ value: [
'http://youtu.be/12345678901', 'http://youtu.be/12345678901',
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
] ]
}, },
DisplayNameEntry = { DisplayNameEntry = {
...@@ -116,10 +116,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -116,10 +116,7 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
help: 'A list of html5 sources.', help: 'A list of html5 sources.',
options: [], options: [],
type: MetadataModel.LIST_TYPE, type: MetadataModel.LIST_TYPE,
value: [ value: ['default.mp4', 'default.webm']
'https://domain.com/default.mp4',
'https://domain.com/default.webm'
]
}, },
youtubeEntry = { youtubeEntry = {
...@@ -172,15 +169,18 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -172,15 +169,18 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
}, "Defaults never loaded", 1000); }, "Defaults never loaded", 1000);
runs(function() { runs(function() {
var displayNameValue = collection[0].getValue(),
videoUrlValue = collection[1].getValue(); var displayNameValue = collection[0].getValue();
var videoUrlValue = collection[1].getValue();
expect(displayNameValue).toBe('default'); expect(displayNameValue).toBe('default');
expect(videoUrlValue).toEqual([ expect(videoUrlValue).toEqual([
'http://youtu.be/OEoXaMPEzfM', 'http://youtu.be/OEoXaMPEzfM',
'https://domain.com/default.mp4', 'default.mp4',
'https://domain.com/default.webm' 'default.webm'
]); ]);
}); });
});
it('If metadataCollection is not defined', function () { it('If metadataCollection is not defined', function () {
transcripts.syncBasicTab(null); transcripts.syncBasicTab(null);
...@@ -190,8 +190,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -190,8 +190,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
expect(videoUrlValue).toEqual([ expect(videoUrlValue).toEqual([
'http://youtu.be/12345678901', 'http://youtu.be/12345678901',
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
]); ]);
}); });
...@@ -202,8 +202,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -202,8 +202,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
model.setValue([ model.setValue([
'12345678', '12345678',
'https://domain.com/default.mp4', 'default.mp4',
'https://domain.com/default.webm' 'default.webm'
]); ]);
transcripts.syncBasicTab(metadataCollection, metadataView); transcripts.syncBasicTab(metadataCollection, metadataView);
...@@ -213,8 +213,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -213,8 +213,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
expect(videoUrlValue).toEqual([ expect(videoUrlValue).toEqual([
'', '',
'https://domain.com/default.mp4', 'default.mp4',
'https://domain.com/default.webm' 'default.webm'
]); ]);
}); });
}); });
...@@ -232,16 +232,16 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -232,16 +232,16 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
runs(function() { runs(function() {
var displayNameValue = collection[0].getValue(), var displayNameValue = collection[0].getValue();
subValue = collection[1].getValue(), var subValue = collection[1].getValue();
html5SourcesValue = collection[2].getValue(), var html5SourcesValue = collection[2].getValue();
youtubeValue = collection[3].getValue(); var youtubeValue = collection[3].getValue();
expect(displayNameValue).toBe('display value'); expect(displayNameValue).toBe('display value');
expect(subValue).toBe('default'); expect(subValue).toBe('default');
expect(html5SourcesValue).toEqual([ expect(html5SourcesValue).toEqual([
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
]); ]);
expect(youtubeValue).toBe('12345678901'); expect(youtubeValue).toBe('12345678901');
}); });
...@@ -259,8 +259,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -259,8 +259,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
expect(displayNameValue).toBe('default'); expect(displayNameValue).toBe('default');
expect(subValue).toBe('default'); expect(subValue).toBe('default');
expect(html5SourcesValue).toEqual([ expect(html5SourcesValue).toEqual([
'https://domain.com/default.mp4', 'default.mp4',
'https://domain.com/default.webm' 'default.webm'
]); ]);
expect(youtubeValue).toBe('OEoXaMPEzfM'); expect(youtubeValue).toBe('OEoXaMPEzfM');
}); });
...@@ -269,8 +269,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -269,8 +269,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
var model = transcripts.collection.models[1]; var model = transcripts.collection.models[1];
model.setValue([ model.setValue([
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
]); ]);
transcripts.syncAdvancedTab(metadataCollection); transcripts.syncAdvancedTab(metadataCollection);
...@@ -280,8 +280,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo ...@@ -280,8 +280,8 @@ function ($, Backbone, _, Utils, Editor, MetadataView, MetadataModel, MetadataCo
youtubeValue = collection[3].getValue(); youtubeValue = collection[3].getValue();
expect(html5SourcesValue).toEqual([ expect(html5SourcesValue).toEqual([
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
]); ]);
expect(youtubeValue).toBe(''); expect(youtubeValue).toBe('');
}); });
......
...@@ -27,10 +27,14 @@ function ($, _, Utils, _str) { ...@@ -27,10 +27,14 @@ function ($, _, Utils, _str) {
html5LinksList = (function (videoName) { html5LinksList = (function (videoName) {
var videoTypes = ['mp4', 'webm'], var videoTypes = ['mp4', 'webm'],
links = [ links = [
'https://somelink.com/%s.%s?param=1&param=2#hash', 'http://somelink.com/%s.%s?param=1&param=2#hash',
'https://somelink.com/%s.%s#hash', 'http://somelink.com/%s.%s#hash',
'https://somelink.com/%s.%s?param=1&param=2', 'http://somelink.com/%s.%s?param=1&param=2',
'https://somelink.com/%s.%s' 'http://somelink.com/%s.%s',
'ftp://somelink.com/%s.%s',
'https://somelink.com/%s.%s',
'somelink.com/%s.%s',
'%s.%s'
], ],
data = {}; data = {};
...@@ -186,12 +190,7 @@ function ($, _, Utils, _str) { ...@@ -186,12 +190,7 @@ function ($, _, Utils, _str) {
'http://google.com/somevideo_mp4', 'http://google.com/somevideo_mp4',
'http://google.com/somevideo:mp4', 'http://google.com/somevideo:mp4',
'http://google.com/somevideo', 'http://google.com/somevideo',
'http://google.com/somevideo.webm_', 'http://google.com/somevideo.webm_'
'http://somelink.com/video_name.mp4?param=1&param=2#hash',
'http://somelink.com/video_name.webm',
'ftp://somelink.com/video_name.mp4',
'somelink.com/video_name.webm',
'video_name.mp4'
]; ];
$.each(html5WrongUrls, function (index, link) { $.each(html5WrongUrls, function (index, link) {
......
...@@ -41,9 +41,9 @@ function ($, _, Utils, VideoList, MessageManager, MetadataView, MetadataModel, A ...@@ -41,9 +41,9 @@ function ($, _, Utils, VideoList, MessageManager, MetadataView, MetadataModel, A
options: [], options: [],
type: MetadataModel.VIDEO_LIST_TYPE, type: MetadataModel.VIDEO_LIST_TYPE,
value: [ value: [
'https://youtu.be/12345678901', 'http://youtu.be/12345678901',
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video.webm' 'video.webm'
] ]
}, },
response = JSON.stringify({ response = JSON.stringify({
...@@ -408,8 +408,8 @@ function ($, _, Utils, VideoList, MessageManager, MetadataView, MetadataModel, A ...@@ -408,8 +408,8 @@ function ($, _, Utils, VideoList, MessageManager, MetadataView, MetadataModel, A
view.setValueInEditor([ view.setValueInEditor([
'http://youtu.be/12345678901', 'http://youtu.be/12345678901',
'https://domain.com/video.mp4', 'video.mp4',
'https://domain.com/video' 'video'
]); ]);
expect(view).assertIsCorrectVideoList(value); expect(view).assertIsCorrectVideoList(value);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment