Consider a problem of searching several wikis at one command. Here's a possible solution. If one'd add the following to the .pentadactylrc
:
javascript <<EOF
dactyl.searchWikis = function (selection) {
let parsedSelection = selection.replace(/^\s*/, "" ).replace(/\s*$/, "" ).replace(/\s+/g, "+" );
dactyl.execute( ":tabopen http://www.scholarpedia.org/wiki/index.php?title=Special:Search&search=" + selection);
dactyl.execute( ":tabopen http://en.citizendium.org/wiki?title=Special:Search&search=" + selection);
};
EOF
:command wikiSearch -nargs=* -js dactyl.searchWikis(<args>)
That should've solved it - but the problem is - that this way Pentadactyl doesn't see the JS code. I.e. new command wikiSearch doesn't appear. Can You fix it?