%
function SYNTAX(obj, className, HAS, crossLink, crossLinkRaw, callView) {
var fpParamInfo = function(varname) {
var params = obj.params || [];
for (var i = 0; i < params.length; i++) {
if (params[i].name === varname) {
return params[i];
}
}
return null;
};
var fpGetType = function(varname) {
var info = fpParamInfo(varname);
return info ? '' + crossLink(info.type) + '' : '';
};
var ret = [];
var itemtype = obj.itemtype;
var parts = obj.syntax ? obj.syntax.split(/\r?\n/) : [ obj.name ];
for (var i = 0, len = parts.length; i < len; i++) {
var syntax = [];
if (itemtype === 'constructor') {
/^(new\s+)?([\$\.\w]+)\((.*)\)/.test(parts[i]);
} else if (itemtype === 'property') {
/^()(.*)()$/.test(parts[i]);
} else {
/^()([\$\.\w]+)\((.*)\)/.test(parts[i]);
}
var maybeNew = RegExp.$1;
var name = RegExp.$2;
var param = RegExp.$3;
param = param.replace(/([\$\w]+)/g, function(_, varname) {
var info = fpParamInfo(varname);
var ret = varname + ':' + fpGetType(varname);
if (!info) {
console.log('ERROR : "' + className + ':' + varname + '" not found!', obj);
}
if (info.multiple) { ret += '…'; }
// if (info.optdefault) { ret += '=' + info.optdefault; }
if (info.optional) { ret = '[' + ret + ']'; }
return ret;
});
var returnType = (obj.returnType || obj.type || '').trim();
if (returnType === 'this') { returnType = className; }
if (callView) {
syntax.push(maybeNew + name);
} else {
syntax.push('' + name + '');
}
if (itemtype === 'constructor' || itemtype === 'method') {
syntax.push('(' + (param || ' ') + ')');
}
if (returnType) {
syntax.push(':' + crossLink(returnType));
}
if (!callView) {
syntax.push(' ');
if (HAS(obj.chainable)) {
syntax.push('chainable');
}
if (HAS(obj.static)) {
syntax.push('static');
}
if (HAS(obj.deprecated)) {
syntax.push('deprecated');
}
if (HAS(obj.extended_from)) {
syntax.push('inherited');
}
}
ret.push(syntax.join('\n'));
}
return ret.join('
');
}
function FIND_EXTEND(cur, classes) {
for (var i = 0, len = classes.length; i < len; i++) {
if (classes[i].name === cur) {
return classes[i].extends;
}
}
return null;
}
%>
<%=this.name.replace(/^jindo\./, '')%>
- 클래스
- <%=this.name%>
<% if (HAS(this.deprecated)) { %>
deprecated
<% } %>
<% if (HAS(this.static)) { %>
static
<% } %>
소스코드
<% if (HAS(this.extends)) { %>
- 상속
-
<%=crossLink(this.extends)%>
<%
var exts = this.extends;
while (exts = FIND_EXTEND(exts, this.classes)) {
%>→<%=crossLink(exts)%><%
}
%>
<% } %>
<% if (HAS(this.mixin)) { %>
- 확장
- <%=crossLink(this.mixin).join(', ')%>
<% } %>
<% if (HAS(this.uses)) { %>
- 사용
- <%=crossLink(this.uses).join(', ')%>
<% } %>
<% if (HAS(this.since)) { %>
- 호환성
- <%=this.since%>~
<% } %>
<% if (HAS(this.screenshots)) { %>
스크린샷
<% EACH(this.screenshots, function() { %>

<% }); %>
<% } %>
<%=this.classDescription%>
<% if (HAS(this.remark)) { %>
<% } %>
<% if (HAS(this.see)) { %>
<% } %>
<% if (HAS(this.refer)) { %>
<% } %>
<% if (HAS(this.constructors)) { %>
생성자
생성자
|
생성자 |
정의 주체 |
<% EACH(this.constructors, function(className) { if (this.access === 'private') { return; } %>
<%=(HAS(this.extended_from) ? "inherited-item" : "")%>">
|
<% if (HAS(this.deprecated)) { %>
deprecated
<% } %>
<% if (HAS(this.extended_from)) { %>
inherited
<% } %>
|
<%=SYNTAX(this, className, HAS, crossLink, crossLinkRaw)%>
<%=this.constructorDescription%>
|
<%=(this.class === className ? className : crossLink(this.class))%> |
<% }, [ this.name ]); %>
<% } %>
<% if (HAS(this.properties)) { %>
프로퍼티
프로퍼티
|
프로퍼티 |
정의 주체 |
<% EACH(this.properties, function(className) { if (this.access === 'private') { return; } %>
<%=(HAS(this.extended_from) ? "inherited-item" : "")%>">
|
<% if (HAS(this.deprecated)) { %>
deprecated
<% } %>
<% if (HAS(this.extended_from)) { %>
inherited
<% } %>
|
<%=SYNTAX(this, className, HAS, crossLink, crossLinkRaw)%>
<%=this.propertyDescription%>
|
<%=(this.class === className ? className : crossLink(this.class))%> |
<% }, [ this.name ]); %>
<% } %>
<% if (HAS(this.methods)) { %>
메서드
메서드
|
메서드 |
정의 주체 |
<% EACH(this.methods, function(className) { if (this.access === 'private') { return; } %>
<%=(HAS(this.extended_from) ? "inherited-item" : "")%>">
|
<% if (HAS(this.deprecated)) { %>
deprecated
<% } %>
<% if (HAS(this.extended_from)) { %>
inherited
<% } %>
|
<%=SYNTAX(this, className, HAS, crossLink, crossLinkRaw)%>
<%=this.methodDescription%>
|
<%=(this.class === className ? className : crossLink(this.class))%> |
<% }, [ this.name ]); %>
<% } %>
<% if (HAS(this.events)) { %>
이벤트
이벤트
|
이벤트 |
정의 주체 |
<% EACH(this.events, function(className) { %>
<%=(HAS(this.extended_from) ? "inherited-item" : "")%>">
|
<% if (HAS(this.deprecated)) { %>
deprecated
<% } %>
<% if (HAS(this.extended_from)) { %>
inherited
<% } %>
|
<%=this.name%>
<%=this.eventDescription%>
|
<%=(this.class === className ? className : crossLink(this.class))%> |
<% }, [ this.name ]); %>
<% } %>
<% if (HAS(this.manuals)) { %>
매뉴얼
<% EACH(this.manuals, function() { %>
<%=this.name%>
<%=this.description%>
<% }); %>
<% } %>
<%
var lists = this.constructors && this.constructors.filter(function(v) { return v.access !== 'private'; });
if (HAS(lists)) {
%>
생성자 세부 정보
<% EACH(lists, function(className) { %>
<%=INCLUDE("constructor", this, { 'className' : className, 'SYNTAX' : SYNTAX })%>
<% }, [ this.name ]); %>
<% } %>
<%
var lists = this.properties && this.properties.filter(function(v) { return v.access !== 'private'; });
if (HAS(lists)) {
%>
프로퍼티 세부 정보
<% EACH(lists, function(className) { %>
<%=INCLUDE("property", this, { 'className' : className, 'SYNTAX' : SYNTAX })%>
<% }, [ this.name ]); %>
<% } %>
<%
var lists = this.methods && this.methods.filter(function(v) { return v.access !== 'private'; });
if (HAS(lists)) {
%>
메서드 세부 정보
<% EACH(lists, function(className) { %>
<%=INCLUDE("method", this, { 'className' : className, 'SYNTAX' : SYNTAX })%>
<% }, [ this.name ]); %>
<% } %>
<%
var lists = this.events && this.events.filter(function(v) { return v.access !== 'private'; });
if (HAS(lists)) {
%>
이벤트 세부 정보
<% EACH(this.events, function(className) { %>
<%=INCLUDE("event", this, { 'className' : className, 'SYNTAX' : SYNTAX })%>
<% }, [ this.name ]); %>
<% } %>
<% if (HAS(this.demos)) { %>
<% } %>
<% if (HAS(this.histories)) { %>
전체 히스토리
<%=INCLUDE("history", this.histories)%>
<% } %>