Updates jquery-impromptu in order to fix issues with modal dialogs.

This commit is contained in:
paweldomas 2015-03-10 13:47:47 +01:00
parent f48633fa1d
commit c296940fd4
6 changed files with 767 additions and 559 deletions

View File

@ -41,7 +41,7 @@
Link used for inline installation of chrome desktop streaming extension, Link used for inline installation of chrome desktop streaming extension,
is updated automatically from the code with the value defined in config.js --> is updated automatically from the code with the value defined in config.js -->
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/diibjkoicjeejcmhdnailmkgecihlobk"> <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/diibjkoicjeejcmhdnailmkgecihlobk">
<script src="libs/jquery-impromptu.js"></script> <script src="libs/jquery-impromptu.js?v=2"></script>
<script src="libs/jquery.autosize.js"></script> <script src="libs/jquery.autosize.js"></script>
</head> </head>
<body> <body>

1273
libs/jquery-impromptu.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
/* global $, APP */
/* Initial "authentication required" dialog */ /* Initial "authentication required" dialog */
var authDialog = null; var authDialog = null;
/* Loop retry ID that wits for other user to create the room */ /* Loop retry ID that wits for other user to create the room */
@ -8,7 +10,7 @@ var Authentication = {
openAuthenticationDialog: function (roomName, intervalCallback, callback) { openAuthenticationDialog: function (roomName, intervalCallback, callback) {
// This is the loop that will wait for the room to be created by // This is the loop that will wait for the room to be created by
// someone else. 'auth_required.moderator' will bring us back here. // someone else. 'auth_required.moderator' will bring us back here.
authRetryId = window.setTimeout(intervalCallback , 5000); authRetryId = window.setTimeout(intervalCallback, 5000);
// Show prompt only if it's not open // Show prompt only if it's not open
if (authDialog !== null) { if (authDialog !== null) {
return; return;
@ -19,10 +21,11 @@ var Authentication = {
var title = APP.translation.generateTranslatonHTML("dialog.Stop"); var title = APP.translation.generateTranslatonHTML("dialog.Stop");
var msg = APP.translation.generateTranslatonHTML("dialog.AuthMsg", var msg = APP.translation.generateTranslatonHTML("dialog.AuthMsg",
{room: room}); {room: room});
var button = APP.translation.generateTranslatonHTML(
"dialog.Authenticate"); var buttonTxt
var buttons = {}; = APP.translation.generateTranslatonHTML("dialog.Authenticate");
buttons.authenticate = {title: button, value: "authNow"}; var buttons = [];
buttons.push({title: buttonTxt, value: "authNow"});
authDialog = APP.UI.messageHandler.openDialog( authDialog = APP.UI.messageHandler.openDialog(
title, title,
@ -41,7 +44,7 @@ var Authentication = {
} }
); );
}, },
closeAuthenticationWindow:function () { closeAuthenticationWindow: function () {
if (authenticationWindow) { if (authenticationWindow) {
authenticationWindow.close(); authenticationWindow.close();
authenticationWindow = null; authenticationWindow = null;

View File

@ -66,11 +66,15 @@ var Prezi = {
"dialog.Share"); "dialog.Share");
var backButton = APP.translation.generateTranslatonHTML( var backButton = APP.translation.generateTranslatonHTML(
"dialog.Back"); "dialog.Back");
var buttons = {}; var buttons = [];
var buttons1 = {}; var buttons1 = [];
buttons1.button1 = buttons.button1 = {title: cancelButton, value: false}; // Cancel button to both states
buttons.button2 = {title: shareButton, value: true}; buttons.push({title: cancelButton, value: false});
buttons1.button2 = {title: backButton, value: true}; buttons1.push({title: cancelButton, value: false});
// Share button
buttons.push({title: shareButton, value: true});
// Back button
buttons1.push({title: backButton, value: true});
var linkError = APP.translation.generateTranslatonHTML( var linkError = APP.translation.generateTranslatonHTML(
"dialog.preziLinkError"); "dialog.preziLinkError");
var defaultUrl = APP.translation.translateString("defaultPreziLink", var defaultUrl = APP.translation.translateString("defaultPreziLink",

View File

@ -104,8 +104,8 @@ function hangup() {
"dialog.hungUp"); "dialog.hungUp");
var button = APP.translation.generateTranslatonHTML( var button = APP.translation.generateTranslatonHTML(
"dialog.joinAgain"); "dialog.joinAgain");
var buttons = {}; var buttons = [];
buttons.joinAgain = {title: button, value: true}; buttons.push({title: button, value: true});
UI.messageHandler.openDialog( UI.messageHandler.openDialog(
title, title,

View File

@ -1,4 +1,4 @@
/* global $, jQuery */ /* global $, APP, jQuery, toastr */
var messageHandler = (function(my) { var messageHandler = (function(my) {
/** /**
@ -37,17 +37,21 @@ var messageHandler = (function(my) {
persistent, leftButtonKey, submitFunction, loadedFunction, persistent, leftButtonKey, submitFunction, loadedFunction,
closeFunction) closeFunction)
{ {
var buttons = [];
var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey); var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey);
var buttons = {}; buttons.push({ title: leftButton, value: true});
buttons.button1 = {title: leftButton, value: true};
var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel"); var cancelButton
buttons.button2 = {title: cancelButton, value: false}; = APP.translation.generateTranslatonHTML("dialog.Cancel");
buttons.push({title: cancelButton, value: false});
var message = msgString, title = titleString; var message = msgString, title = titleString;
if(titleKey) if (titleKey)
{ {
title = APP.translation.generateTranslatonHTML(titleKey); title = APP.translation.generateTranslatonHTML(titleKey);
} }
if(msgKey) { if (msgKey) {
message = APP.translation.generateTranslatonHTML(msgKey); message = APP.translation.generateTranslatonHTML(msgKey);
} }
$.prompt(message, { $.prompt(message, {