Skip to content

Commit

Permalink
Merge pull request #995 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/9.2.2
  • Loading branch information
LinneyS authored May 29, 2024
2 parents aa43e20 + 7008dc6 commit 7bd1cf2
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 53 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 9.2.2
## Changed
- fix settings page when tag app is disabled

## 9.2.0
## Changed
- compatible with Nextcloud 29
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.</description>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
<version>9.2.0</version>
<version>9.2.2</version>
<namespace>Onlyoffice</namespace>
<types>
<prevent_group_restriction/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "onlyoffice",
"description": "ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.",
"version": "8.2.4",
"version": "9.2.2",
"author": "Ascensio System SIA <[email protected]> (https://www.onlyoffice.com)",
"license": "AGPL-3.0",
"homepage": "https://www.onlyoffice.com",
Expand Down
112 changes: 62 additions & 50 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,62 +83,75 @@
$("#onlyofficeWatermark_link_sensitive").toggleClass("onlyoffice-hide");
});

var watermarkLists = [
"allGroups",
var watermarkGroupLists = [
"allGroups"
];

var watermarkTagLists = [
"allTags",
"linkTags",
];
OC.SystemTags.collection.fetch({
success: function () {
$.each(watermarkLists, function (i, watermarkList) {
var watermarkListToggle = function () {
if ($("#onlyofficeWatermark_" + watermarkList).prop("checked")) {
if (watermarkList.indexOf("Group") >= 0) {
OC.Settings.setupGroupsSelect($("#onlyofficeWatermark_" + watermarkList + "List"));
} else {
$("#onlyofficeWatermark_" + watermarkList + "List").select2({
allowClear: true,
closeOnSelect: false,
multiple: true,
separator: "|",
toggleSelect: true,
placeholder: t(OCA.Onlyoffice.AppName, "Select tag"),
query: _.debounce(function (query) {
query.callback({
results: OC.SystemTags.collection.filterByName(query.term)
});
}, 100, true),
initSelection: function (element, callback) {
var selection = ($(element).val() || []).split("|").map(function (tagId) {
return OC.SystemTags.collection.get(tagId);
});
callback(selection);
},
formatResult: function (tag) {
return OC.SystemTags.getDescriptiveTag(tag);
},
formatSelection: function (tag) {
return tag.get("name");
},
sortResults: function (results) {
results.sort(function (a, b) {
return OC.Util.naturalSortCompare(a.get("name"), b.get("name"));
});
return results;
}

var watermarkNodeBehaviour = function (watermark){
var watermarkListToggle = function () {
if ($("#onlyofficeWatermark_" + watermark).prop("checked")) {
if (watermark.indexOf("Group") >= 0) {
OC.Settings.setupGroupsSelect($("#onlyofficeWatermark_" + watermark + "List"));
} else {
$("#onlyofficeWatermark_" + watermark + "List").select2({
allowClear: true,
closeOnSelect: false,
multiple: true,
separator: "|",
toggleSelect: true,
placeholder: t(OCA.Onlyoffice.AppName, "Select tag"),
query: _.debounce(function (query) {
query.callback({
results: OC.SystemTags.collection.filterByName(query.term)
});
}, 100, true),
initSelection: function (element, callback) {
var selection = ($(element).val() || []).split("|").map(function (tagId) {
return OC.SystemTags.collection.get(tagId);
});
callback(selection);
},
formatResult: function (tag) {
return OC.SystemTags.getDescriptiveTag(tag);
},
formatSelection: function (tag) {
return tag.get("name");
},
sortResults: function (results) {
results.sort(function (a, b) {
return OC.Util.naturalSortCompare(a.get("name"), b.get("name"));
});
return results;
}
} else {
$("#onlyofficeWatermark_" + watermarkList + "List").select2("destroy");
}
};
});
}
} else {
$("#onlyofficeWatermark_" + watermark + "List").select2("destroy");
}
};

$("#onlyofficeWatermark_" + watermarkList).click(watermarkListToggle);
watermarkListToggle();
});
}
$("#onlyofficeWatermark_" + watermark).click(watermarkListToggle);
watermarkListToggle();
};

$.each(watermarkGroupLists, function (i, watermarkGroup) {
watermarkNodeBehaviour(watermarkGroup);
});

if (OC.SystemTags && OC.SystemTags.collection) {
OC.SystemTags.collection.fetch({
success: function () {
$.each(watermarkTagLists, function (i, watermarkTag) {
watermarkNodeBehaviour(watermarkTag);
});
}
});
}

$("#onlyofficeAddrSave").click(function () {
$(".section-onlyoffice").addClass("icon-loading");
Expand Down Expand Up @@ -280,11 +293,10 @@
watermarkSettings[watermarkLabel] = $("#onlyofficeWatermark_" + watermarkLabel).is(":checked");
});

$.each(watermarkLists, function (i, watermarkList) {
$.each(watermarkGroupLists.concat(watermarkTagLists), function (i, watermarkList) {
var list = $("#onlyofficeWatermark_" + watermarkList).is(":checked") ? $("#onlyofficeWatermark_" + watermarkList + "List").val() : "";
watermarkSettings[watermarkList + "List"] = list ? list.split("|") : [];
});

}

$.ajax({
Expand Down
2 changes: 1 addition & 1 deletion templates/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
<br />
<p><?php p($l->t("Watermark text")) ?></p>
<br />
<p class="settings-hint"><?php p($l->t("Supported placeholders")) ?>: {userId}, {date}</p>
<p class="settings-hint"><?php p($l->t("Supported placeholders")) ?>: {userId}, {date}, {themingName}</p>
<p><input id="onlyofficeWatermark_text" value="<?php p($_["watermark"]["text"]) ?>" placeholder="<?php p($l->t("DO NOT SHARE THIS")) ?> {userId} {date}" type="text"></p>

<br />
Expand Down

0 comments on commit 7bd1cf2

Please sign in to comment.