Commits

Anonymous committed 669812b

seo/about

Comments (0)

Files changed (4)

   static_files: static/robots.txt
   upload: static/robots.txt
 
-- url: /(index.html)?
-  static_files: static/index.htm
-  upload: static/index.htm
+
 - url: /admin
   script: kcbuser.py
   login: required
 ############__________________________________________________________________________
 import re
 
+class MainPage(webapp.RequestHandler):
+  def get(self):
+	  User=None
+	  template_values = {
 
+	  'USER':User,
+      }
+	  path = os.path.join(os.path.dirname(__file__), 'tpl','mainpage.html')
+	  self.response.out.write(template.render(path, template_values))
+
+class AboutPage(webapp.RequestHandler):
+  def get(self):
+	  User=None
+	  template_values = {
+
+	  'USER':User,
+      }
+	  path = os.path.join(os.path.dirname(__file__), 'tpl','aboutpage.html')
+	  self.response.out.write(template.render(path, template_values))
 
 class ShortUrlHandler(webapp.RequestHandler):
   def get(self,url):
 	  except IndexError:
 		self.redirect('/signin')
 
-application = webapp.WSGIApplication([('/(.*)', ShortUrlHandler),],debug=True)
+application = webapp.WSGIApplication([
+('/', MainPage),
+('/about', AboutPage),
+('/(.*)', ShortUrlHandler),
+
+],debug=True)
 
 def main():
   run_wsgi_app(application)

tpl/aboutpage.html

+<html>
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+<link href="../static/main.css" rel="stylesheet" type="text/css" media="all" />
+<title>关于--dxskcb--大学生课程表</title>
+    {% include 'seo.html' %}
+</head>
+ <body>
+    {% include 'header.html' %}
+
+
+
+<h2>内容完善中。。。。。。</h2>
+
+
+
+
+
+
+{% include 'footer.html' %}
+</body>
+
+</html>

tpl/mainpage.html

-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link href="../static/main.css" rel="stylesheet" type="text/css" media="all" />
-<title>MYKCB</title>
+
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
+
+<title>Mycubemark</title>
+<style type="text/css">
+td,input,th,span{font:9pt verdana;}
+div.text{
+	margin-bottom: 5px;
+	font-size:10pt;
+}
+td.text1{
+
+	font-size:10pt;
+}
+input.btn
+{ padding-left:2px;
+ padding-right:2px;
+  width:86px;
+}
+input.btn1
+{ padding-left:2px;
+ padding-right:2px;
+ width:168px;
+}
+input.btn2
+{ padding-left:2px;
+ padding-right:2px;
+  width:106px;
+
+}
+input.btn3
+{ height:250px;
+  width:250px;
+
+}
+}
+
+
+</style><style type="text/css">.jlhlebbhengjlhmcjebbkambaekglhkf {top: 0px; left: 0px;min-width: 30px;max-width: 300px;font-size: 13px;font-family: arial, helvetica, sans-serif;opacity: .93;padding:0px;position:absolute;display:block;z-index: 999997;font-style: normal;font-variant: normal;font-weight: normal;}#jlhlebbhengjlhmcjebbkambaekglhkf_up{text-align: center;padding:0px;margin: 0px;}#jlhlebbhengjlhmcjebbkambaekglhkf_cont{background-color: #729FCF;font-family: arial, helvetica, sans-serif-webkit-box-shadow: #729FCF 0px 0px 2px;color: #FFFFFF;padding:7px;-webkit-border-radius: 5px;}#jlhlebbhengjlhmcjebbkambaekglhkf_down{text-align: center;padding:0px;margin: 0px;}</style>
+
+
     {% include 'seo.html' %}
 </head>
-    {% include 'header.html' %}
+   <center> {% include 'header.html' %}</center>
 
-  <body>
-<div style="text-align:center;"><a href="/signin"><img src="/static/kechengbiao.jpg"  alt="wd-kcb" />
-</a>
+
+
+
+<body onkeyup="begin(event)" onkeydown="stop(event)" onload="rndCube()">
+<script type="text/javascript">
+
+
+var then; //used by show()
+var nowDec;
+var nowBest;
+var nowWorst;
+var running=0;// stopwatch status
+var timeint;
+var i=0;
+
+var totalsec;
+var sec;
+var min;
+var subsec;
+var secdis;
+var mindis;
+var subsecdis;// the var above used by show(), is pretty much temp vars
+
+var datas=new Array()// store the records
+var nowSecondes;
+var Max=25; //random cube steps
+var arr=new Array();//random cube array
+var myinterval=20; //interval for ie
+if (navigator.userAgent.indexOf("Gecko")>-1) myinterval=10;
+
+function stop(evt)// handle the keyup event
+{
+	if (running==1 && evt.keyCode==32)
+	clearTimeout(timeint);
+}
+
+function toSeconds(dec)// convert the stopwatch display text to seconds
+{	var Ms;
+	var tmpDec=dec.split(":");
+	if(tmpDec[0]*10/10>0)
+	{
+		Ms=tmpDec[0]*60;
+		return (Ms+tmpDec[1]*10/10);
+	}else{
+		return (tmpDec[1]*10/10);
+		}
+
+}
+
+function begin(evt) // handle the keydown and reset event
+{
+	if (evt.keyCode==32)
+	{
+		if (running==0){
+		then=new Date();
+		running=1;
+		show();
+
+
+		}
+		else if (running==1)
+			{
+				running=2;
+		//		document.getElementById("watch1").innerHTML=running;
+			}
+			else
+			{
+        //     document.getElementById("watch1").innerHTML="ok";
+		    ShowDatas(toSeconds(nowSeconds));
+			document.getElementById("watch").innerHTML="00:00.00";
+			running=0;
+
+
+			}
+	}
+}
+var runningb=0;
+function spacebar() // handle the keydown and reset event
+{
+
+		if (runningb==0)
+		{
+		then=new Date();
+		runningb=1;
+		show();
+
+
+		}
+		else if (runningb==2)
+			{
+		    ShowDatas(toSeconds(nowSeconds));
+			document.getElementById("watch").innerHTML="00:00.00";
+			runningb=0;
+			}
+		else{
+		clearTimeout(timeint);
+		runningb=2;
+		}
+}
+
+var a=0;
+function ShowDatas(dec) //push the record in array, display the nowBest and nowWorst and display the record table
+{
+	if(dec==0){return false;}
+	if (dec!=-1)
+	{
+	var newDec=get2(dec);
+	datas.push(newDec);
+	}
+
+	SortDatas();
+
+	ShowDetails();
+    var tempstraa=(datas.length!=0)?sec2minsec(nowBest):"";
+	spanBest.innerHTML="<b style=color:red>"+tempstraa+"</b>";
+     tempstraa=(datas.length!=0)?sec2minsec(nowWorst):"";
+	spanWorst.innerHTML="<b>"+tempstraa+"</b>";
+	var tmp1=0;
+	for(i=0;i<datas.length;i++)
+	{
+		tmp1+=datas[i];
+	}
+	tempstraa=(datas.length!=0)?sec2minsec(get2(tmp1/datas.length)):"";
+
+	spanAv.innerHTML="<b>"+tempstraa+"</b>";
+
+}
+
+function sec2minsec(n)// convert the seconds number in to **:**.** text format
+{       if (n>60)
+        {
+        var tmpmins=Math.floor(n/60);
+		var	tmpseconds=get2(n-tmpmins*60);
+		var tmpstring;
+		if (tmpseconds<10)
+		{  tmpstring=tmpmins+":0"+tmpseconds;
+		}
+	   else  tmpstring=tmpmins+":"+tmpseconds;
+	 return tmpstring;
+	 }
+	 else return n;
+}
+function ShowDetails() //display the record table
+{
+if(datas.length>12){a=datas.length -12;}
+var tmpTd="<table cellspacing=1 bgcolor=olive><tr align=center bgcolor='#EEEEEE'><td width=50>1</td><td width=50>2</td><td width=50>3</td><td width=50>4</td><td width=50>5</td>";
+	tmpTd+="<td width=50>6</td><td width=50>7</td><td width=50>8</td><td width=50>9</td><td width=50>10</td><td width=50>11</td><td width=50>12</td></tr><tr bgcolor=white>";
+	for(i=a;i<(12+a);i++)
+	{
+
+		tmpTd+="<td align=center>";
+		if(datas[i]==undefined){tmpTd+="-";}
+		else
+		{
+			if(datas[i]==nowBest)
+			{
+
+				tmpTd+="<font color=red><b>"+sec2minsec(datas[i])+"*</b></font>";
+			}
+			else if (datas[i]==nowWorst)
+			{
+			tmpTd+="<font color=green>"+sec2minsec(datas[i])+"*</font>";
+
+			}
+			else
+			{
+			  tmpTd+=sec2minsec(datas[i]);
+			}
+		}
+		tmpTd+="</td>";
+	}
+	tmpTd+="</tr></table>";
+	//alert(datas.join(","));
+	div1.innerHTML="";
+	div1.innerHTML=tmpTd;
+	rndCube();
+
+}
+function show() //show the stopwatch display, will run every 20 or 10 ms
+{	var now=new Date();
+	diff=now.getTime()-then.getTime();
+	if (diff<1000)
+	{ mindis="00";
+	  secdis="00";
+	  subsec=Math.floor(diff/10);
+	    if (subsec<10)
+	   	subsecdis="0"+subsec;
+		else
+		subsecdis=subsec;
+     }
+     else if (diff<60000)
+     {
+     mindis="00";
+     sec=Math.floor(diff/1000);
+        if(sec<10)
+	 	secdis="0"+sec;
+		else
+		secdis=sec;
+
+	 	subsec=Math.floor((diff%1000)/10);
+	    if (subsec<10)
+	   	subsecdis="0"+subsec;
+		else
+		subsecdis=subsec;
+     }
+	 else
+	 {
+	 totalsec=Math.floor(diff/1000);//how many seconds?
+	 sec=totalsec%60; //how many seconds-60*n
+	   if(sec<10)
+	 	secdis="0"+sec;
+		else
+		secdis=sec;
+
+	   min=(totalsec-sec)/60; //how many minutes?
+	   if (min<10)
+		mindis="0"+min;
+	    else
+		mindis=min;
+
+	   subsec=Math.floor((diff%1000)/10);
+	    if (subsec<10)
+	   	subsecdis="0"+subsec;
+		else
+		subsecdis=subsec;
+
+	 }
+
+	 nowSeconds=mindis+":"+secdis+"."+subsecdis;
+	document.getElementById("watch").innerHTML=nowSeconds;
+	timeint=setTimeout("show()",myinterval)
+
+}
+
+
+function get2(dec) //取两位小数点
+{
+	return Math.round(dec*100)/100;
+}
+
+function SortDatas()//get max and min
+{
+	var tmpArr=new Array();
+	for(i=0;i<datas.length;i++)
+	{
+		tmpArr[i]=datas[i];
+	}
+	tmpArr.sort(function(a,b){ return a-b;});
+	nowBest=tmpArr[0];
+	nowWorst=tmpArr[tmpArr.length-1];
+	// ShowBestAv();
+}
+
+function mycls()// clear all records
+{
+	clearTimeout(timeint);
+	nowSeconds="00:00:00";
+	running=0;
+	datas=new Array();
+	ShowDetails();
+	document.getElementById("watch").innerHTML="00:00.00";
+
+}
+
+</script>
+<script type="text/javascript">
+function cancel()
+{   clearTimeout(timeint);
+
+	nowSeconds="00:00:00";
+
+	running=0;
+	rndCube();
+	document.getElementById("watch").innerHTML="00:00.00";
+	//	alert("请点击一下网页上的任意空白处,让焦点从这个<不记录此次成绩>按钮上移开,即可开始新的一次计时。");
+
+}
+function delrecord()
+{
+    clearTimeout(timeint);
+
+	nowSeconds="00:00:00";
+	running=0;
+	rndCube();
+	document.getElementById("watch").innerHTML="00:00.00";
+	datas.pop();
+	ShowDatas(-1);
+}
+function isslice(move1,move2)//to judge if 2 moves are slice moves.
+{if (Math.floor(move1/2)==Math.floor(move2/2)) return true;
+else return false;
+}
+function checkmove(move)
+{
+if (move==arr[arr.length-1]) return true;
+   else if (move==arr[arr.length-2] && isslice(move,arr[arr.length-1])) return true;
+   else return false;
+}
+
+
+function rndCube()
+{
+	var move="";
+	var rndMove=new Array("R","L","F","B","U","D");
+	var add=0;
+	var tmpRnd;
+    arr=new Array();
+	for (i=0;i<Max;i++)
+	{	do {
+		tmpRnd=Math.floor(Math.random()*6);
+        }
+        while (checkmove(tmpRnd))
+
+        arr.push(tmpRnd);
+
+	}
+		for(i=0;i<arr.length;i++)
+		{
+			var tmp=Math.floor(Math.random()*5);
+			if(tmp==4)
+			{	move+=rndMove[arr[i]]+"2";}
+			else if(tmp==2 || tmp==3)
+			{	move+=rndMove[arr[i]]+"'";}
+            else
+            {	move+=rndMove[arr[i]];}
+			move+=" ";
+		}
+
+
+		rndDiv.innerHTML=move;
+}
+function exportrecord()
+{
+clearTimeout(timeint);
+
+nowSeconds="00:00:00";
+
+running=0;
+rndCube();
+document.getElementById("watch").innerHTML="00:00.00";
+if (datas.length<1)
+{alert("目前没有记录");
+return false;
+}
+var temprec=datas.toString();
+window.open("stopwatchsave.php?str="+temprec,"_self");
+
+}
+////////////////weakdancer
+function exportrecord2gae()
+{
+clearTimeout(timeint);
+
+nowSeconds="00:00:00";
+
+running=0;
+rndCube();
+document.getElementById("watch").innerHTML="00:00.00";
+if (datas.length<1)
+{alert("目前没有记录");
+return false;
+}
+var temprec=datas.toString();
+window.open("../admin/add/"+temprec,"_self");
+
+}
+//////////////weakdancer
+function changebg(p)
+{
+for (i=1; i<4; i++)
+{
+document.getElementById("big"+i).style.color='blue';
+document.getElementById("big"+i).style.textDecoration='underline';
+document.getElementById("big"+i).style.backgroundColor='transparent';
+}
+document.getElementById("big"+p).style.color='black';
+document.getElementById("big"+p).style.textDecoration='none';
+document.getElementById("big"+p).style.backgroundColor='#FFCCFF';
+}
+
+function buttonstuff(p)
+{
+	document.getElementById(p).blur();
+	document.getElementById('watch').focus();
+}
+
+</script>
+<center>
+
+
+<input type="button" class="btn3" style="height=20px;width=50px;" value="开始/停止/复位" id="exportrec" onclick="spacebar();buttonstuff(&#39;exportrecord1&#39;);" >
+<div id="watch" style="font-size:130px; font-family:Arial; font-weight:bold; color:navy; text-align:center">00:00.00</div>
+<div id="mytext">
+<div class="text">
+用<font color="#000080"><b>空格</b></font>键<b>开始</b>(松开时触发)、<b>停止</b>(按下时触发)、<b>复位</b>(同时记录成绩),enjoy:)<a href="http://www.rubik.com.cn/stopwatch.htm#" onclick="document.getElementById(&#39;mytext&#39;).style.display=&#39;none&#39;;this.blur();document.getElementById(&#39;watch&#39;).focus();return false;">隐藏说明文字</a>
 </div>
+<div class="text">注意:某些时候,如刚打开此页后,<font color="#FF0066">如空格键不起作用,请先用鼠标点一下本页任意空白处</font>,即可开始。<span style="display:none;"><script src="static//index_files/stat.php" language="JavaScript"></script><a href="http://www.cnzz.com/stat/website.php?web_id=351509" target="_blank" title="站长统计">站长统计</a><img src="static//index_files/stat.htm" border="0" width="0" height="0"></span></div>
+<div class="text">请先最大化窗口或拉伸窗口使右边的滚动条不出现,否则空格键会让窗口滚动。</div></div>
+<div id="rndDiv" style="margin-top:20px;font:12pt Arial;font-weight:bold">U L R B' U L B2 U2 B' U B R F R' F B2 U' R' F R' F' D B' F2 L' </div>
+<div id="buttons">
 
+<input type="button" class="btn1" value="DNF&amp;POP 不记录此次成绩" id="notrecord1" onclick="cancel();buttonstuff(&#39;notrecord1&#39;);" title="DNF=Do Not Finish,POP=飞棱.若成绩已记入表格.请用右边清除上次成绩按钮。">
+<input type="button" class="btn" value="清除上次成绩" id="delrecord1" onclick="delrecord();buttonstuff(&#39;delrecord1&#39;);">
+<input type="button" class="btn" value="清除所有记录" id="clear1" onclick="mycls();buttonstuff(&#39;clear1&#39;)">
+<input type="button" class="btn2" value="导出成绩到GAE" id="exportrecord1" onclick=" exportrecord2gae();buttonstuff(&#39;exportrecord1&#39;);">
 
+<span style="display: inline;">秒表尺寸:
+<a href="http://www.rubik.com.cn/stopwatch.htm#" onclick="changebg(1);document.getElementById(&#39;watch&#39;).style.fontSize=200+&#39;px&#39;;this.blur();document.getElementById(&#39;watch&#39;).focus();return false;" id="big1">大</a>,
+<a href="http://www.rubik.com.cn/stopwatch.htm#" onclick="changebg(2);document.getElementById(&#39;watch&#39;).style.fontSize=130+&#39;px&#39;;this.blur();document.getElementById(&#39;watch&#39;).focus();return false;" id="big2" style="color: black; text-decoration: none; background-color: rgb(255, 204, 255); ">中</a>,
+<a href="http://www.rubik.com.cn/stopwatch.htm#" onclick="changebg(3);document.getElementById(&#39;watch&#39;).style.fontSize=70+&#39;px&#39;;this.blur();document.getElementById(&#39;watch&#39;).focus();return false;" id="big3">
+小</a></span></div>
+<div id="div1">
+<table cellspacing="1" bgcolor="olive">
+<tbody><tr bgcolor="#EEEEEE" align="center">
+	<td width="50">1</td>
+	<td width="50">2</td>
+	<td width="50">3</td>
+	<td width="50">4</td>
+	<td width="50">5</td>
+	<td width="50">6</td>
+	<td width="50">7</td>
+	<td width="50">8</td>
+	<td width="50">9</td>
+	<td width="50">10</td>
+	<td width="50">11</td>
+	<td width="50">12</td>
+</tr>
+<tr bgcolor="white" align="center">
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+	<td width="50">-</td>
+</tr>
+</tbody></table></div>
+<div>
+<table border="0">
+<tbody><tr><td class="text1">最快:</td><td><span id="spanBest" class="text2"></span></td></tr>
+<tr><td class="text1">最慢:</td><td><span id="spanWorst" class="text2"></span></td></tr>
+<tr><td class="text1">平均:</td><td><span id="spanAv" class="text2"></span></td></tr>
+</tbody></table></div>
 
-{% include 'footer.html' %}
+</center>
+<div id="watch1" style="margin-top:10px; "><a href="http://www.rubik.com.cn/" style="display:block;text-align:center;" title="魔方小站-实现你童年的小小梦想-魔方的玩法-视频+图解+3D动画"><img src="static/index_files/logo1.gif" width="337" height="59" border="0"></a></div>
+<script type="text/javascript">
+document.getElementById("watch").focus();
+document.getElementById("big2").style.color='black';
+document.getElementById("big2").style.textDecoration='none';
+document.getElementById("big2").style.backgroundColor='#FFCCFF';
+</script>
+
+
+
+<center>
+
+{% include 'footer.html' %}</center>
 </body>
 
 </html>