Skip to content

Commit

Permalink
Merge branch 'master' into PHRAS-3409-fix-prod-edit-right
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaillat authored Jul 5, 2023
2 parents 4c09140 + 1d50a66 commit 1fb391a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 48 deletions.
19 changes: 3 additions & 16 deletions Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -3882,23 +3882,24 @@ var workzoneFacets = function workzoneFacets(services) {
if (match && match[2] != null) {
// text looks like a color !
var colorCode = '#' + match[2];
// add color circle and remove color code from text;
var textWithoutColorCode = text.replace('[' + colorCode + ']', '');
if (textLimit > 0 && textWithoutColorCode.length > textLimit) {
textWithoutColorCode = textWithoutColorCode.substring(0, textLimit) + '…';
}
// patch
type = "COLOR-AGGREGATE";
label = textWithoutColorCode;
textWithoutColorCode = (0, _jquery2.default)('<div/>').text(textWithoutColorCode).html(); // escape html
tooltip = _.escape(textWithoutColorCode);

title = '<span class="color-dot" style="background-color: ' + colorCode + ';"></span> ' + tooltip;
} else {
// keep text as it is, just cut if too long
if (textLimit > 0 && text.length > textLimit) {
text = text.substring(0, textLimit) + '…';
}
label = text;
/*title = tooltip = _.escape(text);*/
title = (0, _jquery2.default)('<div/>').text(text).html(); // escape html
}

return {
Expand Down Expand Up @@ -3952,8 +3953,6 @@ var workzoneFacets = function workzoneFacets(services) {
treeSource = _shouldMaskNodes(treeSource, hiddenFacetsList);
}

treeSource = _parseColors(treeSource);

treeSource = _colorUnsetText(treeSource);

return _getFacetsTree().reload(treeSource).done(function () {
Expand All @@ -3980,18 +3979,6 @@ var workzoneFacets = function workzoneFacets(services) {
});
};

function _parseColors(source) {
_.forEach(source, function (facet) {
if (!_.isUndefined(facet.children) && facet.children.length > 0) {
_.forEach(facet.children, function (child) {
var title = child.title;
child.title = _formatColorText(title.toString());
});
}
});
return source;
}

function _formatColorText(string) {
var textLimit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

Expand Down
19 changes: 3 additions & 16 deletions Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3882,23 +3882,24 @@ var workzoneFacets = function workzoneFacets(services) {
if (match && match[2] != null) {
// text looks like a color !
var colorCode = '#' + match[2];
// add color circle and remove color code from text;
var textWithoutColorCode = text.replace('[' + colorCode + ']', '');
if (textLimit > 0 && textWithoutColorCode.length > textLimit) {
textWithoutColorCode = textWithoutColorCode.substring(0, textLimit) + '…';
}
// patch
type = "COLOR-AGGREGATE";
label = textWithoutColorCode;
textWithoutColorCode = (0, _jquery2.default)('<div/>').text(textWithoutColorCode).html(); // escape html
tooltip = _.escape(textWithoutColorCode);

title = '<span class="color-dot" style="background-color: ' + colorCode + ';"></span> ' + tooltip;
} else {
// keep text as it is, just cut if too long
if (textLimit > 0 && text.length > textLimit) {
text = text.substring(0, textLimit) + '…';
}
label = text;
/*title = tooltip = _.escape(text);*/
title = (0, _jquery2.default)('<div/>').text(text).html(); // escape html
}

return {
Expand Down Expand Up @@ -3952,8 +3953,6 @@ var workzoneFacets = function workzoneFacets(services) {
treeSource = _shouldMaskNodes(treeSource, hiddenFacetsList);
}

treeSource = _parseColors(treeSource);

treeSource = _colorUnsetText(treeSource);

return _getFacetsTree().reload(treeSource).done(function () {
Expand All @@ -3980,18 +3979,6 @@ var workzoneFacets = function workzoneFacets(services) {
});
};

function _parseColors(source) {
_.forEach(source, function (facet) {
if (!_.isUndefined(facet.children) && facet.children.length > 0) {
_.forEach(facet.children, function (child) {
var title = child.title;
child.title = _formatColorText(title.toString());
});
}
});
return source;
}

function _formatColorText(string) {
var textLimit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,16 @@ const workzoneFacets = services => {
if(match && match[2] != null) {
// text looks like a color !
var colorCode = '#' + match[2];
// add color circle and remove color code from text;
var textWithoutColorCode = text.replace('[' + colorCode + ']', '');
if (textLimit > 0 && textWithoutColorCode.length > textLimit) {
textWithoutColorCode = textWithoutColorCode.substring(0, textLimit) + '…';
}
// patch
type = "COLOR-AGGREGATE";
label = textWithoutColorCode;
textWithoutColorCode = $('<div/>').text(textWithoutColorCode).html(); // escape html
tooltip = _.escape(textWithoutColorCode);

title = '<span class="color-dot" style="background-color: ' + colorCode + ';"></span> ' + tooltip;
}
else {
Expand All @@ -95,7 +96,7 @@ const workzoneFacets = services => {
text = text.substring(0, textLimit) + '…';
}
label = text;
/*title = tooltip = _.escape(text);*/
title = $('<div/>').text(text).html(); // escape html
}

return {
Expand Down Expand Up @@ -154,8 +155,6 @@ const workzoneFacets = services => {
treeSource = _shouldMaskNodes(treeSource, hiddenFacetsList);
}

treeSource = _parseColors(treeSource);

treeSource = _colorUnsetText(treeSource);

return _getFacetsTree().reload(treeSource)
Expand Down Expand Up @@ -183,18 +182,6 @@ const workzoneFacets = services => {
});
};

function _parseColors(source) {
_.forEach(source, function (facet) {
if (!_.isUndefined(facet.children) && (facet.children.length > 0)) {
_.forEach(facet.children, function (child) {
var title = child.title;
child.title = _formatColorText(title.toString());
});
}
});
return source;
}

function _formatColorText(string) {
var textLimit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

Expand Down

0 comments on commit 1fb391a

Please sign in to comment.