-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.js
More file actions
30 lines (24 loc) · 886 Bytes
/
main.js
File metadata and controls
30 lines (24 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
define(function(require, exports, module) {
"use strict";
var music = require("./lib/music");
var ExtensionUtils = brackets.getModule("utils/ExtensionUtils");
//jQuery objects
var $icon;
//css file import
ExtensionUtils.loadStyleSheet(module, "./resources/css/style.css");
function _togglePlay() {
if(music.paused) {
music.play();
document.getElementsByClassName("icon ion-headphone")[0].style.color = "#6A9FF5";
} else {
music.pause();
document.getElementsByClassName("icon ion-headphone")[0].style.color = "#ADADAD";
}
$icon.attr("title", music.trackInfo.name);
}
// Add toolbar icon
$icon = $("<a class=\"icon ion-headphone\"></a>")
.click(_togglePlay)
.appendTo($("#main-toolbar .buttons"));
$icon.attr("title", "No playlist loaded!");
});