Skip to content

Commit a44040a

Browse files
SimeonCSimeonC
authored andcommitted
fix(taTools/youtube): Change URL to be https
Fixes textAngular#351
1 parent 7afc96c commit a44040a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/textAngularSetup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,16 @@ angular.module('textAngularSetup', [])
534534
tooltiptext: taTranslations.insertVideo.tooltip,
535535
action: function(){
536536
var urlPrompt;
537-
urlPrompt = $window.prompt(taTranslations.insertVideo.dialogPrompt, 'http://');
538-
if (urlPrompt && urlPrompt !== '' && urlPrompt !== 'http://') {
537+
urlPrompt = $window.prompt(taTranslations.insertVideo.dialogPrompt, 'https://');
538+
if (urlPrompt && urlPrompt !== '' && urlPrompt !== 'https://') {
539539
// get the video ID
540540
var ids = urlPrompt.match(/(\?|&)v=[^&]*/);
541541
/* istanbul ignore else: if it's invalid don't worry - though probably should show some kind of error message */
542542
if(ids.length > 0){
543543
// create the embed link
544-
var urlLink = "http://www.youtube.com/embed/" + ids[0].substring(3);
544+
var urlLink = "https://www.youtube.com/embed/" + ids[0].substring(3);
545545
// create the HTML
546-
var embed = '<img class="ta-insert-video" src="http://img.youtube.com/vi/' + ids[0].substring(3) + '/maxresdefault.jpg" ta-insert-video="' + urlLink + '" contenteditable="false" src="" allowfullscreen="true" frameborder="0" />';
546+
var embed = '<img class="ta-insert-video" src="https://img.youtube.com/vi/' + ids[0].substring(3) + '/maxresdefault.jpg" ta-insert-video="' + urlLink + '" contenteditable="false" src="" allowfullscreen="true" frameborder="0" />';
547547
// insert
548548
return this.$editor().wrapSelection('insertHTML', embed, true);
549549
}

0 commit comments

Comments
 (0)