-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathyii_class.js
60 lines (44 loc) · 2.31 KB
/
yii_class.js
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
var cl = jQuery('table.summaryTable tr').has('th:contains("Inheritance")').find('td a:first').text().trim();
if (cl != "") {
var clextends = jQuery('table.summaryTable tr').has('th:contains("Inheritance")').find('td a:nth-child(2)').text();
var desc = jQuery('div.class-description p strong').first().text();
var is_static = false;
if (jQuery('div.detail-header span.detail-header-tag.small:contains("static")').length) {
is_static = true;
}
WeBuilderAddClass(cl, desc, "", clextends, is_static);
jQuery('div.method-doc div.detail-header').each(function(i) {
var scope = jQuery(this).find('span.detail-header-tag').text().trim();
if (scope.indexOf("public") > -1 || scope == "") {
var desc = jQuery(this).next('div.doc-description').find('p').first().text().normalize_spaces();
var funcname = jQuery(this).clone();
funcname.find('*').remove();
funcname = funcname.text().trim();
funcname = funcname.replace(/\(\)/, "");
var func = jQuery(this).nextAll('table.detail-table').first().find('td.signature').text().normalize_spaces();
var fnArgsRegex = /\(.*\)/;
var funcargs = func.match(fnArgsRegex);
var funcres = jQuery(this).nextAll('table.detail-table').first().find('th:contains("return")').next('td.param-type-col').first().text().normalize_spaces();
var is_static = "0";
if (scope.indexOf("static") > -1) {
is_static = "1";
}
WeBuilderAddMethod(cl, funcname, funcargs[0], funcres, desc, is_static);
}
});
jQuery('div.property-doc div.detail-header').each(function(i) {
var scope = jQuery(this).find('span.detail-header-tag').text().trim();
if (scope.indexOf("public") > -1 || scope == "") {
var desc = jQuery(this).next('div.doc-description').find('p').first().text().normalize_spaces();
var fieldname = jQuery(this).clone();
fieldname.find('*').remove();
fieldname = fieldname.text().trim();
var fieldtype = jQuery(this).nextAll('div.signature').first().find('span.signature-type').text().normalize_spaces();
var is_static = "0";
if (scope.indexOf("static") > -1) {
is_static = "1";
}
WeBuilderAddProperty(cl, fieldname, fieldtype, desc, is_static);
}
});
}