977 reputation
320
bio website
location Perth, Australia
age 31
visits member for 3 years
seen yesterday

Lead SharePoint developer for a major Australian mining company.


Jan
3
accepted Custom Content Query Web Part in a Sandbox Solution
Jan
3
answered Custom Content Query Web Part in a Sandbox Solution
Jan
3
accepted Dynamically registering JavaScript from within a sandbox web part
Jan
3
answered Dynamically registering JavaScript from within a sandbox web part
Jan
3
comment Rich Text fields in New Item Dialog - IE9
I'm not sure you'd ever need two exact copies of the same function on the same page, but in either case, this solution worked great for me without having to overwrite the RTE_GetEditorInstanceVariables() function. Happy days -- thanks Matt :) PS: This, together with your other stack exchange questions on these "random" SharePoint 2010 & IE9 bugs have been the most concise and definitive set of solutions I could find on the net. If you hung them all together in a blog post somewhere, I'm sure it'd be rather popular with other dev folk like myself.
Jan
2
comment Rich Text fields in New Item Dialog - IE9
Correct me if i'm wrong @Matt, but it doesn't look like there's any difference between the RTE_GetEditorInstanceVariables function you posted here and the OOTB function in form.debug.js
Nov
24
awarded  Popular Question
Nov
21
comment Programmatically find lists by template ID
Answer posted...
Nov
21
accepted Programmatically find lists by template ID
Nov
21
answered Programmatically find lists by template ID
Nov
9
comment Programmatically find lists by template ID
Hi Hugh. I ended up just using a foreach loop to iterate through the SPWeb.Lists collection and checking each list's BaseTemplate value to get all the picture and asset libraries. The only reason we went with this approach is because I was able to change the web part requirements so that it just displays a selection of picture libraries in the current site (as apposed to the whole site collection). This is actually a major factor for us as our entire intranet is just a single site collection, and so it contains a few hundred child SPWebs -- and iterating all those could've taken ages!
Nov
6
revised Programmatically find lists by template ID
added 48 characters in body
Nov
6
asked Programmatically find lists by template ID
Nov
5
answered Automatically Activate Feature when subsite created
Nov
5
comment Dynamically registering JavaScript from within a sandbox web part
I just updated the original question with a fourth option (which was posted in a comment by @eirikb). It uses the custom action method too, but he instead points it to a JavaScript function which then works out whether the script file should be loaded on the current page (as apposed to getting the custom action to blindly write the <script> tag). It's the most risky solution as I have no idea how much testing it's had (if any), but it's probably the cleanest as it can be used for CSS files too. Care to weigh in with an opnion?
Nov
5
revised Dynamically registering JavaScript from within a sandbox web part
Added fourth option (based on user comments).
Nov
5
revised Dynamically registering JavaScript from within a sandbox web part
deleted 31 characters in body
Nov
5
comment Dynamically registering JavaScript from within a sandbox web part
I wasn't aware you could use tokens inside the ScriptSrc value -- that makes it an attractive option. Unfortunately though, in my case, the JavaScript files registered by the web parts really shouldn't be loaded onto every page in the site, just the home page. So that's a real deal-breaker for me! My common scripts are already referenced directly in my master page.
Nov
2
comment Dynamically registering JavaScript from within a sandbox web part
That's very interesting indeed! I haven't downloaded your source yet, but it looks at first glance like you're using the CustomAction's ScriptLink attribute to call a "middle-man" function that you've written to do all the necassary checks (i.e. determine if the file is already loaded and that all its dependencies have loaded etc.). Is this about right? Some quick follow up questions... Are you able to control where / when in the DOM the scripts gets registered? For example, what if I want to ensure that my custom CSS is loaded either before or after the OOTB SharePoint stylesheets?
Nov
2
revised Dynamically registering JavaScript from within a sandbox web part
added 109 characters in body; edited tags