How do I setup/support growls for people wanting to make Fluid Apps out of my online product?
So I am a Fluid App developer and I want to make it possible to show a "growl" or a special icon above the app icon that shows the number of moderated comments on a blog. What documentation exists that shows me exactly how to support that?
2
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Hi Byrne, glad to hear you're looking to add Fluid support!
Brief JavaScript documentation for Fluid is here:
http://fluidapp.com/developer/
Showing Growl notifications is very simple. And the Fluid JS api very closely mirrors the original Growl Objective-C API. if you are not familiar with the Growl ObjC api, you might wanna read it over just to understand what the different properties to the fluid.showGrowlNotification() method mean. Read the short "Notification" section on this page:
http://growl.info/documentation/devel... -
Inappropriate?Thank you Todd! I looked at the "Developer" page - my trouble is that I am very new to developing Mac OS X software. To be truthful, I am guessing "growling" is what I want to do - the idea of the icon jumping for example is what I discern to be a "growl" of sorts.
I found another topic on getsatisfaction which I found useful, which pointed me to this sample code:
http://getsatisfaction.com/hahlo/topi...
Assuming I can just hack this to talk to my service (in this case Movable Type and TypePad) what would be helpful is knowing: where do I install this user script? How do I package it such that people wanting to build a fluid app from MT will download it or make use of it automatically or more easily? Am I making sense?
Once I could up all the JS, how do I package it and distribute it?
Or do I need to RFTM?
I’m excited
-
Inappropriate?well i guess there are two options:
1. build Fluid JavaScript support directly into your product (wow... MT! nice!). In that case you would just serve the JS like normal and wrap the fluid specific bit in (if (window.fluid) { fluid.showGrowlNotification(...); })
a few of the "safe" Fluid JS additions (such as Growl notifications and dock badge labels) are available to *all* JS served from anywhere, not just local userscripts.
the downside to this approach is that some users may not want Growl notifications, but they will have no choice.
2. Create a userscript that does stuff and share it on www.userscripts.org or elsewhere. Whenever a user navigates to a userscript in a Fluid SSB (or clicks the 'install' button on a userscripts.org page), you see a dialog asking if you wanna install the userscript.
then tell the world about your userscript and fluid on your blog :0]
thx,
todd -
Inappropriate?I am thinking #1 will be my best bet. Sounds easiest given the software is open source etc.
I definitely have some reading to do though. I am still just stumbling along, and I appreciate your hand holding. So my last question is, what doc will tell me step-by-step how to support growls and dock badges directly into my app? Where do I get started?
I’m grateful.
-
serve it just like any other JavaScript. Fluid renders the dock badge label for you. its magic. as for a custom icon, the user will have to select one when she creates the ssb. -
Inappropriate?More specifically I see this: "Fluid JavaScript API" on the developer page - I get that. But where do I serve this javascript from inside my app? How does fluid know how to render the dock icon?
-
woops... sorry i forgot. you can also serve a custom icon that fluid will use when the user creates her ssb:
<link rel="apple-touch-icon" href="/path/to/icon.png"> -
Inappropriate?good deal.
I mean, if someone doesn't want to see your site with Growl Notifications and Dock badges, then they don't have to use Fluid... there are plenty of other (great) browsers!
both are very simple. all the info you need is in the links provided above.
Here's an example. just add something like the following to your JavaScript to show a Dock badge:
if (widow.fluid) {
fluid.dockBadge = "oh hai!";
}
to show a growl notification that disappears after a few seconds, does not display an icon, and does not have an onclick handler:
if (window.fluid) {
fluid.showGrowlNotification({
title: "title",
description: "some text here",
sticky: false
});
}
very simple.
1 person says
this answers the question
-
Inappropriate?Let me try that again. i don't have docs on this one feature, but you can also serve a custom icon specifically for Fluid. Fluid will discover this whenever a user creates an SSB and selects 'use site favicon':
<link rel="apple-touch-icon" href="/path/to/my/icon.png">
just put that in your html and point to an image on any server. -
Inappropriate?Ok - I think that I finally get it. I can't believe it took me this long.
a) I have a web app.
b) on each page of this web site, presumably I have javascript that is loaded and executed
c) if in that javascript I include the encapsulated code "if (window.fluid)" then I can make calls to my fluid app locally: growls, etc.
That javascript code will be responsible for setting timers etc to make sure that it sleeps and periodically checks for new updates (by ajax I am guessing).
If I click on a link in my fluid app, then the resulting page will also load and execute the same javascript alluded to above, starting the process over.
Do I understand this system yet? -
Inappropriate?yep I think so :0]
you should download Fluid and make some SSBs... that will prolly clear the rest up for you... -
Inappropriate?Todd - I wanted to thank you for all your help. I am well on my way to getting Fluid working with Movable Type. It is something I would like to make core to the app in future versions. Plus, I will be able to give people preferences as to what they want their dock badge to be, and whether or not they want growls for.
Thank you!!
I’m elated.
-
Inappropriate?If I make a growl notification sticky, how can I hide it with Javascript? I assume I can reference it using its handler, but I can't find any documentation related to Fluid or Growl on it.
I’m inquisitive
-
Inappropriate?hi jordan, no... the growl api does not allow you to programatically reference or close an existing, onscreen growl notification. Therefore fluid does not offer that JS api either. so getting a reference to a notification or closing one programatically is not possible.
To see what's possible, take a look at the Growl Cocoa/ObjC api docs:
http://growl.info/documentation/devel...
there are a couple of items which i am not currently exposed (such as your request for isGrowlRunning())
Loading Profile...


EMPLOYEE
