endflow.net blog

/* programming and programming */

Archive for February, 2008

RTM Keyconfig: Change keyboard shortcuts of Remember The Milk

with 5 comments

/* How does it work ? */

This Greasemonkey script add / modify / remove keyboard shortcuts of Remember The Milk you want.

Remember The Milk (RTM) is useful task management tool. It has keyboard shortcuts and you can execute all operations via keyboard. However we can’t customize keyboard shortcuts.
I always push “Esc” key when I want to clear selection.
So I created this Greasemonkey.

/* Install */

This script already uploaded to Userscripts.org. So please install it from this pase.
rtmkeyconfig.user.js

/* Settings */

name description value type
keys A string of keyboard shortcut and function. An array contains an array of string of keyboard shortcut and function. Array(Array)
interval Retry interval. millisecond. I recommend default value. In usually, It has the range 100 to 5000. Number

Sample setting

var cfg = {
	keys: [
		["esc", "taskList.taskSelectNone()"],
		["space", "this.keyboardEntrySelect(ev)"],
		["j", function(){
			var list = view.getViewList();
			if(list.keyboardPosition + 1 != list.entries.length){
				list.keyboardDown();
			}
		}],
		["k", function(){
			var list = view.getViewList();
			if(list.keyboardPosition != 0){
				list.keyboardUp();
			}
		}],
		["ctrl+d", "pagedown", function(){
			var list = view.getViewList();
			for(var i = 0; i < 5; i++){
				if(list.keyboardPosition + 1 == list.entries.length){break}
				list.keyboardDown();
			}
		}],
		["ctrl+u", "pageup", function(){
			var list = view.getViewList();
			for(var i = 0; i < 5; i++){
				if(list.keyboardPosition == 0){break}
				list.keyboardUp();
			}
		}],
		["l", "tab", function(){
			var tabs = view.getViewTabs();
			if(tabs.selected != tabs.entries.length - 1){
				tabs.selectRight();
			}
		}],
		["h", "shift+tab", function(){
			var tabs = view.getViewTabs();
			if(tabs.selected != 0){
				tabs.selectLeft();
			}
		}],
		["u", "control.undoLastAction()"]
	],
	interval: 250
}

/* Conclusion */

enjoy Remember The Milk! ;)

Written by kuy

February 10th, 2008 at 8:20 pm

Posted in Uncategorized

Tagged with , , , ,

LDR Ad-Entry Blocker: Block offecsive Ad-Entries!

with 19 comments

/* How does it work ? */

This Greasemonkey script block advertisement entries such as “AD: …”, “PR: …” on LDR.

Update history

  • 0.1.2 [2008-02-01]: first release
  • 0.1.3 [2008-02-01]: supported Opera
  • 0.1.4 [2008-06-19]: supported fLDR

LDR is useful tool for me. However, some RSS include advertisement entries. Of course I skip these entries but I feel it is annoying.
So I made this.

/* Install */

This script already uploaded to Userscripts.org. So please install it from this page.

ldr_adentry_blocker.user.js

/* Settings */

Configurable items:

name description value type
patterns Blocker search these ads pattern in entry title. RegExp Array(RegExp)
style Blocker apply this style to the element of entry title. valid style name and value Object
interval The interval of crawling to find ad-entry. 0 to Number.MAX_VALUE Number
skip skip ad-entry when press “j/k” if you set true. true/false Boolean

Sample settings

/////////////// configurations ////////////////
var cfg = {
	// judgement patterns of entry title
	patterns: [/^[s【]*(AD|PR|AD|PR)[s】]*[::]/i],
	// advertisement entries style (apply this style to title link <a>)
	style: {
		color: '#aaa',
		fontSize: '12px'
	},
	// apply interval
	interval: 1000,
	// skip ad-entry
	skip: true
}
///////////////////////////////////////////////

In case of default setting, Blocker will remove entry body and change title color to grey. If you want remove completely, you change “style” setting.

/* Conclusion */

I have made this Greasemonkey script 2 months ago. I think I have to upload more because I have many scrips doesn’t upload yet.

enjoy LDR ! Wink

Written by kuy

February 1st, 2008 at 4:28 pm

Posted in Uncategorized

Tagged with , , , , ,