Skip to content

Commit

Permalink
Merge pull request #1 from ajsb85/master
Browse files Browse the repository at this point in the history
Panel in the main menu of Fx
  • Loading branch information
ajsb85 committed Mar 26, 2016
2 parents bc3356a + 2ac55f6 commit 6803dfb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 20 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![ubuntuve-logo](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/logo/ubuntuve_logo.png "ubuntuve")
![ubuntuve-logo](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/logo/ubuntuve_logo.png "ubuntuve")
# Ubuntu VE
Quick navigation menu through all the resources of the Venezuelan community of the Linux distribution Ubuntu (www.ubuntu.org.ve). Allow also a quick navigation through some resources of other Ubuntu communities including the international one.

Expand All @@ -13,9 +13,11 @@ https://addons.mozilla.org/addon/ubuntu-venezuela/
Filing a bug at https://github.com/ajsb85/firefox-addon-ubuntuve/issues

### Preview Screenshots
![ubuntuve-gif](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/fx.gif "ubuntuve")
![ubuntuve-gif](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/dev.gif "ubuntuve")

![ubuntuve-gif](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/screen0.gif "ubuntuve")
![ubuntuve-gif](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/screen1.gif "ubuntuve")
![ubuntuve-png](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/screen2.png "ubuntuve")
![ubuntuve-png](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/screen3.png "ubuntuve")
![ubuntuve-png](https://raw.github.com/ajsb85/firefox-addon-ubuntuve/master/press/screens/screen4.png "ubuntuve")

### Works with:

Expand Down
42 changes: 27 additions & 15 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
var { PanelView } = require("jetpack-panelview");
var buttons = require('sdk/ui/button/action');
const { PanelView } = require("jetpack-panelview");
const { ToggleButton } = require('sdk/ui');
const workaround = require("jetpack-panelview/lib/panelview/workaround");
var tabs = require("sdk/tabs");
const name = "lightweightThemes.selectedThemeID";
const selectedThemeID = require("sdk/preferences/service").get(name);

var pv = PanelView({
id: 'demo-panelview',
title: 'Demo',
id: 'ubuntuve-panelview',
title: 'Ubuntu Venezuela',
content: [
{
type: 'button',
Expand Down Expand Up @@ -110,16 +111,27 @@ var pv = PanelView({
}
});

var button = buttons.ActionButton({
id: "ubuntu-button",
label: "Ubuntu Venezuela",
icon: {
"16": selectedThemeID === "[email protected]" ?
"./icon-16.dev.svg" : "./icon-16.svg",
"32": "./icon-32.svg",
"64": "./icon-64.svg"
},
onClick: function(state){

const button = ToggleButton({
id: "ubuntuve-button",
label: "Ubuntu Venezuela",
icon: {
"16": selectedThemeID === "[email protected]" ?
"./icon-16.dev.svg" : "./icon-16.svg",
"32": "./icon-32.svg",
"64": "./icon-64.svg"
},
onClick(state){
if(state.checked) {
pv.show(button);
}
});
}
});

// Uncheck the button if the panel is hidden by loosing focus
pv.on("hide", () => {
button.state("window", {checked: false});
});

// Don't close the menu panel or overflow panel when the button is clicked.
workaround.applyButtonFix(button);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Ubuntu VE",
"name": "ubuntu-venezuela",
"version": "0.1.0",
"version": "0.1.2",
"id": "{ef65f6de-fa25-45fd-8038-4a340bea4d55}",
"description": "Quick navigation menu through all the resources of the Venezuelan community of the Linux distribution Ubuntu (www.ubuntu.org.ve). Allow also a quick navigation through some resources of other Ubuntu communities including the international one.",
"main": "lib/main.js",
Expand Down
File renamed without changes
File renamed without changes
Binary file added press/screens/screen2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added press/screens/screen3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added press/screens/screen4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6803dfb

Please sign in to comment.