index.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=1920,user-scalable=0">
  6. <title>双师教学标准平台</title>
  7. <link rel="stylesheet" href="../../lib/css/base.css" />
  8. </head>
  9. <body>
  10. <script>
  11. (function (doc, win) {
  12. //用原生方法获取用户设置的浏览器的字体大小(兼容ie)
  13. if (doc.documentElement.currentStyle) {
  14. var user_webset_font = doc.documentElement.currentStyle['fontSize'];
  15. }
  16. else {
  17. var user_webset_font = getComputedStyle(doc.documentElement, false)['fontSize'];
  18. }
  19. //取整后与默认16px的比例系数
  20. // var xs = parseFloat(user_webset_font) / 16;
  21. var docEl = doc.documentElement, //根元素html
  22. //判断窗口有没有orientationchange这个方法,有就赋值给一个变量,没有就返回resize方法。
  23. resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
  24. recalc = function () {
  25. var clientWidth = docEl.clientWidth;
  26. if (!clientWidth) return;
  27. if (clientWidth < 1920) {
  28. docEl.style.fontSize = 100 * (clientWidth / 1920) + 'px';
  29. } else {
  30. docEl.style.fontSize = 100 + 'px';
  31. }
  32. };
  33. if (!doc.addEventListener) return;
  34. win.addEventListener(resizeEvt, recalc, false); //addEventListener事件方法接受三个参数:第一个是事件名称比如点击事件onclick,第二个是要执行的函数,第三个是布尔值
  35. doc.addEventListener('DOMContentLoaded', recalc, false) //绑定浏览器缩放与加载时间
  36. })(document, window);
  37. </script>
  38. <script>
  39. function setAndroidEvent(type, keyCode) {
  40. var leaf = FocusEngine.getFocusedLeaf();
  41. var eid = document.getElementById(leaf.id);
  42. var evt = document.createEvent('Event');
  43. evt.initEvent(type, true, true);
  44. evt.keyCode = keyCode;
  45. eid.dispatchEvent(evt);
  46. }
  47. </script>
  48. <!-- <script src="../../lib/js/alitv-debug.min.js"></script> -->
  49. <script src="../../lib/js/FocusEngine.js"></script>
  50. <script src="../../lib/js/blitz.js"></script>
  51. <script src="../../lib/js/moye.min.js"></script>
  52. <script src="../../lib/js/TVUtil.min.js"></script>
  53. <script src="../../lib/js/core.min.js"></script>
  54. <script src="../../lib/js/sha1.min.js"></script>
  55. <script src="../../lib/js/md5.min.js"></script>
  56. <script src="../../lib/js/ckplayer/hls.min.js"></script>
  57. <script src="../../lib/js/ckplayer/ckplayer.js"></script>
  58. <script>
  59. var ts = '201807251125';
  60. var appCss = document.createElement('link');
  61. appCss.rel = 'stylesheet';
  62. appCss.href = './index.css?t=' + ts;
  63. document.head.appendChild(appCss);
  64. var appScript = document.createElement('script');
  65. appScript.src = './index.js?t=' + ts;
  66. document.body.appendChild(appScript);
  67. </script>
  68. <script>
  69. //定义一个全局变量用于记录使用时间
  70. var globalUseDurationRecord = 0;
  71. setInterval('globalUseDurationRecord += 1', 1000);
  72. </script>
  73. <script>
  74. //解决startsWith、endsWith在webview上不能使用问题
  75. String.prototype.startsWith=function(str){
  76. var reg=new RegExp("^"+str);
  77. return reg.test(this);
  78. }
  79. String.prototype.endsWith=function(str){
  80. var reg=new RegExp(str+"$");
  81. return reg.test(this);
  82. }
  83. </script>
  84. </body>
  85. </html>