Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: newdumdum/newdumdum.github.com
base: 3edad1de96
...
head fork: newdumdum/newdumdum.github.com
compare: cc97bc7bca
  • 2 commits
  • 649 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 06, 2012
ShiChunhua add pages 157ab35
ShiChunhua delete thumbs files cc97bc7
Showing with 26,161 additions and 0 deletions.
  1. +22 −0 demo/code.htm
  2. +64 −0 demo/core/Calendar/Example.htm
  3. BIN  demo/core/Calendar/Thumbs.db
  4. BIN  demo/core/Calendar/calendar.gif
  5. +153 −0 demo/core/Calendar/css/Calendar.css
  6. BIN  demo/core/Calendar/images/Thumbs.db
  7. BIN  demo/core/Calendar/images/calendar.gif
  8. +683 −0 demo/core/Calendar/js/Calendar.js
  9. +172 −0 demo/core/Cpu/cpu.as
  10. BIN  demo/core/Cpu/cpu.fla
  11. +44 −0 demo/core/Cpu/cpu.htm
  12. BIN  demo/core/Cpu/cpu.swf
  13. +6 −0 demo/core/Cpu/data.xml
  14. BIN  demo/core/Cpu/images/Thumbs.db
  15. BIN  demo/core/Cpu/images/frame.jpg
  16. +96 −0 demo/core/GridTree/css/gridTree.css
  17. +40 −0 demo/core/GridTree/data/gridTree.xml
  18. +73 −0 demo/core/GridTree/example.htm
  19. BIN  demo/core/GridTree/images/Thumbs.db
  20. BIN  demo/core/GridTree/images/lessGridRow.gif
  21. BIN  demo/core/GridTree/images/lessGridTitle.gif
  22. BIN  demo/core/GridTree/images/loading_16x16.gif
  23. BIN  demo/core/GridTree/images/minus.gif
  24. BIN  demo/core/GridTree/images/plus.gif
  25. +360 −0 demo/core/GridTree/js/gridTree.js
  26. BIN  demo/core/IMG_2791.jpg
  27. +292 −0 demo/core/Line/AC_RunActiveContent.js
  28. +38 −0 demo/core/Line/Example.htm
  29. BIN  demo/core/Line/images/bt.jpg
  30. BIN  demo/core/Line/images/btBK.jpg
  31. BIN  demo/core/Line/images/btBK_down.jpg
  32. BIN  demo/core/Line/images/btBK_over.jpg
  33. BIN  demo/core/Line/images/btJS.jpg
  34. BIN  demo/core/Line/images/btJS_down.jpg
  35. BIN  demo/core/Line/images/btJS_over.jpg
  36. BIN  demo/core/Line/images/btYJ.jpg
  37. BIN  demo/core/Line/images/btYJ_down.jpg
  38. BIN  demo/core/Line/images/btYJ_over.jpg
  39. BIN  demo/core/Line/images/bt_down.jpg
  40. BIN  demo/core/Line/images/bt_over.jpg
  41. BIN  demo/core/Line/images/round.png
  42. +527 −0 demo/core/Line/line.as
  43. BIN  demo/core/Line/line.fla
  44. BIN  demo/core/Line/line.swf
  45. +21 −0 demo/core/Line/line.xml
  46. +74 −0 demo/core/MessageBox/css/messageBox.css
  47. BIN  demo/core/MessageBox/img/circle.gif
  48. +175 −0 demo/core/MessageBox/js/messageBox.js
  49. +48 −0 demo/core/MessageBox/messageBox.html
  50. +34 −0 demo/core/Meter/Example.htm
  51. BIN  demo/core/Meter/Thumbs.db
  52. BIN  demo/core/Meter/bg.gif
  53. BIN  demo/core/Meter/bg.jpg
  54. +394 −0 demo/core/Meter/meter.as
  55. BIN  demo/core/Meter/meter.fla
  56. BIN  demo/core/Meter/meter.swf
  57. +31 −0 demo/core/Meter/meter.xml
  58. +31 −0 demo/core/Meter/meter2.xml
  59. +7 −0 demo/core/SchAIM-mini.js
  60. +97 −0 demo/core/SchAIM-readme.txt
  61. +534 −0 demo/core/SchAIM.js
  62. +143 −0 demo/core/ScrollTab/css/ScrollTab.css
  63. +21 −0 demo/core/ScrollTab/data/data.xml
  64. +50 −0 demo/core/ScrollTab/doc/ScrollTab控件说明.txt
  65. +114 −0 demo/core/ScrollTab/example.htm
  66. BIN  demo/core/ScrollTab/images/Thumbs.db
  67. BIN  demo/core/ScrollTab/images/loading_16x16.gif
  68. BIN  demo/core/ScrollTab/images/tabButtonBg.gif
  69. BIN  demo/core/ScrollTab/images/tabRoll_DY.gif
  70. +411 −0 demo/core/ScrollTab/js/ScrollTab.js
  71. +163 −0 demo/core/ScrollTab_YELLOW/ScrollTab.css
  72. +361 −0 demo/core/ScrollTab_YELLOW/ScrollTab.js
  73. +641 −0 demo/core/ScrollTab_YELLOW/common.js
  74. +163 −0 demo/core/ScrollTab_YELLOW/css/ScrollTab.css
  75. +21 −0 demo/core/ScrollTab_YELLOW/data.xml
  76. +21 −0 demo/core/ScrollTab_YELLOW/data/data.xml
  77. +99 −0 demo/core/ScrollTab_YELLOW/ex.htm
  78. +102 −0 demo/core/ScrollTab_YELLOW/example.htm
  79. BIN  demo/core/ScrollTab_YELLOW/images/Thumbs.db
  80. BIN  demo/core/ScrollTab_YELLOW/images/loading_16x16.gif
  81. BIN  demo/core/ScrollTab_YELLOW/images/tabButtonBg.gif
  82. BIN  demo/core/ScrollTab_YELLOW/images/tabRoll_DY.gif
  83. +387 −0 demo/core/ScrollTab_YELLOW/js/ScrollTab.js
  84. +521 −0 demo/core/ScrollTab_YELLOW/xml.js
  85. +641 −0 demo/core/ScrollTab_YELLOW/xmlHttp/common.js
  86. +521 −0 demo/core/ScrollTab_YELLOW/xmlHttp/xml.js
  87. +618 −0 demo/core/ScrollTab_YELLOW/xmlHttp/xmlhttp.js
  88. +618 −0 demo/core/ScrollTab_YELLOW/xmlhttp.js
  89. +102 −0 demo/core/SiderBar/css/SiderBar.css
  90. +81 −0 demo/core/SiderBar/example.htm
  91. BIN  demo/core/SiderBar/images/Thumbs.db
  92. BIN  demo/core/SiderBar/images/barBg.gif
  93. BIN  demo/core/SiderBar/images/tool-sprites.gif
  94. +367 −0 demo/core/SiderBar/js/SiderBar.js
  95. BIN  demo/core/SimpleGrid/Thumbs.db
  96. +255 −0 demo/core/SimpleGrid/css/SimpleGrid.css
  97. +56 −0 demo/core/SimpleGrid/data/grid.xml
  98. +24 −0 demo/core/SimpleGrid/doc/SimpleGridL配置模板规范.xml
  99. +53 −0 demo/core/SimpleGrid/doc/SimpleGrid控件说明.txt
  100. +80 −0 demo/core/SimpleGrid/example.htm
  101. BIN  demo/core/SimpleGrid/images/Thumbs.db
  102. BIN  demo/core/SimpleGrid/images/columnOrder_Down.gif
  103. BIN  demo/core/SimpleGrid/images/columnOrder_Up.gif
  104. BIN  demo/core/SimpleGrid/images/loading_16x16.gif
  105. BIN  demo/core/SimpleGrid/images/row-over.gif
  106. BIN  demo/core/SimpleGrid/images/title.gif
  107. +790 −0 demo/core/SimpleGrid/js/simpleGrid.js
  108. BIN  demo/core/SimpleGrid/vssver2.scc
  109. BIN  demo/core/SimpleTree/SimpleTree.rar
  110. +195 −0 demo/core/SimpleTree/ajax.js
  111. +98 −0 demo/core/SimpleTree/css/simpleTree.css
  112. +20 −0 demo/core/SimpleTree/data/tree.json
  113. +34 −0 demo/core/SimpleTree/data/tree.xml
  114. +39 −0 demo/core/SimpleTree/doc/SimpleTree控件说明.txt
  115. +89 −0 demo/core/SimpleTree/example.htm
  116. BIN  demo/core/SimpleTree/images/Thumbs.db
  117. BIN  demo/core/SimpleTree/images/bg_vline.gif
  118. BIN  demo/core/SimpleTree/images/bg_vline_half.gif
  119. BIN  demo/core/SimpleTree/images/checkBox.gif
  120. BIN  demo/core/SimpleTree/images/contract.gif
  121. BIN  demo/core/SimpleTree/images/expand.gif
  122. BIN  demo/core/SimpleTree/images/leaf.gif
  123. BIN  demo/core/SimpleTree/images/loading_16x16.gif
  124. BIN  demo/core/SimpleTree/images/radioBox.gif
  125. BIN  demo/core/SimpleTree/images/root_contract.gif
  126. BIN  demo/core/SimpleTree/images/root_expand.gif
  127. BIN  demo/core/SimpleTree/images/root_leaf.gif
  128. +598 −0 demo/core/SimpleTree/js/simpleTree.js
  129. +29 −0 demo/core/SliderPicShow/css/SliderPic.css
  130. +29 −0 demo/core/SliderPicShow/css/SliderPic_bottom.css
  131. +26 −0 demo/core/SliderPicShow/data.xml
  132. +119 −0 demo/core/SliderPicShow/example.htm
  133. BIN  demo/core/SliderPicShow/images/1.jpg
  134. BIN  demo/core/SliderPicShow/images/10.jpg
  135. BIN  demo/core/SliderPicShow/images/11.jpg
  136. BIN  demo/core/SliderPicShow/images/12.jpg
  137. BIN  demo/core/SliderPicShow/images/13.jpg
  138. BIN  demo/core/SliderPicShow/images/14.jpg
  139. BIN  demo/core/SliderPicShow/images/15.jpg
  140. BIN  demo/core/SliderPicShow/images/16.jpg
  141. BIN  demo/core/SliderPicShow/images/2.jpg
  142. BIN  demo/core/SliderPicShow/images/3.jpg
  143. BIN  demo/core/SliderPicShow/images/4.jpg
  144. BIN  demo/core/SliderPicShow/images/5.jpg
  145. BIN  demo/core/SliderPicShow/images/6.jpg
  146. BIN  demo/core/SliderPicShow/images/7.jpg
  147. BIN  demo/core/SliderPicShow/images/8.jpg
  148. BIN  demo/core/SliderPicShow/images/9.jpg
  149. BIN  demo/core/SliderPicShow/images/Thumbs.db
  150. BIN  demo/core/SliderPicShow/images/bg.jpg
  151. +540 −0 demo/core/SliderPicShow/js/SliderPic.js
  152. +324 −0 demo/core/UiEffect.js
  153. +186 −0 demo/core/VerticalTree/css/tree.css
  154. +57 −0 demo/core/VerticalTree/data/tree.xml
  155. +57 −0 demo/core/VerticalTree/doc/SimpleGridL配置模板规范.xml
  156. +53 −0 demo/core/VerticalTree/doc/SimpleGrid控件说明.txt
  157. +72 −0 demo/core/VerticalTree/example.htm
  158. BIN  demo/core/VerticalTree/images/Thumbs.db
  159. BIN  demo/core/VerticalTree/images/bgLine.gif
  160. BIN  demo/core/VerticalTree/images/block.gif
  161. BIN  demo/core/VerticalTree/images/contract.gif
  162. BIN  demo/core/VerticalTree/images/expand.gif
  163. BIN  demo/core/VerticalTree/images/input.gif
  164. BIN  demo/core/VerticalTree/images/loading_16x16.gif
  165. BIN  demo/core/VerticalTree/images/perBg.jpg
  166. BIN  demo/core/VerticalTree/images/perShow.jpg
  167. +786 −0 demo/core/VerticalTree/js/tree.js
  168. +3,897 −0 demo/core/ace.all.js
  169. +195 −0 demo/core/ajax.js
  170. +180 −0 demo/core/boxLayer/css/boxLayer.css
  171. +72 −0 demo/core/boxLayer/example.htm
  172. BIN  demo/core/boxLayer/images/bodyBg.gif
  173. BIN  demo/core/boxLayer/images/corners-sprite.gif
  174. BIN  demo/core/boxLayer/images/corners.gif
  175. BIN  demo/core/boxLayer/images/tool-sprites.gif
  176. BIN  demo/core/boxLayer/images/top-bottom.gif
  177. +119 −0 demo/core/boxLayer/js/boxLayer.js
  178. BIN  demo/core/button/button/008.gif
  179. BIN  demo/core/button/button/Thumbs.db
  180. +68 −0 demo/core/button/button/btn.css
  181. +120 −0 demo/core/button/button/btn.js
  182. BIN  demo/core/button/button/buttonBg.gif
  183. BIN  demo/core/button/button/ico_del.gif
  184. BIN  demo/core/button/button/icon/Thumbs.db
  185. BIN  demo/core/button/button/icon/accept.gif
  186. BIN  demo/core/button/button/icon/cancel.gif
  187. +37 −0 demo/core/button/testBtn.htm
  188. +199 −0 demo/core/clock/Example.htm
  189. BIN  demo/core/clock/img/Thumbs.db
  190. BIN  demo/core/clock/img/clock.jpg
  191. BIN  demo/core/clock/img/clock2.jpg
  192. BIN  demo/core/clock/img/clock3.jpg
  193. BIN  demo/core/clock/img/mc.jpg
  194. +152 −0 demo/core/commonSelect/css/commonSelect.css
  195. +14 −0 demo/core/commonSelect/doc/commonSelect控件说明.txt
  196. +73 −0 demo/core/commonSelect/example.htm
  197. BIN  demo/core/commonSelect/images/Thumbs.db
  198. BIN  demo/core/commonSelect/images/btImg.gif
  199. BIN  demo/core/commonSelect/images/lrIcon.gif
  200. BIN  demo/core/commonSelect/images/select.gif
  201. BIN  demo/core/commonSelect/images/select2.gif
  202. BIN  demo/core/commonSelect/images/selectIcon.png
  203. +423 −0 demo/core/commonSelect/js/commonSelect.js
  204. BIN  demo/core/cpuNode/bg.jpg
  205. BIN  demo/core/cpuNode/bg.png
  206. +51 −0 demo/core/cpuNode/cpu.htm
  207. +269 −0 demo/core/cpuNode/cpuNode.as
  208. BIN  demo/core/cpuNode/cpuNode.fla
  209. BIN  demo/core/cpuNode/cpuNode.swf
  210. +7 −0 demo/core/cpuNode/data.xml
  211. BIN  demo/core/cpuNode/rightBorder.jpg
  212. +331 −0 demo/core/dragLayer/css/dragLayer.css
  213. +118 −0 demo/core/dragLayer/example.htm
  214. BIN  demo/core/dragLayer/images/Thumbs.db
  215. BIN  demo/core/dragLayer/images/corners-sprite.gif
  216. BIN  demo/core/dragLayer/images/corners-sprite_green.gif
  217. BIN  demo/core/dragLayer/images/corners-sprite_pink.gif
  218. BIN  demo/core/dragLayer/images/corners-sprite_yellow.gif
  219. BIN  demo/core/dragLayer/images/loading.gif
  220. BIN  demo/core/dragLayer/images/tool-sprites.gif
  221. BIN  demo/core/dragLayer/images/tool-sprites_green.gif
  222. BIN  demo/core/dragLayer/images/tool-sprites_pink.gif
  223. BIN  demo/core/dragLayer/images/tool-sprites_yellow.gif
  224. BIN  demo/core/dragLayer/images/top-bottom.gif
  225. BIN  demo/core/dragLayer/images/top-bottom_green.gif
  226. BIN  demo/core/dragLayer/images/top-bottom_pink.gif
  227. BIN  demo/core/dragLayer/images/top-bottom_yellow.gif
  228. +503 −0 demo/core/dragLayer/js/dragLayer.js
  229. BIN  demo/core/dragLayer2/Thumbs.db
  230. BIN  demo/core/dragLayer2/images/Thumbs.db
  231. BIN  demo/core/dragLayer2/images/corners-sprite.gif
  232. BIN  demo/core/dragLayer2/images/showPic/Thumbs.db
  233. BIN  demo/core/dragLayer2/images/showPic/photo_0.jpg
  234. BIN  demo/core/dragLayer2/images/showPic/photo_1.jpg
  235. BIN  demo/core/dragLayer2/images/showPic/photo_2.jpg
  236. BIN  demo/core/dragLayer2/images/showPic/photo_3.jpg
  237. BIN  demo/core/dragLayer2/images/showPic/photo_4.jpg
  238. BIN  demo/core/dragLayer2/images/showPic/photo_5.jpg
  239. BIN  demo/core/dragLayer2/images/showPic/photo_6.jpg
  240. BIN  demo/core/dragLayer2/images/showPic/photo_7.jpg
  241. BIN  demo/core/dragLayer2/images/showPic/photo_8.jpg
  242. BIN  demo/core/dragLayer2/images/showPic/photo_9.jpg
  243. BIN  demo/core/dragLayer2/images/tool-sprites.gif
  244. BIN  demo/core/dragLayer2/images/top-bottom.gif
  245. +86 −0 demo/core/dragLayer2/resizePic.css
  246. +35 −0 demo/core/dragLayer2/resizePic.html
  247. +350 −0 demo/core/dragLayer2/resizePic.js
  248. +643 −0 demo/core/drag_chrome/ChromeDrag.js
  249. BIN  demo/core/drag_chrome/images/1.png
  250. BIN  demo/core/drag_chrome/images/10.png
  251. BIN  demo/core/drag_chrome/images/11.png
  252. BIN  demo/core/drag_chrome/images/12.png
  253. BIN  demo/core/drag_chrome/images/13.png
  254. BIN  demo/core/drag_chrome/images/2.png
  255. BIN  demo/core/drag_chrome/images/3.png
  256. BIN  demo/core/drag_chrome/images/4.png
  257. BIN  demo/core/drag_chrome/images/5.png
  258. BIN  demo/core/drag_chrome/images/6.png
  259. BIN  demo/core/drag_chrome/images/7.png
  260. BIN  demo/core/drag_chrome/images/8.png
  261. BIN  demo/core/drag_chrome/images/9.png
  262. +95 −0 demo/core/drag_chrome/testDrop.htm
  263. +263 −0 demo/core/effect.js
  264. BIN  demo/core/effect.rar
  265. +26 −0 demo/core/flashMenu2/duoziPen.css
  266. +33 −0 demo/core/flashMenu2/duoziPen.htm
  267. +106 −0 demo/core/flashMenu2/duoziPen.js
  268. BIN  demo/core/flashNews/Thumbs.db
  269. +27 −0 demo/core/flashNews/example.htm
  270. BIN  demo/core/flashNews/files/Thumbs.db
  271. BIN  demo/core/flashNews/files/images/PHOTOS/1.jpg
  272. BIN  demo/core/flashNews/files/images/PHOTOS/10.jpg
  273. BIN  demo/core/flashNews/files/images/PHOTOS/2.jpg
  274. BIN  demo/core/flashNews/files/images/PHOTOS/3.jpg
  275. BIN  demo/core/flashNews/files/images/PHOTOS/4.jpg
  276. BIN  demo/core/flashNews/files/images/PHOTOS/5.jpg
  277. BIN  demo/core/flashNews/files/images/PHOTOS/6.jpg
  278. BIN  demo/core/flashNews/files/images/PHOTOS/7.jpg
  279. BIN  demo/core/flashNews/files/images/PHOTOS/8.jpg
  280. BIN  demo/core/flashNews/files/images/PHOTOS/9.jpg
  281. BIN  demo/core/flashNews/files/images/PHOTOS/Thumbs.db
  282. BIN  demo/core/flashNews/files/images/Thumbs.db
  283. BIN  demo/core/flashNews/files/images/background.gif
  284. BIN  demo/core/flashNews/files/images/background.jpg
  285. BIN  demo/core/flashNews/files/images/background.png
  286. +80 −0 demo/core/flashNews/files/news.css
  287. +181 −0 demo/core/flashNews/files/news.js
  288. BIN  demo/core/flip/Thumbs.db
  289. +193 −0 demo/core/flip/flip.htm
  290. BIN  demo/core/flip/flipBg.jpg
  291. BIN  demo/core/flip/flipLayer.gif
  292. +39 −0 demo/core/getStyle.js
  293. +641 −0 demo/core/http/common.js
  294. +521 −0 demo/core/http/xml.js
  295. +618 −0 demo/core/http/xmlhttp.js
  296. +605 −0 demo/core/ifoneDrag/DragBlock.js
  297. BIN  demo/core/ifoneDrag/images/1.png
  298. BIN  demo/core/ifoneDrag/images/10.png
  299. BIN  demo/core/ifoneDrag/images/11.png
  300. BIN  demo/core/ifoneDrag/images/12.png
Sorry, we could not display the entire diff because too many files (649) changed.
View
22 demo/code.htm
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title> new document </title>
+ <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
+ <meta name="generator" content="editplus" />
+ <meta name="author" content="" />
+ <meta name="keywords" content="" />
+ <meta name="description" content="" />
+ <style>
+ *{
+ font:normal 12px ËÎÌå;
+ }
+ </style>
+ </head>
+
+ <body style="font:normal 12px ËÎÌå">
+ <h2></h2><h2><font class="Apple-style-span" size="1"><span class="Apple-style-span" style="font-size: 12px;"></span></font></h2><span style="font-family: ËÎÌå; "><h2><span class="Apple-style-span" style="font-size: 12px;"></span></h2></span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><h2></h2></span></span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><h2></h2></span></span><span style="font-size: small; "><span style="font-family: ËÎÌå; "><h2></h2></span></span><span style="font-size: xx-large; "><span style="font-family: ËÎÌå; "><h2></h2></span></span><span><span style="font-family: ËÎÌå; "><h2></h2></span></span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><h2></h2></span></span><span></span><code><span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><span><h2></h2></span></span></span></span></code><code><span><code><span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><span><h2></h2></span></span></span></span></code></span></code><span style="font-family: Verdana; "><code><code><span style="font-size: 12px; "><h2></h2></span></code></code></span><span style="font-family: ËÎÌå; "><code><code><span style="font-size: 12px; "><h2></h2></span></code></code></span><span style="font-size: small; "><span style="font-family: ËÎÌå; "><code><code><h2></h2></code></code></span></span><span><span style="font-family: ËÎÌå; "><code><code><h2></h2></code></code></span></span><span style="font-size: 12px; "><span style="font-family: ËÎÌå; "><code><code><h2>var GLOBAL = {};</h2><h2>GLOBAL.namespace = function(str) {</h2><h2>&nbsp;&nbsp; &nbsp;var arr = str.split("."),</h2><h2>&nbsp;&nbsp; &nbsp;o = GLOBAL;</h2><h2>&nbsp;&nbsp; &nbsp;for (i = (arr[0] == "GLOBAL") ? 1 : 0; i &lt; arr.length; i++) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;o[arr[i]] = o[arr[i]] || {};</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;o = o[arr[i]];</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>}</h2><h2>GLOBAL.namespace("Dom");</h2><h2>GLOBAL.Dom.getElementsByClassName = function(str, root, tag) {</h2><h2>&nbsp;&nbsp; &nbsp;if (root) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;root = typeof root == "string" ? document.getElementById(root) : root;</h2><h2>&nbsp;&nbsp; &nbsp;} else {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;root = document.body;</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>&nbsp;&nbsp; &nbsp;tag = tag || "*";</h2><h2>&nbsp;&nbsp; &nbsp;var els = root.getElementsByTagName(tag),</h2><h2>&nbsp;&nbsp; &nbsp;arr = [];</h2><h2>&nbsp;&nbsp; &nbsp;for (var i = 0,</h2><h2>&nbsp;&nbsp; &nbsp;n = els.length; i &lt; n; i++) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (var j = 0,</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;k = els[i].className.split(" "), l = k.length; j &lt; l; j++) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (k[j] == str) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;arr.push(els[i]);</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>&nbsp;&nbsp; &nbsp;return arr;</h2><h2>}</h2><h2>GLOBAL.namespace("Event");</h2><h2>GLOBAL.Event.on = function(node, eventType, handler, scope) {</h2><h2>&nbsp;&nbsp; &nbsp;node = typeof node == "string" ? document.getElementById(node) : node;</h2><h2>&nbsp;&nbsp; &nbsp;scope = scope || node;</h2><h2>&nbsp;&nbsp; &nbsp;if (document.all) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;node.attachEvent("on" + eventType,</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;function() {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;handler.apply(scope, arguments)</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;});</h2><h2>&nbsp;&nbsp; &nbsp;} else {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;node.addEventListener(eventType,</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;function() {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;handler.apply(scope, arguments)</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;},</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;false);</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>}</h2><h2>function extend(subClass, superClass) {</h2><h2>&nbsp;&nbsp; &nbsp;var F = function() {};</h2><h2>&nbsp;&nbsp; &nbsp;F.prototype = superClass.prototype;</h2><h2>&nbsp;&nbsp; &nbsp;subClass.prototype = new F();</h2><h2>&nbsp;&nbsp; &nbsp;subClass.prototype.constructor = subClass;</h2><h2>&nbsp;&nbsp; &nbsp;subClass.superclass = superClass.prototype;</h2><h2>&nbsp;&nbsp; &nbsp;if (superClass.prototype.constructor == Object.prototype.constructor) {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;superClass.prototype.constructor = superClass;</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>}</h2><h2>function Animal(name) {</h2><h2>&nbsp;&nbsp; &nbsp;this.name = name;</h2><h2>&nbsp;&nbsp; &nbsp;this.type = "animal";</h2><h2>}</h2><h2>Animal.prototype = {</h2><h2>&nbsp;&nbsp; &nbsp;say: function() {</h2><h2>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;alert("I'm a(an) " + this.type + " , my name is " + this.name);</h2><h2>&nbsp;&nbsp; &nbsp;}</h2><h2>}</h2><h2>function Bird(name) {</h2><h2>&nbsp;&nbsp; &nbsp;this.constructor.superclass.constructor.apply(this, arguments);</h2><h2>&nbsp;&nbsp; &nbsp;this.type = "bird"</h2><h2>}</h2><h2>extend(Bird, Animal);</h2><h2>Bird.prototype.fly = function() {</h2><h2>&nbsp;&nbsp; &nbsp;alert("I'm flying");</h2><h2>}</h2><h2>var canary = new Bird("xiaocui");</h2><h2>canary.say(); // I¡¯m a(an) bird , my name is xiaocui</h2><h2>canary.fly(); // I¡¯m flying</h2><h2></h2><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></code><div></div><div></div></code><div></div><div></div></span><div></div><div></div><div></div></span><div><br></div>
+<p></p>
+
+ </body>
+</html>
View
64 demo/core/Calendar/Example.htm
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<HTML>
+ <HEAD>
+ <TITLE> Apple Style Calendar </TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <META NAME="Generator" CONTENT="EditPlus">
+ <META NAME="Author" CONTENT="ShiCH">
+ <META NAME="Keywords" CONTENT="">
+ <META NAME="Description" CONTENT="">
+ <script src="js/calendar.js" language="javascript"></script>
+ <link rel="stylesheet" href="css/calendar.css" type="text/css"></link>
+ <style type="text/css">
+ body {
+ background:#FFFFFF;
+ margin:0px;
+ padding:0px;
+ }
+
+ .box {
+ padding:15px;
+ }
+
+ * {
+ font:normal 12px Arial,宋体;
+ }
+ </style>
+ <SCRIPT LANGUAGE="JavaScript">
+ <!--
+ /*
+ window.onload = function(){
+ var c = new Calendar();
+ c.render = aa;
+ c.init();
+ }
+ */
+ var calendar = null;
+ function showCalendar(elm,srcElm){
+ if(null == calendar)
+ calendar = new Calendar();
+ calendar.render = elm;
+ calendar.caller = srcElm;
+ calendar.parten = "yyyy/MM/dd";
+ calendar.init();
+ }
+ function hideCalendar(){
+ if(null != calendar){
+ //calendar.dispose();
+ calendar = null;
+ }
+ }
+ //-->
+ </SCRIPT>
+ </HEAD>
+
+ <BODY>
+ <div class="box">
+ 任务:
+ <input type=text /><br/>
+ 日期:
+ <input type=text id="aa"/>
+ <img width=16 height=16 border=0 style="cursor:pointer;" onclick="showCalendar(document.getElementById('aa'),this);" title="选择日期" src="calendar.gif" />
+ </div>
+ </BODY>
+</HTML>
View
BIN  demo/core/Calendar/Thumbs.db
Binary file not shown
View
BIN  demo/core/Calendar/calendar.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
153 demo/core/Calendar/css/Calendar.css
@@ -0,0 +1,153 @@
+.CalendarBox {
+ width:154px;
+ border:1px solid #99BBE8;
+ background:#DFE8F6;
+ color:#264390;
+
+ scrollbar-face-color: #ABC7EC;
+ scrollbar-highlight-color: #D8E4F5;
+ scrollbar-shadow-color: #8EB4E6;
+ scrollbar-3dlight-color: #D8E4F5;
+ scrollbar-arrow-color: #264390;
+ scrollbar-track-color: #EBF2FC;
+ scrollbar-darkshadow-color: #D8E4F5;
+ scrollbar-base-color: #fef6ea;
+}
+.CalendarBox div {
+ padding:0px;
+ margin:0px;
+ text-align:center;
+ cursor:default;
+ font:normal 10px Arial;
+}
+.CalendarBox .header {
+ background:#DFE8F6 url(../images/calendar.gif) repeat-x;
+ height:29px;
+}
+.CalendarBox .headTop {
+ display:block;
+}
+.CalendarBox .headTop div {
+ float:left;
+}
+.CalendarBox .headBottom {
+ display:block;
+}
+.CalendarBox .headDes {
+ width:124px;
+}
+.CalendarBox .headDes A {
+ color:#264390;
+ text-decoration:none;
+}
+.CalendarBox .previewMonthButton {
+ width:15px;
+ height:15px;
+ cursor:hand;
+ cursor:pointer;
+ background:url(../images/calendar.gif) 0px -45px no-repeat;
+}
+.CalendarBox .nextMonthButton {
+ width:15px;
+ height:15px;
+ cursor:hand;
+ cursor:pointer;
+ background:url(../images/calendar.gif) 0px -60px no-repeat;
+}
+.CalendarBox .week {
+ width:22px;
+ float:left;
+}
+.CalendarBox .week_end {
+ width:22px;
+ float:left;
+ color:red;
+}
+.CalendarBox .body {
+ height:132px;
+ overflow:hidden;
+}
+.CalendarBox .OtherMonthDate {
+ width:20px;
+ height:17px;
+ border-width:1px 1px 1px 1px;
+ border-style:solid solid solid solid;
+ border-color:#E9F3FE #8BB1E4 #8BB1E4 #E9F3FE;
+ background:#DFE8F6;
+ color:#AFB0B1;
+ padding:3px 0px 0px 0px;
+ float:left;
+}
+.CalendarBox .CurMonthDate {
+ width:20px;
+ height:17px;
+ border-width:1px 1px 1px 1px;
+ border-style:solid solid solid solid;
+ border-color:#E9F3FE #8BB1E4 #8BB1E4 #E9F3FE;
+ background:#CFE4FB;
+ color:#264390;
+ padding:3px 0px 0px 0px;
+ float:left;
+}
+.CalendarBox .Today {
+ width:20px;
+ height:17px;
+ border:1px solid #261170;
+ background:url(../images/calendar.gif) 0px -93px repeat-x;
+ color:#FFF;
+ padding:3px 0px 0px 0px;
+ float:left;
+}
+.CalendarBox .selectLayer {
+ background:#DFE8F6;
+ border:1px solid #99BBE8;
+ overflow:hidden;
+ position:absolute;
+ left:-1px;
+ top:-1px;
+ width:154px;
+ height:1px;
+}
+.CalendarBox .selectLayer .selectLayerLeft {
+ width:92px;
+ height:140px;
+ overflow:auto;
+ border-right:1px solid #99BBE8;
+ float:left
+}
+.CalendarBox .selectLayer .item {
+ height:16px;
+ overflow:hidden;
+ display:block;
+ text-align:left;
+ padding-left:3px;
+}
+.CalendarBox .selectLayer .itemHighLight {
+ height:16px;
+ overflow:hidden;
+ display:block;
+ color:#FFF;
+ text-align:left;
+ padding-left:3px;
+ border:1px solid #261170;
+ background:url(../images/calendar.gif) 0px -98px repeat-x;
+}
+.CalendarBox .selectLayer .selectLayerRight {
+ width:60px;
+ height:140px;
+ overflow:auto;
+ float:left;
+}
+.CalendarBox .selectLayer .selectLayerBottom {
+ width:154px;
+ border-top:1px solid #99BBE8;
+ float:left;
+ padding-top:4px;
+}
+.CalendarBox .selectLayer .selectLayerBottom .selectLayerBT {
+ display:inline;
+ height:14px;
+ background:#ABC7EC;
+ border:1px solid #99BBE8;
+ margin:0px 2px 0px 2px;
+}
View
BIN  demo/core/Calendar/images/Thumbs.db
Binary file not shown
View
BIN  demo/core/Calendar/images/calendar.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
683 demo/core/Calendar/js/Calendar.js
@@ -0,0 +1,683 @@
+/*
+* Function : Calendar Select JavaScript
+* Author : ShiCH
+* Date : 2009-3-16
+*/
+
+function Calendar(){
+ this.render = null;
+ this.caller = null;
+ this.singleHeight = 132;
+ this.step = 5;
+ this.isIE = /msie/i.test(navigator.userAgent);
+ this.parten = "yyyy-MM-dd";
+
+ this.moveEnd = true;
+}
+
+Array.prototype.CalendarIndex = function(str){
+ var curIndex = null;
+ for(var i = 0 , iLen = this.length ;i < iLen ; i ++){
+ if(this[i] == str){
+ curIndex = i;
+ break;
+ }
+ }
+ return curIndex;
+}
+
+Calendar.prototype.$ = function(id){
+ return document.getElementById(id);
+}
+Calendar.prototype.$C = function(tagName,attrObject){
+ var elm = window.document.createElement(tagName);
+ if(null != attrObject && typeof(attrObject) == "object"){
+ for(var item in attrObject){
+ if(item == "innerHTML" || item == "className")
+ elm[item] = attrObject[item];
+ else
+ elm.setAttribute(item,attrObject[item]);
+ }
+ }
+ return elm;
+}
+Calendar.prototype.$A = function(elm,pElm){
+ return pElm ? pElm.appendChild(elm) : document.body.appendChild(elm);
+}
+Calendar.prototype.$R = function(elm,pElm){
+ return pElm ? pElm.removeChild(elm) : document.body.removeChild(elm);
+}
+Calendar.prototype.$T = function(tagName,pElm){
+ return pElm ? pElm.getElementsByTagName(tagName) : document.getElementsByTagName(tagName);
+}
+
+Calendar.prototype.init = function(oldDate){
+ if(null == this.render){
+ return;
+ }
+ if(this.render.tagName.toUpperCase() != "INPUT"){
+ alert("The Render Of The Calendar Must Be \"Input\"");
+ return;
+ }
+
+ this.weekArr = ["S","M","T","W","T","F","S"];
+ //this.weekArr = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
+ this.weekFullArr = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
+ //this.weekArr = ["日","一","二","三","四","五","六"];
+ this.monthArr = ["January","February","March","April","May","June","July","August","September","October","November","Decmber"];
+ //this.monthArr = ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];
+
+ this.build();
+ this.attachEvent();
+}
+
+Calendar.prototype.build = function(){
+ var year,month,date;
+ var oldValue = this.render.value;
+ if(oldValue == ""){
+ with(new Date()){
+ year = getUTCFullYear();
+ month = getMonth() + 1;
+ date = getDate();
+ }
+ }else{
+ var dateStr = this.getDefaultDate(oldValue);
+ year = Math.ceil(dateStr.split("-")[0]);
+ month = Math.ceil(dateStr.split("-")[1]) + 1;
+ date = Math.ceil(dateStr.split("-")[2]);
+ }
+
+ this.year = year;
+ this.month = month;
+ this.date = date;
+ this.highMonth = month;
+ this.highYear = year;
+
+ if(null == this.layer){
+ this.layer = this.$C("div",{className:"CalendarBox"});
+ this.$A(this.layer,document.body);
+
+ this.head = this.$C("div",{className:"header"});
+ this.$A(this.head,this.layer);
+
+ this.body = this.$C("div",{className:"body"});
+ this.$A(this.body,this.layer);
+
+ var b1 = this.$C("div");
+ var b2 = this.$C("div");
+ var b3 = this.$C("div");
+ this.$A(b1,this.body);
+ this.$A(b2,this.body);
+ this.$A(b3,this.body);
+ b1.style.height = b2.style.height = b3.style.height = this.singleHeight + "px";
+ b1.style.display = b2.style.display = b3.style.display = "block";
+
+ this.bodyArr = [b1,b2,b3];
+
+ var rect = this.BoundingRect(this.render);
+ this.layer.style.position = "absolute";
+ this.layer.style.left = Math.floor(rect.left) + 'px';
+ this.layer.style.top = Math.floor(rect.top) + Math.floor(this.render.offsetHeight) + 'px';
+
+ with(this.layer){
+ oncopy = function(){selection.empty();};
+ onbeforecopy = function(){return false;};
+ up = function(){selection.empty();};
+ oncontextmenu = function(){return false;};
+ ondragstart = function(){return false;};
+ onselectstart = function(){return false;};
+ onselect = function(){selection.empty();};
+ }
+ }
+ this.buildHead();
+ this.buildBody(true);
+ this.buildSelectLayer();
+}
+
+Calendar.prototype.buildHead = function(){
+ // Head Start
+ if(null == this.showHead){
+ var headT = this.$C("div",{className:"headTop"});
+ this.$A(headT,this.head);
+
+ var headB = this.$C("div",{className:"headBottom"});
+ this.$A(headB,this.head);
+
+ this.pre = this.$C("div",{className:"previewMonthButton"});
+ this.$A(this.pre,headT);
+
+ this.showHead = this.$C("div",{className:"headDes"});
+
+ var showSelector = this.$C("a",{innerHTML:this.monthArr[this.month-1] + " " + this.year,href:"javascript:void(0);"});
+ this.$A(showSelector,this.showHead);
+ this.$A(this.showHead,headT);
+
+ this.nxt = this.$C("div",{className:"nextMonthButton"});
+ this.$A(this.nxt,headT);
+
+ for(var i=0,iLen=this.weekArr.length;i<iLen;i++){
+ var d = this.$C("div",{className:"week",innerHTML:this.weekArr[i],title:this.weekFullArr[i]});
+ this.$A(d,headB);
+ }
+ }else{
+ this.showHead.getElementsByTagName("a")[0].innerHTML = this.monthArr[this.month-1] + " " + this.year;;
+ }
+ // Head End
+}
+
+Calendar.prototype.buildBody = function(isNext){
+ this.monthTable = this.getData();
+ var con = isNext ? this.bodyArr[2] : this.bodyArr[0];
+ con.innerHTML = "";
+
+ var theDaysInMonth = new Date(this.year, this.month, 0).getDate();
+ for(var i=1;i<7;i++){
+ for(var j=0;j<7;j++){
+ var backDate = this.starCaTran(this.year,this.month,this.monthTable[i][j]);
+ var isHightLight = this.date == this.monthTable[i][j] && this.month == this.highMonth && this.year == this.highYear;
+ var div = this.$C("div",{
+ className:(this.monthTable[i][j] < 1 || this.monthTable[i][j] > theDaysInMonth) ? "OtherMonthDate" : (isHightLight ? "Today" :"CurMonthDate"),
+ innerHTML:backDate.split("-")[2],
+ _today:backDate
+ });
+ if(isHightLight){
+ this.selectedDate = div;
+ this.oldClass = (this.monthTable[i][j] < 1 || this.monthTable[i][j] > theDaysInMonth) ? "OtherMonthDate" : "CurMonthDate";
+ }
+ this.$A(div,con);
+ }
+ }
+ this.move(isNext,con);
+ //alert(window.clipboardData.setData("text",this.body.outerHTML));
+}
+
+Calendar.prototype.getData = function(){
+ var year = this.year;
+ var month = this.month;
+
+ var aMonth = [];
+ for(i=1;i<7;i++)
+ aMonth[i] = new Array(i);
+
+ var dCalDate = new Date(year, month-1, 1);
+ var iDayOfFirst = dCalDate.getDay();
+ var iDaysInMonth = new Date(year, month, 0).getDate();
+ var iOffsetLast = new Date(year, month-1, 0).getDate() - iDayOfFirst + 1;
+ var iDate = 1;
+ var iNext = 1;
+
+ for (d = 0; d < 7; d++)
+ aMonth[1][d] = (d < iDayOfFirst)?(-iDayOfFirst + d + 1) : iDate++;
+ for (w = 2; w < 7; w++)
+ for (d = 0; d < 7; d++)
+ aMonth[w][d] = iDate++;
+ return aMonth;
+}
+
+Calendar.prototype.starCaTran = function(year,month,date){
+ var curDate = new Date(year,month-1,date);
+ if(curDate.getMonth()+1 == 1 && curDate.getDate() == 1){
+ with(curDate)
+ return getUTCFullYear() + 1 + "-" +(getMonth()+1) + "-" + getDate();
+ }else{
+ with(curDate)
+ return getUTCFullYear() + "-" +(getMonth()+1) + "-" + getDate();
+ }
+}
+
+Calendar.prototype.attachEvent = function(){
+ var oThis = this;
+ this.Event.add(document,'click',function(event){
+ var evt = event ? event : window.event;
+ var elm = evt.srcElement || evt.target;
+
+
+ var isLayer = false,pElm = elm,i = 0;
+ while(i < 10 && pElm){
+ if(pElm == oThis.layer){
+ isLayer = true;
+ break;
+ }else{
+ pElm = pElm.parentNode;
+ }
+ i++;
+ }
+
+ if(!isLayer && oThis.caller != elm){
+ oThis.dispose();
+ }
+ });
+
+ this.pre.onclick = function(){
+ if(!oThis.moveEnd){
+ return;
+ }
+ oThis.year = Math.floor(oThis.month) - 1 < 1 ? Math.floor(oThis.year - 1) : oThis.year;
+ oThis.month = Math.floor(oThis.month) - 1 < 1 ? 12 : Math.floor(oThis.month) - 1;
+
+ oThis.buildHead();
+ oThis.buildBody(false);
+ }
+ this.nxt.onclick = function(){
+ if(!oThis.moveEnd){
+ return;
+ }
+ oThis.year = Math.floor(oThis.month) + 1 > 12 ? Math.floor(oThis.year) + 1 : oThis.year;
+ oThis.month = Math.floor(oThis.month) + 1 > 12 ? 1 : Math.floor(oThis.month) + 1;
+
+ oThis.buildHead();
+ oThis.buildBody(true);
+ }
+
+ this.body.onclick = function(event){
+ if(!oThis.moveEnd){
+ return;
+ }
+ //alert(window.clipboardData.setData("text",this.outerHTML));
+ var evt = event ? event : window.event;
+ var obj = evt.srcElement || evt.target;
+ var storeDate = obj.getAttribute("_today");
+ if(storeDate != null){
+ if(null != oThis.selectedDate){
+ var selectYear = storeDate.split("-")[0];
+ var selectMonth = storeDate.split("-")[1];
+ if(selectYear != oThis.year || selectMonth != oThis.month){
+ var isNext = Math.floor(oThis.month) < Math.floor(selectMonth) || Math.floor(oThis.year) < Math.floor(selectYear);
+ oThis.year = selectYear;
+ oThis.month = selectMonth;
+ oThis.date = storeDate.split("-")[2];
+ oThis.highMonth = oThis.month;
+ oThis.highYear = oThis.year;
+ oThis.buildHead();
+ oThis.buildBody(isNext);
+ }else{
+ oThis.selectedDate.className = oThis.oldClass;
+ oThis.selectedDate = obj;
+ oThis.oldClass = obj.className;
+ obj.className = "Today";
+ }
+ }
+ }
+
+
+ if(storeDate != null){
+ oThis.render.value = oThis.formateDate(storeDate);
+ }
+ }
+
+ /*
+ this.body.ondblclick = function(event){
+ if(!oThis.moveEnd){
+ return;
+ }
+ var evt = event ? event : window.event;
+ var obj = evt.srcElement || evt.target;
+ var storeDate = obj.getAttribute("_today");
+ if(storeDate != null){
+ oThis.render.value = oThis.formateDate(storeDate);
+ oThis.dispose();
+ }
+ }
+ */
+
+ this.showHead.getElementsByTagName("a")[0].onclick = function(){
+ oThis.showYearMonth();
+ }
+
+ this.yearAndMonthLayer.onclick = function(event){
+ var evt = event ? event : window.event;
+ var obj = evt.srcElement || evt.target;
+ var type = obj.getAttribute("_type");
+ if(type == "ok"){
+ var year = this.getAttribute("_selectedYear");
+ var month = this.getAttribute("_selectedMonth");
+ var needMove = (Math.floor(oThis.month) != Math.floor(month)) || (Math.floor(oThis.year) != Math.floor(year));
+
+ if(needMove){
+ var isNext = Math.floor(oThis.month) < Math.floor(month) || Math.floor(oThis.year) < Math.floor(year);
+ oThis.year = year;
+ oThis.month = Number(month);
+ setTimeout(function(){
+ oThis.buildHead();
+ oThis.buildBody(isNext);
+ },300);
+ }
+ oThis.moveMin();
+ }
+ if(type == "no"){
+ oThis.moveMin();
+ }
+ if(type == "month"){
+ var month = obj.getAttribute("_month");
+ this.setAttribute("_selectedMonth",Math.floor(month) + 1);
+
+
+ oThis.yearAndMonthLayerM.className = "item";
+ obj.className = "itemHighLight";
+ oThis.yearAndMonthLayerM = obj;
+ }
+ if(type == "year"){
+ var year = obj.getAttribute("_year");
+ this.setAttribute("_selectedYear",year);
+
+ oThis.yearAndMonthLayerY.className = "item";
+ obj.className = "itemHighLight";
+ oThis.yearAndMonthLayerY = obj;
+ }
+ }
+}
+
+Calendar.prototype.move = function(isNext,con){
+ var oThis = this;
+ this.moveEnd = false;
+
+ var t = Math.floor(this.body.scrollTop);
+ if(t < this.singleHeight * 2 && isNext){
+ var margin = Math.ceil(Math.abs(t - this.singleHeight * 2)/this.step);
+ this.body.scrollTop = t + margin > this.singleHeight * 2 ? this.singleHeight * 2 : t + margin;
+ setTimeout(function(){
+ oThis.move(isNext,con);
+ },10);
+ }else if(isNext){
+ var firstObj = this.bodyArr[0].cloneNode(true);
+ this.$R(this.bodyArr[0],this.body);
+ this.$A(firstObj,this.body);
+
+ this.bodyArr.shift();
+ this.bodyArr.push(firstObj);
+ this.body.scrollTop = this.singleHeight;
+
+ this.moveEnd = true;
+ }
+
+ if(t > 0 && !isNext){
+ var margin = Math.ceil(Math.abs(t - 0)/this.step);
+ this.body.scrollTop = t - margin < 0 ? 0 : t - margin;
+ setTimeout(function(){
+ oThis.move(isNext,con);
+ },10);
+ }else if(!isNext){
+ var lastObj = this.bodyArr[2].cloneNode(true);
+ this.$R(this.bodyArr[2],this.body);
+ this.isIE ? this.body.insertAdjacentElement("afterBegin",lastObj) : this.body.insertBefore(lastObj,this.body.firstChild);
+
+ this.bodyArr.pop();
+ this.bodyArr.unshift(lastObj);
+ this.body.scrollTop = this.singleHeight;
+
+ this.moveEnd = true;
+ }
+}
+
+Calendar.prototype.showYearMonth = function(){
+ this.refocusDate();
+ this.moveMax();
+}
+
+Calendar.prototype.buildSelectLayer = function(){
+ var oThis = this;
+ var oRect = this.BoundingRect(this.layer);
+ var rect = this.BoundingRect(this.head);
+ var zIndex = Math.floor(this.layer.style.zIndex == null ? 1 : this.layer.style.zIndex) + 1;
+
+ this.yearAndMonthLayer = this.$C("div",{className:"selectLayer"});
+ this.yearAndMonthLayer.style.display = "none";
+
+ /*
+ with(this.yearAndMonthLayer.style){
+ width = this.layer.offsetWidth - 2 + 'px';
+ height = "1px";
+ position = "absolute";
+ left = rect.left - oRect.left - 1 + "px";
+ top = rect.top - oRect.top - 1 + "px";
+ zIndex = zIndex;
+ display = "none";
+ }
+ */
+
+ this.$A(this.yearAndMonthLayer,this.layer);
+ this.addYearAndMonthContent(this.year,this.month);
+}
+
+Calendar.prototype.refocusDate = function(){
+ this.yearAndMonthLayer.setAttribute("_selectedYear",this.year);
+ this.yearAndMonthLayer.setAttribute("_selectedMonth",this.month);
+ var oThis = this;
+ var divs = this.yearAndMonthLayer.getElementsByTagName("div");
+ for(var i=0,iLen=divs.length;i<iLen;i++){
+ var curDiv = divs[i];
+ var year = curDiv.getAttribute("_year");
+ var month = curDiv.getAttribute("_month");
+ if(year != null){
+ if(year == this.year){
+ oThis.yearAndMonthLayerY = curDiv;
+ curDiv.className = "itemHighLight";
+ var tmpYearDiv = curDiv;
+ setTimeout(function(){
+ oThis.moveSelectLayerTop(tmpYearDiv);
+ },300);
+ }else{
+ curDiv.className = "item";
+ }
+ }
+ if(month != null){
+ if(month == this.month-1){
+ oThis.yearAndMonthLayerM = curDiv;
+ curDiv.className = "itemHighLight";
+ var tmpMonthDiv = curDiv;
+ setTimeout(function(){
+ oThis.moveSelectLayerTop(tmpMonthDiv);
+ },300);
+ }else{
+ curDiv.className = "item";
+ }
+ }
+ }
+}
+
+Calendar.prototype.BoundingRect = function(el){
+ var ua = navigator.userAgent.toLowerCase();
+ var parent = null;
+ var pos = [];
+ var box;
+ if (el.getBoundingClientRect){ //ie
+ box = el.getBoundingClientRect();
+ var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
+ var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
+ return {
+ left: box.left + scrollLeft,
+ top: box.top + scrollTop
+ };
+ }else if (document.getBoxObjectFor){ // gecko
+ box = document.getBoxObjectFor(el);
+ var borderLeft = (el.style.borderLeftWidth) ? parseInt(el.style.borderLeftWidth) : 0;
+ var borderTop = (el.style.borderTopWidth) ? parseInt(el.style.borderTopWidth) : 0;
+ pos = [box.x - borderLeft, box.y - borderTop];
+ }else{ // safari & opera
+ pos = [el.offsetLeft, el.offsetTop];
+ parent = el.offsetParent;
+ if (parent != el) {
+ while (parent) {
+ pos[0] += parent.offsetLeft;
+ pos[1] += parent.offsetTop;
+ parent = parent.offsetParent;
+ }
+ }
+ if (/opera/.test(ua) || (/safari/.test(ua) && el.style.position == 'absolute')) {
+ pos[0] -= document.body.offsetLeft;
+ pos[1] -= document.body.offsetTop;
+ }
+ }
+
+ el.parentNode ? parent = el.parentNode : parent = null;
+
+ while (parent && parent.tagName.toUpperCase() != 'BODY' && parent.tagName.toUpperCase() != 'HTML') { // account for any scrolled ancestors
+ pos[0] -= parent.scrollLeft;
+ pos[1] -= parent.scrollTop;
+ parent.parentNode ? parent = parent.parentNode : parent = null;
+ }
+ return {
+ left: pos[0],
+ top: pos[1]
+ }
+}
+
+Calendar.prototype.dispose = function(){
+ if(null != this.layer){
+ this.$R(this.layer);
+ this.layer = null;
+ this.showHead = null;
+ }
+}
+
+Calendar.prototype.addYearAndMonthContent = function(year,month){
+ this.yearAndMonthLayer.innerHTML = "";
+ this.yearAndMonthLayer.setAttribute("_selectedYear",year);
+ this.yearAndMonthLayer.setAttribute("_selectedMonth",month);
+
+ var lDiv = this.$C("div",{className:"selectLayerLeft"});
+ this.$A(lDiv,this.yearAndMonthLayer);
+
+ for(var i=0,iLen=this.monthArr.length;i<iLen;i++){
+ var div = this.$C("div",{
+ innerHTML:this.monthArr[i],
+ _month:i,
+ _type:"month",
+ className:i == month ? "itemHighLight" : "item"
+ });
+ this.$A(div,lDiv);
+ }
+
+ var rDiv = this.$C("div",{className:"selectLayerRight"});
+ this.$A(rDiv,this.yearAndMonthLayer);
+ var startYear = year < 1949 ? year : 1949;
+ for(var i=startYear,iLen=Math.floor(year)+10;i<iLen;i++){
+ var div = this.$C("div",{
+ className:i == year ? "itemHighLight" : "item",
+ innerHTML:i,
+ _year:i,
+ _type:"year"
+ });
+ this.$A(div,rDiv);
+ }
+
+ var bDiv = this.$C("div",{className:"selectLayerBottom"});
+ this.$A(bDiv,this.yearAndMonthLayer);
+
+ selectLayerOK = this.$C("div",{
+ className:"selectLayerBT",
+ innerHTML:"ok",
+ _type:"ok"
+ });
+ this.$A(selectLayerOK,bDiv);
+
+ selectLayerNO = this.$C("div",{
+ className:"selectLayerBT",
+ innerHTML:"cancle",
+ _type:"no"
+ });
+ this.$A(selectLayerNO,bDiv);
+}
+
+Calendar.prototype.moveMax = function(){
+ var oThis = this;
+ this.yearAndMonthLayer.style.display = "";
+ var h = Math.floor(this.yearAndMonthLayer.offsetHeight);
+ if(h < this.layer.offsetHeight){
+ var margin = Math.ceil(Math.abs(h - this.layer.offsetHeight)/this.step);
+ this.yearAndMonthLayer.style.height = h + margin + "px";
+ this.yearAndMonthLayer.scrollTop = h;
+ setTimeout(function(){
+ oThis.moveMax();
+ },10)
+ }else{
+ this.yearAndMonthLayer.scrollTop = 0;
+ this.yearAndMonthLayer.style.height = this.layer.offsetHeight + "px";
+ }
+}
+
+Calendar.prototype.moveMin = function(){
+ var oThis = this;
+ this.yearAndMonthLayer.style.display = "";
+ var h = Math.floor(this.yearAndMonthLayer.offsetHeight);
+ var margin = Math.ceil(Math.abs(h - 0)/this.step);
+ var oH = 8;
+ if(h - margin > oH){
+ this.yearAndMonthLayer.style.height = h - margin + "px";
+ this.yearAndMonthLayer.scrollTop = h - margin;
+ setTimeout(function(){
+ oThis.moveMin();
+ },10)
+ }else{
+ this.yearAndMonthLayer.scrollTop = this.layer.offsetHeight;
+ this.yearAndMonthLayer.style.height = "1px";
+ this.yearAndMonthLayer.style.display = "none";
+ }
+}
+
+Calendar.prototype.moveSelectLayerTop = function(elm){
+ var oThis = this;
+ var t = Math.floor(elm.parentNode.scrollTop);
+ var et = Math.floor(elm.offsetTop);
+ var oh = Math.floor(elm.parentNode.offsetHeight);
+ var os = Math.floor(elm.parentNode.scrollHeight);
+ if(t < et && os - t > oh){
+ var margin = Math.ceil(Math.abs(t - et)/this.step);
+ elm.parentNode.scrollTop = t + margin;
+ setTimeout(function(){
+ oThis.moveSelectLayerTop(elm);
+ },10);
+ }else{
+ elm.parentNode.scrollTop = et;
+ }
+}
+
+Calendar.prototype.formateDate = function(dateStr){
+ var dateArr = dateStr.split("-");
+ var year = Number(dateArr[0]);
+ var month = Number(dateArr[1]);
+ var date = Number(dateArr[2]);
+
+ month = month < 10 ? "0" + month : month;
+ date = date < 10 ? "0" + date : date;
+
+ return this.parten.replace(/yyyy/ig,year).replace(/MM/ig,month).replace(/dd/ig,date);
+}
+
+Calendar.prototype.getDefaultDate = function(dateStr){
+ var year = dateStr.substring(this.parten.indexOf("yyyy"),this.parten.lastIndexOf("yyyy")+4);
+ var month = dateStr.substring(this.parten.indexOf("MM"),this.parten.lastIndexOf("MM")+2);
+ var date = dateStr.substring(this.parten.indexOf("dd"),this.parten.lastIndexOf("dd")+2);
+
+ var nDate = new Date(year,Math.floor(month) - 1,Math.floor(date));
+ if(isNaN(nDate)){
+ nDate = new Date();
+ }
+ return nDate.getUTCFullYear() + "-" + nDate.getMonth() + "-" + nDate.getDate();
+}
+
+Calendar.prototype.Event = {
+ add : function(oTarget, sEventType, fnHandler){
+ if (oTarget.addEventListener) {
+ oTarget.addEventListener(sEventType, fnHandler, false);
+ }
+ else if (oTarget.attachEvent) {
+ oTarget.attachEvent("on" + sEventType, fnHandler);
+ }
+ else {
+ oTarget["on" + sEventType] = fnHandler;
+ }
+ },
+
+ remove : function(oTarget, sEventType, fnHandler){
+ if (oTarget.removeEventListener) {
+ oTarget.removeEventListener(sEventType, fnHandler, false);
+ }
+ else if (oTarget.detachEvent) {
+ oTarget.detachEvent("on" + sEventType, fnHandler);
+ }
+ else {
+ oTarget["on" + sEventType] = null;
+ }
+ }
+}
View
172 demo/core/Cpu/cpu.as
@@ -0,0 +1,172 @@
+/*
+* 功 能: CPU使用率展现AS
+* 作 者: IRD ShiCH
+* 日 期: 2009-2-23
+*/
+
+// http请求地址
+_URL_CUP = datasrc;
+
+//缩放舞台并不缩放内容,将内容定位于舞台的左上角;
+Stage.align = "TL";
+Stage.scaleMode = "noScale";
+_quality = "BEST";
+
+var perLayer:MovieClip = _root.createEmptyMovieClip("perLayer",this.getNextHighestDepth());
+var perOverLayer:MovieClip = _root.createEmptyMovieClip("perOverLayer",this.getNextHighestDepth());
+var gridLayer:MovieClip = _root.createEmptyMovieClip("gridLayer",this.getNextHighestDepth());
+var gridPointLayer:MovieClip = _root.createEmptyMovieClip("gridPointLayer",this.getNextHighestDepth());
+
+// 记录循环次数
+var runCount:Number = 0;
+// grid值数组
+var gridPoint:Array = [];
+
+// 网格移动大小
+var gridMoveMarge:Number = 2;
+
+function GetCpuData(){
+ var xmlData:XML = new XML();
+ xmlData.contentType = "application/octet-stream";
+ xmlData.ignoreWhite = true;
+
+ xmlData.onLoad = function(success) {
+ var responseNode:Object = this.firstChild; //得到RESPONSE节点
+ var CpuInfoNode:Object = responseNode.firstChild;
+ var InfoNode:Object = CpuInfoNode.firstChild;
+ var showValue:String = InfoNode.firstChild;
+
+ BuildData(showValue);
+ }
+ xmlData.sendAndLoad(_URL_CUP,xmlData);
+}
+
+function BuildData(showValue:String){
+ percentTxt.text = showValue + "%";
+ drawPerLayer(showValue);
+ drawGrid(showValue);
+}
+
+// 百分比遮盖层
+function drawOverLayer(){
+ perOverLayer.beginFill(0x000000);
+ perOverLayer.moveTo(47, 30);
+ perOverLayer.lineTo(47, 53);
+ perOverLayer.lineTo(48, 53);
+ perOverLayer.lineTo(48, 30);
+ perOverLayer.lineTo(47, 30);
+ perOverLayer.endFill();
+}
+drawOverLayer();
+
+function drawPerLayer(showValue:String){
+ perLayer.clear();
+
+ var vCount:Number = Math.ceil(parseInt(showValue)/100*6);
+
+ for(var i=0;i<vCount;i++){
+ perBlock(i);
+ }
+}
+
+function perBlock(dep:Number){
+ var yNum:Number = dep*3;
+ var bH:Number = 2;
+
+ perLayer.beginFill(0x00FF00);
+ perLayer.moveTo(31, 50-yNum);
+ perLayer.lineTo(64, 50-yNum);
+ perLayer.lineTo(64, 50-yNum+bH);
+ perLayer.lineTo(31, 50-yNum+bH);
+ perLayer.lineTo(31, 50-yNum);
+ perLayer.endFill();
+}
+
+function drawHLine(){
+ var hLineMC:MovieClip = gridLayer.createEmptyMovieClip("hLineMC",gridLayer.getNextHighestDepth());
+ var maxY:Number = Math.floor(51/11);
+ for(var i=0;i<maxY;i++){
+ var x:Number = 119;
+ var y:Number = 26 + (i + 1) * 11;
+ hLineMC.moveTo(x, y);
+ hLineMC.lineStyle(1, 0x008040, 100, false, "none", "none", "bevel", 1);
+ hLineMC.lineTo(x + 229, y);
+ }
+}
+drawHLine();
+
+function drawGrid(showValue:String){
+ runCount ++;
+ if(runCount == 6){
+ runCount = 0;
+ }
+ drawVLine();
+ drawPointLine(showValue);
+}
+
+function drawVLine(){
+ var vLineMC:MovieClip = gridLayer["vLineMC"];
+ if(null == vLineMC){
+ vLineMC = gridLayer.createEmptyMovieClip("vLineMC",gridLayer.getNextHighestDepth());
+ }
+ vLineMC.clear();
+
+ var maxX:Number = Math.floor(229/11);
+ for(var i=0;i<maxX;i++){
+ var x:Number = 119 + (i + 1) * 11 - runCount * gridMoveMarge;
+ vLineMC.moveTo(x, 26);
+ vLineMC.lineStyle(1, 0x008040, 100, false, "none", "none", "bevel", 1);
+ vLineMC.lineTo(x, 77);
+
+ if(runCount != 0 && i == maxX - 1){
+ vLineMC.moveTo(x + 11, 26);
+ vLineMC.lineStyle(1, 0x008040, 100, false, "none", "none", "bevel", 1);
+ vLineMC.lineTo(x + 11, 77);
+ }
+ }
+}
+
+function drawPointLine(showValue:String){
+ gridPointLayer._quality = "LOW";
+ gridPointLayer.clear();
+
+ if(gridPoint.length < Math.floor(229/2)){
+ gridPoint.push(parseInt(showValue));
+ }else{
+ gridPoint.shift();
+ gridPoint.push(parseInt(showValue));
+ }
+ var iLen:Number = gridPoint.length-2;
+ var oLeft:Number = 344;
+ var oTop:Number = 76;
+ var cHei:Number = 51;
+
+ for(var i:Number = iLen ; i >= 0 ; i --){
+ var curValue:Number = gridPoint[i];
+
+ var x:Number = oLeft - (iLen - i - 1) * gridMoveMarge;
+ var y:Number = oTop - (curValue/100 * cHei);
+
+ if(i == iLen){
+ var pValue:Number = gridPoint[i+1];
+ var x2:Number = oLeft - (iLen - i) * gridMoveMarge;
+ var y2:Number = oTop - (pValue/100 * cHei);
+ gridPointLayer.moveTo(x2, y2);
+ }
+ gridPointLayer.lineStyle(1, 0x00FF00, 100, false, "normal", "round", "miter", 255);
+ gridPointLayer.lineTo(x, y);
+ }
+}
+
+GetCpuData();
+setInterval(function(){GetCpuData()},1000);
+
+// 右键菜单
+var menu = new ContextMenu();
+menu.hideBuiltInItems();
+//menu.customItems.push(new ContextMenuItem("..北京中软融鑫计算机系统工程有限公司..",resoftMenu));
+_root.menu = menu;
+
+function resoftMenu(){
+ getURL("http://www.resoft.css.com.cn","_blank");
+}
View
BIN  demo/core/Cpu/cpu.fla
Binary file not shown
View
44 demo/core/Cpu/cpu.htm
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>CPU监控</title>
+<style>
+body{
+ margin: 10px;
+ font-size: 12px;
+ background-color:#EFF2FA;
+ overflow:hidden;
+ border:0px;
+}
+.mainBox {
+ background-color:white;
+ border:1px solid #D5E1F0;
+ padding:5px;
+ overflow:hidden;
+ zoom:1;
+}
+</style>
+</head>
+<body>
+<div class="mainBox">
+ <div style="display:inline;" id="objContainer">
+ </div>
+<script type="text/javascript">
+ var url = "../../service/cpu.asp";//"data.xml"; //初始数据的请求地址
+ var str = [];
+ str[str.length] = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" id=\"cpuShow\" width=\"361\" height=\"88\" align=\"middle\">";
+ str[str.length] = " <param name=\"wmode\" value=\"transparent\" />";
+ str[str.length] = " <param name=\"allowScriptAccess\" value=\"sameDomain\" />";
+ str[str.length] = " <param name=\"movie\" value=\"cpu.swf\" />";
+ str[str.length] = " <param name=\"quality\" value=\"high\" />";
+ str[str.length] = " <param name=\"bgcolor\" value=\"#E9E9EE\" />";
+ str[str.length] = " <param name=\"flashvars\" value=\"datasrc=" + url + "\">";
+ str[str.length] = " <embed src=\"cpu.swf\" flashvars=\"datasrc=" + url + "\" quality=\"high\" bgcolor=\"#E9E9EE\" width=\"361\" height=\"88\" swLiveConnect=true id=\"cpuShow\" name=\"workFlow\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />"
+ str[str.length] = "</object>";
+ var div = document.getElementById("objContainer");
+ div.innerHTML = str.join("\n");
+</script>
+</div>
+</body>
+</html>
View
BIN  demo/core/Cpu/cpu.swf
Binary file not shown
View
6 demo/core/Cpu/data.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Response>
+ <CpuInfo>
+ <Info>15</Info>
+ </CpuInfo>
+</Response>
View
BIN  demo/core/Cpu/images/Thumbs.db
Binary file not shown
View
BIN  demo/core/Cpu/images/frame.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
96 demo/core/GridTree/css/gridTree.css
@@ -0,0 +1,96 @@
+html{filter:expression(document.execCommand("BackgroundImageCache", false, true))}
+.gridTree {
+}
+.gridTree .mainTable {
+ border-collapse:collapse;
+ border:1px solid #D0D0D0;
+ width:100%;
+ background:#FFFFFF;
+}
+.gridTree .mainTable .title {
+ background: #FFFFFF url(../images/lessGridTitle.gif) repeat-x;
+ font:normal 12px Arial,ËÎÌå;
+ *work-break:keep-all;
+ white-space:noWrap;
+ height:23px;
+ line-height:120%;
+ border-bottom: 1px solid #D0D0D0;
+ cursor:default;
+}
+.gridTree .mainTable .contentTD {
+ font:normal 12px Arial,ËÎÌå;
+ line-height:120%;
+ border:1px solid #F0F0F0;
+ cursor:default;
+ height:20px;
+ background-image:url(../images/lessGridRow.gif);
+}
+.gridTree .mainTable .contentTD .contentTitleTD {
+ font:normal 12px Arial,ËÎÌå;
+ line-height:120%;
+ border:0px;
+ cursor:default;
+}
+.gridTree .mainTable .contentCB {
+ font:normal 12px Arial,ËÎÌå;
+ line-height:120%;
+ border:1px solid #F0F0F0;
+ cursor:default;
+ text-align:center;
+ background: url(../images/lessGridRow.gif);
+}
+.gridTree .icon {
+ cursor:default;
+ width:9px;
+ height:9px;
+ display:-moz-inline-block;
+}
+.gridTree .iconO {
+ background:url(../images/minus.gif) no-repeat -5px -6px;
+ cursor:default;
+ width:9px;
+ height:9px;
+ display:-moz-inline-block;
+ *position:relative;
+ *left:0px;
+ *top:2px;
+}
+.gridTree .iconC {
+ background:url(../images/plus.gif) no-repeat -5px -6px;
+ cursor:default;
+ width:9px;
+ height:9px;
+ display:-moz-inline-block;
+ *position:relative;
+ *left:0px;
+ *top:2px;
+}
+
+
+.gridTree .rowA {
+ background:#FAFAFA;
+}
+.gridTree .rowB {
+ background:#FFF;
+}
+.gridTree .rowC {
+ background:#FFF url(../images/lessGridRow.gif);
+}
+.gridTree .titleCB {
+ width:15px;
+ background-image:url(../images/lessGridRow.gif);
+ font:normal 12px Arial,ËÎÌå;
+ line-height:120%;
+ border:1px solid #B6B6B6;
+ cursor:default;
+}
+.gridTree .cb {
+ width:13px;
+ height:13px;
+}
+.gridTree .Ipt {
+ width:95%;
+ height:14px;
+ font:normal 12px Arial,ËÎÌå;
+ border:1px solid #FF6600;
+}
View
40 demo/core/GridTree/data/gridTree.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Response>
+ <GridTree>
+ <data>
+ <columns>
+ <column name="名称" col="name" align="left" empty="false" />
+ <column name="地址" col="addr" align="left" />
+ <column name="电话" col="tell" align="center" />
+ </columns>
+ <rows>
+ <row name="中软集团" addr="北京市昌平区北清路90号" tell="010-80778588">
+ <row name="中软融鑫" addr="北京市海淀区学院南路55号 中软大厦D座3层" tell="010-51527500">
+ <row name="IRD" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043" >
+ <row name="小黑" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043-1" />
+ </row>
+ </row>
+ <row name="中软国际" addr="北京市海淀区学院南路55号 中软大厦A座55层" tell="010-51526490" />
+ </row>
+ <row name="东亚银行" addr="中国香港" tell="xxxxx">
+ <row name="中软集团" addr="北京市昌平区北清路90号" tell="010-80778588">
+ <row name="中软融鑫" addr="北京市海淀区学院南路55号 中软大厦D座3层" tell="010-51527500">
+ <row name="IRD" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043" >
+ <row name="小黑" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043-1" >
+
+ <row name="中软融鑫" addr="北京市海淀区学院南路55号 中软大厦D座3层" tell="010-51527500">
+ <row name="IRD" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043" >
+ <row name="小黑" addr="北京市海淀区学院南路55号 中软大厦D座4层" tell="010-51527500-6043-1" />
+ </row>
+ </row>
+ <row name="中软国际" addr="北京市海淀区学院南路55号 中软大厦A座55层" tell="010-51526490" />
+ </row>
+ </row>
+ </row>
+ <row name="中软国际" addr="北京市海淀区学院南路55号 中软大厦A座55层" tell="010-51526490" />
+ </row>
+ </row>
+ </rows>
+ </data>
+ </GridTree>
+</Response>
View
73 demo/core/GridTree/example.htm
@@ -0,0 +1,73 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title> GridTree </title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="generator" content="editplus">
+ <meta name="author" content="">
+ <meta name="keywords" content="">
+ <meta name="description" content="">
+ <!-- ajax js 开始 -->
+ <script language="javascript" src="../ajax.js"></script>
+ <!-- ajax js 结束 -->
+
+ <!-- pulic Css 开始 -->
+ <link href="../public/css/pageInfo.css" type="text/css" rel="stylesheet" />
+ <!-- pulic Css 结束 -->
+
+ <!-- GridTree JS CSS 开始 -->
+ <script language="javascript" src="js/gridTree.js"></script>
+ <link href="css/gridTree.css" type="text/css" rel="stylesheet">
+ <!-- GridTree JS CSS 结束 -->
+ <script language="javascript">
+ <!--
+ var g = null;
+
+ function init(){
+ var p = new ajax();
+ //p.url = "data/gridTree.xml";
+ p.url = "../../service/gridTree.asp";
+ p.onresult = function(){
+ var data = this.data.selectSingleNode(".//GridTree");
+ buildGrid(data);
+ }
+ p.send();
+ }
+
+ function buildGrid(data){
+ g = new GridTree("gridTreeDiv");
+ g.hasCheckBox = true;
+ g.editable = true;
+ g.load(data);
+ }
+
+ function getSelectedNode(){
+ var nodes = g.getSelectedRows();
+ alert(nodes);
+ }
+ function getEditNode(){
+ var nodes = g.getEditRows();
+ alert(nodes);
+ }
+
+ window.onload = init;
+ //-->
+ </script>
+ <style type="text/css">
+ body {
+ background:#FFFFFF;
+ }
+ * {
+ font:normal 12px Arial,宋体;
+ }
+ </style>
+ </head>
+
+ <body scroll=no>
+ <div id="gridTreeDiv">
+ </div>
+
+ <input type=button value="取选择数据" onclick="getSelectedNode()" />
+ <input type=button value="取编辑数据" onclick="getEditNode()" />
+ </body>
+</html>
View
BIN  demo/core/GridTree/images/Thumbs.db
Binary file not shown
View
BIN  demo/core/GridTree/images/lessGridRow.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/GridTree/images/lessGridTitle.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/GridTree/images/loading_16x16.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/GridTree/images/minus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/GridTree/images/plus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
360 demo/core/GridTree/js/gridTree.js
@@ -0,0 +1,360 @@
+ /*
+ * 功 能 : 简单的GRIDTREE
+ * 作 者 : 史纯华
+ * 日 期 : 2009-7-22
+ */
+ function GridTree(render){
+ if(null == render) alert("实例化GridTree参数不正确.");
+ this.render = typeof(render) == "string" ? this.$(render) : render;
+ this.maxDepth = 0;
+ this.column = [];
+ this.render.className = "gridTree";
+ this.hasCheckBox = false;
+ this.editable = false;
+ //this.path = this.getPath();
+ //this.highlightImg = (new Image()).src = this.path + "images/lessGridRow.gif";
+ this.editRow = [];
+ }
+
+ GridTree.prototype.$ = function(id){
+ return document.getElementById(id);
+ }
+ GridTree.prototype.$C = function(tagName,attrObject){
+ var elm = window.document.createElement(tagName);
+ var spArr = ["innerHTML","className","cellSpacing","cellPadding","id","colSpan","rowSpan"];
+ if(null != attrObject && typeof(attrObject) == "object"){
+ for(var item in attrObject){
+ if(spArr.indexOf(item) != -1)
+ elm[item] = attrObject[item];
+ else
+ elm.setAttribute(item,attrObject[item]);
+ }
+ }
+ return elm;
+ }
+ GridTree.prototype.$A = function(elm,pElm){
+ return pElm ? pElm.appendChild(elm) : document.body.appendChild(elm);
+ }
+ GridTree.prototype.$R = function(elm,pElm){
+ return pElm ? pElm.removeChild(elm) : document.body.removeChild(elm);
+ }
+ GridTree.prototype.$T = function(tagName,pElm){
+ return pElm ? pElm.getElementsByTagName(tagName) : document.getElementsByTagName(tagName);
+ }
+ Array.prototype.indexOf = function(key){
+ var index = -1;
+ for(var i=0,iLen=this.length;i<iLen;i++){
+ if(this[i] == key){
+ index = i;
+ break;
+ }
+ }
+ return index;
+ }
+ GridTree.prototype.addEvent = function(elm,type,handler,useCapture){
+ try{
+ elm.attachEvent("on"+type,function(){handler();});
+ }catch(e){
+ try{
+ if(null == useCapture) useCapture = false;
+ elm.addEventListener(type,handler,useCapture);
+ }catch(e1){
+ elm["on"+type] = function(){
+ handler;
+ }
+ }
+ }
+ }
+ GridTree.prototype.fireEvent = function(elm,type,handler,useCapture){
+ try{
+ elm.detachEvent("on"+type,function(){handler;});
+ }catch(e){
+ try{
+ if(null == useCapture) useCapture = false;
+ elm.removeEventListener(type,handler,useCapture);
+ }catch(e1){
+ elm["on"+type] = function(){handler;}
+ }
+ }
+ }
+
+ GridTree.prototype.load = function(data){
+ this.data = data;
+ var oThis = this;
+ var rows = this.data.selectSingleNode(".//rows");
+ this.setUUID();
+ this.setDepth(rows,0);
+ this.buildTitle();
+ this.buildContent(rows,0);
+ this.setTitleWidth();
+ this.addEvent(this.table,"click",function(event){oThis.editCell(event);});
+ }
+ GridTree.prototype.setUUID = function(){
+ var nodes = this.data.selectNodes(".//row");
+ var nLen = nodes.length;
+ for(var i = 0 ; i < nLen ; i++)
+ nodes[i].setAttribute("_uuid",i);
+ }
+ GridTree.prototype.setDepth = function(curNode,depth){
+ this.maxDepth = this.maxDepth > depth ? this.maxDepth : depth;
+ depth = depth + 1;
+ var nodes = curNode.selectNodes("./row");
+ var nLen = nodes.length;
+ for(var i = 0 ; i < nLen ; i++){
+ var node = nodes[i];
+ node.setAttribute("_depth",depth);
+ this.setDepth(node,depth);
+ }
+ }
+
+ GridTree.prototype.buildTitle = function(){
+ var oThis = this;
+ var columns = this.data.selectNodes(".//column");
+ var cLen = columns.length;
+ if(cLen != 0){
+ this.table = this.$C("table",{className:"gridTree mainTable"});
+ this.tbody = this.$C("tbody");
+ this.$A(this.tbody,this.table);
+ this.$A(this.table,this.render);
+ var tr = this.$C("tr");
+ this.$A(tr,this.tbody);
+ }
+
+ for(var i=0;i<cLen;i++){
+ if(this.hasCheckBox && i == 0){
+ var cbTh = this.$C("th",{className:"gridTree titleCB"});
+ var cb = this.$C("input",{type:"checkBox",name:this.render.id+"_gridTree_box",className:"gridTree cb"});
+ this.$A(cb,cbTh);
+ this.addEvent(cb,"click",function(event){oThis.checkAll(event);});
+ this.$A(cbTh,tr);
+ }
+ var name = columns[i].getAttribute("name");
+ var col = columns[i].getAttribute("col");
+ var align = columns[i].getAttribute("align");
+ this.column.push({col:col,align:align});
+ var th = this.$C("th",{className:"gridTree title",innerHTML:name});
+ this.$A(th,tr);
+ }
+ }
+
+ GridTree.prototype.buildContent = function(row,x){
+ var rows = row.selectNodes("./row"),oThis = this;
+ var count = x;
+ for(var i=0,iLen=rows.length;i<iLen;i++){
+ var curRow = rows[i];
+ var uuid = curRow.getAttribute("_uuid");
+ var depth = curRow.getAttribute("_depth");
+ var tr = this.$C("tr",{gridRowID:uuid,id:this.render.id+"_gridTreeTR_"+uuid,className:count%2==0?"gridTreee rowA":"gridTreee rowB"});
+ this.$A(tr,this.tbody);
+ tr.onmouseover = function(){oThis.highlight(this,true);}
+ tr.onmouseout = function(){oThis.highlight(this,false);}
+
+ if(this.hasCheckBox){
+ var cbTd = this.$C("td",{className:"gridTreee contentCB"});
+ var cb = this.$C("input",{type:"checkBox",name:this.render.id+"_gridTree_box",className:"gridTree cb",_uuid:uuid});
+ this.$A(cb,cbTd);
+ this.$A(cbTd,tr);
+ cbTd.style.backgroundPosition = "0px -200px";
+ cbTd.style.backgroundRepeat = "repeat-x";
+ }
+ for(var j=0,jLen=this.column.length;j<jLen;j++){
+ var text = curRow.getAttribute(this.column[j].col);
+ var innerHTML = j == 0 ? "<table cellSpacing=0 cellPadding=0 width=100%>"
+ + "<tr>"
+ + "<td width=13 align=center>"
+ + "<div _uuid='"+uuid+"' id='"+this.render.id+"_gridTreeIconDiv_"+uuid+"' class='gridTree icon'>"
+ + "</div>"
+ + "</td>"
+ + "<td class='gridTreee contentTitleTD' _type='editTD' _uuid='"+uuid+"' _col='"+this.column[j].col+"'>"+text+"</td>"
+ + "</tr>"
+ + "</table>"
+ : text;
+ var td = this.$C("td",{
+ innerHTML:innerHTML,
+ className:"gridTreee contentTD",
+ _type: j==0 ? "" : "editTD",
+ _uuid:uuid,
+ _col:this.column[j].col
+ });
+ if(null != this.column[j].align)
+ td.style.textAlign = this.column[j].align;
+ this.$A(td,tr);
+
+
+ td.style.backgroundPosition = "0px -200px";
+ td.style.backgroundRepeat = "repeat-x";
+
+ if(j == 0){
+ td.style.paddingLeft = (depth - 1) * 15 + "px";
+ td.style.textAlign = "left";
+ if(curRow.selectSingleNode(".//row") != null){
+ var div = this.$(this.render.id+"_gridTreeIconDiv_"+uuid);
+ div.className = "gridTree iconO";
+ this.addEvent(div,"click",function(event){oThis.resize(event);});
+ }
+ }
+ }
+ count ++;
+ this.buildContent(curRow,count);
+ }
+ }
+
+ GridTree.prototype.resize = function(evt){
+ var e = evt ? evt : window.event;
+ var elm = e.srcElement || e.target;
+ var uuid = elm.getAttribute("_uuid");
+ if(elm.getAttribute("_closed") != "true"){
+ elm.className = "gridTree iconC";
+ elm.setAttribute("_closed","true");
+ }else{
+ elm.className = "gridTree iconO";
+ elm.setAttribute("_closed","false");
+ }
+ var curRow = this.data.selectSingleNode(".//row[@_uuid='"+uuid+"']");
+ var rows = curRow.selectNodes(".//row");
+ for(var i=0,iLen=rows.length;i<iLen;i++){
+ var row = rows[i];
+ var curUUID = row.getAttribute("_uuid");
+ var tr = this.$(this.render.id+"_gridTreeTR_"+curUUID);
+ if(elm.getAttribute("_closed") != "true"){
+ if(this.getParentsCloseStatus(row)){
+ tr.style.display = "";
+ }else{
+ tr.style.display = "none";
+ }
+ }else{
+ tr.style.display = "none";
+ }
+ }
+ }
+ GridTree.prototype.getParentsCloseStatus = function(row){
+ var canShow = true;
+ var pRow = row.parentNode;
+ while(null != pRow && pRow.nodeName == "row"){
+ var pUUID = pRow.getAttribute("_uuid");
+ var pDiv = this.$(this.render.id+"_gridTreeIconDiv_"+pUUID);
+ if(pDiv.getAttribute("_closed") != "true"){
+ canShow = true;
+ }else{
+ canShow = false;
+ break;
+ }
+ pRow = pRow.parentNode;
+ }
+ return canShow;
+ }
+
+ GridTree.prototype.getPath = function(){
+ var path = "";
+ var scripts = this.$T("script");
+ for(var i=0,iLen=scripts.length;i<iLen;i++){
+ var src = scripts[i].src;
+ if(src.indexOf("gridTree.js") != -1){
+ path = src.substring(0,src.indexOf("js/gridTree.js"));
+ }
+ }
+ return path;
+ }
+
+ GridTree.prototype.highlight = function(elm,isHighlight){
+ /*
+ if(isHighlight){
+ var eCls = elm.className;
+ if(null != this.highlightTR)
+ this.highlightTR.className = this.oldCls;
+ this.highlightTR = elm;
+ elm.className = "gridTree rowC";
+ this.oldCls = eCls;
+ }else{
+ this.highlightTR.className = this.oldCls;
+ }
+ */
+
+ var tds = elm.getElementsByTagName("td");
+ for(var j=0,jLen=tds.length;j<jLen;j++){
+ tds[j].style.backgroundPosition = isHighlight ? "0px 0px" : "0px -200px";
+ }
+ }
+
+ GridTree.prototype.setTitleWidth = function(){
+ var oThis = this;
+ var ths = this.$T("th",this.$T("tr",this.table)[0]);
+ for(var i=0,iLen=ths.length;i<iLen;i++){
+ var w = ths[i].offsetWidth;
+ ths[i].style.width = w + "px";
+ }
+ }
+
+ GridTree.prototype.checkAll = function(evt){
+ var e = evt ? evt : window.event;
+ var elm = e.srcElement || e.target;
+ var ipts = this.$T("input",this.table);
+ for(var i=0,iLen=ipts.length;i<iLen;i++){
+ if(ipts[i].name == this.render.id + "_gridTree_box"){
+ ipts[i].checked = elm.checked;
+ }
+ }
+ }
+
+ GridTree.prototype.getSelectedRows = function(){
+ var arr = [];
+ var ipts = this.$T("input",this.table);
+ for(var i=0,iLen=ipts.length;i<iLen;i++){
+ if(ipts[i].name == this.render.id + "_gridTree_box" && ipts[i].checked){
+ var uuid = ipts[i].getAttribute("_uuid");
+ var node = this.data.selectSingleNode(".//row[@_uuid='"+uuid+"']");
+ arr.push(node);
+ }
+ }
+ return arr;
+ }
+
+ GridTree.prototype.editCell = function(evt){
+ if(!this.editable){return;}
+ var oThis = this;
+ var e = evt ? evt : window.event;
+ var elm = e.srcElement || e.target;
+ if(elm.tagName.toUpperCase() == "TD" && elm.getAttribute("_type") == "editTD"){
+ var uuid = elm.getAttribute("_uuid");
+ var col = elm.getAttribute("_col");
+ var text = elm.innerText || elm.textContent;
+ elm.innerHTML =