Merge branch 'newtoolbar' into hpbs

pull/1/head
yflory 8 years ago
commit 75f1eed712

@ -80,7 +80,7 @@ define([
var logout = common.logout = function (cb) {
[
fileHashKey,
// fileHashKey,
userHashKey,
].forEach(function (k) {
sessionStorage.removeItem(k);
@ -88,6 +88,11 @@ define([
delete localStorage[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(); }
};

@ -374,7 +374,7 @@ define([
if (config.displayed.indexOf('useradmin') !== -1) {
if (!config.userName || !config.userName.setName || !config.userName.lastName) {
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 accountName = Cryptpad.getStore().getLoginName ? Cryptpad.getStore().getLoginName() : null;
@ -388,7 +388,7 @@ define([
var $userName = $('<span>', {'class': 'userDisplayName'});
if (readOnly !== 1) {
// Hide "Display name:" in read only mode
$userName.append(Messages.user_displayName + ': ')
$userName.append(Messages.user_displayName + ': ');
}
$userName.append($displayedName.clone());
$userAdminContent.append($userName);
@ -429,12 +429,12 @@ define([
if (account) {
$button.append($('<span>', {'class': 'account-name'}).text('(' + accountName + ')'));
}
var dropdownConfig = {
var dropdownConfigUser = {
text: $button.html(), // Button initial text
options: options, // Entries displayed in the menu
left: true, // Open to the left of the button
};
var $userAdmin = Cryptpad.createDropdown(dropdownConfig);
var $userAdmin = Cryptpad.createDropdown(dropdownConfigUser);
$userContainer.append($userAdmin);
$userAdmin.find('a.logout').click(function (e) {
@ -569,9 +569,9 @@ define([
return;
}
var e = jQuery.Event("keyup");
e.which = 13;
$titleElement.find('input').trigger(e);
var ev = $.Event("keyup");
ev.which = 13;
$titleElement.find('input').trigger(ev);
/*
$titleElement.find('input').hide();

@ -495,8 +495,9 @@ define([
updateMetadata(shjson);
var newInner = JSON.parse(shjson);
var newSInner;
if (newInner.length > 2) {
var newSInner = stringify(newInner[2]);
newSInner = stringify(newInner[2]);
}
// 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
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
if (newSInner !== oldSInner) {
if (newSInner && newSInner !== oldSInner) {
notify();
}
};

@ -32,8 +32,6 @@
}
.realtime {
display: block;
overflow: auto;
max-height: 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 */
var change = function (o, n, path, throttle) {
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 userList; // List of users still connected to the channel (server IDs)
var addToUserData = function(data) {

@ -766,7 +766,7 @@ define([
}
Slide.update(remoteDoc);
if (oldDoc !== newDoc) {
if (oldDoc !== remoteDoc) {
notify();
}
};

@ -212,19 +212,19 @@ define([
}, 1000);
});
$modal.find('#button_exit').click(function (e) {
var e = jQuery.Event("keyup");
e.which = 27;
$modal.trigger(e);
var ev = $.Event("keyup");
ev.which = 27;
$modal.trigger(ev);
});
$modal.find('#button_left').click(function (e) {
var e = jQuery.Event("keyup");
e.which = 37;
$modal.trigger(e);
var ev = $.Event("keyup");
ev.which = 37;
$modal.trigger(ev);
});
$modal.find('#button_right').click(function (e) {
var e = jQuery.Event("keyup");
e.which = 39;
$modal.trigger(e);
var ev = $.Event("keyup");
ev.which = 39;
$modal.trigger(ev);
});
$(ifrw).on('keyup', function (e) {

Loading…
Cancel
Save