-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bogomil Shopov
committed
May 26, 2011
0 parents
commit 4b76c1a
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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; | ||
|
||
|
This file contains 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
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 |
This file contains 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
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); | ||
|
||
}); |
This file contains 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
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. |