You are here: PSPad forum > Bug report / Hlášení chyb > Please fix/add JS code explorer classes support

Please fix/add JS code explorer classes support

Goto Page: Previous1 2

#11 Re: Please fix/add JS code explorer classes support

Posted by: Quicker | Date: 2013-11-11 20:07 | IP: IP Logged

wow, this is an old one. ...but still very much needed...

I provide you with 2 pieces of code, which do the same:

var rectangle = {
};
rectangle.init = function (width, height) {
this.height = height;
this.width = width;
return this;
}
rectangle.area= function () {
this.hello();
return this.width * this.height;
}
rectangle.hello= function () {
alert('rectangle');
}

------------------------

function rectangle() {}
rectangle.prototype.init = function(width, height) {
this.height = height;
this.width = width;
return this;
}
rectangle.prototype.area= function() {
this.hello();
return this.width * this.height;
}
rectangle.prototype.hello= function() {
alert('rectangle');
}

-----
You may see, that a line with
-> '='+[0..n BLANKS]+toLower('function')+BLANK
OR->'='+[0..n BLANKS]+toLower('function')+[0..n BLANKS]+'('
marks a javascript class related function

For php the code explorer offers any kind of tree. Actually I do not think that this is so important for people. If everything before '=' would be put into the function list (trimmed and without 'prototype.') for such javascript-lines would work out for most people already.

Btw. PSPAD is a great tool. I use it for 6 years now (usually php and funtional javascript - but latest projects requires me to work on classes)

Cheers,
Quicker

Edited 1 time(s). Last edit at 2013-11-11 20:10 by Quicker.

Options: Reply | Quote | Up ^


#12 Re: Please fix/add JS code explorer classes support

Posted by: pspad | Date: 2013-11-28 14:08 | IP: IP Logged

There is a problem with space between function and ( in the first block of code
I will fix it

Options: Reply | Quote | Up ^


Goto Page: Previous1 2





Editor PSPad - freeware editor, © 2001 - 2021 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR