rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nansenat16

Pages: 1
1
HTML & templates / a upload template
« on: May 21, 2007, 06:26:54 PM »
Share my upload template ;D
Code: [Select]


[upload]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <title>HFS %folder%</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <style type="text/css">
  %style%
  </style>
</head>
<body>
%login-link%
%loggedin%
<script type="text/javascript">
var s1, s2;
if (window.parent.progress) s1 = '" target=_parent', s2 = 'CLOSE';
else s1 = '+progress"', s2= 'ADD';
document.write('<a href="~upload'+s1+' class=button onClick="if (frm.upbtn.disabled) return false;"><img src="/~img10" /> '+s2+' PROGRESS FRAME</a>');
</script>
<a href="." target=_parent class=button><img src="/~img21" /> CANCEL UPLOAD</a>
<div style="margin-top:60px" id=folderlabel>folder</div>
<div id="folder">%folder%</div>
<div id="body">

<script type="text/javascript">
<!---
/*
Designer:Nansenat16(nansenat16+js@gmail.com)
Web:http://nansen.ispaz.blogdns.org
Date:2006/08/21
Licence:BSD licence
Test browse:Firefox 1.5.0.6、Opera 9.01、IE6 SP2
*/
count_n=1;//del_button count
count_m=1;//upload file count
function add_upload(){
text=document.createElement("input");
text.type="file";
text.size="70";
text.setAttribute('onchange','addchk()');//For Firefox Opera
text.onchange = function(){//For IE
addchk();
};
text.name="fileupload"+count_m;
document.getElementById("upload_div").appendChild(text);
count_m++;
}
function add_del_button(){
text=document.createElement("input");
text.type="button";
text.value="Delete";
text.id="del"+count_n;
text.name="del_button";
text.setAttribute('onclick','delchk(this.id)');//For Firefox Opera
if ((document.all)&&(document.getElementById)){//For IE
text["onclick"]=new Function("delchk(this.id)");
}
document.getElementById("upload_div").appendChild(text);
count_n++;
}
function get_del_num(did){
del_button=document.getElementsByName("del_button");//get all delete button object
if(del_button.length==0){//For IE
tmp=document.getElementsByTagName('input');
tmp_n=0;
tmp_ary=new Array();
for(n=0;n<tmp.length;n++){
if(tmp[n].name=="del_button"){
tmp_ary[tmp_n]=tmp[n];
tmp_n++;
}
}
del_button=tmp_ary;
}
for(m=0;m<del_button.length;m++){
if((del_button[m].id)==did){
del_num=m;
}
}
return del_num;
}
function get_previous_id(did){
del_button=document.getElementsByName("del_button");//get all delete button object
if(del_button.length==0){//For IE
tmp=document.getElementsByTagName('input');
tmp_n=0;
tmp_ary=new Array();
for(n=0;n<tmp.length;n++){
if(tmp[n].name=="del_button"){
tmp_ary[tmp_n]=tmp[n];
tmp_n++;
}
}
del_button=tmp_ary;
}
for(m=0;m<del_button.length;m++){
if((del_button[m].id)==did){
if(m>=1){
previous_id=del_button[m-1].id+"";
}else{
previous_id=-1;
}
}
}
return previous_id;
}
function del_file_upload(did){
upload_ary=document.getElementsByTagName("input");//get all upload input object
if(upload_ary.length==0){//For IE
upload_ary=document.getElementsByTagName('input');
}
tmp_n=0;
tmp_ary=new Array();
for(n=0;n<upload_ary.length;n++){
if(upload_ary[n].name.match(/^fileupload+\S/)){
tmp_ary[tmp_n]=upload_ary[n];
tmp_n++;
}
}
upload_ary=tmp_ary;
del_num=get_del_num(did);
document.getElementById("upload_div").removeChild(upload_ary[del_num]);
count_m--;
}
function del_del_button(did){
del_button=document.getElementsByName("del_button");//get all delete button object
if(del_button.length==0){//For IE
tmp=document.getElementsByTagName('input');
tmp_n=0;
tmp_ary=new Array();
for(n=0;n<tmp.length;n++){
if(tmp[n].name=="del_button"){
tmp_ary[tmp_n]=tmp[n];
tmp_n++;
}
}
del_button=tmp_ary;
}
del_num=get_del_num(did);
document.getElementById("upload_div").removeChild(del_button[del_num]);
}
function addchk(){
upload_ary=document.getElementsByTagName("input");//get all upload input object
if(upload_ary.length==0){//For IE
upload_ary=document.getElementsByTagName('input');
}
tmp_n=0;
tmp_ary=new Array();
for(n=0;n<upload_ary.length;n++){
if(upload_ary[n].name.match(/^fileupload+\S/)){
tmp_ary[tmp_n]=upload_ary[n];
tmp_n++;
}
}
upload_ary=tmp_ary;
tmp_chk=true;
n=0;
while(tmp_chk==true&n<upload_ary.length){
if(upload_ary[n].value==""){
tmp_chk=false;
}
n++;
}
if(tmp_chk==true){
if(count_m>0){
tmp=document.getElementById("add_button");
if(tmp){
document.getElementById("upload_div").removeChild(tmp);
}
add_del_button();
}
add_upload();
}
}
function delchk(did){
del_file_upload(did);
del_del_button(did);
}
-->
</script>


<form name="frm" action="." target=_parent method=post enctype="multipart/form-data" onSubmit="frm.upbtn.disabled=true; return true;">
<div id="upload_div" style="width:100%"><input type="file" name="fileupload0" onChange="addchk()" size="70"/></div>
<noscript>
%upload-files%
</noscript>
<input name="upbtn" type="submit" value="Upload files" />
</form>
<br />Before uploading you may want to open a <a target=_blank href="/~progress">progress status window</a>.
</div>
<div id=footer>
<a href="http://www.rejetto.com/hfs/">HttpFileServer %version%</a>
<br />Servertime: %timestamp%
<br />Uptime: %uptime%
<br />Disk space: %diskfree%
</div>
</body>
</html>



[attachment deleted by admin]

2
HTML & templates / Re: A template encode problem
« on: May 21, 2007, 01:12:10 PM »
Thinks. :D

3
HTML & templates / A template encode problem
« on: May 21, 2007, 12:38:03 PM »
Hi, all

I have a problem about save template. I use hfs in Chinese Winxp. When I apply a template,it's have Chinese word.
hfs running find and output proper. But when I exit hfs and start it, hfs can't output proper Chinese word. I find the tpl save in reg "HKEY_CURRENT_USER\Software\rejetto\HFS" The code in the string is "??". Is this a bug or system can't save utf-8 in reg? I thought maybe use base64 encode the tpl

Sorry,my English very poor :-[

Pages: 1