DeskTop.js 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  1. /*
  2. 此处为桌面系统启动应用区域
  3. */
  4. Namespace.register("U.MD.D.I"); //桌面应用处理
  5. //判断图片是否在拖拽,如果是拖拽图标的过程是不会打开图片的
  6. U.MD.D.I.IsDrag;
  7. U.MD.D.I.Ip;
  8. //教师桌面图标的全局变量
  9. U.MD.D.I.teacherDeskIcon = [
  10. { "Name": "项目管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  11. { "Name": "学习中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  12. { "Name": "学生管理", "Url": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
  13. { "Name": "学生评价", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  14. { "Name": "班级管理", "Url": "class", "style": { "cssText": "background-image:url(/img/icon/class.png)" } },
  15. { "Name": "我的资料", "Url": "my", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  16. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.png)" } },
  17. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  18. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  19. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  20. { "Name": "便签分类", "Url": "note", "style": { "cssText": "background-image:url(/img/icon/note.png)" } },
  21. // { "Name": "量规评分", "Url": "score", "style": { "cssText": "background-image:url(/img/icon/score.png)" } },
  22. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  23. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  24. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  25. { "Name": "实时课堂", "Url": "teacherClassRoom", "style": { "cssText": "background-image:url(/img/icon/classRoom.png)" } },
  26. { "Name": "体系设置", "Url": "sys", "style": { "cssText": "background-image:url(/img/icon/sys.png)" } }
  27. ];
  28. U.MD.D.I.studentDeskIcon = [
  29. { "Name": "我的项目", "Url": "studnetProject", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  30. { "Name": "学习中心", "Url": "studentStudy", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  31. { "Name": "我的评价", "Url": "studentEvaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  32. { "Name": "我的资料", "Url": "studentMy", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  33. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  34. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  35. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  36. { "Name": "便签分类", "Url": "note", "style": { "cssText": "background-image:url(/img/icon/note.png)" } },
  37. // { "Name": "量规评分", "Url": "score", "style": { "cssText": "background-image:url(/img/icon/score.png)" } },
  38. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  39. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  40. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  41. { "Name": "实时课堂", "Url": "studentClassRoom", "style": { "cssText": "background-image:url(/img/icon/classRoom.png)" } }
  42. ];
  43. U.MD.D.I.schoolDeskIcon = [
  44. { "Name": "项目管理", "Url": "project", "style": { "cssText": "background-image:url(/img/icon/project.png)" } },
  45. { "Name": "学习中心", "Url": "study", "style": { "cssText": "background-image:url(/img/icon/study.png)" } },
  46. { "Name": "学生评价", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  47. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.png)" } },
  48. { "Name": "学习资料", "Url": "stuLibrary", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  49. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  50. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  51. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  52. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } },
  53. { "Name": "思维网格", "Url": "mindNetwork", "style": { "cssText": "background-image:url(/img/icon/mindNetwork.png)" } },
  54. { "Name": "训练服务器", "Url": "train", "style": { "cssText": "background-image:url(/img/icon/trainPlatform.png)" } },
  55. { "Name": "体系设置", "Url": "sys", "style": { "cssText": "background-image:url(/img/icon/sys.png)" } }
  56. ];
  57. //#region 桌面初始化a
  58. /**
  59. * 初始化桌面的起始函数
  60. *
  61. */
  62. U.MD.D.I.init = function() {
  63. if ($("#U_MD_D_K")[0]) {
  64. //初始化桌面图标
  65. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0]);
  66. // var clickUrl = ':12588/requestIp.php';
  67. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  68. // U.MD.D.I.Ip = data;
  69. // var AccessUrl = ':12588/useAccess.php?ip=' + U.MD.D.I.Ip;
  70. // U.MD.D.I.Mysqlrequest(AccessUrl,function(data){
  71. // U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
  72. // })
  73. // //初始化任务栏,因为是静态的,所以直接改变样式即可.
  74. // })
  75. }
  76. }
  77. /**
  78. * 隐藏任务栏
  79. *
  80. * @param {element} 桌面元素
  81. */
  82. U.MD.D.I.hiddenTaskbar = function(el) {
  83. //任务栏位置变小
  84. U.selectEl(el).parentElement(3).css({ "bottom": "-60px" });
  85. //桌面的位置变大
  86. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  87. }
  88. /**
  89. * 隐藏任务栏
  90. *
  91. * @param {element} 桌面元素
  92. */
  93. U.MD.D.I.hiddenTaskbarout = function(el) {
  94. //任务栏位置变小
  95. if (!U.UF.EV.stopBubbleMouseOutOrOver(el)) {
  96. //任务栏位置变化
  97. U.selectEl(el).css({ "bottom": "-60px" });
  98. //桌面的位置变大
  99. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  100. }
  101. }
  102. /**
  103. * 初始化打印桌面图标
  104. *
  105. * @param {element} 桌面元素
  106. */
  107. U.MD.D.I.initDesktopIcons = function(el) {
  108. var i, //用于循环
  109. _content, //桌面图标元素
  110. _iconcontent, //桌面图标元素
  111. _frag = $$("frag"), //定义一个碎片元素
  112. _type = US.userInfo.type,
  113. _oid = US.userInfo.organizeid;
  114. _teacherDesktopIconInfo = U.MD.D.I.teacherDeskIcon, //获取教师端桌面图标
  115. _studentDesktopIconInfo = U.MD.D.I.studentDeskIcon, //获取学生端桌面图标
  116. _schoolDesktopIconInfo = U.MD.D.I.schoolDeskIcon; //获取测试学校桌面图标
  117. //清楚桌面图标
  118. el.innerHTML = "";
  119. //循环创建桌面图标
  120. if (_type == 2 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  121. for (i = 0; i < _studentDesktopIconInfo.length; i++) {
  122. _content = $$("div", {
  123. className: "U_MD_D_KO",
  124. "onmousedown": U.UF.C.closure(function(obj) {
  125. //防止拖动图标即打开了桌面应用
  126. U.MD.D.click(this, obj);
  127. }, [_studentDesktopIconInfo[i]]),
  128. "onclick": U.UF.C.closure(function(obj) {
  129. //防止拖动图标即打开了桌面应用
  130. U.MD.D.click(this, obj);
  131. }, [_studentDesktopIconInfo[i]])
  132. }, _frag); //
  133. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  134. $$("div", { className: "U_MD_D_KOS U_Img", "style": _studentDesktopIconInfo[i].style }, _iconcontent);
  135. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _studentDesktopIconInfo[i].Name }, _iconcontent);
  136. }
  137. } else if (_type == 1 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  138. for (i = 0; i < _teacherDesktopIconInfo.length; i++) {
  139. _content = $$("div", {
  140. className: "U_MD_D_KO",
  141. "onmousedown": U.UF.C.closure(function(obj) {
  142. //防止拖动图标即打开了桌面应用
  143. U.MD.D.click(this, obj);
  144. }, [_teacherDesktopIconInfo[i]]),
  145. "onclick": U.UF.C.closure(function(obj) {
  146. //防止拖动图标即打开了桌面应用
  147. U.MD.D.click(this, obj);
  148. }, [_teacherDesktopIconInfo[i]])
  149. }, _frag); //
  150. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  151. $$("div", { className: "U_MD_D_KOS U_Img", "style": _teacherDesktopIconInfo[i].style }, _iconcontent);
  152. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _teacherDesktopIconInfo[i].Name }, _iconcontent);
  153. }
  154. } else if (_type == 1 && _oid == "91305d49-01ba-11ed-8c78-005056b86db5") {
  155. for (i = 0; i < _schoolDesktopIconInfo.length; i++) {
  156. _content = $$("div", {
  157. className: "U_MD_D_KO",
  158. "onmousedown": U.UF.C.closure(function(obj) {
  159. //防止拖动图标即打开了桌面应用
  160. U.MD.D.click(this, obj);
  161. }, [_schoolDesktopIconInfo[i]]),
  162. "onclick": U.UF.C.closure(function(obj) {
  163. //防止拖动图标即打开了桌面应用
  164. U.MD.D.click(this, obj);
  165. }, [_schoolDesktopIconInfo[i]])
  166. }, _frag); //
  167. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  168. $$("div", { className: "U_MD_D_KOS U_Img", "style": _schoolDesktopIconInfo[i].style }, _iconcontent);
  169. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _schoolDesktopIconInfo[i].Name }, _iconcontent);
  170. }
  171. } else {
  172. for (i = 0; i < _teacherDesktopIconInfo.length; i++) {
  173. _content = $$("div", {
  174. className: "U_MD_D_KO",
  175. "onmousedown": U.UF.C.closure(function(obj) {
  176. //防止拖动图标即打开了桌面应用
  177. U.MD.D.click(this, obj);
  178. }, [_teacherDesktopIconInfo[i]]),
  179. "onclick": U.UF.C.closure(function(obj) {
  180. //防止拖动图标即打开了桌面应用
  181. U.MD.D.click(this, obj);
  182. }, [_teacherDesktopIconInfo[i]])
  183. }, _frag); //
  184. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  185. $$("div", { className: "U_MD_D_KOS U_Img", "style": _teacherDesktopIconInfo[i].style }, _iconcontent);
  186. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -webkit-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; -moz-text-shadow: rgb(100 100 100) 2px 1px 3px, rgb(102 102 102) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _teacherDesktopIconInfo[i].Name }, _iconcontent);
  187. }
  188. }
  189. //加载好后给图标定位
  190. U.MD.D.iconPostion($(_frag).Child());
  191. //把图标加载到页面
  192. el.appendChild(_frag);
  193. }
  194. /**
  195. * 显示任务栏
  196. *
  197. * @param {element} 桌面元素
  198. */
  199. U.MD.D.I.displayTaskbar = function(el) {
  200. //判断是否需要形式任务栏,由于用了mouseover事件会冒泡响应多次,这里做了过滤
  201. if (!U.UF.EV.stopBubbleMouseOutOrOver(el) && U.selectEl(el).css("bottom") != "0px") {
  202. //任务栏位置变化
  203. U.selectEl(el).css({ "bottom": "0px" });
  204. //桌面位置变话
  205. // U.selectEl("#U_MD_D_K").css({ "left": "70px" });
  206. }
  207. }
  208. //#region 桌面图标拖动逻辑
  209. /**
  210. * 桌面排列图标
  211. *
  212. * @param {element} 桌面元素
  213. * @param {object} 上下相距的距离
  214. * @param {object} 左右相距的距离
  215. * @return {object} 命名空间
  216. */
  217. U.MD.D.iconPostion = function(childs, top, left) {
  218. var i; //用于循环处理
  219. top = top || 15; //如果没有设置元素的间距处理默认上间距为15
  220. left = left || 20; //如果没有设置元素的间距处理默认左间距为15
  221. //循环所有的图标,设置每个图标的间距,打印顺序是竖排打印的方式
  222. for (i = 0; i < childs.length; i++) {
  223. //如果竖排top超过了范围处理
  224. if (top + 95 > US.height - 10) {
  225. //left超过了页面范围处理,则向上重叠打印处理
  226. if ((left + 180) > US.width) {
  227. top -= 115;
  228. left -= 90;
  229. }
  230. //没有超过范围,那么left+90添加到下一个竖排打印
  231. else {
  232. left += 90;
  233. top = 15;
  234. };
  235. }
  236. //给图标的位置赋值
  237. U.selectEl(childs[i]).css({ top: top + "px", left: left + "px" });
  238. if (i < childs.length - 1) {
  239. //页面图标每次向下加115
  240. top += 115;
  241. }
  242. }
  243. //返回最后调用的图标的位置
  244. return [top, left];
  245. }
  246. /**
  247. * 桌面点击事件逻辑
  248. *
  249. * @param {element} 桌面元素
  250. * @param {object} 上下相距的距离
  251. * @param {object} 左右相距的距离
  252. * @return {object} 命名空间
  253. */
  254. U.MD.D.click = function(el, obj) {
  255. var _buttonnumber = event.button; //点击的按钮的事件值
  256. var _userinfo = US.userInfo;
  257. U.UF.EV.stopBubble(); //阻止向上冒泡
  258. //onmousedown 包含了左键和右键 这里大于2是为了兼容 所有浏览器的右键处理
  259. if (_buttonnumber < 2) {
  260. //如果是click事件的处理
  261. if (event.type == "click") {
  262. //如果元素在mousemove事件中没有移动则出发click事件
  263. if (!U.MD.D.I.IsDrag) {
  264. if (!_userinfo || Object.keys(_userinfo).length === 0) {
  265. U.alert("请先登录您的账号!");
  266. setTimeout(() => {
  267. U.MD.U.L.login();
  268. }, 2000);
  269. } else {
  270. //打开应用处理
  271. U.MD.D.I.openApplication(obj.Url, { "userid": US.userInfo.userid, "directoryid": US.FTPFOLDERID });
  272. }
  273. }
  274. }
  275. //如果是mouse事件的处理
  276. else {
  277. //拖动处理,添加拖动和拖动结束事件
  278. U.UF.F.drag(el, U.MD.D.iconMove, U.MD.D.iconUp);
  279. }
  280. U.MD.D.I.IsDrag = false;
  281. }
  282. }
  283. /**
  284. * 拖动的处理
  285. *
  286. */
  287. U.MD.D.iconMove = function() {
  288. //如果当前位置点击初始化的位置出现了变化,则设置是否拖动的属性 U.MD.D.I.IsDrag为true
  289. U.MD.D.I.IsDrag = true;
  290. }
  291. /**
  292. * 拖动结束后,这里是定位处理,以网状的形式定位
  293. *
  294. * @param {element} 拖动的元素
  295. * @return {object} 命名空间
  296. */
  297. U.MD.D.iconUp = function(el) {
  298. var _top = 15,
  299. _left = 20,
  300. _margin,
  301. _childs = U.selectEl("#U_MD_D_K").Child(), //桌面所有的图标
  302. _positioninfo = U.UF.EL.getElementInfo(el); //获取拖动结束的元素的位置
  303. if (_positioninfo["OT"] > 15) {
  304. //网状的形式定位,如果差超过了55,那么向下定位,否则向上定位
  305. _margin = ((_positioninfo["OT"] - 15) % 115 > 55 && _positioninfo["OT"] + 115 < US.height) ? 1 : 0;
  306. _top = (Math.floor((_positioninfo["OT"] - 15) / 115) + _margin) * 115 + 15;
  307. }
  308. if (_positioninfo["OL"] > 20) {
  309. //网状的形式定位,如果差超过了90,那么向右定位,否则向左定位
  310. _margin = ((_positioninfo["OL"] - 20) % 90 > 45 && _positioninfo["OL"] + 90 < US.width) ? 1 : 0;
  311. _left = (Math.floor((_positioninfo["OL"] - 20) / 90) + _margin) * 90 + 20
  312. }
  313. //while循环判断么一个重叠的元素
  314. do {
  315. _positioninfo = U.MD.D.iconPostion([el], _top, _left); //给重叠的元素向下定位
  316. _top = _positioninfo[0] + 115; //得到定位后的top
  317. _left = _positioninfo[1]; //得到定位后的left
  318. } while (el = U.MD.D.isOverlap(el, _childs, _positioninfo))
  319. }
  320. /**
  321. * 判断拖动后图标是否重叠
  322. *
  323. * @param {element} 拖动的元素
  324. * @param {element} 桌面所有的元素
  325. * @param {array} 拖动元素的位置
  326. ----------[0] 上 top
  327. ----------[1] 左 left
  328. * @return {object} 命名空间
  329. */
  330. U.MD.D.isOverlap = function(el, childs, postionarray) {
  331. //循环所有的图标
  332. for (var i = 0; i < childs.length; i++) {
  333. //判断有没有和该图标诶子重叠的元素
  334. if (el != childs[i] && (childs[i].offsetTop == postionarray[0] && childs[i].offsetLeft == postionarray[1])) {
  335. return childs[i]; //如果有返回
  336. }
  337. }
  338. }
  339. //#endregion
  340. //#endregion
  341. //#region 桌面应用
  342. /**
  343. * 打开应用
  344. *
  345. * @param {string} 类型
  346. -----------------Disk 网盘系统
  347. -----------------PDisk 学习系统网盘
  348. -----------------Poto 图片
  349. -----------------Video 视频
  350. -----------------Music 音乐
  351. -----------------Word word
  352. -----------------Excel excel
  353. -----------------Txt 记事本
  354. -----------------PB 学习系统
  355. -----------------Blog 朋友圈系统
  356. -----------------FTP ftp系统
  357. -----------------Group 好友群
  358. -----------------SY 首页系统
  359. -----------------Set 个人设置
  360. -----------------XSet 系统设置
  361. -----------------App 我们所有的app
  362. -----------------BC c.1473.cn 平台
  363. -----------------CWeb d.1473.cn 变成平台
  364. -----------------其他的外联系统 我们统一用iframe打开
  365. * @param {array} 类型
  366. 如果第一个参数为"disk",则第二个参数为object,里面包含了用户id和目录id{userid:"",directoryid:""}
  367. 如果第一个参数为"word"或者"excel","txt",则第二个参数为文件信息fileinfo。
  368. 如果第一个参数为"blog"或者"PDisk"。建议删除。
  369. 如果第一个参数为其他,则无第二个参数
  370. * @returns {array}
  371. */
  372. window.addEventListener('message', function(e) { // 监听 message 事件
  373. // alert(e.data.type);
  374. if (e.data.type && e.data.type == "1") { //项目管理传入
  375. U.MD.D.I.openInApplication("studyDetail", e.data.cid)
  376. } else if (e.data.close && e.data.close == "1") { //更新用户信息
  377. U.MD.D.I.selectUser();
  378. } else if (e.data.allScreen && e.data.allScreen == "1") {
  379. var _formel = document.getElementById("study") || document.getElementById("studyDetail");
  380. U.UF.F.windowZooming(_formel);
  381. } else if (e.data.tools && e.data.tools == "1") {
  382. U.MD.D.I.openApplication("whiteboard")
  383. } else if (e.data.tools && e.data.tools == "2") {
  384. U.MD.D.I.openApplication("note")
  385. } else if (e.data.tools && e.data.tools == "3") {
  386. U.MD.D.I.openApplication("mind")
  387. } else if (e.data.tools && e.data.tools == "4") {
  388. U.MD.D.I.openApplication("investigation")
  389. } else if (e.data.tools && e.data.tools == "6") {
  390. U.MD.D.I.openApplication("doc")
  391. } else if (e.data.tools && e.data.tools == "7") {
  392. U.MD.D.I.openApplication("mindNetwork")
  393. } else if (e.data.tools && e.data.tools == "8") {
  394. U.MD.D.I.openApplication("library")
  395. } else if (e.data.tools && e.data.tools == "17") {
  396. U.MD.D.I.openApplication("stuLibrary")
  397. } else if (e.data.tools && e.data.tools == "18") {
  398. U.MD.D.I.openApplication("train")
  399. }
  400. });
  401. U.MD.D.I.selectUser = function() {
  402. U.A.Request(US.Config.pbl + "selectUser?userid=" + US.userInfo.userid, [], function(res) { //US.userInfo.userid
  403. if (res.value[0].length > 0) {
  404. US.userInfo = res.value[0][0];
  405. $(".userName")[0].innerHTML = US.userInfo.username;
  406. }
  407. }, [], { "type": "GET", "withCredentials": true });
  408. }
  409. U.MD.D.I.openInApplication = function(str, data) {
  410. var _userinfo = US.userInfo, //登录用户信息
  411. _userid = US.userInfo.userid, //登录用户id
  412. _oid = _userinfo.organizeid;
  413. switch (str) {
  414. case "studyDetail":
  415. if (!_userinfo || Object.keys(_userinfo).length === 0) {
  416. setTimeout(() => {
  417. U.MD.U.L.login();
  418. }, 2000);
  419. } else {
  420. _formdiv = new U.UF.UI.form(
  421. "项目详情",
  422. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=" + _userid + "&oid=" + _oid + "&courseId=" + data }), {
  423. "id": "studyDetail",
  424. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  425. "onresize": function() {}
  426. }, {
  427. closecallback: function() {}
  428. }, { "style": { "height": "36px" } }).form; //创建窗体
  429. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/study.png)" }, "name": "学习中心", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  430. break;
  431. }
  432. }
  433. }
  434. U.MD.D.I.openApplication = function(str, obj, info) {
  435. obj = obj || {};
  436. var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
  437. _formdiv, //创建任务栏时同时弹出的窗体元素。
  438. _userinfo = US.userInfo, //登录用户信息
  439. _userid = obj.userid || US.userInfo.userid, //登录用户id
  440. _oid = obj.organizeid || _userinfo.organizeid,
  441. _type = US.userInfo.type;
  442. if (_type == 2 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  443. switch (str) {
  444. case "studnetProject": //好友打开
  445. _formdiv = new U.UF.UI.form(
  446. "我的项目",
  447. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/project?userid=" + _userid + "&oid=" + _oid }), {
  448. "id": "studnetProject",
  449. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  450. "onresize": function() {}
  451. }, {
  452. closecallback: function() {}
  453. }, { "style": { "height": "36px" } }).form; //创建窗体
  454. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "我的项目", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  455. break;
  456. case "studentEvaluate": //好友打开
  457. _formdiv = new U.UF.UI.form(
  458. "我的评价",
  459. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  460. "id": "studentEvaluate",
  461. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  462. "onresize": function() {}
  463. }, {
  464. closecallback: function() {}
  465. }, { "style": { "height": "36px" } }).form; //创建窗体
  466. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "我的评价", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  467. break;
  468. case "my":
  469. _formdiv = new U.UF.UI.form(
  470. "我的资料",
  471. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/data?userid=" + _userid }), {
  472. "id": "my",
  473. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  474. "onresize": function() {}
  475. }, {
  476. closecallback: function() {}
  477. }, { "style": { "height": "36px" } }).form; //创建窗体
  478. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/myMessage.png)" }, "name": "我的资料", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  479. break;
  480. case "library":
  481. _formdiv = new U.UF.UI.form(
  482. "素材库",
  483. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library?userid=" + _userid }), {
  484. "id": "library",
  485. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  486. "onresize": function() {}
  487. }, {
  488. closecallback: function() {}
  489. }, { "style": { "height": "36px" } }).form; //创建窗体
  490. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/library.png)" }, "name": "素材库", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  491. break;
  492. case "whiteboard":
  493. _formdiv = new U.UF.UI.form(
  494. "电子白板",
  495. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  496. "id": "whiteboard",
  497. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  498. "onresize": function() {}
  499. }, {
  500. closecallback: function() {}
  501. }, { "style": { "height": "36px" } }).form; //创建窗体
  502. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/whiteBoard.png)" }, "name": "电子白板", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  503. break;
  504. case "investigation":
  505. _formdiv = new U.UF.UI.form(
  506. "问卷调查",
  507. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  508. "id": "investigation",
  509. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  510. "onresize": function() {}
  511. }, {
  512. closecallback: function() {}
  513. }, { "style": { "height": "36px" } }).form; //创建窗体
  514. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  515. break;
  516. case "note":
  517. _formdiv = new U.UF.UI.form(
  518. "便签分类",
  519. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/note?userid=" + _userid }), {
  520. "id": "note",
  521. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  522. "onresize": function() {}
  523. }, {
  524. closecallback: function() {}
  525. }, { "style": { "height": "36px" } }).form; //创建窗体
  526. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/note.png)" }, "name": "便签分类", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  527. break;
  528. // case "score":
  529. // _formdiv = new U.UF.UI.form(
  530. // "量规评分",
  531. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  532. // "id": "score",
  533. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  534. // "onresize": function() {}
  535. // }, {
  536. // closecallback: function() {}
  537. // }, { "style": { "height": "36px" } }).form; //创建窗体
  538. // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/score.png)" }, "name": "量规评分", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  539. // break;
  540. case "mind":
  541. _formdiv = new U.UF.UI.form(
  542. "思维导图",
  543. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  544. "id": "mind",
  545. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  546. "onresize": function() {}
  547. }, {
  548. closecallback: function() {}
  549. }, { "style": { "height": "36px" } }).form; //创建窗体
  550. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindMapping.png)" }, "name": "思维导图", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  551. break;
  552. case "doc":
  553. // U.MD.D.I.isRoom();
  554. _formdiv = new U.UF.UI.form(
  555. "协同文档",
  556. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  557. "id": "doc",
  558. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  559. "onresize": function() {}
  560. }, {
  561. closecallback: function() {}
  562. }, { "style": { "height": "36px" } }).form; //创建窗体
  563. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  564. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  565. })
  566. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/doc.png)" }, "name": "协同文档", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  567. break;
  568. case "studentStudy":
  569. _formdiv = new U.UF.UI.form(
  570. "学习中心",
  571. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  572. "id": "studentStudy",
  573. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  574. "onresize": function() {}
  575. }, {
  576. closecallback: function() {}
  577. }, { "style": { "height": "36px" } }).form; //创建窗体
  578. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/study.png)" }, "name": "学习中心", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  579. break;
  580. case "mindNetwork": //好友打开
  581. _formdiv = new U.UF.UI.form(
  582. "思维网格",
  583. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=" + _userid }), {
  584. "id": "mindNetwork",
  585. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  586. "onresize": function() {}
  587. }, {
  588. closecallback: function() {}
  589. }, { "style": { "height": "36px" } }).form; //创建窗体
  590. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindNetwork.png)" }, "name": "思维网格", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  591. break;
  592. case "studentClassRoom": //好友打开
  593. _formdiv = new U.UF.UI.form(
  594. "实时课堂",
  595. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/liveRoom?userid=" + _userid + "&oid=" + _oid }), {
  596. "id": "studentClassRoom",
  597. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  598. "onresize": function() {}
  599. }, {
  600. closecallback: function() {}
  601. }, { "style": { "height": "36px" } }).form; //创建窗体
  602. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/classRoom.png)" }, "name": "实时课堂", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  603. setTimeout(() => {
  604. U.UF.F.windowZooming(_formdiv)
  605. }, 0);
  606. break;
  607. }
  608. } else if (_type == 1 && _oid != "91305d49-01ba-11ed-8c78-005056b86db5") {
  609. //选择应用处理
  610. switch (str) {
  611. case "project": //好友打开
  612. _formdiv = new U.UF.UI.form(
  613. "项目管理",
  614. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course?userid=" + _userid + "&oid=" + _oid }), {
  615. "id": "project",
  616. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  617. "onresize": function() {}
  618. }, {
  619. closecallback: function() {}
  620. }, { "style": { "height": "36px" } }).form; //创建窗体
  621. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "项目管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  622. break;
  623. case "student":
  624. _formdiv = new U.UF.UI.form(
  625. "学生管理",
  626. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/student?userid=" + _userid + "&oid=" + _oid }), {
  627. "id": "student",
  628. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  629. "onresize": function() {}
  630. }, {
  631. closecallback: function() {}
  632. }, { "style": { "height": "36px" } }).form; //创建窗体
  633. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/student.png)" }, "name": "学生管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  634. break;
  635. case "evaluate":
  636. _formdiv = new U.UF.UI.form(
  637. "学生评价",
  638. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  639. "id": "evaluate",
  640. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  641. "onresize": function() {}
  642. }, {
  643. closecallback: function() {}
  644. }, { "style": { "height": "36px" } }).form; //创建窗体
  645. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "学生评价", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  646. break;
  647. case "sys":
  648. _formdiv = new U.UF.UI.form(
  649. "体系设置",
  650. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/evaluation?userid=" + _userid + "&oid=" + _oid }), {
  651. "id": "sys",
  652. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  653. "onresize": function() {}
  654. }, {
  655. closecallback: function() {}
  656. }, { "style": { "height": "36px" } }).form; //创建窗体
  657. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/sys.png)" }, "name": "体系设置", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  658. break;
  659. case "class":
  660. _formdiv = new U.UF.UI.form(
  661. "班级管理",
  662. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/class?userid=" + _userid + "&oid=" + _oid }), {
  663. "id": "class",
  664. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  665. "onresize": function() {}
  666. }, {
  667. closecallback: function() {}
  668. }, { "style": { "height": "36px" } }).form; //创建窗体
  669. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/class.png)" }, "name": "班级管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  670. break;
  671. case "my":
  672. _formdiv = new U.UF.UI.form(
  673. "我的资料",
  674. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/data?userid=" + _userid }), {
  675. "id": "my",
  676. "style": { "width": "42%", "height": "90%", "overflow": 'hidden' },
  677. "onresize": function() {}
  678. }, {
  679. closecallback: function() {}
  680. }, { "style": { "height": "36px" } }).form; //创建窗体
  681. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/myMessage.png)" }, "name": "我的资料", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  682. break;
  683. case "notice":
  684. _formdiv = new U.UF.UI.form(
  685. "通知公告",
  686. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/notice?userid=" + _userid }), {
  687. "id": "notice",
  688. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  689. "onresize": function() {}
  690. }, {
  691. closecallback: function() {}
  692. }, { "style": { "height": "36px" } }).form; //创建窗体
  693. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/news.png)" }, "name": "通知公告", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  694. break;
  695. case "library":
  696. _formdiv = new U.UF.UI.form(
  697. "素材库",
  698. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/library?userid=" + _userid }), {
  699. "id": "library",
  700. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  701. "onresize": function() {}
  702. }, {
  703. closecallback: function() {}
  704. }, { "style": { "height": "36px" } }).form; //创建窗体
  705. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/library.png)" }, "name": "素材库", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  706. break;
  707. case "whiteboard":
  708. _formdiv = new U.UF.UI.form(
  709. "电子白板",
  710. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  711. "id": "whiteboard",
  712. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  713. "onresize": function() {}
  714. }, {
  715. closecallback: function() {}
  716. }, { "style": { "height": "36px" } }).form; //创建窗体
  717. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/whiteBoard.png)" }, "name": "电子白板", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  718. break;
  719. case "investigation":
  720. _formdiv = new U.UF.UI.form(
  721. "问卷调查",
  722. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  723. "id": "investigation",
  724. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  725. "onresize": function() {}
  726. }, {
  727. closecallback: function() {}
  728. }, { "style": { "height": "36px" } }).form; //创建窗体
  729. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  730. break;
  731. case "note":
  732. _formdiv = new U.UF.UI.form(
  733. "便签分类",
  734. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/note?userid=" + _userid }), {
  735. "id": "note",
  736. "style": { "width": "20%", "height": "90%", "overflow": 'hidden' },
  737. "onresize": function() {}
  738. }, {
  739. closecallback: function() {}
  740. }, { "style": { "height": "36px" } }).form; //创建窗体
  741. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/note.png)" }, "name": "便签分类", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  742. break;
  743. // case "score":
  744. // _formdiv = new U.UF.UI.form(
  745. // "量规评分",
  746. // $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  747. // "id": "score",
  748. // "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  749. // "onresize": function() {}
  750. // }, {
  751. // closecallback: function() {}
  752. // }, { "style": { "height": "36px" } }).form; //创建窗体
  753. // _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/score.png)" }, "name": "量规评分", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  754. // break;
  755. case "mind":
  756. _formdiv = new U.UF.UI.form(
  757. "思维导图",
  758. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  759. "id": "mind",
  760. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  761. "onresize": function() {}
  762. }, {
  763. closecallback: function() {}
  764. }, { "style": { "height": "36px" } }).form; //创建窗体
  765. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindMapping.png)" }, "name": "思维导图", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  766. break;
  767. case "doc":
  768. // U.MD.D.I.isRoom();
  769. _formdiv = new U.UF.UI.form(
  770. "协同文档",
  771. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  772. "id": "doc",
  773. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  774. "onresize": function() {}
  775. }, {
  776. closecallback: function() {}
  777. }, { "style": { "height": "36px" } }).form; //创建窗体
  778. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  779. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  780. })
  781. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/doc.png)" }, "name": "协同文档", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  782. break;
  783. case "study":
  784. _formdiv = new U.UF.UI.form(
  785. "学习中心",
  786. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  787. "id": "study",
  788. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  789. "onresize": function() {}
  790. }, {
  791. closecallback: function() {}
  792. }, { "style": { "height": "36px" } }).form; //创建窗体
  793. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/study.png)" }, "name": "学习中心", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  794. break;
  795. case "mindNetwork": //好友打开
  796. _formdiv = new U.UF.UI.form(
  797. "思维网格",
  798. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=" + _userid }), {
  799. "id": "mindNetwork",
  800. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  801. "onresize": function() {}
  802. }, {
  803. closecallback: function() {}
  804. }, { "style": { "height": "36px" } }).form; //创建窗体
  805. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindNetwork.png)" }, "name": "思维网格", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  806. break;
  807. case "teacherClassRoom": //好友打开
  808. _formdiv = new U.UF.UI.form(
  809. "实时课堂",
  810. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/classRoom?userid=" + _userid + "&oid=" + _oid }), {
  811. "id": "teacherClassRoom",
  812. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  813. "onresize": function() {}
  814. }, {
  815. closecallback: function() {}
  816. }, { "style": { "height": "36px" } }).form; //创建窗体
  817. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/classRoom.png)" }, "name": "实时课堂", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  818. setTimeout(() => {
  819. U.UF.F.windowZooming(_formdiv)
  820. }, 0);
  821. break;
  822. }
  823. } else if (_type == 1 && _oid == "91305d49-01ba-11ed-8c78-005056b86db5") {
  824. switch (str) {
  825. case "project": //好友打开
  826. _formdiv = new U.UF.UI.form(
  827. "项目管理",
  828. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course?userid=" + _userid + "&oid=" + _oid }), {
  829. "id": "project",
  830. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  831. "onresize": function() {}
  832. }, {
  833. closecallback: function() {}
  834. }, { "style": { "height": "36px" } }).form; //创建窗体
  835. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/project.png)" }, "name": "项目管理", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  836. break;
  837. case "evaluate":
  838. _formdiv = new U.UF.UI.form(
  839. "学生评价",
  840. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/works?userid=" + _userid + "&oid=" + _oid }), {
  841. "id": "evaluate",
  842. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  843. "onresize": function() {}
  844. }, {
  845. closecallback: function() {}
  846. }, { "style": { "height": "36px" } }).form; //创建窗体
  847. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/evaluation.png)" }, "name": "学生评价", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  848. break;
  849. case "notice":
  850. _formdiv = new U.UF.UI.form(
  851. "通知公告",
  852. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/notice?userid=" + _userid }), {
  853. "id": "notice",
  854. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  855. "onresize": function() {}
  856. }, {
  857. closecallback: function() {}
  858. }, { "style": { "height": "36px" } }).form; //创建窗体
  859. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/news.png)" }, "name": "通知公告", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  860. break;
  861. case "stuLibrary":
  862. _formdiv = new U.UF.UI.form(
  863. "学习资料",
  864. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/studyLibrary?userid=" + _userid }), {
  865. "id": "stuLibrary",
  866. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  867. "onresize": function() {}
  868. }, {
  869. closecallback: function() {}
  870. }, { "style": { "height": "36px" } }).form; //创建窗体
  871. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/stuLibrary.png)" }, "name": "学习资料", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  872. break;
  873. case "whiteboard":
  874. _formdiv = new U.UF.UI.form(
  875. "电子白板",
  876. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://iwb.cocorobo.cn/" }), {
  877. "id": "whiteboard",
  878. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  879. "onresize": function() {}
  880. }, {
  881. closecallback: function() {}
  882. }, { "style": { "height": "36px" } }).form; //创建窗体
  883. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/whiteBoard.png)" }, "name": "电子白板", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  884. break;
  885. case "investigation":
  886. _formdiv = new U.UF.UI.form(
  887. "问卷调查",
  888. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/ask?userid=" + _userid }), {
  889. "id": "investigation",
  890. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  891. "onresize": function() {}
  892. }, {
  893. closecallback: function() {}
  894. }, { "style": { "height": "36px" } }).form; //创建窗体
  895. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/ask.png)" }, "name": "问卷调查", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  896. break;
  897. case "mind":
  898. _formdiv = new U.UF.UI.form(
  899. "思维导图",
  900. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/kityminder-editor/dist/index.html" }), { //"/jsmind/example/demo.html"
  901. "id": "mind",
  902. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  903. "onresize": function() {}
  904. }, {
  905. closecallback: function() {}
  906. }, { "style": { "height": "36px" } }).form; //创建窗体
  907. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindMapping.png)" }, "name": "思维导图", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  908. break;
  909. case "doc":
  910. // U.MD.D.I.isRoom();
  911. _formdiv = new U.UF.UI.form(
  912. "协同文档",
  913. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "/Office/Word/WordEditArea.htm" }), {
  914. "id": "doc",
  915. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  916. "onresize": function() {}
  917. }, {
  918. closecallback: function() {}
  919. }, { "style": { "height": "36px" } }).form; //创建窗体
  920. U.UF.DL.iframeLoad($("iframe", _formdiv)[0], function() {
  921. $("iframe", _formdiv)[0].contentWindow.U.MD.O.W.load();
  922. })
  923. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/doc.png)" }, "name": "协同文档", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  924. break;
  925. case "study":
  926. _formdiv = new U.UF.UI.form(
  927. "学习中心",
  928. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index?userid=" + _userid + "&oid=" + _oid }), { //https://pbl.cocorobo.cn/pbl-student-table/dist/#/index
  929. "id": "study",
  930. "style": { "width": "70%", "height": "90%", "overflow": 'hidden' },
  931. "onresize": function() {}
  932. }, {
  933. closecallback: function() {}
  934. }, { "style": { "height": "36px" } }).form; //创建窗体
  935. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/study.png)" }, "name": "学习中心", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  936. break;
  937. case "mindNetwork": //好友打开
  938. _formdiv = new U.UF.UI.form(
  939. "思维网格",
  940. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/Grid?userid=" + _userid }), {
  941. "id": "mindNetwork",
  942. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  943. "onresize": function() {}
  944. }, {
  945. closecallback: function() {}
  946. }, { "style": { "height": "36px" } }).form; //创建窗体
  947. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindNetwork.png)" }, "name": "思维网格", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  948. break;
  949. case "train": //好友打开
  950. _formdiv = new U.UF.UI.form(
  951. "训练服务器",
  952. $$("iframe", { "webkitallowfullscreen": "", "mozallowfullscreen": "", "allowfullscreen": "", "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0; width:100%; height:100%;" }, "src": "https://xunlian.cocorobo.cn" }), {
  953. "id": "mindNetwork",
  954. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  955. "onresize": function() {}
  956. }, {
  957. closecallback: function() {}
  958. }, { "style": { "height": "36px" } }).form; //创建窗体
  959. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/mindNetwork.png)" }, "name": "训练服务器", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  960. break;
  961. case "sys":
  962. _formdiv = new U.UF.UI.form(
  963. "体系设置",
  964. $$("iframe", { "frameborder": "no", "border": "0", "scrolling ": "no", "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/evaluation?userid=" + _userid + "&oid=" + _oid }), {
  965. "id": "sys",
  966. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  967. "onresize": function() {}
  968. }, {
  969. closecallback: function() {}
  970. }, { "style": { "height": "36px" } }).form; //创建窗体
  971. _taskbar = { "id": str + _formdiv.id, "style": { "backgroundImage": "url(/img/icon/sys.png)" }, "name": "体系设置", "forms": _formdiv, "click": function() { U.MD.D.I.openApplication(str, obj, info); } }
  972. break;
  973. }
  974. }
  975. //U.MD.D.I.openClick(str);
  976. //如果有任务栏信息
  977. if (_taskbar) {
  978. U.MD.D.T.taskbar(_taskbar); //创建任务处理
  979. }
  980. }
  981. // U.MD.D.I.openClick = function(str){
  982. // var click = '';
  983. // switch(str){
  984. // case 'friend':
  985. // click = '我的好友';
  986. // break;
  987. // case 'domain':
  988. // click = '域名管理';
  989. // break;
  990. // case 'disk':
  991. // click = '我的云盘';
  992. // break;
  993. // case 'word':
  994. // click = 'Word';
  995. // break;
  996. // case 'excel':
  997. // click = 'Execl';
  998. // break;
  999. // case 'txt':
  1000. // click = '文本文件';
  1001. // break;
  1002. // case 'lookupFriend':
  1003. // click = '查找好友';
  1004. // break;
  1005. // case 'ftp':
  1006. // click = 'FTP';
  1007. // break;
  1008. // case 'group':
  1009. // click = '群组';
  1010. // break;
  1011. // case 'set':
  1012. // click = '我的设置';
  1013. // break;
  1014. // case 'systemSet':
  1015. // click = '系统设置';
  1016. // break;
  1017. // case 'boomYun':
  1018. // click = '互联办公';
  1019. // break;
  1020. // case 'xz':
  1021. // click = '云端下载';
  1022. // break;
  1023. // case 'client':
  1024. // click = '有思浏览器';
  1025. // break;
  1026. // case 'backEndProgramming':
  1027. // click = '在线后台编程';
  1028. // break;
  1029. // case 'frontEndProgramming':
  1030. // click = '在线前端编程';
  1031. // break;
  1032. // default: break;
  1033. // }
  1034. // if(U.MD.D.I.Ip && click){
  1035. // var clickUrl = ':12588/useClick.php?name=' + click + '&ip=' + U.MD.D.I.Ip;
  1036. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  1037. // })
  1038. // }
  1039. // }
  1040. /**
  1041. *函数作用:ajax简易函数,使用post格式
  1042. *@param url {data} 后台地址
  1043. *@param data {data} 参数json
  1044. *@param fn {data} 回调函数
  1045. *
  1046. */
  1047. // U.MD.D.I.Mysqlrequest = function(url,fn){
  1048. // var xhr = new XMLHttpRequest();
  1049. // xhr.open("GET",url,true);
  1050. // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  1051. // xhr.onreadystatechange = function(){
  1052. // if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)){
  1053. // fn.call(this,xhr.responseText);
  1054. // }
  1055. // };
  1056. // xhr.send();
  1057. // }
  1058. /*判断是否是内网IP*/
  1059. // U.MD.D.I.isInnerIPFn = function(str){
  1060. // var curPageUrl = str;
  1061. // var reg1 = /(http|ftp|https|www):\/\//g;//去掉前缀
  1062. // curPageUrl =curPageUrl.replace(reg1,'');
  1063. // // console.log('curPageUrl-1 '+curPageUrl);
  1064. // var reg2 = /\:+/g;//替换冒号为一点
  1065. // curPageUrl =curPageUrl.replace(reg2,'.');
  1066. // // console.log('curPageUrl-2 '+curPageUrl);
  1067. // curPageUrl = curPageUrl.split('.');//通过一点来划分数组
  1068. // var ipAddress = curPageUrl[0]+'.'+curPageUrl[1]+'.'+curPageUrl[2]+'.'+curPageUrl[3];
  1069. // if(curPageUrl[2] != '16'){
  1070. // return ipAddress;
  1071. // }else{
  1072. // return false;
  1073. // }
  1074. // }
  1075. // U.MD.D.I.getUserIP = function(onNewIP) { // onNewIp - your listener function for new IPs
  1076. // //compatibility for firefox and chrome
  1077. // var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
  1078. // var pc = new myPeerConnection({
  1079. // iceServers: []
  1080. // }),
  1081. // noop = function() {},
  1082. // localIPs = {},
  1083. // ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
  1084. // key;
  1085. // function iterateIP(ip) {
  1086. // if (!localIPs[ip]) onNewIP(ip);
  1087. // localIPs[ip] = true;
  1088. // }
  1089. // //create a bogus data channel
  1090. // pc.createDataChannel("");
  1091. // // create offer and set local description
  1092. // pc.createOffer().then(function(sdp) {
  1093. // sdp.sdp.split('\n').forEach(function(line) {
  1094. // if (line.indexOf('candidate') < 0) return;
  1095. // line.match(ipRegex).forEach(iterateIP);
  1096. // });
  1097. // pc.setLocalDescription(sdp, noop, noop);
  1098. // }).catch(function(reason) {
  1099. // // An error occurred, so handle the failure to connect
  1100. // });
  1101. // //sten for candidate events
  1102. // pc.onicecandidate = function(ice) {
  1103. // if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
  1104. // ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
  1105. // };
  1106. // }
  1107. // U.MD.D.I.getUserIpBool = function(callback){
  1108. // U.MD.D.I.getUserIP(function(ip){
  1109. // alert("Got IP! :" + ip);
  1110. // });
  1111. //}
  1112. //#endregion