From 044b9f5d12a34020ed5971f5a9065afc20fe3b1d Mon Sep 17 00:00:00 2001 From: Barry de Graaff Date: Tue, 20 Nov 2018 10:41:18 +0100 Subject: [PATCH] fix:https://github.com/Zimbra-Community/bigbluebutton-zimlet/issues/4 --- .../tk_barrydegraaff_bigbluebutton.js | 51 ++++++++++++------- .../tk_barrydegraaff_bigbluebutton.xml | 2 +- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.js b/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.js index c453bf5..f83d55c 100644 --- a/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.js +++ b/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.js @@ -109,16 +109,21 @@ function(itemId) { switch (itemId) { case "host": var controller = appCtxt.getCurrentController(); - zimletInstance._dialog = new ZmDialog( { title:zimletInstance.getMessage('BigBlueButtonZimlet_label') + " Host Meeting", parent:zimletInstance.getShell(), standardButtons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON], disposeOnPopDown:true } ); + zimletInstance._dialog = new ZmDialog( { title:(zimletInstance.getMessage('BigBlueButtonZimlet_label').indexOf('???') == 0) ? "BigBlueButton" : zimletInstance.getMessage('BigBlueButtonZimlet_label') + " Host Meeting", parent:zimletInstance.getShell(), standardButtons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON], disposeOnPopDown:true } ); + + var default_password = (zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords').indexOf('???') == 0) ? "Here you can set the default moderator and attendee passwords.
Changes here affect only new meetings, not already planned ones." : zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords'); + var moderator_password = (zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password').indexOf('???') == 0) ? "Moderator Password" : zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password'); + var attendee_password = (zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password').indexOf('???') == 0) ? "Attendee Password" : zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password'); + var set_defaults = (zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults').indexOf('???') == 0) ? "Set as default for future meetings" : zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults'); zimletInstance._dialog.setContent( '
'+ '
'+ - zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords')+ + default_password+ '

' + - '' + - '' + - '' + + '' + + '' + + '' + '
'+zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password')+':
'+zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password')+':
 
'+zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults')+':
'+moderator_password+':
'+attendee_password+':
 
'+set_defaults+':
' ); @@ -148,15 +153,19 @@ BigBlueButton.prototype.status = function(text, type) { BigBlueButton.prototype.prefDialog = function() { var zimletInstance = appCtxt._zimletMgr.getZimletByName('tk_barrydegraaff_bigbluebutton').handlerObject; - zimletInstance._dialog = new ZmDialog( { title:zimletInstance.getMessage('BigBlueButtonZimlet_label'), parent:this.getShell(), standardButtons:[DwtDialog.CANCEL_BUTTON,DwtDialog.OK_BUTTON], disposeOnPopDown:true } ); + var default_password = (zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords').indexOf('???') == 0) ? "Here you can set the default moderator and attendee passwords.
Changes here affect only new meetings, not already planned ones." : zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords'); + var moderator_password = (zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password').indexOf('???') == 0) ? "Moderator Password" : zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password'); + var attendee_password = (zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password').indexOf('???') == 0) ? "Attendee Password" : zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password'); + var set_defaults = (zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults').indexOf('???') == 0) ? "Set as default for future meetings" : zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults'); + zimletInstance._dialog = new ZmDialog( { title:(zimletInstance.getMessage('BigBlueButtonZimlet_label').indexOf('???') == 0) ? "BigBlueButton" : zimletInstance.getMessage('BigBlueButtonZimlet_label'), parent:this.getShell(), standardButtons:[DwtDialog.CANCEL_BUTTON,DwtDialog.OK_BUTTON], disposeOnPopDown:true } ); zimletInstance._dialog.setContent( '
'+ '
'+ - zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords')+ + default_password+ '

' + - '' + - '' + + '' + + '' + '
'+zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password')+':
'+zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password')+':
'+moderator_password+':
'+attendee_password+':
' ); @@ -210,7 +219,6 @@ BigBlueButton.prototype.initializeToolbar = function(app, toolbar, controller, v BigBlueButton.prototype._initCalendarBigBlueButtonToolbar = function(toolbar, controller) { var zimletInstance = appCtxt._zimletMgr.getZimletByName('tk_barrydegraaff_bigbluebutton').handlerObject; if (!toolbar.getButton("BIGBLUEBUTTON2")) { - //ZmMsg.sforceAdd = this.getMessage("BigBlueButtonZimlet_saveAsBigBlueButton"); var buttonIndex = toolbar.opList.length + 1; var button = toolbar.createOp("BIGBLUEBUTTON2", {image:"tk_barrydegraaff_bigbluebutton-panelIcon", text:"BigBlueButton", index:buttonIndex}); toolbar.addOp("BIGBLUEBUTTON2", buttonIndex); @@ -244,16 +252,19 @@ BigBlueButton.prototype._AddBigBlueButtonLinkHandler = function() { } var controller = appCtxt.getCurrentController(); - zimletInstance._dialog = new ZmDialog( { title:zimletInstance.getMessage('BigBlueButtonZimlet_label'), parent:zimletInstance.getShell(), standardButtons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON], disposeOnPopDown:true } ); - + zimletInstance._dialog = new ZmDialog( { title:(zimletInstance.getMessage('BigBlueButtonZimlet_label').indexOf('???') == 0) ? "BigBlueButton" : zimletInstance.getMessage('BigBlueButtonZimlet_label'), parent:zimletInstance.getShell(), standardButtons:[DwtDialog.OK_BUTTON,DwtDialog.CANCEL_BUTTON], disposeOnPopDown:true } ); + var default_password = (zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords').indexOf('???') == 0) ? "Here you can set the default moderator and attendee passwords.
Changes here affect only new meetings, not already planned ones." : zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords'); + var moderator_password = (zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password').indexOf('???') == 0) ? "Moderator Password" : zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password'); + var attendee_password = (zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password').indexOf('???') == 0) ? "Attendee Password" : zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password'); + var set_defaults = (zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults').indexOf('???') == 0) ? "Set as default for future meetings" : zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults'); zimletInstance._dialog.setContent( '
'+ '
'+ - zimletInstance.getMessage('BigBlueButtonZimlet_default_passwords')+ + default_password+ '

' + - '' + - '' + - '' + + '' + + '' + + '' + '
'+zimletInstance.getMessage('BigBlueButtonZimlet_moderator_password')+':
'+zimletInstance.getMessage('BigBlueButtonZimlet_attendee_password')+':
 
'+zimletInstance.getMessage('BigBlueButtonZimlet_set_defaults')+':
'+moderator_password+':
'+attendee_password+':
 
'+set_defaults+':
' ); @@ -327,7 +338,8 @@ BigBlueButton.prototype._JumpToBigBlueButtonListener = function() { } else { - BigBlueButton.prototype.status(zimletInstance.getMessage('BigBlueButtonZimlet_password_required'), ZmStatusView.LEVEL_WARNING); + var password_required = (zimletInstance.getMessage('BigBlueButtonZimlet_password_required').indexOf('???') == 0) ? "Please set a Moderator and Attendee Password" : zimletInstance.getMessage('BigBlueButtonZimlet_password_required'); + BigBlueButton.prototype.status(password_required, ZmStatusView.LEVEL_WARNING); } }; @@ -366,7 +378,7 @@ BigBlueButton.prototype._AddBigBlueButtonLinkInserter = function() { if(meetingId.match(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i)) { - var message = zimletInstance.getMessage('BigBlueButtonZimlet_Meeting_Message'); + var message = (zimletInstance.getMessage('BigBlueButtonZimlet_Meeting_Message').indexOf('???') == 0) ? "To join the Meeting Online go to:\r\n[meetinglink]\r\n\r\nYou can use the following password:\r\n[password]\r\n" : zimletInstance.getMessage('BigBlueButtonZimlet_Meeting_Message'); var editorType = "HTML"; if (controller._composeView.getComposeMode() != "text/html") { editorType = "PLAIN_TEXT"; @@ -415,7 +427,8 @@ BigBlueButton.prototype._AddBigBlueButtonLinkInserter = function() { } else { - BigBlueButton.prototype.status(zimletInstance.getMessage('BigBlueButtonZimlet_password_required'), ZmStatusView.LEVEL_WARNING); + var password_required = (zimletInstance.getMessage('BigBlueButtonZimlet_password_required').indexOf('???') == 0) ? "Please set a Moderator and Attendee Password" : zimletInstance.getMessage('BigBlueButtonZimlet_password_required'); + BigBlueButton.prototype.status(password_required, ZmStatusView.LEVEL_WARNING); } }; diff --git a/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.xml b/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.xml index 0bec0dc..3196744 100644 --- a/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.xml +++ b/zimlet/tk_barrydegraaff_bigbluebutton/tk_barrydegraaff_bigbluebutton.xml @@ -1,4 +1,4 @@ - + BigBlueButton.png tk_barrydegraaff_bigbluebutton.js