wiki:DropboxRevisions

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

Migrated from old trac wiki

This code will insert url:s in WikidPad pages, to the Dropbox revision pages, if the wiki is stored on Dropbox.

# This code will insert url:s in WikidPad pages, to the Dropbox revision pages
# if the wiki is stored on Dropbox

# Install: Put the source below into "WikidPad/user_extensions/DropboxRevisions.py"
# and restart WikidPad.
# Press CTRL-ALT-R to insert a link to the revision page on Dropbox.

# Look into the code and customize the path to the Dropbox revision pages:
# Replace 'YourWiki' in the path, with your wikis real name.

# This code is based on the SubpageCreate plugin
# on http://wikidpad.python-hosting.com/wiki/SubpageCreate

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

def describeMenuItems(wiki):
	global nextNumber
	return ((DropboxRev, "Dropbox Revisions\tCtrl-Alt-R", "Dropbox Revisions"),)

def DropboxRev(pwiki, evt):
	editor=pwiki.getActiveEditor()
	text = pwiki.getCurrentWikiWord()	# get current WikiWord
	text = text.replace(" ", "%20")		# replace spaces in pagename, otherwise the url won't work
	editor.AddText("[https://www.getdropbox.com/revisions/YourWiki/data/"+ text +".wiki | Dropbox Revisions]")