Fix secure iframes on Edge

pull/1/head
yflory 7 years ago
parent 290d668ceb
commit 05793c220c

@ -383,9 +383,18 @@ define([
var $avatar = $userAdmin.find('.cp-dropdown-button-title');
var oldUrl;
var loadingAvatar;
var to;
var updateButton = function () {
var myData = metadataMgr.getUserData();
if (!myData) { return; }
if (loadingAvatar) {
// Try again in 200ms
window.clearTimeout(to);
to = window.setTimeout(updateButton, 200);
return;
}
loadingAvatar = true;
var newName = myData.name;
var url = myData.avatar;
$displayName.text(newName || Messages.anonymous);
@ -396,8 +405,11 @@ define([
if ($img) {
$userAdmin.find('button').addClass('cp-avatar');
}
loadingAvatar = false;
});
return;
}
loadingAvatar = false;
};
metadataMgr.onChange(updateButton);
updateButton();
@ -465,12 +477,13 @@ define([
}
}
};
common.initFilePicker(common, fileDialogCfg);
common.initFilePicker(fileDialogCfg);
var pickerCfg = {
types: [type],
where: ['template']
};
common.openFilePicker(common, pickerCfg);
console.log(pickerCfg);
common.openFilePicker(pickerCfg);
};
return UI;

@ -17,6 +17,9 @@ define({
// When either the outside or inside registers a query handler, this is sent.
'EV_REGISTER_HANDLER': true,
// When an iframe is ready to receive messages
'EV_RPC_READY': true,
// Realtime events called from the outside.
// When someone joins the pad, argument is a string with their netflux id.
'EV_RT_JOIN': true,

@ -1263,7 +1263,8 @@ define([
if (APP.mobile() && !noStyle) { // noStyle means title in search result
return $container;
}
var el = path[0] === SEARCH ? undefined : filesOp.find(path);
var isVirtual = virtualCategories.indexOf(path[0]) !== -1;
var el = isVirtual ? undefined : filesOp.find(path);
path = path[0] === SEARCH ? path.slice(0,1) : path;
path.forEach(function (p, idx) {
if (isTrash && [2,3].indexOf(idx) !== -1) { return; }

@ -78,7 +78,7 @@ define([
};
var updateContainer;
var createFileDialog = function () {
var types = filters.types;
var types = filters.types || [];
// Create modal
var $blockContainer = Cryptpad.createModal({
id: 'cp-filepicker-dialog',

@ -608,7 +608,6 @@ define([
initializing = false;
onLocal(); // push local state to avoid parse errors later.
console.log(editor.getValue());
Slide.update(editor.getValue());
Cryptpad.removeLoadingScreen();
@ -736,9 +735,11 @@ define([
onConnectError();
}
});
common.isPresentUrl(function (err, val) {
isPresentMode = val;
andThen(editor, CodeMirror, common);
common.getSframeChannel().onReady(function () {
common.isPresentUrl(function (err, val) {
isPresentMode = val;
andThen(editor, CodeMirror, common);
});
});
});
};

@ -239,8 +239,6 @@ define([
});
};
$(window).resize(Slide.updateFontSize);
// Swipe
var addSwipeEvents = function () {
var touch = {
@ -294,6 +292,7 @@ define([
options = Slide.options = opt;
addEvent();
addSwipeEvents();
$(window).resize(Slide.updateFontSize);
};
Slide.setTitle = function (titleObj) {

Loading…
Cancel
Save