mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
Create script for multi-lingual input control page (again)
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8855 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ac9bf88af4
commit
3568bb75ff
2 changed files with 13 additions and 14 deletions
|
|
@ -2,28 +2,27 @@ jQuery(function($){
|
||||||
|
|
||||||
// multi-lingual text list
|
// multi-lingual text list
|
||||||
$('#langList')
|
$('#langList')
|
||||||
.find('ul').hide().attr('aria-hidden','true').end() // collapse all language input control
|
.find('form').hide().attr('aria-hidden','true').end() // collapse all language input control
|
||||||
.delegate('button._edit', 'click', function(){
|
.delegate('button._edit', 'click', function(){
|
||||||
var $this = $(this), $ul = $this.next('ul'), form;
|
var $this = $(this), $form = $this.next('form');
|
||||||
|
|
||||||
// toggle input control
|
// toggle input control
|
||||||
if($ul.attr('aria-hidden') == 'false') {
|
if($form.attr('aria-hidden') == 'false') {
|
||||||
$ul.slideUp('fast');
|
$form.slideUp('fast');
|
||||||
$ul.attr('aria-hidden', 'true');
|
$form.attr('aria-hidden', 'true');
|
||||||
}else{
|
}else{
|
||||||
$ul.slideDown('fast');
|
$form.slideDown('fast');
|
||||||
$ul.attr('aria-hidden', 'false');
|
$form.attr('aria-hidden', 'false');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ul.data('lang-loaded') == true) return;
|
if($form.data('lang-loaded') == true) return;
|
||||||
|
|
||||||
$ul.data('lang-loaded', true);
|
$form.data('lang-loaded', true);
|
||||||
form = $this.closest('form').get(0);
|
|
||||||
|
|
||||||
function on_complete(ret) {
|
function on_complete(ret) {
|
||||||
var name = ret['lang_name'], list = ret['lang_list']['item'], elems = form.elements, item;
|
var name = ret['lang_name'], list = ret['lang_list']['item'], elems = $form[0].elements, item;
|
||||||
|
|
||||||
$ul.find('label+textarea').prev('label').css('visibility','hidden');
|
$form.find('label+textarea').prev('label').css('visibility','hidden');
|
||||||
|
|
||||||
if(!$.isArray(list)) list = [list];
|
if(!$.isArray(list)) list = [list];
|
||||||
for(var i=0,c=list.length; i < c; i++) {
|
for(var i=0,c=list.length; i < c; i++) {
|
||||||
|
|
@ -38,7 +37,7 @@ $('#langList')
|
||||||
exec_xml(
|
exec_xml(
|
||||||
'module',
|
'module',
|
||||||
'getModuleAdminLangListByName',
|
'getModuleAdminLangListByName',
|
||||||
{lang_name:form.elements['lang_name'].value},
|
{lang_name:$form[0].elements['lang_name'].value},
|
||||||
on_complete,
|
on_complete,
|
||||||
'error,message,lang_list,lang_name'.split(',')
|
'error,message,lang_list,lang_name'.split(',')
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
<ul id="langList">
|
<ul id="langList">
|
||||||
<li loop="$lang_code_list=>$key,$value">
|
<li loop="$lang_code_list=>$key,$value">
|
||||||
{@$langName = $value->name}
|
{@$langName = $value->name}
|
||||||
|
<strong>{$value->value}</strong> <button type="button" class="side text _edit">Edit</button>
|
||||||
<form action="./" method="post" class="form" id="langForm_{$langName}" >
|
<form action="./" method="post" class="form" id="langForm_{$langName}" >
|
||||||
<input type="hidden" name="act" value="procModuleAdminInsertLang" />
|
<input type="hidden" name="act" value="procModuleAdminInsertLang" />
|
||||||
<input type="hidden" name="lang_name" value="{$langName}" />
|
<input type="hidden" name="lang_name" value="{$langName}" />
|
||||||
<strong>{$value->value}</strong> <button type="button" class="side text _edit">Edit</button>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li class="{$key2}" loop="$lang_supported=>$key2,$value2"><label for="{$langName}_{$key2}">{$value2}</label> <textarea rows="1" cols="42" name="{$key2}" id="{$langName}_{$key2}"></textarea></li>
|
<li class="{$key2}" loop="$lang_supported=>$key2,$value2"><label for="{$langName}_{$key2}">{$value2}</label> <textarea rows="1" cols="42" name="{$key2}" id="{$langName}_{$key2}"></textarea></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue