|
|
|
@ -143,9 +143,9 @@ var Infowindow = View.extend({
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!this._isValidURL(url)) {
|
|
|
|
|
if (!this._isValidVideoURL(url)) {
|
|
|
|
|
this._stopCoverLoader();
|
|
|
|
|
this._showInfowindowImageError();
|
|
|
|
|
this._showInfowindowVideoError();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -155,6 +155,20 @@ var Infowindow = View.extend({
|
|
|
|
|
this._loadCoverFromUrl(url);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_isValidVideoURL: function (url) {
|
|
|
|
|
if (url) {
|
|
|
|
|
var urlPattern = /^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-|]*[\w@?^=%&\/~+#-])?$/;
|
|
|
|
|
return String(url).match(urlPattern) !== null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_showInfowindowVideoError: function () {
|
|
|
|
|
this.$('.js-infowindow').addClass('is-fail');
|
|
|
|
|
this.$('.js-cover').append('<p class="CDB-infowindow-fail">Non-valid Video URL</p>');
|
|
|
|
|
},
|
|
|
|
|
// end video
|
|
|
|
|
|
|
|
|
|
_initBinds: function () {
|
|
|
|
|