DeskTop.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  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": "student", "style": { "cssText": "background-image:url(/img/icon/student.png)" } },
  27. { "Name": "评价管理", "Url": "evaluate", "style": { "cssText": "background-image:url(/img/icon/evaluation.png)" } },
  28. { "Name": "班级管理", "Url": "class", "style": { "cssText": "background-image:url(/img/icon/class.png)" } },
  29. { "Name": "我的资料", "Url": "my", "style": { "cssText": "background-image:url(/img/icon/myMessage.png)" } },
  30. { "Name": "通知公告", "Url": "notice", "style": { "cssText": "background-image:url(/img/icon/news.png)" } },
  31. { "Name": "素材库", "Url": "library", "style": { "cssText": "background-image:url(/img/icon/library.png)" } },
  32. { "Name": "电子白板", "Url": "whiteboard", "style": { "cssText": "background-image:url(/img/icon/whiteBoard.png)" } },
  33. { "Name": "问卷调查", "Url": "investigation", "style": { "cssText": "background-image:url(/img/icon/ask.png)" } },
  34. { "Name": "便签分类", "Url": "note", "style": { "cssText": "background-image:url(/img/icon/note.png)" } },
  35. { "Name": "量规评分", "Url": "score", "style": { "cssText": "background-image:url(/img/icon/score.png)" } },
  36. { "Name": "思维导图", "Url": "mind", "style": { "cssText": "background-image:url(/img/icon/mindMapping.png)" } },
  37. { "Name": "协同文档", "Url": "doc", "style": { "cssText": "background-image:url(/img/icon/doc.png)" } }
  38. ];
  39. //#region 桌面初始化a
  40. /**
  41. * 初始化桌面的起始函数
  42. *
  43. */
  44. U.MD.D.I.init = function () {
  45. if ($("#U_MD_D_K")[0]) {
  46. //初始化桌面图标
  47. U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0]);
  48. // var clickUrl = ':12588/requestIp.php';
  49. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  50. // U.MD.D.I.Ip = data;
  51. // var AccessUrl = ':12588/useAccess.php?ip=' + U.MD.D.I.Ip;
  52. // U.MD.D.I.Mysqlrequest(AccessUrl,function(data){
  53. // U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
  54. // })
  55. // //初始化任务栏,因为是静态的,所以直接改变样式即可.
  56. // })
  57. }
  58. }
  59. /**
  60. * 隐藏任务栏
  61. *
  62. * @param {element} 桌面元素
  63. */
  64. U.MD.D.I.hiddenTaskbar = function (el) {
  65. //任务栏位置变小
  66. U.selectEl(el).parentElement(3).css({ "bottom": "-39px" });
  67. //桌面的位置变大
  68. // U.selectEl("#U_MD_D_K").css({ "left": "5px" });
  69. }
  70. /**
  71. * 初始化打印桌面图标
  72. *
  73. * @param {element} 桌面元素
  74. */
  75. U.MD.D.I.initDesktopIcons = function (el) {
  76. var i, //用于循环
  77. _content, //桌面图标元素
  78. _iconcontent, //桌面图标元素
  79. _frag = $$("frag"), //定义一个碎片元素
  80. _DesktopIconInfo = U.MD.D.I.DeskIcon; //获取桌面图标
  81. //清楚桌面图标
  82. el.innerHTML = "";
  83. //循环创建桌面图标
  84. for (i = 0; i < _DesktopIconInfo.length; i++) {
  85. _content = $$("div", {
  86. className: "U_MD_D_KO",
  87. "onmousedown": U.UF.C.closure(function (obj) {
  88. //防止拖动图标即打开了桌面应用
  89. U.MD.D.click(this, obj);
  90. }, [_DesktopIconInfo[i]]),
  91. "onclick": U.UF.C.closure(function (obj) {
  92. //防止拖动图标即打开了桌面应用
  93. U.MD.D.click(this, obj);
  94. }, [_DesktopIconInfo[i]])
  95. }, _frag); //
  96. _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
  97. $$("div", { className: "U_MD_D_KOS U_Img", "style": _DesktopIconInfo[i].style }, _iconcontent); //{ "backgroundPosition": _DesktopIconInfo[i].Img.x + "px " + _DesktopIconInfo[i].Img.y + "px" }
  98. $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: #000 2px 1px 3px,#666 0 1px 0,#555 -1px 0 0,#999 0 -1px 0; -webkit-text-shadow: #333 1px 0 0,#666 0 1px 0,#555 -1px 0 0,#999 0 -1px 0; -moz-text-shadow: #333 1px 0 0,#666 0 1px 0,#555 -1px 0 0,#999 0 -1px 0; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _DesktopIconInfo[i].Name }, _iconcontent);
  99. }
  100. //加载好后给图标定位
  101. U.MD.D.iconPostion($(_frag).Child());
  102. //把图标加载到页面
  103. el.appendChild(_frag);
  104. }
  105. /**
  106. * 显示任务栏
  107. *
  108. * @param {element} 桌面元素
  109. */
  110. U.MD.D.I.displayTaskbar = function (el) {
  111. //判断是否需要形式任务栏,由于用了mouseover事件会冒泡响应多次,这里做了过滤
  112. if (!U.UF.EV.stopBubbleMouseOutOrOver(el) && U.selectEl(el).css("bottom") != "0px") {
  113. //任务栏位置变化
  114. U.selectEl(el).css({ "bottom": "0px" });
  115. //桌面位置变话
  116. // U.selectEl("#U_MD_D_K").css({ "left": "70px" });
  117. }
  118. }
  119. //#region 桌面图标拖动逻辑
  120. /**
  121. * 桌面排列图标
  122. *
  123. * @param {element} 桌面元素
  124. * @param {object} 上下相距的距离
  125. * @param {object} 左右相距的距离
  126. * @return {object} 命名空间
  127. */
  128. U.MD.D.iconPostion = function (childs, top, left) {
  129. var i; //用于循环处理
  130. top = top || 15; //如果没有设置元素的间距处理默认上间距为15
  131. left = left || 20; //如果没有设置元素的间距处理默认左间距为15
  132. //循环所有的图标,设置每个图标的间距,打印顺序是竖排打印的方式
  133. for (i = 0; i < childs.length; i++) {
  134. //如果竖排top超过了范围处理
  135. if (top + 95 > US.height - 85) {
  136. //left超过了页面范围处理,则向上重叠打印处理
  137. if ((left + 180) > US.width) {
  138. top -= 115;
  139. left -= 90;
  140. }
  141. //没有超过范围,那么left+90添加到下一个竖排打印
  142. else {
  143. left += 90;
  144. top = 15;
  145. };
  146. }
  147. //给图标的位置赋值
  148. U.selectEl(childs[i]).css({ top: top + "px", left: left + "px" });
  149. if (i < childs.length - 1) {
  150. //页面图标每次向下加115
  151. top += 115;
  152. }
  153. }
  154. //返回最后调用的图标的位置
  155. return [top, left];
  156. }
  157. /**
  158. * 桌面点击事件逻辑
  159. *
  160. * @param {element} 桌面元素
  161. * @param {object} 上下相距的距离
  162. * @param {object} 左右相距的距离
  163. * @return {object} 命名空间
  164. */
  165. U.MD.D.click = function (el, obj) {
  166. var _buttonnumber = event.button; //点击的按钮的事件值
  167. U.UF.EV.stopBubble(); //阻止向上冒泡
  168. //onmousedown 包含了左键和右键 这里大于2是为了兼容 所有浏览器的右键处理
  169. if (_buttonnumber < 2) {
  170. //如果是click事件的处理
  171. if (event.type == "click") {
  172. //如果元素在mousemove事件中没有移动则出发click事件
  173. if (!U.MD.D.I.IsDrag) {
  174. //打开应用处理
  175. U.MD.D.I.openApplication(obj.Url, { "userid": US.userInfo.UserId, "directoryid": US.FTPFOLDERID });
  176. }
  177. }
  178. //如果是mouse事件的处理
  179. else {
  180. //拖动处理,添加拖动和拖动结束事件
  181. U.UF.F.drag(el, U.MD.D.iconMove, U.MD.D.iconUp);
  182. }
  183. U.MD.D.I.IsDrag = false;
  184. }
  185. }
  186. /**
  187. * 拖动的处理
  188. *
  189. */
  190. U.MD.D.iconMove = function () {
  191. //如果当前位置点击初始化的位置出现了变化,则设置是否拖动的属性 U.MD.D.I.IsDrag为true
  192. U.MD.D.I.IsDrag = true;
  193. }
  194. /**
  195. * 拖动结束后,这里是定位处理,以网状的形式定位
  196. *
  197. * @param {element} 拖动的元素
  198. * @return {object} 命名空间
  199. */
  200. U.MD.D.iconUp = function (el) {
  201. var _top = 15,
  202. _left = 20,
  203. _margin,
  204. _childs = U.selectEl("#U_MD_D_K").Child(), //桌面所有的图标
  205. _positioninfo = U.UF.EL.getElementInfo(el); //获取拖动结束的元素的位置
  206. if (_positioninfo["OT"] > 15) {
  207. //网状的形式定位,如果差超过了55,那么向下定位,否则向上定位
  208. _margin = ((_positioninfo["OT"] - 15) % 115 > 55 && _positioninfo["OT"] + 115 < US.height) ? 1 : 0;
  209. _top = (Math.floor((_positioninfo["OT"] - 15) / 115) + _margin) * 115 + 15;
  210. }
  211. if (_positioninfo["OL"] > 20) {
  212. //网状的形式定位,如果差超过了90,那么向右定位,否则向左定位
  213. _margin = ((_positioninfo["OL"] - 20) % 90 > 45 && _positioninfo["OL"] + 90 < US.width) ? 1 : 0;
  214. _left = (Math.floor((_positioninfo["OL"] - 20) / 90) + _margin) * 90 + 20
  215. }
  216. //while循环判断么一个重叠的元素
  217. do {
  218. _positioninfo = U.MD.D.iconPostion([el], _top, _left); //给重叠的元素向下定位
  219. _top = _positioninfo[0] + 115; //得到定位后的top
  220. _left = _positioninfo[1]; //得到定位后的left
  221. } while (el = U.MD.D.isOverlap(el, _childs, _positioninfo))
  222. }
  223. /**
  224. * 判断拖动后图标是否重叠
  225. *
  226. * @param {element} 拖动的元素
  227. * @param {element} 桌面所有的元素
  228. * @param {array} 拖动元素的位置
  229. ----------[0] 上 top
  230. ----------[1] 左 left
  231. * @return {object} 命名空间
  232. */
  233. U.MD.D.isOverlap = function (el, childs, postionarray) {
  234. //循环所有的图标
  235. for (var i = 0; i < childs.length; i++) {
  236. //判断有没有和该图标诶子重叠的元素
  237. if (el != childs[i] && (childs[i].offsetTop == postionarray[0] && childs[i].offsetLeft == postionarray[1])) {
  238. return childs[i]; //如果有返回
  239. }
  240. }
  241. }
  242. //#endregion
  243. //#endregion
  244. //#region 桌面应用
  245. /**
  246. * 打开应用
  247. *
  248. * @param {string} 类型
  249. -----------------Disk 网盘系统
  250. -----------------PDisk 学习系统网盘
  251. -----------------Poto 图片
  252. -----------------Video 视频
  253. -----------------Music 音乐
  254. -----------------Word word
  255. -----------------Excel excel
  256. -----------------Txt 记事本
  257. -----------------PB 学习系统
  258. -----------------Blog 朋友圈系统
  259. -----------------FTP ftp系统
  260. -----------------Group 好友群
  261. -----------------SY 首页系统
  262. -----------------Set 个人设置
  263. -----------------XSet 系统设置
  264. -----------------App 我们所有的app
  265. -----------------BC c.1473.cn 平台
  266. -----------------CWeb d.1473.cn 变成平台
  267. -----------------其他的外联系统 我们统一用iframe打开
  268. * @param {array} 类型
  269. 如果第一个参数为"disk",则第二个参数为object,里面包含了用户id和目录id{userid:"",directoryid:""}
  270. 如果第一个参数为"word"或者"excel","txt",则第二个参数为文件信息fileinfo。
  271. 如果第一个参数为"blog"或者"PDisk"。建议删除。
  272. 如果第一个参数为其他,则无第二个参数
  273. * @returns {array}
  274. */
  275. U.MD.D.I.openApplication = function (str, obj, info) {
  276. obj = obj || {};
  277. var _taskbar, //_taskbar 作为任务栏显示的元素,包含图标和名字
  278. _formdiv, //创建任务栏时同时弹出的窗体元素。
  279. _userinfo = US.userInfo, //登录用户信息
  280. _userid = obj.userid || _userinfo.UserId //登录用户id
  281. ;
  282. //选择应用处理
  283. switch (str) {
  284. case "project": //好友打开
  285. _formdiv = new U.UF.UI.form(
  286. "项目管理",
  287. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course" }), {
  288. "id": "project",
  289. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  290. "onresize": function () { }
  291. }, {
  292. closecallback: function () { }
  293. }, { "style": { "height": "36px" } }).form; //创建窗体
  294. _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); } }
  295. break;
  296. case "student":
  297. new U.UF.UI.form(
  298. "学生管理",
  299. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn/pbl-student-table/dist/#/index" }), {
  300. "id": "student",
  301. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  302. "onresize": function () { }
  303. }, {
  304. closecallback: function () { }
  305. }, { "style": { "height": "36px" } }).form; //创建窗体
  306. break;
  307. case "evaluate":
  308. new U.UF.UI.form(
  309. "评价管理",
  310. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  311. "id": "evaluate",
  312. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  313. "onresize": function () { }
  314. }, {
  315. closecallback: function () { }
  316. }, { "style": { "height": "36px" } }).form; //创建窗体
  317. break;
  318. case "class":
  319. new U.UF.UI.form(
  320. "班级管理",
  321. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  322. "id": "class",
  323. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  324. "onresize": function () { }
  325. }, {
  326. closecallback: function () { }
  327. }, { "style": { "height": "36px" } }).form; //创建窗体
  328. break;
  329. case "my":
  330. new U.UF.UI.form(
  331. "我的资料",
  332. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  333. "id": "my",
  334. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  335. "onresize": function () { }
  336. }, {
  337. closecallback: function () { }
  338. }, { "style": { "height": "36px" } }).form; //创建窗体
  339. break;
  340. case "notice":
  341. new U.UF.UI.form(
  342. "通知公告",
  343. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  344. "id": "notice",
  345. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  346. "onresize": function () { }
  347. }, {
  348. closecallback: function () { }
  349. }, { "style": { "height": "36px" } }).form; //创建窗体
  350. break;
  351. case "library":
  352. new U.UF.UI.form(
  353. "素材库",
  354. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  355. "id": "library",
  356. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  357. "onresize": function () { }
  358. }, {
  359. closecallback: function () { }
  360. }, { "style": { "height": "36px" } }).form; //创建窗体
  361. break;
  362. case "whiteboard":
  363. new U.UF.UI.form(
  364. "电子白板",
  365. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  366. "id": "whiteboard",
  367. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  368. "onresize": function () { }
  369. }, {
  370. closecallback: function () { }
  371. }, { "style": { "height": "36px" } }).form; //创建窗体
  372. break;
  373. case "investigation":
  374. new U.UF.UI.form(
  375. "问卷调查",
  376. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  377. "id": "investigation",
  378. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  379. "onresize": function () { }
  380. }, {
  381. closecallback: function () { }
  382. }, { "style": { "height": "36px" } }).form; //创建窗体
  383. break;
  384. case "note":
  385. new U.UF.UI.form(
  386. "便签分类",
  387. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  388. "id": "note",
  389. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  390. "onresize": function () { }
  391. }, {
  392. closecallback: function () { }
  393. }, { "style": { "height": "36px" } }).form; //创建窗体
  394. break;
  395. case "score":
  396. new U.UF.UI.form(
  397. "量规评分",
  398. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  399. "id": "score",
  400. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  401. "onresize": function () { }
  402. }, {
  403. closecallback: function () { }
  404. }, { "style": { "height": "36px" } }).form; //创建窗体
  405. break;
  406. case "mind":
  407. new U.UF.UI.form(
  408. "思维导图",
  409. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  410. "id": "mind",
  411. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  412. "onresize": function () { }
  413. }, {
  414. closecallback: function () { }
  415. }, { "style": { "height": "36px" } }).form; //创建窗体
  416. break;
  417. case "doc":
  418. new U.UF.UI.form(
  419. "协同文档",
  420. $$("iframe", { "style": { "cssText": "border:0;width:100%;height:100%" }, "src": "https://pbl.cocorobo.cn" }), {
  421. "id": "doc",
  422. "style": { "width": "90%", "height": "90%", "overflow": 'hidden' },
  423. "onresize": function () { }
  424. }, {
  425. closecallback: function () { }
  426. }, { "style": { "height": "36px" } }).form; //创建窗体
  427. break;
  428. case "friend": //好友打开
  429. U.MD.D.I.IsDrag = true;
  430. U.MD.F.W.viewFriend(info); //打开好友
  431. // U.MD.N.urlWrite("friend/" + obj.directoryid, "好友"); //好友的url重写
  432. break;
  433. case "domain":
  434. 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" } });
  435. _formdiv = new U.UF.UI.form("域名管理", _iframe, { id: "U_MD_DS_DomainShare", style: { "width": "370px", "height": "390px" } }).form;
  436. if (_formdiv) {
  437. //生成任务栏的变量
  438. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
  439. }
  440. break;
  441. case "disk": //个人网盘查看
  442. _formdiv = U.MD.DK.initDisk(_userid, obj.directoryid); //根据网盘数据,并加载网盘,里面包含了url重写
  443. if (_formdiv) {
  444. //生成任务栏的变量
  445. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  446. }
  447. break;
  448. case "word": //Word打开
  449. var _wordinfo = U.MD.O.word(_userinfo, obj, arguments[2]); //初始化word的处理
  450. _formdiv = _wordinfo[0];
  451. if (_formdiv) {
  452. //生成任务栏的变量
  453. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-462px -296px", "name": "文档", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, _wordinfo[1]); } }
  454. }
  455. if (obj.UrlType != 'join') {
  456. U.MD.N.urlWrite("word/" + _formdiv.id.substr(-36), "在线文档"); //word的url重写
  457. }
  458. break;
  459. case "excel": //Excel打开
  460. _formdiv = U.MD.O.excel(_userinfo, obj);
  461. if (_formdiv) {
  462. //生成任务栏的变量
  463. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-523px -296px", "name": "Excel", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  464. }
  465. U.MD.N.urlWrite("excel/" + _formdiv.id.substr(-36), "Excel");
  466. break;
  467. case "txt": //Txt打开
  468. _formdiv = U.MD.D.Txt.textCreate();
  469. if (_formdiv) {
  470. //生成任务栏的变量
  471. _taskbar = { "id": str + obj.directoryid, "backgroundPostion": "-267px -413px", "name": "文本", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  472. }
  473. U.MD.N.urlWrite("txt/" + _formdiv.id.substr(-36), "文本");
  474. break;
  475. case "lookupFriend":
  476. _formdiv = U.MD.F.S.popSearchFriendsOrGroupForm(0);
  477. //生成任务栏的变量
  478. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "查找好友", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  479. U.MD.N.urlWrite("lookupfriend/" + obj.directoryid.substr(-36), "查找好友"); //查找好友的url重写
  480. break;
  481. case "ftp": //Ftp
  482. _formdiv = U.MD.F.S.popupsSearchFtp();
  483. //生成任务栏的变量
  484. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-144px -413px", "name": "FTP", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  485. break;
  486. case "group": //群组
  487. _formdiv = U.MD.F.S.popupsSearchGroups(0);
  488. //生成任务栏的变量
  489. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "群组", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  490. break;
  491. case "set": //个人设置
  492. _formdiv = U.MD.U.P.userDataSet();
  493. if (_formdiv) {
  494. //生成任务栏的变量
  495. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "个人设置", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  496. }
  497. break;
  498. case "systemSet": //系统设置
  499. _formdiv = U.MD.D.B.init();
  500. //生成任务栏的变量
  501. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "系统设置", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  502. break;
  503. case "boomYun": //BoomYun
  504. _formdiv = U.Boom.I.onload();
  505. //生成任务栏的变量
  506. _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-844px -419px", "name": "互联办公", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
  507. U.MD.N.urlWrite("boomyun", "互联办公"); //boomyun的url重写
  508. break;
  509. case "xz": //App下载
  510. window.open("http://xz.1473.cn");
  511. break;
  512. case "client": //App下载
  513. window.open("http://client.1473.cn");
  514. break;
  515. case "backEndProgramming": //在线编程平台打开
  516. window.open("http://c.1473.cn");
  517. break;
  518. case "frontEndProgramming": //在线web编程
  519. window.open("http://d.1473.cn");
  520. break;
  521. default:
  522. break;
  523. }
  524. //U.MD.D.I.openClick(str);
  525. //如果有任务栏信息
  526. if (_taskbar) {
  527. U.MD.D.T.taskbar(_taskbar); //创建任务处理
  528. }
  529. }
  530. // U.MD.D.I.openClick = function(str){
  531. // var click = '';
  532. // switch(str){
  533. // case 'friend':
  534. // click = '我的好友';
  535. // break;
  536. // case 'domain':
  537. // click = '域名管理';
  538. // break;
  539. // case 'disk':
  540. // click = '我的云盘';
  541. // break;
  542. // case 'word':
  543. // click = 'Word';
  544. // break;
  545. // case 'excel':
  546. // click = 'Execl';
  547. // break;
  548. // case 'txt':
  549. // click = '文本文件';
  550. // break;
  551. // case 'lookupFriend':
  552. // click = '查找好友';
  553. // break;
  554. // case 'ftp':
  555. // click = 'FTP';
  556. // break;
  557. // case 'group':
  558. // click = '群组';
  559. // break;
  560. // case 'set':
  561. // click = '我的设置';
  562. // break;
  563. // case 'systemSet':
  564. // click = '系统设置';
  565. // break;
  566. // case 'boomYun':
  567. // click = '互联办公';
  568. // break;
  569. // case 'xz':
  570. // click = '云端下载';
  571. // break;
  572. // case 'client':
  573. // click = '有思浏览器';
  574. // break;
  575. // case 'backEndProgramming':
  576. // click = '在线后台编程';
  577. // break;
  578. // case 'frontEndProgramming':
  579. // click = '在线前端编程';
  580. // break;
  581. // default: break;
  582. // }
  583. // if(U.MD.D.I.Ip && click){
  584. // var clickUrl = ':12588/useClick.php?name=' + click + '&ip=' + U.MD.D.I.Ip;
  585. // U.MD.D.I.Mysqlrequest(clickUrl,function(data){
  586. // })
  587. // }
  588. // }
  589. /**
  590. *函数作用:ajax简易函数,使用post格式
  591. *@param url {data} 后台地址
  592. *@param data {data} 参数json
  593. *@param fn {data} 回调函数
  594. *
  595. */
  596. // U.MD.D.I.Mysqlrequest = function(url,fn){
  597. // var xhr = new XMLHttpRequest();
  598. // xhr.open("GET",url,true);
  599. // xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  600. // xhr.onreadystatechange = function(){
  601. // if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)){
  602. // fn.call(this,xhr.responseText);
  603. // }
  604. // };
  605. // xhr.send();
  606. // }
  607. /*判断是否是内网IP*/
  608. // U.MD.D.I.isInnerIPFn = function(str){
  609. // var curPageUrl = str;
  610. // var reg1 = /(http|ftp|https|www):\/\//g;//去掉前缀
  611. // curPageUrl =curPageUrl.replace(reg1,'');
  612. // // console.log('curPageUrl-1 '+curPageUrl);
  613. // var reg2 = /\:+/g;//替换冒号为一点
  614. // curPageUrl =curPageUrl.replace(reg2,'.');
  615. // // console.log('curPageUrl-2 '+curPageUrl);
  616. // curPageUrl = curPageUrl.split('.');//通过一点来划分数组
  617. // var ipAddress = curPageUrl[0]+'.'+curPageUrl[1]+'.'+curPageUrl[2]+'.'+curPageUrl[3];
  618. // if(curPageUrl[2] != '16'){
  619. // return ipAddress;
  620. // }else{
  621. // return false;
  622. // }
  623. // }
  624. // U.MD.D.I.getUserIP = function(onNewIP) { // onNewIp - your listener function for new IPs
  625. // //compatibility for firefox and chrome
  626. // var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
  627. // var pc = new myPeerConnection({
  628. // iceServers: []
  629. // }),
  630. // noop = function() {},
  631. // localIPs = {},
  632. // ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,
  633. // key;
  634. // function iterateIP(ip) {
  635. // if (!localIPs[ip]) onNewIP(ip);
  636. // localIPs[ip] = true;
  637. // }
  638. // //create a bogus data channel
  639. // pc.createDataChannel("");
  640. // // create offer and set local description
  641. // pc.createOffer().then(function(sdp) {
  642. // sdp.sdp.split('\n').forEach(function(line) {
  643. // if (line.indexOf('candidate') < 0) return;
  644. // line.match(ipRegex).forEach(iterateIP);
  645. // });
  646. // pc.setLocalDescription(sdp, noop, noop);
  647. // }).catch(function(reason) {
  648. // // An error occurred, so handle the failure to connect
  649. // });
  650. // //sten for candidate events
  651. // pc.onicecandidate = function(ice) {
  652. // if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;
  653. // ice.candidate.candidate.match(ipRegex).forEach(iterateIP);
  654. // };
  655. // }
  656. // U.MD.D.I.getUserIpBool = function(callback){
  657. // U.MD.D.I.getUserIP(function(ip){
  658. // alert("Got IP! :" + ip);
  659. // });
  660. //}
  661. //#endregion