You are here: PSPad forum > Bug report / Hlášení chyb > 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.
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
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR