Skip to content

Commit

Permalink
First commit mate!
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogomil Shopov committed May 26, 2011
0 parents commit 4b76c1a
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
43 changes: 43 additions & 0 deletions JPersona/JPersona.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//define contstants
const {Cu} = require("chrome");

//import LightweightThemeManager - the one responsible for handling Personas.
const lwtm = Cu.import('resource://gre/modules/LightweightThemeManager.jsm').LightweightThemeManager;

//define class element
var JPersona =
{
//define function element
getBGColor: function (args, callback)
{

var bgcolor;
if (lwtm.currentTheme)
{
bgcolor = lwtm.currentTheme.accentcolor;
callback(bgcolor);
}else
{
callback(null);
}
},
getTextColor: function(args,callback)
{
var textcolor;
if (lwtm.currentTheme)
{
textcolor = lwtm.currentTheme.textcolor;
callback(textcolor);
}else
{
callback(null);
}


}

}
//export object to be visible from your code
exports.JPersona = JPersona;


1 change: 1 addition & 0 deletions JPersona/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In this folder you can find an example how to create a custom JetPack (addon SDK) lib with class structure and how to use it from your main.js
9 changes: 9 additions & 0 deletions JPersona/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//import the object
const jp = require('JPersona');

//execute a function
jp.JPersona.getTextColor("bgcolor",function(jcolor){

console.log(jcolor);

});
26 changes: 26 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
__About__

Here you can find some cool JetPack examples and hacks. Watch the repo, the changes will be a lot :)

__Follow__

You can follow me on twitter: https://twitter.com/bogomep and identi.ca: http://identi.ca/bogomep


__The License__

All files in this REPO are under this LICENSE:

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

0 comments on commit 4b76c1a

Please sign in to comment.