Fire event comment.create with live-stream facebook plugin - facebook-graph-api

The event comment.create fired when the user adds a comment (fb:comments) and the event comment.remove fired when the user removes a comment (fb:comments)
view : http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
If I want to detect the same events in (fb:live-stream) http://developers.facebook.com/docs/reference/plugins/live-stream/
may I use comment.create and comment.remove or
something else like event stream.publish and stream.remove

Neither https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ nor http://developers.facebook.com/docs/reference/plugins/live-stream/ indicate there's any public event you can subscribe to for the Live Stream plugin. If you think this is valuable to have, log a bug/enhancement request with Facebook and post the link to the bug report here. Thanks :)

Related

AgGrid Detect changing on columns/filters/sortings events

I'm using ag-grid and I'd like to save the layout/state of the user. Pretty much something like this
This solution forces the user to click on the button to save the preferences ("Save state"). There is some other way/event to detect that the user changed the state of the table (in order, to me to save and avoid to force the user to click on a button for that)?
I was hopping to find some method here but i didn't..
I initially had code that listened to all of the applicable events from the grid, but ultimately, I found it easier to just save the entire grid state in the component's onDestroy method, regardless of whether anything has actually changed.
Found my answer here.
All the events are here but i prefer to add a global event:
addGlobalListener(listener) Add an event listener for all event types coming from the grid.)
Source: AgGrid javascript grid api

Subscriptions to model lifecycle events accumulate

When updating a record, I do the following:
...
this.transaction.commit();
entry.on("didUpdate", this.afterSave.bind(this, success_msg));
But my function afterSave "accumulates" on the run loop (no better way to describe it). That is, the first time that I edit a record, afterSave is called once. The second time, it is called twice, and so on.
What am I doing wrong here?
EDIT
According to the model lifecycle, record.on subscribes to events. When I want to save en edited record, I basically do the following:
update the model data, updating some derived properties from the view
commit the transaction
suscribe to the didUpdate event, to notify the user and perform some final cleanup
So, every time that I edit the record, I suscribe to the didUpdate event. I expected that this was a one-time suscription. That is: I suscribe, the event is fired, I handle it, done and forgotten.
But maybe Ember practices are not supposed to work like this. It seems that I each time I call .on('didUpdate' the old suscription is still remembered. Is this so? I do not want to do this. How can I do one of these:
remove any existing suscriptions from the current record
or get a fresh record, so that I can suscribe to events from scratch. Currently I get the record with this.get('content')
I guess to avoid accumulation of subscriptions you should use one: http://emberjs.com/api/classes/Ember.Evented.html#method_one as a one time subscription. one subscribes a function to a named event and then cancels the subscription after the first time the event is triggered.
remove any existing subscription
As for the unsubscription, you could do it with on's counterpart off: http://emberjs.com/api/classes/Ember.Evented.html#method_off
Hope this helps.

Receive PostMessage messages for MFC Dialog

I have a dialog where the user is able to enter information and then press the Go button. When they press this button I disable the form elements (buttons etc) and create a worker thread using AfxBeginThread( ... ). Once the worker thread has completed I want it to send a message to the UI thread so as to re-enable the form. I am using ::PostMessage( ... ) to send the message, but I can't find how to intercept these messages.
i've searched online (Link #1, Link #2, Link #3) but I can't find an understandable example of the code to implement my own message listener. In the header I can see some crazy define statements (started with DECLARE_MESSAGE_MAP()) which looks like it may have something to do with it, but I can't figure it out.
Any help is much appreciated. Thanks.
The message map is a table. For each message you are interested in it contains the message and a function pointer to the message handler function. To add a custom message to the map you add an ON_MESSAGE entry to the table. A tutorial example of doing this from a worker thread is here:
http://vcfaq.mvps.org/mfc/12.htm

Sitecore - Creating an New Item on the OnSavingItem Event redirects the Shell to the newly created Item

Got an annoying issue.
When a user edits a field on an item, we use a OnSavingItem event handler to create some new items elsewhere in the background as it were.
Problem is the item the users edited the field of gets redirected to the item we invisible created in the background.
We want it to stay where it is... Any ideas?
thanks
If you want to disable the transfer to the item you've just created you could also consider implementing the following code:
// Before we copy the item we put notifications on to make sure we won't be transfered to the newly created item
Sitecore.Client.Site.Notifications.Disabled = true;
// Your action comes here
Sitecore.Client.Site.Notifications.Disabled = false;
Are you using the
<event name="item:saved">
Handler? If so, don't forget that this event is fired on all the new items you create as well, potentially triggering a recursive event loop.
This answer came from the SiteCore forum ... credit goes to John West
I think you could use the item:saving event or the saveUI pipeline. Use the event if you need to handle changes that occur through APIs, or use the pipeline if you only need to handle changes that occur through the user interface.
You could also consider adding the logic to the field itself.
John West Sitecore Blog
item:saved is much heavier than a processor within the saveUI pipeline. For example, item:saved is triggered during publishing which is not what you really want. I always recommend handling such customizations either on the pipeline or workflow action level.

How to get complete HTML body using browser helper object (BHO) in case of DHTML/AJAX page?

I'm writing a BHO that analyze the HTML taken from the 'onDocumentComplete' event of 'DWebBrowserEvents2'. Currently it works fine, unless I have a DHTML/AJAX page, where HTML handle is delivered too soon.
For sample, I tried using it on 'http://www.google.com'. From the 'onDocumentComplete' event I can get most of the page but in the topmost link/anchors, the 'href' for maps, videos, orkut etc. is not available (normally it is javascript:void(0)).
Has anyone any ideas how to capture it when the page is fully loaded rather than just when the frame/body is loaded?
Thanks,
UPDATE
It seems there is some problem with the MSHTML API. I have posted the same question on MSDN forum and some response. Also I have detailed out my problem and findings....
http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/d517dbd1-df22-4dce-8ff9-0ca6786757f9
In case someone finds some way to solve this then please do share...
Thanks,
The AJAX DHTML changes mostly don't cause a further onDocumentComplete call.
You need to register for further Window or Document events such as DISPID_HTMLWINDOWEVENTS2_ONLOAD.
One method is to advise the window of a com object that you provide with the generic event sink interface.
hr = AtlAdvise(winDisp, pWinHandler, DIID_HTMLWindowEvents2, &dwCookie);
When this further event is triggered re examining the document you will find that it is updated.