Skip to content

Instantly share code, notes, and snippets.

@gialloporpora
Created December 10, 2008 16:11
Show Gist options
  • Save gialloporpora/34359 to your computer and use it in GitHub Desktop.
Save gialloporpora/34359 to your computer and use it in GitHub Desktop.
Cite text in a Web page in BBCode, HTML and plain-text
CmdUtils.CreateCommand({
name: "foxiewire",
icon: "http://foxiewire.com/favicon.ico",
homepage: "http://www.gialloporpora.netsons.org/ubiquity",
description: "If not yet submitted, submits the page to Foxiewire. Otherwise, it takes you to the story's Foxiewire page.",
author: { name: "Sandro Della Giustina", email: "sandrodll@yahoo.it"},
license: "MPL,GPL",
execute: function() {
var doc = CmdUtils.getDocument();
var params = Utils.paramsToString({
q: "submit",
url: doc.location,
title: doc.title,
body: doc.getSelection()
});
story_url="http://foxiewire.com/" + params;
/* Utils.openUrlInBrowser(story_url); */
CmdUtils.setSelection(params+"<br>"+doc.location);
},
preview: function(pblock) {
var html= 'Submit or vote this page to Foxiewire. Checking if this page has already been submitted...';
pblock.innerHTML=CmdUtils.renderTemplate(html);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment