Merge branch 'newtoolbar' into hpbs
This commit is contained in:
commit
75f1eed712
@ -80,7 +80,7 @@ define([
|
|||||||
|
|
||||||
var logout = common.logout = function (cb) {
|
var logout = common.logout = function (cb) {
|
||||||
[
|
[
|
||||||
fileHashKey,
|
// fileHashKey,
|
||||||
userHashKey,
|
userHashKey,
|
||||||
].forEach(function (k) {
|
].forEach(function (k) {
|
||||||
sessionStorage.removeItem(k);
|
sessionStorage.removeItem(k);
|
||||||
@ -88,6 +88,11 @@ define([
|
|||||||
delete localStorage[k];
|
delete localStorage[k];
|
||||||
delete sessionStorage[k];
|
delete sessionStorage[k];
|
||||||
});
|
});
|
||||||
|
// Make sure we have an FS_hash in localStorage before reloading all the tabs
|
||||||
|
// so that we don't end up with tabs using different anon hashes
|
||||||
|
if (!localStorage[fileHashKey]) {
|
||||||
|
localStorage[fileHashKey] = common.createRandomHash();
|
||||||
|
}
|
||||||
if (cb) { cb(); }
|
if (cb) { cb(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -374,7 +374,7 @@ define([
|
|||||||
if (config.displayed.indexOf('useradmin') !== -1) {
|
if (config.displayed.indexOf('useradmin') !== -1) {
|
||||||
if (!config.userName || !config.userName.setName || !config.userName.lastName) {
|
if (!config.userName || !config.userName.setName || !config.userName.lastName) {
|
||||||
throw new Error("You must provide a `userName` object containing `setName` (function) " +
|
throw new Error("You must provide a `userName` object containing `setName` (function) " +
|
||||||
"and `lastName` (object) if you want to display the user admin menu.")
|
"and `lastName` (object) if you want to display the user admin menu.");
|
||||||
}
|
}
|
||||||
var $displayedName = $('<span>', {'class': USERNAME_CLS});
|
var $displayedName = $('<span>', {'class': USERNAME_CLS});
|
||||||
var accountName = Cryptpad.getStore().getLoginName ? Cryptpad.getStore().getLoginName() : null;
|
var accountName = Cryptpad.getStore().getLoginName ? Cryptpad.getStore().getLoginName() : null;
|
||||||
@ -388,7 +388,7 @@ define([
|
|||||||
var $userName = $('<span>', {'class': 'userDisplayName'});
|
var $userName = $('<span>', {'class': 'userDisplayName'});
|
||||||
if (readOnly !== 1) {
|
if (readOnly !== 1) {
|
||||||
// Hide "Display name:" in read only mode
|
// Hide "Display name:" in read only mode
|
||||||
$userName.append(Messages.user_displayName + ': ')
|
$userName.append(Messages.user_displayName + ': ');
|
||||||
}
|
}
|
||||||
$userName.append($displayedName.clone());
|
$userName.append($displayedName.clone());
|
||||||
$userAdminContent.append($userName);
|
$userAdminContent.append($userName);
|
||||||
@ -429,12 +429,12 @@ define([
|
|||||||
if (account) {
|
if (account) {
|
||||||
$button.append($('<span>', {'class': 'account-name'}).text('(' + accountName + ')'));
|
$button.append($('<span>', {'class': 'account-name'}).text('(' + accountName + ')'));
|
||||||
}
|
}
|
||||||
var dropdownConfig = {
|
var dropdownConfigUser = {
|
||||||
text: $button.html(), // Button initial text
|
text: $button.html(), // Button initial text
|
||||||
options: options, // Entries displayed in the menu
|
options: options, // Entries displayed in the menu
|
||||||
left: true, // Open to the left of the button
|
left: true, // Open to the left of the button
|
||||||
};
|
};
|
||||||
var $userAdmin = Cryptpad.createDropdown(dropdownConfig);
|
var $userAdmin = Cryptpad.createDropdown(dropdownConfigUser);
|
||||||
$userContainer.append($userAdmin);
|
$userContainer.append($userAdmin);
|
||||||
|
|
||||||
$userAdmin.find('a.logout').click(function (e) {
|
$userAdmin.find('a.logout').click(function (e) {
|
||||||
@ -569,9 +569,9 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var e = jQuery.Event("keyup");
|
var ev = $.Event("keyup");
|
||||||
e.which = 13;
|
ev.which = 13;
|
||||||
$titleElement.find('input').trigger(e);
|
$titleElement.find('input').trigger(ev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$titleElement.find('input').hide();
|
$titleElement.find('input').hide();
|
||||||
|
|||||||
@ -495,8 +495,9 @@ define([
|
|||||||
updateMetadata(shjson);
|
updateMetadata(shjson);
|
||||||
|
|
||||||
var newInner = JSON.parse(shjson);
|
var newInner = JSON.parse(shjson);
|
||||||
|
var newSInner;
|
||||||
if (newInner.length > 2) {
|
if (newInner.length > 2) {
|
||||||
var newSInner = stringify(newInner[2]);
|
newSInner = stringify(newInner[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// build a dom from HJSON, diff, and patch the editor
|
// build a dom from HJSON, diff, and patch the editor
|
||||||
@ -535,7 +536,7 @@ define([
|
|||||||
|
|
||||||
// Notify only when the content has changed, not when someone has joined/left
|
// Notify only when the content has changed, not when someone has joined/left
|
||||||
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
||||||
if (newSInner !== oldSInner) {
|
if (newSInner && newSInner !== oldSInner) {
|
||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,8 +32,6 @@
|
|||||||
}
|
}
|
||||||
.realtime {
|
.realtime {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -192,6 +192,20 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var unnotify = function () {
|
||||||
|
if (APP.tabNotification &&
|
||||||
|
typeof(APP.tabNotification.cancel) === 'function') {
|
||||||
|
APP.tabNotification.cancel();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var notify = function () {
|
||||||
|
if (Visible.isSupported() && !Visible.currently()) {
|
||||||
|
unnotify();
|
||||||
|
APP.tabNotification = Notify.tab(1000, 10);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* Any time the realtime object changes, call this function */
|
/* Any time the realtime object changes, call this function */
|
||||||
var change = function (o, n, path, throttle) {
|
var change = function (o, n, path, throttle) {
|
||||||
if (path && !Cryptpad.isArray(path)) {
|
if (path && !Cryptpad.isArray(path)) {
|
||||||
@ -402,20 +416,6 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var unnotify = function () {
|
|
||||||
if (APP.tabNotification &&
|
|
||||||
typeof(APP.tabNotification.cancel) === 'function') {
|
|
||||||
APP.tabNotification.cancel();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var notify = function () {
|
|
||||||
if (Visible.isSupported() && !Visible.currently()) {
|
|
||||||
unnotify();
|
|
||||||
APP.tabNotification = Notify.tab(1000, 10);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var userData = APP.userData = {}; // List of pretty names for all users (mapped with their ID)
|
var userData = APP.userData = {}; // List of pretty names for all users (mapped with their ID)
|
||||||
var userList; // List of users still connected to the channel (server IDs)
|
var userList; // List of users still connected to the channel (server IDs)
|
||||||
var addToUserData = function(data) {
|
var addToUserData = function(data) {
|
||||||
|
|||||||
@ -766,7 +766,7 @@ define([
|
|||||||
}
|
}
|
||||||
Slide.update(remoteDoc);
|
Slide.update(remoteDoc);
|
||||||
|
|
||||||
if (oldDoc !== newDoc) {
|
if (oldDoc !== remoteDoc) {
|
||||||
notify();
|
notify();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -212,19 +212,19 @@ define([
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
$modal.find('#button_exit').click(function (e) {
|
$modal.find('#button_exit').click(function (e) {
|
||||||
var e = jQuery.Event("keyup");
|
var ev = $.Event("keyup");
|
||||||
e.which = 27;
|
ev.which = 27;
|
||||||
$modal.trigger(e);
|
$modal.trigger(ev);
|
||||||
});
|
});
|
||||||
$modal.find('#button_left').click(function (e) {
|
$modal.find('#button_left').click(function (e) {
|
||||||
var e = jQuery.Event("keyup");
|
var ev = $.Event("keyup");
|
||||||
e.which = 37;
|
ev.which = 37;
|
||||||
$modal.trigger(e);
|
$modal.trigger(ev);
|
||||||
});
|
});
|
||||||
$modal.find('#button_right').click(function (e) {
|
$modal.find('#button_right').click(function (e) {
|
||||||
var e = jQuery.Event("keyup");
|
var ev = $.Event("keyup");
|
||||||
e.which = 39;
|
ev.which = 39;
|
||||||
$modal.trigger(e);
|
$modal.trigger(ev);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(ifrw).on('keyup', function (e) {
|
$(ifrw).on('keyup', function (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user