Updates handling links on watermarks.

When link is missing disable clicking.
This commit is contained in:
damencho 2016-09-16 14:05:39 -05:00
parent f0a898c674
commit e4c4236386
3 changed files with 30 additions and 9 deletions

View File

@ -273,6 +273,23 @@ import KeyboardShortcut from '../../keyboardshortcut/keyboardshortcut';
*/ */
parseCssInt(cssValue) { parseCssInt(cssValue) {
return parseInt(cssValue) || 0; return parseInt(cssValue) || 0;
},
/**
* Adds href value to 'a' link jquery object. If link value is null,
* undefined or empty string, disables the link.
* @param {object} aLinkElement the jquery object
* @param {string} link the link value
*/
setLinkHref(aLinkElement, link) {
if (link) {
aLinkElement.attr('href', link);
} else {
aLinkElement.css({
"pointer-events": "none",
"cursor": "default"
});
}
} }
}; };

View File

@ -414,8 +414,9 @@ export default class LargeVideoManager {
leftWatermarkDiv.css({display: 'block'}); leftWatermarkDiv.css({display: 'block'});
leftWatermarkDiv.parent().attr( UIUtil.setLinkHref(
'href', interfaceConfig.JITSI_WATERMARK_LINK); leftWatermarkDiv.parent(),
interfaceConfig.JITSI_WATERMARK_LINK);
} }
if (interfaceConfig.SHOW_BRAND_WATERMARK) { if (interfaceConfig.SHOW_BRAND_WATERMARK) {
@ -427,8 +428,9 @@ export default class LargeVideoManager {
backgroundImage: 'url(images/rightwatermark.png)' backgroundImage: 'url(images/rightwatermark.png)'
}); });
rightWatermarkDiv.parent().attr( UIUtil.setLinkHref(
'href', interfaceConfig.BRAND_WATERMARK_LINK); rightWatermarkDiv.parent(),
interfaceConfig.BRAND_WATERMARK_LINK);
} }
if (interfaceConfig.SHOW_POWERED_BY) { if (interfaceConfig.SHOW_POWERED_BY) {

View File

@ -2,6 +2,7 @@
var animateTimeout, updateTimeout; var animateTimeout, updateTimeout;
var RoomnameGenerator = require("../../util/RoomnameGenerator"); var RoomnameGenerator = require("../../util/RoomnameGenerator");
import UIUtil from "../util/UIUtil";
function enter_room() { function enter_room() {
var val = $("#enter_room_field").val(); var val = $("#enter_room_field").val();
@ -39,10 +40,10 @@ function setupWelcomePage() {
$("#welcome_page_header div[class='watermark leftwatermark']"); $("#welcome_page_header div[class='watermark leftwatermark']");
if(leftWatermarkDiv && leftWatermarkDiv.length > 0) { if(leftWatermarkDiv && leftWatermarkDiv.length > 0) {
leftWatermarkDiv.css({display: 'block'}); leftWatermarkDiv.css({display: 'block'});
leftWatermarkDiv.parent().get(0).href = UIUtil.setLinkHref(
interfaceConfig.JITSI_WATERMARK_LINK; leftWatermarkDiv.parent(),
interfaceConfig.JITSI_WATERMARK_LINK);
} }
} }
if (interfaceConfig.SHOW_BRAND_WATERMARK) { if (interfaceConfig.SHOW_BRAND_WATERMARK) {
@ -50,8 +51,9 @@ function setupWelcomePage() {
$("#welcome_page_header div[class='watermark rightwatermark']"); $("#welcome_page_header div[class='watermark rightwatermark']");
if(rightWatermarkDiv && rightWatermarkDiv.length > 0) { if(rightWatermarkDiv && rightWatermarkDiv.length > 0) {
rightWatermarkDiv.css({display: 'block'}); rightWatermarkDiv.css({display: 'block'});
rightWatermarkDiv.parent().get(0).href = UIUtil.setLinkHref(
interfaceConfig.BRAND_WATERMARK_LINK; rightWatermarkDiv.parent(),
interfaceConfig.BRAND_WATERMARK_LINK);
rightWatermarkDiv.get(0).style.backgroundImage = rightWatermarkDiv.get(0).style.backgroundImage =
"url(images/rightwatermark.png)"; "url(images/rightwatermark.png)";
} }