U.CD.Control.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. //注册编程控件js,这个js比较复杂,以后再详细细分每个控件。暂时可以写在一块。。
  2. //
  3. Namespace.register("U.CD.C");
  4. //构建botton按钮
  5. U.CD.C.Button = function () {
  6. return $$("input", { "type": "button", "style": { "cssText": "width:120px; height:25px; position:absolute;" }, "value": "按钮" });
  7. }
  8. //构建Div --钟泽锋
  9. U.CD.C.Div = function () {
  10. return $$("div", { "style": { "cssText": "width:80px; height:80px; line-height:80px; color:white; background-color:blue; text-align:center; position:absolute;" }, "innerHTML": "最基本元素" });
  11. }
  12. //构建img --钟泽锋
  13. U.CD.C.Img = function () {
  14. return $$("img", { "style": { "cssText": "width:200px; height:200px; text-align:center; position:absolute;" }, "src": "http://d.1473.cn/images/cloudlogo.png" });
  15. }
  16. //构建textarea --钟泽锋
  17. U.CD.C.Textarea = function () {
  18. return $$("textarea", { "style": { "cssText": "width:360px; height:160px; border:1px solid gray; position:absolute;" }, "value": "文本域" });
  19. }
  20. //构建reset按钮 --洪超彬
  21. U.CD.C.Reset = function () {
  22. return $$("input", { "type": "reset", "style": { "cssText": "width:120px; height:25px; position:absolute;" }, "value": "重置" });
  23. }
  24. //构建reset按钮 --洪超彬
  25. U.CD.C.Submit = function () {
  26. return $$("input", { "type": "submit", "style": { "cssText": "width:120px; height:25px; position:absolute;" }, "value": "提交" });
  27. }
  28. //构建text文本框 --洪超彬
  29. U.CD.C.Text = function () {
  30. return $$("input", { "type": "text", "style": { "cssText": "width:150px; height:25px; position:absolute;"} });
  31. }
  32. //构建password文本框 --洪超彬
  33. U.CD.C.Password = function () {
  34. return $$("input", { "type": "password", "style": { "cssText": "width:150px; height:25px; position:absolute;"} });
  35. }
  36. //构建radio按钮 --洪超彬
  37. U.CD.C.Radio = function () {
  38. return $$("input", { "type": "radio", "style": { "cssText": "position:absolute;"} });
  39. }
  40. //构建checkbox按钮 --洪超彬
  41. U.CD.C.Checkbox = function () {
  42. return $$("input", { "type": "checkbox", "style": { "cssText": "position:absolute;"} });
  43. }
  44. //构建p --钟泽锋
  45. U.CD.C.P = function () {
  46. return $$("p", { "style": { "cssText": " position:absolute; " }, "innerHTML": "这是一个段落" });
  47. }
  48. //构建h --钟泽锋
  49. U.CD.C.H = function () {
  50. return $$("h3", { "style": { "cssText": " position:absolute;" }, "innerHTML": "这是一个标题" });
  51. }
  52. //构建select --钟泽锋
  53. U.CD.C.Select = function () {
  54. //return $$("select", { "style": { "cssText": " position:absolute;" }, "innerHTML": "<option value=0>一月</option><option value=1>二月</option><option value=2>三月</option><option value=3>四月</option>" });
  55. //如果还有地方需要弹出,还可以继续封装。
  56. /*var _UFFD = $$("div", { "className": "UCD_TR_CP" }); //调用主项目对话框,并构建一个显示用的Div。
  57. $$("div", { "className": "UCD_TR_CP_MS", "innerHTML": "请输入选项个数:" }, _UFFD); //项目名称输入input 传最后一个参数_UFFD的是将input加入_UFFD中
  58. var _h = $$("input", { "className": "UCD_RT_CP_Input" }, _UFFD); //行
  59. var P = ([_UDPD, _L, _T, _h]); //参数数组
  60. //创建项目一定是在根元素下面。
  61. var _CUM = new U.UF.UI.Dialog(null, null, "创建Select", 350, "", "", "", "", "", U.M.apply(_UFFD, [[U.CD.C.SelectAsyn, P]]), _UFFD, ""); //js太智能了,可以自由拼凑参数!
  62. U.D.PopupWindow(_CUM.Create());*/
  63. var arr = new Array("操作", "设置栏目", "更多设置", "更多选项"); //保存下拉列表内容的数组
  64. var _s = $$("select", { "style": { "cssText": "position:absolute;"} }); //创建select元素
  65. for (var i = 0; i < arr.length; i++) {//根据数组大小创建option
  66. var _o = $$("option", { "style": {}, "innerHTML": arr[i] }, _s); //创建option
  67. }
  68. return _s; //返回select
  69. }
  70. //select弹窗异步函数 --钟泽锋 --暂时不使用
  71. U.CD.C.SelectAsyn = function (_UDPD, _L, _T, _h) {
  72. var a = new Array("操作", "设置栏目", "更多设置", "更多选项"); //保存选项内容的数组
  73. var _h = parseInt(_h.value); //option选项个数
  74. if (_h >= 20 || _h <= 0) { alert("请输入正确数值0-20。"); return; } //选项个数大于0不大于20
  75. var _s = $$("select", { "style": { "cssText": "position:absolute;"} }); //创建select元素
  76. for (var i = 0; i < _h; i++) {//根据传入数量创建option
  77. var _o = $$("option", { "style": {}, "innerHTML": i }, _s); //创建option
  78. }
  79. U.CD.L.AppendIF(_s, _UDPD, _L, _T); //将select加入编辑区域
  80. }
  81. //构建Table --钟泽锋
  82. U.CD.C.Table = function (_UDPD, _L, _T) {
  83. //如果还有地方需要弹出,还可以继续封装。
  84. var _UFFD = $$("div", { "className": "UCD_TR_CP" }); //调用主项目对话框,并构建一个显示用的Div。
  85. $$("div", { "className": "UCD_TR_CP_MS", "innerHTML": "请输入行数:" }, _UFFD); //项目名称输入input 传最后一个参数_UFFD的是将input加入_UFFD中
  86. var _h = $$("input", { "className": "UCD_RT_CP_Input" }, _UFFD); //行
  87. $$("div", { "className": "UCD_TR_CP_MS", "innerHTML": "请输入列数:" }, _UFFD); //项目名称输入input
  88. var _l = $$("input", { "className": "UCD_RT_CP_Input" }, _UFFD); //列
  89. var P = ([_UDPD, _L, _T, _h, _l]); //参数数组
  90. //创建项目一定是在根元素下面。
  91. var _CUM = new U.UF.UI.Dialog("创建表格Table", { "width": "350px" }, null, U.M.apply(_UFFD, [[U.CD.C.TableAsyn, P]]), _UFFD); //js太智能了,可以自由拼凑参数!
  92. U.D.PopupWindow(_CUM.Create());
  93. }
  94. //表格弹窗异步函数。也就是单击了弹出窗体确认按钮后触发的事件。
  95. U.CD.C.TableAsyn = function (_UDPD, _L, _T, _h, _l) {
  96. var _h = parseInt(_h.value); //行
  97. var _l = parseInt(_l.value); //列
  98. if (_h <= 0 || _l <= 0) { alert("请输入正确数值(0-30)"); return; } //行数列数不小于0
  99. if (_h > 30 || _l > 30) { alert("数值过大(0-30)"); return; } //行数列数不大于30
  100. var str = ""
  101. var i, j; //i:列数,j:行数
  102. for (i = 0; i < _h; i++) {//根据行数列数构建table中的内容
  103. str += "<tr style='border:1px solid green;'>";
  104. for (j = 0; j < _l; j++) {
  105. str += "<td style='border:1px solid green;'>&nbsp;</td>";
  106. }
  107. str += "</tr>";
  108. }
  109. var _t = $$("table", { "style": { "cssText": "width:300px; height:200px; position:absolute; border:1px solid blue;"} }); //创建一个table并设置css样式
  110. U.CD.C.IETable(_t, str); //调用setTableInnerHTML方法为table加入内容(方法用于解决ie6-ie9不支持table的innerHTML问题)
  111. U.CD.L.AppendIF(_t, _UDPD, _L, _T); //调用追加函数追加到iframe中
  112. }
  113. //*向指定table加入html代码(解决ie6-ie9不支持table的innerHTML问题)--钟泽锋
  114. U.CD.C.IETable = function (table, html) {
  115. if (navigator && navigator.userAgent.match(/msie/i)) {
  116. var temp = table.ownerDocument.createElement('div');
  117. temp.innerHTML = '<table><tbody>' + html + '</tbody></table>'; //ie6-ie9不支持table的innerHTML问题,在table中加入tbody标签可以解决
  118. if (table.tBodies.length == 0) {
  119. var tbody = document.createElement("tbody");
  120. table.appendChild(tbody);
  121. }
  122. table.replaceChild(temp.firstChild.firstChild, table.tBodies[0]);
  123. } else {
  124. table.innerHTML = html;
  125. }
  126. }
  127. //构建ol --钟泽锋
  128. U.CD.C.Ol = function (_UDPD, _L, _T) {
  129. var _UFFD = $$("div", { "className": "UCD_TR_CP", "id": "UCD_TR_CPOL" }); //调用主项目对话框,并构建一个显示用的Div。
  130. $$("div", { "className": "UCD_TR_CP_MS", "innerHTML": "请输入列表行数:" }, _UFFD); //项目名称输入input 传最后一个参数_UFFD的是将input加入_UFFD中
  131. var _h = $$("input", { "className": "UCD_RT_CP_Input" }, _UFFD); //行
  132. var P = ([_UDPD, _L, _T, _h]); //参数数组
  133. //创建项目一定是在根元素下面。
  134. var _CUM = new U.UF.UI.Dialog("创建Ol", { "width": "350px"}, null, U.M.apply(_UFFD, [[U.CD.C.OlAsyn, P]]), _UFFD); //js太智能了,可以自由拼凑参数!
  135. //this.parentElement.parentElement.parentElement.remove() ;
  136. U.D.PopupWindow(_CUM.Create());
  137. }
  138. //构建ul --钟泽锋
  139. U.CD.C.Ul = function (_UDPD, _L, _T) {
  140. var _UFFD = $$("div", { "className": "UCD_TR_CP" }); //调用主项目对话框,并构建一个显示用的Div。
  141. $$("div", { "className": "UCD_TR_CP_MS", "innerHTML": "请输入列表行数:" }, _UFFD); //项目名称输入input 传最后一个参数_UFFD的是将input加入_UFFD中
  142. var _h = $$("input", { "className": "UCD_RT_CP_Input" }, _UFFD); //行
  143. var P = ([_UDPD, _L, _T, _h]); //参数数组
  144. //创建项目一定是在根元素下面。
  145. var _CUM = new U.UF.UI.Dialog("创建Ul", { "width": "350px" }, null, U.M.apply(_UFFD, [[U.CD.C.UlAsyn, P]]), _UFFD); //js太智能了,可以自由拼凑参数!
  146. U.D.PopupWindow(_CUM.Create());
  147. }
  148. //有序列表弹窗异步函数 --钟泽锋
  149. U.CD.C.OlAsyn = function (_UDPD, _L, _T, _h) {
  150. var a = new Array("新闻资讯", "体育竞技", "娱乐八卦", "前沿科技", "环球财经", "天气预报", "房产家居", "网络游戏"); //保存列表内容的数组
  151. var _h = parseInt(_h.value); //li行数
  152. if (_h >= 20 || _h <= 0) { alert("请输入正确数值0-20。"); return; }
  153. var _s = $$("ol", { "style": { "cssText": "position:absolute;"} }); //创建ol
  154. for (var i = 0; i < _h; i++) {//根据数组总数创建li
  155. var _o = $$("li", { "style": {}, "innerHTML": a[i] }, _s);
  156. }
  157. U.CD.L.AppendIF(_s, _UDPD, _L, _T); //调用追加函数追加到iframe中
  158. $("#UCD_TR_CPOL")[0].parentElement.parentElement.parentElement.remove();
  159. }
  160. //无序列表弹窗异步函数 --钟泽锋
  161. U.CD.C.UlAsyn = function (_UDPD, _L, _T, _h) {
  162. var a = new Array("新闻资讯", "体育竞技", "娱乐八卦", "前沿科技", "环球财经", "天气预报", "房产家居", "网络游戏"); //保存列表内容的数组
  163. var _h = parseInt(_h.value); //li行数
  164. if (_h >= 20 || _h <= 0) { alert("请输入正确数值0-20。"); return; }
  165. var _s = $$("ul", { "style": { "cssText": "position:absolute;"} }); //创建ul
  166. for (var i = 0; i < _h; i++) {//根据数组总数创建li
  167. var _o = $$("li", { "style": { "list-style-type": "disc" }, "innerHTML": a[i] }, _s); //创建li
  168. }
  169. U.CD.L.AppendIF(_s, _UDPD, _L, _T); //调用追加函数追加到iframe中
  170. }
  171. //构建导航navigation bar --钟泽锋
  172. U.CD.C.Navigation = function () {
  173. var _nav = $$("div", { "style": { "cssText": " position:absolute;"} }); //创建div用于包含导航项
  174. var _a1 = $$("a", { "innerHTML": "首页", "href": "#", "style": { "cssText": "margin-left:10px;"} }, _nav); //添加导航项
  175. var _a2 = $$("a", { "innerHTML": "资料", "href": "#", "style": { "cssText": "margin-left:10px;"} }, _nav);
  176. var _a3 = $$("a", { "innerHTML": "信息", "href": "#", "style": { "cssText": "margin-left:10px;"} }, _nav);
  177. var _hr = $$("hr", { "style": { "cssText": "width:300px;"} }, _nav);
  178. return _nav;
  179. }
  180. //构建分页列表 --钟泽锋
  181. U.CD.C.Pagination = function () {
  182. var _page = $$("div", { "style": { "cssText": " position:absolute;"} }); //创建div用于包含分页列表
  183. var _ul = $$("div", { "style": { "cssText": "margin:10px;"} }, _page);
  184. var _liprev = $$("div", { "innerHTML": "上一页", "href": "#", "style": { "cssText": "color:#5AA3CE; width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;list-style:none; float:left;"} }, _ul);
  185. var _li1 = $$("div", { "innerHTML": "1", "href": "#", "style": { "cssText": "color:#5AA3CE; width:25px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD; list-style:none; float:left;"} }, _ul);
  186. var _li2 = $$("div", { "innerHTML": "2", "href": "#", "style": { "cssText": "color:#5AA3CE;width:25px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD; list-style:none; float:left;"} }, _ul);
  187. var _li3 = $$("div", { "innerHTML": "3", "href": "#", "style": { "cssText": "color:#5AA3CE;width:25px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD; list-style:none; float:left;"} }, _ul);
  188. var _linext = $$("div", { "innerHTML": "下一页", "href": "#", "style": { "cssText": "color:#5AA3CE;width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;float:left; list-style:none;"} }, _ul);
  189. var _hr = $$("div", { "style": { "cssText": "clear:both;"} }, _page);
  190. return _page;
  191. }
  192. //构建切换卡 --钟泽锋
  193. U.CD.C.Switchingcard = function () { //创建div用于包含切换卡
  194. var _sc = $$("div", { "style": { "cssText": "position:absolute;"} });
  195. var _ul = $$("div", { "style": { "cssText": "margin-left:0px;"} }, _sc);
  196. //var _f = $$("div", { "id": "first", "onclick": "switching(this)", "innerHTML": "第一部分", "style": { "cssText": "color:#5AA3CE; width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;list-style:none; float:left; margin:0px;"} }, _ul);
  197. //var _s = $$("div", { "id": "second", "onclick": "switching(this)", "innerHTML": "第二部分", "style": { "cssText": "color:#5AA3CE; width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;float:left; list-style:none;"} }, _ul);
  198. var _f = $$("div", { "id": "first", "innerHTML": "第一部分", "style": { "cssText": "color:#5AA3CE; width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;list-style:none; float:left; margin:0px;"} }, _ul);
  199. var _s = $$("div", { "id": "second", "innerHTML": "第二部分", "style": { "cssText": "color:#5AA3CE; width:75px; height:25px; line-height:25px; text-align:center; border:1px solid #DDDDDD;float:left; list-style:none;"} }, _ul);
  200. var _hr = $$("hr", { "style": { "cssText": "clear:both;"} }, _sc);
  201. var _div = $$("div", { "id": "show_div", "style": {} }, _sc);
  202. var _first = $$("div", { "id": "first_div", "style": { "cssText": "border:1px solid #DDDDDD;width:300px;height:100px;display:block;" }, "innerHTML": "<p>第一部分内容</p>" }, _div);
  203. var _second = $$("div", { "id": "second_div", "style": { "cssText": "border:1px solid #DDDDDD;width:300px;height:100px;display:none;" }, "innerHTML": "<p>第二部分内容</p>" }, _div);
  204. //js函数 大于号自动换行,导致切换功能不能使用,代码没有问题
  205. var _div = $$("div", { "style": {}, "innerHTML": "<script>function switching(obj){var divs = document.getElementById('show_div').childNodes; for(var iLoop = 0;divs.length>iLoop;iLoop++){divs[iLoop].style.display = 'none'; }document.getElementById(obj.id+'_div').style.display='block';}</script>" }, _sc);
  206. return _sc;
  207. }
  208. //构建搜索表单 --洪超彬
  209. U.CD.C.Search = function () {
  210. var _search = $$("div", { "style": { "cssText": "position:absolute;"} });
  211. $$("input", { "type": "text", "style": { "cssText": "width:150px; height:25px;float:left;border:1px solid #cccccc;"} }, _search);
  212. //$$("input", { "type": "button", "style": { "cssText": "height:25px;position:absolute;background-color:#e6e6e6;" }, "value": "搜索" }, _search);
  213. var _searchdiv = $$("div",{ "style": { "cssText": "width:50px; background-color:#e6e6e6; height:25px; padding-top:3px; float:left; margin-left:10px;border:1px solid #cccccc;"} }, _search);
  214. $$("div", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:11px; color:#333333;font-size:14px;cursor: pointer;" }, "innerHTML": "搜索" }, _searchdiv);
  215. //$$("input", { "type": "button", "value": "登录" }, _search);
  216. return _search;
  217. }
  218. //构建form登录表单 --洪超彬
  219. U.CD.C.Form = function () {
  220. var _form = $$("form", { "style": { "cssText": "position:absolute;"} });
  221. var _maildiv = $$("div", {}, _form);
  222. $$("div", { "style": { "cssText": "margin-top:15px;" }, "innerHTML": "电子邮箱:" }, _maildiv);
  223. $$("input", { "type": "text", "style": { "cssText": "width:300px;height:25px;margin-top:10px;border:1px solid #cccccc;"} }, _maildiv);
  224. var _pswdiv = $$("div", {}, _form);
  225. $$("div", { "style": { "cssText": "margin-top:15px;" }, "innerHTML": "密码:" }, _pswdiv);
  226. $$("input", { "type": "text", "style": { "cssText": "width:300px;height:25px;margin-top:10px;border:1px solid #cccccc;"} }, _pswdiv);
  227. var _logindiv = $$("div", { "style": { "cssText": "margin-top:15px;"} }, _form);
  228. $$("input", { "type": "checkbox", "style": { "cssText": "float:left;margin-top:-3px;"} }, _logindiv);
  229. $$("div", { "style": { "cssText": "width:100px; float:left;font-size:14px;" }, "innerHTML": "记住登录状态" }, _logindiv);
  230. var _butdiv = $$("div", { "style": { "cssText": "width:50px; background-color:#e6e6e6; height:25px; padding-top:3px; float:left; margin-left:10px;border:1px solid #cccccc;margin-top:-5px;"} }, _logindiv);
  231. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:11px; color:#333333;font-size:14px;" }, "innerHTML": "登录" }, _butdiv);
  232. //$$("input", { "type": "button", "value": "登录" }, _logindiv);
  233. return _form;
  234. }
  235. //构建form注册表单 --洪超彬
  236. U.CD.C.Register = function () {
  237. var _register = $$("form", { "style": { "cssText": "position:absolute;"} });
  238. var _regdiv = $$("div", {}, _register);
  239. $$("div", { "style": { "cssText": "margin-top:15px;font-size:25px; color:Orange;" }, "innerHTML": "用户注册" }, _regdiv);
  240. var _regdiv1 = $$("div", { "style": { "cssText": "margin-top:30px;"} }, _regdiv);
  241. var _usediv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  242. $$("div", { "style": { "cssText": "margin-left:15px;float:left;" }, "innerHTML": "用户名:" }, _usediv);
  243. $$("input", { "type": "text" }, _usediv);
  244. var _pswdiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  245. $$("div", { "style": { "cssText": "margin-left:30px;float:left;" }, "innerHTML": "密码:" }, _pswdiv);
  246. $$("input", { "type": "text" }, _pswdiv);
  247. var _paswdiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  248. $$("div", { "style": { "cssText": "float:left;" }, "innerHTML": "确认密码:" }, _paswdiv);
  249. $$("input", { "type": "text" }, _paswdiv);
  250. var _namediv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  251. $$("div", { "style": { "cssText": "float:left;" }, "innerHTML": "用户全称:" }, _namediv);
  252. $$("input", { "type": "text" }, _namediv);
  253. var _teldiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  254. $$("div", { "style": { "cssText": "float:left;margin-left:30px;" }, "innerHTML": "电话:" }, _teldiv);
  255. $$("input", { "type": "text" }, _teldiv);
  256. var _adrdiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  257. $$("div", { "style": { "cssText": "float:left;margin-left:30px;" }, "innerHTML": "地址:" }, _adrdiv);
  258. $$("input", { "type": "text" }, _adrdiv);
  259. var _maildiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  260. $$("div", { "style": { "cssText": "float:left;margin-left:30px;" }, "innerHTML": "邮箱:" }, _maildiv);
  261. $$("input", { "type": "text" }, _maildiv);
  262. var _qqdiv = $$("div", { "style": { "cssText": "margin-top:35px;"} }, _regdiv1);
  263. $$("div", { "style": { "cssText": "float:left;margin-left:35px;" }, "innerHTML": "QQ:" }, _qqdiv);
  264. $$("input", { "type": "text" }, _qqdiv);
  265. var _butdiv = $$("div", { "style": { "cssText": "margin-top:50px; margin-left:100px;"} }, _regdiv1);
  266. $$("input", { "type": "button", "value": "确定" }, _butdiv);
  267. $$("input", { "type": "reset" }, _butdiv);
  268. return _register;
  269. }
  270. //构建遮罩窗体 --洪超彬
  271. U.CD.C.ShadeForms = function () {
  272. return $$("input", { "type": "button", "style": { "cssText": "width:120px; height:25px; position:absolute;" }, "value": "按钮", "onclick": U.CD.C.Shade() });
  273. }
  274. //触发遮罩窗体的函数 --洪超彬
  275. U.CD.C.Shade = function () {
  276. var coverDiv = $$("div", { "style": { "cssText": "position:absolute;background:#000000;left:0px;top:0px;z-Index:0;"} });
  277. document.body.appendChild(coverDiv);
  278. var _div = $$("div", { "style": { "cssText": "position:absolute;background:white;left:35%;top:10%;width:500px; height:200px;z-Index:1;"} }, coverDiv);
  279. var _Buttondiv = $$("div", { "style": { "cssText": "width:50px; background-color:#0044cc; height:25px; padding-top:6px; margin-top:150px;margin-left:420px;float:left;"} }, _div);
  280. $$("a", { "href": "#", "style": { "cssText": "color:white; text-decoration:none; margin-left:12px;" }, "innerHTML": "关闭" }, _Buttondiv);
  281. var _Buttondiv1 = $$("div", { "style": { "cssText": "width:80px; background-color:#e6e6e6; height:25px; float:left;padding-top:6px; margin-left:320px;float:left;margin-top:-30px;"} }, _div);
  282. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:12px; color:black;" }, "innerHTML": "保存设置" }, _Buttondiv1);
  283. var bodySize = []; //定义一个数组用于存放页面宽度高度
  284. with (document.documentElement) {
  285. bodySize[0] = (scrollWidth > clientWidth) ? scrollWidth : clientWidth; //如果滚动条的宽度大于页面的宽度,取得滚动条的宽度,否则取页面宽度
  286. bodySize[1] = (scrollHeight > clientHeight) ? scrollHeight : clientHeight; //如果滚动条的高度大于页面的高度,取得滚动条的高度,否则取高度
  287. }
  288. coverDiv.style.width = bodySize[0] + 'px'
  289. coverDiv.style.height = bodySize[1] + 'px';
  290. (document.all && window.ActiveXObject && !window.opera) ? coverDiv.style.filter = "Alpha(Opacity=60)" : coverDiv.style.opacity = 0.6; //判断浏览器,根据浏览器调整透明度
  291. }
  292. //构建按钮组 --洪超彬
  293. U.CD.C.ButtonGrop = function () {
  294. var _ButtonGrop = $$("div", { "style": { "cssText": "width:128px; height:35px; border:1px solid #cccccc; position:absolute;"} });
  295. var _button1 = $$("div", { "style": { "cssText": "width:30px; height:30px; float:left;border:1px solid #cccccc;padding-top:5px;"} }, _ButtonGrop);
  296. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; padding-left:8px;color:#000000;font-size:14px;" }, "innerHTML": "亖" }, _button1);
  297. var _button2 = $$("div", { "style": { "cssText": "width:30px; height:30px; float:left;border:1px solid #cccccc;padding-top:5px;"} }, _ButtonGrop);
  298. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; padding-left:8px;color:#000000;font-size:14px;" }, "innerHTML": "亖" }, _button2);
  299. var _button3 = $$("div", { "style": { "cssText": "width:30px; height:30px; float:left;border:1px solid #cccccc;padding-top:5px;"} }, _ButtonGrop);
  300. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; padding-left:8px;color:#000000;font-size:14px;" }, "innerHTML": "亖" }, _button3);
  301. var _button4 = $$("div", { "style": { "cssText": "width:30px; height:30px; float:left;border:1px solid #cccccc;padding-top:5px;"} }, _ButtonGrop);
  302. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; padding-left:8px;color:#000000;font-size:14px;" }, "innerHTML": "亖" }, _button4);
  303. return _ButtonGrop;
  304. }
  305. //构建进度条 --洪超彬
  306. U.CD.C.Bar = function () {
  307. var _ButtonGrop = $$("div", { "style": { "cssText": "width:300px; height:20px; position:absolute; background-Color:#CCCCCC;"} });
  308. var _button1 = $$("div", { "style": { "cssText": "width:160px; height:20px;background-Color:#0D8FD1;"} }, _ButtonGrop);
  309. return _ButtonGrop;
  310. }
  311. //构建预览列表 --洪超彬
  312. U.CD.C.Preview = function () {
  313. var _PreviewBorderdiv = $$("div", { "style": { "cssText": "position:absolute;"} });
  314. var _Preview = $$("div", { "style": { "cssText": "float:left; width:30%; margin-left:2%; border:1px solid #CCCCCC;"} }, _PreviewBorderdiv);
  315. $$("img", { "style": { "cssText": "width:99%; margin:2%;" }, "src": "images/city.jpg" }, _Preview);
  316. var _PreviewContent = $$("div", { "style": { "cssText": "margin-left:10px; width:90%;"} }, _Preview);
  317. $$("h3", { "innerHTML": "冯诺尔曼结构" }, _PreviewContent);
  318. $$("p", { "innerHTML": "也称普林斯顿结构,是一种将程序指令存储器和数据存储器合并在一起的存储器结构。程序指令存储地址和数据存储地址指向同一个存储器的不同物理位置。" }, _PreviewContent);
  319. var _PreviewButton = $$("div", { "style": { "cssText": "height:50px;"} }, _PreviewContent);
  320. var _PreviewButtondiv = $$("div", { "style": { "cssText": "width:50px; background-color:#0044cc; height:30px; padding-top:6px; float:left;"} }, _PreviewButton);
  321. $$("a", { "href": "#", "style": { "cssText": "color:white; text-decoration:none; margin-left:9px;" }, "innerHTML": "浏览" }, _PreviewButtondiv);
  322. var _PreviewButtondiv1 = $$("div", { "style": { "cssText": "width:50px; background-color:#e6e6e6; height:30px; padding-top:6px; float:left; margin-left:10px;"} }, _PreviewButton);
  323. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:9px; color:black;" }, "innerHTML": "分享" }, _PreviewButtondiv1);
  324. var _Preview1 = $$("div", { "style": { "cssText": "float:left; width:30%; margin-left:2%; border:1px solid #CCCCCC;"} }, _PreviewBorderdiv);
  325. $$("img", { "style": { "cssText": "width:99%; margin:2%;" }, "src": "images/city.jpg" }, _Preview1);
  326. var _PreviewContent1 = $$("div", { "style": { "cssText": "margin-left:10px; width:90%;"} }, _Preview1);
  327. $$("h3", { "innerHTML": "冯诺尔曼结构" }, _PreviewContent1);
  328. $$("p", { "innerHTML": "也称普林斯顿结构,是一种将程序指令存储器和数据存储器合并在一起的存储器结构。程序指令存储地址和数据存储地址指向同一个存储器的不同物理位置。" }, _PreviewContent1);
  329. var _PreviewButton1 = $$("div", { "style": { "cssText": "height:50px;"} }, _PreviewContent1);
  330. var _PreviewButtondiv2 = $$("div", { "style": { "cssText": "width:50px; background-color:#0044cc; height:30px; padding-top:6px; float:left;"} }, _PreviewButton1);
  331. $$("a", { "href": "#", "style": { "cssText": "color:white; text-decoration:none; margin-left:9px;" }, "innerHTML": "浏览" }, _PreviewButtondiv2);
  332. var _PreviewButtondiv3 = $$("div", { "style": { "cssText": "width:50px; background-color:#e6e6e6; height:30px; padding-top:6px; float:left; margin-left:10px;"} }, _PreviewButton1);
  333. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:9px; color:black;" }, "innerHTML": "分享" }, _PreviewButtondiv3);
  334. var _Preview2 = $$("div", { "style": { "cssText": "float:left; width:30%; margin-left:2%; border:1px solid #CCCCCC;"} }, _PreviewBorderdiv);
  335. $$("img", { "style": { "cssText": "width:99%; margin:2%;" }, "src": "images/city.jpg" }, _Preview2);
  336. var _PreviewContent2 = $$("div", { "style": { "cssText": "margin-left:10px; width:90%;"} }, _Preview2);
  337. $$("h3", { "innerHTML": "冯诺尔曼结构" }, _PreviewContent2);
  338. $$("p", { "innerHTML": "也称普林斯顿结构,是一种将程序指令存储器和数据存储器合并在一起的存储器结构。程序指令存储地址和数据存储地址指向同一个存储器的不同物理位置。" }, _PreviewContent2);
  339. var _PreviewButton2 = $$("div", { "style": { "cssText": "height:50px;"} }, _PreviewContent2);
  340. var _PreviewButtondiv4 = $$("div", { "style": { "cssText": "width:50px; background-color:#0044cc; height:30px; padding-top:6px; float:left;"} }, _PreviewButton2);
  341. $$("a", { "href": "#", "style": { "cssText": "color:white; text-decoration:none; margin-left:9px;" }, "innerHTML": "浏览" }, _PreviewButtondiv4);
  342. var _PreviewButtondiv5 = $$("div", { "style": { "cssText": "width:50px; background-color:#e6e6e6; height:30px; padding-top:6px; float:left; margin-left:10px;"} }, _PreviewButton2);
  343. $$("a", { "href": "#", "style": { "cssText": "text-decoration:none; margin-left:9px; color:black;" }, "innerHTML": "分享" }, _PreviewButtondiv5);
  344. return _PreviewBorderdiv;
  345. }
  346. //论坛系统 蒲昊
  347. U.CD.C.forum = function () {
  348. var button = $$('a', {innerHTML:'打开论坛'})
  349. button.setAttribute('onclick', "U.MD.D.I.openApplication('PB', '3c779543-bc1a-4851-af22-af9ba97a5f33')")
  350. return button
  351. }