From e5c8c08e91061738052d8156b4527c522670bc0a Mon Sep 17 00:00:00 2001 From: noformnocontent Date: Sat, 29 Dec 2012 14:01:42 -0800 Subject: [PATCH] Updated Plugins (markdown) --- Plugins.md | 78 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/Plugins.md b/Plugins.md index 73cacea..7b243ec 100644 --- a/Plugins.md +++ b/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 -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 -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(/\/$/,'') +}) +```