link shorten bugfix
subdomains and & in url didn't work
This commit is contained in:
parent
e5120f5bdf
commit
91291925c0
|
@ -863,14 +863,17 @@ function shortenUrlsInBox(shortenButton) {
|
||||||
|
|
||||||
$.each(shortenButton.parent().parent().siblings('.syntax-middle').find('span.url'),function(key,obj){
|
$.each(shortenButton.parent().parent().siblings('.syntax-middle').find('span.url'),function(key,obj){
|
||||||
|
|
||||||
var url = $.trim($(obj).html().replace(/&/gi,'&').replace(/ /gi,'').replace(/<br>/gi,''));
|
var url = $.trim($(obj).text());
|
||||||
|
|
||||||
display_spinner();
|
display_spinner();
|
||||||
|
|
||||||
$.ajax({ url: window.urlShortenerAPIURL + '?format=jsonp&action=shorturl&signature=' + window.urlShortenerSignature + '&url=' + encodeURIComponent(url), type: "GET", dataType: "jsonp", success: function(data) {
|
$.ajax({ url: window.urlShortenerAPIURL + '?format=jsonp&action=shorturl&signature=' + window.urlShortenerSignature + '&url=' + encodeURIComponent(url), type: "GET", dataType: "jsonp", success: function(data) {
|
||||||
|
|
||||||
if(typeof data.shorturl != 'undefined') {
|
if(typeof data.shorturl != 'undefined') {
|
||||||
shortenButton.parent().parent().siblings('.queet-box-syntax').html(shortenButton.parent().parent().siblings('.queet-box-syntax').html().replace(data.url.url, data.shorturl));
|
|
||||||
|
console.log(data.url);
|
||||||
|
|
||||||
|
shortenButton.parent().parent().siblings('.queet-box-syntax').html(shortenButton.parent().parent().siblings('.queet-box-syntax').html().replace($('<div/>').text(data.url.url).html(), data.shorturl));
|
||||||
shortenButton.parent().parent().siblings('.queet-box-syntax').trigger('keyup');
|
shortenButton.parent().parent().siblings('.queet-box-syntax').trigger('keyup');
|
||||||
shortenButton.addClass('disabled'); // make sure the button is disabled right after
|
shortenButton.addClass('disabled'); // make sure the button is disabled right after
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user