Created
May 22, 2017 10:40
-
-
Save maizhibin/fdf2776093070855bff8fb183a90766d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name scezju for chrome | |
// @namespace http://ycjy.scezju.com/ | |
// @version 0.1 | |
// @description IE go away! | |
// @author mzb | |
// @domain ycjy.scezju.com | |
// @match http://ycjy.scezju.com/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== | |
$(document).ready(function() { | |
//'use strict'; | |
$("#mainFrame").height(500); | |
$("#mainFrame").unbind("load"); | |
// Your code here... | |
function init(){ | |
//console.log($("#a_6")); | |
$("a:contains('平时作业')").click(); //("click"); | |
//document.getElementById("a_1").click(); | |
var isDcOrNot = $("#isDcOrNot").val(); //document.getElementById('isDcOrNot').value; | |
var xsjbxxb_id = $("#xsjbxxb_id").val(); //document.getElementById('xsjbxxb_id').value; | |
//if(isDcOrNot == 'true' && xsjbxxb_id !== null && xsjbxxb_id !== '') | |
//{ | |
// openWindows('kcIndexXsdc.action?kcdmb_id='+235+'&xsjbxxb_id='+xsjbxxb_id,'650','400'); | |
//} | |
} | |
function newtest(str){ | |
var kcdmb_id = $("#tempKcdmb_id").val(); //document.getElementById('tempKcdmb_id').value; | |
var jpkcurl = $("#jpkcurl").val(); //document.getElementById('jpkcurl').value; | |
var sfyyjp = $("#sfyyjp").val(); //document.getElementById('sfyyjp').value; | |
if(str==14){ | |
window.open('kcbjIndex.action?kcdmb_id=235&sid=','_blank','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbar=yes,resizable=no,copyhistory=yes,width=600px,height=635px,left=300px, top=30px,screenX=200px,screenY=200px'); | |
}else if(str==9){ | |
window.open('kcltindex.action?kcdmb_id=235&sid=','_blank',''); | |
}else if(str==18){ | |
window.open('../other/jsbkIndex.action?kcdmb_id=235&sid=','_blank',''); | |
}else if(str==3 && jpkcurl!=="" && sfyyjp==4){ | |
window.open(jpkcurl,'_blank',''); | |
}else{ | |
var id = "a_" + str; | |
document.getElementById(id).click(); | |
} | |
document.getElementById('a_'+str).className='leftbtn_over'; | |
//if(over!==''&&over!==('a_'+str)){ | |
// document.getElementById(over).className=''; | |
//} | |
//over='a_'+str; | |
} | |
function dyniframesize(iframename) { | |
//console.log($("#mainFrame")); | |
var pTar = document.getElementById(iframename); | |
var mastheadHeight=$("#div_kcindex").height(); //document.getElementById("div_kcindex").clientHeight; | |
var footerHeight=$("#footer").height(); //document.getElementById("footer").clientHeight; | |
var ptDivElement=document.getElementById("ptMain"); | |
if (pTar && !window.opera){ | |
// ptDivElement.style.height=document.documentElement.clientHeight-mastheadHeight-footerHeight; | |
// pTar.height= ptDivElement.clientHeight; | |
} | |
} | |
dyniframesize('mainFrame'); | |
$("a:contains('课程首页')").unbind("click"); | |
$("a:contains('课程首页')").on('click', function() { | |
newtest('1'); | |
//event.stopPropagation(); | |
}); | |
dyniframesize('mainFrame'); | |
$("a:contains('课程导学')").unbind("click"); | |
$("a:contains('课程导学')").on('click', function() { | |
newtest('2'); | |
//event.stopPropagation(); | |
}); | |
dyniframesize('mainFrame'); | |
$("a:contains('教学内容')").unbind("click"); | |
$("a:contains('教学内容')").on('click', function() { | |
newtest('3'); | |
//event.stopPropagation(); | |
}); | |
dyniframesize('mainFrame'); | |
$("a:contains('参考资源')").unbind("click"); | |
$("a:contains('参考资源')").on('click', function() { | |
newtest('5'); | |
//event.stopPropagation(); | |
}); | |
$("a:contains('平时作业')").unbind("click"); | |
$("a:contains('平时作业')").on('click', function() { | |
newtest('6'); | |
//event.stopPropagation(); | |
}); | |
$("a:contains('自我测试')").unbind("click"); | |
$("a:contains('自我测试')").on('click', function() { | |
newtest('7'); | |
//event.stopPropagation(); | |
}); | |
$("a:contains('练习及模拟试卷')").unbind("click"); | |
$("a:contains('练习及模拟试卷')").on('click', function() { | |
newtest('8'); | |
//event.stopPropagation(); | |
}); | |
init(); | |
//console.log("OK"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment