I've came across an issue when I was modifying / customizing the mini social tag buttons (a delegate control - class), everything went good and well untill I encountered an issue "onmouseover" event. A TagAndNotes link has onmouseover='{0}_GetSocialNotification(); event, which calls the SocialData.js to retrieve the information regarding the tags on the page and also changes the image to a different image. And that is the problem, I do not want the image to be changed. Investigating the SocialData.js I found in the code the place where they change the image, deleting the code from IF structrues removes this unwanted behavriour. BUT as a good SharePoint behaviour I'm against the modification of OOTB files etc, so I'm trying to find a way to avoid this behaviour without changing the default file.

Untill now I couldn't get my solution to work: I wanted to create an identically same javascript file but in that event I would remove the unwanted piece of code, I registered it as script on demand etc etc. But I don't get it working I've tried changing this and that but no ... I always get some error that the file is not found or method is not existing.

Anyone has any idea, how can I get it to work?

And maybe anyone has another approach I would try?

And if there are 2 scripts with different name on the page, but with the same signature, same methods etc etc, which will be used? Because in my case there 2 of them.

And how do I invoke On Demand?

The js file has following code:

SocialTagsAndNotes._serviceMethod = "GetSocialNotification";
SocialTagsAndNotes._hasIcon24 = "/_layouts/images/SocialTagsAndNotesHas_24.png";
SocialTagsAndNotes._hasIcon32 = "/_layouts/images/SocialTagsAndNotesHas_32.png";

Can I get somehow access outside of the file to this property and maybe I could set the icon to a different source?

Thanks in advance.

  • I cannot recommend this procedure, but one thing you could do is make a backup of the original, then copy it, rename, and then use the copy in which you make the changes. That way you keep the original file and don't have to bother with new script registrations etc. As I mentioned, I can't recommend it, thus I place it as a comment. But it surely is one way to do it. – user2536 Aug 9 '12 at 9:13
  • Agree but not still not a good one, can you imagine some patch will come and your file is overwritten, then you have to redeploy the solution, etc, but still ... it might have negative effect on the users – Shkipper Aug 9 '12 at 9:21
  • What about the images then? If that's the only thing you don't want to change, you can always take a copy of the image it should show at all times and rename the copy to match the url the js switches to. It's either that or make a custom action which is a 100% copy of the SocialTagsAndNotes ribbon action, with the minor change to exclude the image change. – user2536 Aug 9 '12 at 9:33
  • so there is really no ANY other more flexible way to do it? – Shkipper Aug 9 '12 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.