META-INF.resources.asset.ajaxjs-ui.js.widgets.admin.allConfig-renderer.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ajaxjs-web Show documentation
Show all versions of ajaxjs-web Show documentation
AJAXJS Web aims to full-stack, not only the server-side framework, but also integrates the front-end library. It's written in HTML5 + Java, a successor to the JVM platform, efficient, secure, stable, cross-platform and many other advantages, but it abandoned the traditional enterprise architecture brought about by the large and bloated, emphasizing the lightweight, and fast, very suitable for the Internet fast application.
function renderRadio(scheme, namespaces, tip, value) {
var t = '[: for (var i=0;i\
[:=list[i].text:] \
[:}:]';
var arr = [];
for(var i = 0, j = scheme.option.length; i < j; i++) {
var item = scheme.option[i];
var _arr = item.split('=');
var checked = value == getRealValue(_arr[0]); // 是否选中?
arr.push({
name : namespaces,
value: _arr[0],
text : _arr[1],
dataNote: tip,
checked : checked
});
}
return tppl(t, {
list : arr
});
}
function renderCheckbox(scheme, namespaces, tip, value) {
// 有一隐藏域是 保存 value 的
var checkboxTpl = '\
[: for (var i=0;i\
[:=list[i].text:] \
[:}:]';
var arr = [];
for(var i = 0, j = scheme.option.length; i < j; i++) {
var item = scheme.option[i];
var _arr = item.split('=');
var checked = isChecked(value, getRealValue(_arr[0])); // 是否选中?
arr.push({
name : namespaces,
value: _arr[0],
text : _arr[1],
dataNote: tip,
checked : checked
});
}
return tppl(checkboxTpl, {
namespaces:namespaces,
totalValue : value,
list : arr
});
}
// 初始化 HTML 编辑器
function initHtmlEditor(li, value, namespaces) {
setTimeout(function() {
var htmlEditor = new ajaxjs_HtmlEditor(li.querySelector('.htmlEditor'));
htmlEditor.setValue(value);
htmlEditor.sourceEditor.name = namespaces;
htmlEditor.sourceEditor.value = value;
}, 0);
}
function renderSelect(scheme, namespaces, tip, value) {
var tpl = '\
[: for (var i=0;i\
[:=list[i].text:] \
[:}:]';
var arr = [];
for(var i = 0, j = scheme.option.length; i < j; i++) {
var item = scheme.option[i];
var _arr = item.split('=');
var checked = value == getRealValue(_arr[0]); // 是否选中?
arr.push({
value: _arr[0],
text : _arr[1],
checked : checked
});
}
return tppl(tpl, {
namespaces:namespaces,
dataNote: tip,
list : arr
});
}