This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jetpack.tabs.onReady(function(doc){ | |
| if (this.url.match(/^https:\/\/jetpack.mozillalabs.com\//)) | |
| $("*",doc).css({"font-family":"Times"}); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // NOTE: Remember to fill in login credentials - in the future, this will be stored persistently via simple_storage probably... | |
| Components.utils.import("resource://jetpack/ubiquity-modules/utils.js"); | |
| var TwitterJetpack = { | |
| last: 0, | |
| queue: [], | |
| request: { type: "GET", | |
| url: "http://twitter.com/statuses/friends_timeline.json", | |
| dataType: "json", | |
| error: function() {jetpack.notifications.show({"title":"TwitterJetpack","body":"Error fechting updates"});}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This is a template command. */ | |
| CmdUtils.CreateCommand({ | |
| names: ["example"], | |
| icon: "http://www.mozilla.com/favicon.ico", | |
| description: "A short description of your command.", | |
| help: "How to use your command.", | |
| author: {name: "Your Name", email: "you@mozilla.com"}, | |
| license: "GPL", | |
| homepage: "http://labs.mozilla.com/", | |
| arguments: [{role: 'object', nountype: noun_arb_text}], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CmdUtils.makeSearchCommand({ | |
| name: "MovieZoo", | |
| url: "http://www.moviezoo.dk/alle-produkter/soeg/{QUERY}", | |
| parser: { | |
| container: "table.nyhedsbrev_tabel2", | |
| title: "tr:nth-child(2) tr tr:first-child b", | |
| href: function(c) {return jQuery("a.nyhedsbrev",c).attr("href");}, | |
| preview: function(c) {var p = ""; jQuery("table table tr:not(:first)",c).each(function(){p += jQuery(this).text()+"<br>";});return p;}, | |
| thumbnail: "img.lister_img", | |
| maxResults: 3 |