Skip to content

Instantly share code, notes, and snippets.

var klass = "_jetpackNotification";
jetpack.tabs.onReady(function(doc){
$("body",doc).append('<div id="'+klass+'" style="position: fixed; bottom: 0; right: 0; height: 0; width: 151px;"><div style="height: 40px; width: 150px; background: #ddd; border: #999 solid; border-width: 1px 0 0 1px"></div></div>');
});
function notify(options) {
var doc = jetpack.tabs.focused.contentDocument;
$("#"+klass+" div", doc).text(options.body).parent().animate({"height":41},"slow", function(){
setTimeout(function(el){$(el).animate({"height":0},"slow")},3000,this);
});
jetpack.tabs.onReady(function(doc){
if (this.url.match(/^https:\/\/jetpack.mozillalabs.com\//))
$("*",doc).css({"font-family":"Times"});
});
CmdUtils.CreateCommand({
name: "selector",
description: "Finds a selector that will match element currently hovered, and highlights all matches",
execute: function() {
var d = CmdUtils.getDocumentInsecure();
myId = function(me){ return me.id ? '#' + me.id : '' }
myTag = function(me){ return me.tagName ? me.tagName.toLowerCase() : '' }
myClass = function(me){ return me.className ? '.' + me.className.split(' ').join('.') : '' }
breadcrumbs = function breadcrumbs(me){
function absolutifyUrls(data, sourceUrl) {
var relRe = /:\/\//;
var domainRe = /.*?\/\/[^?/]*/;
var pathRe = /.*\//;
if (sourceUrl.length-sourceUrl.replace(/\//g,"").length==2) {
sourceUrl += "/";
}
if (typeof(data)=="string") {
data = jQuery("<div>"+data+"</div>");
} else if (typeof(data)=="object") {
function absolutifyUrls(data, sourceUrl) {
var relRe = /:\/\//;
var domainRe = /.*?\/\/[^?/]*/;
var pathRe = /.*\//;
if (sourceUrl.length-sourceUrl.replace(/\//g,"").length==2) {
sourceUrl += "/";
}
if (typeof(data)=="string") {
data = jQuery("<div>"+data+"</div>");
} else if (typeof(data)=="object") {
diff -r afca0bffe6e1 parser-demo/da.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/parser-demo/da.js Fri Mar 27 14:39:56 2009 +0100
@@ -0,0 +1,16 @@
+// set up our parsers
+
+var da = new Parser('da');
+da.roles = [
+ {role: 'goal', delimiter: 'til'},
+ {role: 'source', delimiter: 'fra'},
diff -r f084d1578ba1 parser-demo/da.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/parser-demo/da.js Wed Mar 25 00:21:33 2009 +0100
@@ -0,0 +1,16 @@
+// set up our parsers
+
+var da = new Parser('da');
+da.roles = [
+ {role: 'goal', delimiter: 'til'},
+ {role: 'source', delimiter: 'fra'},
@cers
cers / x
Created March 23, 2009 09:31
CmdUtils.CreateCommand({
name: "example",
takes: {"search term": /.*/},
preview: function(pblock, input) {
CmdUtils.previewGet(pblock, "http://google.com", {q: input.text}, function(data){
pblock.innerHTML = data;
});
}
});
@cers
cers / x
Created March 19, 2009 18:01
CmdUtils.CreateCommand({
name: "selector",
description: "Finds a selector that will match element currently hovered, and highlights all matches",
execute: function() {
var d = CmdUtils.getDocumentInsecure();
myId = function(me){ return me.id ? '#' + me.id : '' }
myTag = function(me){ return me.tagName ? me.tagName.toLowerCase() : '' }
myClass = function(me){ return me.className ? '.' + me.className.split(' ').join('.') : '' }
breadcrumbs = function breadcrumbs(me){
@cers
cers / x
Created March 19, 2009 11:28
CmdUtils.CreateCommand({
name: "flasher",
description: "Finds a selector that will match element currently hovered, and highlights all matches",
execute: function ubiquityHighlightExecute() {
var d = CmdUtils.getDocumentInsecure();
myId = function(me){ return me.id ? '#' + me.id : '' }
myTag = function(me){ return me.tagName ? me.tagName.toLowerCase() : '' }
myClass = function(me){ return me.className ? '.' + me.className.split(' ').join('.') : '' }
breadcrumbs = function breadcrumbs(me){