Skip to main content
Requested links
Source Link
Yuri Leontyev
  • 1.8k
  • 12
  • 14

I think you can go that way:

  1. Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event. You can use jQuery - http://api.jquery.com/click/ or regular js - http://www.howtocreate.co.uk/tutorials/javascript/domevents and place your js code somewhere in master page

  2. Make sure, that you script is triggered after the ribbon is loaded. Cause ribbon is loaded with delay. See these links http://sharepointtaproom.com/2010/07/27/sharepoint-2010-ribbon-responding-to-tab-clicks/ and http://sharepointtaproom.com/2011/09/09/manipulating-the-ribbon-in-sharepoint-2010-with-javascript-part-1/. The easiest solution can be adding handler to ribbon tab open (first link) and set timer to 10 (time the tab content is loaded) seconds, and then registering you js handler with all ribbon buttons (jquery selector - http://api.jquery.com/?ns0=1&s=selector&go=)

  3. You can use js Client Object Model to submit gathered data to a list - http://www.avanadeblog.com/sharepointasg/2011/05/client-object-model-introduction-part-2-adding-a-list-item.html

I think you can go that way:

  1. Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event.

  2. Make sure, that you script is triggered after the ribbon is loaded. Cause ribbon is loaded with delay.

I think you can go that way:

  1. Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event. You can use jQuery - http://api.jquery.com/click/ or regular js - http://www.howtocreate.co.uk/tutorials/javascript/domevents and place your js code somewhere in master page

  2. Make sure, that you script is triggered after the ribbon is loaded. Cause ribbon is loaded with delay. See these links http://sharepointtaproom.com/2010/07/27/sharepoint-2010-ribbon-responding-to-tab-clicks/ and http://sharepointtaproom.com/2011/09/09/manipulating-the-ribbon-in-sharepoint-2010-with-javascript-part-1/. The easiest solution can be adding handler to ribbon tab open (first link) and set timer to 10 (time the tab content is loaded) seconds, and then registering you js handler with all ribbon buttons (jquery selector - http://api.jquery.com/?ns0=1&s=selector&go=)

  3. You can use js Client Object Model to submit gathered data to a list - http://www.avanadeblog.com/sharepointasg/2011/05/client-object-model-introduction-part-2-adding-a-list-item.html

Source Link
Yuri Leontyev
  • 1.8k
  • 12
  • 14

I think you can go that way:

  1. Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event.

  2. Make sure, that you script is triggered after the ribbon is loaded. Cause ribbon is loaded with delay.