Not sure how much help this is but...

- I don't think it's recursively calling itself: the definition is for 
"showModalDialog", but it then calls "ModalDialog"

- $1g is a name of a function (dollar signs are valid in function names in JS) 
. In this case, it would have to be defined in SP.UI.ModalDialog (*not* 
SP.UI.showModalDialog).

Michal.


On 2 Jan 2011, at 00:42, Matthew Hazlett wrote:

> Sorry about this post but I am deviating from the subject of mootools for a 
> second to ask the resident JS talent about a strange function I found in 
> Sharepoint 2010.
> I'm loading a subpage and it calls a JS function called OpenPage.  I traced 
> the function threw a veritable maze of MS code to find out what it ultimately 
> does.
>  
> options = {
>                 url: url,
>                 args: null,
>                 title: title,
>                 dialogReturnValueCallback: callback,
>                 width: width,
>                 height: height
> };
>  
> SP.UI.ModalDialog.showModalDialog = function(options) {
>     var $v_0 = new SP.UI.ModalDialog(options);
>     $v_0.$1g();
>     return $v_0;
> }
>  
> So this creates the function 'showModalDialog' in the namespace 
> 'SP.UI.ModalDialog' with 'options' as it's params. 
> Next it recreates itself by recursively calling itself? 
> and what the hell is method $1g();
>  
> This looks like total code gibberish to me.  If I am reading this right, 
> worse yet, it would seem this function is for a modal dialog but that's not 
> what it does!
> This makes no sense to me, anyone know what this could be or where I could 
> look?  There is no constructer at least that I can find.
>  

Reply via email to