URSH: Rename ursh controller return value: msg -> url

This commit is contained in:
Ergys Dona 2018-08-21 17:06:23 +02:00 committed by Adrian Moennich
parent 89dc4af965
commit 09539b83b2
2 changed files with 2 additions and 19 deletions

View File

@ -32,24 +32,7 @@ async function _makeUrshRequest(originalURL, triggerElement) {
}
const data = response.data;
if (data.success) {
$(triggerElement).copyURLTooltip(data.msg).show();
} else {
$(triggerElement).qtip({
content: {
text: $T.gettext(`URL shortening service is unavailable: ${data.msg}`),
},
hide: {
event: 'mouseleave',
fixed: true,
delay: 700,
},
show: {
event: false,
ready: true,
}
}).show();
}
$(triggerElement).copyURLTooltip(data.url).show();
}

View File

@ -48,4 +48,4 @@ class RHShortenURL(RH):
full_url = self._resolve_full_url(original_url)
self._check_host(full_url)
short_url = request_short_url(full_url)
return jsonify(success=True, msg=short_url)
return jsonify(url=short_url)