forked from aivarsi/framework-scraper-webuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnette_class.js
More file actions
64 lines (47 loc) · 2.19 KB
/
Copy pathnette_class.js
File metadata and controls
64 lines (47 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var cl = jQuery('dl.tree dd b span').text().trim();
if (cl != "") {
var clextends = jQuery('dl.tree dd').last().prev('dd').find('a span').first().text();
var desc = jQuery('div.description p').first().text();
var is_static = false;
if (jQuery('#methods tr td.attributes code:contains("static")').length) {
is_static = true;
}
WeBuilderAddClass(cl, desc, "", clextends, is_static);
jQuery('#methods tr').each(function(i) {
var scope = jQuery(this).find('td.attributes>code').text().trim();
if (scope.indexOf("public") > -1 || scope == "") {
var desc = jQuery(this).find('div.description.short p').first().text().normalize_spaces();
var funcname = jQuery(this).find('td.name div code a').first().text().trim();
var func = jQuery(this).find('td.name div code').first().text().normalize_spaces();
var fnArgsRegex = /\(.*\)/;
var funcargs = func.match(fnArgsRegex);
var funcres = "";
var funcresparts = scope.replace(/public|static/g, "");
funcresparts = funcresparts.match(/[^\s]+$/);
if (funcresparts && funcresparts.length > 0)
funcres = funcresparts[0];
var is_static = "0";
if (scope.indexOf("static") > -1) {
is_static = "1";
}
WeBuilderAddMethod(cl, funcname, funcargs[0], funcres, desc, is_static);
}
});
jQuery('#properties tr').each(function(i) {
var scope = jQuery(this).find('td.attributes>code').text().trim();
if (scope.indexOf("public") > -1 || scope == "") {
var desc = jQuery(this).find('div.description.short p').first().text().normalize_spaces();
var fieldname = jQuery(this).find('td.name a var').first().text().trim();
var fieldtype = "";
var fieldtypeparts = scope.replace(/public|static/g, "");
fieldtypeparts = fieldtypeparts.match(/[^\s]+$/);
if (fieldtypeparts && fieldtypeparts.length > 0)
fieldtype = fieldtypeparts[0];
var is_static = "0";
if (scope.indexOf("static") > -1) {
is_static = "1";
}
WeBuilderAddProperty(cl, fieldname, fieldtype, desc, is_static);
}
});
}