mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
Separate scripts from html & New rendering function
This commit is contained in:
parent
656d34ed0b
commit
e16e92278b
84 changed files with 848 additions and 1280 deletions
|
@ -32,18 +32,7 @@
|
|||
<form id="vstobjects" method="post" name="v_edit_user" class="<?=$v_status?>">
|
||||
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
|
||||
<input type="hidden" name="save" value="save" />
|
||||
<script type="text/javascript">
|
||||
function randomString() {
|
||||
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
|
||||
var string_length = 10;
|
||||
var randomstring = '';
|
||||
for (var i=0; i<string_length; i++) {
|
||||
var rnum = Math.floor(Math.random() * chars.length);
|
||||
randomstring += chars.substring(rnum,rnum+1);
|
||||
}
|
||||
document.v_edit_user.v_password.value = randomstring;
|
||||
}
|
||||
</script>
|
||||
|
||||
<table class='data'>
|
||||
<tr class="data-add">
|
||||
<td class="data-dotted">
|
||||
|
@ -109,7 +98,7 @@
|
|||
}
|
||||
echo ">".htmlentities($value)."</option>\n";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -232,33 +221,3 @@
|
|||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('.add-ns-button').click(function(){
|
||||
var n = $("input[name^=v_ns]").length;
|
||||
if(n < 8){
|
||||
var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
|
||||
t.find('input').attr({value:'', name:'v_ns'+(n+1)});
|
||||
t.find('span').show();
|
||||
$('tr.add-ns').before(t);
|
||||
}
|
||||
if( n == 7 ) {
|
||||
$('.add-ns').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.remove-ns').click(function(){
|
||||
$(this).parents('tr')[0].remove();
|
||||
$('input[name^=v_ns]').each(function(i, ns){
|
||||
$(ns).attr({name: 'v_ns'+(i+1)});
|
||||
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
|
||||
})
|
||||
$('.add-ns').show()
|
||||
})
|
||||
|
||||
$('input[name^=v_ns]').each(function(i, ns){
|
||||
i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue