File manager in the home page, lint

pull/1/head
yflory 8 years ago
parent 4646d5c866
commit e3f484d876

@ -33,7 +33,7 @@ define([
// implement in alternative store
Store.setBatch = function (map, cb) {
Object.keys(map).forEach(function (key) {
safeSet(key, val);
safeSet(key, map[key]);
});
cb(void 0, map);
};

@ -40,7 +40,7 @@
<div id="main">
<center>
<img class="imgcenter cryptofist" src="/customize/cryptofist_small.png" />
<h1 data-localization="main_slogan">Unity is Strength - Collaboration is Key</h1>
<h1>Unity is Strength - Collaboration is Key</h1>
</center>
<p data-localization="main_p1"><!-- Zero Knowledge collaborative realtime editor. Protected from the NSA. --></p>
@ -65,9 +65,9 @@
<strong>OUPS</strong> Afin de pouvoir réaliser le cryptage depuis votre navigateur, Javascript est <strong>vraiment</strong> requis.
</p>
</noscript>
<h5 id="tryit" data-localization="tryIt"></h5>
<h5 id="tryit" data-localization="tryIt"></h5> (<a href="/file" target="_blank" data-localization="main_openFileManager">Open in a new tab</a>)
<!-- <table class="recent scroll" style="display:none">
<!--<table class="recent scroll" style="display:none">
<tbody>
<tr>
@ -79,9 +79,8 @@
</tr>
</tbody>
</table>
-->
<iframe src="/file#iframe" style="width: 100%; height: 500px;"></iframe>
</table>-->
<iframe src="/file/#iframe" id="fileManagerIframe" style="display: none;"></iframe>
<div id="buttons" class="buttons">
<a id="create-pad" class="button create" href="/pad/" data-localization="button_newpad"></a>

@ -321,6 +321,11 @@ tr {
font-size: medium;
padding-bottom: 1em;
}
#fileManagerIframe {
width: 100%;
height: 500px;
margin-top: 15px;
}
/* buttons */
.create,
.action {

@ -123,16 +123,19 @@ define([
if (recentPads.length) {
recentPads.sort(Cryptpad.mostRecent);
makeRecentPadsTable(recentPads);
$('iframe').attr('style', '');
$tryit.removeAttr('data-localization');
$tryit.text(Messages.recentPadsIframe);
//makeRecentPadsTable(recentPads);
}
if (hasRecent) {
/*if (hasRecent) {
$('table').attr('style', '');
// Race condition here, this is triggered before the localization in HTML
// so we have to remove the data-localization attr
$tryit.removeAttr('data-localization');
$tryit.text(Messages.recentPads);
}
}*/
});
};

@ -150,6 +150,12 @@ p, pre, td, a, table, tr {
padding-bottom: 1em;
}
#fileManagerIframe {
width: 100%;
height: 500px;
margin-top: 15px;
}
/* buttons */
.create, .action {
@thick: 2px;

@ -25,9 +25,9 @@
<strong>OUPS</strong> Afin de pouvoir réaliser le cryptage depuis votre navigateur, Javascript est <strong>vraiment</strong> requis.
</p>
</noscript>
<h5 id="tryit" data-localization="tryIt"></h5>
<h5 id="tryit" data-localization="tryIt"></h5> (<a href="/file" target="_blank" data-localization="main_openFileManager">Open in a new tab</a>)
<table class="recent scroll" style="display:none">
<!--<table class="recent scroll" style="display:none">
<tbody>
<tr>
@ -39,7 +39,8 @@
</tr>
</tbody>
</table>
</table>-->
<iframe src="/file/#iframe" id="fileManagerIframe" style="display: none;"></iframe>
<div id="buttons" class="buttons">
<a id="create-pad" class="button create" href="/pad/" data-localization="button_newpad"></a>

@ -104,6 +104,7 @@ define(function () {
out.tryIt = 'Essayez-le !';
out.recentPads = 'Vos documents récents (stockés uniquement dans votre navigateur)';
out.recentPadsIframe = 'Vos documents récents';
out.okButton = 'OK (Entrée)';
out.cancelButton = 'Annuler (Echap)';
@ -217,6 +218,7 @@ define(function () {
out.main_about = 'À propos';
out.main_about_p1 = 'Vous pouvez en apprendre davantage sur notre <a href="/privacy.html" title="">politique de confidentialité</a> et nos <a href="/terms.html">conditions d\'utilisation</a>.';
out.main_about_p2 = 'Si vous avez des questions ou commentaires, vous pouvez <a href="https://twitter.com/cryptpad">nous tweeter</a>, ouvrir une issue sur <a href="https://github.com/xwiki-labs/cryptpad/issues/" title="our issue tracker">Github</a>, venir dire bonjour sur IRC (<a href="http://webchat.freenode.net?channels=%23cryptpad&uio=MT1mYWxzZSY5PXRydWUmMTE9Mjg3JjE1PXRydWUe7" title="freenode webchat">irc.freenode.net</a>), ou <a href="mailto:research@xwiki.com">nous envoyer un email</a>.';
out.main_openFileManager = 'Ouvrir dans un nouvel onglet';
out.table_type = 'Type';
out.table_link = 'Lien';

@ -107,6 +107,7 @@ define(function () {
out.tryIt = 'Try it out!';
out.recentPads = 'Your recent pads (stored only in your browser)';
out.recentPadsIframe = 'Your recent pads';
out.okButton = 'OK (enter)';
out.cancelButton = 'Cancel (esc)';
@ -219,8 +220,8 @@ define(function () {
out.main_howitworks_p1 = 'CryptPad uses a variant of the <a href="https://en.wikipedia.org/wiki/Operational_transformation">Operational transformation</a> algorithm which is able to find distributed consensus using a <a href="https://bitcoin.org/bitcoin.pdf">Nakamoto Blockchain</a>, a construct popularized by <a href="https://en.wikipedia.org/wiki/Bitcoin">Bitcoin</a>. This way the algorithm can avoid the need for a central server to resolve Operational Transform Edit Conflicts and without the need for resolving conflicts, the server can be kept unaware of the content which is being edited on the pad.';
out.main_about = 'About';
out.main_about_p1 = 'You can read more about our <a href="/privacy.html" title="">privacy policy</a> and <a href="/terms.html">terms of service</a>.';
out.main_about_p2 = 'If you have any questions or comments, you can <a href="https://twitter.com/cryptpad">tweet us</a>, open an issue <a href="https://github.com/xwiki-labs/cryptpad/issues/" title="our issue tracker">on github</a>, come say hi on irc (<a href="http://webchat.freenode.net?channels=%23cryptpad&uio=MT1mYWxzZSY5PXRydWUmMTE9Mjg3JjE1PXRydWUe7" title="freenode webchat">irc.freenode.net</a>), or <a href="mailto:research@xwiki.com">send us an email</a>.';
out.main_openFileManager = 'Open in a new tab';
out.table_type = 'Type';
out.table_link = 'Link';

@ -227,7 +227,7 @@ define([
appStatus._onReady.forEach(function (h) {
h();
});
_onReady = [];
appStatus._onReady = [];
}
}
};
@ -348,6 +348,7 @@ define([
// Open the selected context menu on the closest "li" element
var openContextMenu = function (e, $menu) {
module.hideMenu();
e.stopPropagation();
var path = $(e.target).closest('li').data('path');
if (!path) { return; }
@ -744,13 +745,14 @@ define([
var SORT_FILE_DESC = 'sortFilesDesc';
var onSortByClick = function (e) {
var $span = $(this);
var value;
if ($span.hasClass('foldername')) {
var value = files[SORT_FOLDER_DESC];
value = files[SORT_FOLDER_DESC];
files[SORT_FOLDER_DESC] = value ? false : true;
refresh();
return;
}
var value = files[SORT_FILE_BY];
value = files[SORT_FILE_BY];
var descValue = files[SORT_FILE_DESC];
if ($span.hasClass('filename')) {
if (value === '') {
@ -1234,7 +1236,7 @@ define([
var i = 0;
var space = 10;
path.forEach(function (s) {
if (i === 0) { s = rootName(s) }
if (i === 0) { s = rootName(s); }
$div.append($('<span>', {'style': 'margin: 0 0 0 ' + i * space + 'px;'}).text(s));
$div.append($('<br>'));
i++;
@ -1263,7 +1265,7 @@ define([
else if ($(this).hasClass('newfolder')) {
var onCreated = function (info) {
module.newFolder = info.newPath;
module.displayDirectory(path);;
module.displayDirectory(path);
};
filesOp.createNewFolder(path, null, onCreated);
}
@ -1437,14 +1439,9 @@ define([
Cryptpad.styleAlerts();
if (window.location.hash && window.location.hash === "#iframe") {
$('.top-bar').hide();
$('#pad-iframe').css({
top: "0px",
height: "100%"
});
$iframe.find('body').addClass('iframe');
window.location.hash = "";
homePageIframe = true;
APP.homePageIframe = true;
}
var hash = window.location.hash.slice(1) || localStorage.FS_hash;
@ -1465,8 +1462,8 @@ define([
rt.proxy.on('create', function (info) {
var realtime = module.realtime = info.realtime;
var editHash = !readOnly ? Cryptpad.getEditHashFromKeys(info.channel, secret.keys) : undefined;
var viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys);
var editHash = APP.editHash = !readOnly ? Cryptpad.getEditHashFromKeys(info.channel, secret.keys) : undefined;
var viewHash = APP.viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys);
APP.hash = readOnly ? viewHash : editHash;
if (!readOnly && (!window.location.hash || !localStorage.FS_hash)) {
@ -1478,7 +1475,7 @@ define([
logging: true,
});
userList = APP.userList = info.userList;
var userList = APP.userList = info.userList;
var config = {
readOnly: readOnly,
ifrw: window,
@ -1490,8 +1487,23 @@ define([
var $bar = APP.$bar;
var $rightside = $bar.find('.' + Toolbar.constants.rightside);
var $userBlock = $bar.find('.' + Toolbar.constants.username);
var $editShare = $bar.find('.' + Toolbar.constants.editShare);
var $viewShare = $bar.find('.' + Toolbar.constants.viewShare);
if (APP.homePageIframe) {
var $linkToMain = $bar.find('.cryptpad-link a');
$linkToMain.attr('href', '#');
$linkToMain.attr('title', '');
$linkToMain.css('cursor', 'default');
$linkToMain.off('click');
}
if (!readOnly) {
var $backupButton = Cryptpad.createButton('', true);
$backupButton.on('click', function() {
var url = window.location.origin + window.location.pathname + '#' + editHash;
Cryptpad.alert("Backup URL for this pad. It is highly recommended that you do not share it with other people.<br>Anybody with that URL can remove all the files in your file manager.<br>" + url);
});
$userBlock.append($backupButton);
}
}).on('ready', function () {
module.files = rt.proxy;
@ -1506,6 +1518,7 @@ define([
}
initLocalStorage();
init(rt.proxy);
APP.userList.onChange();
})
.on('disconnect', function (info) {
setEditable(false);

@ -660,7 +660,7 @@ define([
});
};
var disconnect = function () {
var disconnect = function (info) {
//setEditable(false); // TODO
if (info.error) {
Cryptpad.alert(Messages.websocketError);

Loading…
Cancel
Save