Repository: yadtang/Check Branch: master Commit: 3300d8bc18a2 Files: 692 Total size: 32.4 MB Directory structure: gitextract_z89967oo/ └── Check Maven Webapp/ ├── .classpath ├── .project ├── .settings/ │ ├── .jsdtscope │ ├── com.genuitec.eclipse.core.prefs │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.ltk.core.refactoring.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ └── org.eclipse.wst.validation.prefs ├── pom.xml ├── src/ │ └── main/ │ ├── java/ │ │ └── edu/ │ │ └── fjnu/ │ │ └── online/ │ │ ├── common/ │ │ │ └── springdao/ │ │ │ ├── AppContext.java │ │ │ └── SQLDAO.java │ │ ├── controller/ │ │ │ ├── BaseController.java │ │ │ ├── admin/ │ │ │ │ ├── CourseController.java │ │ │ │ ├── GradeController.java │ │ │ │ ├── PaperController.java │ │ │ │ ├── QuestionController.java │ │ │ │ ├── TypeController.java │ │ │ │ └── UserController.java │ │ │ └── user/ │ │ │ ├── ErrorBookController.java │ │ │ ├── PaperMgController.java │ │ │ └── StuController.java │ │ ├── dao/ │ │ │ ├── BaseDao.java │ │ │ ├── CourseDao.java │ │ │ ├── ErrorBookDao.java │ │ │ ├── GradeDao.java │ │ │ ├── PaperDao.java │ │ │ ├── QuestionDao.java │ │ │ ├── TypeDao.java │ │ │ ├── UserDao.java │ │ │ └── impl/ │ │ │ ├── BaseDaoImpl.java │ │ │ ├── CourseDaoImpl.java │ │ │ ├── ErrorBookDaoImpl.java │ │ │ ├── GradeDaoImpl.java │ │ │ ├── PaperDaoImpl.java │ │ │ ├── QuestionDaoImpl.java │ │ │ ├── TypeDaoImpl.java │ │ │ └── UserDaoImpl.java │ │ ├── domain/ │ │ │ ├── Course.java │ │ │ ├── ErrorBook.java │ │ │ ├── Factory.java │ │ │ ├── Grade.java │ │ │ ├── MsgItem.java │ │ │ ├── Paper.java │ │ │ ├── Question.java │ │ │ ├── Type.java │ │ │ └── User.java │ │ ├── pagination/ │ │ │ ├── Page.java │ │ │ └── PageInterceptor.java │ │ ├── service/ │ │ │ ├── CourseService.java │ │ │ ├── ErrorBookService.java │ │ │ ├── GradeService.java │ │ │ ├── PaperService.java │ │ │ ├── QuestionService.java │ │ │ ├── TypeService.java │ │ │ ├── UserService.java │ │ │ └── impl/ │ │ │ ├── CourseServiceImpl.java │ │ │ ├── ErrorBookServiceImpl.java │ │ │ ├── GradeServiceImpl.java │ │ │ ├── PaperServiceImpl.java │ │ │ ├── QuestionServiceImpl.java │ │ │ ├── TypeServiceImpl.java │ │ │ └── UserServiceImpl.java │ │ └── util/ │ │ ├── Arith.java │ │ ├── ComputeScore.java │ │ ├── Computeclass.java │ │ ├── DateConverter.java │ │ ├── DownloadUtil.java │ │ ├── FormatStyle.java │ │ ├── MD5Util.java │ │ ├── MybatisUtil.java │ │ ├── TextSimilarityUtil.java │ │ ├── UtilFuns.java │ │ └── file/ │ │ └── FileUtil.java │ ├── resources/ │ │ ├── beans.xml │ │ ├── edu/ │ │ │ └── fjnu/ │ │ │ └── online/ │ │ │ └── mapper/ │ │ │ ├── Course.xml │ │ │ ├── ErrorBook.xml │ │ │ ├── Factory.xml │ │ │ ├── Grade.xml │ │ │ ├── Paper.xml │ │ │ ├── Question.xml │ │ │ ├── Type.xml │ │ │ └── User.xml │ │ ├── jdbc.properties │ │ ├── springmvc-servlet.xml │ │ └── sqlMapConfig.xml │ └── webapp/ │ ├── WEB-INF/ │ │ ├── pages/ │ │ │ ├── admin/ │ │ │ │ ├── course-mgt.jsp │ │ │ │ ├── course-reg.jsp │ │ │ │ ├── course-upd.jsp │ │ │ │ ├── grade-mgt.jsp │ │ │ │ ├── grade-reg.jsp │ │ │ │ ├── grade-upd.jsp │ │ │ │ ├── index.jsp │ │ │ │ ├── info-deal.jsp │ │ │ │ ├── info-det.jsp │ │ │ │ ├── info-mgt.jsp │ │ │ │ ├── info-qry.jsp │ │ │ │ ├── info-reg.jsp │ │ │ │ ├── info-upd.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── paper-mgt.jsp │ │ │ │ ├── paper-qry.jsp │ │ │ │ ├── paper-reg.jsp │ │ │ │ ├── question-mgt.jsp │ │ │ │ ├── question-qry.jsp │ │ │ │ ├── question-reg.jsp │ │ │ │ ├── question-upd.jsp │ │ │ │ ├── type-info.jsp │ │ │ │ ├── type-mgt.jsp │ │ │ │ ├── type-qry.jsp │ │ │ │ ├── type-reg.jsp │ │ │ │ └── type-upd.jsp │ │ │ ├── base.jsp │ │ │ ├── baseinfo/ │ │ │ │ ├── left.jsp │ │ │ │ └── main.jsp │ │ │ ├── baselist.jsp │ │ │ ├── bases.jsp │ │ │ ├── home/ │ │ │ │ ├── fmain.jsp │ │ │ │ ├── left.jsp │ │ │ │ ├── olmsgList.jsp │ │ │ │ └── title.jsp │ │ │ ├── index1.jsp │ │ │ └── user/ │ │ │ ├── about.html │ │ │ ├── about.jsp │ │ │ ├── index.html │ │ │ ├── index.jsp │ │ │ ├── login.html │ │ │ ├── login.jsp │ │ │ ├── mybooks.html │ │ │ ├── mybooks.jsp │ │ │ ├── mypaper.html │ │ │ ├── mypaper.jsp │ │ │ ├── onlinecheck.html │ │ │ ├── paperdetail.jsp │ │ │ ├── qrypaper.jsp │ │ │ ├── regist.html │ │ │ ├── regist.jsp │ │ │ ├── regist1.jsp │ │ │ ├── scorequery.html │ │ │ ├── scorequery.jsp │ │ │ ├── tomypaper.jsp │ │ │ ├── userinfo.html │ │ │ └── userinfo.jsp │ │ └── web.xml │ ├── components/ │ │ ├── chart/ │ │ │ ├── amcolumn/ │ │ │ │ ├── amcharts_key.txt │ │ │ │ ├── amcolumn.swf │ │ │ │ ├── amcolumn_data.txt │ │ │ │ ├── amcolumn_data.xml │ │ │ │ ├── amcolumn_data333.txt │ │ │ │ ├── amcolumn_settings.xml │ │ │ │ ├── export.aspx │ │ │ │ ├── export.aspx.cs │ │ │ │ ├── export.php │ │ │ │ ├── fonts/ │ │ │ │ │ ├── arial.fla │ │ │ │ │ ├── arial.swf │ │ │ │ │ ├── garamond.swf │ │ │ │ │ ├── tahoma.swf │ │ │ │ │ └── times new roman.swf │ │ │ │ ├── patterns/ │ │ │ │ │ ├── diagonal.fla │ │ │ │ │ ├── diagonal.swf │ │ │ │ │ ├── horizontal.fla │ │ │ │ │ ├── horizontal.swf │ │ │ │ │ ├── vertical.fla │ │ │ │ │ └── vertical.swf │ │ │ │ ├── plugins/ │ │ │ │ │ └── value_indicator.swf │ │ │ │ └── swfobject.js │ │ │ ├── amline_1.6.4.1/ │ │ │ │ ├── amline/ │ │ │ │ │ ├── amcharts_key.txt │ │ │ │ │ ├── amline.swf │ │ │ │ │ ├── amline_data.txt │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ ├── export.aspx │ │ │ │ │ ├── export.aspx.cs │ │ │ │ │ ├── export.php │ │ │ │ │ ├── fonts/ │ │ │ │ │ │ ├── arial.swf │ │ │ │ │ │ ├── garamond.swf │ │ │ │ │ │ ├── georgia.swf │ │ │ │ │ │ ├── tahoma.fla │ │ │ │ │ │ ├── tahoma.swf │ │ │ │ │ │ └── times new roman.swf │ │ │ │ │ ├── plugins/ │ │ │ │ │ │ └── value_indicator.swf │ │ │ │ │ └── swfobject.js │ │ │ │ ├── amline.html │ │ │ │ ├── changelog.txt │ │ │ │ ├── examples/ │ │ │ │ │ ├── auto_resizing_chart/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── chart_with_data_gaps/ │ │ │ │ │ │ ├── amline_data.txt │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── chart_with_scroller/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ ├── bg.swf │ │ │ │ │ │ ├── bomb.swf │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── data_and_settings_inisde_html/ │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── javascript_control/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── multiple_charts_on_one_page/ │ │ │ │ │ │ ├── amline_data1.txt │ │ │ │ │ │ ├── amline_data2.txt │ │ │ │ │ │ ├── amline_settings1.xml │ │ │ │ │ │ ├── amline_settings2.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── no_interactivity/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── stacked_area_chart/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ └── value_indicator_plugin/ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ └── index.html │ │ │ │ ├── licence.txt │ │ │ │ └── readme.txt │ │ │ └── ampie_1.6.4.1/ │ │ │ ├── ampie/ │ │ │ │ ├── amcharts_key.txt │ │ │ │ ├── ampie.swf │ │ │ │ ├── ampie_data.txt │ │ │ │ ├── ampie_data.xml │ │ │ │ ├── ampie_settings.xml │ │ │ │ ├── export.aspx │ │ │ │ ├── export.aspx.cs │ │ │ │ ├── export.php │ │ │ │ ├── patterns/ │ │ │ │ │ ├── diagonal.fla │ │ │ │ │ ├── diagonal.swf │ │ │ │ │ ├── horizontal.fla │ │ │ │ │ ├── horizontal.swf │ │ │ │ │ ├── vertical.fla │ │ │ │ │ └── vertical.swf │ │ │ │ ├── swfobject.js │ │ │ │ └── xx.xml │ │ │ ├── ampie.html │ │ │ ├── changelog.txt │ │ │ ├── examples/ │ │ │ │ ├── ampie/ │ │ │ │ │ ├── ampie1/ │ │ │ │ │ │ ├── ampie_data.txt │ │ │ │ │ │ └── ampie_settings.xml │ │ │ │ │ ├── ampie3/ │ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ │ └── ampie_settings.xml │ │ │ │ │ ├── ampie4/ │ │ │ │ │ │ ├── ampie_data1.txt │ │ │ │ │ │ ├── ampie_data2.txt │ │ │ │ │ │ ├── ampie_settings1.xml │ │ │ │ │ │ └── ampie_settings2.xml │ │ │ │ │ ├── ampie5/ │ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ │ ├── ampie_settings.xml │ │ │ │ │ │ └── bg.swf │ │ │ │ │ └── js/ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ └── ampie_settings.xml │ │ │ │ ├── ampie1.html │ │ │ │ ├── ampie2.html │ │ │ │ ├── ampie3.html │ │ │ │ ├── ampie4.html │ │ │ │ ├── ampie5.html │ │ │ │ ├── js_example.html │ │ │ │ └── multiple_charts_on_one_page/ │ │ │ │ ├── ampie_data1.txt │ │ │ │ ├── ampie_data2.txt │ │ │ │ ├── ampie_settings1.xml │ │ │ │ ├── ampie_settings2.xml │ │ │ │ └── index.html │ │ │ ├── licence.txt │ │ │ └── readme.txt │ │ └── jquery-ui/ │ │ └── jquery-1.2.6.js │ ├── css/ │ │ ├── WdatePicker.css │ │ ├── base.css │ │ ├── bootstrap.css │ │ ├── extreme/ │ │ │ ├── extremecomponents.css │ │ │ └── extremesite.css │ │ ├── home.css │ │ ├── index.css │ │ ├── info-mgt.css │ │ ├── info-reg.css │ │ ├── jquery.dialog.css │ │ ├── jquery.searchableSelect.css │ │ ├── login.css │ │ ├── reset.css │ │ ├── style.css │ │ ├── supersized.css │ │ ├── swipebox.css │ │ ├── time.css │ │ └── userlogin.css │ ├── images/ │ │ └── olmsg/ │ │ ├── mouse149.ANI │ │ ├── shubiao.ani │ │ └── wish1.swf │ ├── index.jsp │ ├── js/ │ │ ├── WdatePicker.js │ │ ├── bootstrap.js │ │ ├── calendar.js │ │ ├── classie.js │ │ ├── common.js │ │ ├── core.js │ │ ├── datepicker/ │ │ │ ├── My97DatePicker.htm │ │ │ ├── WdatePicker.js │ │ │ ├── calendar.js │ │ │ ├── config.js │ │ │ ├── lang/ │ │ │ │ ├── en.js │ │ │ │ ├── zh-cn.js │ │ │ │ └── zh-tw.js │ │ │ ├── readme.txt │ │ │ └── skin/ │ │ │ ├── WdatePicker.css │ │ │ ├── default/ │ │ │ │ └── datepicker.css │ │ │ └── whyGreen/ │ │ │ └── datepicker.css │ │ ├── dtree/ │ │ │ ├── ckdtree/ │ │ │ │ ├── api.html │ │ │ │ ├── dtree.css │ │ │ │ ├── dtree.js │ │ │ │ └── example01.html │ │ │ ├── dtree/ │ │ │ │ ├── bzgk.html │ │ │ │ ├── dept.html │ │ │ │ ├── dtree.css │ │ │ │ ├── dtree.js │ │ │ │ ├── dtreebak.js │ │ │ │ └── example01.html │ │ │ └── tdtree/ │ │ │ ├── api.html │ │ │ ├── dtree.css │ │ │ ├── dtree.js │ │ │ ├── example01.html │ │ │ └── frame.html │ │ ├── easing.js │ │ ├── index.js │ │ ├── jquery-1.10.1.js │ │ ├── jquery.dialog.js │ │ ├── jquery.js │ │ ├── jquery.pagination.js │ │ ├── jquery.searchableSelect.js │ │ ├── lang/ │ │ │ ├── en.js │ │ │ ├── zh-cn.js │ │ │ └── zh-tw.js │ │ ├── modernizr.custom.js │ │ ├── move-top.js │ │ ├── scripts.js │ │ ├── skin/ │ │ │ ├── WdatePicker.css │ │ │ ├── default/ │ │ │ │ └── datepicker.css │ │ │ └── whyGreen/ │ │ │ └── datepicker.css │ │ ├── supersized-init.js │ │ ├── tabledo.js │ │ └── uisearch.js │ ├── make/ │ │ └── xlsprint/ │ │ ├── OFFER.xls │ │ ├── SALES.xls │ │ ├── SAMPLE.xls │ │ ├── tCONTRACT.xls │ │ ├── tEXPORT.xls │ │ ├── tFINANCE.xls │ │ ├── tHOMEPARKINGLIST.xls │ │ ├── tINVOICE.xls │ │ ├── tOUTPRODUCT.xls │ │ ├── tPARKINGLIST.xls │ │ ├── tSHIPPINGORDER.xls │ │ └── txOutProduct.xls │ ├── skin/ │ │ └── default/ │ │ ├── css/ │ │ │ ├── default.css │ │ │ ├── login.css │ │ │ ├── main.css │ │ │ ├── table.css │ │ │ └── title.css │ │ └── js/ │ │ └── toggle.js │ └── sql/ │ └── onlinetest.sql └── target/ ├── Check/ │ ├── WEB-INF/ │ │ ├── classes/ │ │ │ ├── beans.xml │ │ │ ├── edu/ │ │ │ │ └── fjnu/ │ │ │ │ └── online/ │ │ │ │ └── mapper/ │ │ │ │ ├── Course.xml │ │ │ │ ├── ErrorBook.xml │ │ │ │ ├── Factory.xml │ │ │ │ ├── Grade.xml │ │ │ │ ├── Paper.xml │ │ │ │ ├── Question.xml │ │ │ │ ├── Type.xml │ │ │ │ └── User.xml │ │ │ ├── jdbc.properties │ │ │ ├── springmvc-servlet.xml │ │ │ └── sqlMapConfig.xml │ │ ├── lib/ │ │ │ ├── aopalliance-1.0.jar │ │ │ ├── c3p0-0.9.1.2.jar │ │ │ ├── com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar │ │ │ ├── commons-codec-1.5.jar │ │ │ ├── commons-fileupload-1.2.2.jar │ │ │ ├── commons-io-2.0.1.jar │ │ │ ├── commons-logging-1.1.1.jar │ │ │ ├── dom4j-1.6.1.jar │ │ │ ├── hamcrest-core-1.1.jar │ │ │ ├── jackson-core-asl-1.9.11.jar │ │ │ ├── jackson-mapper-asl-1.9.11.jar │ │ │ ├── jcommon-1.0.16.jar │ │ │ ├── jfreechart-1.0.13.jar │ │ │ ├── jsp-api-2.1.jar │ │ │ ├── jsqlparser-0.9.1.jar │ │ │ ├── jstl-api-1.2.jar │ │ │ ├── jstl-impl-1.2.jar │ │ │ ├── junit-4.9.jar │ │ │ ├── jxl-2.4.2.jar │ │ │ ├── log4j-1.2.13.jar │ │ │ ├── mybatis-3.2.2.jar │ │ │ ├── mybatis-spring-1.2.0.jar │ │ │ ├── mysql-connector-java-5.1.10.jar │ │ │ ├── pagehelper-4.0.0.jar │ │ │ ├── poi-3.9.jar │ │ │ ├── poi-ooxml-3.9.jar │ │ │ ├── poi-ooxml-schemas-3.9.jar │ │ │ ├── servlet-api-2.5.jar │ │ │ ├── spring-aop-3.2.2.RELEASE.jar │ │ │ ├── spring-beans-3.2.2.RELEASE.jar │ │ │ ├── spring-context-3.2.2.RELEASE.jar │ │ │ ├── spring-core-3.2.2.RELEASE.jar │ │ │ ├── spring-expression-3.2.2.RELEASE.jar │ │ │ ├── spring-jdbc-3.2.2.RELEASE.jar │ │ │ ├── spring-orm-3.2.2.RELEASE.jar │ │ │ ├── spring-tx-3.2.2.RELEASE.jar │ │ │ ├── spring-web-3.2.2.RELEASE.jar │ │ │ ├── spring-webmvc-3.2.2.RELEASE.jar │ │ │ ├── stax-api-1.0.1.jar │ │ │ ├── xml-apis-1.0.b2.jar │ │ │ └── xmlbeans-2.3.0.jar │ │ ├── pages/ │ │ │ ├── admin/ │ │ │ │ ├── course-mgt.jsp │ │ │ │ ├── course-reg.jsp │ │ │ │ ├── course-upd.jsp │ │ │ │ ├── grade-mgt.jsp │ │ │ │ ├── grade-reg.jsp │ │ │ │ ├── grade-upd.jsp │ │ │ │ ├── index.jsp │ │ │ │ ├── info-deal.jsp │ │ │ │ ├── info-det.jsp │ │ │ │ ├── info-mgt.jsp │ │ │ │ ├── info-qry.jsp │ │ │ │ ├── info-reg.jsp │ │ │ │ ├── info-upd.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── paper-mgt.jsp │ │ │ │ ├── paper-qry.jsp │ │ │ │ ├── paper-reg.jsp │ │ │ │ ├── question-mgt.jsp │ │ │ │ ├── question-qry.jsp │ │ │ │ ├── question-reg.jsp │ │ │ │ ├── question-upd.jsp │ │ │ │ ├── type-info.jsp │ │ │ │ ├── type-mgt.jsp │ │ │ │ ├── type-qry.jsp │ │ │ │ ├── type-reg.jsp │ │ │ │ └── type-upd.jsp │ │ │ ├── base.jsp │ │ │ ├── baseinfo/ │ │ │ │ ├── left.jsp │ │ │ │ └── main.jsp │ │ │ ├── baselist.jsp │ │ │ ├── bases.jsp │ │ │ ├── home/ │ │ │ │ ├── fmain.jsp │ │ │ │ ├── left.jsp │ │ │ │ ├── olmsgList.jsp │ │ │ │ └── title.jsp │ │ │ ├── index1.jsp │ │ │ └── user/ │ │ │ ├── index.html │ │ │ ├── index.jsp │ │ │ ├── login.html │ │ │ ├── login.jsp │ │ │ ├── mybooks.html │ │ │ ├── mybooks.jsp │ │ │ ├── mypaper.html │ │ │ ├── mypaper.jsp │ │ │ ├── onlinecheck.html │ │ │ ├── paperdetail.jsp │ │ │ ├── qrypaper.jsp │ │ │ ├── regist.html │ │ │ ├── regist.jsp │ │ │ ├── regist1.jsp │ │ │ ├── scorequery.html │ │ │ ├── scorequery.jsp │ │ │ ├── tomypaper.jsp │ │ │ ├── userinfo.html │ │ │ └── userinfo.jsp │ │ └── web.xml │ ├── components/ │ │ ├── chart/ │ │ │ ├── amcolumn/ │ │ │ │ ├── amcharts_key.txt │ │ │ │ ├── amcolumn.swf │ │ │ │ ├── amcolumn_data.txt │ │ │ │ ├── amcolumn_data.xml │ │ │ │ ├── amcolumn_data333.txt │ │ │ │ ├── amcolumn_settings.xml │ │ │ │ ├── export.aspx │ │ │ │ ├── export.aspx.cs │ │ │ │ ├── export.php │ │ │ │ ├── fonts/ │ │ │ │ │ ├── arial.fla │ │ │ │ │ ├── arial.swf │ │ │ │ │ ├── garamond.swf │ │ │ │ │ ├── tahoma.swf │ │ │ │ │ └── times new roman.swf │ │ │ │ ├── patterns/ │ │ │ │ │ ├── diagonal.fla │ │ │ │ │ ├── diagonal.swf │ │ │ │ │ ├── horizontal.fla │ │ │ │ │ ├── horizontal.swf │ │ │ │ │ ├── vertical.fla │ │ │ │ │ └── vertical.swf │ │ │ │ ├── plugins/ │ │ │ │ │ └── value_indicator.swf │ │ │ │ └── swfobject.js │ │ │ ├── amline_1.6.4.1/ │ │ │ │ ├── amline/ │ │ │ │ │ ├── amcharts_key.txt │ │ │ │ │ ├── amline.swf │ │ │ │ │ ├── amline_data.txt │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ ├── export.aspx │ │ │ │ │ ├── export.aspx.cs │ │ │ │ │ ├── export.php │ │ │ │ │ ├── fonts/ │ │ │ │ │ │ ├── arial.swf │ │ │ │ │ │ ├── garamond.swf │ │ │ │ │ │ ├── georgia.swf │ │ │ │ │ │ ├── tahoma.fla │ │ │ │ │ │ ├── tahoma.swf │ │ │ │ │ │ └── times new roman.swf │ │ │ │ │ ├── plugins/ │ │ │ │ │ │ └── value_indicator.swf │ │ │ │ │ └── swfobject.js │ │ │ │ ├── amline.html │ │ │ │ ├── changelog.txt │ │ │ │ ├── examples/ │ │ │ │ │ ├── auto_resizing_chart/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── chart_with_data_gaps/ │ │ │ │ │ │ ├── amline_data.txt │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── chart_with_scroller/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ ├── bg.swf │ │ │ │ │ │ ├── bomb.swf │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── data_and_settings_inisde_html/ │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── javascript_control/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── multiple_charts_on_one_page/ │ │ │ │ │ │ ├── amline_data1.txt │ │ │ │ │ │ ├── amline_data2.txt │ │ │ │ │ │ ├── amline_settings1.xml │ │ │ │ │ │ ├── amline_settings2.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── no_interactivity/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── stacked_area_chart/ │ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ │ └── index.html │ │ │ │ │ └── value_indicator_plugin/ │ │ │ │ │ ├── amline_data.xml │ │ │ │ │ ├── amline_settings.xml │ │ │ │ │ └── index.html │ │ │ │ ├── licence.txt │ │ │ │ └── readme.txt │ │ │ └── ampie_1.6.4.1/ │ │ │ ├── ampie/ │ │ │ │ ├── amcharts_key.txt │ │ │ │ ├── ampie.swf │ │ │ │ ├── ampie_data.txt │ │ │ │ ├── ampie_data.xml │ │ │ │ ├── ampie_settings.xml │ │ │ │ ├── export.aspx │ │ │ │ ├── export.aspx.cs │ │ │ │ ├── export.php │ │ │ │ ├── patterns/ │ │ │ │ │ ├── diagonal.fla │ │ │ │ │ ├── diagonal.swf │ │ │ │ │ ├── horizontal.fla │ │ │ │ │ ├── horizontal.swf │ │ │ │ │ ├── vertical.fla │ │ │ │ │ └── vertical.swf │ │ │ │ ├── swfobject.js │ │ │ │ └── xx.xml │ │ │ ├── ampie.html │ │ │ ├── changelog.txt │ │ │ ├── examples/ │ │ │ │ ├── ampie/ │ │ │ │ │ ├── ampie1/ │ │ │ │ │ │ ├── ampie_data.txt │ │ │ │ │ │ └── ampie_settings.xml │ │ │ │ │ ├── ampie3/ │ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ │ └── ampie_settings.xml │ │ │ │ │ ├── ampie4/ │ │ │ │ │ │ ├── ampie_data1.txt │ │ │ │ │ │ ├── ampie_data2.txt │ │ │ │ │ │ ├── ampie_settings1.xml │ │ │ │ │ │ └── ampie_settings2.xml │ │ │ │ │ ├── ampie5/ │ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ │ ├── ampie_settings.xml │ │ │ │ │ │ └── bg.swf │ │ │ │ │ └── js/ │ │ │ │ │ ├── ampie_data.xml │ │ │ │ │ └── ampie_settings.xml │ │ │ │ ├── ampie1.html │ │ │ │ ├── ampie2.html │ │ │ │ ├── ampie3.html │ │ │ │ ├── ampie4.html │ │ │ │ ├── ampie5.html │ │ │ │ ├── js_example.html │ │ │ │ └── multiple_charts_on_one_page/ │ │ │ │ ├── ampie_data1.txt │ │ │ │ ├── ampie_data2.txt │ │ │ │ ├── ampie_settings1.xml │ │ │ │ ├── ampie_settings2.xml │ │ │ │ └── index.html │ │ │ ├── licence.txt │ │ │ └── readme.txt │ │ └── jquery-ui/ │ │ └── jquery-1.2.6.js │ ├── css/ │ │ ├── WdatePicker.css │ │ ├── base.css │ │ ├── bootstrap.css │ │ ├── extreme/ │ │ │ ├── extremecomponents.css │ │ │ └── extremesite.css │ │ ├── home.css │ │ ├── index.css │ │ ├── info-mgt.css │ │ ├── info-reg.css │ │ ├── jquery.dialog.css │ │ ├── jquery.searchableSelect.css │ │ ├── login.css │ │ ├── reset.css │ │ ├── style.css │ │ ├── supersized.css │ │ ├── swipebox.css │ │ ├── time.css │ │ └── userlogin.css │ ├── images/ │ │ └── olmsg/ │ │ ├── mouse149.ANI │ │ ├── shubiao.ani │ │ └── wish1.swf │ ├── index.jsp │ ├── js/ │ │ ├── WdatePicker.js │ │ ├── bootstrap.js │ │ ├── calendar.js │ │ ├── classie.js │ │ ├── common.js │ │ ├── core.js │ │ ├── datepicker/ │ │ │ ├── My97DatePicker.htm │ │ │ ├── WdatePicker.js │ │ │ ├── calendar.js │ │ │ ├── config.js │ │ │ ├── lang/ │ │ │ │ ├── en.js │ │ │ │ ├── zh-cn.js │ │ │ │ └── zh-tw.js │ │ │ ├── readme.txt │ │ │ └── skin/ │ │ │ ├── WdatePicker.css │ │ │ ├── default/ │ │ │ │ └── datepicker.css │ │ │ └── whyGreen/ │ │ │ └── datepicker.css │ │ ├── dtree/ │ │ │ ├── ckdtree/ │ │ │ │ ├── api.html │ │ │ │ ├── dtree.css │ │ │ │ ├── dtree.js │ │ │ │ └── example01.html │ │ │ ├── dtree/ │ │ │ │ ├── bzgk.html │ │ │ │ ├── dept.html │ │ │ │ ├── dtree.css │ │ │ │ ├── dtree.js │ │ │ │ ├── dtreebak.js │ │ │ │ └── example01.html │ │ │ └── tdtree/ │ │ │ ├── api.html │ │ │ ├── dtree.css │ │ │ ├── dtree.js │ │ │ ├── example01.html │ │ │ └── frame.html │ │ ├── easing.js │ │ ├── index.js │ │ ├── jquery-1.10.1.js │ │ ├── jquery.dialog.js │ │ ├── jquery.js │ │ ├── jquery.pagination.js │ │ ├── jquery.searchableSelect.js │ │ ├── lang/ │ │ │ ├── en.js │ │ │ ├── zh-cn.js │ │ │ └── zh-tw.js │ │ ├── modernizr.custom.js │ │ ├── move-top.js │ │ ├── scripts.js │ │ ├── skin/ │ │ │ ├── WdatePicker.css │ │ │ ├── default/ │ │ │ │ └── datepicker.css │ │ │ └── whyGreen/ │ │ │ └── datepicker.css │ │ ├── supersized-init.js │ │ ├── tabledo.js │ │ └── uisearch.js │ ├── make/ │ │ └── xlsprint/ │ │ ├── OFFER.xls │ │ ├── SALES.xls │ │ ├── SAMPLE.xls │ │ ├── tCONTRACT.xls │ │ ├── tEXPORT.xls │ │ ├── tFINANCE.xls │ │ ├── tHOMEPARKINGLIST.xls │ │ ├── tINVOICE.xls │ │ ├── tOUTPRODUCT.xls │ │ ├── tPARKINGLIST.xls │ │ ├── tSHIPPINGORDER.xls │ │ └── txOutProduct.xls │ └── skin/ │ └── default/ │ ├── css/ │ │ ├── default.css │ │ ├── login.css │ │ ├── main.css │ │ ├── table.css │ │ └── title.css │ └── js/ │ └── toggle.js ├── Check.war ├── classes/ │ ├── beans.xml │ ├── edu/ │ │ └── fjnu/ │ │ └── online/ │ │ └── mapper/ │ │ ├── Course.xml │ │ ├── ErrorBook.xml │ │ ├── Factory.xml │ │ ├── Grade.xml │ │ ├── Paper.xml │ │ ├── Question.xml │ │ ├── Type.xml │ │ └── User.xml │ ├── jdbc.properties │ ├── springmvc-servlet.xml │ └── sqlMapConfig.xml ├── m2e-jee/ │ └── web-resources/ │ └── META-INF/ │ ├── MANIFEST.MF │ └── maven/ │ └── edu.fjnu.online/ │ └── Check/ │ ├── pom.properties │ └── pom.xml ├── maven-archiver/ │ └── pom.properties └── maven-status/ └── maven-compiler-plugin/ ├── compile/ │ └── default-compile/ │ ├── createdFiles.lst │ └── inputFiles.lst └── testCompile/ └── default-testCompile/ └── inputFiles.lst ================================================ FILE CONTENTS ================================================ ================================================ FILE: Check Maven Webapp/.classpath ================================================ ================================================ FILE: Check Maven Webapp/.project ================================================ Check Maven Webapp org.eclipse.wst.jsdt.core.javascriptValidator org.eclipse.jdt.core.javabuilder org.eclipse.wst.common.project.facet.core.builder org.eclipse.wst.validation.validationbuilder org.maven.ide.eclipse.maven2Builder com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder com.genuitec.eclipse.springframework.springbuilder org.eclipse.m2e.core.maven2Builder com.genuitec.eclipse.springframework.springnature org.maven.ide.eclipse.maven2Nature org.eclipse.m2e.core.maven2Nature org.eclipse.jem.workbench.JavaEMFNature org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature ================================================ FILE: Check Maven Webapp/.settings/.jsdtscope ================================================ ================================================ FILE: Check Maven Webapp/.settings/com.genuitec.eclipse.core.prefs ================================================ clsCnt=57 eclipse.preferences.version=1 locCnt=5725 pkgCnt=19 sTime=2017\u5E743\u670822\u65E5 \u661F\u671F\u4E09 \u4E0B\u534807\u65F611\u520623\u79D2 GMT+08\:00 srcCnt=3 ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.core.resources.prefs ================================================ eclipse.preferences.version=1 encoding//src/main/webapp/WEB-INF/pages/user/about.jsp=UTF-8 encoding//src/main/webapp/WEB-INF/pages/user/index.jsp=UTF-8 encoding//src/main/webapp/WEB-INF/pages/user/userinfo.jsp=UTF-8 ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.jdt.core.prefs ================================================ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.5 ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.ltk.core.refactoring.prefs ================================================ eclipse.preferences.version=1 org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.m2e.core.prefs ================================================ activeProfiles= eclipse.preferences.version=1 resolveWorkspaceProjects=true version=1 ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.wst.common.component ================================================ ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.wst.common.project.facet.core.xml ================================================ ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.wst.jsdt.ui.superType.container ================================================ org.eclipse.wst.jsdt.launching.baseBrowserLibrary ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.wst.jsdt.ui.superType.name ================================================ Window ================================================ FILE: Check Maven Webapp/.settings/org.eclipse.wst.validation.prefs ================================================ disabled=06target eclipse.preferences.version=1 ================================================ FILE: Check Maven Webapp/pom.xml ================================================ 4.0.0 edu.fjnu.online Check war 0.0.1-SNAPSHOT Check Maven Webapp http://maven.apache.org 3.2.2.RELEASE org.springframework spring-webmvc ${org.springframework.version} org.springframework spring-orm ${org.springframework.version} org.aspectj com.springsource.org.aspectj.weaver 1.6.8.RELEASE org.mybatis mybatis 3.2.2 org.mybatis mybatis-spring 1.2.0 c3p0 c3p0 0.9.1.2 mysql mysql-connector-java 5.1.10 log4j log4j 1.2.13 org.apache.poi poi 3.9 org.apache.poi poi-ooxml 3.9 jfree jfreechart 1.0.13 junit junit 4.9 commons-fileupload commons-fileupload 1.2.2 commons-io commons-io 2.0.1 javax.servlet.jsp.jstl jstl-api 1.2 org.glassfish.web jstl-impl 1.2 jexcelapi jxl 2.4.2 org.codehaus.jackson jackson-mapper-asl 1.9.11 com.github.pagehelper pagehelper 4.0.0 Check ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/common/springdao/AppContext.java ================================================ package edu.fjnu.online.common.springdao; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class AppContext { private static AppContext instance; public static String[] paths = {"/nu-template-dao.xml"}; //指定自己的配置文件 private AbstractApplicationContext appContext; public synchronized static AppContext getInstance() { if (instance == null) { instance = new AppContext(); } return instance; } private AppContext() { this.appContext = new ClassPathXmlApplicationContext(paths); } public AbstractApplicationContext getAppContext() { return appContext; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/common/springdao/SQLDAO.java ================================================ package edu.fjnu.online.common.springdao; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.sql.DataSource; import org.apache.log4j.Logger; import org.springframework.jdbc.core.JdbcTemplate; import edu.fjnu.online.util.UtilFuns; /* * 执行sql语句类 * 调用方法: * 引入配置问题 * SQLDAO sqlDao = (SQLDAO)AppContext.getInstance().getAppContext().getBean("sqlDao"); * */ public class SQLDAO { private static Logger log = Logger.getLogger(SQLDAO.class); private UtilFuns utilFuns = new UtilFuns(); private JdbcTemplate jdbcTemplate; public void setDataSource(DataSource ds){ jdbcTemplate = new JdbcTemplate(ds); } public int findInt(String sql){ log.debug(sql); int i = jdbcTemplate.queryForInt(sql); return i; } public int findInt(String sql, Object[] objs){ log.debug(sql); int i = jdbcTemplate.queryForInt(sql, objs); return i; } //返回单值 public String getSingleValue(String sql){ log.debug(sql); StringBuffer sBuf = new StringBuffer(); List jlist = jdbcTemplate.queryForList(sql); Iterator ite = jlist.iterator(); while(ite.hasNext()){ Map map = (Map)ite.next(); for(Object o:map.keySet()){ sBuf.append(String.valueOf(map.get(o))).append(","); } } if(sBuf!=null && sBuf.length()>1){ sBuf.delete(sBuf.length()-1, sBuf.length()); //del last char } return sBuf.toString(); } public String getSingleValue(String sql, Object[] objs){ log.debug(sql); StringBuffer sBuf = new StringBuffer(); List jlist = null; if(utilFuns.arrayValid(objs)){ jlist = jdbcTemplate.queryForList(sql, objs); } else { jlist = jdbcTemplate.queryForList(sql); } Iterator ite = jlist.iterator(); while(ite.hasNext()){ Map map = (Map)ite.next(); for(Object o:map.keySet()){ sBuf.append(String.valueOf(map.get(o))).append(","); } } if(sBuf!=null && sBuf.length()>1){ sBuf.delete(sBuf.length()-1, sBuf.length()); //del last char } return sBuf.toString(); } public String[] toArray(String sql){ log.debug(sql); String[] strs = null; List aList = this.executeSQL(sql); if(aList.size()>0){ int count = aList.size(); strs = new String[ count ]; for(int i=0; i aList = new ArrayList(); List jlist = jdbcTemplate.queryForList(sql); Iterator ite = jlist.iterator(); while(ite.hasNext()){ Map map = (Map)ite.next(); for(Object o:map.keySet()){ if(map.get(o.toString())==null){ aList.add(""); //对象不存在时,写空串 }else{ aList.add(map.get(o.toString()).toString()); } } } return aList; } public List executeSQL(String sql, Object[] objs){ log.debug(sql); List aList = new ArrayList(); List jlist = null; if(utilFuns.arrayValid(objs)){ jlist = jdbcTemplate.queryForList(sql, objs); } else { jlist = jdbcTemplate.queryForList(sql); } Iterator ite = jlist.iterator(); while(ite.hasNext()){ Map map = (Map)ite.next(); for(Object o:map.keySet()){ aList.add((String)map.get(o)); } } return aList; } public List executeSQLForList(String sql, Object[] objs){ log.debug(sql); List aList = new ArrayList(); List jlist = null; if(utilFuns.arrayValid(objs)){ jlist = jdbcTemplate.queryForList(sql, objs); } else { jlist = jdbcTemplate.queryForList(sql); } Iterator ite = jlist.iterator(); List list; while(ite.hasNext()){ Map map = (Map)ite.next(); list = new ArrayList(); for(Object o:map.keySet()){ list.add(map.get(o)); } aList.add(list.toArray()); } return aList; } public int updateSQL(String sql){ log.debug(sql); int i = jdbcTemplate.update(sql); return i; } public int updateSQL(String sql, Object[] objs){ log.debug(sql); int i = jdbcTemplate.update(sql, objs); return i; } public int[] batchSQL(String[] sql){ log.debug(sql); return jdbcTemplate.batchUpdate(sql); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/BaseController.java ================================================ package edu.fjnu.online.controller; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; /** * @CreateDate: 2017-3-11 */ public abstract class BaseController { @InitBinder public void initBinder(WebDataBinder binder) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setLenient(true); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/admin/CourseController.java ================================================ package edu.fjnu.online.controller.admin; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.service.CourseService; @Controller public class CourseController { @Autowired CourseService courseService; /** * 跳转到课程页面 * @param course * @param model * @param session * @return */ @RequestMapping("/toCoursePage.action") public String toCoursePage(@RequestParam(value="page", defaultValue="1") int page, Course course,Model model, HttpSession session){ //List dataList = courseService.find(course); PageInfo pageInfo = courseService.findByPage(course, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return "/admin/course-mgt.jsp"; } @RequestMapping("/qryCoursePage.action") @ResponseBody public List qryCoursePage(@RequestParam(value="page", defaultValue="1") int page, Course course,Model model, HttpSession session){ //List dataList = courseService.find(course); PageInfo pageInfo = courseService.findByPage(course, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return dataList; } /** * 删除课程信息 * @param courseId 课程编号,删除多个是,id用逗号分隔开 * @param model * @return */ @RequestMapping("/deleteCourse.action") public String deleteCourse(String courseId, Model model){ if(courseId != null){ String ids[] = courseId.split(","); for(int i=0;i dataList = courseService.find(course); model.addAttribute("dataList", dataList); return "/admin/course-reg.jsp"; } /** * 添加课程信息 * @param user * @param model * @return */ @RequestMapping("/addCourse.action") public String addType(Course course, Model model){ course.setCourseState("0"); courseService.insert(course); return "redirect:/toCoursePage.action"; } /** * 查看题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/toQryCourse.action") public String toQryType(int courseId, Model model, HttpSession session){ Course courseInfo = courseService.get(courseId); model.addAttribute("course", courseInfo); return "/admin/course-qry.jsp"; } /** * 跳转到更新题型信息页面 * @param type * @param model * @param session * @return */ @RequestMapping("/toUpdCourse.action") public String toUpdType(int courseId, Model model, HttpSession session){ Course courseInfo = courseService.get(courseId); model.addAttribute("course", courseInfo); return "/admin/course-upd.jsp"; } /** * 更新题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/updCourse.action") public String updType(Course course, Model model, HttpSession session){ courseService.update(course); return "redirect:/toCoursePage.action"; } /** * 删除题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/delCourse.action") public String delCourse(int courseId, Model model, HttpSession session){ courseService.delete(courseId); return "redirect:/toCoursePage.action"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/admin/GradeController.java ================================================ package edu.fjnu.online.controller.admin; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.domain.Question; import edu.fjnu.online.service.CourseService; import edu.fjnu.online.service.GradeService; @Controller public class GradeController { @Autowired GradeService gradeService; @Autowired CourseService courseService; /** * 跳转到年级页面 * @param course * @param model * @param session * @return */ @RequestMapping("/toGradePage.action") public String toGradePage(@RequestParam(value="page", defaultValue="1") int page, Grade grade,Model model, HttpSession session){ // List dataList = gradeService.find(grade); PageInfo pageInfo = gradeService.findByPage(grade, page, 5); List dataList = pageInfo.getList(); Course course=null; for(Grade g : dataList){ String courseName= ""; String id = g.getCourseId(); if(id != null){ String ids[] = id.split(","); for(int i=0;i qryAllGrade(@RequestParam(value="page", defaultValue="1") int page, Grade grade,Model model, HttpSession session){ // List dataList = gradeService.find(grade); PageInfo pageInfo = gradeService.findByPage(grade, page, 5); List dataList = pageInfo.getList(); Course course=null; for(Grade g : dataList){ String courseName= ""; String id = g.getCourseId(); if(id != null){ String ids[] = id.split(","); for(int i=0;i dataList = courseService.find(course); model.addAttribute("dataList", dataList); return "/admin/grade-reg.jsp"; } /** * 添加年级信息 * @param user * @param model * @return */ @RequestMapping("/addGrade.action") public String addType(Grade grade, Model model){ gradeService.insert(grade); return "redirect:/toGradePage.action"; } /** * 查看年级信息 * @param type * @param model * @param session * @return */ @RequestMapping("/toQryGrade.action") public String toQryGrade(int gradeId, Model model, HttpSession session){ Grade gradeInfo = gradeService.get(gradeId); model.addAttribute("grade", gradeInfo); model.addAttribute("course", courseService.find(new Course())); return "/admin/grade-upd.jsp"; } /** * 跳转到更新年级信息页面 * @param type * @param model * @param session * @return */ @RequestMapping("/toUpdGrade.action") public String toUpdGrade(int gradeId, Model model, HttpSession session){ Grade gradeInfo = gradeService.get(gradeId); String courseName= ""; Course course=null; List dataList = courseService.find(course); model.addAttribute("dataList", dataList); String id = gradeInfo.getCourseId(); if(id != null){ String ids[] = id.split(","); for(int i=0;i pageInfo = paperService.findAllPage(paper, page, 5); List dataList = pageInfo.getList(); // List dataList = paperService.find(paper); Course course=null; for(Paper g : dataList){ String courseName= ""; String id = g.getCourseId(); if(id != null){ String ids[] = id.split(","); for(int i=0;i qryAllPaper(@RequestParam(value="page", defaultValue="1") int page, Paper paper,Model model, HttpSession session){ PageInfo pageInfo = paperService.findAllPage(paper, page, 5); List dataList = pageInfo.getList(); // List dataList = paperService.find(paper); Course course=null; for(Paper g : dataList){ String courseName= ""; String id = g.getCourseId(); if(id != null){ String ids[] = id.split(","); for(int i=0;i selectList = null; List inputList = null; List descList = null; List paperList = new ArrayList(); map.put("gradeId", paper.getGradeId()); map.put("courseId", paper.getCourseId()); if(selectNum>0){//选择题 map.put("num", selectNum); map.put("typeId", 1); selectList = questionService.createPaper(map); paperList.addAll(selectList); } if(inputNum>0){//判断题 map.put("num", inputNum); map.put("typeId", 4); inputList = questionService.createPaper(map); paperList.addAll(inputList); } if(descNum > 0 ){//描述题 map.put("num", descNum); map.put("typeId", 5); descList = questionService.createPaper(map); paperList.addAll(descList); } String quesId = ""; for(Question ques : paperList){ quesId+=ques.getQuestionId()+","; } if(!quesId.isEmpty()){ quesId = removeLast(quesId); } paper.setQuestionId(quesId); paper.setPaperstate("0"); paperService.insert(paper); return "redirect:/toPaperPage.action"; } /** * 删除试卷信息 * @param paperId 试卷编号,删除多个是,id用逗号分隔开 * @param model * @return */ @RequestMapping("/deletePaper.action") public String deletePaper(String paperId, Model model){ if(paperId != null){ String ids[] = paperId.split(","); for(int i=0;i quesList =new ArrayList(); Question question = null; Course course = courseService.get(Integer.parseInt(paper.getCourseId())); paper.setCourseId(course.getCourseName()); int selNum=0; int inpNum=0; int desNum=0; if(quesId != null){ String ids[] = quesId.split(","); for(int i=0;i dataList = questionService.find(question); PageInfo pageInfo = questionService.findByPage(question, page, 5); List dataList = pageInfo.getList(); Course course=null; Type type=null; for(Question que : dataList){ String courseName= ""; String typeName=""; course = courseService.get(Integer.parseInt(que.getCourseId())); type = typeService.get(Integer.parseInt(que.getTypeId())); courseName=course.getCourseName(); typeName=type.getTypeName(); que.setCourseId(courseName); que.setTypeId(typeName); } model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return "/admin/question-mgt.jsp"; } /** * 跳转到题库管理页面 * @param question * @param model * @param session * @return */ @RequestMapping("/quesPage.action") @ResponseBody public List quesPage(@RequestParam(value="page", defaultValue="1") int page, Question question,Model model, HttpSession session){ // List dataList = questionService.find(question); PageInfo pageInfo = questionService.findByPage(question, page, 5); List dataList = pageInfo.getList(); Course course=null; Type type=null; for(Question que : dataList){ String courseName= ""; String typeName=""; course = courseService.get(Integer.parseInt(que.getCourseId())); type = typeService.get(Integer.parseInt(que.getTypeId())); courseName=course.getCourseName(); typeName=type.getTypeName(); que.setCourseId(courseName); que.setTypeId(typeName); } model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return dataList; } /** * 删除问题信息 * @param questionId 问题编号,删除多个是,id用逗号分隔开 * @param model * @return */ @RequestMapping("/deleteQuestion.action") public String deleteQuestion(String questionId, Model model){ if(questionId != null){ String ids[] = questionId.split(","); for(int i=0;i dataList = questionService.find(question); //获取课程信息 List courseList = courseService.find(new Course()); //获取年级信息 model.addAttribute("grade", gradeService.find(new Grade())); //获取题型信息 model.addAttribute("type", typeService.find(new Type())); model.addAttribute("dataList", dataList); model.addAttribute("course", courseList); return "/admin/question-reg.jsp"; } /** * 添加试题信息 * @param question * @param model * @return */ @RequestMapping("/addQuesInfo.action") public String addQuesInfo(Question question, Model model){ questionService.insert(question); return "redirect:/toQuestionPage.action"; } /** * 查看问题信息 * @param questionId 问题编号 * @param model * @param session * @return */ @RequestMapping("/toQryQuestion.action") public String toQryQuestion(int questionId, Model model, HttpSession session){ Question questionInfo = questionService.get(questionId); Grade grade = gradeService.get(Integer.parseInt(questionInfo.getGradeId())); Course course = courseService.get(Integer.parseInt(questionInfo.getCourseId())); Type type = typeService.get(Integer.parseInt(questionInfo.getTypeId())); questionInfo.setGradeId(grade.getGradeName()); questionInfo.setCourseId(course.getCourseName()); questionInfo.setTypeId(type.getTypeName()); model.addAttribute("question", questionInfo); return "/admin/question-qry.jsp"; } /** * 跳转到更新题目信息页面 * @param type * @param model * @param session * @return */ @RequestMapping("/toUpdQuestion.action") public String toUpdQuestion(int questionId, Model model, HttpSession session){ Question questionInfo = questionService.get(questionId); model.addAttribute("question", questionInfo); ListgradeList = gradeService.find(new Grade()); ListcourseList = courseService.find(new Course()); List typeList = typeService.find(new Type()); model.addAttribute("gradeList", gradeList); model.addAttribute("courseList", courseList); model.addAttribute("typeList", typeList); return "/admin/question-upd.jsp"; } /** * 更新题目信息 * @param type * @param model * @param session * @return */ @RequestMapping("/updQuestion.action") public String updQuestion(Question question, Model model, HttpSession session){ questionService.update(question); return "redirect:/toQuestionPage.action"; } /** * 删除问题信息 * @param type * @param model * @param session * @return */ @RequestMapping("/delQuestion.action") public String delQuestion(int questionId, Model model, HttpSession session){ questionService.delete(questionId); return "redirect:/todelQuestionPage.action"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/admin/TypeController.java ================================================ package edu.fjnu.online.controller.admin; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Type; import edu.fjnu.online.domain.User; import edu.fjnu.online.service.TypeService; /** * 试题类型管理 * @author hspcadmin * */ @Controller public class TypeController { @Autowired TypeService typeService; @RequestMapping("/toTypePage.action") public String toTypePage(@RequestParam(value="page", defaultValue="1") int page, Type type,Model model, HttpSession session){ // List dataList = typeService.find(type); PageInfo pageInfo = typeService.findByPage(type, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return "/admin/type-mgt.jsp"; } @RequestMapping("/qryTypePage.action") @ResponseBody public List qryTypePage(@RequestParam(value="page", defaultValue="1") int page, Type type,Model model, HttpSession session){ // List dataList = typeService.find(type); PageInfo pageInfo = typeService.findByPage(type, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return dataList; } /** * 删除题型信息 * @param typeId 题型编号,删除多个是,id用逗号分隔开 * @param model * @return */ @RequestMapping("/deleteType.action") public String deleteUser(String typeId, Model model){ if(typeId != null){ String ids[] = typeId.split(","); for(int i=0;i dataList = typeService.find(type); model.addAttribute("dataList", dataList); return "/admin/type-reg.jsp"; } /** * 添加题型信息 * @param user * @param model * @return */ @RequestMapping("/addType.action") public String addType(Type type, Model model){ typeService.insert(type); return "redirect:/toTypePage.action"; } /** * 查看题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/toQryType.action") public String toQryType(int typeId, Model model, HttpSession session){ Type typeInfo = typeService.get(typeId); model.addAttribute("type", typeInfo); return "/admin/type-qry.jsp"; } /** * 跳转到更新题型信息页面 * @param type * @param model * @param session * @return */ @RequestMapping("/toUpdType.action") public String toUpdType(int typeId, Model model, HttpSession session){ Type typeInfo = typeService.get(typeId); model.addAttribute("type", typeInfo); return "/admin/type-upd.jsp"; } /** * 更新题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/updType.action") public String updType(Type type, Model model, HttpSession session){ typeService.update(type); return "redirect:/toTypePage.action"; } /** * 删除题型信息 * @param type * @param model * @param session * @return */ @RequestMapping("/delType.action") public String delType(int typeId, Model model, HttpSession session){ typeService.delete(typeId); return "redirect:/toTypePage.action"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/admin/UserController.java ================================================ package edu.fjnu.online.controller.admin; import java.lang.reflect.Method; import java.util.List; import javax.servlet.http.HttpSession; import org.apache.poi.hssf.record.UserSViewEnd; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.github.pagehelper.PageInfo; import edu.fjnu.online.controller.BaseController; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.domain.MsgItem; import edu.fjnu.online.domain.Question; import edu.fjnu.online.domain.User; import edu.fjnu.online.service.GradeService; import edu.fjnu.online.service.UserService; /** * 用户管理 * @author hspcadmin * */ @Controller public class UserController extends BaseController{ @Autowired UserService userService; @Autowired GradeService gradeService; //跳转到登录页面 @RequestMapping("/admin/login.action") public String toLoin(User user, Model model, HttpSession session){ if(session.getAttribute("userName")!= null){ return "/admin/index.jsp"; } List dataList = userService.find(user); model.addAttribute("dataList", dataList); return "/admin/login.jsp"; } @RequestMapping("/admin/userLogin.action") public String checkUser(User user, Model model, HttpSession session){ User loginUser = userService.login(user); if(session.getAttribute("userName")!= null){ return "/admin/index.jsp"; } if(loginUser!=null && loginUser.getUserType() == 2){ session.setAttribute("userName", loginUser.getUserName()); return "/admin/index.jsp"; }else{ model.addAttribute("message", "用户名或密码输入错误!!!"); return "/admin/login.jsp"; } } /** * 判断账户信息是否存在 * @param name * @param model * @return */ @RequestMapping("/admin/checkAccount.action") public String checkAccount(String userId, Model model){ User userInfo = userService.get(userId); if(userInfo!= null){ model.addAttribute("message", "该账号已经存在"); }else{ model.addAttribute("message", "验证通过"); } model.addAttribute("userId", userId); return "/admin/info-reg.jsp"; } /** * ajax验证用户账号是否存在 * @param userId * @param model * @return */ @RequestMapping("/admin/userRegist.action") @ResponseBody public MsgItem userRegist(String userId, Model model, HttpSession session){ MsgItem msgItem = new MsgItem(); User user = userService.get(userId); if(user!=null){ msgItem.setErrorNo("1"); msgItem.setErrorInfo("账号已经存在"); }else{ msgItem.setErrorNo("0"); msgItem.setErrorInfo("验证通过"); } return msgItem; } //跳转到登录页面 @RequestMapping("/admin/exitSys.action") public String exitSys(User user, Model model, HttpSession session){ if(session.getAttribute("userName")!= null){ session.removeAttribute("userName"); return "forward:/admin/login.action"; } return "/admin/login.jsp"; } //跳转到题库录入页面 @RequestMapping(value="/admin/toQueDep.action",method=RequestMethod.POST) public String toQueDep(Model model, HttpSession session){ return "/admin/info-reg.jsp"; } //获取所有的用户信息 @RequestMapping("/admin/getAllUser.action") public String getAllUserInfo(@RequestParam(value="page", defaultValue="1") int page, User user, Model model, HttpSession session){ // List dataList = userService.find(user); PageInfo pageInfo = userService.findByPage(user, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return "/admin/info-mgt.jsp"; } //获取所有的用户信息 @RequestMapping("/admin/qryAllUser.action") @ResponseBody public List qryAllUser(@RequestParam(value="page", defaultValue="1") int page, User user, Model model, HttpSession session){ // List dataList = userService.find(user); PageInfo pageInfo = userService.findByPage(user, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return dataList; } /** * 跳转到添加用户信息页面 * @param user * @param model * @param session * @return */ @RequestMapping("/admin/toAddUser.action") public String toAddUserInfo(User user, Model model, HttpSession session){ List dataList = userService.find(user); model.addAttribute("grade", gradeService.find(new Grade())); model.addAttribute("dataList", dataList); return "/admin/info-reg.jsp"; } /** * 添加用户信息 * @param user * @param model * @return */ @RequestMapping("/admin/addUser.action") public String addUser(User user, Model model){ userService.insert(user); return "redirect:/admin/getAllUser.action"; } /** * 删除用户信息 * @param userId 用户账号,删除多个是,id用逗号分隔开 * @param model * @return */ @RequestMapping("/admin/deleteUser.action") public String deleteUser(String userId, Model model){ if(userId != null){ String ids[] = userId.split(","); for(int i=0;i pageInfo = userService.findPendingByPage(user, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return "/admin/info-deal.jsp"; } //获取所有的用户信息 @RequestMapping("/admin/qryFindPending.action") @ResponseBody public List qryFindPending(@RequestParam(value="page", defaultValue="1") int page, User user, Model model, HttpSession session){ // List dataList = userService.find(user); PageInfo pageInfo = userService.findPendingByPage(user, page, 5); List dataList = pageInfo.getList(); model.addAttribute("dataList", dataList); model.addAttribute("pageInfo", pageInfo); return dataList; } /** * 用户身份信息审核(通过) * @param user * @param model * @return */ @RequestMapping("/admin/passinfo.action") public String passUserInfo(User user, Model model){ User us = new User(); if(user != null){ String ids[] = user.getUserId().split(","); for(int i=0;i errorBookList = bookService.find(new ErrorBook()); List gradeList = gradeService.find(new Grade()); List courseList = courseService.find(new Course()); List typeList = typeService.find(new Type()); Map map = new HashMap(); map.put("userId", user.getUserId()); List bookList = bookService.getBookInfo(map); model.addAttribute("grade", gradeList); model.addAttribute("course", courseList); model.addAttribute("type", typeList); model.addAttribute("errorBook", bookList); return "/user/mybooks.jsp"; } //跳转到前台登录页面 @RequestMapping("/getBooks.action") public String getBooks(User user, Model model, HttpSession session){ List gradeList = gradeService.find(new Grade()); List courseList = courseService.find(new Course()); List typeList = typeService.find(new Type()); List errorBookList = bookService.getBookInfo(new HashMap()); model.addAttribute("grade", gradeList); model.addAttribute("course", courseList); model.addAttribute("type", typeList); return "/user/mybooks.jsp"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/user/PaperMgController.java ================================================ package edu.fjnu.online.controller.user; import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLDecoder; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.ErrorBook; import edu.fjnu.online.domain.MsgItem; import edu.fjnu.online.domain.Paper; import edu.fjnu.online.domain.Question; import edu.fjnu.online.domain.User; import edu.fjnu.online.service.CourseService; import edu.fjnu.online.service.ErrorBookService; import edu.fjnu.online.service.GradeService; import edu.fjnu.online.service.PaperService; import edu.fjnu.online.service.QuestionService; import edu.fjnu.online.service.UserService; import edu.fjnu.online.util.Computeclass; /** * 试卷综合管理 * @author hspcadmin * */ @Controller public class PaperMgController { @Autowired UserService userService; @Autowired GradeService gradeService; @Autowired PaperService paperService; @Autowired CourseService courseService; @Autowired QuestionService questionService; @Autowired ErrorBookService bookService; //跳转到成绩查询页面 @RequestMapping("/toScoreQry.action") public String toScoreQry(User user, Model model, HttpSession session){ if("".equals(user.getUserId()) || user==null){ user = (User) session.getAttribute("user"); } if(session.getAttribute("user")== null){ session.setAttribute("user", userService.get(user.getUserId())); } user = userService.getStu(user); List paper = paperService.getUserPaperById(user.getUserId()); Course course = null; for(Paper p : paper){ course = courseService.get(Integer.parseInt(p.getCourseId())); p.setCourseId(course.getCourseName()); } model.addAttribute("user", user); model.addAttribute("paper", paper); return "/user/scorequery.jsp"; } /** * 查看试卷详情 * @param paperId * @param userId * @param model * @param session * @return */ @SuppressWarnings({ "rawtypes", "unchecked" }) @RequestMapping("/qrypaper.action") public String qrypaper(String paperId,String userId,Model model, HttpSession session){ Map map = new HashMap(); map.put("paperId", paperId); map.put("userId", userId); Paper paper = paperService.getPaperDetail(map); Question question = null; String []ids = paper.getQuestionId().split(","); List selList = new ArrayList(); List inpList = new ArrayList(); List desList = new ArrayList(); for(int i = 0;i0){ model.addAttribute("selectQ", "单项选择题(每题5分)"); model.addAttribute("selList", selList); } if(inpList.size()>0){ model.addAttribute("inpQ", "填空题(每题5分)"); model.addAttribute("inpList", inpList); } if(desList.size()>0){ model.addAttribute("desQ", "简答题(每题5分)"); model.addAttribute("desList", desList); } model.addAttribute("paper", paper); return "/user/qrypaper.jsp"; } /** * 自动评分 * @param paper * @param model * @param session * @return * @throws UnsupportedEncodingException */ @SuppressWarnings("unchecked") @RequestMapping("/dealPaper.action") @ResponseBody public MsgItem dealPaper(Paper paper, Model model, HttpSession session) throws UnsupportedEncodingException{ String paperId = paper.getPaperId(); //答案临时存放 String ans = paper.getScore(); ans = URLDecoder.decode(ans,"UTF-8"); String [] answer = null; if(ans.contains("&")){ answer = ans.split("&"); } Map map = new HashMap(); User user = (User) session.getAttribute("user"); map.put("paperId", paperId); map.put("userId", user.getUserId()); Paper paperInfo = paperService.getPaperDetail(map); String []ids = paperInfo.getQuestionId().split(","); List question = new ArrayList(); Question ques = null; int endScore = 0; ErrorBook book = new ErrorBook(); book.setUserId(user.getUserId()); for(int i = 1 ;i1){ //学生的答案 String str2 = str[1]; if(!"5".equals(ques.getTypeId())){//判断是否为简答题 if(str2.equals(answer1)){//如果用户答案和数据库中的答案一致 endScore+=5; }else{//插入错题本 book.setQuestion(ques); book.setCourseId(ques.getCourseId()); book.setGradeId(ques.getGradeId()); book.setUserAnswer(str2); bookService.insert(book); } } if("5".equals(ques.getTypeId())){//为简答题的时候 String strA = answer1; String strB = URLDecoder.decode(str2, "UTF-8");//转码 //计算相似 double d = Computeclass.SimilarDegree(strA, strB); BigDecimal bg = new BigDecimal(d*5).setScale(1, RoundingMode.DOWN); d = bg.doubleValue(); endScore+=d; if(d<=2){//如果小于2分,认定错误 book.setQuestion(ques); book.setCourseId(ques.getCourseId()); book.setGradeId(ques.getGradeId()); book.setUserAnswer(str2); bookService.insert(book); } } } } System.out.println("最后得分:"+endScore); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date currentTime = new Date();//得到当前系统时间 String endTime = formatter.format(currentTime); //将日期时间格式化 map.put("beginTime", paper.getBeginTime()); map.put("endTime", endTime); map.put("score", endScore); //将考试的试卷状态改为2 map.put("paperState", "2"); paperService.updateUserPaper(map); if(session.getAttribute("user")== null){ session.setAttribute("user", user); } MsgItem msgItem = new MsgItem(); msgItem.setErrorNo("1"); msgItem.setErrorInfo("试卷提交成功,本次考试得分:"+endScore +"分"); return msgItem; } /** * 考试页面 * @param paperId * @param userId * @param model * @param session * @return */ @SuppressWarnings({ "rawtypes", "unchecked" }) @RequestMapping("/qryPaperDetail.action") public String qryPaperDetail(String paperId,String userId,Model model, HttpSession session){ Map map = new HashMap(); map.put("paperId", paperId); map.put("userId", userId); Paper paper = paperService.getPaperDetail(map); Question question = null; String []ids = paper.getQuestionId().split(","); List selList = new ArrayList(); List inpList = new ArrayList(); List desList = new ArrayList(); for(int i = 0;i0){ model.addAttribute("selectQ", "单项选择题(每题5分)"); model.addAttribute("selList", selList); } if(inpList.size()>0){ model.addAttribute("inpQ", "填空题(每题5分)"); model.addAttribute("inpList", inpList); } if(desList.size()>0){ model.addAttribute("desQ", "简答题(每题5分)"); model.addAttribute("desList", desList); } model.addAttribute("paper", paper); return "/user/paperdetail.jsp"; } /** * 获取未考试试卷,并将为考试的试卷添加用户信息 * @param user * @param model * @param session * @return */ @SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping("/toMyPaperPage.action") public String toMyPaperPage(User user,Model model, HttpSession session){ if("".equals(user.getUserId()) || user.getUserId()==null){ user = (User) session.getAttribute("user"); } if(session.getAttribute("user")== null){ session.setAttribute("user", userService.get(user.getUserId())); } user = userService.getStu(user); Map map =new HashMap(); map.put("userId", user.getUserId()); //List paper = paperService.getUserPaperById(user.getUserId()); List paper1 = paperService.getUndoPaper(map); Course course = null; for(Paper p : paper1){ course = courseService.get(Integer.parseInt(p.getCourseId())); p.setUserId(user.getUserId()); p.setPaperstate("1"); paperService.insert(p); p.setCourseId(course.getCourseName()); } List paper = paperService.qryUndoPaper(map); for(Paper p : paper){ course = courseService.get(Integer.parseInt(p.getCourseId())); p.setCourseId(course.getCourseName()); } model.addAttribute("user", user); model.addAttribute("paper", paper); return "/user/mypaper.jsp"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/controller/user/StuController.java ================================================ package edu.fjnu.online.controller.user; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.domain.MsgItem; import edu.fjnu.online.domain.User; import edu.fjnu.online.service.GradeService; import edu.fjnu.online.service.UserService; import edu.fjnu.online.util.MD5Util; @Controller public class StuController { @Autowired UserService userService; @Autowired GradeService gradeService; //跳转到前台登录页面 @RequestMapping("/toLogin.action") public String toUserLogin(User user, Model model, HttpSession session){ if(session.getAttribute("userName")!= null){ return "/user/index.jsp"; } if(session.getAttribute("user")== null){ session.setAttribute("user", userService.get(user.getUserId())); } List dataList = userService.find(user); model.addAttribute("dataList", dataList); return "/user/login.jsp"; } /** * 前台用户登录 * @param user * @param model * @param session * @return */ @RequestMapping("/user/toIndex.action") public String toIndex(User user, Model model, HttpSession session){ if(session.getAttribute("userName")!= null){ return "/user/index.jsp"; }else{ return "forward:/toLogin.action"; } } /** * 用户账号密码检查 * @param user * @param model * @param session * @return */ @RequestMapping("/checkPwd.action") @ResponseBody public MsgItem checkPwd(User user, Model model, HttpSession session){ MsgItem item = new MsgItem(); User loginUser = userService.login(user); if(loginUser!=null && loginUser.getUserType() ==0){ if(loginUser.getUserState()==0 ){ item.setErrorNo("1"); item.setErrorInfo("该账号尚未通过审核!"); }else{ item.setErrorNo("0"); item.setErrorInfo("登录成功!"); session.setAttribute("userName", loginUser.getUserName()); session.setAttribute("user", loginUser); } }else{ item.setErrorNo("1"); item.setErrorInfo("账号不存在或用户名密码错误!"); } return item; } @RequestMapping("/toRegistPage.action") public String toRegistPage(Model model, HttpSession session){ List list = gradeService.find(new Grade()); model.addAttribute("grade", list); return "/user/regist.jsp"; } /** * 添加用户信息 * @param user * @param model * @return */ @RequestMapping("/addUserInfo.action") public String addUserInfo(User user, Model model, HttpSession session){ userService.insert(user); return "redirect:/toLogin.action"; } //跳转到前台登录页面 @RequestMapping("/toUserInfo.action") public String toUserInfo(User user, Model model, HttpSession session){ User loginUser = (User) session.getAttribute("user"); user = userService.getStu(loginUser); Grade grade = gradeService.get(Integer.parseInt(user.getGrade())); user.setGrade(grade.getGradeName()); model.addAttribute("user", user); return "/user/userinfo.jsp"; } /** * 更新学生信息 * @param user * @param model * @param session * @return */ @RequestMapping("/updateUserInfo.action") public String updateUserInfo(String newPwd,User user, Model model, HttpSession session){ if(newPwd!= null && newPwd.trim().length()>0){ user.setUserPwd(newPwd); } userService.update(user); user = userService.get(user.getUserId()); if(session.getAttribute("user")== null){ session.setAttribute("user", userService.getStu(user)); } return "redirect:/user/toIndex.action"; } //跳转到登录页面 @RequestMapping("/user/exitSys.action") public String exitSystem(User user, Model model, HttpSession session){ if(session.getAttribute("userName")!= null){ session.removeAttribute("userName"); return "/user/login.jsp"; } return "/user/login.jsp"; } //跳转到前台登录页面 @RequestMapping("/toAbout.action") public String toAbout(User user, Model model, HttpSession session){ User loginUser = (User) session.getAttribute("user"); model.addAttribute("user", loginUser); return "/user/about.jsp"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/BaseDao.java ================================================ package edu.fjnu.online.dao; import java.io.Serializable; import java.util.List; /** * @Description: 泛型类,基础的DAO接口 * @CreateDate: 2017-3-11 */ public interface BaseDao { public List find(T entity); public T get(Serializable id); public void insert(T entity); public void update(T entity); public void delete(Serializable id); public void delete(Serializable[] ids); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/CourseDao.java ================================================ package edu.fjnu.online.dao; import edu.fjnu.online.domain.Course; public interface CourseDao extends BaseDao{ } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/ErrorBookDao.java ================================================ package edu.fjnu.online.dao; import java.util.List; import java.util.Map; import edu.fjnu.online.domain.ErrorBook; import edu.fjnu.online.domain.Question; public interface ErrorBookDao extends BaseDao{ public List getBookInfo(Map map); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/GradeDao.java ================================================ package edu.fjnu.online.dao; import edu.fjnu.online.domain.Grade; public interface GradeDao extends BaseDao{ } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/PaperDao.java ================================================ package edu.fjnu.online.dao; import java.io.Serializable; import java.util.List; import java.util.Map; import edu.fjnu.online.domain.Paper; public interface PaperDao extends BaseDao { /** * 通过学生编号获取所有的试卷 * @param id * @return */ public List getUserPaperById(Serializable id); /**查看试卷详情*/ public Paper getPaperDetail(Map map); /**更新用户试卷信息*/ public void updateUserPaper(Map map); /**查询未考试的试卷*/ public List getUndoPaper(Map map); /**查询学生未考试的试卷*/ public List qryUndoPaper(Map map); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/QuestionDao.java ================================================ package edu.fjnu.online.dao; import java.util.List; import java.util.Map; import edu.fjnu.online.domain.Question; public interface QuestionDao extends BaseDao{ public List createPaper(Map map); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/TypeDao.java ================================================ package edu.fjnu.online.dao; import edu.fjnu.online.domain.Type; public interface TypeDao extends BaseDao { } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/UserDao.java ================================================ package edu.fjnu.online.dao; import java.util.List; import edu.fjnu.online.domain.User; public interface UserDao extends BaseDao{ public List findPending(User user); public User getStu(User user); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/BaseDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import java.util.List; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.support.SqlSessionDaoSupport; import org.springframework.beans.factory.annotation.Autowired; import edu.fjnu.online.dao.BaseDao; public abstract class BaseDaoImpl extends SqlSessionDaoSupport implements BaseDao{ @Autowired //mybatis-spring 1.0无需此方法;mybatis-spring1.2必须注入。 public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory){ super.setSqlSessionFactory(sqlSessionFactory); } private String ns; //命名空间 public String getNs() { return ns; } public void setNs(String ns) { this.ns = ns; } public List find(T entiy) { List oList = this.getSqlSession().selectList(ns + "find", entiy); return oList; } public T get(Serializable id) { return this.getSqlSession().selectOne(ns + "get", id); } public void insert(T entity) { this.getSqlSession().insert(ns + "insert", entity); } public void update(T entity) { this.getSqlSession().update(ns + "update", entity); } public void delete(Serializable id) { this.getSqlSession().delete(ns + "delete", id); } public void delete(Serializable[] ids) { this.getSqlSession().delete(ns + "deleteBatch", ids); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/CourseDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.CourseDao; import edu.fjnu.online.domain.Course; @Repository public class CourseDaoImpl extends BaseDaoImpl implements CourseDao { public CourseDaoImpl() { this.setNs("edu.fjnu.online.mapper.CourseMapper."); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/ErrorBookDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.ErrorBookDao; import edu.fjnu.online.domain.ErrorBook; @Repository public class ErrorBookDaoImpl extends BaseDaoImpl implements ErrorBookDao { public ErrorBookDaoImpl() { this.setNs("edu.fjnu.online.mapper.ErrorBookMapper."); } public List getBookInfo(Map map) { return this.getSqlSession().selectList(this.getNs()+"getBookInfo", map); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/GradeDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.GradeDao; import edu.fjnu.online.domain.Grade; @Repository public class GradeDaoImpl extends BaseDaoImpl implements GradeDao{ public GradeDaoImpl() { this.setNs("edu.fjnu.online.mapper.GradeMapper."); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/PaperDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.PaperDao; import edu.fjnu.online.domain.Paper; @Repository public class PaperDaoImpl extends BaseDaoImpl implements PaperDao{ public PaperDaoImpl() { this.setNs("edu.fjnu.online.mapper.PaperMapper."); } public List getUserPaperById(Serializable id) { return this.getSqlSession().selectList(this.getNs()+"getUserPaperById", id); } public Paper getPaperDetail(Map map) { // TODO Auto-generated method stub return this.getSqlSession().selectOne(this.getNs()+"getPaperDetail", map); } public void updateUserPaper(Map map) { // TODO Auto-generated method stub this.getSqlSession().selectOne(this.getNs()+"updateUserPaper", map); } public List getUndoPaper(Map map) { // TODO Auto-generated method stub return this.getSqlSession().selectList(this.getNs()+"getUndoPaper", map); } public List qryUndoPaper(Map map) { // TODO Auto-generated method stub return this.getSqlSession().selectList(this.getNs()+"qryUndoPaper", map); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/QuestionDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.QuestionDao; import edu.fjnu.online.domain.Question; @Repository public class QuestionDaoImpl extends BaseDaoImpl< Question> implements QuestionDao { public QuestionDaoImpl() { this.setNs("edu.fjnu.online.mapper.QuestionMapper."); } public List createPaper(Map map) { return this.getSqlSession().selectList(this.getNs()+"createPaper", map); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/TypeDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.TypeDao; import edu.fjnu.online.domain.Type; @Repository public class TypeDaoImpl extends BaseDaoImpl implements TypeDao{ public TypeDaoImpl() { this.setNs("edu.fjnu.online.mapper.TypeMapper."); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/dao/impl/UserDaoImpl.java ================================================ package edu.fjnu.online.dao.impl; import java.io.Serializable; import java.util.List; import org.springframework.stereotype.Repository; import edu.fjnu.online.dao.UserDao; import edu.fjnu.online.domain.User; @Repository public class UserDaoImpl extends BaseDaoImpl implements UserDao{ public UserDaoImpl() { this.setNs("edu.fjnu.online.mapper.UserMapper."); //设置命名空间 } public List findPending(User user) { return this.getSqlSession().selectList(this.getNs()+"findPending",user); } public User getStu(User user) { return this.getSqlSession().selectOne(this.getNs()+"getStu",user); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Course.java ================================================ package edu.fjnu.online.domain; /** * 课程表 * @author hspcadmin * */ public class Course { /**课程编号*/ private int courseId; /**课程名称*/ private String courseName; /**课程状态*/ private String courseState; public int getCourseId() { return courseId; } public void setCourseId(int courseId) { this.courseId = courseId; } public String getCourseName() { return courseName; } public void setCourseName(String courseName) { this.courseName = courseName; } public String getCourseState() { return courseState; } public void setCourseState(String courseState) { this.courseState = courseState; } public Course() { super(); // TODO Auto-generated constructor stub } public Course(int courseId, String courseName, String courseState) { super(); this.courseId = courseId; this.courseName = courseName; this.courseState = courseState; } @Override public String toString() { return "Course [courseId=" + courseId + ", courseName=" + courseName + ", courseState=" + courseState + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/ErrorBook.java ================================================ package edu.fjnu.online.domain; /** * 错题本 * @author hspcadmin * */ public class ErrorBook { /**错题编号*/ private int bookId; /**用户编号*/ private String userId; /**科目编号*/ private String courseId; /**年级编号*/ private String gradeId; /**学生答案*/ private String userAnswer; /**问题编号*/ private Question question; /**题型编号*/ private String typeId; public int getBookId() { return bookId; } public void setBookId(int bookId) { this.bookId = bookId; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getCourseId() { return courseId; } public void setCourseId(String courseId) { this.courseId = courseId; } public String getGradeId() { return gradeId; } public void setGradeId(String gradeId) { this.gradeId = gradeId; } public String getUserAnswer() { return userAnswer; } public void setUserAnswer(String userAnswer) { this.userAnswer = userAnswer; } public String getTypeId() { return typeId; } public void setTypeId(String typeId) { this.typeId = typeId; } public Question getQuestion() { return question; } public void setQuestion(Question question) { this.question = question; } public ErrorBook() { super(); // TODO Auto-generated constructor stub } public ErrorBook(int bookId, String userId, String courseId, String gradeId, String userAnswer, Question question, String typeId) { super(); this.bookId = bookId; this.userId = userId; this.courseId = courseId; this.gradeId = gradeId; this.userAnswer = userAnswer; this.question = question; this.typeId = typeId; } @Override public String toString() { return "ErrorBook [bookId=" + bookId + ", userId=" + userId + ", courseId=" + courseId + ", gradeId=" + gradeId + ", userAnswer=" + userAnswer + ", question=" + question + ", typeId=" + typeId + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Factory.java ================================================ package edu.fjnu.online.domain; /** * @Description: * @Author: nutony * @Company: http://java.itcast.cn * @CreateDate: 2014-3-12 */ public class Factory { private String id; private String fullName; private String factoryName; private String contractor; private String phone; private String mobile; private String fax; private String cnote; public String getCnote() { return cnote; } public void setCnote(String cnote) { this.cnote = cnote; } private Integer orderNo; private Integer state; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public String getFactoryName() { return factoryName; } public void setFactoryName(String factoryName) { this.factoryName = factoryName; } public String getContractor() { return contractor; } public void setContractor(String contractor) { this.contractor = contractor; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public Integer getOrderNo() { return orderNo; } public void setOrderNo(Integer orderNo) { this.orderNo = orderNo; } public Integer getState() { return state; } public void setState(Integer state) { this.state = state; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Grade.java ================================================ package edu.fjnu.online.domain; /** * 年级 * @author hspcadmin * */ public class Grade { /**年级编号*/ private int gradeId; /**年级名称*/ private String gradeName; /**包含课程*/ private String courseId; public int getGradeId() { return gradeId; } public void setGradeId(int gradeId) { this.gradeId = gradeId; } public String getGradeName() { return gradeName; } public void setGradeName(String gradeName) { this.gradeName = gradeName; } public String getCourseId() { return courseId; } public void setCourseId(String courseId) { this.courseId = courseId; } public Grade() { super(); // TODO Auto-generated constructor stub } public Grade(int gradeId, String gradeName, String courseId) { super(); this.gradeId = gradeId; this.gradeName = gradeName; this.courseId = courseId; } @Override public String toString() { return "Grade [gradeId=" + gradeId + ", gradeName=" + gradeName + ", courseId=" + courseId + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/MsgItem.java ================================================ package edu.fjnu.online.domain; public class MsgItem { private String remark; private String errorNo; private String errorInfo; public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getErrorNo() { return errorNo; } public void setErrorNo(String errorNo) { this.errorNo = errorNo; } public String getErrorInfo() { return errorInfo; } public void setErrorInfo(String errorInfo) { this.errorInfo = errorInfo; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Paper.java ================================================ package edu.fjnu.online.domain; /** * 试卷实体 * @author hspcadmin * */ public class Paper { /**试卷编号*/ private String paperId; /**试卷名称*/ private String paperName; /**对应课程*/ private String courseId; /**适合年级*/ private String gradeId; /**学生编号*/ private String userId; /**问题编号*/ private String questionId; /**开始时间*/ private String beginTime; /**结束时间*/ private String endTime; /**允许时长*/ private String allowTime; /**分数*/ private String score; /**试卷状态 0:准备考试1:尚未开始2:已完成*/ private String paperState; public Paper() { } public Paper(String paperId, String paperName, String courseId, String gradeId, String userId, String questionId, String beginTime, String endTime, String allowTime, String score, String paperState) { super(); this.paperId = paperId; this.paperName = paperName; this.courseId = courseId; this.gradeId = gradeId; this.userId = userId; this.questionId = questionId; this.beginTime = beginTime; this.endTime = endTime; this.allowTime = allowTime; this.score = score; this.paperState = paperState; } public String getPaperId() { return paperId; } public void setPaperId(String paperId) { this.paperId = paperId; } public String getPaperName() { return paperName; } public void setPaperName(String paperName) { this.paperName = paperName; } public String getCourseId() { return courseId; } public void setCourseId(String courseId) { this.courseId = courseId; } public String getGradeId() { return gradeId; } public void setGradeId(String gradeId) { this.gradeId = gradeId; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getQuestionId() { return questionId; } public void setQuestionId(String questionId) { this.questionId = questionId; } public String getBeginTime() { return beginTime; } public void setBeginTime(String beginTime) { this.beginTime = beginTime; } public String getEndTime() { return endTime; } public void setEndTime(String endTime) { this.endTime = endTime; } public String getAllowTime() { return allowTime; } public void setAllowTime(String allowTime) { this.allowTime = allowTime; } public String getScore() { return score; } public void setScore(String score) { this.score = score; } public String getPaperstate() { return paperState; } public void setPaperstate(String paperstate) { this.paperState = paperstate; } @Override public String toString() { return "Paper [paperId=" + paperId + ", paperName=" + paperName + ", courseId=" + courseId + ", gradeId=" + gradeId + ", userId=" + userId + ", questionId=" + questionId + ", beginTime=" + beginTime + ", endTime=" + endTime + ", allowTime=" + allowTime + ", score=" + score + ", paperstate=" + paperState + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Question.java ================================================ package edu.fjnu.online.domain; public class Question { /**问题编号*/ private int questionId; /**问题名称*/ private String quesName; /**选项A*/ private String optionA; /**选项B*/ private String optionB; /**选项C*/ private String optionC; /**选项D*/ private String optionD; /**标准答案*/ private String answer; /**学生答案*/ private String userAnswer; /**对应课程*/ private String courseId; /**题型*/ private String typeId; /**难度(0:容易,1:中等,2:难)*/ private int difficulty; /**备注*/ private String remark; private String answerDetail; private String gradeId; public int getQuestionId() { return questionId; } public void setQuestionId(int questionId) { this.questionId = questionId; } public String getQuesName() { return quesName; } public void setQuesName(String quesName) { this.quesName = quesName; } public String getOptionA() { return optionA; } public void setOptionA(String optionA) { this.optionA = optionA; } public String getOptionB() { return optionB; } public void setOptionB(String optionB) { this.optionB = optionB; } public String getOptionC() { return optionC; } public void setOptionC(String optionC) { this.optionC = optionC; } public String getOptionD() { return optionD; } public void setOptionD(String optionD) { this.optionD = optionD; } public String getAnswer() { return answer; } public void setAnswer(String answer) { this.answer = answer; } public String getUserAnswer() { return userAnswer; } public void setUserAnswer(String userAnswer) { this.userAnswer = userAnswer; } public String getCourseId() { return courseId; } public void setCourseId(String courseId) { this.courseId = courseId; } public String getTypeId() { return typeId; } public void setTypeId(String typeId) { this.typeId = typeId; } public int getDifficulty() { return difficulty; } public void setDifficulty(int difficulty) { this.difficulty = difficulty; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public String getAnswerDetail() { return answerDetail; } public void setAnswerDetail(String answerDetail) { this.answerDetail = answerDetail; } public String getGradeId() { return gradeId; } public void setGradeId(String gradeId) { this.gradeId = gradeId; } public Question() { } public Question(int questionId, String quesName, String optionA, String optionB, String optionC, String optionD, String answer, String userAnswer, String courseId, String typeId, int difficulty, String remark, String answerDetail, String gradeId) { super(); this.questionId = questionId; this.quesName = quesName; this.optionA = optionA; this.optionB = optionB; this.optionC = optionC; this.optionD = optionD; this.answer = answer; this.userAnswer = userAnswer; this.courseId = courseId; this.typeId = typeId; this.difficulty = difficulty; this.remark = remark; this.answerDetail = answerDetail; this.gradeId = gradeId; } @Override public String toString() { return "Question [questionId=" + questionId + ", quesName=" + quesName + ", optionA=" + optionA + ", optionB=" + optionB + ", optionC=" + optionC + ", optionD=" + optionD + ", answer=" + answer + ", userAnswer=" + userAnswer + ", courseId=" + courseId + ", typeId=" + typeId + ", difficulty=" + difficulty + ", remark=" + remark + ", answerDetail=" + answerDetail + ", gradeId=" + gradeId + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/Type.java ================================================ package edu.fjnu.online.domain; /** * 题目类型 * @author hspcadmin * */ public class Type { /**题型编号*/ private int typeId; /**题型名称*/ private String typeName; /**分值*/ private int score; /**备注*/ private String remark; public int getTypeId() { return typeId; } public void setTypeId(int typeId) { this.typeId = typeId; } public String getTypeName() { return typeName; } public void setTypeName(String typeName) { this.typeName = typeName; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Type() { } public Type(int typeId, String typeName, int score, String remark) { super(); this.typeId = typeId; this.typeName = typeName; this.score = score; this.remark = remark; } @Override public String toString() { return "Type [typeId=" + typeId + ", typeName=" + typeName + ", score=" + score + ", remark=" + remark + "]"; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/domain/User.java ================================================ /** * */ package edu.fjnu.online.domain; /** * 用户表 * @author hspcadmin * @CreateDate: 2017-3-11 */ public class User { /**用户账号*/ private String userId; /**用户昵称*/ private String userName; /**用户密码*/ private String userPwd; /**年级*/ private String grade; /**账户类型(0:学生,1:老师,2:管理员)*/ private int userType; /**账户状态(0:待审核,1:在用,2:注销)*/ private int userState; /**邮箱*/ private String email; /**联系电话*/ private String telephone; /**联系地址*/ private String address; /**备注*/ private String remark; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPwd() { return userPwd; } public void setUserPwd(String userPwd) { this.userPwd = userPwd; } public String getGrade() { return grade; } public void setGrade(String grade) { this.grade = grade; } public int getUserType() { return userType; } public void setUserType(int userType) { this.userType = userType; } public int getUserState() { return userState; } public void setUserState(int userState) { this.userState = userState; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public User() { } public User(String userId, String userName, String userPwd, String grade, int userType, int userState, String email, String telephone, String address, String remark) { super(); this.userId = userId; this.userName = userName; this.userPwd = userPwd; this.grade = grade; this.userType = userType; this.userState = userState; this.email = email; this.telephone = telephone; this.address = address; this.remark = remark; } @Override public String toString() { return super.toString(); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/pagination/Page.java ================================================ package edu.fjnu.online.pagination; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 对分页的基本数据进行一个简单的封装 */ public class Page { private int pageNo = 1; //页码,默认是第一页 private int pageSize = 10; //每页显示的记录数,默认是10 private int totalRecord; //总记录数 private int totalPage; //总页数 private List results; //对应的当前页记录 private Map params = new HashMap(); //其他的参数我们把它分装成一个Map对象 public int getPageNo() { return pageNo; } public void setPageNo(int pageNo) { this.pageNo = pageNo; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public int getTotalRecord() { return totalRecord; } public void setTotalRecord(int totalRecord) { this.totalRecord = totalRecord; //在设置总页数的时候计算出对应的总页数,在下面的三目运算中加法拥有更高的优先级,所以最后可以不加括号。 int totalPage = totalRecord%pageSize==0 ? totalRecord/pageSize : totalRecord/pageSize + 1; this.setTotalPage(totalPage); } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public List getResults() { return results; } public void setResults(List results) { this.results = results; } public Map getParams() { return params; } public void setParams(Map params) { this.params = params; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Page [pageNo=").append(pageNo).append(", pageSize=").append(pageSize).append(", results=").append(results).append(", totalPage=").append(totalPage).append(", totalRecord=").append(totalRecord).append("]"); return builder.toString(); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/pagination/PageInterceptor.java ================================================ package edu.fjnu.online.pagination; import java.lang.reflect.Field; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.Properties; import org.apache.ibatis.executor.parameter.ParameterHandler; import org.apache.ibatis.executor.statement.RoutingStatementHandler; import org.apache.ibatis.executor.statement.StatementHandler; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.ParameterMapping; import org.apache.ibatis.plugin.Interceptor; import org.apache.ibatis.plugin.Intercepts; import org.apache.ibatis.plugin.Invocation; import org.apache.ibatis.plugin.Plugin; import org.apache.ibatis.plugin.Signature; import org.apache.ibatis.scripting.defaults.DefaultParameterHandler; /** * * 分页拦截器,用于拦截需要进行分页查询的操作,然后对其进行分页处理。 * 利用拦截器实现Mybatis分页的原理: * 要利用JDBC对数据库进行操作就必须要有一个对应的Statement对象,Mybatis在执行Sql语句前就会产生一个包含Sql语句的Statement对象,而且对应的Sql语句 * 是在Statement之前产生的,所以我们就可以在它生成Statement之前对用来生成Statement的Sql语句下手。在Mybatis中Statement语句是通过RoutingStatementHandler对象的 * prepare方法生成的。所以利用拦截器实现Mybatis分页的一个思路就是拦截StatementHandler接口的prepare方法,然后在拦截器方法中把Sql语句改成对应的分页查询Sql语句,之后再调用 * StatementHandler对象的prepare方法,即调用invocation.proceed()。 * 对于分页而言,在拦截器里面我们还需要做的一个操作就是统计满足当前条件的记录一共有多少,这是通过获取到了原始的Sql语句后,把它改为对应的统计语句再利用Mybatis封装好的参数和设 * 置参数的功能把Sql语句中的参数进行替换,之后再执行查询记录数的Sql语句进行总记录数的统计。 * */ @Intercepts( { @Signature(method = "prepare", type = StatementHandler.class, args = {Connection.class}) }) public class PageInterceptor implements Interceptor { private String databaseType;//数据库类型,不同的数据库有不同的分页方法 /** * 拦截后要执行的方法 */ public Object intercept(Invocation invocation) throws Throwable { //对于StatementHandler其实只有两个实现类,一个是RoutingStatementHandler,另一个是抽象类BaseStatementHandler, //BaseStatementHandler有三个子类,分别是SimpleStatementHandler,PreparedStatementHandler和CallableStatementHandler, //SimpleStatementHandler是用于处理Statement的,PreparedStatementHandler是处理PreparedStatement的,而CallableStatementHandler是 //处理CallableStatement的。Mybatis在进行Sql语句处理的时候都是建立的RoutingStatementHandler,而在RoutingStatementHandler里面拥有一个 //StatementHandler类型的delegate属性,RoutingStatementHandler会依据Statement的不同建立对应的BaseStatementHandler,即SimpleStatementHandler、 //PreparedStatementHandler或CallableStatementHandler,在RoutingStatementHandler里面所有StatementHandler接口方法的实现都是调用的delegate对应的方法。 //我们在PageInterceptor类上已经用@Signature标记了该Interceptor只拦截StatementHandler接口的prepare方法,又因为Mybatis只有在建立RoutingStatementHandler的时候 //是通过Interceptor的plugin方法进行包裹的,所以我们这里拦截到的目标对象肯定是RoutingStatementHandler对象。 RoutingStatementHandler handler = (RoutingStatementHandler) invocation.getTarget(); //通过反射获取到当前RoutingStatementHandler对象的delegate属性 StatementHandler delegate = (StatementHandler)ReflectUtil.getFieldValue(handler, "delegate"); //获取到当前StatementHandler的 boundSql,这里不管是调用handler.getBoundSql()还是直接调用delegate.getBoundSql()结果是一样的,因为之前已经说过了 //RoutingStatementHandler实现的所有StatementHandler接口方法里面都是调用的delegate对应的方法。 BoundSql boundSql = delegate.getBoundSql(); //拿到当前绑定Sql的参数对象,就是我们在调用对应的Mapper映射语句时所传入的参数对象 Object obj = boundSql.getParameterObject(); //这里我们简单的通过传入的是Page对象就认定它是需要进行分页操作的。 if (obj instanceof Page) { Page page = (Page) obj; //通过反射获取delegate父类BaseStatementHandler的mappedStatement属性 MappedStatement mappedStatement = (MappedStatement)ReflectUtil.getFieldValue(delegate, "mappedStatement"); //拦截到的prepare方法参数是一个Connection对象 Connection connection = (Connection)invocation.getArgs()[0]; //获取当前要执行的Sql语句,也就是我们直接在Mapper映射语句中写的Sql语句 String sql = boundSql.getSql(); //给当前的page参数对象设置总记录数 this.setTotalRecord(page, mappedStatement, connection); //获取分页Sql语句 String pageSql = this.getPageSql(page, sql); //利用反射设置当前BoundSql对应的sql属性为我们建立好的分页Sql语句 ReflectUtil.setFieldValue(boundSql, "sql", pageSql); } return invocation.proceed(); } /** * 拦截器对应的封装原始对象的方法 */ public Object plugin(Object target) { return Plugin.wrap(target, this); } /** * 设置注册拦截器时设定的属性 */ public void setProperties(Properties properties) { this.databaseType = properties.getProperty("databaseType"); } /** * 根据page对象获取对应的分页查询Sql语句,这里只做了两种数据库类型,Mysql和Oracle * 其它的数据库都 没有进行分页 * * @param page 分页对象 * @param sql 原sql语句 * @return */ private String getPageSql(Page page, String sql) { StringBuffer sqlBuffer = new StringBuffer(sql); if ("mysql".equalsIgnoreCase(databaseType)) { return getMysqlPageSql(page, sqlBuffer); } else if ("oracle".equalsIgnoreCase(databaseType)) { return getOraclePageSql(page, sqlBuffer); } return sqlBuffer.toString(); } /** * 获取Mysql数据库的分页查询语句 * @param page 分页对象 * @param sqlBuffer 包含原sql语句的StringBuffer对象 * @return Mysql数据库分页语句 */ private String getMysqlPageSql(Page page, StringBuffer sqlBuffer) { //计算第一条记录的位置,Mysql中记录的位置是从0开始的。 int offset = (page.getPageNo() - 1) * page.getPageSize(); sqlBuffer.append(" limit ").append(offset).append(",").append(page.getPageSize()); return sqlBuffer.toString(); } /** * 获取Oracle数据库的分页查询语句 * @param page 分页对象 * @param sqlBuffer 包含原sql语句的StringBuffer对象 * @return Oracle数据库的分页查询语句 */ private String getOraclePageSql(Page page, StringBuffer sqlBuffer) { //计算第一条记录的位置,Oracle分页是通过rownum进行的,而rownum是从1开始的 int offset = (page.getPageNo() - 1) * page.getPageSize() + 1; sqlBuffer.insert(0, "select u.*, rownum r from (").append(") u where rownum < ").append(offset + page.getPageSize()); sqlBuffer.insert(0, "select * from (").append(") where r >= ").append(offset); //上面的Sql语句拼接之后大概是这个样子: //select * from (select u.*, rownum r from (select * from t_user) u where rownum < 31) where r >= 16 return sqlBuffer.toString(); } /** * 给当前的参数对象page设置总记录数 * * @param page Mapper映射语句对应的参数对象 * @param mappedStatement Mapper映射语句 * @param connection 当前的数据库连接 */ private void setTotalRecord(Page page, MappedStatement mappedStatement, Connection connection) { //获取对应的BoundSql,这个BoundSql其实跟我们利用StatementHandler获取到的BoundSql是同一个对象。 //delegate里面的boundSql也是通过mappedStatement.getBoundSql(paramObj)方法获取到的。 BoundSql boundSql = mappedStatement.getBoundSql(page); //获取到我们自己写在Mapper映射语句中对应的Sql语句 String sql = boundSql.getSql(); //通过查询Sql语句获取到对应的计算总记录数的sql语句 String countSql = this.getCountSql(sql); //通过BoundSql获取对应的参数映射 List parameterMappings = boundSql.getParameterMappings(); //利用Configuration、查询记录数的Sql语句countSql、参数映射关系parameterMappings和参数对象page建立查询记录数对应的BoundSql对象。 BoundSql countBoundSql = new BoundSql(mappedStatement.getConfiguration(), countSql, parameterMappings, page); //通过mappedStatement、参数对象page和BoundSql对象countBoundSql建立一个用于设定参数的ParameterHandler对象 ParameterHandler parameterHandler = new DefaultParameterHandler(mappedStatement, page, countBoundSql); //通过connection建立一个countSql对应的PreparedStatement对象。 PreparedStatement pstmt = null; ResultSet rs = null; try { pstmt = connection.prepareStatement(countSql); //通过parameterHandler给PreparedStatement对象设置参数 parameterHandler.setParameters(pstmt); //之后就是执行获取总记录数的Sql语句和获取结果了。 rs = pstmt.executeQuery(); if (rs.next()) { int totalRecord = rs.getInt(1); //给当前的参数page对象设置总记录数 page.setTotalRecord(totalRecord); } } catch (SQLException e) { e.printStackTrace(); } finally { try { if (rs != null) rs.close(); if (pstmt != null) pstmt.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * 根据原Sql语句获取对应的查询总记录数的Sql语句 * @param sql * @return */ private String getCountSql(String sql) { int index = sql.indexOf("from"); return "select count(*) " + sql.substring(index); } /** * 利用反射进行操作的一个工具类 * */ private static class ReflectUtil { /** * 利用反射获取指定对象的指定属性 * @param obj 目标对象 * @param fieldName 目标属性 * @return 目标属性的值 */ public static Object getFieldValue(Object obj, String fieldName) { Object result = null; Field field = ReflectUtil.getField(obj, fieldName); if (field != null) { field.setAccessible(true); try { result = field.get(obj); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return result; } /** * 利用反射获取指定对象里面的指定属性 * @param obj 目标对象 * @param fieldName 目标属性 * @return 目标字段 */ private static Field getField(Object obj, String fieldName) { Field field = null; for (Class clazz=obj.getClass(); clazz != Object.class; clazz=clazz.getSuperclass()) { try { field = clazz.getDeclaredField(fieldName); break; } catch (NoSuchFieldException e) { //这里不用做处理,子类没有该字段可能对应的父类有,都没有就返回null。 } } return field; } /** * 利用反射设置指定对象的指定属性为指定的值 * @param obj 目标对象 * @param fieldName 目标属性 * @param fieldValue 目标值 */ public static void setFieldValue(Object obj, String fieldName, String fieldValue) { Field field = ReflectUtil.getField(obj, fieldName); if (field != null) { try { field.setAccessible(true); field.set(obj, fieldValue); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } } } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/CourseService.java ================================================ package edu.fjnu.online.service; import java.util.List; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Grade; public interface CourseService { public List find(Course course); public Course get(int id); public void insert(Course course); public void update(Course course); public void delete(int id); public PageInfo findByPage(Course course, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/ErrorBookService.java ================================================ package edu.fjnu.online.service; import java.util.List; import java.util.Map; import edu.fjnu.online.domain.ErrorBook; public interface ErrorBookService { public List find(ErrorBook errorBook); public ErrorBook get(int id); public void insert(ErrorBook errorBook); public void update(ErrorBook errorBook); public void delete(int id); public List getBookInfo(Map map); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/GradeService.java ================================================ package edu.fjnu.online.service; import java.util.List; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.domain.Question; public interface GradeService { public List find(Grade grade); public Grade get(int id); public void insert(Grade grade); public void update(Grade grade); public void delete(int id); public PageInfo findByPage(Grade grade, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/PaperService.java ================================================ package edu.fjnu.online.service; import java.io.Serializable; import java.util.List; import java.util.Map; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Paper; import edu.fjnu.online.domain.Question; public interface PaperService { public List find(Paper paper); public Paper get(Serializable id); public void insert(Paper paper); public void update(Paper paper); public void delete(Serializable id); public void delete(Serializable[] ids); /**通过学生编号获取所有的试卷*/ public List getUserPaperById(Serializable id); /**查看试卷详情*/ public Paper getPaperDetail(Map map); /**更新用户试卷信息*/ public void updateUserPaper(Map map); /**查询未考试的试卷*/ public List getUndoPaper(Map map); /**查询学生未考试的试卷*/ public List qryUndoPaper(Map map); public PageInfo findAllPage(Paper paper, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/QuestionService.java ================================================ package edu.fjnu.online.service; import java.util.List; import java.util.Map; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Question; public interface QuestionService { public List find(Question question); public Question get(int id); public void insert(Question question); public void update(Question question); public void delete(int id); public List createPaper(Map map); public PageInfo findByPage(Question question, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/TypeService.java ================================================ package edu.fjnu.online.service; import java.util.List; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Type; public interface TypeService { public List find(Type type); public Type get(int id); public void insert(Type type); public void update(Type type); public void delete(int id); public PageInfo findByPage(Type type, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/UserService.java ================================================ package edu.fjnu.online.service; import java.io.Serializable; import java.util.List; import com.github.pagehelper.PageInfo; import edu.fjnu.online.domain.Question; import edu.fjnu.online.domain.User; public interface UserService { public List find(User user); /**查询所有待审核记录*/ public List findPending(User user); public User get(Serializable id); public void insert(User user); public void update(User user); public void delete(Serializable id); public void delete(Serializable[] ids); public User login(User user); /**查询学生信息*/ public User getStu(User user); /**分页查询学生信息*/ public PageInfo findByPage(User user, Integer pageNo,Integer pageSize); /**分页查询待审核记录*/ public PageInfo findPendingByPage(User user, Integer pageNo,Integer pageSize); } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/CourseServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.CourseDao; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.service.CourseService; @Service public class CourseServiceImpl implements CourseService { @Autowired CourseDao courseDao; public List find(Course course) { return courseDao.find(course); } public Course get(int id) { return courseDao.get(id); } public void insert(Course course) { courseDao.insert(course); } public void update(Course course) { courseDao.update(course); } public void delete(int id) { courseDao.delete(id); } public PageInfo findByPage(Course course, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = courseDao.find(course); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/ErrorBookServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import edu.fjnu.online.dao.ErrorBookDao; import edu.fjnu.online.domain.ErrorBook; import edu.fjnu.online.service.ErrorBookService; @Service public class ErrorBookServiceImpl implements ErrorBookService { @Autowired ErrorBookDao bookDao; public List find(ErrorBook errorBook) { return bookDao.find(errorBook); } public ErrorBook get(int id) { return bookDao.get(id); } public void insert(ErrorBook errorBook) { bookDao.insert(errorBook); } public void update(ErrorBook errorBook) { bookDao.update(errorBook); } public void delete(int id) { bookDao.delete(id); } public List getBookInfo(Map map) { return bookDao.getBookInfo(map); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/GradeServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.GradeDao; import edu.fjnu.online.domain.Grade; import edu.fjnu.online.domain.Paper; import edu.fjnu.online.service.GradeService; @Service public class GradeServiceImpl implements GradeService{ @Autowired GradeDao gradeDao; public List find(Grade grade) { return gradeDao.find(grade); } public Grade get(int id) { return gradeDao.get(id); } public void insert(Grade grade) { gradeDao.insert(grade); } public void update(Grade grade) { gradeDao.update(grade); } public void delete(int id) { gradeDao.delete(id); } public PageInfo findByPage(Grade grade, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = gradeDao.find(grade); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/PaperServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.io.Serializable; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.PaperDao; import edu.fjnu.online.domain.Paper; import edu.fjnu.online.domain.Question; import edu.fjnu.online.service.PaperService; @Service public class PaperServiceImpl implements PaperService { @Autowired PaperDao paperDao; public List find(Paper paper) { return paperDao.find(paper); } public Paper get(Serializable id) { return paperDao.get(id); } public void insert(Paper paper) { paperDao.insert(paper); } public void update(Paper paper) { paperDao.update(paper); } public void delete(Serializable id) { paperDao.delete(id); } public void delete(Serializable[] ids) { paperDao.delete(ids); } public List getUserPaperById(Serializable id) { // TODO Auto-generated method stub return paperDao.getUserPaperById(id); } public Paper getPaperDetail(Map map) { // TODO Auto-generated method stub return paperDao.getPaperDetail(map); } public void updateUserPaper(Map map) { // TODO Auto-generated method stub paperDao.updateUserPaper(map); } public List getUndoPaper(Map map) { // TODO Auto-generated method stub return paperDao.getUndoPaper(map); } public List qryUndoPaper(Map map) { // TODO Auto-generated method stub return paperDao.qryUndoPaper(map); } public PageInfo findAllPage(Paper paper, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = paperDao.find(paper); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/QuestionServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.QuestionDao; import edu.fjnu.online.domain.Question; import edu.fjnu.online.service.QuestionService; @Service public class QuestionServiceImpl implements QuestionService { @Autowired QuestionDao questionDao; public List find(Question question) { return questionDao.find(question); } public Question get(int id) { return questionDao.get(id); } public void insert(Question question) { questionDao.insert(question); } public void update(Question question) { questionDao.update(question); } public void delete(int id) { questionDao.delete(id); } public List createPaper(Map map) { // TODO Auto-generated method stub return questionDao.createPaper(map); } public PageInfo findByPage(Question question, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = questionDao.find(question); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/TypeServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.TypeDao; import edu.fjnu.online.domain.Course; import edu.fjnu.online.domain.Type; import edu.fjnu.online.service.TypeService; @Service public class TypeServiceImpl implements TypeService{ @Autowired TypeDao typeDao; public List find(Type type) { return typeDao.find(type); } public Type get(int id) { return typeDao.get(id); } public void insert(Type type) { typeDao.insert(type); } public void update(Type type) { typeDao.update(type); } public void delete(int id) { typeDao.delete(id); } public PageInfo findByPage(Type type, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = typeDao.find(type); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/service/impl/UserServiceImpl.java ================================================ package edu.fjnu.online.service.impl; import java.io.Serializable; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import edu.fjnu.online.dao.UserDao; import edu.fjnu.online.domain.Question; import edu.fjnu.online.domain.User; import edu.fjnu.online.service.UserService; import edu.fjnu.online.util.MD5Util; @Service public class UserServiceImpl implements UserService { @Autowired UserDao userDao; public List find(User user) { // TODO Auto-generated method stub return userDao.find(user); } public User get(Serializable id) { // TODO Auto-generated method stub return userDao.get(id); } public void insert(User user) { String userPwd = user.getUserPwd(); //密码加密 userPwd = MD5Util.getData(userPwd); user.setUserPwd(userPwd); userDao.insert(user); } public void update(User user) { // TODO Auto-generated method stub userDao.update(user); } public void delete(Serializable id) { // TODO Auto-generated method stub userDao.delete(id); } public void delete(Serializable[] ids) { // TODO Auto-generated method stub } public User login(User user) { // TODO Auto-generated method stub User u = get(user.getUserId()); if(u!=null){ String userPwd = MD5Util.getData(user.getUserPwd()); if(userPwd.equals(u.getUserPwd())){ return u; } } return null; } public List findPending(User user) { // TODO Auto-generated method stub return userDao.findPending(user); } public User getStu(User user) { // TODO Auto-generated method stub return userDao.getStu(user); } public PageInfo findByPage(User user, Integer pageNo, Integer pageSize) { // TODO Auto-generated method stub pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = userDao.find(user); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } public PageInfo findPendingByPage(User user, Integer pageNo, Integer pageSize) { pageNo = pageNo == null?1:pageNo; pageSize = pageSize == null?10:pageSize; PageHelper.startPage(pageNo, pageSize); List list = userDao.findPending(user); System.out.println(list.toString()); //用PageInfo对结果进行包装 PageInfo page = new PageInfo(list); return page; } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/Arith.java ================================================ package edu.fjnu.online.util; // 这是一个数数学计算的class 缩略图生成的时候需要用到。 import java.math.BigDecimal; import java.util.Random; public class Arith { //默认除法运算精度 private static final int DEF_DIV_SCALE = 10; /** * 提供精确的加法运算。 * @param v1 被加数 * @param v2 加数 * @return 两个参数的和 */ public static double add(double v1,double v2){ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); } /** * 提供精确的减法运算。 * @param v1 被减数 * @param v2 减数 * @return 两个参数的差 */ public static double sub(double v1,double v2){ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.subtract(b2).doubleValue(); } /** * 提供精确的乘法运算。 * @param v1 被乘数 * @param v2 乘数 * @return 两个参数的积 */ public static double mul(double v1,double v2){ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.multiply(b2).doubleValue(); } /** * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 * 小数点以后10位,以后的数字四舍五入。 * @param v1 被除数 * @param v2 除数 * @return 两个参数的商 */ public static double div(double v1,double v2){ return div(v1,v2,DEF_DIV_SCALE); } /** * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 * 定精度,以后的数字四舍五入。 * @param v1 被除数 * @param v2 除数 * @param scale 表示表示需要精确到小数点以后几位。 * @return 两个参数的商 */ public static double div(double v1,double v2,int scale){ if(scale<0){ throw new IllegalArgumentException( "The scale must be a positive integer or zero"); } BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); } /** * 提供精确的小数位四舍五入处理。 * @param v 需要四舍五入的数字 * @param scale 小数点后保留几位 * @return 四舍五入后的结果 */ public static double round(double v,int scale){ if(scale<0){ throw new IllegalArgumentException( "The scale must be a positive integer or zero"); } BigDecimal b = new BigDecimal(Double.toString(v)); BigDecimal one = new BigDecimal("1"); return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); } //非整除则进位 by tony 20111006 public int round(int i1,int i2){ int modi = 0; modi = i1 % i2; int i = i1/i2; if(modi==0){ return i; }else{ return i+1; } } //使用时一定要注意其大小,不可超出范围 public int pow(int i1,int i2){ double d1 = (double)i1; double d2 = (double)i2; return (int)java.lang.Math.pow(d1, d2); } //对给定数目的自0开始步长为1的数字序列进行乱序 public static int[] getSequence(int maxnum) { int[] sequence = new int[maxnum]; for(int i = 0; i < maxnum; i++){ sequence[i] = i; } Random random = new Random(); for(int i = 0; i < maxnum; i++){ int p = random.nextInt(maxnum); int tmp = sequence[i]; sequence[i] = sequence[p]; sequence[p] = tmp; } random = null; return sequence; } public static void main(String[] agrs){ Arith arith = new Arith(); int[] i = arith.getSequence(300); for(int n=0;n= 0x4E00 && charValue <= 0X9FA5) || (charValue >= 'a' && charValue <= 'z') || (charValue >= 'A' && charValue <= 'Z') || (charValue >= '0' && charValue <= '9'); } /* * 求公共子串,采用动态规划算法。 * 其不要求所求得的字符在所给的字符串中是连续的。 * * */ public static String longestCommonSubstring(String strA, String strB) { char[] chars_strA = strA.toCharArray(); char[] chars_strB = strB.toCharArray(); int m = chars_strA.length; int n = chars_strB.length; /* * 初始化矩阵数据,matrix[0][0]的值为0, * 如果字符数组chars_strA和chars_strB的对应位相同,则matrix[i][j]的值为左上角的值加1, * 否则,matrix[i][j]的值等于左上方最近两个位置的较大值, * 矩阵中其余各点的值为0. */ int[][] matrix = new int[m + 1][n + 1]; for (int i = 1; i <= m; i++) { for (int j = 1; j <= n; j++) { if (chars_strA[i - 1] == chars_strB[j - 1]) matrix[i][j] = matrix[i - 1][j - 1] + 1; else matrix[i][j] = Math.max(matrix[i][j - 1], matrix[i - 1][j]); } } /* * 矩阵中,如果matrix[m][n]的值不等于matrix[m-1][n]的值也不等于matrix[m][n-1]的值, * 则matrix[m][n]对应的字符为相似字符元,并将其存入result数组中。 * */ char[] result = new char[matrix[m][n]]; int currentIndex = result.length - 1; while (matrix[m][n] != 0) { if (matrix[n] == matrix[n - 1]) n--; else if (matrix[m][n] == matrix[m - 1][n]) m--; else { result[currentIndex] = chars_strA[m - 1]; currentIndex--; n--; m--; } } return new String(result); } /* * 结果转换成百分比形式 * */ public static String similarityResult(double resule){ return NumberFormat.getPercentInstance(new Locale( "en ", "US ")).format(resule); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/DateConverter.java ================================================ package edu.fjnu.online.util; import java.sql.Date; import java.sql.Timestamp; import java.text.SimpleDateFormat; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.support.WebBindingInitializer; import org.springframework.web.context.request.WebRequest; /* * 实现自定义日期格式转换,格式为:yyyy-MM-dd * * * 为何在springmvc-servlet.xml中配置不起作用,直接controller中声明起作用 */ public class DateConverter implements WebBindingInitializer { public void initBinder(WebDataBinder binder, WebRequest request) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); binder.registerCustomEditor(Date.class, new CustomDateEditor(df, true)); binder.registerCustomEditor(Timestamp.class, new CustomDateEditor(df, true)); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/DownloadUtil.java ================================================ package edu.fjnu.online.util; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; public class DownloadUtil { /** * @param filePath 要下载的文件路径 * @param returnName 返回的文件名 * @param response HttpServletResponse * @param delFlag 是否删除文件 */ protected void download(String filePath,String returnName,HttpServletResponse response,boolean delFlag){ this.prototypeDownload(new File(filePath), returnName, response, delFlag); } /** * @param file 要下载的文件 * @param returnName 返回的文件名 * @param response HttpServletResponse * @param delFlag 是否删除文件 */ protected void download(File file,String returnName,HttpServletResponse response,boolean delFlag){ this.prototypeDownload(file, returnName, response, delFlag); } /** * @param file 要下载的文件 * @param returnName 返回的文件名 * @param response HttpServletResponse * @param delFlag 是否删除文件 */ public void prototypeDownload(File file,String returnName,HttpServletResponse response,boolean delFlag){ // 下载文件 FileInputStream inputStream = null; ServletOutputStream outputStream = null; try { if(!file.exists()) return; response.reset(); //设置响应类型 PDF文件为"application/pdf",WORD文件为:"application/msword", EXCEL文件为:"application/vnd.ms-excel"。 response.setContentType("application/octet-stream;charset=utf-8"); //设置响应的文件名称,并转换成中文编码 //returnName = URLEncoder.encode(returnName,"UTF-8"); returnName = response.encodeURL(new String(returnName.getBytes(),"iso8859-1")); //保存的文件名,必须和页面编码一致,否则乱码 //attachment作为附件下载;inline客户端机器有安装匹配程序,则直接打开;注意改变配置,清除缓存,否则可能不能看到效果 response.addHeader("Content-Disposition", "attachment;filename="+returnName); //将文件读入响应流 inputStream = new FileInputStream(file); outputStream = response.getOutputStream(); int length = 1024; int readLength=0; byte buf[] = new byte[1024]; readLength = inputStream.read(buf, 0, length); while (readLength != -1) { outputStream.write(buf, 0, readLength); readLength = inputStream.read(buf, 0, length); } } catch (Exception e) { e.printStackTrace(); } finally { try { outputStream.flush(); } catch (IOException e) { e.printStackTrace(); } try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } //删除原文件 if(delFlag) { file.delete(); } } } /** * by tony 2013-10-17 * @param byteArrayOutputStream 将文件内容写入ByteArrayOutputStream * @param response HttpServletResponse 写入response * @param returnName 返回的文件名 */ public void download(ByteArrayOutputStream byteArrayOutputStream, HttpServletResponse response, String returnName) throws IOException{ response.setContentType("application/octet-stream;charset=utf-8"); returnName = response.encodeURL(new String(returnName.getBytes(),"iso8859-1")); //保存的文件名,必须和页面编码一致,否则乱码 response.addHeader("Content-Disposition", "attachment;filename=" + returnName); response.setContentLength(byteArrayOutputStream.size()); ServletOutputStream outputstream = response.getOutputStream(); //取得输出流 byteArrayOutputStream.writeTo(outputstream); //写到输出流 byteArrayOutputStream.close(); //关闭 outputstream.flush(); //刷数据 } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/FormatStyle.java ================================================ package edu.fjnu.online.util; public class FormatStyle { public static void main(String[] args) { // TODO: Add your code here FormatStyle formatStyle = new FormatStyle(); System.out.println(formatStyle.fileSize("10737418240")); } public String fileSize(String s1) { int iPos = 0; String s =""; StringBuffer sBuf = new StringBuffer(); try{ if(s1.trim().compareTo("")==0){ return ""; } long g = Long.parseLong("1099511627776");//数字太大,JAVA直接写会无法识别,会引起下面比较失败 //int i = Integer.parseInt(s1); double i = Double.parseDouble(s1); if(i<=0){ sBuf.append(""); }else if(i<1024){ sBuf.append(i).append(" B"); //四舍五入 iPos = sBuf.lastIndexOf(".00 B"); if(iPos>0){ sBuf.delete(iPos,sBuf.length()-2); } }else if(i<1024*1024){ sBuf.append(new java.text.DecimalFormat(".00").format(i/1024)).append(" KB"); //四舍五入 iPos = sBuf.lastIndexOf(".00 KB"); if(iPos>0){ sBuf.delete(iPos,sBuf.length()-3); } }else if(i<1024*1024*1024){ sBuf.append(new java.text.DecimalFormat(".00").format(i/(1024*1024))).append(" M"); //四舍五入 iPos = sBuf.lastIndexOf(".00 M"); if(iPos>0){ sBuf.delete(iPos,sBuf.length()-2); } }else{ sBuf.append(new java.text.DecimalFormat(".00").format(i/(1024*1024*1024))).append(" G"); //四舍五入 iPos = sBuf.lastIndexOf(".00 G"); if(iPos>0){ sBuf.delete(iPos,sBuf.length()-2); } } }catch(Exception e){ return ""; } return sBuf.toString(); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/MD5Util.java ================================================ package edu.fjnu.online.util; import java.security.MessageDigest; public class MD5Util { public static String getData(String str) { try { MessageDigest digest = MessageDigest.getInstance("md5"); byte[] data = digest.digest(str.getBytes()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < data.length; i++) { String result = Integer.toHexString(data[i] & 0xff); String temp = null; if (result.length() == 1) { temp = "0" + result; } else { temp = result; } sb.append(temp); } return sb.toString(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } public static void main(String[] args) { System.out.println("e10adc3949ba59abbe56e057f20f883e".equals(getData("123456"))); System.out.println(getData("123456")); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/MybatisUtil.java ================================================ package edu.fjnu.online.util; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; public class MybatisUtil { private static SqlSessionFactory factory; //利用静态块初始化 static{ try{ InputStream inputStream = Resources.getResourceAsStream("MybatisTestConfig.xml"); Properties properties = Resources.getResourceAsProperties("jdbc.properties"); //获取属性文件 factory = new SqlSessionFactoryBuilder().build(inputStream, properties); } catch (IOException e) { e.printStackTrace(); } } //获得session对象 public static SqlSession openSession(){ return factory.openSession(); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/TextSimilarityUtil.java ================================================ package edu.fjnu.online.util; import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class TextSimilarityUtil { public static double getSimilarity(String doc1, String doc2) { if (doc1 != null && doc1.trim().length() > 0 && doc2 != null&& doc2.trim().length() > 0) { Map AlgorithmMap = new HashMap(); //将两个字符串中的中文字符以及出现的总数封装到,AlgorithmMap中 for (int i = 0; i < doc1.length(); i++) { char d1 = doc1.charAt(i); if(isHanZi(d1)){//标点和数字不处理 int charIndex = getGB2312Id(d1);//保存字符对应的GB2312编码 if(charIndex != -1){ int[] fq = AlgorithmMap.get(charIndex); if(fq != null && fq.length == 2){ fq[0]++;//已有该字符,加1 }else { fq = new int[2]; fq[0] = 1; fq[1] = 0; AlgorithmMap.put(charIndex, fq);//新增字符入map } } } } for (int i = 0; i < doc2.length(); i++) { char d2 = doc2.charAt(i); if(isHanZi(d2)){ int charIndex = getGB2312Id(d2); if(charIndex != -1){ int[] fq = AlgorithmMap.get(charIndex); if(fq != null && fq.length == 2){ fq[1]++; }else { fq = new int[2]; fq[0] = 0; fq[1] = 1; AlgorithmMap.put(charIndex, fq); } } } } Iterator iterator = AlgorithmMap.keySet().iterator(); double sqdoc1 = 0; double sqdoc2 = 0; double denominator = 0; while(iterator.hasNext()){ int[] c = AlgorithmMap.get(iterator.next()); denominator += c[0]*c[1]; sqdoc1 += c[0]*c[0]; sqdoc2 += c[1]*c[1]; } return denominator / Math.sqrt(sqdoc1*sqdoc2);//余弦计算 } else { throw new NullPointerException(" the Document is null or have not cahrs!!"); } } public static boolean isHanZi(char ch) { // 判断是否汉字 return (ch >= 0x4E00 && ch <= 0x9FA5); /*if (ch >= 0x4E00 && ch <= 0x9FA5) {//汉字 return true; }else{ String str = "" + ch; boolean isNum = str.matches("[0-9]+"); return isNum; }*/ /*if(Character.isLetterOrDigit(ch)){ String str = "" + ch; if (str.matches("[0-9a-zA-Z\\u4e00-\\u9fa5]+")){//非乱码 return true; }else return false; }else return false;*/ } /** * 根据输入的Unicode字符,获取它的GB2312编码或者ascii编码, * * @param ch 输入的GB2312中文字符或者ASCII字符(128个) * @return ch在GB2312中的位置,-1表示该字符不认识 */ public static short getGB2312Id(char ch) { try { byte[] buffer = Character.toString(ch).getBytes("GB2312"); if (buffer.length != 2) { // 正常情况下buffer应该是两个字节,否则说明ch不属于GB2312编码,故返回'?',此时说明不认识该字符 return -1; } int b0 = (int) (buffer[0] & 0x0FF) - 161; // 编码从A1开始,因此减去0xA1=161 int b1 = (int) (buffer[1] & 0x0FF) - 161; return (short) (b0 * 94 + b1);// 第一个字符和最后一个字符没有汉字,因此每个区只收16*6-2=94个汉字 } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return -1; } public static void main(String[] args) { String str1="精英计划教育一个高中生申请美国名校解决方案的整体服务体系。这个项目纵向综合了前期培训申请,签证三个项目;横向结合了教学培训,教学辅导,留学申请,和后期服务等诸多部门的综合项目"; String str2="余弦定理算法:doc1 和doc2 相似度为:0.99425095, 用时:33mm"; long start=System.currentTimeMillis(); double Similarity=TextSimilarityUtil.getSimilarity(str1, str2); System.out.println("用时:"+(System.currentTimeMillis()-start)); System.out.println(Similarity); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/UtilFuns.java ================================================ package edu.fjnu.online.util; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.text.ParseException; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.StringTokenizer; import java.util.ArrayList; import java.text.DecimalFormat; import java.net.URLEncoder; import java.net.URLDecoder; import java.util.Date; /** UtilFuns is a JavaBean. */ public class UtilFuns { static public String newLine(){ return System.getProperty("line.separator"); } /* 验证数组是否为空 */ public static boolean arrayValid(Object[] objects) { if (objects != null && objects.length > 0) { return true; } else { return false; } } /* 验证list是否为空 */ public boolean listValid(List list) { if (list != null && list.size() > 0) { return true; } else { return false; } } //获得年龄 public int age(String dateStart, String dateEnd) throws Exception{ int yearStart = Integer.parseInt(dateStart.substring(0,4)); int yearEnd = Integer.parseInt(dateEnd.substring(0,4)); return yearEnd-yearStart; } //是否为奇数 public boolean isOdd(int i){ if(i%2==0){ return false; }else{ return true; } } public String cutStr(String str,int len){ try{ str = str.substring(0,len); }catch(Exception e){ return str; } return str; } //返回固定长度串,空白地方用空格填充 by tony 20110926 public String fixSpaceStr(String str,int len){ StringBuffer sBuf = new StringBuffer(); try{ if(str.length()>len){ return str; }else{ sBuf.append(str); for(int i=0;i<(len-str.length());i++){ sBuf.append(" "); } return sBuf.toString(); } }catch(Exception e){ return str; } } public String fixSpaceStr(int number,int len){ return fixSpaceStr(String.valueOf(number),len); } //前缀空格 public String prefixSpaceStr(String str,int len){ StringBuffer sBuf = new StringBuffer(); try{ if(str.length()>len){ return str; }else{ for(int i=0;i<(len-str.length());i++){ sBuf.append(" "); } sBuf.append(str); return sBuf.toString(); } }catch(Exception e){ return str; } } //截取字符,如果超过长度,截取并加省略号 by tony 20101108 public String suspensionStr(String str,int len){ try{ str = str.substring(0,len) + "..."; }catch(Exception e){ return str; } return str; } //url get方式传递参数 by tony 20110328 public static String joinUrlParameter(List sList){ StringBuffer sBuf = new StringBuffer(); for(Iterator it = sList.iterator(); it.hasNext();){ sBuf.append("&").append(it.next()).append("=").append(it.next()); } return sBuf.substring(1, sBuf.length()); //去掉第一个&符号 } /** SplitStr 功能:返回分割后的数组 *
输入参数:String str 设置返回系统时间样式 *
输入参数:String SplitFlag 设置分割字符 *
输出参数:string[] 返回分割后的数组 *
作者:陈子枢 *
时间:2003-9-7 *
用法: */ /* String s[] = SplitStr("asd asd we sd"," "); for (int i=0;i输入参数:String aStr 要合并数组 *
输入参数:String SplitFlag 设置分割字符 *
输出参数:String 要合并数组 *
作者:陈子枢 *
时间:2004-1-9 *
用法: */ static public String joinStr(String[] aStr,String SplitFlag){ StringBuffer sBuffer = new StringBuffer(); if (aStr != null){ for (int i=0;i功能:将数组合并为一个字符串 *
输入参数:String sPrefix 数组元素加的前缀 *
输入参数:String sSuffix 数组元素加的后缀 *
输入参数:String SplitFlag 设置分割字符 *
输出参数:String 合并后的字符串 *
作者:陈子枢 *
时间:2005-3-17 *
用法: */ static public String joinStr(String[] aStr,String sPrefix,String sSuffix,String SplitFlag){ StringBuffer sBuffer = new StringBuffer(); if (aStr != null){ for (int i=0;i输入参数:int style 设置返回系统时间样式 *
输出参数:string 返回系统时间样式 *
作者:陈子枢 *
时间:2003-6-24 *
存在问题:中文乱码,但JSP中显示正常。 */ static public String SysTime(String strStyle){ String s = ""; if (strStyle.compareTo("")==0){ strStyle = "yyyy-MM-dd HH:mm:ss"; //default } java.util.Date date=new java.util.Date(); SimpleDateFormat dformat=new SimpleDateFormat(strStyle); s = dformat.format(date); return s; } static public String sysTime(){ String s = ""; java.util.Date date=new java.util.Date(); SimpleDateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); s = dformat.format(date); return s; } static public String sysDate(){ String s = ""; java.util.Date date=new java.util.Date(); SimpleDateFormat dformat=new SimpleDateFormat("yyyy-MM-dd"); s = dformat.format(date); return s; } /* add by tony 20091113 */ public static boolean isNull(Object obj){ try{ if(obj==null){ return true; } return false; }catch(Exception e){ return false; } } public static boolean isNotNull(Object obj){ try{ if(obj==null){ return false; } return true; }catch(Exception e){ return true; } } public static boolean isEmpty(String str){ try{ if(str==null || str.equals("null") || str.equals("")){ return true; } return false; }catch(Exception e){ return false; } } public static boolean isEmpty(String strs[]){ try{ if(strs==null || strs.length<=0){ return true; } return false; }catch(Exception e){ return false; } } public static boolean isNotEmpty(String str){ try{ if(str==null || str.equals("null") || str.equals("")){ return false; } return true; }catch(Exception e){ return true; } } public static boolean isNotEmpty(Object obj){ try{ if(obj==null || obj.toString().equals("null") || obj.toString().equals("")){ return false; } return true; }catch(Exception e){ return true; } } public static boolean isNotEmpty(List obj){ try{ if(obj==null || obj.size()<=0){ return false; } return true; }catch(Exception e){ return true; } } /** 功能:用于转换为null的字段。 *
入参:String strvalue 设置要转换的字符串 *
出参:不为“null”的返回原串;为“null”返回""。 *
作者:陈子枢 *
时间:2003-9-16 *

用法:optionFuns.convertNull(String.valueOf(oi.next()))

*/ public static String convertNull(String strvalue) { try{ if(strvalue.equals("null") || strvalue.length()==0){ return ""; }else{ return strvalue.trim(); } }catch(Exception e){ return ""; } } public static String[] convertNull(String[] aContent) { try{ for(int i=0;i输入参数:String CurrentValue 查找出的数据库中的数据 * String[] content 需要输出的所有下拉列表框的内容 *
输出参数:返回下拉列表 *
注意事项:values为0开始,而且中间不能断开 */ public String ComboList(String CurrentValue, String[] content) { int i = 0; StringBuffer sBuf = new StringBuffer(); String selected = " selected"; try{ sBuf.append(""); for (i = 0; i < content.length; i++) { sBuf.append("\n"); } return sBuf.toString(); }catch(Exception e){ return ""; } } public String ComboListMust(String CurrentValue, String[] content) { int i = 0; StringBuffer sBuf = new StringBuffer(); String selected = " selected"; try{ for (i = 0; i < content.length; i++) { sBuf.append("\n"); } return sBuf.toString(); }catch(Exception e){ return ""; } } /** ComboList 功能:选定在下拉列表框中与查找到数据,相符的那一项内容 *
输入参数:String CurrentValue 查找出的数据库中的数据 * String[] values 需要输出的所有下拉列表框的内容所对应的值 * String[] content 需要输出的所有下拉列表框的内容 *
输出参数:返回下拉列表 *
修改:陈子枢 *
修改时间:2003-9-4 *
注意事项:values和content数组个数必须相同.适合从数据库中取值 <% String[] aContextOPERATE_TYPE = {"定检","轮换","抽检"}; out.print(optionFuns.ComboList("",aContextOPERATE_TYPE,aContextOPERATE_TYPE)); %> */ public String ComboList(String CurrentValue,String[] values, String[] content) { int i = 0; StringBuffer sBuf = new StringBuffer(); String selected = " selected"; try{ if(CurrentValue==null){ CurrentValue = ""; } sBuf.append(""); for (i = 0; i < content.length; i++) { sBuf.append(""); } return sBuf.toString(); }catch(Exception e){ return ""; } } public String ComboListMust(String CurrentValue,String[] values, String[] content) { int i = 0; StringBuffer sBuf = new StringBuffer(); String selected = " selected"; try{ for (i = 0; i < content.length; i++) { sBuf.append(""); } return sBuf.toString(); }catch(Exception e){ return ""; } } /** StrToTimestamp 功能:将字符串转换为Timestamp 。 *
输入参数:String timestampStr 设置要转换的字符串 * String pattern 要转换的format *
输出参数:如果格式正确返回格式后的字符串。 * 不正确返回系统日期。 *
作者:陈子枢 *
时间:2003-8-26 */ public static Timestamp StrToTimestamp(String timestampStr,String pattern) throws ParseException { java.util.Date date = null; SimpleDateFormat format = new SimpleDateFormat(pattern); try { date = format.parse(timestampStr); } catch (ParseException ex) { throw ex; } return date == null ? null : new Timestamp(date.getTime()); } //ex:utilFuns.StrToDateTimeFormat("2005-12-01 00:00:00.0,"yyyy-MM-dd") public static String StrToDateTimeFormat(String timestampStr,String pattern) throws ParseException { String s =""; try{ s = String.valueOf(StrToTimestamp(timestampStr, pattern)); s = s.substring(0,pattern.length()); }catch(Exception e){ } return s; } //ex:utilFuns.StrToDateTimeFormat("2005-12-01 00:00:00.0,"yyyy-MM-dd") public static String dateTimeFormat(Date date,String pattern) throws ParseException { String s =""; try{ SimpleDateFormat dformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); s = dformat.format(date); s = String.valueOf(StrToTimestamp(s, pattern)); s = s.substring(0,pattern.length()); }catch(Exception e){ } return s; } public static String dateTimeFormat(Date date) throws ParseException { String s =""; try{ SimpleDateFormat dformat = new SimpleDateFormat("yyyy-MM-dd"); s = dformat.format(date); s = String.valueOf(StrToTimestamp(s, "yyyy-MM-dd")); s = s.substring(0,"yyyy-MM-dd".length()); }catch(Exception e){ } return s; } //add by tony 20100228 转换中文 格式必须为:"yyyy-MM-dd HH:mm:ss"的一部分 public static String formatDateTimeCN(String date) throws ParseException { String s =""; try{ if(UtilFuns.isEmpty(date)){ return ""; } if(date.indexOf(".")>-1){ date = date.substring(0, date.indexOf(".")); } if(date.length()==4){ //yyyy s = date+"年"; }else if(date.length()==7){ //yyyy-MM s = date.replaceAll("-0", "-").replaceFirst("-", "年")+"月"; }else if(date.length()==10){ //yyyy-MM-dd s = date.replaceAll("-0", "-").replaceFirst("-", "年").replaceFirst("-", "月")+"日"; }else if(date.length()==2){ //HH s = date+"时"; }else if(date.length()==5){ //HH:mm s = date.replaceAll(":0", ":").replaceFirst(":", "时")+"分"; }else if(date.length()==8){ //HH:mm:ss s = date.replaceAll(":0", ":").replaceFirst(":", "时").replaceFirst(":", "分")+"秒"; }else if(date.length()==13){ //yyyy-MM-dd HH s = date.replaceAll("-0", "-").replaceFirst("-", "年").replaceFirst("-", "月").replaceAll(" 0", " ").replaceFirst(" ", "日")+"时"; }else if(date.length()==16){ //yyyy-MM-dd HH:mm s = date.replaceAll("-0", "-").replaceFirst("-", "年").replaceFirst("-", "月").replaceAll(" 0", " ").replaceFirst(" ", "日").replaceAll(":0", ":").replaceFirst(":", "时")+"分"; }else if(date.length()==19){ //yyyy-MM-dd HH:mm:ss s = date.replaceAll("-0", "-").replaceFirst("-", "年").replaceFirst("-", "月").replaceAll(" 0", " ").replaceFirst(" ", "日").replaceAll(":0", ":").replaceFirst(":", "时").replaceFirst(":", "分")+"秒"; } s = s.replaceAll("0[时分秒]", ""); //正则 0时0分0秒的都替换为空 }catch(Exception e){ } return s; } //add by tony 2011-07-26 返回英文格式日期 oct.10.2011 public static String formatDateEN(String date) throws ParseException { String s =""; int whichMonth = 1; try{ if(UtilFuns.isEmpty(date)){ return ""; } String[] aString = date.replaceAll("-0", "-").split("-"); whichMonth = Integer.parseInt(aString[1]); if(whichMonth==1){ s = "Jan"; }else if(whichMonth==2){ s = "Feb"; }else if(whichMonth==3){ s = "Mar"; }else if(whichMonth==4){ s = "Apr"; }else if(whichMonth==5){ s = "May"; }else if(whichMonth==6){ s = "Jun"; }else if(whichMonth==7){ s = "Jul"; }else if(whichMonth==8){ s = "Aug"; }else if(whichMonth==9){ s = "Sept"; }else if(whichMonth==10){ s = "Oct"; }else if(whichMonth==11){ s = "Nov"; }else if(whichMonth==12){ s = "Dec"; } s = s+"."+aString[2]+","+aString[0]; }catch(Exception e){ } return s; } //返回年月格式 2010-7 public String formatShortMonth(String strDate){ return strDate.substring(0,7).replaceAll("-0", "-"); } //返回年月格式 2010-07 public String formatMonth(String strDate){ return strDate.substring(0,7); } //删除最后1个字符 public static String delLastChar(String s){ try{ if(s.length()>0){ s = s.substring(0,s.length()-1); } }catch(Exception e){ return ""; } return s; } //删除最后len个字符 public static String delLastChars(String s,int len){ try{ if(s.length()>0){ s = s.substring(0,s.length()-len); } }catch(Exception e){ return ""; } return s; } //替换网页用字符-配合FCKEditor使用 .replaceAll("'","'") //for viewpage public String htmlReplaceAll(String s){ try{ StringBuffer sBuf = new StringBuffer(); //.replaceAll("\\\\","\\\\\\\\").replaceAll("&","&") sBuf.append(s.replaceAll(" "," ").replaceAll("<","<").replaceAll(">",">").replaceAll("\"",""").replaceAll("\n","")); return sBuf.toString(); }catch(Exception e){ return ""; } } //for viewpage by jstl/make html public static String htmlNewline(String s){ try{ //如不替换空格,html解释时会自动把多个空格显示为一个空格,这样当我们通过空格来布局时就出现textarea中和html页面展现不一致的情况 tony //s.replaceAll(" "," ") 不能进行空格的替换,否则页面内容中如果有等标签,内容就会显示乱; return s.replaceAll(" "," ").replaceAll("\n",""); }catch(Exception e){ return ""; } } /** getPassString 功能:用于转换为后几位的为*。 *
输入参数:String strvalue 设置要转换的字符串 * int Flag 位数。 *
输出参数:。 *
作者:范波 *
时间:2006-8-7 *
存在问题: *
用法: * <%=utilFuns.ConvertString("abcdef",3)%> */ public static String getPassString( String strvalue, int Flag ) { try { if ( strvalue.equals("null") || strvalue.compareTo("")==0){ return ""; } else { int intStrvalue = strvalue.length(); if ( intStrvalue > Flag ) { strvalue = strvalue.substring( 0, intStrvalue - Flag ); } for ( int i = 0; i < Flag; i++ ) { strvalue = strvalue + "*"; } //System.out.print( "strvalue:" + strvalue ); return strvalue; } } catch (Exception e) { return strvalue; } } /** getPassString 功能:用于转换为后几位的为*。 *
输入参数:String strvalue 设置要转换的字符串 * int Flag 起位数。 * int sFlag 末位数。 *
输出参数:。 *
作者:范波 *
时间:2006-8-7 *
存在问题: *
用法: * <%=optionFuns.getPassString(String.valueOf(oi.next()),3)%> */ public static String getPassString( String strvalue, int Flag, int sFlag ,int iPassLen ) { try { if ( strvalue.equals( "null" ) ) { return ""; } else { String strvalue1=""; String strvalue2=""; int intStrvalue = strvalue.length(); if(sFlag>=Flag){ if ( intStrvalue > Flag ) { strvalue1 = strvalue.substring( 0, Flag ); strvalue2 = strvalue.substring( sFlag, intStrvalue ); } else { strvalue1 = ""; strvalue2 = ""; } for ( int i = 0; i < iPassLen; i++ ) { strvalue1 = strvalue1 + "*"; } strvalue=strvalue1+strvalue2; } //System.out.print( "strvalue:" + strvalue ); return strvalue; } } catch (Exception e) { return strvalue; } } /* by czs 2006-8-17 OPTION: 取得字符串iStartPos位置到iEndPos位置,将中间这部分转换iPatternLen个sPattern EXSAMPLE: getPatternString("CHEN ZISHU",5,7,"*",3) RESULT: CHEN ***SHU getPatternString("CHEN ZISHU",10,0,".",3) RESULT: CHEN****** */ public static String getPatternString( String s, int iStartPos, int iEndPos, String sPattern, int iPatternLen ) { try { if (iEndPos==0) { iEndPos = s.length(); } String sStartStr = ""; String sCenterStr = ""; String sEndStr = ""; if ( s.equals("null")){ return ""; } else { int ints = s.length(); if ( ints > iStartPos ) { sStartStr = s.substring( 0, iStartPos ); }else{ return s; } if ( ints > iEndPos) { sEndStr = s.substring( iEndPos, ints ); } for ( int i = 0; i < iPatternLen; i++ ) { sCenterStr = sCenterStr + sPattern; } return sStartStr + sCenterStr + sEndStr; } } catch (Exception e) { System.out.println(e); return s; } } public static String getPatternString( String s, int iStartPos, String sPattern, int iPatternLen ) { return getPatternString(s,iStartPos,0,sPattern,iPatternLen); } public static String getPatternString( String s, int iStartPos, String sPattern ) { return getPatternString(s,iStartPos,0,sPattern,3); } /** getQQString 功能:用于转换为后几位的为*。 *
输入参数:String strvalue 设置要转换的字符串 * *
输出参数:。 *
作者:范波 *
时间:2006-8-7 *
存在问题: *
用法: * <%=optionFuns.getQQString(String.valueOf(oi.next()))%> */ public static String getQQString( String strvalue ) { try { String QQ=""; if ( strvalue.equals("") ) { return ""; } else { QQ="" +" "+strvalue+""; } strvalue=QQ; //System.out.print( "strvalue:" + strvalue ); return strvalue; } catch (Exception e) { return strvalue; } } public String getNoExistString(String allString, String existString){ return this.getNoExistString(this.splitStr(allString, ","), existString); } /* 返回existString中的每个字串不在allString中的 */ public String getNoExistString(String[] allString, String existString){ existString = existString + ","; if(allString==null&&allString.length==0){ return ""; } StringBuffer sBuf = new StringBuffer(); for(int i=0;i1){ sBuf.delete(sBuf.length()-1, sBuf.length()); } return sBuf.toString(); } public static void main(String[] args) throws Exception { // // // java.util.List aList = new ArrayList(); // System.out.println(UtilFuns.isNotEmpty(aList)); // // System.out.println(uf.formatDateTimeCN("2011")); // System.out.println(uf.formatDateTimeCN("2011-01")); // System.out.println(uf.formatDateTimeCN("2011-01-02")); // System.out.println(uf.formatDateTimeCN("2011-01-02 03")); // System.out.println(uf.formatDateTimeCN("2011-01-02 13:05")); // System.out.println(uf.formatDateTimeCN("2011-01-02 13:05:05")); // System.out.println(uf.formatDateTimeCN("03")); // System.out.println(uf.formatDateTimeCN("13:05")); // System.out.println(uf.formatDateTimeCN("13:05:05")); // UtilFuns uf = new UtilFuns(); // System.out.println(uf.getNoExistString("1,2,3", "1,2,3,4")); // System.out.println(uf.getNoExistString("安全,生产,营销", "生产,营销")); // System.out.println("finish!"); // Set set = new HashSet(); // set.add("abc"); // set.add("xyz"); // set.add("abc"); // for(Iterator it = set.iterator();it.hasNext();){ // System.out.println(it.next()); // } /* System.out.println(SysTime("yyyy-MM-dd")); System.out.println(SysTime("yyyy-MM-dd HH:mm:ss")); System.out.println(Double.parseDouble("12.11")); System.out.println(FormatNumber("12.11000000000f")); System.out.println(getPatternString("CHEN ZISHU",8,0,".",3)); */ //System.out.println(SysTime("yyyy年MM月")); //System.out.println(SysTime("yyyyMM")); //System.out.println(ConvertSpaceTD("")); //System.out.println(ConvertTD("")); /* process the stat data Start Statement stmt1 = conn.createStatement(); String sTableName = find_Type; String sUserName = findName; StringBuffer sBuffer = new StringBuffer(); //Step 1 clear Table userState sBuffer.append("delete * from userStat;"); //Step 2 read username from User_P and write inputnum in it sBuffer.append("select User_P.loginname,").append(sTableName).append(".createby,count(").append(sTableName).append(".createby)") .append(" from ").append(sTableName).append("") .append(" right join") .append(" User_P") .append(" on User_P.loginname=").append(sTableName).append(".createby") .append(" where 1=1"); if (find_Name.compareTo("")!=0){ sBuffer.append(" and ").append(sTableName).append(".createby='").append(sTableName).append("'"); } if (find_DateStart.compareTo("")!=0){ sBuffer.append(" and createdate<='").append(find_DateStart).append(" 00:00:00'"); } if (find_DateStart.compareTo("")!=0){ sBuffer.append(" and createdate>='").append(find_DateEnd).append(" 23:59:59'"); } sBuffer.append(" group by ").append(sTableName).append(".createby") .append(";"); //Step 3 read updatenum sBuffer.append("select count(updateby) from ").append(sTableName).append("") .append(" where ").append(sTableName).append(".updateby=''") .append(" and updatedate<='").append(find_DateStart).append(" 00:00:00'") .append(" and updatedate>='").append(find_DateEnd).append(" 23:59:59'") .append(";"); //Step 4 update the userStat.updatenum value sBuffer.append("update userStat set updatenum='3' where updateby='").append(sTableName).append("'") .append(";"); sBuffer.toString(); process the stat data End */ /* try{ System.out.println(SysDate()); System.out.println(StrToDateTimeFormat("2003-08-21 18:28:47", "yyyy-MM-")); }catch(Exception e){ } String s[] = SplitStr("asd,asd,we,sd",","); for (int curLayNum=0;curLayNum var today = new Date(); var strDate = (today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日 "); var n_day = today.getDay(); switch (n_day) { case 0:{ strDate = strDate + "星期日" }break; case 1:{ strDate = strDate + "星期一" }break; case 2:{ strDate = strDate + "星期二" }break; case 3:{ strDate = strDate + "星期三" }break; case 4:{ strDate = strDate + "星期四" }break; case 5:{ strDate = strDate + "星期五" }break; case 6:{ strDate = strDate + "星期六" }break; case 7:{ strDate = strDate + "星期日" }break; } document.write(strDate); */ public String replaceLast(String string, String toReplace, String replacement) { int pos = string.lastIndexOf(toReplace); if (pos > -1) { return string.substring(0, pos) + replacement + string.substring(pos + toReplace.length(), string.length()); } else { return string; } } public static String getROOTPath(){ UtilFuns uf = new UtilFuns(); return uf.getClass().getResource("/").getPath().replace("/WEB-INF/classes/", "/").substring(1); } public String getClassRootPath(){ return this.getClass().getResource("/").getPath(); } } ================================================ FILE: Check Maven Webapp/src/main/java/edu/fjnu/online/util/file/FileUtil.java ================================================ package edu.fjnu.online.util.file; import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.channels.FileChannel; import java.util.ArrayList; import java.util.List; import edu.fjnu.online.util.FormatStyle; import edu.fjnu.online.util.UtilFuns; public class FileUtil { /* ======================================== * * Class Methods * ======================================== */ public String getFileExt(String s){ String s1 = new String(); int i = 0; int j = 0; if(s == null) return null; i = s.lastIndexOf(46) + 1; j = s.length(); s1 = s.substring(i, j); if(s.lastIndexOf(46) > 0) return s1.toLowerCase(); else return ""; } private String getNameWithoutExtension(String fileName){ return fileName.substring(0, fileName.lastIndexOf(".")); } public boolean isImgFile(String file) { if(UtilFuns.isNotEmpty(file)){ String s1 = "."+this.getFileExt(file); if(".jpg.jpeg.bmp.gif.png".indexOf(s1)>-1){ return true; } } return false; } public String getFileName(String s){ try{ s = s.replaceAll("/", "\\\\"); int fileIndex= s.lastIndexOf("\\")+1; return s.substring(fileIndex,s.length()); }catch(Exception e){ return ""; } } public String getFilePath(String s){ try{ s = s.replaceAll("/", "\\\\"); int fileIndex= s.lastIndexOf("\\"); return s.substring(0,fileIndex); }catch(Exception e){ return ""; } } /* 目录下已经有同名文件,则文件重命名,增加文件序号 add by tony 20110712 */ public String newFile(String sPath, String sFile){ String newFileName = new String(); String withoutExt = new String(); File curFile = new File(sPath + "\\" + sFile); if (curFile.exists()) { for(int counter = 1; curFile.exists(); counter++){ withoutExt = this.getNameWithoutExtension(curFile.getName()); if(withoutExt.endsWith(counter-1 + ")")){ withoutExt = withoutExt.substring(0,withoutExt.indexOf("(")); //idea } newFileName = withoutExt + "(" + counter + ")" + "." + getFileExt(curFile.getName()); curFile = new File(sPath + "\\" + newFileName); } }else{ newFileName = curFile.getName(); } return newFileName; } /* 只清空文件夹,不删除文件夹 */ public static synchronized void clearDir(String dir_path) throws FileNotFoundException { File file = new File(dir_path); if (!file.exists()) { throw new FileNotFoundException(); } if (file.isDirectory()) { File[] fe = file.listFiles(); for (int i = 0; i < fe.length; i++) { deleteFiles(fe[i].toString()); fe[i].delete(); //删除已经是空的子目录 } } } //ex: deleteDir(new File("c://aaa")); /* 清空文件夹,并删除文件夹 */ public static synchronized void deleteDir(String dir_path) throws FileNotFoundException,IOException { deleteDir(new File(dir_path)); } //ex: deleteDir(new File("c://aaa")); /* 清空文件夹,并删除文件夹 */ public static synchronized void deleteDir(File f) throws FileNotFoundException,IOException { if(!f.exists()){//文件夹不存在不存在 throw new IOException("指定目录不存在:"+f.getName()); } boolean rslt=true;//保存中间结果 if(!(rslt=f.delete())){//先尝试直接删除 //若文件夹非空。枚举、递归删除里面内容 File subs[] = f.listFiles(); for (int i = 0; i <= subs.length - 1; i++) { if (subs[i].isDirectory()) deleteDir(subs[i]);//递归删除子文件夹内容 rslt = subs[i].delete();//删除子文件夹本身 } rslt = f.delete();//删除此文件夹本身 } //if(!rslt) // throw new IOException("无法删除:"+f.getName()); //return; } //路径中的多层目录,如果不存在,则建立(mkdir-只可建最后一层目录) public static synchronized void makeDir(String dirPath) throws FileNotFoundException { String s = ""; dirPath = dirPath.replaceAll("\\t","/t"); //replace tab key dirPath = dirPath.replaceAll("\\\\","/"); String[] aPath = dirPath.split("/"); for (int i=0;idir_path.lastIndexOf("/")?dir_path.lastIndexOf("\\"):dir_path.lastIndexOf("/"); if(i>0){ return dir_path.substring(i); }else{ return ""; } } } //删除给定的文件 public static void deleteFile(String FileName) { File f2 = new File(FileName); f2.delete(); //del file f2 = null; } /* *删除目录下的所有文件 **/ public static boolean deleteFiles(String dir) { if(dir==null || "".equals(dir)) return true; File f0 = new File(dir); if( !f0.isDirectory() ) return false; File[] files = f0.listFiles(); boolean status = true; for(int i=0; ifiles which is under path. * It does not delete directory. * * @param path * @param files * @return true if and only if all the files are successfully * deleted; false otherwise. */ public static boolean deleteFiles(String path, String[] files) { if(path==null || files==null) return true; boolean status = true; for(int i=0; if to os. * * @param f * @param os * @throws IOException */ public static void fileToOutputStream(File f, OutputStream os) throws IOException { // InputStream is = new BufferedInputStream( new FileInputStream(f) ); byte[] barr = new byte[1024]; int count; while(true) { count = is.read(barr); if(count == -1) break; os.write(barr, 0, count); } is.close(); return; } //读日志文件 "c:\\Log.txt" //输入参数:sFile = Path + FileName 文件路径+文件名称 public List readTxtFile(String sFile) { String str = ""; List sList = new ArrayList(); try { FileReader fr = new FileReader(sFile); BufferedReader bfr = new BufferedReader(fr); while((str = bfr.readLine())!=null){ sList.add(str); } fr.close(); }catch (IOException ex){System.out.println("readTxtFile IOException Error."+ex.getMessage()); }catch (Exception ex) {System.out.println("readTxtFile Exception Error."+ex.getMessage());} return sList; } public String WriteTxt(String sPath,String sFile,String sContent) { String s = ""; File d=new File(sPath);//建立代表Sub目录的File对象,并得到它的一个引用 if(!d.exists()){//检查Sub目录是否存在 d.mkdir();//建立Sub目录 } try { FileWriter fw = new FileWriter(sPath + "\\" + sFile,true); BufferedWriter bfw = new BufferedWriter(fw); bfw.write(sContent); bfw.flush(); fw.close(); }catch (IOException ex){ s = "WriteTxt IOException Error."; }catch (Exception ex) { s = "WriteTxt Exception Error.";} return s; } /* 创建新文本文件,如果文件已经存在则覆盖 */ public String createTxt(String sPathFile,String sContent) throws FileNotFoundException { String s = ""; String sPath = this.getFilePath(sPathFile); String sFile = this.getFileName(sPathFile); File d=new File(sPath); //建立代表Sub目录的File对象,并得到它的一个引用 if(!d.exists()){ //检查Sub目录是否存在 this.makeDir(sPath); //建立Sub目录 } try { FileWriter fw = new FileWriter(sPath + "\\" + sFile,false); BufferedWriter bfw = new BufferedWriter(fw); bfw.write(sContent); bfw.flush(); fw.close(); }catch (IOException ex){ s = "createTxt IOException Error."; }catch (Exception ex) { s = "createTxt Exception Error.";} return s; } /* 创建新文本文件,如果文件已经存在则覆盖 */ public String createTxt(String sPath,String sFile,String sContent) throws FileNotFoundException { String s = ""; File d=new File(sPath); //建立代表Sub目录的File对象,并得到它的一个引用 if(!d.exists()){ //检查Sub目录是否存在 this.makeDir(sPath); //建立Sub目录 } try { FileWriter fw = new FileWriter(sPath + "\\" + sFile,false); BufferedWriter bfw = new BufferedWriter(fw); bfw.write(sContent); bfw.flush(); fw.close(); }catch (IOException ex){ s = "createTxt IOException Error."; }catch (Exception ex) { s = "createTxt Exception Error.";} return s; } /* 创建新文本文件,如果文件已经存在则覆盖,在文件后追加内容 文件格式:encode:UTF-8 add by tony 20100118 */ public String createTxt(String sPath,String sFile,String sContent,String enCoding) throws FileNotFoundException { String s = ""; File d=new File(sPath); //建立代表Sub目录的File对象,并得到它的一个引用 if(!d.exists()){ //检查Sub目录是否存在 this.makeDir(sPath); //建立Sub目录 } try { OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(sPath + "\\" + sFile), enCoding); out.write(sContent); out.flush(); out.close(); }catch (IOException ex){ s = "createTxt IOException Error."; }catch (Exception ex) { s = "createTxt Exception Error."; } return s; } /* 创建新文本文件,如果文件已经存在则覆盖,只覆盖不追加 文件格式:encode:UTF-8 add by tony 20100118 */ public String newTxt(String sPath,String sFile,String sContent,String enCoding) throws FileNotFoundException { String s = ""; File d=new File(sPath); //建立代表Sub目录的File对象,并得到它的一个引用 if(!d.exists()){ //检查Sub目录是否存在 this.makeDir(sPath); //建立Sub目录 } try { OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(sPath + "\\" + sFile, false), enCoding); out.write(sContent); out.flush(); out.close(); }catch (IOException ex){ s = "createTxt IOException Error."; }catch (Exception ex) { s = "createTxt Exception Error."; } return s; } /* s = "c:\\ex.txt"; String[] aTitle = null; //表示没有标题 String[] aContent = {"a","b","c","a1","a2","a3"}; sMsg = fileUtil.WriteTxt(s,aTitle,aContent,"\t",3); //\t TAB键 */ public String WriteTxt(String sFile,String[] aTitle,String[] aContent,String sSplitFlag,int iColumns) { String sMsg = ""; long lTime = System.currentTimeMillis(); try { if (aTitle!=null){ if (aTitle.length!=iColumns){ throw new Exception("Title Length is not right!"); } } File f = new File(sFile); if(f.exists()) { f.delete(); //if exist then delete() } FileWriter fw = new FileWriter(sFile,true); BufferedWriter bfw = new BufferedWriter(fw); //write Title if (aTitle!=null){ for(int i=0;i"; aTrunkSuffix[i] = aTrunk[i].replaceFirst("<",""; aLeaf[i] = sIndent + "<" + aLeaf[i] + ">"; } FileWriter fw = new FileWriter(sFile,true); BufferedWriter bfw = new BufferedWriter(fw); bfw.write("");bfw.newLine(); if(root.length()>0){ bfw.write("<"+root+">");bfw.newLine(); } while(k-1;i--){ bfw.write(aTrunkSuffix[i]);bfw.newLine(); } }//end while if(root.length()>0){ bfw.write("");bfw.newLine(); } bfw.flush(); //将缓冲区内的数据写入文件中 fw.close(); }catch (IOException ex){ sMsg = this.getClass().getName()+ " WriteXML IOException Error."+ex.getMessage(); }catch (Exception ex) { sMsg = this.getClass().getName()+ " WriteXML Exception Error."+ex.getMessage(); } return sMsg; } //create xml lines to ArrayList public ArrayList CreateXML(String StartIndent,String indent,String[] aTrunk,String[] aLeaf,String[] aContent) { ArrayList aList = new ArrayList(); int i=0,j=0,k=0; String sIndent = StartIndent; String[] aTrunkSuffix = new String[aTrunk.length]; String[] aLeafSuffix = new String[aLeaf.length]; String sMsg = ""; long lTime = System.currentTimeMillis(); try { //inital array for(i=0;i"; aTrunkSuffix[i] = aTrunk[i].replaceFirst("<",""; aLeaf[i] = sIndent + "<" + aLeaf[i] + ">"; } while(k-1;i--){ aList.add(aTrunkSuffix[i]); } }//end while return aList; }catch (Exception ex) { sMsg = this.getClass().getName()+ " CreateXML Exception Error."+ex.getMessage(); } return null; } //边生成边写XML文件 public String WriteXML(String sFile,String sXmlVer,String root,ArrayList aList) { String sMsg = ""; long lTime = System.currentTimeMillis(); try { File f = new File(sFile); if(f.exists()) { f.delete(); //if exist then delete() } FileWriter fw = new FileWriter(sFile,true); BufferedWriter bfw = new BufferedWriter(fw); bfw.write("");bfw.newLine(); if(root.length()>0){ bfw.write("<"+root+">");bfw.newLine(); } //write txt for(int i=0;i0){ //去掉元素后面的属性 bfw.write(""); } bfw.flush(); //将缓冲区内的数据写入文件中 fw.close(); }catch (IOException ex){ sMsg = this.getClass().getName()+ " WriteXML IOException Error."+ex.getMessage(); }catch (Exception ex) { sMsg = this.getClass().getName()+ " WriteXML Exception Error."+ex.getMessage(); } return sMsg; } public boolean isExist(String filename){ try{ File file = new File(filename); if(!file.exists()){ return false; }else{ return true; } }catch(Exception e){ return false; } } //用于判断是绝对路径还是相对路径 add by tony 20100413 public boolean isAbsolutePath(String path){ if(path.indexOf(":")>0){ return true; } return false; } /** * 功能:利用nio来快速复制文件 */ public void copyFile(String srcFile, String destFile) throws java.io.FileNotFoundException, java.io.IOException { FileInputStream fis = new FileInputStream(srcFile); FileOutputStream fos = new FileOutputStream(destFile); FileChannel fcin = fis.getChannel(); FileChannel fcout = fos.getChannel(); fcin.transferTo(0, fcin.size(), fcout); fcin.close(); fcout.close(); fis.close(); fos.close(); } /** 忽略拷贝文件时发生的错误,可能是文件不存在 */ public boolean copyFileIgnore(String file1,String file2){ try{ File file_in = new File(file1); File file_out = new File(file2); FileInputStream in1 = new FileInputStream(file_in); FileOutputStream out1 = new FileOutputStream(file_out); byte[] bytes = new byte[1024]; int c; while((c=in1.read(bytes))!=-1){ out1.write(bytes,0,c); } in1.close(); out1.close(); return true; //if sucess then return true }catch(Exception e){ return false; //if fail then return false } } /* create by czs 2006-08-08 */ public void copyDir(String dir1,String dir2) throws java.io.FileNotFoundException, IOException{ (new File(dir2)).mkdir(); File[] file = (new File(dir1)).listFiles(); for(int i=0;i fileList(String dir, String prefix, String suffix){ FormatStyle formatStyle = new FormatStyle(); File f = new File(dir); File[] files = f.listFiles(); if (files==null){ return null; } int count = files.length; List _list = new ArrayList(count); for (int i=0;i ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Course.xml ================================================ insert into t_course (coursename,coursestate) values (#{courseName},#{courseState}) update t_course coursename=#{courseName}, coursestate=#{courseState}, where courseid=#{courseId} delete from t_course where courseid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/ErrorBook.xml ================================================ insert into t_errorbook (userid,courseid,gradeid,uanswer,questionid,typeid) values (#{userId},#{courseId},#{gradeId},#{userAnswer},#{question.questionId},#{question.typeId}) update t_errorbook courseid=#{courseId}, gradeid=#{gradeId}, uanswer=#{userAnswer}, questionid=#{questionId}, where bookid=#{bookId} delete from t_errorbook where bookid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Factory.xml ================================================ ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Grade.xml ================================================ insert into t_grade (gradename,courseid) values (#{gradeName},#{courseId}) update t_grade gradename=#{gradeName}, courseid=#{courseId}, where gradeid=#{gradeId} delete from t_grade where gradeid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Paper.xml ================================================ insert into t_paper (paperid,papername,courseid,gradeid,userid,questionid,begintime,endtime,allowtime,score,paperstate) values (#{paperId},#{paperName},#{courseId},#{gradeId},#{userId},#{questionId},#{beginTime},#{endTime},#{allowTime},#{score},#{paperState}) update t_paper papername=#{paperName}, gradeid=#{gradeId}, courseid=#{courseId}, userid=#{userId}, questionid=#{questionId}, begintime=#{beginTime}, endtime=#{endTime}, allowtime=#{allowTime}, score=#{score}, paperstate=#{paperState}, where paperid=#{paperId} delete from t_paper where paperid=#{id} update t_paper papername=#{paperName}, gradeid=#{gradeId}, courseid=#{courseId}, questionid=#{questionId}, begintime=#{beginTime}, endtime=#{endTime}, allowtime=#{allowTime}, score=#{score}, paperstate=#{paperState}, where paperid=#{paperId} and userid=#{userId} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Question.xml ================================================ insert into t_question (quesName,optiona,optionb,optionc,optiond,answer,useranswer,courseid,typeid,difficulty,remark,answerdetail,gradeid) values (#{quesName},#{optionA},#{optionB},#{optionC},#{optionD},#{answer},#{userAnswer},#{courseId},#{typeId},#{difficulty},#{remark},#{answerDetail},#{gradeId}) update t_question quesname=#{quesName}, optiona=#{optionA}, optionb=#{optionB}, optionc=#{optionC}, optiond=#{optionD}, answer=#{answer}, useranswer=#{userAnswer}, typeid=#{typeId}, gradeid=#{gradeId}, difficulty=#{difficulty}, remark=#{remark}, answerdetail=#{answerDetail}, courseid=#{courseId}, where questionid=#{questionId} delete from t_question where questionid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/Type.xml ================================================ insert into t_type (typename,score,remark) values (#{typeName},#{score},#{remark}) update t_type typename=#{typeName}, score=#{score}, remark=#{remark}, where typeid=#{typeId} delete from t_type where typeid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/edu/fjnu/online/mapper/User.xml ================================================ insert into t_user (userid,username,userpwd,grade,usertype,userstate,email,telephone,address,remark) values (#{userId},#{userName},#{userPwd},#{grade},#{userType},'0',#{email},#{telephone},#{address},#{remark}) update t_user username=#{userName}, userpwd=#{userPwd}, usertype=#{userType}, userstate=#{userState}, email=#{email}, telephone=#{telephone}, address=#{address}, remark=#{remark}, where userid=#{userId} delete from t_user where userid=#{id} ================================================ FILE: Check Maven Webapp/src/main/resources/jdbc.properties ================================================ jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/onlinetest?characterEncoding=utf-8 jdbc.username=root jdbc.password=123456 c3p0.pool.size.max=20 c3p0.pool.size.min=5 c3p0.pool.size.ini=3 c3p0.pool.size.increment=2 ================================================ FILE: Check Maven Webapp/src/main/resources/springmvc-servlet.xml ================================================ ================================================ FILE: Check Maven Webapp/src/main/resources/sqlMapConfig.xml ================================================ ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/course-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

课程管理

课程编号 课程名称 课程状态 操作
${o.courseId} ${o.courseName} ${o.courseState} 删除 编辑
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/course-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增课程

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/course-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

更新课程

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/grade-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

年级管理

年级编号 年级名称 包含课程 操作
${o.gradeId} ${o.gradeName} ${o.courseId} 删除 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/grade-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增年级

${o.courseName}

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/grade-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

查看年级信息

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/index.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试后台管理系统

你确定要退出系统?

如果是请点击“确定”,否则点“取消”

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-deal.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

身份审核

账号 昵称 账户类型 账户状态 邮箱 联系电话 操作
${o.userId} ${o.userName} 学生 老师 管理员 待审核 在用 注销 审核不通过 ${o.email} ${o.telephone} 通过 注销 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-det.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户信息查询

checked />${grade.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

信息管理

账号 昵称 账户类型 账户状态 邮箱 联系电话 操作
${o.userId} ${o.userName} 学生 老师 管理员 待审核 在用 注销 审核不通过 ${o.email} ${o.telephone} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户信息查询

checked />${grade.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户注册

${message }

${cs.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/info-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

修改用户信息

学生 老师 管理员

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/login.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试后台管理系统
CopyRight 2014  
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/paper-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

试卷管理

试卷编号 试卷名称 年级 对应科目 允许时长 操作
${o.paperId} ${o.paperName} ${o.gradeId} ${o.courseId} ${o.allowTime} 删除 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/paper-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

查看试卷

${paper.paperId }

${paper.paperName }

${paper.allowTime }分钟

${paper.courseId }

${paper.questionId }

${paper.score }

${paper.beginTime }

${paper.endTime }

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/paper-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增试卷

${cs.gradeName}
${cs.courseName}

${message }

分钟

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/question-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目管理

题目编号 题目名称 对应科目 题型 难度 备注 操作
${o.questionId} ${o.quesName} ${o.courseId} ${o.typeId} 简单 中等 较难 ${o.remark} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/question-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目详细

${question.questionId}

${question.gradeId}

${question.courseId}

${question.difficulty}

${question.typeId}

${question.quesName}

${question.optionA}

${question.optionB}

${question.optionC}

${question.optionD}

${question.answer}

${question.remark}

${question.answerDetail}

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/question-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目录入

${cs.gradeName}
${cs.courseName}
简单 中等 较难
${cs.typeName}

${message }

${message }

${message }

${message }

${message }

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/question-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目更新

checked />${grade.gradeName}
checked/>${course.courseName}
简单 中等 较难
checked/>${typeInfo.typeName}

${message }

${message }

${message }

${message }

${message }

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/type-info.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题型详情

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/type-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题型管理

编号 类型名称 分值 备注 操作
${o.typeId} ${o.typeName} ${o.score} ${o.remark} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/type-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

查看题型

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/type-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增题型

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/admin/type-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

更新题型

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/base.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/baseinfo/left.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../baselist.jsp" %>
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/baseinfo/main.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %> 模块介绍
货运模块介绍
购销合同 客户签单后,公司向厂家下达购销合同,包括货物的具体要求和交期。合同按不同厂家打印购销合同单,附件单独打印,由公司驻当地销售人员分发到各工厂。
归档:标识彻底完成的项目,方便统计。在报运时也不能在选这些合同。
出货表 根据合同和指定的船期月份,统计当月的出货情况。
出口报运单 根据购销合同制定出口商品报运单。报运时可以将多个购销合同形成一单报运;也可以只走部分货物。
分批走货:合同可以多个一起报运; 而一个合同可以分多次走货; 根据合同和合同货物的走货状态可以查看合同的走货情况。
HOME装箱单 根据出口报运单制定HOME装箱单,先制作HOME装箱单给客户看,客人同意,则直接制定相应装箱单;如有调整,则重新复制修改出口报运单,可能拆成多个报运。
装箱单 根据出口报运单制定装箱单,填写发票号、发票时间,以及客人等相关信息。
委托书 根据装箱制定海运或空运委托书。
发票 根据装箱制定发票。
财务出口报运单 根据报运制定财务出口报运单。
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/baselist.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="base.jsp"%> ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/bases.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/home/fmain.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> 陕西杰信商务综合管理平台 <body> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body> ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/home/left.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %>
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/home/olmsgList.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %>
 
2013-02-22 13:37
欢迎使用杰管理平台
[备忘]
 
2013-02-22 13:37
本系统实现货运企业日常管理
包括合同、报运、装箱、委托、发票等业务
[备忘]
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/home/title.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
您好:${_CURRENT_USER.realName}  | 您所属单位:${_CURRENT_USER.dept.deptName}  
鼠标指向箭头位置
可显示更多菜单项
<%//备忘录等使用%> ================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/index1.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="base.jsp" %> 陕西杰信商务综合管理平台
用户名:
密 码:
${errorInfo}
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/about.html ================================================ 在线考试系统

在线考试系统

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

界面简洁

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

操作简单

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

响应速度快

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

可扩展性高

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/about.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

在线考试系统

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

界面简洁

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

操作简单

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

响应速度快

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint

可扩展性高

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/index.html ================================================ 在线考试系统

OUR TEACHERS

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate.

FEDERICA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

PATRICK

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

THOMPSON

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

VICTORIA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

FEATURES

SPECIAL CARE ON STUDENTS

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatu.

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatu.

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/index.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

OUR TEACHERS

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate.

FEDERICA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

PATRICK

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

THOMPSON

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

VICTORIA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/login.html ================================================ Fullscreen Login

Login

+
没有账号? 注册
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/login.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户登录

<%-- ${message } --%>
${message }
没有账号? 注册
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/mybooks.html ================================================ 在线考试系统
35% Complete (success)
20% Complete (warning)
10% Complete (danger)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/mybooks.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
35% Complete (success)
20% Complete (warning)
10% Complete (danger)

${errorBook.question.quesName }

${errorBook.question.optionA }
${errorBook.question.optionB }
${errorBook.question.optionC }
${errorBook.question.optionD }

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/mypaper.html ================================================ 在线考试系统

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/mypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
${paper.paperName} ${paper.courseId} ${paper.beginTime} ${paper.endTime} ${paper.score} 准备考试 尚未开始 考试结束
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/onlinecheck.html ================================================ 在线考试系统
0天 0时 0分 0秒 考试中...

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/paperdetail.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <% java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date();//得到当前系统时间 String str_date1 = formatter.format(currentTime); //将日期时间格式化 String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 request.setAttribute("starttime ", str_date1); %> 在线考试系统
0时 0分 0秒 开始考试

${paper.paperName }

${selectQ }

${selType.quesName }

${selType.optionA }
${selType.optionB }
${selType.optionC }
${selType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>

${inpQ }

${inpType.quesName }


答案:

${desQ }

${desType.quesName }

答案:
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/qrypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <% java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date();//得到当前系统时间 String str_date1 = formatter.format(currentTime); //将日期时间格式化 String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 request.setAttribute("starttime ", str_date1); %> 在线考试系统

${paper.paperName }

${selectQ }

${selType.quesName }

${selType.optionA }
${selType.optionB }
${selType.optionC }
${selType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>

${inpQ }

${inpType.quesName }


答案:

${desQ }

${desType.quesName }

${desType.optionA }
${desType.optionB }
${desType.optionC }
${desType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/regist.html ================================================ 在线考试系统

用户注册

登录账号:
登录账号:
登录账号
登录账号:
登录账号:
登录账号:

我已经有一个账户,我要 登录

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/regist.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户注册


${message }

${grade.gradeName }  
${message }
我已经有一个账号,我要 登录
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/regist1.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户注册

登录账号:
登录账号:
登录账号
登录账号:
登录账号:
登录账号:

我已经有一个账户,我要 登录

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/scorequery.html ================================================ 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
高三(上)语文(期中)试题 语文 2017-03-14 10:00:00 2017-03-14 11:23:00 60 已完成
大一(上)数学(期中)试题 数学 2017-03-15 10:00:00 2017-03-15 11:23:00 80 已完成
大一(上)语文(期中)试题 语文 2017-03-16 10:00:00 2017-03-16 11:30:00 80 已完成
大一(上)英语(期中)试题 英语 2017-03-17 10:00:00 2017-03-17 11:30:00 80 已完成
大一(下)英语(期末)试题 语文 - - - 未开始
大一(下)数学(期末)试题 数学 - - - 未开始
大一(下)语文(期末)试题 英语 - - - 未开始
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/scorequery.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
${paper.paperName} ${paper.courseId} ${paper.beginTime} ${paper.endTime} ${paper.score} 准备考试 尚未开始 考试结束
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/tomypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/userinfo.html ================================================ 在线考试系统

Headings

h1. Bootstrap heading

Semibold 36px

h2. Bootstrap heading

Semibold 30px

h3. Bootstrap heading

Semibold 24px

h4. Bootstrap heading

Semibold 18px
h5. Bootstrap heading
Semibold 14px
h6. Bootstrap heading
Semibold 12px

Progress Bars

Info with progress-bar-info class.

Success with progress-bar-success class.

Warning with progress-bar-warning class.

Danger with progress-bar-danger class.

Inverse with progress-bar-inverse class.

Inverse with progress-bar-inverse class.

35% Complete (success)
20% Complete (warning)
10% Complete (danger)

Pagination

Breadcrumbs

Badges

Add modifier classes to change the appearance of a badge.

Classes Badges
No modifiers 42
.badge-primary 1
.badge-success 22
.badge-info 30
.badge-warning 412
.badge-danger 999

Easily highlight new or unread items with the .badge class

Tabs

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

Unordered List

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus
  • Porta ac consectetur ac
  • Vestibulum at eros

Ordered List

  1. Cras justo odio
  2. Dapibus ac facilisis in
  3. Morbi leo risus
  4. Porta ac consectetur ac
  5. Vestibulum at eros

Forms

@
@example.com
$ .00
@
@
@

Default styles

For basic stylinglight padding and only horizontal add the base class .table to any <table>.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Add any of the following classes to the .table base class.

Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE7-8).

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Add borders and rounded corners to the table.

# First Name Last Name Username
1 Mark Otto @mdo
Mark Otto @getbootstrap
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Enable a hover state on table rows within a <tbody>.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/pages/user/userinfo.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
用户账号:
用户昵称:
 年      级:
常用邮箱:
联系电话:
家庭地址:
原 密 码 :
新 密 码 :
重复密码:

 更 新  返回首页

================================================ FILE: Check Maven Webapp/src/main/webapp/WEB-INF/web.xml ================================================ Check encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true encodingFilter /* contextConfigLocation classpath:beans.xml org.springframework.web.context.ContextLoaderListener spingmvc org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springmvc-servlet.xml spingmvc *.action ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/amcharts_key.txt ================================================ AMCHART-LNKS-1966-6679-1965-1082 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/amcolumn_data.txt ================================================ USA;4.2;3.5 UK;3.1;1.7 Canada;2.9;2.8 Japan;2.3;2.6 France;2.1;1.4 Brazil;4.9;2.6 Russia;7.2;6.4 India;7.4;8.0 China;10.1;9.9 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/amcolumn_data.xml ================================================ 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -0.307 -0.168 -0.073 -0.027 -0.251 -0.281 -0.348 -0.074 -0.011 -0.074 -0.124 -0.024 -0.022 0.000 -0.296 -0.217 -0.147 -0.150 -0.160 -0.011 -0.068 -0.190 -0.056 0.077 -0.213 -0.170 -0.254 0.019 -0.063 0.050 0.077 0.120 0.011 0.177 -0.021 -0.037 0.030 0.179 0.180 0.104 0.255 0.210 0.065 0.110 0.172 0.269 0.141 0.353 0.548 0.298 0.267 0.411 0.462 0.470 0.445 0.470 -0.171 -0.175 -0.176 -0.174 -0.169 -0.162 -0.151 -0.139 -0.125 -0.114 -0.106 -0.104 -0.108 -0.114 -0.120 -0.125 -0.127 -0.125 -0.120 -0.114 -0.108 -0.104 -0.100 -0.097 -0.091 -0.082 -0.068 -0.050 -0.028 -0.006 0.015 0.032 0.046 0.058 0.069 0.081 0.094 0.108 0.123 0.137 0.150 0.163 0.178 0.195 0.216 0.241 0.268 0.296 0.323 0.348 0.370 0.389 0.404 0.415 0.422 0.426 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/amcolumn_data333.txt ================================================ 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -0.307 -0.168 -0.073 -0.027 -0.251 -0.281 -0.348 -0.074 -0.011 -0.074 -0.124 -0.024 -0.022 0.000 -0.296 -0.217 -0.147 -0.150 -0.160 -0.011 -0.068 -0.190 -0.056 0.077 -0.213 -0.170 -0.254 0.019 -0.063 0.050 0.077 0.120 0.011 0.177 -0.021 -0.037 0.030 0.179 0.180 0.104 0.255 0.210 0.065 0.110 0.172 0.269 0.141 0.353 0.548 0.298 0.267 0.411 0.462 0.470 0.445 0.470 -0.171 -0.175 -0.176 -0.174 -0.169 -0.162 -0.151 -0.139 -0.125 -0.114 -0.106 -0.104 -0.108 -0.114 -0.120 -0.125 -0.127 -0.125 -0.120 -0.114 -0.108 -0.104 -0.100 -0.097 -0.091 -0.082 -0.068 -0.050 -0.028 -0.006 0.015 0.032 0.046 0.058 0.069 0.081 0.094 0.108 0.123 0.137 0.150 0.163 0.178 0.195 0.216 0.241 0.268 0.296 0.323 0.348 0.370 0.389 0.404 0.415 0.422 0.426 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/amcolumn_settings.xml ================================================ column xml Tahoma 0 0 85 0 3 true #EED600 15 70 60 50 80 5 0 000000 5 3 45 true 0 1 1 85 false
column Anomaly B92F2F line Smoothed
================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/export.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="export.aspx.cs" Inherits="_export" %> ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/export.aspx.cs ================================================ using System; using System.Web; using System.Drawing; using System.Drawing.Imaging; public partial class _export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Form["width"] != null && Request.Form["width"] != String.Empty) { // image dimensions int width = Int32.Parse((Request.Form["width"].IndexOf('.') != -1) ? Request.Form["width"].Substring(0, Request.Form["width"].IndexOf('.')) : Request.Form["width"]); int height = Int32.Parse((Request.Form["height"].IndexOf('.') != -1) ? Request.Form["height"].Substring(0, Request.Form["height"].IndexOf('.')) : Request.Form["height"]); // image Bitmap result = new Bitmap(width, height); // set pixel colors for (int y = 0; y < height; y++) { // column counter for the row int x = 0; // get current row data string[] row = Request.Form["r" + y].Split(new char[] { ',' }); // set pixels in the row for (int c = 0; c < row.Length; c++) { // get pixel color and repeat count string[] pixel = row[c].Split(new char[] { ':' }); Color current_color = ColorTranslator.FromHtml("#" + pixel[0]); int repeat = pixel.Length > 1 ? Int32.Parse(pixel[1]) : 1; // set pixel(s) for (int l = 0; l < repeat; l++) { result.SetPixel(x, y, current_color); x++; } } } // output image // image type Response.ContentType = "image/jpeg"; Response.AddHeader("Content-Disposition", "attachment; filename=\"amchart.jpg\""); // find image encoder for selected type ImageCodecInfo[] encoders; ImageCodecInfo img_encoder = null; encoders = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in encoders) if (codec.MimeType == Response.ContentType) { img_encoder = codec; break; } // image parameters EncoderParameter jpeg_quality = new EncoderParameter(Encoder.Quality, 100L); // for jpeg images only EncoderParameters enc_params = new EncoderParameters(1); enc_params.Param[0] = jpeg_quality; result.Save(Response.OutputStream, img_encoder, enc_params); } else { // invalid post Response.Write("Invalid post"); } } } ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/export.php ================================================ ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amcolumn/swfobject.js ================================================ /** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/amcharts_key.txt ================================================ AMCHART-LNKS-1966-6679-1965-1082 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/amline_data.txt ================================================ 1949;2.54;20.21 1950;2.51;19.73 1951;2.53;18.43 1952;2.53;18.08 1953;2.68;19.01 1954;2.78;19.57 1955;2.77;19.58 1956;2.79;19.43 1957;3.09;20.83 1958;3.01;19.73 1959;2.90;18.87 1960;2.88;18.43 1961;2.89;18.31 1962;2.90;18.19 1963;2.89;17.89 1964;2.88;17.60 1965;2.86;17.20 1966;2.88;16.84 1967;2.92;16.56 1968;2.94;16.00 1969;3.09;15.95 1970;3.18;15.52 1971;3.39;15.85 1972;3.39;15.36 1973;3.89;16.59 1974;6.87;26.39 1975;7.67;27.00 1976;8.19;27.26 1977;8.57;26.78 1978;9.00;26.14 1979;12.64;32.98 1980;21.59;49.63 1981;31.77;66.20 1982;28.52;55.98 1983;26.19;49.80 1984;25.88;47.18 1985;24.09;42.40 1986;12.51;21.62 1987;15.40;25.68 1988;12.58;20.14 1989;15.86;24.22 1990;20.03;29.03 1991;16.54;23.00 1992;15.99;21.59 1993;14.25;18.68 1994;13.19;16.86 1995;14.62;18.17 1996;18.46;22.40 1997;17.23;20.39 1998;10.87;12.66 1999;15.56;17.78 2000;26.72;29.54 2001;21.84;23.39 2002;22.51;23.78 2003;27.54;28.42 2004;38.93;54.93 2005;46.47;47.97 2006;58.30;58.30 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/amline_data.xml ================================================ 1949 1950 1951 1951 1951 2.54 2.51 2.53 5 1 ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/amline_settings.xml ================================================ 2 true 44 left
left Nominal #FFCC00 left Inflation adjusted #999999 false
================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/export.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="export.aspx.cs" Inherits="_export" %> ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/export.aspx.cs ================================================ using System; using System.Web; using System.Drawing; using System.Drawing.Imaging; public partial class _export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Form["width"] != null && Request.Form["width"] != String.Empty) { // image dimensions int width = Int32.Parse((Request.Form["width"].IndexOf('.') != -1) ? Request.Form["width"].Substring(0, Request.Form["width"].IndexOf('.')) : Request.Form["width"]); int height = Int32.Parse((Request.Form["height"].IndexOf('.') != -1) ? Request.Form["height"].Substring(0, Request.Form["height"].IndexOf('.')) : Request.Form["height"]); // image Bitmap result = new Bitmap(width, height); // set pixel colors for (int y = 0; y < height; y++) { // column counter for the row int x = 0; // get current row data string[] row = Request.Form["r" + y].Split(new char[] { ',' }); // set pixels in the row for (int c = 0; c < row.Length; c++) { // get pixel color and repeat count string[] pixel = row[c].Split(new char[] { ':' }); Color current_color = ColorTranslator.FromHtml("#" + pixel[0]); int repeat = pixel.Length > 1 ? Int32.Parse(pixel[1]) : 1; // set pixel(s) for (int l = 0; l < repeat; l++) { result.SetPixel(x, y, current_color); x++; } } } // output image // image type Response.ContentType = "image/jpeg"; Response.AddHeader("Content-Disposition", "attachment; filename=\"amchart.jpg\""); // find image encoder for selected type ImageCodecInfo[] encoders; ImageCodecInfo img_encoder = null; encoders = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in encoders) if (codec.MimeType == Response.ContentType) { img_encoder = codec; break; } // image parameters EncoderParameter jpeg_quality = new EncoderParameter(Encoder.Quality, 100L); // for jpeg images only EncoderParameters enc_params = new EncoderParameters(1); enc_params.Param[0] = jpeg_quality; result.Save(Response.OutputStream, img_encoder, enc_params); } else { // invalid post Response.Write("Invalid post"); } } } ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/export.php ================================================ ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline/swfobject.js ================================================ /** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",encodeURIComponent(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; ================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/amline.html ================================================ Line & Area chart
You need to upgrade your Flash Player
================================================ FILE: Check Maven Webapp/src/main/webapp/components/chart/amline_1.6.4.1/changelog.txt ================================================ *** CHANGE LOG ***************************************************************** *** 1.6.4.0 ******************************************************************** FEATURE ADDED amReturnParam function also returns the param name: amReturnParam(chart_id, value, param); *** 1.6.3.1 ******************************************************************** FIX: stacking issue with missing values fixed FIX: balloons do not go above the plot area FIX: js function print could print three charts instead of one *** 1.6.3.0 ******************************************************************** FEATURE ADDED: New settings and added. If absolute value of your number is equal or bigger then scientific_max or equal or less then scientific_min, this number will be formatted using scientific notation, for example: 15000000000000000 -> 1.5e16 0.0000023 -> 2.3e-6 FIX: amClickedOnSeries is not called anymore when zooming the chart. *** 1.6.2.1 ******************************************************************** FEATURE ADDED: a new setting, was added. It allows disabling all javascript-html communication. Id you set this to false, then the chart won't listen and won't call any JavaScript functions. This will also disable the security warning message when opening the chart from your hard drive or CD. *** 1.6.2.0 ******************************************************************** FEATURE ADDED:Y axis values can be formatted as duration. To do this, you have to tell the duration unit of your data. For example, if your data represents seconds, you have to set: ss The units of the duration can be changed in the section. FIX: you can call JS functions after amError function was called by the chart FIX: amClickedOnSeries function is called even the zoomable is set to false now *** 1.6.1.4 ******************************************************************** FEATURE ADDED: Margins can be set in percents now FIX: balloon.text_color setting was ignored FIX: in some cases, when values were missing and axis type was "stacked" or "100% stacked" the area to the stacked graph was filled incorrectly FIX: amGetZoom was called when resizing window (if the redraw was set to true) FIX: if balloon.only_one was set to true, the balloon wasn't appearing if the graph was hidden or not selected and the mouse was close to this graph. *** 1.6.1.3 ******************************************************************** FIX: amGetZoom returned "undefined" if the indicator was moved off the plot area to the right side. *** 1.6.1.2 ******************************************************************** FIX: incorrect scroller could appear after reloadData javascript function was called. The chart didn't accept new JS functions if error, such as no data occureed *** 1.6.1.1 ******************************************************************** FIX: the indicator could go left of the plot area *** 1.6.1.0 ******************************************************************** IMPORTANT UPDATE: JS functions amClickedOnSeries(), amClickedOnBullet() and amRolledOverBullet() changed - now the first parameter they return is chart_id, like for all the other JS functions which are called by flash. If you are using these functions, you will have to update your scripts. FEATURE ADDED: JavaScript functions are cued now - previously you could call one JS function at a time and call another only after the chart finished the previous process. Now, you can call several functions one after another, without waiting for the chart to finish doing something. The functions are cued and all of them will be executed. FEATURE ADDED: New JavaScript function amProcessCompleted(chart_id, process) This function is called after some process initialized by some JS function is finished. For example, if you make the chart to reload data by calling reloadData function, after the data is reloaded, the chart will call amProcessCompleted function and the "process" parameter will be "reloadData" - the same as the function name you called. Check examples/javascript_control example to see this in action. FIX: The bullets might be displayed out of plot area, when the was set to true and the graph's values were out of the and range. FIX: If all the graphs of one axis were hidden, the grid and values still remained. FIX: chart_id was lost after the use of setSettings JS function. *** 1.6.0.0 ******************************************************************** FEATURE ADDED: RESCALING THE CHART WHEN THE GRAPH IS HIDDEN When you click on the legend key, the graph is hidden or shown. Now the chart recalculates min and max values (rescales the chart) when you do this. You can turn this feature off by setting to "false". FEATURE ADDED: AUTO-FITTING OF THE LEGEND and X AXIS VALUES The legend now automatically adjusts bottom margin to fit to the flash object's area. If your X axis values are rotated, the legend position is adjusted not to overlap the values. In order this to work, you have to leave setting empty. FEATURE ADDED: Y BALLOONS NO LONGER OVERLAP FEATURE ADDED: NEW BULLET TYPES New bullet types are: square_outline and round_outline FEATURE ADDED: CHART TYPE CAN BE SET SEPARATELY FOR RIGHT AND LEFT AXES Previously you set the same (line, stacked, 100% stacked) for both left and right axes. Now you can set the type separately. This setting is now in section. FEATURE ADDED: MORE SETTINGS FOR THE Y BALLOON New balloon settings allows you to have balloon border and rounded corners: The setting replaced the setting, and the replaced the . The old ones will also work. FEATURE ADDED: POSSIBILITY TO SET ARRAY OF COLORS Using setting, you can set an array fo colors, which will be used if the graph's color is not set. FEATURE ADDED: CHANGE MULTIPLE SETTINGS WITH JAVASCRIPT Using new function, flashMovie.setSettings(settings, rebuild) You can control multiple settings. It is recommended to use this new function even for one setting, instead of setParam() function. The "rebuild" option might be "true" or "false" (the default is "true"). If you set it to "false", then the settings will not be applied until you call another new JS function: flashMovie.rebuild() or pass another set of settings with the "rebuild" set to "true". A new function flashMovie.getSettings() will return the full settings XML by calling amReturnSettings(chart_id, settings) function. FEATURE ADDED: IMAGE DATA IS PASSED TO JAVASCRIPT When exporting chart as an image, the chart passes image data to JavaScript function: amReturnImageData(chart_id, data) FEATURE ADDED: FONT COLOR AND SIZE OF A LABEL TEXT Can accept font color and font size HTML tags now, for example: amCharts]]> CHANGE OF THE DEFAULT SETTINGS: default value was changed to "false" FIXES: When adding some settings using additional_chart_settings variable, you don't need to set all the or
'; if (node._hc) { str += '
'; str += this.addNode(node); str += '
'; } this.aIndent.pop(); return str; }; // Adds the empty and line icons dTree.prototype.indent = function(node, nodeId) { var str = ''; if (this.root.id != node.pid) { for (var n=0; n'; (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); if (node._hc) { str += ''; } else str += ''; } return str; }; // Checks if a node has any children and if it is the last sibling dTree.prototype.setCS = function(node) { var lastId; for (var n=0; n Destroydrop » Javascripts » Tree

Destroydrop » Javascripts » Tree

Example

open all | close all

©2002-2003 Geir Landrö

================================================ FILE: Check Maven Webapp/src/main/webapp/js/dtree/tdtree/frame.html ================================================ self J2ee Frame

Open all | Close all

================================================ FILE: Check Maven Webapp/src/main/webapp/js/easing.js ================================================ /* * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php * * Uses the built In easIng capabilities added In jQuery 1.1 * to offer multiple easIng options * * Copyright (c) 2007 George Smith * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.extend( jQuery.easing, { easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); ================================================ FILE: Check Maven Webapp/src/main/webapp/js/index.js ================================================ $(".nav").on("click","li",function(){ $(this).siblings().removeClass("current"); var hasChild = !!$(this).find(".subnav").size(); if(hasChild){ $(this).toggleClass("hasChild"); } $(this).addClass("current"); }); $(window).resize(function(e) { $("#bd").height($(window).height() - $("#hd").height() - $("#ft").height()-6); $(".wrap").height($("#bd").height()-6); $(".nav").css("minHeight", $(".sidebar").height() - $(".sidebar-header").height()-1); $("#iframe").height($(window).height() - $("#hd").height() - $("#ft").height()-12); }).resize(); $(".nav>li").css({"borderColor":"#dbe9f1"}); $(".nav>.current").prev().css({"borderColor":"#7ac47f"}); $(".nav").on("click","li",function(e){ var aurl = $(this).find("a").attr("date-src"); $("#iframe").attr("src",aurl); $(".nav>li").css({"borderColor":"#dbe9f1"}); $(".nav>.current").prev().css({"borderColor":"#7ac47f"}); return false; }); $('.exitDialog').Dialog({ title:'提示信息', autoOpen: false, width:400, height:200 }); $('.exit').click(function(){ $('.exitDialog').Dialog('open'); }); $('.exitDialog input[type=button]').click(function(e) { $('.exitDialog').Dialog('close'); if($(this).hasClass('ok')){ window.location.href = "exitSys.action" ; } }); ================================================ FILE: Check Maven Webapp/src/main/webapp/js/jquery-1.10.1.js ================================================ /*! * jQuery JavaScript Library v1.10.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-05-30T21:49Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.9.4-pre * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-05-27 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function() { return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied if the test fails * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler */ function addHandle( attrs, handler, test ) { attrs = attrs.split("|"); var current, i = attrs.length, setHandle = test ? null : handler; while ( i-- ) { // Don't override a user's handler if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) { Expr.attrHandle[ attrs[i] ] = setHandle; } } } /** * Fetches boolean attributes by node * @param {Element} elem * @param {String} name */ function boolHandler( elem, name ) { // XML does not need to be checked as this will not be assigned for XML documents var val = elem.getAttributeNode( name ); return val && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } /** * Fetches attributes without interpolation * http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx * @param {Element} elem * @param {String} name */ function interpolationHandler( elem, name ) { // XML does not need to be checked as this will not be assigned for XML documents return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } /** * Uses defaultValue to retrieve value in IE6/7 * @param {Element} elem * @param {String} name */ function valueHandler( elem ) { // Ignore the value *property* on inputs by using defaultValue // Fallback to Sizzle.attr by returning undefined where appropriate // XML does not need to be checked as this will not be assigned for XML documents if ( elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns Returns -1 if a precedes b, 1 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.parentWindow; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 if ( parent && parent.frameElement ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { // Support: IE<8 // Prevent attribute/property "interpolation" div.innerHTML = ""; addHandle( "type|href|height|width", interpolationHandler, div.firstChild.getAttribute("href") === "#" ); // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies addHandle( booleans, boolHandler, div.getAttribute("disabled") == null ); div.className = "i"; return !div.getAttribute("className"); }); // Support: IE<9 // Retrieving value should defer to defaultValue support.input = assert(function( div ) { div.innerHTML = ""; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }); // IE6/7 still return empty string for value, // but are actually retrieving the property addHandle( "value", valueHandler, support.attributes && support.input ); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "
"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = ""; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( doc.createElement("div") ) & 1; }); // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = ( fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined ); return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Initialize against the default document setDocument(); // Support: Chrome<<14 // Always assume duplicates if they aren't passed to the comparison function [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = "
a"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "
t
"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "
"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "" ], legend: [ 1, "
", "
" ], area: [ 1, "", "" ], param: [ 1, "", "" ], thead: [ 1, "", "
" ], tr: [ 2, "", "
" ], col: [ 2, "", "
" ], td: [ 3, "", "
" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted from table fragments if ( !jQuery.support.tbody ) { // String was a , *may* have spurious elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare or wrap[1] === "
" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("
XXXXX Office System
Automation V2.0XXXXX

你确定要退出系统?

如果是请点击“确定”,否则点“取消”

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-deal.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

身份审核

账号 昵称 账户类型 账户状态 邮箱 联系电话 操作
${o.userId} ${o.userName} 学生 老师 管理员 待审核 在用 注销 审核不通过 ${o.email} ${o.telephone} 通过 注销 查看
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-det.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户信息查询

checked />${grade.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

信息管理

账号 昵称 账户类型 账户状态 邮箱 联系电话 操作
${o.userId} ${o.userName} 学生 老师 管理员 待审核 在用 注销 审核不通过 ${o.email} ${o.telephone} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户信息查询

checked />${grade.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

用户注册

${message }

${cs.gradeName}
学生 老师 管理员

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/info-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

修改用户信息

学生 老师 管理员

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/login.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试后台管理系统
CopyRight 2014  
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/paper-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

试卷管理

试卷编号 试卷名称 年级 对应科目 允许时长 操作
${o.paperId} ${o.paperName} ${o.gradeId} ${o.courseId} ${o.allowTime} 删除 查看
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/paper-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

查看试卷

${paper.paperId }

${paper.paperName }

${paper.allowTime }分钟

${paper.courseId }

${paper.questionId }

${paper.score }

${paper.beginTime }

${paper.endTime }

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/paper-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增试卷

${cs.gradeName}
${cs.courseName}

${message }

分钟

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/question-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目管理

题目编号 题目名称 对应科目 题型 难度 备注 操作
${o.questionId} ${o.quesName} ${o.courseId} ${o.typeId} 简单 中等 较难 ${o.remark} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/question-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目详细

${question.questionId}

${question.gradeId}

${question.courseId}

${question.difficulty}

${question.typeId}

${question.quesName}

${question.optionA}

${question.optionB}

${question.optionC}

${question.optionD}

${question.answer}

${question.remark}

${question.answerDetail}

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/question-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目录入

${cs.gradeName}
${cs.courseName}
简单 中等 较难
${cs.typeName}

${message }

${message }

${message }

${message }

${message }

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/question-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题目更新

checked />${grade.gradeName}
checked/>${course.courseName}
简单 中等 较难
checked/>${typeInfo.typeName}

${message }

${message }

${message }

${message }

${message }

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/type-info.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题型详情

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/type-mgt.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

题型管理

编号 类型名称 分值 备注 操作
${o.typeId} ${o.typeName} ${o.score} ${o.remark} 删除 编辑 查看
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/type-qry.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

查看题型

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/type-reg.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

新增题型

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/admin/type-upd.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 移动办公自动化系统

更新题型

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/base.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/baseinfo/left.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../baselist.jsp" %>
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/baseinfo/main.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %> 模块介绍
货运模块介绍
购销合同 客户签单后,公司向厂家下达购销合同,包括货物的具体要求和交期。合同按不同厂家打印购销合同单,附件单独打印,由公司驻当地销售人员分发到各工厂。
归档:标识彻底完成的项目,方便统计。在报运时也不能在选这些合同。
出货表 根据合同和指定的船期月份,统计当月的出货情况。
出口报运单 根据购销合同制定出口商品报运单。报运时可以将多个购销合同形成一单报运;也可以只走部分货物。
分批走货:合同可以多个一起报运; 而一个合同可以分多次走货; 根据合同和合同货物的走货状态可以查看合同的走货情况。
HOME装箱单 根据出口报运单制定HOME装箱单,先制作HOME装箱单给客户看,客人同意,则直接制定相应装箱单;如有调整,则重新复制修改出口报运单,可能拆成多个报运。
装箱单 根据出口报运单制定装箱单,填写发票号、发票时间,以及客人等相关信息。
委托书 根据装箱制定海运或空运委托书。
发票 根据装箱制定发票。
财务出口报运单 根据报运制定财务出口报运单。
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/baselist.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="base.jsp"%> ================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/bases.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/home/fmain.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> 陕西杰信商务综合管理平台 <body> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body> ================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/home/left.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %>
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/home/olmsgList.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %>
 
2013-02-22 13:37
欢迎使用杰管理平台
[备忘]
 
2013-02-22 13:37
本系统实现货运企业日常管理
包括合同、报运、装箱、委托、发票等业务
[备忘]
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/home/title.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="../base.jsp" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
您好:${_CURRENT_USER.realName}  | 您所属单位:${_CURRENT_USER.dept.deptName}  
鼠标指向箭头位置
可显示更多菜单项
<%//备忘录等使用%> ================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/index1.jsp ================================================ <%@ page language="java" pageEncoding="UTF-8"%> <%@ include file="base.jsp" %> 陕西杰信商务综合管理平台
用户名:
密 码:
${errorInfo}
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/index.html ================================================ 在线考试系统

OUR TEACHERS

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate.

FEDERICA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

PATRICK

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

THOMPSON

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

VICTORIA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

FEATURES

SPECIAL CARE ON STUDENTS

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatu.

Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatu.

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/index.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

OUR TEACHERS

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate.

FEDERICA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

PATRICK

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

THOMPSON

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

VICTORIA

Co-founder

Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/login.html ================================================ Fullscreen Login

Login

+
没有账号? 注册
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/login.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户登录

<%-- ${message } --%>
${message }
没有账号? 注册
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/mybooks.html ================================================ 在线考试系统
35% Complete (success)
20% Complete (warning)
10% Complete (danger)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/mybooks.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
35% Complete (success)
20% Complete (warning)
10% Complete (danger)

${errorBook.question.quesName }

${errorBook.question.optionA }
${errorBook.question.optionB }
${errorBook.question.optionC }
${errorBook.question.optionD }

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/mypaper.html ================================================ 在线考试系统

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/mypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
${paper.paperName} ${paper.courseId} ${paper.beginTime} ${paper.endTime} ${paper.score} 准备考试 尚未开始 考试结束
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/onlinecheck.html ================================================ 在线考试系统
0天 0时 0分 0秒 考试中...

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/paperdetail.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <% java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date();//得到当前系统时间 String str_date1 = formatter.format(currentTime); //将日期时间格式化 String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 request.setAttribute("starttime ", str_date1); %> 在线考试系统
0时 0分 0秒 开始考试

${paper.paperName }

${selectQ }

${selType.quesName }

${selType.optionA }
${selType.optionB }
${selType.optionC }
${selType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>

${inpQ }

${inpType.quesName }


答案:

${desQ }

${desType.quesName }

${desType.optionA }
${desType.optionB }
${desType.optionC }
${desType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/qrypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <% java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date();//得到当前系统时间 String str_date1 = formatter.format(currentTime); //将日期时间格式化 String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 request.setAttribute("starttime ", str_date1); %> 在线考试系统

${paper.paperName }

${selectQ }

${selType.quesName }

${selType.optionA }
${selType.optionB }
${selType.optionC }
${selType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>

${inpQ }

${inpType.quesName }


答案:

${desQ }

${desType.quesName }

${desType.optionA }
${desType.optionB }
${desType.optionC }
${desType.optionD }
<%--

我的答案:${errorBook.userAnswer }

标准答案:${errorBook.question.answer }( ${errorBook.question.answerDetail })

解析:${errorBook.question.remark }

--%>
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/regist.html ================================================ 在线考试系统

用户注册

登录账号:
登录账号:
登录账号
登录账号:
登录账号:
登录账号:

我已经有一个账户,我要 登录

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/regist.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户注册


${message }

${grade.gradeName }  
${message }
我已经有一个账号,我要 登录
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/regist1.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

用户注册

登录账号:
登录账号:
登录账号
登录账号:
登录账号:
登录账号:

我已经有一个账户,我要 登录

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/scorequery.html ================================================ 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
高三(上)语文(期中)试题 语文 2017-03-14 10:00:00 2017-03-14 11:23:00 60 已完成
大一(上)数学(期中)试题 数学 2017-03-15 10:00:00 2017-03-15 11:23:00 80 已完成
大一(上)语文(期中)试题 语文 2017-03-16 10:00:00 2017-03-16 11:30:00 80 已完成
大一(上)英语(期中)试题 英语 2017-03-17 10:00:00 2017-03-17 11:30:00 80 已完成
大一(下)英语(期末)试题 语文 - - - 未开始
大一(下)数学(期末)试题 数学 - - - 未开始
大一(下)语文(期末)试题 英语 - - - 未开始
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/scorequery.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
试卷名称 试卷科目 开始时间 结束时间 最后得分 试卷状态
${paper.paperName} ${paper.courseId} ${paper.beginTime} ${paper.endTime} ${paper.score} 准备考试 尚未开始 考试结束
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/tomypaper.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统

高三(上)语文(期中)试题

一、选择题(每题5分)

下列词语中,没有错别字的一项是( )

A.妨碍 功夫片 钟灵毓秀 管中窥豹,可见一斑
B.梳妆 吊胃口 瞠目结舌 文武之道,一张一驰
C.辐射 入场券 循章摘句 风声鹤唳,草木皆兵
D.蜚然 直辖市 秘而不宣 城门失火,殃及池鱼

我的答案:D

标准答案:A( B.文武之道,一张一弛;C.寻章摘句;D.斐然)

解析:本题考察的都是高考高频字形。

下列词语中加点字的读音,全部正确的一项是( )

A.暂时zàn 埋怨mái 谆谆告诫zhūn 引吭高歌háng
B.豆豉chǐ 踝骨huái 踉踉跄跄cāng 按图索骥jì
C.梗概gěn 删改shān 炊烟袅袅niǎo 明眸皓齿móu
D.搁浅gē 解剖pōu 鬼鬼祟祟suì 不屑一顾xiè

我的答案:D

标准答案:D ( A.埋 mán, B.跄 qiàng C.梗gěng )

解析:本题考察的都是基础字音,没有出现偏难怪的字音。

下列各句中加点词语的使用,不恰当的一项是( )

A.“2015年度中国文化跨界论坛”日前在北京举行,届时来自世界各国的艺术家、企业家和媒体人围绕当前文化创意产业发展中的热点进行了交流。
B.对于那些熟稔互联网的人来说,进行“互联网+”创业,最难的可能并不是“互联网”这一部分,而是“+”什么以及怎么“+”的问题。
C.这家民用小型无人机公司一年前还寂寂无闻,一年后却声名鹊起,其系列产品先后被评为“十大科技产品“2014年杰出高科技产品”。
D.近年来,广袤蜀地的新村建设全面推进,大巴山区漂亮民居星罗棋雍,大凉山上彝家 新寨鳞次栉比,西部高原羌寨碉楼拔地而起。

我的答案:D

标准答案:A(届时是“到时候”的意思,而本句所叙述的是已经发生了的事实。)解析:本题考察的是词语和成语运用。都是考纲内的高频词语辨析和成语分析,难度不大。

解析:

下列各句中,没有语病的一项是( )

A.首届“书香之家”颁奖典礼,是设在杜甫草堂古色古香的仰止堂举行的,当场揭晓了书香家庭、书香校园、书香企业、书香社区等获奖名单。
B.专家强调,必须牢固树立保护生态环境就是保护生产力的理念,形成绿水青山也是金山银山的生态意识,构建与生态文明相适应的发展模式。
C.市旅游局要求各风景区进一步加强对景区厕所、停车场的建设和管理,整治和引导不文明旅游的各种顽疾和陋习,有效提升景区的服务水平。
D.《四川省农村扶贫开发条例》是首次四川针对贫困人群制定的地方性法规,将精准扶贫确定为重要原则,从最贫困村户人手,让老乡过上好日子。

二、填空题(每题5分)

@
@example.com

三、判断题(每题5分)

@
@example.com

四、简答题(每题20分)

@
@example.com

Forms

@
@example.com
$ .00
@
@
@
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/userinfo.html ================================================ 在线考试系统

Headings

h1. Bootstrap heading

Semibold 36px

h2. Bootstrap heading

Semibold 30px

h3. Bootstrap heading

Semibold 24px

h4. Bootstrap heading

Semibold 18px
h5. Bootstrap heading
Semibold 14px
h6. Bootstrap heading
Semibold 12px

Progress Bars

Info with progress-bar-info class.

Success with progress-bar-success class.

Warning with progress-bar-warning class.

Danger with progress-bar-danger class.

Inverse with progress-bar-inverse class.

Inverse with progress-bar-inverse class.

35% Complete (success)
20% Complete (warning)
10% Complete (danger)

Pagination

Breadcrumbs

Badges

Add modifier classes to change the appearance of a badge.

Classes Badges
No modifiers 42
.badge-primary 1
.badge-success 22
.badge-info 30
.badge-warning 412
.badge-danger 999

Easily highlight new or unread items with the .badge class

Tabs

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

Unordered List

  • Cras justo odio
  • Dapibus ac facilisis in
  • Morbi leo risus
  • Porta ac consectetur ac
  • Vestibulum at eros

Ordered List

  1. Cras justo odio
  2. Dapibus ac facilisis in
  3. Morbi leo risus
  4. Porta ac consectetur ac
  5. Vestibulum at eros

Forms

@
@example.com
$ .00
@
@
@

Default styles

For basic stylinglight padding and only horizontal add the base class .table to any <table>.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Add any of the following classes to the .table base class.

Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE7-8).

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Add borders and rounded corners to the table.

# First Name Last Name Username
1 Mark Otto @mdo
Mark Otto @getbootstrap
2 Jacob Thornton @fat
3 Larry the Bird @twitter

Enable a hover state on table rows within a <tbody>.

# First Name Last Name Username
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/pages/user/userinfo.jsp ================================================ <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 在线考试系统
用户账号:
用户昵称:
 年      级:
常用邮箱:
联系电话:
家庭地址:
原 密 码 :
新 密 码 :
重复密码:

 更 新  返回首页

================================================ FILE: Check Maven Webapp/target/Check/WEB-INF/web.xml ================================================ Check encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true encodingFilter /* contextConfigLocation classpath:beans.xml org.springframework.web.context.ContextLoaderListener spingmvc org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springmvc-servlet.xml spingmvc *.action ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/amcharts_key.txt ================================================ AMCHART-LNKS-1966-6679-1965-1082 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/amcolumn_data.txt ================================================ USA;4.2;3.5 UK;3.1;1.7 Canada;2.9;2.8 Japan;2.3;2.6 France;2.1;1.4 Brazil;4.9;2.6 Russia;7.2;6.4 India;7.4;8.0 China;10.1;9.9 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/amcolumn_data.xml ================================================ 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -0.307 -0.168 -0.073 -0.027 -0.251 -0.281 -0.348 -0.074 -0.011 -0.074 -0.124 -0.024 -0.022 0.000 -0.296 -0.217 -0.147 -0.150 -0.160 -0.011 -0.068 -0.190 -0.056 0.077 -0.213 -0.170 -0.254 0.019 -0.063 0.050 0.077 0.120 0.011 0.177 -0.021 -0.037 0.030 0.179 0.180 0.104 0.255 0.210 0.065 0.110 0.172 0.269 0.141 0.353 0.548 0.298 0.267 0.411 0.462 0.470 0.445 0.470 -0.171 -0.175 -0.176 -0.174 -0.169 -0.162 -0.151 -0.139 -0.125 -0.114 -0.106 -0.104 -0.108 -0.114 -0.120 -0.125 -0.127 -0.125 -0.120 -0.114 -0.108 -0.104 -0.100 -0.097 -0.091 -0.082 -0.068 -0.050 -0.028 -0.006 0.015 0.032 0.046 0.058 0.069 0.081 0.094 0.108 0.123 0.137 0.150 0.163 0.178 0.195 0.216 0.241 0.268 0.296 0.323 0.348 0.370 0.389 0.404 0.415 0.422 0.426 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/amcolumn_data333.txt ================================================ 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 -0.307 -0.168 -0.073 -0.027 -0.251 -0.281 -0.348 -0.074 -0.011 -0.074 -0.124 -0.024 -0.022 0.000 -0.296 -0.217 -0.147 -0.150 -0.160 -0.011 -0.068 -0.190 -0.056 0.077 -0.213 -0.170 -0.254 0.019 -0.063 0.050 0.077 0.120 0.011 0.177 -0.021 -0.037 0.030 0.179 0.180 0.104 0.255 0.210 0.065 0.110 0.172 0.269 0.141 0.353 0.548 0.298 0.267 0.411 0.462 0.470 0.445 0.470 -0.171 -0.175 -0.176 -0.174 -0.169 -0.162 -0.151 -0.139 -0.125 -0.114 -0.106 -0.104 -0.108 -0.114 -0.120 -0.125 -0.127 -0.125 -0.120 -0.114 -0.108 -0.104 -0.100 -0.097 -0.091 -0.082 -0.068 -0.050 -0.028 -0.006 0.015 0.032 0.046 0.058 0.069 0.081 0.094 0.108 0.123 0.137 0.150 0.163 0.178 0.195 0.216 0.241 0.268 0.296 0.323 0.348 0.370 0.389 0.404 0.415 0.422 0.426 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/amcolumn_settings.xml ================================================ column xml Tahoma 0 0 85 0 3 true #EED600 15 70 60 50 80 5 0 000000 5 3 45 true 0 1 1 85 false
column Anomaly B92F2F line Smoothed
================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/export.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="export.aspx.cs" Inherits="_export" %> ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/export.aspx.cs ================================================ using System; using System.Web; using System.Drawing; using System.Drawing.Imaging; public partial class _export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Form["width"] != null && Request.Form["width"] != String.Empty) { // image dimensions int width = Int32.Parse((Request.Form["width"].IndexOf('.') != -1) ? Request.Form["width"].Substring(0, Request.Form["width"].IndexOf('.')) : Request.Form["width"]); int height = Int32.Parse((Request.Form["height"].IndexOf('.') != -1) ? Request.Form["height"].Substring(0, Request.Form["height"].IndexOf('.')) : Request.Form["height"]); // image Bitmap result = new Bitmap(width, height); // set pixel colors for (int y = 0; y < height; y++) { // column counter for the row int x = 0; // get current row data string[] row = Request.Form["r" + y].Split(new char[] { ',' }); // set pixels in the row for (int c = 0; c < row.Length; c++) { // get pixel color and repeat count string[] pixel = row[c].Split(new char[] { ':' }); Color current_color = ColorTranslator.FromHtml("#" + pixel[0]); int repeat = pixel.Length > 1 ? Int32.Parse(pixel[1]) : 1; // set pixel(s) for (int l = 0; l < repeat; l++) { result.SetPixel(x, y, current_color); x++; } } } // output image // image type Response.ContentType = "image/jpeg"; Response.AddHeader("Content-Disposition", "attachment; filename=\"amchart.jpg\""); // find image encoder for selected type ImageCodecInfo[] encoders; ImageCodecInfo img_encoder = null; encoders = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in encoders) if (codec.MimeType == Response.ContentType) { img_encoder = codec; break; } // image parameters EncoderParameter jpeg_quality = new EncoderParameter(Encoder.Quality, 100L); // for jpeg images only EncoderParameters enc_params = new EncoderParameters(1); enc_params.Param[0] = jpeg_quality; result.Save(Response.OutputStream, img_encoder, enc_params); } else { // invalid post Response.Write("Invalid post"); } } } ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/export.php ================================================ ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amcolumn/swfobject.js ================================================ /** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/amcharts_key.txt ================================================ AMCHART-LNKS-1966-6679-1965-1082 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/amline_data.txt ================================================ 1949;2.54;20.21 1950;2.51;19.73 1951;2.53;18.43 1952;2.53;18.08 1953;2.68;19.01 1954;2.78;19.57 1955;2.77;19.58 1956;2.79;19.43 1957;3.09;20.83 1958;3.01;19.73 1959;2.90;18.87 1960;2.88;18.43 1961;2.89;18.31 1962;2.90;18.19 1963;2.89;17.89 1964;2.88;17.60 1965;2.86;17.20 1966;2.88;16.84 1967;2.92;16.56 1968;2.94;16.00 1969;3.09;15.95 1970;3.18;15.52 1971;3.39;15.85 1972;3.39;15.36 1973;3.89;16.59 1974;6.87;26.39 1975;7.67;27.00 1976;8.19;27.26 1977;8.57;26.78 1978;9.00;26.14 1979;12.64;32.98 1980;21.59;49.63 1981;31.77;66.20 1982;28.52;55.98 1983;26.19;49.80 1984;25.88;47.18 1985;24.09;42.40 1986;12.51;21.62 1987;15.40;25.68 1988;12.58;20.14 1989;15.86;24.22 1990;20.03;29.03 1991;16.54;23.00 1992;15.99;21.59 1993;14.25;18.68 1994;13.19;16.86 1995;14.62;18.17 1996;18.46;22.40 1997;17.23;20.39 1998;10.87;12.66 1999;15.56;17.78 2000;26.72;29.54 2001;21.84;23.39 2002;22.51;23.78 2003;27.54;28.42 2004;38.93;54.93 2005;46.47;47.97 2006;58.30;58.30 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/amline_data.xml ================================================ 1949 1950 1951 1951 1951 2.54 2.51 2.53 5 1 ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/amline_settings.xml ================================================ 2 true 44 left
left Nominal #FFCC00 left Inflation adjusted #999999 false
================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/export.aspx ================================================ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="export.aspx.cs" Inherits="_export" %> ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/export.aspx.cs ================================================ using System; using System.Web; using System.Drawing; using System.Drawing.Imaging; public partial class _export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Form["width"] != null && Request.Form["width"] != String.Empty) { // image dimensions int width = Int32.Parse((Request.Form["width"].IndexOf('.') != -1) ? Request.Form["width"].Substring(0, Request.Form["width"].IndexOf('.')) : Request.Form["width"]); int height = Int32.Parse((Request.Form["height"].IndexOf('.') != -1) ? Request.Form["height"].Substring(0, Request.Form["height"].IndexOf('.')) : Request.Form["height"]); // image Bitmap result = new Bitmap(width, height); // set pixel colors for (int y = 0; y < height; y++) { // column counter for the row int x = 0; // get current row data string[] row = Request.Form["r" + y].Split(new char[] { ',' }); // set pixels in the row for (int c = 0; c < row.Length; c++) { // get pixel color and repeat count string[] pixel = row[c].Split(new char[] { ':' }); Color current_color = ColorTranslator.FromHtml("#" + pixel[0]); int repeat = pixel.Length > 1 ? Int32.Parse(pixel[1]) : 1; // set pixel(s) for (int l = 0; l < repeat; l++) { result.SetPixel(x, y, current_color); x++; } } } // output image // image type Response.ContentType = "image/jpeg"; Response.AddHeader("Content-Disposition", "attachment; filename=\"amchart.jpg\""); // find image encoder for selected type ImageCodecInfo[] encoders; ImageCodecInfo img_encoder = null; encoders = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo codec in encoders) if (codec.MimeType == Response.ContentType) { img_encoder = codec; break; } // image parameters EncoderParameter jpeg_quality = new EncoderParameter(Encoder.Quality, 100L); // for jpeg images only EncoderParameters enc_params = new EncoderParameters(1); enc_params.Param[0] = jpeg_quality; result.Save(Response.OutputStream, img_encoder, enc_params); } else { // invalid post Response.Write("Invalid post"); } } } ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/export.php ================================================ ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline/swfobject.js ================================================ /** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",encodeURIComponent(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();if(!(navigator.plugins && navigator.mimeTypes.length)) window[this.getAttribute('id')] = document.getElementById(this.getAttribute('id'));return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; ================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/amline.html ================================================ Line & Area chart
You need to upgrade your Flash Player
================================================ FILE: Check Maven Webapp/target/Check/components/chart/amline_1.6.4.1/changelog.txt ================================================ *** CHANGE LOG ***************************************************************** *** 1.6.4.0 ******************************************************************** FEATURE ADDED amReturnParam function also returns the param name: amReturnParam(chart_id, value, param); *** 1.6.3.1 ******************************************************************** FIX: stacking issue with missing values fixed FIX: balloons do not go above the plot area FIX: js function print could print three charts instead of one *** 1.6.3.0 ******************************************************************** FEATURE ADDED: New settings and added. If absolute value of your number is equal or bigger then scientific_max or equal or less then scientific_min, this number will be formatted using scientific notation, for example: 15000000000000000 -> 1.5e16 0.0000023 -> 2.3e-6 FIX: amClickedOnSeries is not called anymore when zooming the chart. *** 1.6.2.1 ******************************************************************** FEATURE ADDED: a new setting, was added. It allows disabling all javascript-html communication. Id you set this to false, then the chart won't listen and won't call any JavaScript functions. This will also disable the security warning message when opening the chart from your hard drive or CD. *** 1.6.2.0 ******************************************************************** FEATURE ADDED:Y axis values can be formatted as duration. To do this, you have to tell the duration unit of your data. For example, if your data represents seconds, you have to set: ss The units of the duration can be changed in the section. FIX: you can call JS functions after amError function was called by the chart FIX: amClickedOnSeries function is called even the zoomable is set to false now *** 1.6.1.4 ******************************************************************** FEATURE ADDED: Margins can be set in percents now FIX: balloon.text_color setting was ignored FIX: in some cases, when values were missing and axis type was "stacked" or "100% stacked" the area to the stacked graph was filled incorrectly FIX: amGetZoom was called when resizing window (if the redraw was set to true) FIX: if balloon.only_one was set to true, the balloon wasn't appearing if the graph was hidden or not selected and the mouse was close to this graph. *** 1.6.1.3 ******************************************************************** FIX: amGetZoom returned "undefined" if the indicator was moved off the plot area to the right side. *** 1.6.1.2 ******************************************************************** FIX: incorrect scroller could appear after reloadData javascript function was called. The chart didn't accept new JS functions if error, such as no data occureed *** 1.6.1.1 ******************************************************************** FIX: the indicator could go left of the plot area *** 1.6.1.0 ******************************************************************** IMPORTANT UPDATE: JS functions amClickedOnSeries(), amClickedOnBullet() and amRolledOverBullet() changed - now the first parameter they return is chart_id, like for all the other JS functions which are called by flash. If you are using these functions, you will have to update your scripts. FEATURE ADDED: JavaScript functions are cued now - previously you could call one JS function at a time and call another only after the chart finished the previous process. Now, you can call several functions one after another, without waiting for the chart to finish doing something. The functions are cued and all of them will be executed. FEATURE ADDED: New JavaScript function amProcessCompleted(chart_id, process) This function is called after some process initialized by some JS function is finished. For example, if you make the chart to reload data by calling reloadData function, after the data is reloaded, the chart will call amProcessCompleted function and the "process" parameter will be "reloadData" - the same as the function name you called. Check examples/javascript_control example to see this in action. FIX: The bullets might be displayed out of plot area, when the was set to true and the graph's values were out of the and range. FIX: If all the graphs of one axis were hidden, the grid and values still remained. FIX: chart_id was lost after the use of setSettings JS function. *** 1.6.0.0 ******************************************************************** FEATURE ADDED: RESCALING THE CHART WHEN THE GRAPH IS HIDDEN When you click on the legend key, the graph is hidden or shown. Now the chart recalculates min and max values (rescales the chart) when you do this. You can turn this feature off by setting to "false". FEATURE ADDED: AUTO-FITTING OF THE LEGEND and X AXIS VALUES The legend now automatically adjusts bottom margin to fit to the flash object's area. If your X axis values are rotated, the legend position is adjusted not to overlap the values. In order this to work, you have to leave setting empty. FEATURE ADDED: Y BALLOONS NO LONGER OVERLAP FEATURE ADDED: NEW BULLET TYPES New bullet types are: square_outline and round_outline FEATURE ADDED: CHART TYPE CAN BE SET SEPARATELY FOR RIGHT AND LEFT AXES Previously you set the same (line, stacked, 100% stacked) for both left and right axes. Now you can set the type separately. This setting is now in section. FEATURE ADDED: MORE SETTINGS FOR THE Y BALLOON New balloon settings allows you to have balloon border and rounded corners: The setting replaced the setting, and the replaced the . The old ones will also work. FEATURE ADDED: POSSIBILITY TO SET ARRAY OF COLORS Using setting, you can set an array fo colors, which will be used if the graph's color is not set. FEATURE ADDED: CHANGE MULTIPLE SETTINGS WITH JAVASCRIPT Using new function, flashMovie.setSettings(settings, rebuild) You can control multiple settings. It is recommended to use this new function even for one setting, instead of setParam() function. The "rebuild" option might be "true" or "false" (the default is "true"). If you set it to "false", then the settings will not be applied until you call another new JS function: flashMovie.rebuild() or pass another set of settings with the "rebuild" set to "true". A new function flashMovie.getSettings() will return the full settings XML by calling amReturnSettings(chart_id, settings) function. FEATURE ADDED: IMAGE DATA IS PASSED TO JAVASCRIPT When exporting chart as an image, the chart passes image data to JavaScript function: amReturnImageData(chart_id, data) FEATURE ADDED: FONT COLOR AND SIZE OF A LABEL TEXT Can accept font color and font size HTML tags now, for example: amCharts]]> CHANGE OF THE DEFAULT SETTINGS: default value was changed to "false" FIXES: When adding some settings using additional_chart_settings variable, you don't need to set all the or
'; if (node._hc) { str += '
'; str += this.addNode(node); str += '
'; } this.aIndent.pop(); return str; }; // Adds the empty and line icons dTree.prototype.indent = function(node, nodeId) { var str = ''; if (this.root.id != node.pid) { for (var n=0; n'; (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1); if (node._hc) { str += ''; } else str += ''; } return str; }; // Checks if a node has any children and if it is the last sibling dTree.prototype.setCS = function(node) { var lastId; for (var n=0; n Destroydrop » Javascripts » Tree

Destroydrop » Javascripts » Tree

Example

open all | close all

©2002-2003 Geir Landrö

================================================ FILE: Check Maven Webapp/target/Check/js/dtree/tdtree/frame.html ================================================ self J2ee Frame

Open all | Close all

================================================ FILE: Check Maven Webapp/target/Check/js/easing.js ================================================ /* * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php * * Uses the built In easIng capabilities added In jQuery 1.1 * to offer multiple easIng options * * Copyright (c) 2007 George Smith * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.extend( jQuery.easing, { easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); ================================================ FILE: Check Maven Webapp/target/Check/js/index.js ================================================ $(".nav").on("click","li",function(){ $(this).siblings().removeClass("current"); var hasChild = !!$(this).find(".subnav").size(); if(hasChild){ $(this).toggleClass("hasChild"); } $(this).addClass("current"); }); $(window).resize(function(e) { $("#bd").height($(window).height() - $("#hd").height() - $("#ft").height()-6); $(".wrap").height($("#bd").height()-6); $(".nav").css("minHeight", $(".sidebar").height() - $(".sidebar-header").height()-1); $("#iframe").height($(window).height() - $("#hd").height() - $("#ft").height()-12); }).resize(); $(".nav>li").css({"borderColor":"#dbe9f1"}); $(".nav>.current").prev().css({"borderColor":"#7ac47f"}); $(".nav").on("click","li",function(e){ var aurl = $(this).find("a").attr("date-src"); $("#iframe").attr("src",aurl); $(".nav>li").css({"borderColor":"#dbe9f1"}); $(".nav>.current").prev().css({"borderColor":"#7ac47f"}); return false; }); $('.exitDialog').Dialog({ title:'提示信息', autoOpen: false, width:400, height:200 }); $('.exit').click(function(){ $('.exitDialog').Dialog('open'); }); $('.exitDialog input[type=button]').click(function(e) { $('.exitDialog').Dialog('close'); if($(this).hasClass('ok')){ window.location.href = "exitSys.action" ; } }); ================================================ FILE: Check Maven Webapp/target/Check/js/jquery-1.10.1.js ================================================ /*! * jQuery JavaScript Library v1.10.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-05-30T21:49Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.9.4-pre * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-05-27 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function() { return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied if the test fails * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler */ function addHandle( attrs, handler, test ) { attrs = attrs.split("|"); var current, i = attrs.length, setHandle = test ? null : handler; while ( i-- ) { // Don't override a user's handler if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) { Expr.attrHandle[ attrs[i] ] = setHandle; } } } /** * Fetches boolean attributes by node * @param {Element} elem * @param {String} name */ function boolHandler( elem, name ) { // XML does not need to be checked as this will not be assigned for XML documents var val = elem.getAttributeNode( name ); return val && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } /** * Fetches attributes without interpolation * http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx * @param {Element} elem * @param {String} name */ function interpolationHandler( elem, name ) { // XML does not need to be checked as this will not be assigned for XML documents return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } /** * Uses defaultValue to retrieve value in IE6/7 * @param {Element} elem * @param {String} name */ function valueHandler( elem ) { // Ignore the value *property* on inputs by using defaultValue // Fallback to Sizzle.attr by returning undefined where appropriate // XML does not need to be checked as this will not be assigned for XML documents if ( elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns Returns -1 if a precedes b, 1 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.parentWindow; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 if ( parent && parent.frameElement ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { // Support: IE<8 // Prevent attribute/property "interpolation" div.innerHTML = ""; addHandle( "type|href|height|width", interpolationHandler, div.firstChild.getAttribute("href") === "#" ); // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies addHandle( booleans, boolHandler, div.getAttribute("disabled") == null ); div.className = "i"; return !div.getAttribute("className"); }); // Support: IE<9 // Retrieving value should defer to defaultValue support.input = assert(function( div ) { div.innerHTML = ""; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }); // IE6/7 still return empty string for value, // but are actually retrieving the property addHandle( "value", valueHandler, support.attributes && support.input ); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "
"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = ""; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( doc.createElement("div") ) & 1; }); // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = ( fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined ); return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Initialize against the default document setDocument(); // Support: Chrome<<14 // Always assume duplicates if they aren't passed to the comparison function [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = "
a"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "
t
"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "
"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "" ], legend: [ 1, "
", "
" ], area: [ 1, "", "" ], param: [ 1, "", "" ], thead: [ 1, "", "
" ], tr: [ 2, "", "
" ], col: [ 2, "", "
" ], td: [ 3, "", "
" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted from table fragments if ( !jQuery.support.tbody ) { // String was a , *may* have spurious elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare or wrap[1] === "
" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("