mirror of https://github.com/xwiki-labs/cryptpad
Merge branch '1487-print-gives-an-empty-sheet' into 2024.6.1
This commit is contained in:
commit
edef920363
|
@ -8,3 +8,8 @@
|
|||
margin: 3cm;
|
||||
size: A4 portrait;
|
||||
}
|
||||
@media print {
|
||||
body {
|
||||
background: white !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
cd $CPAD_HOME
|
||||
|
||||
if [ "$CPAD_INSTALL_ONLYOFFICE" == "yes" ]; then
|
||||
./install-onlyoffice.sh --accept-license
|
||||
./install-onlyoffice.sh --accept-license --trust-repository
|
||||
fi
|
||||
|
||||
npm run build
|
||||
|
|
|
@ -69,6 +69,10 @@ parse_arguments() {
|
|||
ACCEPT_LICENSE="1"
|
||||
shift
|
||||
;;
|
||||
-t | --trust-repository)
|
||||
TRUST_REPOSITORY="1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
show_help
|
||||
shift
|
||||
|
@ -110,17 +114,26 @@ OPTIONS:
|
|||
Accept the license of OnlyOffice and do not ask when running this
|
||||
script. Read and accept this before using this option:
|
||||
https://github.com/ONLYOFFICE/web-apps/blob/master/LICENSE.txt
|
||||
|
||||
-t, --trust-repository
|
||||
Automatically configure the cloned onlyoffice-builds repository
|
||||
as a safe.directory.
|
||||
https://git-scm.com/docs/git-config/#Documentation/git-config.txt-safedirectory
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ensure_oo_is_downloaded() {
|
||||
ensure_command_available git
|
||||
ensure_command_available git
|
||||
|
||||
if ! [ -d "$BUILDS_DIR" ]; then
|
||||
echo "Downloading OnlyOffice..."
|
||||
git clone --bare https://github.com/cryptpad/onlyoffice-builds.git "$BUILDS_DIR"
|
||||
fi
|
||||
if ! [ -d "$BUILDS_DIR" ]; then
|
||||
echo "Downloading OnlyOffice..."
|
||||
git clone --bare https://github.com/cryptpad/onlyoffice-builds.git "$BUILDS_DIR"
|
||||
fi
|
||||
if [ ${TRUST_REPOSITORY+x} ] || [ "${PROPS[trust_repository]:-no}" == yes ]; then
|
||||
git config --global --add safe.directory /cryptpad/onlyoffice-conf/onlyoffice-builds.git
|
||||
fi
|
||||
}
|
||||
|
||||
install_version() {
|
||||
|
|
|
@ -106,7 +106,7 @@ define([
|
|||
framework._.toolbar.$theme.append($showAuthorColors);
|
||||
markers.setButton($showAuthorColors);
|
||||
};
|
||||
var mkPrintButton = function (framework, $content) {
|
||||
var mkPrintButton = function (framework, $content, $print) {
|
||||
var $printButton = framework._.sfCommon.createButton('print', true);
|
||||
$printButton.click(function () {
|
||||
$print.html($content.html());
|
||||
|
@ -115,8 +115,8 @@ define([
|
|||
framework.feedback('PRINT_CODE');
|
||||
UI.clearTooltipsDelay();
|
||||
});
|
||||
var $print = UIElements.getEntryFromButton($printButton);
|
||||
framework._.toolbar.$drawer.append($print);
|
||||
var $dropdownEntry = UIElements.getEntryFromButton($printButton);
|
||||
framework._.toolbar.$drawer.append($dropdownEntry);
|
||||
};
|
||||
var mkMarkdownTb = function (editor, framework) {
|
||||
var $codeMirrorContainer = $('#cp-app-code-container');
|
||||
|
|
|
@ -919,7 +919,10 @@ define([
|
|||
};
|
||||
|
||||
const getMyOOIndex = function() {
|
||||
return findUserByOOId(myOOId).index;
|
||||
const user = findUserByOOId(myOOId);
|
||||
return user
|
||||
? user.index
|
||||
: content.ids.length; // Assign an unused id to read-only users
|
||||
};
|
||||
|
||||
var getParticipants = function () {
|
||||
|
@ -1478,6 +1481,10 @@ define([
|
|||
send({ type: "message" });
|
||||
break;
|
||||
case "saveChanges":
|
||||
if (readOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we have unsaved data before reloading for a checkpoint...
|
||||
if (APP.onStrictSaveChanges) {
|
||||
delete APP.unsavedLocks;
|
||||
|
|
|
@ -1055,7 +1055,7 @@ define([
|
|||
|
||||
var removeClient = function (ctx, cId) {
|
||||
var idx = ctx.clients.indexOf(cId);
|
||||
ctx.clients.splice(idx, 1);
|
||||
if (idx !== -1) { ctx.clients.splice(idx, 1); }
|
||||
|
||||
Object.keys(ctx.calendars).forEach(function (id) {
|
||||
var cal = ctx.calendars[id];
|
||||
|
|
Loading…
Reference in New Issue