7 messages in com.googlegroups.google-desktop-developerRe: Designer, Javascript, and Notific...| From | Sent On | Attachments |
|---|---|---|
| hunt...@gmail.com | 15 Dec 2006 08:41 | |
| James [GD Team] | 15 Dec 2006 13:32 | |
| hunt...@gmail.com | 15 Dec 2006 13:59 | |
| James [GD Team] | 15 Dec 2006 17:51 | |
| hunt...@gmail.com | 15 Dec 2006 21:58 | |
| James [GD Team] | 19 Dec 2006 06:08 | |
| hunt...@gmail.com | 19 Dec 2006 10:00 |
| Subject: | Re: Designer, Javascript, and Notification![]() |
|---|---|
| From: | hunt...@gmail.com (hunt...@gmail.com) |
| Date: | 12/19/2006 10:00:05 AM |
| List: | com.googlegroups.google-desktop-developer |
Just tried it and stil not working.
Whole javascript file is below.
Basically if the sidebar is active but hidden (as in it is on the right of the screen do to autohide) notifications work. If I drop the sidebar down into deskbar or floating deskbar mode (so I have a search box in my task bar) notifications do not show up.
As I said I'm trying to simulate what the news gadget does. If the sidebar is visible nothing happens. If it is hidden notifications are shown. If the sidebar is a deskbar notifications show.
My whole Javascript file is: function view_onOpen() { gadget.debug.trace("On open"); setInterval("callBack()", 10 * 1000); }
function callBack() { gadget.debug.trace("callback");
ci = new ContentItem(); ci.heading = "Heading";
cnArea.AddContentItem(ci, gddItemDisplayInSidebar + gddItemDisplayAsNotificationIfSidebarHidden);
}
On Dec 19, 9:09 am, "James [GD Team]" <j....@google.com> wrote:
Hello,
Have you tried:
"gddItemDisplayInSidebar + gddItemDisplayAsNotificationIfSidebarHidden"
"gddItemDisplayAsNotification" will display a notification even if the sidebar is hidden as you've seen, so you'll need to remove that flag.
Cheers! James
hunt...@gmail.com wrote:
Okay. Still not getting the functionality I want it seems.
Current code: ci = new ContentItem(); ci.heading = "Heading";
cnArea.AddContentItem(ci, gddItemDisplayInSidebar + gddItemDisplayAsNotification + gddItemDisplayAsNotificationIfSidebarHidden);
Here is what I want. If the sidebar is displayed it shouldn't notify. If the sidebar is hidden (via autohide) it should notify. If the sidebar has been minimized to the Deskbar it should notifty.
In essence basically what the news gadget does.
Shouldn't the code above do that?
On Dec 15, 8:52 pm, "James [GD Team]" <j....@google.com> wrote:
Hello,
You need to change the flag "gddItemDisplayAsNotification" to "gddItemDisplayAsNotification+gddItemDisplayAsNotificationIfSidebarHidden".
Cheers! James
hunt...@gmail.com wrote:
Okay progress.
What first threw me was the error in designer. I couldn't tell if it was a error in my code or something designer didn't support.
Seems it was the later.
Okay.
I can get notifcation to show up: When the gadget is not docked to the sidebar and floating When the gadget is docked to the sidebar and the sidebar is set to autohide
But if the gadget is docked to the sidebar and the sidebar minized the gadget will not show notification. The debuger shows my function is being called that runs the notification command, but no notification.
Any ideas? Yes the alerts option is turned on and inside the gadget it is set to use notifcation.
On Dec 15, 4:32 pm, "James [GD Team]" <j....@google.com> wrote:
Hello,
Within the designer, is "Uses notifier for displaying alerts?" checked in "Project Settings"?
Also, your code might be perfect, but gadgets will refuse to actually display the alerts unless the user opts-in and allows it. So make sure your gadget is running and within the sidebar go to "Options > Configure Gadgets". Find your gadget among the list and check the "Enable alerts" checkbox. Be sure your users are aware of this too.
And as you've seen, the notifications do not work in the designer preview.
Cheers! James
hunt...@gmail.com wrote:
Hey All,
I've doen searches and tried the code snippets here in the group but I still can't get notification working.
Does anyone have a good simple example of working notifications I can look at and work through what is happening?
Right now when I do this:
ci = new ContentItem(); ci.heading = "Heading"; cnArea.AddContentItem(ci, gddItemDisplayAsNotification);
In the designer I get an error saying 'Code:0x800a01ad Description: Automation server can't create Object". And if I run it from Google Desktop nothing happens.
Any ideas?




