Fixes issues after jquery-impromptu update.

This commit is contained in:
paweldomas 2015-03-11 10:03:32 +01:00
parent c296940fd4
commit 581ffec5ed
5 changed files with 58 additions and 54 deletions

View File

@ -26,4 +26,9 @@
button.jqidefaultbutton #inviteLinkRef { button.jqidefaultbutton #inviteLinkRef {
color: #2c8ad2; color: #2c8ad2;
}
#inviteLinkRef {
-webkit-user-select: text;
user-select: text;
} }

View File

@ -483,7 +483,7 @@ function onPasswordReqiured(callback) {
message += APP.translation.translateString( message += APP.translation.translateString(
"dialog.passwordRequired"); "dialog.passwordRequired");
message += '</h2>' + message += '</h2>' +
'<input id="lockKey" type="text" data-i18n=' + '<input name="lockKey" type="text" data-i18n=' +
'"[placeholder]dialog.password" placeholder="' + '"[placeholder]dialog.password" placeholder="' +
APP.translation.translateString("dialog.password") + APP.translation.translateString("dialog.password") +
'" autofocus>'; '" autofocus>';
@ -492,18 +492,17 @@ function onPasswordReqiured(callback) {
true, true,
"dialog.Ok", "dialog.Ok",
function (e, v, m, f) {}, function (e, v, m, f) {},
function (event) { null,
document.getElementById('lockKey').focus();
},
function (e, v, m, f) { function (e, v, m, f) {
if (v) { if (v) {
var lockKey = document.getElementById('lockKey'); var lockKey = f.lockKey;
if (lockKey.value !== null) { if (lockKey) {
Toolbar.setSharedKey(lockKey.value); Toolbar.setSharedKey(lockKey);
callback(lockKey.value); callback(lockKey);
} }
} }
} },
':input:first'
); );
} }
function onMucEntered(jid, id, displayName) { function onMucEntered(jid, id, displayName) {
@ -633,9 +632,9 @@ UI.showLoginPopup = function(callback)
message += APP.translation.translateString( message += APP.translation.translateString(
"dialog.passwordRequired"); "dialog.passwordRequired");
message += '</h2>' + message += '</h2>' +
'<input id="passwordrequired.username" type="text" ' + '<input name="username" type="text" ' +
'placeholder="user@domain.net" autofocus>' + 'placeholder="user@domain.net" autofocus>' +
'<input id="passwordrequired.password" ' + '<input name="password" ' +
'type="password" data-i18n="[placeholder]dialog.userPassword"' + 'type="password" data-i18n="[placeholder]dialog.userPassword"' +
' placeholder="user password">'; ' placeholder="user password">';
UI.messageHandler.openTwoButtonDialog(null, null, null, message, UI.messageHandler.openTwoButtonDialog(null, null, null, message,
@ -643,17 +642,13 @@ UI.showLoginPopup = function(callback)
"dialog.Ok", "dialog.Ok",
function (e, v, m, f) { function (e, v, m, f) {
if (v) { if (v) {
var username = document.getElementById('passwordrequired.username'); if (f.username !== null && f.password != null) {
var password = document.getElementById('passwordrequired.password'); callback(f.username, f.password);
if (username.value !== null && password.value != null) {
callback(username.value, password.value);
} }
} }
}, },
function (event) { null, null, ':input:first'
document.getElementById('passwordrequired.username').focus();
}
); );
} }

View File

@ -82,23 +82,24 @@ var Prezi = {
var openPreziState = { var openPreziState = {
state0: { state0: {
html: '<h2>' + html + '</h2>' + html: '<h2>' + html + '</h2>' +
'<input id="preziUrl" type="text" ' + '<input name="preziUrl" type="text" ' +
'data-i18n="[placeholder]defaultPreziLink" data-i18n-options=\'' + 'data-i18n="[placeholder]defaultPreziLink" data-i18n-options=\'' +
JSON.stringify({"url": "http://prezi.com/wz7vhjycl7e6/my-prezi"}) + JSON.stringify({"url": "http://prezi.com/wz7vhjycl7e6/my-prezi"}) +
'\' placeholder="' + defaultUrl + '" autofocus>', '\' placeholder="' + defaultUrl + '" autofocus>',
persistent: false, persistent: false,
buttons: buttons, buttons: buttons,
defaultButton: 1, focus: ':input:first',
submit: function(e,v,m,f){ defaultButton: 0,
submit: function (e, v, m, f) {
e.preventDefault(); e.preventDefault();
if(v) if(v)
{ {
var preziUrl = document.getElementById('preziUrl'); var preziUrl = f.preziUrl;
if (preziUrl.value) if (preziUrl)
{ {
var urlValue var urlValue
= encodeURI(UIUtil.escapeHtml(preziUrl.value)); = encodeURI(UIUtil.escapeHtml(preziUrl));
if (urlValue.indexOf('http://prezi.com/') != 0 if (urlValue.indexOf('http://prezi.com/') != 0
&& urlValue.indexOf('https://prezi.com/') != 0) && urlValue.indexOf('https://prezi.com/') != 0)
@ -130,10 +131,11 @@ var Prezi = {
linkError, linkError,
persistent: false, persistent: false,
buttons: buttons1, buttons: buttons1,
focus: ':input:first',
defaultButton: 1, defaultButton: 1,
submit:function(e,v,m,f) { submit: function (e, v, m, f) {
e.preventDefault(); e.preventDefault();
if(v==0) if (v === 0)
$.prompt.close(); $.prompt.close();
else else
$.prompt.goToState('state0'); $.prompt.goToState('state0');

View File

@ -131,25 +131,23 @@ function toggleRecording() {
var token = APP.translation.translateString("dialog.token"); var token = APP.translation.translateString("dialog.token");
APP.UI.messageHandler.openTwoButtonDialog(null, null, null, APP.UI.messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + msg + '</h2>' + '<h2>' + msg + '</h2>' +
'<input id="recordingToken" type="text" ' + '<input name="recordingToken" type="text" ' +
' data-i18n="[placeholder]dialog.token" ' + ' data-i18n="[placeholder]dialog.token" ' +
'placeholder="' + token + '" autofocus>', 'placeholder="' + token + '" autofocus>',
false, false,
"dialog.Save", "dialog.Save",
function (e, v, m, f) { function (e, v, m, f) {
if (v) { if (v) {
var token = document.getElementById('recordingToken'); var token = f.recordingToken;
if (token.value) { if (token) {
callback(UIUtil.escapeHtml(token.value)); callback(UIUtil.escapeHtml(token));
} }
} }
}, },
function (event) { null,
document.getElementById('recordingToken').focus(); function () { },
}, ':input:first'
function () {
}
); );
}, Toolbar.setRecordingButtonState, Toolbar.setRecordingButtonState); }, Toolbar.setRecordingButtonState, Toolbar.setRecordingButtonState);
} }
@ -232,22 +230,21 @@ function callSipButtonClicked()
"dialog.sipMsg"); "dialog.sipMsg");
messageHandler.openTwoButtonDialog(null, null, null, messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + sipMsg + '</h2>' + '<h2>' + sipMsg + '</h2>' +
'<input id="sipNumber" type="text"' + '<input name="sipNumber" type="text"' +
' value="' + defaultNumber + '" autofocus>', ' value="' + defaultNumber + '" autofocus>',
false, false,
"dialog.Dial", "dialog.Dial",
function (e, v, m, f) { function (e, v, m, f) {
if (v) { if (v) {
var numberInput = document.getElementById('sipNumber'); var numberInput = f.sipNumber;
if (numberInput.value) { if (numberInput) {
APP.xmpp.dial(numberInput.value, 'fromnumber', APP.xmpp.dial(
UI.getRoomName(), sharedKey); numberInput, 'fromnumber', UI.getRoomName(), sharedKey);
} }
} }
}, },
function (event) { null,
document.getElementById('sipNumber').focus(); ':input:first'
}
); );
} }
@ -377,24 +374,23 @@ var Toolbar = (function (my) {
"dialog.yourPassword"); "dialog.yourPassword");
messageHandler.openTwoButtonDialog(null, null, null, messageHandler.openTwoButtonDialog(null, null, null,
'<h2>' + msg + '</h2>' + '<h2>' + msg + '</h2>' +
'<input id="lockKey" type="text"' + '<input name="lockKey" type="text"' +
' data-i18n="[placeholder]dialog.yourPassword" ' + ' data-i18n="[placeholder]dialog.yourPassword" ' +
'placeholder="' + yourPassword + '" autofocus>', 'placeholder="' + yourPassword + '" autofocus>',
false, false,
"dialog.Save", "dialog.Save",
function (e, v) { function (e, v, m, f) {
if (v) { if (v) {
var lockKey = document.getElementById('lockKey'); var lockKey = f.lockKey;
if (lockKey.value) { if (lockKey) {
Toolbar.setSharedKey(UIUtil.escapeHtml(lockKey.value)); Toolbar.setSharedKey(
UIUtil.escapeHtml(lockKey));
lockRoom(true); lockRoom(true);
} }
} }
}, },
function () { null, null, 'input:first'
document.getElementById('lockKey').focus();
}
); );
} }
} }
@ -438,6 +434,7 @@ var Toolbar = (function (my) {
/** /**
* Opens the settings dialog. * Opens the settings dialog.
* FIXME: not used ?
*/ */
my.openSettingsDialog = function () { my.openSettingsDialog = function () {
var settings1 = APP.translation.generateTranslatonHTML( var settings1 = APP.translation.generateTranslatonHTML(

View File

@ -32,10 +32,14 @@ var messageHandler = (function(my) {
* @param submitFunction function to be called on submit * @param submitFunction function to be called on submit
* @param loadedFunction function to be called after the prompt is fully loaded * @param loadedFunction function to be called after the prompt is fully loaded
* @param closeFunction function to be called after the prompt is closed * @param closeFunction function to be called after the prompt is closed
* @param focus optional focus selector or button index to be focused after
* the dialog is opened
* @param defaultButton index of default button which will be activated when
* the user press 'enter'. Indexed from 0.
*/ */
my.openTwoButtonDialog = function(titleKey, titleString, msgKey, msgString, my.openTwoButtonDialog = function(titleKey, titleString, msgKey, msgString,
persistent, leftButtonKey, submitFunction, loadedFunction, persistent, leftButtonKey, submitFunction, loadedFunction,
closeFunction) closeFunction, focus, defaultButton)
{ {
var buttons = []; var buttons = [];
@ -58,7 +62,8 @@ var messageHandler = (function(my) {
title: title, title: title,
persistent: false, persistent: false,
buttons: buttons, buttons: buttons,
defaultButton: 1, defaultButton: defaultButton,
focus: focus,
loaded: loadedFunction, loaded: loadedFunction,
submit: submitFunction, submit: submitFunction,
close: closeFunction close: closeFunction