DeskTop.js 50 KB

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