Skip to content

Instantly share code, notes, and snippets.

@rve
Created February 25, 2013 05:11
Show Gist options
  • Save rve/5027890 to your computer and use it in GitHub Desktop.
Save rve/5027890 to your computer and use it in GitHub Desktop.
class schedule
<html version="g42dymwpi--nx"><script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生课表</title>
<style>
#subprinttable1{
border: 1px solid #d3dffa;
border-collapse: collapse;
font-size:12px;
}
#subprinttable1 .tab_3{
background-color:#f0f7ff;
}
#subprinttable1 tr {
border: 1px solid;
}
#subprinttable1 td {
border: 1px solid #d3dffa;
text-align:center;
}
#subprinttable1 td.tab_3 {
background-color:#eaeffd;
}
#subprinttable1 td.tab_1 {
background-color:#b9cbfa;
font: 宋体;
}
#subprinttable1 tr.tab_3 {
font-weight:bold;
background-color:#eaeffd;
}
</style>
<script type="text/javascript">
//节此信息
var jcNum = 15;
var jcshowdata=["","第一节<br>08:00-08:45","第二节<br>08:55-09:40","第三节<br>09:50-10:35","第四节<br>10:45-11:30","第五节<br>11:40-12:25","第六节<br>12:35-13:20","第七节<br>13:30-14:15","第八节<br>14:25-15:10","第九节<br>15:20-16:05","第十节<br>16:15-17:00","第十一节<br>17:10-17:55","第十二节<br>18:05-18:50","第十三节<br>19:00-19:45","第十四节<br>19:55-20:40","第十五节<br>20:50-21:35"];
var jcs= new Array();
jcs[0] = "";
for(var i = 1; i <= jcNum; i++){
jcs[i] = i+"";
}
function findjcpos(v){
if(v){
var tempV='';
if(v.length>0 && v.indexOf('-')!=-1)
tempV=v.substring(0,v.indexOf('-'));
else
tempV=v.substring(0,v.length-1); // 格式为: X节
for(var i=0;i<jcs.length;i++){
if(jcs[i].indexOf(tempV)!=-1){
return i;
}
}
}
}
//星期信息
var weeks=["","星期一","星期二","星期三","星期四","星期五","星期六","星期日"];
function findweekpos(v){
for(var i=0;i<weeks.length;i++){
if(v==weeks[i]){
return i;
}
}
}
//获得节次之间的间隔,例如1-2节间隔是2
function getJcNumBetweenMinAndMax(jc){
var min;
var max;
var tempJc = jc.substring(0,jc.indexOf('节'));
var index = tempJc.indexOf('-');
if(index == -1){
min = max = tempJc;
}else{
min = tempJc.substring(0,index);
max = tempJc.substring(index + 1);
}
return parseInt(max) - parseInt(min) + 1;
}
var tableblankcontent='';
for(var i=1;i<=jcNum;i++){
tableblankcontent+='<tr class="tab_5">';
tableblankcontent+='<td align="right" class="tab_3">'+jcshowdata[i]+'</td>';
for(var j=1;j<=7;j++){
tableblankcontent+='<td align="center">&nbsp;</td>';
}
tableblankcontent+='</tr>';
}
var tablecontent = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
for(var i=0;i<tablecontent.length;i++){
var subtablecontent=tablecontent[i];
for(var j=0;j<subtablecontent.length;j++){
subtablecontent[j]='';
}
}
var dataArray = new Array();
for(var i= 0; i<= jcNum; i++){
var tempArray = new Array();
for(var j = 0; j <= 7; j++){
tempArray[j]= 1;
}
dataArray[i] = tempArray;
}
// 处理表格布局,因为节次原先只能显示在一个单元格内,像1-2,3-4节这样的就需要跨行显示了
function processTableStyle(){
var listtable = document.getElementById('subprinttable1');
for(var j = 1; j <= 7; j++){
for(var i= 1; i<= jcNum; i++){
if(dataArray[i][j] > 1){
var tempTr = listtable.getElementsByTagName('tr')[i];
//可能前面有的单元格已经被合并过了,所以计算索引时要去掉已经合并过的单元格
var tdIndex = j - getColumnIndex(i,j);
var tempTd = tempTr.getElementsByTagName('td')[tdIndex];
tempTd.rowSpan = dataArray[i][j];
tempTd.className="tab_1";
var rowNum = parseInt(dataArray[i][j]);
while(rowNum > 1){
rowNum--;
var node = listtable.getElementsByTagName('tr')[i+rowNum];
node.removeChild(node.getElementsByTagName('td')[j-getColumnIndex(i+rowNum,j)]);
}
}
}
}
}
//判断单元格(x,y)前面有没有合并的单元格(横坐标的范围必须包含x,并且纵坐标必须在y的前面)
function getColumnIndex(x,y){
var result = 0;
for(var i= 1; i<= jcNum; i++){
for(var j = 1; j < y; j++){
if(dataArray[i][j] > 1){
if(dataArray[i][j]+i > x && x>i){
result += 1;
}
}
}
}
return result;
}
function gettablecontent(){
var kcmc,dd,zfw,dsz,innercontent,jc,jcpos,week,weekpos;
var tablecontents = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
var havedata;
var returncontent='';
for(var i=1;i<=jcNum;i++){
havedata=0;
tablecontents[i][0]='<tr class="tab_5">';
tablecontents[i][0]+='<td height="30" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
for(var j=1;j<=7;j++){
tablecontents[i][j]='<td align=center width=\"13%\">&nbsp;</td>';
}
tablecontents[i][8]='</tr>';
//alert();
//以下代码由java生成
jc='3-6节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='毛泽东思想和中国特色社会主义理论体系概论';
dd='东B104';
zfw='1-18';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=4;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='3-5节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='操作系统原理';
dd='东A201';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=3;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='10-11节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='操作系统原理实验';
dd='实验中心B401';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=4;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='10-11节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='计算机网络实验';
dd='实验中心B402';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=2;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='4-5节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='算法设计与应用';
dd='东A202';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=1;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='8-9节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='图论及其算法';
dd='东C203';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=1;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='10-11节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='体育';
dd=' ';
zfw='1-18';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=3;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='3-5节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='计算机网络';
dd='东A105';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=2;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='3-5节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='大学物理(2)';
dd='东A105';
zfw='1-17';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=5;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='7-9节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='经济学与生活(通识课)';
dd='东E101';
zfw='2-13';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=3;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
jc='12-14节'
jcpos=findjcpos(jc);
if(jcpos==i){
havedata=1;
kcmc='宏观经济学原理(通识课)';
dd='东B203';
zfw='2-12';
dsz='01';
if(dsz=='01'){
dsz ='';
}else if(dsz=='02'){
dsz='(单周)';
}else if(dsz=='03'){
dsz='(双周)';
}else{
dsz='';
};
innercontent='';innercontent+=kcmc+'<br>';
if(dd != ''){innercontent+=dd+'<br>'};
if(jc != ''){innercontent+=jc+'<br>'};
if(zfw!='' && zfw!='-'){innercontent+=zfw+'周'};
if(dsz!=''){innercontent+=''+dsz+''};
weekpos=1;
dataArray[i][weekpos] = getJcNumBetweenMinAndMax(jc);
tablecontent[i][0]='<tr>';
tablecontent[i][0]+='<td height=30 align=right class="tab_3">'+jcshowdata[i]+'</td>';
if(tablecontent[i][weekpos]){
var tempvalue=tablecontent[i][weekpos];
if(tempvalue!='<td align="center" width="13%">&nbsp;</td>'){
if(tempvalue.indexOf('>')!=-1){
var beforetempvalue=tempvalue.substring(0,tempvalue.indexOf('>')+1);
var betweentempvalue=tempvalue.substring(tempvalue.indexOf('>')+1,tempvalue.indexOf('</td>'));
beforetempvalue+=''+betweentempvalue+'<br>'+innercontent+'</td>';
tablecontent[i][weekpos]=beforetempvalue;
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
tablecontent[i][weekpos]='<td align=center width="13%">'+innercontent+'&nbsp;</td>';
}
}else{
for(var j=1;j<=7;j++){
tablecontent[i][j]='';
if(weekpos!=j){
tablecontent[i][j]='<td>&nbsp;</td>';
}else{
tablecontent[i][j]='<td >'+innercontent+'&nbsp;</td>';
}
}
}tablecontent[i][8]='</tr>';
}
if(havedata==0)
tablecontent[i]=tablecontents[i];
}
for(var i=0;i<tablecontent.length;i++){
var subtablecontent=tablecontent[i];
for(var j=0;j<subtablecontent.length;j++){
/*
if(j==0){
if(i==1){
subtablecontent[j]='<tr class="tab_5">'+'<td height="50" align="right" class="tab_3" rowspan="2">上午</td>'+'<td height="50" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==3){
subtablecontent[j]='<tr class="tab_5">'+'<td height="50" align="right" class="tab_3">中午</td>'+'<td height="50" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==4){
subtablecontent[j]='<tr class="tab_5">'+'<td height="50" align="right" class="tab_3" rowspan="2">下午</td>'+'<td height="50" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==6){
subtablecontent[j]='<tr class="tab_5">'+'<td height="50" align="right" class="tab_3">晚上</td>'+'<td height="50" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}
}*/
if(j==0){
if(i==1){
subtablecontent[j]='<tr class="tab_5">'+'<td height="30" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==3){
subtablecontent[j]='<tr class="tab_5">'+'<td height="30" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==4){
subtablecontent[j]='<tr class="tab_5">'+'<td height="30" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}else if(i==6){
subtablecontent[j]='<tr class="tab_5">'+'<td height="30" align="right" class="tab_3">'+jcshowdata[i]+'</td>';
}
}
returncontent+=subtablecontent[j];
}
}
return returncontent;
}
</script>
<style>@-moz-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@-webkit-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@-o-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}embed,object{animation-duration:.001s;-ms-animation-duration:.001s;-moz-animation-duration:.001s;-webkit-animation-duration:.001s;-o-animation-duration:.001s;animation-name:nodeInserted;-ms-animation-name:nodeInserted;-moz-animation-name:nodeInserted;-webkit-animation-name:nodeInserted;-o-animation-name:nodeInserted;}</style><style type="text/css">#yddContainer{display:block;font-family:Microsoft YaHei;position:relative;width:100%;height:100%;top:-4px;left:-4px;font-size:12px;border:1px solid}#yddTop{display:block;height:22px}#yddTopBorderlr{display:block;position:static;height:17px;padding:2px 28px;line-height:17px;font-size:12px;color:#5079bb;font-weight:bold;border-style:none solid;border-width:1px}#yddTopBorderlr .ydd-sp{position:absolute;top:2px;height:0;overflow:hidden}.ydd-icon{left:5px;width:17px;padding:0px 0px 0px 0px;padding-top:17px;background-position:-16px -44px}.ydd-close{right:5px;width:16px;padding-top:16px;background-position:left -44px}#yddKeyTitle{float:left;text-decoration:none}#yddMiddle{display:block;margin-bottom:10px}.ydd-tabs{display:block;margin:5px 0;padding:0 5px;height:18px;border-bottom:1px solid}.ydd-tab{display:block;float:left;height:18px;margin:0 5px -1px 0;padding:0 4px;line-height:18px;border:1px solid;border-bottom:none}.ydd-trans-container{display:block;line-height:160%}.ydd-trans-container a{text-decoration:none;}#yddBottom{position:absolute;bottom:0;left:0;width:100%;height:22px;line-height:22px;overflow:hidden;background-position:left -22px}.ydd-padding010{padding:0 10px}#yddWrapper{color:#252525;z-index:10001;background:url(chrome-extension://eopjamdnofihpioajgfdikhhbobonhbb/ab20.png);}#yddContainer{background:#fff;border-color:#4b7598}#yddTopBorderlr{border-color:#f0f8fc}#yddWrapper .ydd-sp{background-image:url(chrome-extension://eopjamdnofihpioajgfdikhhbobonhbb/ydd-sprite.png)}#yddWrapper a,#yddWrapper a:hover,#yddWrapper a:visited{color:#50799b}#yddWrapper .ydd-tabs{color:#959595}.ydd-tabs,.ydd-tab{background:#fff;border-color:#d5e7f3}#yddBottom{color:#363636}#yddWrapper{min-width:250px;max-width:400px;}</style></head>
<body class="unieap" style="position: static;">
<table width="100%" id="subprinttable1">
<tbody><tr class="tab_3">
<td height="25" width="200">&nbsp;</td>
<td height="25" align="center" class="article_subhead">星期一</td>
<td height="25" align="center" class="article_subhead">星期二</td>
<td height="25" align="center" class="article_subhead">星期三</td>
<td height="25" align="center" class="article_subhead">星期四</td>
<td height="25" align="center" class="article_subhead">星期五</td>
<td height="25" align="center" class="article_subhead">星期六</td>
<td height="25" align="center" class="article_subhead">星期日</td>
</tr>
<script>
var writecontent=gettablecontent();
document.write(writecontent);
processTableStyle();
</script><tr class="tab_5"><td height="30" align="right" class="tab_3">第一节<br>08:00-08:45</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第二节<br>08:55-09:40</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第三节<br>09:50-10:35</td><td>&nbsp;</td><td rowspan="3" class="tab_1">&nbsp;<br>计算机网络<br>东A105<br>3-5节<br>1-17周</td><td rowspan="3" class="tab_1">&nbsp;<br>操作系统原理<br>东A201<br>3-5节<br>1-17周</td><td rowspan="4" class="tab_1">毛泽东思想和中国特色社会主义理论体系概论<br>东B104<br>3-6节<br>1-18周&nbsp;</td><td rowspan="3" class="tab_1">&nbsp;<br>大学物理(2)<br>东A105<br>3-5节<br>1-17周</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第四节<br>10:45-11:30</td><td rowspan="2" class="tab_1">算法设计与应用<br>东A202<br>4-5节<br>1-17周&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第五节<br>11:40-12:25</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第六节<br>12:35-13:20</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr><td height="30" align="right" class="tab_3">第七节<br>13:30-14:15</td><td>&nbsp;</td><td>&nbsp;</td><td rowspan="3" class="tab_1">经济学与生活(通识课)<br>东E101<br>7-9节<br>2-13周&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td height="30" align="right" class="tab_3">第八节<br>14:25-15:10</td><td rowspan="2" class="tab_1">图论及其算法<br>东C203<br>8-9节<br>1-17周&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第九节<br>15:20-16:05</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr><td height="30" align="right" class="tab_3">第十节<br>16:15-17:00</td><td>&nbsp;</td><td rowspan="2" class="tab_1">&nbsp;<br>计算机网络实验<br>实验中心B402<br>10-11节<br>1-17周</td><td rowspan="2" class="tab_1">&nbsp;<br>体育<br> <br>10-11节<br>1-18周</td><td rowspan="2" class="tab_1">操作系统原理实验<br>实验中心B401<br>10-11节<br>1-17周&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第十一节<br>17:10-17:55</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr><td height="30" align="right" class="tab_3">第十二节<br>18:05-18:50</td><td rowspan="3" class="tab_1">宏观经济学原理(通识课)<br>东B203<br>12-14节<br>2-12周&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第十三节<br>19:00-19:45</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第十四节<br>19:55-20:40</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr><tr class="tab_5"><td height="30" align="right" class="tab_3">第十五节<br>20:50-21:35</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td><td align="center" width="13%">&nbsp;</td></tr>
</tbody></table>
<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"></object>
<div id="sbi_camera_button" class="sbi_search" style="left: 0px; top: 0px; position: absolute; width: 29px; height: 27px; border: none; margin: 0px; padding: 0px; z-index: 2147483647; display: none;"></div><script>(function main() {
var CONSTANTS = {
PLAYER_DOM: 'object[data],embed[src],iframe[src]',
PLAYERS: [
{
find: /http:\/\/static\.youku\.com\/.*q?(player|loader)(_taobao)?\.swf/,
replace: 'http://player.opengg.me/loader.swf'
},
{
find: /http:\/\/js\.tudouui\.com\/.*\/TudouVideoPlayer_Homer_.*.swf/,
replace: 'http://player.opengg.me/TudouVideoPlayer_Homer_237.swf'
},
{
find: /http:\/\/player\.youku\.com\/player\.php\//,
replace: 'http://player.opengg.me/player.php/'
},
{
find: /http:\/\/www.tudou.com\/(([a-z]|programs)\/.*)/,
replace: 'http://player.opengg.me/td.php/$1'
}
],
SHARE_DOM: '#panel_share input,input#copyInput.txt',
SHARES: [
{
find: /http:\/\/player\.youku\.com\/player\.php\//,
replace: 'http://player.opengg.me/player.php/'
},
{
find: /http:\/\/www.tudou.com\/(.*v\.swf)/,
replace: 'http://player.opengg.me/td.php/$1'
}
],
NODEINSERTED_HACK: '@-moz-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@-webkit-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@-o-keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}@keyframes nodeInserted{from{opacity:0;}to{opacity:1;}}embed,object{animation-duration:.001s;-ms-animation-duration:.001s;-moz-animation-duration:.001s;-webkit-animation-duration:.001s;-o-animation-duration:.001s;animation-name:nodeInserted;-ms-animation-name:nodeInserted;-moz-animation-name:nodeInserted;-webkit-animation-name:nodeInserted;-o-animation-name:nodeInserted;}',
TOGGLE_BTN: '#toggleGoogle'
};
var DONE = [];
var UTIL = {
addCss: function (str) {
var style = document.createElement('style');
style.textContent = str;
document.head.appendChild(style);
},
reloadFlash: function (elem) {
var nextSibling = elem.nextSibling;
var parentNode = elem.parentNode;
parentNode.removeChild(elem);
if (nextSibling) {
parentNode.insertBefore(elem, nextSibling);
} else {
parentNode.appendChild(elem);
}
},
initFlash: function (elem) {
// console.log(elem);
if (DONE.indexOf(elem) !== -1) {
return;
}
if (this.rewriteFlash(elem)) {
this.reloadFlash(elem);
DONE.push(elem);
}
},
rewriteFlash: function (elem) {
var atrs = ['data', 'src'];
var players = CONSTANTS.PLAYERS;
var needReload = false;
UTIL.forEach(atrs, function (atr) {
UTIL.forEach(players, function (player) {
if (elem[atr] && player.find.test(elem[atr])) {
elem[atr] = elem[atr].replace(player.find, player.replace);
needReload = true;
}
});
});
return needReload;
},
forEach: function (arr, callback) {
if (this.isArrayLike(arr)) {
if (Array.prototype.forEach) {
Array.prototype.forEach.call(arr, callback);
} else {
var i = 0;
for (i = 0; i < arr.length; ++i) {
callback.call(arr[i], arr[i]);
}
}
}
},
isArrayLike: function (obj) {
if (typeof obj !== 'object') {
return false;
}
var types = ['Array', 'NodeList', 'HTMLCollection'];
var i = 0;
for (i = 0; i < types.length; ++i) {
if (Object.prototype.toString.call(obj).indexOf(types[i]) !== -1) {
return true;
}
}
return false;
}
};
function init() {
function onDOMNodeInsertedHandler(e) {
var target = e.target;
if (target.nodeType === 1 && /OBJECT|EMBED|IFRAME/ig.test(target.nodeName)) {
UTIL.initFlash(target);
}
}
function onAnimationStartHandler(e) {
if (e.animationName === 'nodeInserted') {
var target = e.target;
// console.log(target);
if (target.nodeType === 1 && /OBJECT|EMBED|IFRAME/ig.test(target.nodeName)) {
UTIL.initFlash(target);
}
}
}
UTIL.addCss(CONSTANTS.NODEINSERTED_HACK);
/*Firefox*/
document.body.addEventListener('animationstart', onAnimationStartHandler, false);
/*/Firefox*/
/*Chrome*/
document.body.addEventListener('webkitAnimationEnd', onAnimationStartHandler, false);
/*/Chrome*/
/*Opera 12+*/
document.body.addEventListener('oAnimationStart', onAnimationStartHandler, false);
/*/Opera 12+*/
/*IE, but I never tested this*/
document.body.addEventListener('msAnimationStart', onAnimationStartHandler, false);
/*/IE, but I never tested this*/
if (/Opera/.test(navigator.userAgent) && !(/Version\/12/.test(navigator.userAgent))) {
/*Old fashion, slower maybe*/
document.body.addEventListener('DOMNodeInserted', onDOMNodeInsertedHandler, false);
var matches = document.body.querySelectorAll(CONSTANTS.PLAYER_DOM);
UTIL.forEach(matches, function (elem) {
UTIL.initFlash(elem);
});
}
}
function tips() {
s=document.getElementById('ab_pip');
s.innerHTML = "";
}
function share(elem) {
var pairs = CONSTANTS.SHARES;
UTIL.forEach(pairs, function (item) {
elem.value = elem.value.replace(item.find, item.replace);
});
}
var CONTROLLER = [
{
host: '.',
fn: function () {
init();
}
},
{
host: 'youku.com',
fn: function () {
// UTIL.addCss(CONSTANTS.STYLE);
tips();
var matches = document.body.querySelectorAll(CONSTANTS.SHARE_DOM);
UTIL.forEach(matches, share);
var youkuPlayer = document.body.querySelector('.playBox');
var notWide = !document.body.querySelector('.playBox_thx');
if (youkuPlayer && notWide) {
youkuPlayer.className += ' playBox_thx';
}
}
},
{
host: 'tudou.com',
fn: function () {
// UTIL.addCss(CONSTANTS.STYLE);
//tips();
var tudouPlayer = document.body.querySelector('#playerObject');
var normalDom = document.querySelector('.normal');
if (tudouPlayer && normalDom) {
normalDom.className = normalDom.className.replace('normal','widescreen');
}
var g = (typeof unsafeWindow !== 'undefined') ? unsafeWindow : window;
var TUI_copyToClip = g.TUI.copyToClip;
g.TUI.copyToClip = function () {
var matches = document.body.querySelectorAll(CONSTANTS.SHARE_DOM);
UTIL.forEach(matches, share);
TUI_copyToClip.apply(g.TUI, arguments);
};
}
}
];
var host = location.host;
function PROC(item) {
if (host.indexOf(item.host) !== -1) {
item.fn();
return;
}
}
UTIL.forEach(CONTROLLER, PROC);
})();</script></body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment