Log in or register to post comments
Last post
oggiemc's picture
Joined: 28/05/2011
Posts: 35
editor syntax
Hello all,

Can someone explain to me what the following syntax means?
dialog._.tabs[ pageId ];
i.e what does the ._. notation mean? Something to do with private variables??

Thanks
alfonsoml's picture
Joined: 31/12/2006
Posts: 3733
Re: editor syntax
Yes, it means some object that probably you shouldn't use if you want to be sure that your code keeps working in future versions. (although usually the internals aren't changed so much between revisions)

That's really a trick, it happens that _ is a valid name for an object property in javascript, and in CKEditor when you find something that way it's because putting ._ is shorter than putting .private (or any other word) specially thinking about the total file size.
oggiemc's picture
Joined: 28/05/2011
Posts: 35
Re: editor syntax
ok thanks for reply alsonsomi..
so effectively the _ is used instead of a full word to reduce the file size?

Thanks
codewaggle's picture
Joined: 29/06/2011
Posts: 44
Re: editor syntax
Hi AlfonsoML,

I'd like to get a better understanding of the "._." syntax, do you have any links to further information?

Using this snippet from the code as a sample:
var tabId = this._.currentTabId

Is it saying look through the properties of this tab object and see if one has a child called "currentTabId" or does it replace a specific property name? If a specific property name, where in the code is the "_" assigned the value of that specific property?

Is it used to replace anything other than ".private." in the CKEditor code?

Thanks,
Joe
alfonsoml's picture
Joined: 31/12/2006
Posts: 3733
Re: editor syntax
codewaggle wrote:

Is it used to replace anything other than ".private." in the CKEditor code?

Thanks,
Joe


No. That's all that it does.
codewaggle's picture
Joined: 29/06/2011
Posts: 44
Re: editor syntax
Thanks for the feedback,
Joe