Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 8 years ago
commit dae17588c6

@ -77,7 +77,7 @@
</div> </div>
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -93,8 +93,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -102,7 +102,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -113,10 +113,11 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -74,7 +74,7 @@
</div> </div>
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -90,8 +90,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -99,7 +99,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -110,10 +110,11 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -200,7 +200,7 @@
</div> </div>
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -216,8 +216,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -225,7 +225,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -236,10 +236,11 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -455,11 +455,24 @@
#cryptpadTopBar .right a:hover { #cryptpadTopBar .right a:hover {
text-decoration: underline; text-decoration: underline;
} }
footer { .cp footer {
background: #cccccc; background: #cccccc;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
padding-top: 1em; padding-top: 1em;
} }
.cp footer a {
color: #555;
}
.cp footer a:visited {
color: #777;
}
.cp footer a:hover {
color: #333;
}
.cp footer li:first-child {
font-weight: bold;
text-decoration: underline;
}
html.cp, html.cp,
.cp body { .cp body {
font-size: .875em; font-size: .875em;

@ -96,7 +96,7 @@
</div> </div>
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -112,8 +112,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -121,7 +121,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -132,10 +132,11 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -1,5 +1,5 @@
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -15,8 +15,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -24,7 +24,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -35,7 +35,7 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>

@ -1,7 +1,20 @@
@import "./variables.less"; @import "./variables.less";
footer { .cp footer {
background: @dark-base; background: @dark-base;
font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
padding-top: 1em; padding-top: 1em;
} a {
color: #555;
&:visited {
color: #777;
}
&:hover {
color: #333;
}
}
li:first-child {
font-weight: bold;
text-decoration: underline;
}
}

@ -78,7 +78,7 @@
</div> </div>
<footer> <footer>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul class="list-unstyled"> <ul class="list-unstyled">
@ -94,8 +94,8 @@
<li><a href="/pad/" data-localization="main_richText"></a></li> <li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="#" data-localization="main_code"></a></li> <li><a href="#" data-localization="main_code"></a></li>
<li><a href="#" data-localization="main_slide"></a></li> <li><a href="#" data-localization="main_slide"></a></li>
<li><a href="#" data-localization="main_poll"></a></li> <li><a href="#" data-localization="main_poll"></a></li>
<li><a href="#" data-localization="main_drive"></a></li> <li><a href="#" data-localization="main_drive"></a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -103,7 +103,7 @@
<li data-localization="footer_aboutUs"><li> <li data-localization="footer_aboutUs"><li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li> <li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li> <li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaSS</a></li> <li><a href="https://www.openpass.fr/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul> </ul>
</div> </div>
<div class="col"> <div class="col">
@ -114,10 +114,11 @@
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li> <li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact">Email</a></li> <li><a href="/contact">Email</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html> </html>

@ -3,6 +3,7 @@
<head> <head>
<title>CryptPad</title> <title>CryptPad</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/> <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script data-main="main" src="/bower_components/requirejs/require.js"></script> <script data-main="main" src="/bower_components/requirejs/require.js"></script>
<script> <script>
require.config({ require.config({

@ -334,6 +334,29 @@ define([
}); });
}; };
var updateContextButton = function () {
var $li = $content.find('.selected');
if ($li.length !== 1) {
$li = $tree.find('.element.active').closest('li');
}
var $button = $driveToolbar.find('#contextButton');
if ($li.length !== 1
|| !$._data($li[0], 'events').contextmenu
|| $._data($li[0], 'events').contextmenu.length === 0) {
$button.hide();
return;
}
$button.show();
$button.css({
background: '#000'
});
window.setTimeout(function () {
$button.css({
background: ''
});
}, 500);
};
// Add the "selected" class to the "li" corresponding to the clicked element // Add the "selected" class to the "li" corresponding to the clicked element
var onElementClick = function (e, $element, path) { var onElementClick = function (e, $element, path) {
// If "Ctrl" is pressed, do not remove the current selection // If "Ctrl" is pressed, do not remove the current selection
@ -354,14 +377,7 @@ define([
} else { } else {
$element.removeClass("selected"); $element.removeClass("selected");
} }
$driveToolbar.find('#contextButton').css({ updateContextButton();
background: '#000'
});
window.setTimeout(function () {
$driveToolbar.find('#contextButton').css({
background: ''
});
}, 500);
}; };
// Open the selected context menu on the closest "li" element // Open the selected context menu on the closest "li" element
@ -408,7 +424,7 @@ define([
var openDirectoryContextMenu = function (e) { var openDirectoryContextMenu = function (e) {
var $element = $(e.target).closest('li'); var $element = $(e.target).closest('li');
$contextMenu.find('li').show(); $contextMenu.find('li').show();
if ($element.find('.file-element').length) { if ($element.is('.file-element')) {
$contextMenu.find('a.newfolder').parent('li').hide(); $contextMenu.find('a.newfolder').parent('li').hide();
} else { } else {
$contextMenu.find('a.open_ro').parent('li').hide(); $contextMenu.find('a.open_ro').parent('li').hide();
@ -420,7 +436,7 @@ define([
var openDefaultContextMenu = function (e) { var openDefaultContextMenu = function (e) {
var $element = $(e.target).closest('li'); var $element = $(e.target).closest('li');
$defaultContextMenu.find('li').show(); $defaultContextMenu.find('li').show();
if ($element.find('.file-element').length) { if ($element.is('.file-element')) {
$defaultContextMenu.find('a.newfolder').parent('li').hide(); $defaultContextMenu.find('a.newfolder').parent('li').hide();
} else { } else {
$defaultContextMenu.find('a.open_ro').parent('li').hide(); $defaultContextMenu.find('a.open_ro').parent('li').hide();
@ -1215,6 +1231,8 @@ define([
var $icon = getFileIcon(file.href); var $icon = getFileIcon(file.href);
var $element = $('<li>', { 'class': 'file-element element' }); var $element = $('<li>', { 'class': 'file-element element' });
addFileData(file.href, file.title, $element, false); addFileData(file.href, file.title, $element, false);
$element.data('path', [FILES_DATA, allfiles.indexOf(file)]);
$element.data('element', file.href);
$element.prepend($icon).dblclick(function () { $element.prepend($icon).dblclick(function () {
openFile(file.href); openFile(file.href);
}); });
@ -1324,6 +1342,7 @@ define([
if (APP.mobile) { if (APP.mobile) {
var $context = $('<button>', {'class': 'element right dropdown-bar', id: 'contextButton'}); var $context = $('<button>', {'class': 'element right dropdown-bar', id: 'contextButton'});
$context.append($('<span>', {'class': 'fa fa-caret-down'})); $context.append($('<span>', {'class': 'fa fa-caret-down'}));
$context.appendTo($toolbar.find('.rightside'));
$context.click(function (e) { $context.click(function (e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@ -1331,14 +1350,20 @@ define([
if ($li.length !== 1) { if ($li.length !== 1) {
$li = $tree.find('.element.active').closest('li'); $li = $tree.find('.element.active').closest('li');
} }
// Close if already opened
if ($iframe.find('.contextMenu:visible').length) {
module.hideMenu();
return;
}
// Open the menu
$iframe.find('.contextMenu').css({ $iframe.find('.contextMenu').css({
top: ($li.offset().top + 10) + 'px', top: ($context.offset().top + 32) + 'px',
left: ($li.offset().left + 50) + 'px' right: '0px'
}); });
$li.contextmenu(); $li.contextmenu();
}); });
$context.appendTo($toolbar.find('.rightside'));
} }
updateContextButton();
// NewButton can be undefined if we're in read only mode // NewButton can be undefined if we're in read only mode
$toolbar.find('.leftside').append(createNewButton(isInRoot)); $toolbar.find('.leftside').append(createNewButton(isInRoot));
@ -1623,7 +1648,10 @@ define([
} }
else if ($(this).hasClass('open_ro')) { else if ($(this).hasClass('open_ro')) {
var el = filesOp.findElement(files, path); var el = filesOp.findElement(files, path);
if (filesOp.isFolder(el)) { return; } if (filesOp.isPathInFilesData(path)) {
el = el.href;
}
if (!el || filesOp.isFolder(el)) { return; }
var roUrl = getReadOnlyUrl(el); var roUrl = getReadOnlyUrl(el);
openFile(roUrl); openFile(roUrl);
} }

Loading…
Cancel
Save