2013-07-09 00:46:23 +08:00
|
|
|
function setTitle(title){
|
2013-08-19 22:28:33 +08:00
|
|
|
document.title= "BigBlueButton - " + title;
|
2013-07-09 00:46:23 +08:00
|
|
|
}
|
|
|
|
|
2012-08-10 02:14:20 +08:00
|
|
|
var i = 1;
|
|
|
|
function addAlert(message){
|
|
|
|
var target = document.getElementById( 'notifications' ),
|
|
|
|
contentDiv = document.createElement( "div" );
|
|
|
|
contentDiv.id = "alertDiv" + i;
|
|
|
|
i++;
|
2012-08-10 04:10:46 +08:00
|
|
|
//contentDiv.innerHTML = "<p>" + message + "</p>";
|
|
|
|
contentDiv.innerHTML = message;
|
2012-08-10 02:14:20 +08:00
|
|
|
contentDiv.style.display = "block";
|
|
|
|
target.appendChild( contentDiv );
|
|
|
|
target.hide();
|
2012-08-10 04:10:46 +08:00
|
|
|
target.setAttribute("role","alert");
|
2012-08-10 02:14:20 +08:00
|
|
|
target.show();
|
|
|
|
contentDiv.hide();
|
2012-08-10 04:10:46 +08:00
|
|
|
contentDiv.setAttribute("role","alert");
|
2012-08-10 02:14:20 +08:00
|
|
|
contentDiv.show();
|
|
|
|
}
|
|
|
|
|
2012-12-18 05:50:08 +08:00
|
|
|
function determineModifier()
|
|
|
|
{
|
|
|
|
var browser = determineBrowser();
|
|
|
|
var modifier;
|
|
|
|
if (browser == "Firefox"){
|
|
|
|
modifier = "control+";
|
|
|
|
}
|
|
|
|
else if (browser == "Chrome"){
|
|
|
|
modifier = "control+";
|
|
|
|
}
|
|
|
|
else if (browser == "Microsoft Internet Explorer"){
|
2013-05-24 02:14:50 +08:00
|
|
|
modifier = "control+shift+";
|
2012-12-18 05:50:08 +08:00
|
|
|
}
|
2013-05-24 02:14:50 +08:00
|
|
|
//else if (browser == "Safari"){
|
|
|
|
// modifier = "control+shift+";
|
|
|
|
//}
|
|
|
|
else{
|
|
|
|
modifier = "control+shift+";
|
|
|
|
}
|
|
|
|
return modifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
function determineGlobalModifier()
|
|
|
|
{
|
|
|
|
var browser = determineBrowser();
|
|
|
|
var modifier;
|
|
|
|
if (browser == "Firefox"){
|
|
|
|
modifier = "control+shift+";
|
|
|
|
}
|
|
|
|
else if (browser == "Chrome"){
|
|
|
|
modifier = "control+shift+";
|
|
|
|
}
|
|
|
|
else if (browser == "Microsoft Internet Explorer"){
|
|
|
|
modifier = "control+alt+";
|
|
|
|
}
|
|
|
|
//else if (browser == "Safari"){
|
|
|
|
// modifier = "control+alt";
|
|
|
|
//}
|
2012-12-18 05:50:08 +08:00
|
|
|
else{
|
2013-05-24 02:14:50 +08:00
|
|
|
modifier = "control+alt+";
|
2012-12-18 05:50:08 +08:00
|
|
|
}
|
|
|
|
return modifier;
|
|
|
|
}
|
|
|
|
|
2012-08-10 02:14:20 +08:00
|
|
|
function determineBrowser()
|
|
|
|
{
|
2012-08-11 05:01:54 +08:00
|
|
|
// Browser name extraction code provided by http://www.javascripter.net/faq/browsern.htm
|
|
|
|
var nVer = navigator.appVersion;
|
|
|
|
var nAgt = navigator.userAgent;
|
|
|
|
var browserName = navigator.appName;
|
|
|
|
var fullVersion = ''+parseFloat(navigator.appVersion);
|
|
|
|
var majorVersion = parseInt(navigator.appVersion,10);
|
|
|
|
var nameOffset,verOffset,ix;
|
|
|
|
|
|
|
|
// In Opera, the true version is after "Opera" or after "Version"
|
|
|
|
if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
|
|
|
|
browserName = "Opera";
|
|
|
|
fullVersion = nAgt.substring(verOffset+6);
|
|
|
|
if ((verOffset=nAgt.indexOf("Version"))!=-1)
|
|
|
|
fullVersion = nAgt.substring(verOffset+8);
|
|
|
|
}
|
|
|
|
// In MSIE, the true version is after "MSIE" in userAgent
|
|
|
|
else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
|
|
|
|
browserName = "Microsoft Internet Explorer";
|
|
|
|
fullVersion = nAgt.substring(verOffset+5);
|
|
|
|
}
|
|
|
|
// In Chrome, the true version is after "Chrome"
|
|
|
|
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
|
|
|
|
browserName = "Chrome";
|
|
|
|
fullVersion = nAgt.substring(verOffset+7);
|
|
|
|
}
|
|
|
|
// In Safari, the true version is after "Safari" or after "Version"
|
|
|
|
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
|
|
|
|
browserName = "Safari";
|
|
|
|
fullVersion = nAgt.substring(verOffset+7);
|
|
|
|
if ((verOffset=nAgt.indexOf("Version"))!=-1)
|
|
|
|
fullVersion = nAgt.substring(verOffset+8);
|
|
|
|
}
|
|
|
|
// In Firefox, the true version is after "Firefox"
|
|
|
|
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
|
|
|
|
browserName = "Firefox";
|
|
|
|
fullVersion = nAgt.substring(verOffset+8);
|
|
|
|
}
|
|
|
|
// In most other browsers, "name/version" is at the end of userAgent
|
|
|
|
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) )
|
|
|
|
{
|
|
|
|
browserName = nAgt.substring(nameOffset,verOffset);
|
|
|
|
fullVersion = nAgt.substring(verOffset+1);
|
|
|
|
if (browserName.toLowerCase()==browserName.toUpperCase()) {
|
|
|
|
browserName = navigator.appName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// trim the fullVersion string at semicolon/space if present
|
|
|
|
if ((ix=fullVersion.indexOf(";"))!=-1)
|
|
|
|
fullVersion=fullVersion.substring(0,ix);
|
|
|
|
if ((ix=fullVersion.indexOf(" "))!=-1)
|
|
|
|
fullVersion=fullVersion.substring(0,ix);
|
|
|
|
|
|
|
|
majorVersion = parseInt(''+fullVersion,10);
|
|
|
|
if (isNaN(majorVersion)) {
|
|
|
|
fullVersion = ''+parseFloat(navigator.appVersion);
|
|
|
|
majorVersion = parseInt(navigator.appVersion,10);
|
|
|
|
}
|
|
|
|
|
|
|
|
return browserName;
|
2012-08-10 02:14:20 +08:00
|
|
|
}
|