mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-02 20:34:07 +02:00
parent
24edcc3402
commit
49fa7626b6
@ -177,6 +177,42 @@
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Block: Expand shortened links.
|
||||||
|
//
|
||||||
|
(function(){
|
||||||
|
var cutStart = function(str, search){
|
||||||
|
return _.startsWith(str,search) ? str.substr(search.length) : str;
|
||||||
|
};
|
||||||
|
|
||||||
|
$(document.body).delegate("a[data-full-url]","mouseenter mouseleave",function(e){
|
||||||
|
var me = $(this);
|
||||||
|
|
||||||
|
if (e.type == "mouseenter"){
|
||||||
|
var text = me.text();
|
||||||
|
|
||||||
|
if (text.charCodeAt(text.length-1) !== 8230){ // horizontal ellipsis
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var expanded = me.attr("data-full-url");
|
||||||
|
expanded = cutStart(expanded,"https://");
|
||||||
|
expanded = cutStart(expanded,"http://");
|
||||||
|
expanded = cutStart(expanded,"www.");
|
||||||
|
|
||||||
|
me.attr("td-prev-text",text);
|
||||||
|
me.text(expanded);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var prevText = me.attr("td-prev-text");
|
||||||
|
|
||||||
|
if (prevText){
|
||||||
|
me.text(prevText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Hook into mp4 video element clicking
|
// Block: Hook into mp4 video element clicking
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user