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 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.
|
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
|
## Hide posts with stopwords plugin
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
// hide posts with stopwords
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
if(tentia_instance.action == "timeline") {
|
if(tentia_instance.action == 'timeline') {
|
||||||
tentia_instance.body.addEventListener( 'DOMNodeInserted', filter, false );
|
tentia_instance.body.addEventListener( 'DOMNodeInserted', filter, false );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function filter(e) {
|
function filter(e) {
|
||||||
var stopwords = [
|
var stopwords = [
|
||||||
// Add the stopwords here
|
// Add the stopwords here
|
||||||
"apple",
|
'apple',
|
||||||
"#iPhone"
|
'#iPhone'
|
||||||
];
|
];
|
||||||
var element = e.target;
|
var element = e.target;
|
||||||
var parent = element.parentNode;
|
var parent = element.parentNode;
|
||||||
if(parent != tentia_instance.body) return;
|
if(parent != tentia_instance.body) return;
|
||||||
var text = element.innerHTML;
|
var text = element.innerHTML;
|
||||||
for(var i=0, count=stopwords.length; i<count; ++i) {
|
for(var i=0, count=stopwords.length; i<count; ++i) {
|
||||||
if(text.indexOf(stopwords[i]) > -1) {
|
if(text.indexOf(stopwords[i]) > -1) {
|
||||||
parent.removeChild(element);
|
parent.removeChild(element);
|
||||||
return;
|
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
|
## Mark post plugin
|
||||||
|
|
||||||
|
A plugin which lets you mark particular posts so you don't forget them in your timeline
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
$("ol").delegate('a', 'click dblclick', function(e) {
|
// mark posts with dbl-click
|
||||||
|
$('ol').delegate('a', 'click dblclick', function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}).delegate('li', 'dblclick', function(e) {
|
}).delegate('li', 'dblclick', function(e) {
|
||||||
var li = $(this);
|
var li = $(this);
|
||||||
if(li.hasClass("selected")) {
|
if(li.hasClass('selected')) {
|
||||||
li.removeClass("selected");
|
li.removeClass('selected');
|
||||||
} else {
|
} else {
|
||||||
li.addClass("selected");
|
li.addClass('selected');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
And add this to your CSS plugin file.
|
And add this to your CSS plugin file:
|
||||||
|
|
||||||
``` css
|
``` css
|
||||||
|
/* mark posts with dbl-click */
|
||||||
.selected {
|
.selected {
|
||||||
border-left: 5px solid green;
|
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