|
|
@ -75,16 +75,16 @@ define([
|
|
|
|
return '<li'+ cls + '>' + text + '</li>\n';
|
|
|
|
return '<li'+ cls + '>' + text + '</li>\n';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var DISPLAYNAME_ID = "displayName";
|
|
|
|
var DISPLAYNAME_ID = "cp-app-profile-displayname";
|
|
|
|
var LINK_ID = "link";
|
|
|
|
var LINK_ID = "cp-app-profile-link";
|
|
|
|
var AVATAR_ID = "avatar";
|
|
|
|
var AVATAR_ID = "cp-app-profile-avatar";
|
|
|
|
var DESCRIPTION_ID = "description";
|
|
|
|
var DESCRIPTION_ID = "cp-app-profile-description";
|
|
|
|
var PUBKEY_ID = "pubKey";
|
|
|
|
var PUBKEY_ID = "cp-app-profile-pubkey";
|
|
|
|
var CREATE_ID = "createProfile";
|
|
|
|
var CREATE_ID = "cp-app-profile-create";
|
|
|
|
var HEADER_ID = "header";
|
|
|
|
var HEADER_ID = "cp-app-profile-header";
|
|
|
|
var HEADER_RIGHT_ID = "rightside";
|
|
|
|
var HEADER_RIGHT_ID = "cp-app-profile-rightside";
|
|
|
|
var CREATE_INVITE_BUTTON = 'inviteButton'; /* jshint ignore: line */
|
|
|
|
var CREATE_INVITE_BUTTON = 'cp-app-profile-invite-button'; /* jshint ignore: line */
|
|
|
|
var VIEW_PROFILE_BUTTON = 'viewProfileButton';
|
|
|
|
var VIEW_PROFILE_BUTTON = 'cp-app-profile-viewprofile-button';
|
|
|
|
|
|
|
|
|
|
|
|
var common;
|
|
|
|
var common;
|
|
|
|
var sFrameChan;
|
|
|
|
var sFrameChan;
|
|
|
@ -98,7 +98,7 @@ define([
|
|
|
|
'id': name+'Input',
|
|
|
|
'id': name+'Input',
|
|
|
|
placeholder: ph
|
|
|
|
placeholder: ph
|
|
|
|
}).val(value);
|
|
|
|
}).val(value);
|
|
|
|
var $icon = $('<span>', {'class': 'fa fa-pencil edit'});
|
|
|
|
var $icon = $('<span>', {'class': 'fa fa-pencil cp-app-profile-input-edit'});
|
|
|
|
var editing = false;
|
|
|
|
var editing = false;
|
|
|
|
var todo = function () {
|
|
|
|
var todo = function () {
|
|
|
|
if (editing) { return; }
|
|
|
|
if (editing) { return; }
|
|
|
@ -273,7 +273,7 @@ define([
|
|
|
|
if (APP.readOnly) { return; }
|
|
|
|
if (APP.readOnly) { return; }
|
|
|
|
|
|
|
|
|
|
|
|
var $delButton = $('<button>', {
|
|
|
|
var $delButton = $('<button>', {
|
|
|
|
'class': 'delete btn btn-danger fa fa-times',
|
|
|
|
'class': 'cp-app-profile-avatar-delete btn btn-danger fa fa-times',
|
|
|
|
title: Messages.fc_delete
|
|
|
|
title: Messages.fc_delete
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$span.append($delButton);
|
|
|
|
$span.append($delButton);
|
|
|
@ -333,15 +333,20 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
if (APP.readOnly) {
|
|
|
|
if (APP.readOnly) {
|
|
|
|
if (!(APP.lm.proxy.description || "").trim()) { return void $block.hide(); }
|
|
|
|
if (!(APP.lm.proxy.description || "").trim()) { return void $block.hide(); }
|
|
|
|
var $div = $('<div>', {'class': 'rendered'}).appendTo($block);
|
|
|
|
var $div = $('<div>', {'class': 'cp-app-profile-description-rendered'}).appendTo($block);
|
|
|
|
var val = Marked(APP.lm.proxy.description);
|
|
|
|
var val = Marked(APP.lm.proxy.description);
|
|
|
|
$div.html(val);
|
|
|
|
$div.html(val);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$('<h3>').text(Messages.profile_description).insertBefore($block);
|
|
|
|
$('<h3>').text(Messages.profile_description).insertBefore($block);
|
|
|
|
|
|
|
|
|
|
|
|
var $ok = $('<span>', {'class': 'ok fa fa-check', title: Messages.saved}).appendTo($block);
|
|
|
|
var $ok = $('<span>', {
|
|
|
|
var $spinner = $('<span>', {'class': 'spin fa fa-spinner fa-pulse'}).appendTo($block);
|
|
|
|
'class': 'cp-app-profile-description-ok fa fa-check',
|
|
|
|
|
|
|
|
title: Messages.saved
|
|
|
|
|
|
|
|
}).appendTo($block);
|
|
|
|
|
|
|
|
var $spinner = $('<span>', {
|
|
|
|
|
|
|
|
'class': 'cp-app-profile-description-spin fa fa-spinner fa-pulse'
|
|
|
|
|
|
|
|
}).appendTo($block);
|
|
|
|
var $textarea = $('<textarea>').val(APP.lm.proxy.description || '');
|
|
|
|
var $textarea = $('<textarea>').val(APP.lm.proxy.description || '');
|
|
|
|
$block.append($textarea);
|
|
|
|
$block.append($textarea);
|
|
|
|
var editor = APP.editor = CodeMirror.fromTextArea($textarea[0], {
|
|
|
|
var editor = APP.editor = CodeMirror.fromTextArea($textarea[0], {
|
|
|
@ -371,10 +376,8 @@ define([
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var createLeftside = function () {
|
|
|
|
var createLeftside = function () {
|
|
|
|
var $categories = $('<div>', {'class': 'categories'}).appendTo(APP.$leftside);
|
|
|
|
var $categories = $('<div>', {'class': 'cp-sidebarlayout-categories'}).appendTo(APP.$leftside);
|
|
|
|
APP.$usage = $('<div>', {'class': 'usage'}).appendTo(APP.$leftside);
|
|
|
|
var $category = $('<div>', {'class': 'cp-sidebarlayout-category'}).appendTo($categories);
|
|
|
|
|
|
|
|
|
|
|
|
var $category = $('<div>', {'class': 'category'}).appendTo($categories);
|
|
|
|
|
|
|
|
$category.append($('<span>', {'class': 'fa fa-user'}));
|
|
|
|
$category.append($('<span>', {'class': 'fa fa-user'}));
|
|
|
|
$category.addClass('cp-leftside-active');
|
|
|
|
$category.addClass('cp-leftside-active');
|
|
|
|
$category.append(Messages.profileButton);
|
|
|
|
$category.append(Messages.profileButton);
|
|
|
@ -426,10 +429,10 @@ define([
|
|
|
|
$(waitFor(Cryptpad.addLoadingScreen));
|
|
|
|
$(waitFor(Cryptpad.addLoadingScreen));
|
|
|
|
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));
|
|
|
|
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
APP.$container = $('#container');
|
|
|
|
APP.$container = $('#cp-sidebarlayout-container');
|
|
|
|
APP.$toolbar = $('#cp-toolbar');
|
|
|
|
APP.$toolbar = $('#cp-toolbar');
|
|
|
|
APP.$leftside = $('<div>', {id: 'leftSide'}).appendTo(APP.$container);
|
|
|
|
APP.$leftside = $('<div>', {id: 'cp-sidebarlayout-leftside'}).appendTo(APP.$container);
|
|
|
|
APP.$rightside = $('<div>', {id: 'rightSide'}).appendTo(APP.$container);
|
|
|
|
APP.$rightside = $('<div>', {id: 'cp-sidebarlayout-rightside'}).appendTo(APP.$container);
|
|
|
|
sFrameChan = common.getSframeChannel();
|
|
|
|
sFrameChan = common.getSframeChannel();
|
|
|
|
sFrameChan.onReady(waitFor());
|
|
|
|
sFrameChan.onReady(waitFor());
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|
}).nThen(function (/*waitFor*/) {
|
|
|
|