Version 1 (modified by chriz, 8 years ago) (diff)

Migrated from old trac wiki

This plugin adds the currently selected word to the wiki's blacklist (Views > Func. pages > Wiki cc. blacklist). If nothing is selected, the currently selected tree node is added to the blacklist. This allows you to quickly add items from the list of "undefined" wikiwords, found under Views > undefined-nodes.

    Adds the currently selected word or the currently selected treenode to the wiki's blacklist.

    v0.11 by wwwald, 20090204.

WIKIDPAD_PLUGIN = (("MenuFunctions",1),)

def describeMenuItems(wiki):
	return ((addtoblacklist, "Add To Blacklist\tCtrl-Shift-X", "Add To Blacklist"),)

def addtoblacklist(pwiki, evt):
	editor = pwiki.getActiveEditor()
	blackword = editor.GetSelectedText()
	if len(blackword.strip())<1:
		blackword = pwiki.getCurrentWikiWord()
		blackwordtype = 'Wiki node'
		blackwordtype = 'Selected word'

	wdm = pwiki.getWikiDocument();
	blacklist = wdm.getFuncPage("wiki/CCBlacklist")
	pwiki.appendLogMessage(blackwordtype + ' blacklisted: ' + blackword)