- eventsmanager_demo.zip
- MyGadget.gadget
- deploygadget_demo.zip
- DeployGadget.exe
- ICSharpCode.SharpZipLib.dll
- deploygadget_src.zip
- eventsmanager_src.zip
- css
- en-us
- fr-ca
- Gadget.xml
- icon.png
- images
- AddEvent.gif
- anim
- 1.gif
- 2.gif
- 2.pdn
- 3.gif
- 4.gif
- 5.gif
- 6.gif
- 7.gif
- bgEvents.jpg
- BgImage.jpg
- BgSettings.jpg
- Binder.gif
- bmp
- AddEvent.bmp
- BgImage.bmp
- BgSettings.bmp
- CloseIconCold.bmp
- CloseIconHot.bmp
- EventListBgImage.bmp
- Footer.bmp
- grayDot.bmp
- Header.bmp
- Search.bmp
- SearchIcon.bmp
- SliderBgImage.bmp
- cal.gif
- CloseIconCold.jpg
- CloseIconHot.jpg
- ErrorBgImage.jpg
- EventListBgImage.gif
- Footer.jpg
- grayDot.gif
- Header.jpg
- HotEvent.gif
- Search.jpg
- SearchIcon.jpg
- SliderBgImage.gif
- SliderCold.png
- SliderHot.png
- js
- sound
- toutoune.wav
|
// JScript File
// Load events and display them
function LoadEvents()
{
ClearEventsList();
for(i = 0, j=0; j<EventsNumber; i++)
{
if(System.Gadget.Settings.read("Event"+i+"Id")==i)
{
j++;
AddLineToEventsList(i);
}
}
}
function AddLineToEventsList(eventId)
{
var eventsList = document.getElementById("EventsList");
var divTag = document.createElement("div");
var anchorTag = document.createElement("a");
var radical = "Event" + eventId;
var eventName = System.Gadget.Settings.read(radical + "Name");
// arguments are used when user is searching
// (see SearchEngine.js for more details
var highlight = arguments[1];
var start = arguments[2];
var end = arguments[3];
// CheckEvent set event's notification info
// return false if the event is too old and should not be displayed
if(!CheckEvent(eventId)) return;
anchorTag.setAttribute("href", "javascript:DisplayEventInfo(" + eventId + ");");
anchorTag.setAttribute("title", eventName);
// highlight text in search-mode only
if(highlight)
{
anchorTag.innerHTML = eventName.substring(0, start) +
"<span class=\"selected\">" + eventName.substring(start, end) + "</span>" +
eventName.substring(end);
}
else anchorTag.innerHTML = eventName;
// depending of the event's state, set the correct class name
switch(System.Gadget.Settings.read(radical + "State"))
{
case "Hot" :
// to notify user
divTag.className = "hotEvent";
// play sound only if EnableSound == true
if(EnableSound) System.Sound.playSound("../sound/toutoune.wav");
break;
case "Old" :
anchorTag.className = "oldEvent";
break;
}
// appendChild
divTag.appendChild(anchorTag);
eventsList.insertBefore(divTag, eventsList.firstChild);
}
function ClearEventsList()
{
// clear events list
document.getElementById("EventsList").innerHTML = "";
}
// Called by AddEvent in AddEvent.js
function AddEvent()
{
EventsNumber++;
CurrentEventId++;
SaveSettings();
LoadEvents();
SetSlider();
UpdateSliderInput();
}
function RemoveEvent(eventId)
{
EventsNumber--;
System.Gadget.Settings.write("Event"+eventId+"Id", -1);
HideEventInfo();
SaveSettings();
LoadEvents();
UpdateSliderInput();
SetSlider();
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.