Updated Plugins (markdown)
parent
6a8b20d5fb
commit
5c6bac24a6
1 changed files with 0 additions and 21 deletions
21
Plugins.md
21
Plugins.md
|
@ -51,24 +51,3 @@ And add this to your CSS plugin file.
|
||||||
.selected {
|
.selected {
|
||||||
border-right: 5px solid green;
|
border-right: 5px solid green;
|
||||||
}
|
}
|
||||||
|
|
||||||
## Fuzzy location plugin
|
|
||||||
|
|
||||||
if (tentia_instance.action == "timeline") {
|
|
||||||
(function() {
|
|
||||||
var fuzzyness = 1; // Set how fuzzy it should be rounded. 0 ≈ country, 1 ≈ city, 6 = very exact
|
|
||||||
function shortenDecimals(number, decimals) {
|
|
||||||
return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals);
|
|
||||||
}
|
|
||||||
tentia_instance.original_sendNewMessage = tentia_instance.sendNewMessage;
|
|
||||||
tentia_instance.sendNewMessage = function(content, in_reply_to_status_id, in_reply_to_entity, location) {
|
|
||||||
if (location) {
|
|
||||||
location = [
|
|
||||||
shortenDecimals(location[0], fuzzyness),
|
|
||||||
shortenDecimals(location[1], fuzzyness)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
tentia_instance.original_sendNewMessage(content, in_reply_to_status_id, in_reply_to_entity, location);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
}
|
|
Reference in a new issue