-
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
Showing
4 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License | |
along with resumeLater. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/*jshint esnext:true,strict:false*/ | ||
/*jshint esnext:true,strict:false,latedef:false*/ | ||
/*globals exports*/ | ||
|
||
const widgets = require('sdk/widget'); | ||
const toggle = require('sdk/ui/button/toggle'); | ||
const panel = require('sdk/panel'); | ||
const tabs = require('sdk/tabs'); | ||
const data = require('sdk/self').data; | ||
|
@@ -34,6 +34,24 @@ const sites = require('./sites'); | |
const VideoStorage = require('./videos').VideoStorage; | ||
var videoStorage = new VideoStorage(simpleStorage, simplePrefs); | ||
|
||
// button | ||
var button = toggle.ToggleButton({ | ||
id: "button", | ||
label: "Resume Later", | ||
icon: { | ||
"16": "./button/icon16.png", | ||
"32": "./button/icon32.png", | ||
"64": "./button/icon64.png" | ||
}, | ||
onChange: function (state) { | ||
if (state.checked) { | ||
videoList.show({ | ||
position: button | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
// list panel | ||
var locale = (_("locale")); | ||
if (locale === "locale") { | ||
|
@@ -50,7 +68,10 @@ var videoList = panel.Panel({ | |
panelLocale, | ||
data.url("panel/l10n.js"), | ||
data.url("panel/panel.js") | ||
] | ||
], | ||
onHide: function () { | ||
button.state('window', { checked: false }); | ||
} | ||
}); | ||
|
||
function resizeVideoList() { | ||
|
@@ -83,12 +104,4 @@ videoStorage.on('update', function () { | |
videoList.port.emit('update', videoStorage.getAll()); | ||
}); | ||
|
||
// widget | ||
var widget = widgets.Widget({ | ||
id: "[email protected]", | ||
label: "Resume Later", | ||
contentURL: data.url("widget/widget.png"), | ||
panel: videoList | ||
}); | ||
|
||
// vim: set ts=4 sw=4 sts=4 tw=72 et : |