not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

42 lines
1.4 KiB

define(["sugar-web/activity/activity","sugar-web/env","filterpalette"], function (activity, env, filterpalette) {
var isFavorite = false;
// Manipulate the DOM only when it is ready.
requirejs(['domReady!'], function (doc) {
// Initialize the activity.
activity.setup();
// Create palette
var filterButton = document.getElementById("filter-button");
filterpalette = new filterpalette.FilterPalette(filterButton, undefined);
filterpalette.addEventListener('filter', function() {
app.setFilter({category: filterpalette.getFilter()});
Util.saveContext();
filterpalette.popDown();
});
document.getElementById("favorite-button").onclick = function(s, e) {
var invoker = s.toElement || s.explicitOriginalTarget || s.currentTarget;
isFavorite = !isFavorite;
if (isFavorite)
invoker.style.backgroundImage = 'url(icons/favorite.svg)';
else
invoker.style.backgroundImage = 'url(icons/notfavorite.svg)';
app.setFilter({favorite: isFavorite});
};
document.getElementById("library-button").onclick = function(s, e) {
app.showLibraries();
};
// Launch main screen
app = new VideoViewer.App({activity: activity, filter: filterpalette});
app.renderInto(document.getElementById("viewer"));
var search = new Sugar.SearchField();
search.renderInto(document.getElementById("search"));
// Load context
Util.loadContext(function() {
app.draw();
});
});
});