MyChromeBarWidget.js 0100777 0000000 0000000 00000003327 13540171246 011676 0 ustar 00 /// FOURJS_START_COPYRIGHT(D,2018)
/// Property of Four Js*
/// (c) Copyright Four Js 2018, 2019. All Rights Reserved.
/// * Trademark of Four Js Development Tools Europe Ltd
/// in the United States and elsewhere
///
/// This file can be modified by licensees according to the
/// product manual.
/// FOURJS_END_COPYRIGHT
"use strict";
modulum('MyChromeBarWidget', ['ChromeBarWidget', 'WidgetFactory'],
function(context, cls) {
cls.MyChromeBarWidget = context.oo.Class(cls.ChromeBarWidget, function($super) {
return {
__name: "MyChromeBarWidget",
_windowIconImage: null,
constructor: function(opts) {
$super.constructor.call(this, opts);
},
setIcon: function(image, appIcon) {
$super.setIcon.call(this, image, appIcon);
// Re-hide the fgl application icon since I won't be able to make it works with it
this._element.getElementsByClassName('zmdi')[0].removeClass('hidden');
if (this._windowIconImage) {
this._windowIconImage.setHidden(true);
}
var containerElement = document.body.getElementsByClassName('containerElement')[0];
var containerWidget = gbc.WidgetService.getWidgetFromElement(containerElement);
var elt = this.getElement().querySelector(".gbcAppCount");
var appcount = containerWidget.getAppsCount();
if (appcount == 0) {
elt.addClass('hidden');;
elt.textContent = '';
}
else {
elt.removeClass('hidden');;
elt.textContent = appcount.toString();
}
}
};
});
cls.WidgetFactory.registerBuilder('ChromeBar', cls.MyChromeBarWidget);
});
MyChromeBarWidget.tpl.html 0100777 0000000 0000000 00000001414 13540171207 013014 0 ustar 00