Updated Plugins (markdown)
parent
089a763564
commit
e5c8c08e91
1 changed files with 54 additions and 24 deletions
78
Plugins.md
78
Plugins.md
|
@ -5,57 +5,87 @@ You can add CSS too, create the file `~/Library/Application Support/Tentia/Plugi
|
|||
To ease plugins development you can enable WebKit inspector for Tent windows using executing this command in a Terminal window: `defaults write nu.jabs.apps.tentia WebKitDeveloperExtras -bool YES`.
|
||||
To open the inspector, right click on the view and choose `Inspect Element` from the contextual menu.
|
||||
|
||||
You can use the embeded jQuery too.
|
||||
|
||||
***
|
||||
|
||||
|
||||
## Hide posts with stopwords plugin
|
||||
|
||||
``` js
|
||||
// hide posts with stopwords
|
||||
$(document).ready(function() {
|
||||
if(tentia_instance.action == "timeline") {
|
||||
tentia_instance.body.addEventListener( 'DOMNodeInserted', filter, false );
|
||||
}
|
||||
if(tentia_instance.action == 'timeline') {
|
||||
tentia_instance.body.addEventListener( 'DOMNodeInserted', filter, false );
|
||||
}
|
||||
});
|
||||
|
||||
function filter(e) {
|
||||
var stopwords = [
|
||||
// Add the stopwords here
|
||||
"apple",
|
||||
"#iPhone"
|
||||
];
|
||||
var element = e.target;
|
||||
var parent = element.parentNode;
|
||||
if(parent != tentia_instance.body) return;
|
||||
var text = element.innerHTML;
|
||||
for(var i=0, count=stopwords.length; i<count; ++i) {
|
||||
if(text.indexOf(stopwords[i]) > -1) {
|
||||
parent.removeChild(element);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var stopwords = [
|
||||
// Add the stopwords here
|
||||
'apple',
|
||||
'#iPhone'
|
||||
];
|
||||
var element = e.target;
|
||||
var parent = element.parentNode;
|
||||
if(parent != tentia_instance.body) return;
|
||||
var text = element.innerHTML;
|
||||
for(var i=0, count=stopwords.length; i<count; ++i) {
|
||||
if(text.indexOf(stopwords[i]) > -1) {
|
||||
parent.removeChild(element);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can use the embeded jQuery too, here for example a plugin which lets you mark particular posts so you don't forget them in your timeline:
|
||||
|
||||
## Mark post plugin
|
||||
|
||||
A plugin which lets you mark particular posts so you don't forget them in your timeline
|
||||
|
||||
``` js
|
||||
$("ol").delegate('a', 'click dblclick', function(e) {
|
||||
// mark posts with dbl-click
|
||||
$('ol').delegate('a', 'click dblclick', function(e) {
|
||||
e.stopPropagation();
|
||||
}).delegate('li', 'dblclick', function(e) {
|
||||
var li = $(this);
|
||||
if(li.hasClass("selected")) {
|
||||
li.removeClass("selected");
|
||||
if(li.hasClass('selected')) {
|
||||
li.removeClass('selected');
|
||||
} else {
|
||||
li.addClass("selected");
|
||||
li.addClass('selected');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
And add this to your CSS plugin file.
|
||||
And add this to your CSS plugin file:
|
||||
|
||||
``` css
|
||||
/* mark posts with dbl-click */
|
||||
.selected {
|
||||
border-left: 5px solid green;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Make the font BIGGER
|
||||
|
||||
Better readability on big resolutions screens (css)
|
||||
|
||||
``` css
|
||||
/* bigger font */
|
||||
ol li .message {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Show the URIs instead of the names
|
||||
|
||||
``` js
|
||||
// show the URIs instead of the names
|
||||
$('ol li a.name').each(function (i, e) {
|
||||
e.title = e.innerHTML
|
||||
e.innerHTML = '^' + e.href.replace(/^http(s)?:\/\//i,'').replace(/\/$/,'')
|
||||
})
|
||||
```
|
||||
|
|
Reference in a new issue