Skip to content

Instantly share code, notes, and snippets.

@Artanis
Created February 12, 2009 23:21
Show Gist options
  • Save Artanis/62937 to your computer and use it in GitHub Desktop.
Save Artanis/62937 to your computer and use it in GitHub Desktop.
Removes spaces from posted Powder Game save codes.
CmdUtils.CreateCommand({
name: "dust",
homepage: "http://gist.github.com/62937",
author: { name: "Artanis", email: "artanis.00@gmail.com"},
license: "Public Domain",
description: "Removes spaces from <a href='http://dan-ball.jp/en/javagame/dust/'>Powder Game</a> save codes. Execute command to replace selection with formatted code, even in the save game text box.",
help: "dust (code|selection)",
takes: {"code": noun_arb_text},
preview: function( pblock, input ) {
var template = "${code}";
pblock.innerHTML = CmdUtils.renderTemplate(template, {"code": input.text.split(' ').join('')});
},
execute: function(input) {
CmdUtils.setSelection(input.html.split(' ').join(''));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment