-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathxml.html
More file actions
138 lines (129 loc) · 6.32 KB
/
Copy pathxml.html
File metadata and controls
138 lines (129 loc) · 6.32 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="keywords" content="ui,gui,prototyping,designer,builder,rad,ria,spa,no-code,codeless,without coding,programming,development,drag and drop,web application,build app,create app,make app" />
<meta name="description" content="Powered by CrossUI No-Code App Builder - Create Interactive App Without Coding" />
<meta name="copyright" content="copyright@crossui.com" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Powered by CrossUI No-Code App Builder</title>
</head>
<body>
<textarea id="out" class="html plain"></textarea>
<script type="text/javascript" src="../runtime/xui/js/xui-debug.js"></script>
<script type="text/javascript" src="../runtime/xui/js/Coder.js"></script>
<script type="text/javascript" src="Locale/en.js"></script>
<script type="text/javascript">
xui.main(function(){
xui.setAppLangKey("app");
var api2xml=function(){
var t,
doc=xui.Locale[xui.getLang()].doc,
map1={_:1,$:1},
map2={prototype:1,constructor:1,toString:1,valueOf:1,upper:1,Constructor:1,After:1,Before:1,KEY:1},
reg=/\./,
ghash={},
getAPI=function(o,tag){
var tt,hash;
ghash[tag]={
completion:{
'@version':'CrossUI-1.3',
'@extends':((function(tag){var a=[],t=xui.SC(tag).$parent; if(t && t.length){xui.arr.each(t,function(o){a.push(o.KEY)}); return a.join(',')}else return 'Object'})(tag)),
'@parent':(tt=tag.split('.')).length>1?tt.slice(0,tt.length-1).join('.'):'window',
'@prefix':tag,
item:[]
}
};
hash=ghash[tag].completion.item;
var k=o.KEY;
for(var i in o){
if(!map1[i.charAt(0)] && !map2[i] && !reg.test(i)){
if(typeof o[i]=='function'&& o[i].$xui$)
getAPI(o[i],tag+'.'+i);
else{
if(typeof (t=o[i])!='function' || !(t=t.$original$) || t==k){
var v=xui.get(doc,(tag+'.'+i).split('.')),ss="",s="",r="void",a,aa,h;
if(v){
if(typeof xui.SC(tag+'.'+i)=='function'){
aa=[];
a=v.$paras;
if(a && a.length){
xui.arr.each(a,function(o){
s=o.replace(/\.$/,'').replace(/(\w+)\s*(\[\w+\])?(\s*\:\s*)([\w\./\[\]]+)(.*)/,'$4 $1');
if(o.indexOf("[Optional]")!=-1)
s = "["+s+"]";
aa.push(s);
})
}
}
if(aa)
ss="("+aa.join(" , ")+")";
r=v.$rtn?v.$rtn:r;
r=r.replace("[self]",tag);
}
h={
'@rpel':tag+"."+i,
'@display':tag+"."+ i + ss + ' : ' + r
};
if(v&&v.$desc)
h['#cdata']=(v&&v.$desc);
hash.push(h);
}
}
}
}
o=o.prototype;
for(var i in o)
if(!map1[i.charAt(0)])
if(typeof (t=o[i])=='function' && (!(t=t.$original$) || t==k)){
var v=xui.get(doc,(tag+'.prototype.'+i).split('.')),ss="",s="",r="void",a,aa,h;
if(v){
if(typeof xui.SC(tag+'.prototype.'+i)=='function'){
aa=[];
a=v.$paras;
if(a && a.length){
xui.arr.each(a,function(o){
s=o.replace(/\.$/,'').replace(/(\w+)\s*(\[\w+\])?(\s*\:\s*)([\w\./\[\]]+)(.*)/,'$4 $1');
if(o.indexOf("[Optional]")!=-1)
s = "["+s+"]";
aa.push(s);
})
}
}
if(aa)
ss="("+aa.join(" , ")+")";
r=v.$rtn?v.$rtn:r;
r=r.replace("[self]",tag);
}
h={
'@rpel':i,
'@display':i + ss + ' : ' + r
};
if(v&&v.$desc)
h['#cdata']=(v&&v.$desc);
hash.push(h);
}
};
xui.arr.each(['_','xui.fun','xui.str','xui.arr','Class','xui'],function(o,i){
getAPI(xui.SC(o),o);
});
var out={};
xui.each(ghash,function(o,i){
out[i]=xui.XML.json2xml(o);
});
return out;
};
var hash=api2xml();
var str="";
xui.each(hash,function(o,i){
str +="<!------------><!------------><!-- save as " + i + ".xml --><!------------><!------------>" + o;
});
xui("out").text( str );
xui.Coder.applyById("out",true);
});
</script>
</body>
</html>