xheditor 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. data/Gemfile +13 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.rdoc +19 -0
  4. data/Rakefile +55 -0
  5. data/assets/xheditor/xheditor-en.min.js +109 -0
  6. data/assets/xheditor/xheditor-zh-cn.min.js +112 -0
  7. data/assets/xheditor/xheditor-zh-tw.min.js +112 -0
  8. data/assets/xheditor/xheditor.js +0 -0
  9. data/assets/xheditor/xheditor_emot/default/angry.gif +0 -0
  10. data/assets/xheditor/xheditor_emot/default/awkward.gif +0 -0
  11. data/assets/xheditor/xheditor_emot/default/bye.gif +0 -0
  12. data/assets/xheditor/xheditor_emot/default/config.txt +1 -0
  13. data/assets/xheditor/xheditor_emot/default/crazy.gif +0 -0
  14. data/assets/xheditor/xheditor_emot/default/cry.gif +0 -0
  15. data/assets/xheditor/xheditor_emot/default/curse.gif +0 -0
  16. data/assets/xheditor/xheditor_emot/default/cute.gif +0 -0
  17. data/assets/xheditor/xheditor_emot/default/despise.gif +0 -0
  18. data/assets/xheditor/xheditor_emot/default/doubt.gif +0 -0
  19. data/assets/xheditor/xheditor_emot/default/envy.gif +0 -0
  20. data/assets/xheditor/xheditor_emot/default/fastcry.gif +0 -0
  21. data/assets/xheditor/xheditor_emot/default/knock.gif +0 -0
  22. data/assets/xheditor/xheditor_emot/default/laugh.gif +0 -0
  23. data/assets/xheditor/xheditor_emot/default/mad.gif +0 -0
  24. data/assets/xheditor/xheditor_emot/default/ohmy.gif +0 -0
  25. data/assets/xheditor/xheditor_emot/default/panic.gif +0 -0
  26. data/assets/xheditor/xheditor_emot/default/proud.gif +0 -0
  27. data/assets/xheditor/xheditor_emot/default/quiet.gif +0 -0
  28. data/assets/xheditor/xheditor_emot/default/sad.gif +0 -0
  29. data/assets/xheditor/xheditor_emot/default/shutup.gif +0 -0
  30. data/assets/xheditor/xheditor_emot/default/shy.gif +0 -0
  31. data/assets/xheditor/xheditor_emot/default/sleep.gif +0 -0
  32. data/assets/xheditor/xheditor_emot/default/smile.gif +0 -0
  33. data/assets/xheditor/xheditor_emot/default/struggle.gif +0 -0
  34. data/assets/xheditor/xheditor_emot/default/titter.gif +0 -0
  35. data/assets/xheditor/xheditor_emot/default/tongue.gif +0 -0
  36. data/assets/xheditor/xheditor_emot/default/wail.gif +0 -0
  37. data/assets/xheditor/xheditor_emot/default/wronged.gif +0 -0
  38. data/assets/xheditor/xheditor_emot/ipb/alien.gif +0 -0
  39. data/assets/xheditor/xheditor_emot/ipb/angel.gif +0 -0
  40. data/assets/xheditor/xheditor_emot/ipb/angry.gif +0 -0
  41. data/assets/xheditor/xheditor_emot/ipb/bandit.gif +0 -0
  42. data/assets/xheditor/xheditor_emot/ipb/biglaugh.gif +0 -0
  43. data/assets/xheditor/xheditor_emot/ipb/blink.gif +0 -0
  44. data/assets/xheditor/xheditor_emot/ipb/blush.gif +0 -0
  45. data/assets/xheditor/xheditor_emot/ipb/config.txt +1 -0
  46. data/assets/xheditor/xheditor_emot/ipb/cool.gif +0 -0
  47. data/assets/xheditor/xheditor_emot/ipb/cry.gif +0 -0
  48. data/assets/xheditor/xheditor_emot/ipb/depres.gif +0 -0
  49. data/assets/xheditor/xheditor_emot/ipb/devil.gif +0 -0
  50. data/assets/xheditor/xheditor_emot/ipb/glare.gif +0 -0
  51. data/assets/xheditor/xheditor_emot/ipb/heart.gif +0 -0
  52. data/assets/xheditor/xheditor_emot/ipb/joyful.gif +0 -0
  53. data/assets/xheditor/xheditor_emot/ipb/kiss.gif +0 -0
  54. data/assets/xheditor/xheditor_emot/ipb/laugh.gif +0 -0
  55. data/assets/xheditor/xheditor_emot/ipb/magician.gif +0 -0
  56. data/assets/xheditor/xheditor_emot/ipb/ninja.gif +0 -0
  57. data/assets/xheditor/xheditor_emot/ipb/pinch.gif +0 -0
  58. data/assets/xheditor/xheditor_emot/ipb/police.gif +0 -0
  59. data/assets/xheditor/xheditor_emot/ipb/sad.gif +0 -0
  60. data/assets/xheditor/xheditor_emot/ipb/sick.gif +0 -0
  61. data/assets/xheditor/xheditor_emot/ipb/sideways.gif +0 -0
  62. data/assets/xheditor/xheditor_emot/ipb/sleep.gif +0 -0
  63. data/assets/xheditor/xheditor_emot/ipb/smile.gif +0 -0
  64. data/assets/xheditor/xheditor_emot/ipb/surprised.gif +0 -0
  65. data/assets/xheditor/xheditor_emot/ipb/tongue.gif +0 -0
  66. data/assets/xheditor/xheditor_emot/ipb/unsure.gif +0 -0
  67. data/assets/xheditor/xheditor_emot/ipb/w00t.gif +0 -0
  68. data/assets/xheditor/xheditor_emot/ipb/whistling.gif +0 -0
  69. data/assets/xheditor/xheditor_emot/ipb/wondering.gif +0 -0
  70. data/assets/xheditor/xheditor_emot/ipb/wub.gif +0 -0
  71. data/assets/xheditor/xheditor_emot/msn/1.gif +0 -0
  72. data/assets/xheditor/xheditor_emot/msn/10.gif +0 -0
  73. data/assets/xheditor/xheditor_emot/msn/11.gif +0 -0
  74. data/assets/xheditor/xheditor_emot/msn/12.gif +0 -0
  75. data/assets/xheditor/xheditor_emot/msn/13.gif +0 -0
  76. data/assets/xheditor/xheditor_emot/msn/14.gif +0 -0
  77. data/assets/xheditor/xheditor_emot/msn/15.gif +0 -0
  78. data/assets/xheditor/xheditor_emot/msn/16.gif +0 -0
  79. data/assets/xheditor/xheditor_emot/msn/17.gif +0 -0
  80. data/assets/xheditor/xheditor_emot/msn/18.gif +0 -0
  81. data/assets/xheditor/xheditor_emot/msn/19.gif +0 -0
  82. data/assets/xheditor/xheditor_emot/msn/2.gif +0 -0
  83. data/assets/xheditor/xheditor_emot/msn/20.gif +0 -0
  84. data/assets/xheditor/xheditor_emot/msn/21.gif +0 -0
  85. data/assets/xheditor/xheditor_emot/msn/22.gif +0 -0
  86. data/assets/xheditor/xheditor_emot/msn/23.gif +0 -0
  87. data/assets/xheditor/xheditor_emot/msn/24.gif +0 -0
  88. data/assets/xheditor/xheditor_emot/msn/25.gif +0 -0
  89. data/assets/xheditor/xheditor_emot/msn/26.gif +0 -0
  90. data/assets/xheditor/xheditor_emot/msn/27.gif +0 -0
  91. data/assets/xheditor/xheditor_emot/msn/28.gif +0 -0
  92. data/assets/xheditor/xheditor_emot/msn/29.gif +0 -0
  93. data/assets/xheditor/xheditor_emot/msn/3.gif +0 -0
  94. data/assets/xheditor/xheditor_emot/msn/30.gif +0 -0
  95. data/assets/xheditor/xheditor_emot/msn/31.gif +0 -0
  96. data/assets/xheditor/xheditor_emot/msn/32.gif +0 -0
  97. data/assets/xheditor/xheditor_emot/msn/33.gif +0 -0
  98. data/assets/xheditor/xheditor_emot/msn/34.gif +0 -0
  99. data/assets/xheditor/xheditor_emot/msn/35.gif +0 -0
  100. data/assets/xheditor/xheditor_emot/msn/36.gif +0 -0
  101. data/assets/xheditor/xheditor_emot/msn/37.gif +0 -0
  102. data/assets/xheditor/xheditor_emot/msn/38.gif +0 -0
  103. data/assets/xheditor/xheditor_emot/msn/39.gif +0 -0
  104. data/assets/xheditor/xheditor_emot/msn/4.gif +0 -0
  105. data/assets/xheditor/xheditor_emot/msn/40.gif +0 -0
  106. data/assets/xheditor/xheditor_emot/msn/5.gif +0 -0
  107. data/assets/xheditor/xheditor_emot/msn/6.gif +0 -0
  108. data/assets/xheditor/xheditor_emot/msn/7.gif +0 -0
  109. data/assets/xheditor/xheditor_emot/msn/8.gif +0 -0
  110. data/assets/xheditor/xheditor_emot/msn/9.gif +0 -0
  111. data/assets/xheditor/xheditor_emot/pidgin/angry.gif +0 -0
  112. data/assets/xheditor/xheditor_emot/pidgin/bad.gif +0 -0
  113. data/assets/xheditor/xheditor_emot/pidgin/blush.gif +0 -0
  114. data/assets/xheditor/xheditor_emot/pidgin/brokenheart.gif +0 -0
  115. data/assets/xheditor/xheditor_emot/pidgin/bye.gif +0 -0
  116. data/assets/xheditor/xheditor_emot/pidgin/coffee.gif +0 -0
  117. data/assets/xheditor/xheditor_emot/pidgin/config.txt +1 -0
  118. data/assets/xheditor/xheditor_emot/pidgin/cool.gif +0 -0
  119. data/assets/xheditor/xheditor_emot/pidgin/cry.gif +0 -0
  120. data/assets/xheditor/xheditor_emot/pidgin/curse.gif +0 -0
  121. data/assets/xheditor/xheditor_emot/pidgin/cute.gif +0 -0
  122. data/assets/xheditor/xheditor_emot/pidgin/devil.gif +0 -0
  123. data/assets/xheditor/xheditor_emot/pidgin/envy.gif +0 -0
  124. data/assets/xheditor/xheditor_emot/pidgin/gift.gif +0 -0
  125. data/assets/xheditor/xheditor_emot/pidgin/good.gif +0 -0
  126. data/assets/xheditor/xheditor_emot/pidgin/kiss.gif +0 -0
  127. data/assets/xheditor/xheditor_emot/pidgin/laugh.gif +0 -0
  128. data/assets/xheditor/xheditor_emot/pidgin/love.gif +0 -0
  129. data/assets/xheditor/xheditor_emot/pidgin/music.gif +0 -0
  130. data/assets/xheditor/xheditor_emot/pidgin/question.gif +0 -0
  131. data/assets/xheditor/xheditor_emot/pidgin/rose.gif +0 -0
  132. data/assets/xheditor/xheditor_emot/pidgin/sad.gif +0 -0
  133. data/assets/xheditor/xheditor_emot/pidgin/shocked.gif +0 -0
  134. data/assets/xheditor/xheditor_emot/pidgin/shout.gif +0 -0
  135. data/assets/xheditor/xheditor_emot/pidgin/sick.gif +0 -0
  136. data/assets/xheditor/xheditor_emot/pidgin/sleepy.gif +0 -0
  137. data/assets/xheditor/xheditor_emot/pidgin/smile.gif +0 -0
  138. data/assets/xheditor/xheditor_emot/pidgin/soccer.gif +0 -0
  139. data/assets/xheditor/xheditor_emot/pidgin/sweat.gif +0 -0
  140. data/assets/xheditor/xheditor_emot/pidgin/tired.gif +0 -0
  141. data/assets/xheditor/xheditor_emot/pidgin/tongue.gif +0 -0
  142. data/assets/xheditor/xheditor_emot/pidgin/victory.gif +0 -0
  143. data/assets/xheditor/xheditor_emot/pidgin/wink.gif +0 -0
  144. data/assets/xheditor/xheditor_plugins/multiupload/img/add.gif +0 -0
  145. data/assets/xheditor/xheditor_plugins/multiupload/img/bg1.gif +0 -0
  146. data/assets/xheditor/xheditor_plugins/multiupload/img/bg2.gif +0 -0
  147. data/assets/xheditor/xheditor_plugins/multiupload/img/btnbg.gif +0 -0
  148. data/assets/xheditor/xheditor_plugins/multiupload/img/btnbgr.gif +0 -0
  149. data/assets/xheditor/xheditor_plugins/multiupload/img/clear.gif +0 -0
  150. data/assets/xheditor/xheditor_plugins/multiupload/img/progressbg.gif +0 -0
  151. data/assets/xheditor/xheditor_plugins/multiupload/img/start.gif +0 -0
  152. data/assets/xheditor/xheditor_plugins/multiupload/multiupload.css +61 -0
  153. data/assets/xheditor/xheditor_plugins/multiupload/multiupload.html +120 -0
  154. data/assets/xheditor/xheditor_plugins/multiupload/multiupload.js +125 -0
  155. data/assets/xheditor/xheditor_plugins/multiupload/swfupload/swfupload.js +980 -0
  156. data/assets/xheditor/xheditor_plugins/multiupload/swfupload/swfupload.swf +0 -0
  157. data/assets/xheditor/xheditor_plugins/ubb.min.js +20 -0
  158. data/assets/xheditor/xheditor_skin/default/iframe.css +29 -0
  159. data/assets/xheditor/xheditor_skin/default/img/anchor.gif +0 -0
  160. data/assets/xheditor/xheditor_skin/default/img/close.gif +0 -0
  161. data/assets/xheditor/xheditor_skin/default/img/flash.gif +0 -0
  162. data/assets/xheditor/xheditor_skin/default/img/icons.gif +0 -0
  163. data/assets/xheditor/xheditor_skin/default/img/loading.gif +0 -0
  164. data/assets/xheditor/xheditor_skin/default/img/progress.gif +0 -0
  165. data/assets/xheditor/xheditor_skin/default/img/progressbg.gif +0 -0
  166. data/assets/xheditor/xheditor_skin/default/img/tag-address.gif +0 -0
  167. data/assets/xheditor/xheditor_skin/default/img/tag-div.gif +0 -0
  168. data/assets/xheditor/xheditor_skin/default/img/tag-h1.gif +0 -0
  169. data/assets/xheditor/xheditor_skin/default/img/tag-h2.gif +0 -0
  170. data/assets/xheditor/xheditor_skin/default/img/tag-h3.gif +0 -0
  171. data/assets/xheditor/xheditor_skin/default/img/tag-h4.gif +0 -0
  172. data/assets/xheditor/xheditor_skin/default/img/tag-h5.gif +0 -0
  173. data/assets/xheditor/xheditor_skin/default/img/tag-h6.gif +0 -0
  174. data/assets/xheditor/xheditor_skin/default/img/tag-p.gif +0 -0
  175. data/assets/xheditor/xheditor_skin/default/img/tag-pre.gif +0 -0
  176. data/assets/xheditor/xheditor_skin/default/img/waiting.gif +0 -0
  177. data/assets/xheditor/xheditor_skin/default/img/wmp.gif +0 -0
  178. data/assets/xheditor/xheditor_skin/default/ui.css +140 -0
  179. data/assets/xheditor/xheditor_skin/nostyle/iframe.css +29 -0
  180. data/assets/xheditor/xheditor_skin/nostyle/img/anchor.gif +0 -0
  181. data/assets/xheditor/xheditor_skin/nostyle/img/close.gif +0 -0
  182. data/assets/xheditor/xheditor_skin/nostyle/img/flash.gif +0 -0
  183. data/assets/xheditor/xheditor_skin/nostyle/img/icons.gif +0 -0
  184. data/assets/xheditor/xheditor_skin/nostyle/img/loading.gif +0 -0
  185. data/assets/xheditor/xheditor_skin/nostyle/img/progress.gif +0 -0
  186. data/assets/xheditor/xheditor_skin/nostyle/img/progressbg.gif +0 -0
  187. data/assets/xheditor/xheditor_skin/nostyle/img/tag-address.gif +0 -0
  188. data/assets/xheditor/xheditor_skin/nostyle/img/tag-div.gif +0 -0
  189. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h1.gif +0 -0
  190. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h2.gif +0 -0
  191. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h3.gif +0 -0
  192. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h4.gif +0 -0
  193. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h5.gif +0 -0
  194. data/assets/xheditor/xheditor_skin/nostyle/img/tag-h6.gif +0 -0
  195. data/assets/xheditor/xheditor_skin/nostyle/img/tag-p.gif +0 -0
  196. data/assets/xheditor/xheditor_skin/nostyle/img/tag-pre.gif +0 -0
  197. data/assets/xheditor/xheditor_skin/nostyle/img/waiting.gif +0 -0
  198. data/assets/xheditor/xheditor_skin/nostyle/img/wmp.gif +0 -0
  199. data/assets/xheditor/xheditor_skin/nostyle/ui.css +140 -0
  200. data/assets/xheditor/xheditor_skin/o2007blue/iframe.css +29 -0
  201. data/assets/xheditor/xheditor_skin/o2007blue/img/anchor.gif +0 -0
  202. data/assets/xheditor/xheditor_skin/o2007blue/img/buttonbg.gif +0 -0
  203. data/assets/xheditor/xheditor_skin/o2007blue/img/close.gif +0 -0
  204. data/assets/xheditor/xheditor_skin/o2007blue/img/flash.gif +0 -0
  205. data/assets/xheditor/xheditor_skin/o2007blue/img/icons.gif +0 -0
  206. data/assets/xheditor/xheditor_skin/o2007blue/img/loading.gif +0 -0
  207. data/assets/xheditor/xheditor_skin/o2007blue/img/progress.gif +0 -0
  208. data/assets/xheditor/xheditor_skin/o2007blue/img/progressbg.gif +0 -0
  209. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-address.gif +0 -0
  210. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-div.gif +0 -0
  211. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h1.gif +0 -0
  212. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h2.gif +0 -0
  213. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h3.gif +0 -0
  214. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h4.gif +0 -0
  215. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h5.gif +0 -0
  216. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-h6.gif +0 -0
  217. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-p.gif +0 -0
  218. data/assets/xheditor/xheditor_skin/o2007blue/img/tag-pre.gif +0 -0
  219. data/assets/xheditor/xheditor_skin/o2007blue/img/waiting.gif +0 -0
  220. data/assets/xheditor/xheditor_skin/o2007blue/img/wmp.gif +0 -0
  221. data/assets/xheditor/xheditor_skin/o2007blue/ui.css +139 -0
  222. data/assets/xheditor/xheditor_skin/o2007silver/iframe.css +29 -0
  223. data/assets/xheditor/xheditor_skin/o2007silver/img/anchor.gif +0 -0
  224. data/assets/xheditor/xheditor_skin/o2007silver/img/buttonbg.gif +0 -0
  225. data/assets/xheditor/xheditor_skin/o2007silver/img/close.gif +0 -0
  226. data/assets/xheditor/xheditor_skin/o2007silver/img/flash.gif +0 -0
  227. data/assets/xheditor/xheditor_skin/o2007silver/img/icons.gif +0 -0
  228. data/assets/xheditor/xheditor_skin/o2007silver/img/loading.gif +0 -0
  229. data/assets/xheditor/xheditor_skin/o2007silver/img/progress.gif +0 -0
  230. data/assets/xheditor/xheditor_skin/o2007silver/img/progressbg.gif +0 -0
  231. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-address.gif +0 -0
  232. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-div.gif +0 -0
  233. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h1.gif +0 -0
  234. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h2.gif +0 -0
  235. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h3.gif +0 -0
  236. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h4.gif +0 -0
  237. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h5.gif +0 -0
  238. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-h6.gif +0 -0
  239. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-p.gif +0 -0
  240. data/assets/xheditor/xheditor_skin/o2007silver/img/tag-pre.gif +0 -0
  241. data/assets/xheditor/xheditor_skin/o2007silver/img/waiting.gif +0 -0
  242. data/assets/xheditor/xheditor_skin/o2007silver/img/wmp.gif +0 -0
  243. data/assets/xheditor/xheditor_skin/o2007silver/ui.css +139 -0
  244. data/assets/xheditor/xheditor_skin/vista/iframe.css +29 -0
  245. data/assets/xheditor/xheditor_skin/vista/img/anchor.gif +0 -0
  246. data/assets/xheditor/xheditor_skin/vista/img/buttonbg.gif +0 -0
  247. data/assets/xheditor/xheditor_skin/vista/img/close.gif +0 -0
  248. data/assets/xheditor/xheditor_skin/vista/img/flash.gif +0 -0
  249. data/assets/xheditor/xheditor_skin/vista/img/icons.gif +0 -0
  250. data/assets/xheditor/xheditor_skin/vista/img/loading.gif +0 -0
  251. data/assets/xheditor/xheditor_skin/vista/img/progress.gif +0 -0
  252. data/assets/xheditor/xheditor_skin/vista/img/progressbg.gif +0 -0
  253. data/assets/xheditor/xheditor_skin/vista/img/tag-address.gif +0 -0
  254. data/assets/xheditor/xheditor_skin/vista/img/tag-div.gif +0 -0
  255. data/assets/xheditor/xheditor_skin/vista/img/tag-h1.gif +0 -0
  256. data/assets/xheditor/xheditor_skin/vista/img/tag-h2.gif +0 -0
  257. data/assets/xheditor/xheditor_skin/vista/img/tag-h3.gif +0 -0
  258. data/assets/xheditor/xheditor_skin/vista/img/tag-h4.gif +0 -0
  259. data/assets/xheditor/xheditor_skin/vista/img/tag-h5.gif +0 -0
  260. data/assets/xheditor/xheditor_skin/vista/img/tag-h6.gif +0 -0
  261. data/assets/xheditor/xheditor_skin/vista/img/tag-p.gif +0 -0
  262. data/assets/xheditor/xheditor_skin/vista/img/tag-pre.gif +0 -0
  263. data/assets/xheditor/xheditor_skin/vista/img/titlebg.gif +0 -0
  264. data/assets/xheditor/xheditor_skin/vista/img/waiting.gif +0 -0
  265. data/assets/xheditor/xheditor_skin/vista/img/wmp.gif +0 -0
  266. data/assets/xheditor/xheditor_skin/vista/ui.css +140 -0
  267. data/lib/xheditor.rb +17 -0
  268. data/lib/xheditor/railtie.rb +10 -0
  269. data/lib/xheditor/version.rb +4 -0
  270. data/test/helper.rb +18 -0
  271. data/test/test_xheditor.rb +4 -0
  272. metadata +365 -0
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.6.4"
12
+ gem "rcov", ">= 0"
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 zires
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = xheditor
2
+
3
+ gem wrap for xheditor http://xheditor.com/.
4
+
5
+ == Contributing to xheditor
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 zires. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.version = "0.1.0"
18
+ gem.name = "xheditor"
19
+ gem.homepage = "http://github.com/zires/xheditor"
20
+ gem.license = "MIT"
21
+ gem.summary = %Q{xheditor for rails3}
22
+ gem.description = %Q{xheditor is a online html editor}
23
+ gem.email = "zshuaibin@gmail.com"
24
+ gem.authors = ["zires"]
25
+ gem.files = FileList["Gemfile","LICENSE.txt","Rakefile","README.rdoc","{assets,lib,test}/**/*"]
26
+ # dependencies defined in Gemfile
27
+ end
28
+ Jeweler::RubygemsDotOrgTasks.new
29
+
30
+ require 'rake/testtask'
31
+ Rake::TestTask.new(:test) do |test|
32
+ test.libs << 'lib' << 'test'
33
+ test.pattern = 'test/**/test_*.rb'
34
+ test.verbose = true
35
+ end
36
+
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/test_*.rb'
41
+ test.verbose = true
42
+ test.rcov_opts << '--exclude "gems/*"'
43
+ end
44
+
45
+ task :default => :test
46
+
47
+ require 'rake/rdoctask'
48
+ Rake::RDocTask.new do |rdoc|
49
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
+
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "xheditor #{version}"
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ end
@@ -0,0 +1,109 @@
1
+ (function(e,ha){if(window.xheditor)return false;var xb=navigator.userAgent.toLowerCase().indexOf("mobile")>-1,qa=e.browser,Ca=parseFloat(qa.version),y=qa.msie,Da=qa.mozilla,Y=qa.safari,eb=qa.opera;e.fn.xheditor=function(B){if(xb)return false;var A=[];this.each(function(){if(e.nodeName(this,"TEXTAREA"))if(B===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(this.xheditor)A.push(this.xheditor);else{var J=/({.*})/.exec(e(this).attr("class"));if(J){try{J=eval("("+J[1]+")")}catch(Qa){}B=
2
+ e.extend({},J,B)}J=new Ea(this,B);if(J.init()){this.xheditor=J;A.push(J)}}});if(A.length===0)A=false;if(A.length===1)A=A[0];return A};var ia=0,Z=false,Fa=true,Ga=false,fb=false,L,ra,sa,ja,S,Ra,ka,Sa,Ta,Ua,T;e("script[src*=xheditor]").each(function(){var B=this.src;if(B.match(/xheditor[^\/]*\.js/i)){T=B.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});if(y)try{document.execCommand("BackgroundImageCache",false,true)}catch(Kb){}var yb={27:"esc",9:"tab",32:"space",13:"enter",8:"backspace",
3
+ 145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},gb=["#FFFFFF","#CCCCCC","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66",
4
+ "#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#99FF99","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],zb=[{n:"p",t:"Paragraph"},{n:"h1",
5
+ t:"Heading 1"},{n:"h2",t:"Heading 2"},{n:"h3",t:"Heading 3"},{n:"h4",t:"Heading 4"},{n:"h5",t:"Heading 5"},{n:"h6",t:"Heading 6"},{n:"pre",t:"Preformatted"},{n:"address",t:"Address"}],Ab=[{n:"Arial"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"},{n:"System"},{n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],$=[{n:"x-small",s:"10px",t:"1"},{n:"small",s:"13px",t:"2"},{n:"medium",s:"16px",t:"3"},{n:"large",s:"18px",t:"4"},{n:"x-large",s:"24px",t:"5"},{n:"xx-large",s:"32px",t:"6"},{n:"-webkit-xxx-large",
6
+ s:"48px",t:"7"}],Bb=[{s:"Align left",v:"justifyleft"},{s:"Align center",v:"justifycenter"},{s:"Align right",v:"justifyright"},{s:"Align full",v:"justifyfull"}],Cb=[{s:"Ordered list",v:"insertOrderedList"},{s:"Unordered list",v:"insertUnorderedList"}],Db={"default":{name:"Default",width:24,height:24,line:7,list:{smile:"Smile",tongue:"Tongue",titter:"Titter",laugh:"Laugh",sad:"Sad",wronged:"Wronged",fastcry:"Fast cry",cry:"Cry",wail:"Wail",mad:"Mad",knock:"Knock",curse:"Curse",crazy:"Crazy",angry:"Angry",
7
+ ohmy:"Oh my",awkward:"Awkward",panic:"Panic",shy:"Shy",cute:"Cute",envy:"Envy",proud:"Proud",struggle:"Struggle",quiet:"Quiet",shutup:"Shut up",doubt:"Doubt",despise:"Despise",sleep:"Sleep",bye:"Bye"}}},ta={Cut:{t:"Cut (Ctrl+X)"},Copy:{t:"Copy (Ctrl+C)"},Paste:{t:"Paste (Ctrl+V)"},Pastetext:{t:"Paste as plain text",h:y?0:1},Blocktag:{t:"Block tag",h:1},Fontface:{t:"Font family",h:1},FontSize:{t:"Font size",h:1},Bold:{t:"Bold (Ctrl+B)",s:"Ctrl+B"},Italic:{t:"Italic (Ctrl+I)",s:"Ctrl+I"},Underline:{t:"Underline (Ctrl+U)",
8
+ s:"Ctrl+U"},Strikethrough:{t:"Strikethrough"},FontColor:{t:"Select text color",h:1},BackColor:{t:"Select background color",h:1},SelectAll:{t:"SelectAll (Ctrl+A)"},Removeformat:{t:"Remove formatting"},Align:{t:"Align",h:1},List:{t:"List",h:1},Outdent:{t:"Outdent"},Indent:{t:"Indent"},Link:{t:"Insert/edit link (Ctrl+L)",s:"Ctrl+L",h:1},Unlink:{t:"Unlink"},Anchor:{t:"Anchor",h:1},Img:{t:"Insert/edit image",h:1},Flash:{t:"Insert/edit flash",h:1},Media:{t:"Insert/edit media",h:1},Hr:{t:"Horizontal rule"},
9
+ Emot:{t:"Emotions",s:"ctrl+e",h:1},Table:{t:"Insert a new table",h:1},Source:{t:"Edit source code"},Preview:{t:"Preview"},Print:{t:"Print (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"Toggle fullscreen (Esc)",s:"Esc"},About:{t:"About xhEditor"}},Va={mini:"Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Link,Img,Emot",full:"Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen"};
10
+ Va.mfull=Va.full.replace(/\|(,Align)/i,"/$1");var Eb={a:"Link",img:"Img",embed:"Embed"},Fb={"<":"&lt;",">":"&gt;",'"':"&quot;","\u00ae":"&reg;","\u00a9":"&copy;"},Gb=/[<>"\u00ae\u00a9]/g,Ea=function(B,A){function J(a){a=a.target;var b=Eb[a.tagName.toLowerCase()];if(b){if(b==="Embed")b={"application/x-shockwave-flash":"Flash","application/x-mplayer2":"Media"}[a.type.toLowerCase()];d.exec(b)}}function Qa(a){if(a.which===27){if(Ga)d.removeModal();else Z&&d.hidePanel();return false}}function hb(){setTimeout(d.setSource,
11
+ 10)}function aa(){d.getSource()}function ib(a){var b,c,g;if(a&&(b=a.originalEvent.clipboardData)&&(c=b.items)&&(g=c[0])&&g.kind=="file"&&g.type.match(/^image\//i)){a=g.getAsFile();b=new FileReader;b.onload=function(){var j='<img src="'+event.target.result+'">';j=jb(j);d.pasteHTML(j)};b.readAsDataURL(a);return false}var n=p.cleanPaste;if(n===0||F||Wa)return true;Wa=true;d.saveBookmark();b=y?"pre":"div";var m=e("<"+b+' class="xhe-paste">\ufeff\ufeff</'+b+">",v).appendTo(v.body);b=m[0];c=d.getSel();
12
+ g=d.getRng(true);m.css("top",ba.scrollTop());if(y){g.moveToElementText(b);g.select();g.execCommand("Paste");if(b.innerHTML=="\ufeff\ufeff"){m.remove();return}a.preventDefault()}else{g.selectNodeContents(b);c.removeAllRanges();c.addRange(g)}setTimeout(function(){var j=n===3,i;if(j)i=m.text();else{var l=[];e(".xhe-paste",v.body).each(function(f,h){e(h).find(".xhe-paste").length==0&&l.push(h.innerHTML)});i=l.join("<br />")}m.remove();d.loadBookmark();if(j)d.pasteText(i);else{i=d.cleanHTML(i);i=d.cleanWord(i);
13
+ i=d.formatXHTML(i);if(!p.onPaste||p.onPaste&&(i=p.onPaste(i))!==false){i=jb(i);d.pasteHTML(i)}}Wa=false},0)}function jb(a){var b=p.localUrlTest,c=p.remoteImgSaveUrl;if(b&&c){var g=[],n=0;a=a.replace(/(<img)((?:\s+[^>]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(m,j,i,l,f){if(/^(https?|data:image)/i.test(l)&&!b.test(l)){g[n]=l;i=i.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+Ha+'img/waiting.gif" remoteimg="'+n++ +'"')}return j+i+f});g.length>0&&e.post(c,
14
+ {urls:g.join("|")},function(m){m=m.split("|");e("img[remoteimg]",d.doc).each(function(){var j=e(this);U(j,"src",m[j.attr("remoteimg")]);j.removeAttr("remoteimg")})})}return a}function Xa(a){try{d._exec("styleWithCSS",a,true)}catch(b){try{d._exec("useCSS",!a,true)}catch(c){}}}function Ya(){if(Za&&!F){Xa(false);try{d._exec("enableObjectResizing",true,true)}catch(a){}if(y)try{d._exec("BackgroundImageCache",true,true)}catch(b){}}}function Hb(a){if(F||a.which!==13||a.shiftKey||a.ctrlKey||a.altKey)return true;
15
+ a=d.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(p.forcePtag)a.length===0&&d._exec("formatblock","<p>");else{d.pasteHTML("<br />");y&&a.length>0&&d.getRng().parentElement().childNodes.length===2&&d.pasteHTML("<br />");return false}}function $a(){if(!Da&&!Y){ua&&O.height("100%").css("height",O.outerHeight()-C.outerHeight());y&&C.hide().show()}}function Ib(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var b=d.getSel(),c=d.getRng(true);c.selectNode(a);b.removeAllRanges();
16
+ b.addRange(c)}}function U(a,b,c){if(!b)return false;var g="_xhe_"+b;if(c){if(Ia)c=ca(c,Ia,P);a.attr(b,P?ca(c,"abs",P):c).removeAttr(g).attr(g,c)}return a.attr(g)||a.attr(b)}function ab(){Fa&&d.hidePanel()}function Jb(a){if(F)return true;var b=a.which,c=yb[b];b=c?c:String.fromCharCode(b).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=b;a=va[sKey];for(var g in a){g=a[g];if(e.isFunction(g)){if(g.call(d)===false)return false}else{d.exec(g);
17
+ return false}}}function V(a,b){var c=typeof a;if(!b)return c!="undefined";if(b==="array"&&a.hasOwnProperty&&a instanceof Array)return true;return c===b}function ca(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||a.match(/^#/i))return a;var g=c?e('<a href="'+c+'" />')[0]:location;c=g.protocol;var n=g.host,m=g.hostname,j=g.port;g=g.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");if(j==="")j="80";if(g==="")g="/";else if(g.charAt(0)!=="/")g="/"+g;a=e.trim(a);if(b!=="abs")a=a.replace(RegExp(c+
18
+ "\\/\\/"+m.replace(/\./g,"\\.")+"(?::"+j+")"+(j==="80"?"?":"")+"(/|$)","i"),"/");if(b==="rel")a=a.replace(RegExp("^"+g.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(b!=="rel"){a.match(/^(https?:\/\/|\/)/i)||(a=g+a);if(a.charAt(0)==="/"){m=[];a=a.split("/");var i=a.length;for(g=0;g<i;g++){j=a[g];if(j==="..")m.pop();else j!==""&&j!=="."&&m.push(j)}a[i-1]===""&&m.push("");a="/"+m.join("/")}}if(b==="abs"&&!a.match(/^https?:\/\//i))a=c+"//"+n+a;return a=a.replace(/(https?:\/\/[^:\/?#]+):80(\/|$)/i,
19
+ "$1$2")}function kb(a,b){if(b==="*"||a.match(RegExp(".("+b.replace(/,/g,"|")+")$","i")))return true;else{alert("Upload file extension required for this: "+b);return false}}function lb(a){var b=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(b))).toFixed(2)+["Byte","KB","MB","GB","TB","PB"][b]}function W(){return false}var d=this,Q=e(B),mb=Q.closest("form"),C,O,la,ba,v,ma,na,Za=false,F=false,ua=false,Wa=false,bb,wa=false,nb="",M=null,Ja,xa=false,cb=false,oa=null,da=null,X=
20
+ 0,p=d.settings=e.extend({},Ea.settings,A),Ka=p.plugins,La=[];if(Ka){ta=e.extend({},ta,Ka);e.each(Ka,function(a){La.push(a)});La=La.join(",")}if(p.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var ob=Va[e.trim(p.tools)];p.tools=p.tools.match(/m?full/i)&&Ka?ob.replace("Table","Table,"+La):ob}p.tools.match(/(^|,)\s*About\s*(,|$)/i)||(p.tools+=",About");p.tools=p.tools.split(",");if(p.editorRoot)T=p.editorRoot;T=ca(T,"abs");if(p.urlBase)p.urlBase=ca(p.urlBase,"abs");var pb="xheCSS_"+p.skin,ya="xhe"+ia+
21
+ "_container",qb="xhe"+ia+"_Tool",rb="xhe"+ia+"_iframearea",sb="xhe"+ia+"_iframe",Ma="xhe"+ia+"_fixffcursor",za="",pa="",Ha=T+"xheditor_skin/"+p.skin+"/",Na=Db,Ia=p.urlType,P=p.urlBase,ea=p.emotPath;ea=ea?ea:T+"xheditor_emot/";var db="";Na=e.extend({},Na,p.emots);ea=ca(ea,"rel",P?P:null);if(wa=p.showBlocktag)pa+=" showBlocktag";var va=[];this.init=function(){e("#"+pb).length===0&&e("head").append('<link id="'+pb+'" rel="stylesheet" type="text/css" href="'+Ha+'ui.css" />');var a=Q.outerWidth(),b=Q.outerHeight();
22
+ a=p.width||B.style.width||(a>10?a:0);X=p.height||B.style.height||(b>10?b:150);if(V(a,"number"))a+="px";if(V(X,"string"))X=X.replace(/[^\d]+/g,"");b=p.background||B.style.background;var c=['<span class="xheGStart"/>'],g,n,m=/\||\//i;e.each(p.tools,function(f,h){h.match(m)&&c.push('<span class="xheGEnd"/>');if(h==="|")c.push('<span class="xheSeparator"/>');else if(h==="/")c.push("<br />");else{g=ta[h];if(!g)return;n=g.c?g.c:"xheIcon xheBtn"+h;c.push('<span><a href="#" title="'+g.t+'" cmd="'+h+'" class="xheButton xheEnabled" tabindex="-1" role="button"><span class="'+
23
+ n+'" unselectable="on" style="font-size:0;color:transparent;text-indent:-999px;">'+g.t+"</span></a></span>");g.s&&d.addShortcuts(g.s,h)}h.match(m)&&c.push('<span class="xheGStart"/>')});c.push('<span class="xheGEnd"/><br />');Q.after(e('<input type="text" id="'+Ma+'" style="position:absolute;display:none;" /><span id="'+ya+'" class="xhe_'+p.skin+'" style="display:none"><table cellspacing="0" cellpadding="0" class="xheLayout" style="'+(a!="0px"?"width:"+a+";":"")+"height:"+X+'px;" role="presentation"><tr><td id="'+
24
+ qb+'" class="xheTool" unselectable="on" style="height:1px;" role="presentation"></td></tr><tr><td id="'+rb+'" class="xheIframeArea" role="presentation"><iframe frameborder="0" id="'+sb+'" src="javascript:;" style="width:100%;"></iframe></td></tr></table></span>'));C=e("#"+qb);O=e("#"+rb);za='<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><link rel="stylesheet" href="'+Ha+'iframe.css"/>';if(a=p.loadCSS)if(V(a,"array"))for(var j in a)za+='<link rel="stylesheet" href="'+a[j]+'"/>';
25
+ else za+=a.match(/\s*<style(\s+[^>]*?)?>[\s\S]+?<\/style>\s*/i)?a:'<link rel="stylesheet" href="'+a+'"/>';j="<html><head>"+za+"<title>WYSIWYG Editor,press alt+1-9,toogle to tool area,press tab,select button,press esc,return editor "+(p.readTip?p.readTip:"")+"</title>";if(b)j+="<style>body{background:"+b+";}</style>";j+='</head><body spellcheck="0" class="editMode'+pa+'"></body></html>';d.win=la=e("#"+sb)[0].contentWindow;ba=e(la);try{this.doc=v=la.document;ma=e(v);v.open();v.write(j);v.close();if(y)v.body.contentEditable=
26
+ "true";else v.designMode="On"}catch(i){}setTimeout(Ya,300);d.setSource();la.setInterval=null;C.append(c.join("")).bind("mousedown contextmenu",W).click(function(f){var h=e(f.target).closest("a");if(h.is(".xheEnabled")){clearTimeout(Ja);C.find("a").attr("tabindex","-1");M=f;d.exec(h.attr("cmd"))}return false});C.find(".xheButton").hover(function(f){var h=e(this),o=p.hoverExecDelay,k=da;da=null;if(o===-1||xa||!h.is(".xheEnabled"))return false;if(k&&k>10){xa=true;setTimeout(function(){xa=false},100);
27
+ return false}var q=h.attr("cmd");if(ta[q].h!==1){d.hidePanel();return false}if(cb)o=0;if(o>=0)Ja=setTimeout(function(){M=f;oa={x:M.clientX,y:M.clientY};d.exec(q)},o)},function(){oa=null;Ja&&clearTimeout(Ja)}).mousemove(function(f){if(oa){var h={x:f.clientX-oa.x,y:f.clientY-oa.y};if(Math.abs(h.x)>1||Math.abs(h.y)>1){if(h.x>0&&h.y>0){h=Math.round(Math.atan(h.y/h.x)/0.017453293);da=da?(da+h)/2:h}else da=null;oa={x:f.clientX,y:f.clientY}}}});L=e("#xhePanel");ra=e("#xheShadow");sa=e("#xheCntLine");if(L.length===
28
+ 0){L=e('<div id="xhePanel"></div>').mousedown(function(f){f.stopPropagation()});ra=e('<div id="xheShadow"></div>');sa=e('<div id="xheCntLine"></div>');setTimeout(function(){e(document.body).append(L).append(ra).append(sa)},10)}e("#"+ya).show();Q.hide();O.css("height",X-C.outerHeight());y&Ca<8&&setTimeout(function(){O.css("height",X-C.outerHeight())},1);Q.focus(d.focus);mb.submit(aa).bind("reset",hb);p.submitID&&e("#"+p.submitID).click(aa);e(window).bind("unload beforeunload",aa).bind("resize",$a);
29
+ e(document).mousedown(ab);if(!fb){e(document).keydown(Qa);fb=true}ba.focus(function(){p.focus&&p.focus()}).blur(function(){p.blur&&p.blur()});Y&&ba.click(Ib);ma.mousedown(ab).keydown(Jb).keypress(Hb).dblclick(J).bind("mousedown click",function(f){Q.trigger(f.type)});if(y){ma.keydown(function(f){var h=d.getRng();if(f.which===8&&h.item){e(h.item(0)).remove();return false}});var l=function(f){f=e(f.target);var h;if(h=f.css("width"))f.css("width","").attr("width",h.replace(/[^0-9%]+/g,""));if(h=f.css("height"))f.css("height",
30
+ "").attr("height",h.replace(/[^0-9%]+/g,""))};ma.bind("controlselect",function(f){f=f.target;e.nodeName(f,"IMG")&&e(f).unbind("resizeend",l).bind("resizeend",l)})}ma.keydown(function(f){var h=f.which;if(f.altKey&&h>=49&&h<=57){C.find("a").attr("tabindex","0");C.find(".xheGStart").eq(h-49).next().find("a").focus();v.title="\ufeff\ufeff";return false}}).click(function(){C.find("a").attr("tabindex","-1")});C.keydown(function(f){var h=f.which;if(h==27){C.find("a").attr("tabindex","-1");d.focus()}else if(f.altKey&&
31
+ h>=49&&h<=57){C.find(".xheGStart").eq(h-49).next().find("a").focus();return false}});j=e(v.documentElement);eb?j.bind("keydown",function(f){f.ctrlKey&&f.which===86&&ib()}):j.bind("paste",ib);p.disableContextmenu&&j.bind("contextmenu",W);p.html5Upload&&j.bind("dragenter dragover",function(f){var h;if((h=f.originalEvent.dataTransfer.types)&&e.inArray("Files",h)!==-1)return false}).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(f&&(h=f.files)&&h.length>0){var o,k;f=["Link","Img","Flash",
32
+ "Media"];var q=[],r;for(o in f){k=f[o];p["up"+k+"Url"]&&p["up"+k+"Url"].match(/^[^!].*/i)&&q.push(k+":,"+p["up"+k+"Ext"])}if(q.length===0)return false;else r=q.join(",");k=function(t){var s,w;for(o=0;o<t.length;o++){s=t[o].fileName.replace(/.+\./,"");if(s=r.match(RegExp("(\\w+):[^:]*,"+s+"(?:,|$)","i")))if(w){if(w!==s[1])return 2}else w=s[1];else return 1}return w}(h);if(k===1)alert("Upload file extension required for this: "+r.replace(/\w+:,/g,""));else if(k===2)alert("You can only drag and drop the same type of file.");
33
+ else k&&d.startUpload(h,p["up"+k+"Url"],"*",function(t){var s=[],w;(w=p.onUpload)&&w(t);for(o in t){w=t[o];url=V(w,"string")?w:w.url;if(url.substr(0,1)==="!")url=url.substr(1);s.push(url)}d.exec(k);e("#xhe"+k+"Url").val(s.join(" "));e("#xheSave").click()});return false}});(j=p.shortcuts)&&e.each(j,function(f,h){d.addShortcuts(f,h)});ia++;Za=true;if(p.fullscreen)d.toggleFullscreen();else p.sourceMode&&setTimeout(d.toggleSource,20);return true};this.remove=function(){d.hidePanel();aa();Q.unbind("focus",
34
+ d.focus);mb.unbind("submit",aa).unbind("reset",hb);p.submitID&&e("#"+p.submitID).unbind("mousedown",aa);e(window).unbind("unload beforeunload",aa).unbind("resize",$a);e(document).unbind("mousedown",ab);e("#"+ya).remove();e("#"+Ma).remove();Q.show();Za=false};this.saveBookmark=function(){if(!F){d.focus();var a=d.getRng();a=a.cloneRange?a.cloneRange():a;na={top:ba.scrollTop(),rng:a}}};this.loadBookmark=function(){if(!(F||!na)){d.focus();var a=na.rng;if(y)a.select();else{var b=d.getSel();b.removeAllRanges();
35
+ b.addRange(a)}ba.scrollTop(na.top);na=null}};this.focus=function(){F?e("#sourceCode",v).focus():ba.focus();if(y){var a=d.getRng();a.parentElement&&a.parentElement().ownerDocument!==v&&d.setTextCursor()}return false};this.setTextCursor=function(a){var b=d.getRng(true),c=v.body;if(y)b.moveToElementText(c);else{for(var g=a?"lastChild":"firstChild";c.nodeType!=3&&c[g];)c=c[g];b.selectNode(c)}b.collapse(a?false:true);if(y)b.select();else{a=d.getSel();a.removeAllRanges();a.addRange(b)}};this.getSel=function(){return v.selection?
36
+ v.selection:la.getSelection()};this.getRng=function(a){var b,c;try{if(!a){b=d.getSel();c=b.createRange?b.createRange():b.rangeCount>0?b.getRangeAt(0):null}c||(c=v.body.createTextRange?v.body.createTextRange():v.createRange())}catch(g){}return c};this.getParent=function(a){var b=d.getRng(),c;if(y)c=b.item?b.item(0):b.parentElement();else{c=b.commonAncestorContainer;if(!b.collapsed)if(b.startContainer===b.endContainer&&b.startOffset-b.endOffset<2&&b.startContainer.hasChildNodes())c=b.startContainer.childNodes[b.startOffset]}a=
37
+ a?a:"*";c=e(c);c.is(a)||(c=e(c).closest(a));return c};this.getSelect=function(a){var b=d.getSel(),c=d.getRng(),g=true;g=!c||c.item?false:!b||c.boundingWidth===0||c.collapsed;if(a==="text")return g?"":c.text||(b.toString?b.toString():"");if(c.cloneContents){a=e("<div></div>");(c=c.cloneContents())&&a.append(c);c=a.html()}else c=V(c.item)?c.item(0).outerHTML:V(c.htmlText)?c.htmlText:c.toString();if(g)c="";c=d.processHTML(c,"read");c=d.cleanHTML(c);return c=d.formatXHTML(c)};this.pasteHTML=function(a,
38
+ b){if(F)return false;d.focus();a=d.processHTML(a,"write");var c=d.getSel(),g=d.getRng();if(b!==ha){if(g.item){var n=g.item(0);g=d.getRng(true);g.moveToElementText(n);g.select()}g.collapse(b)}a+="<"+(y?"img":"span")+' id="_xhe_temp" width="0" height="0" />';if(g.insertNode){if(e(g.startContainer).closest("style,script").length>0)return false;g.deleteContents();g.insertNode(g.createContextualFragment(a))}else{if(c.type.toLowerCase()==="control"){c.clear();g=d.getRng()}g.pasteHTML(a)}n=e("#_xhe_temp",
39
+ v);var m=n[0];if(y){g.moveToElementText(m);g.select()}else{g.selectNode(m);c.removeAllRanges();c.addRange(g)}n.remove()};this.pasteText=function(a,b){a||(a="");a=d.domEncode(a);a=a.replace(/\r?\n/g,"<br />");d.pasteHTML(a,b)};this.appendHTML=function(a){if(F)return false;d.focus();a=d.processHTML(a,"write");e(v.body).append(a);d.setTextCursor(true)};this.domEncode=function(a){return a.replace(Gb,function(b){return Fb[b]})};this.setSource=function(a){na=null;if(typeof a!=="string"&&a!=="")a=B.value;
40
+ if(F)e("#sourceCode",v).val(a);else{if(p.beforeSetSource)a=p.beforeSetSource(a);a=d.cleanHTML(a);a=d.formatXHTML(a);a=d.processHTML(a,"write");if(y){v.body.innerHTML='<img id="_xhe_temp" width="0" height="0" />'+a+"\n";e("#_xhe_temp",v).remove()}else v.body.innerHTML=a}};this.processHTML=function(a,b){if(b==="write"){a=a.replace(/(<(\/?)(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g,function(m,j,i,l,f,h,o){l=l.toLowerCase();if(Da)if(l==="strong")l="b";else{if(l==="em")l="i"}else if(Y)if(l===
41
+ "strong"){l="span";i||(f+=' class="Apple-style-span" style="font-weight: bold;"')}else if(l==="em"){l="span";i||(f+=' class="Apple-style-span" style="font-style: italic;"')}else if(l==="u"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: underline;"')}else if(l==="strike"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: line-through;"')}var k,q="";if(l==="del")l="strike";else if(l==="img")f=f.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(t,s){k=
42
+ s.match(/^(["']?)(.*)\1/)[2];k=k.split(",");if(!k[1]){k[1]=k[0];k[0]=""}if(k[0]==="default")k[0]="";return p.emotMark?t:""});else if(l==="a"){if(!f.match(/ href=[^ ]/i)&&f.match(/ name=[^ ]/i))q+=" xhe-anchor";if(o)h="></a>"}else if(l==="table"&&!i){m=f.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i);if(!m||m[1].match(/^(["']?)\s*0\s*\1$/))q+=" xhe-border"}var r;f=f.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(t,s,w){s=s.toLowerCase();w=w.match(/^(["']?)(.*)\1/)[2];aft="";
43
+ if(y&&s.match(/^(disabled|checked|readonly|selected)$/)&&w.match(/^(false|0)$/i))return"";if(l==="img"&&k&&s==="src")return"";if(s.match(/^(src|href)$/)){aft=" _xhe_"+s+'="'+w+'"';if(P)w=ca(w,"abs",P)}if(q&&s==="class"){w+=" "+q;q=""}if(Y&&s==="style")if(l==="span"&&w.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i))r=true;return" "+s+'="'+w+'"'+aft});if(k){m=ea+(k[0]?k[0]:"default")+"/"+k[1]+".gif";f+=' src="'+m+'" _xhe_src="'+m+'"'}if(r)f+=' class="Apple-style-span"';
44
+ if(q)f+=' class="'+q+'"';return"<"+i+l+f+h});if(y)a=a.replace(/&apos;/ig,"&#39;");if(!Y){var c=function(m,j,i,l){j="";var f,h;if(f=i.match(/font-family\s*:\s*([^;"]+)/i))j+=' face="'+f[1]+'"';if(f=i.match(/font-size\s*:\s*([^;"]+)/i)){f=f[1].toLowerCase();for(var o=0;o<$.length;o++)if(f===$[o].n||f===$[o].s){h=o+1;break}if(h){j+=' size="'+h+'"';i=i.replace(/(^|;)(\s*font-size\s*:\s*[^;"]+;?)+/ig,"$1")}}if(h=i.match(/(?:^|[\s;])color\s*:\s*([^;"]+)/i)){if(f=h[1].match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)){h[1]=
45
+ "#";for(o=1;o<=3;o++)h[1]+=(f[o]-0).toString(16)}h[1]=h[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3");j+=' color="'+h[1]+'"'}i=i.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig,"$1");if(j!==""){if(i)j+=' style="'+i+'"';return"<font"+j+">"+l+"</font>"}else return m};a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
46
+ c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}a=a.replace(/<(td|th)(\s+[^>]*?)?>(\s|&nbsp;)*<\/\1>/ig,"<$1$2>"+(y?"":"<br />")+"</$1>")}else{if(Y){var g=[{r:/font-weight:\sbold/ig,
47
+ t:"strong"},{r:/font-style:\sitalic/ig,t:"em"},{r:/text-decoration:\sunderline/ig,t:"u"},{r:/text-decoration:\sline-through/ig,t:"strike"}];c=function(m,j,i,l,f){j=i+l;i="";if(!j)return f;for(l=0;l<g.length;l++)if(j.match(g[l].r)){i=g[l].t;break}return i?"<"+i+">"+f+"</"+i+">":m};for(var n=0;n<2;n++){a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
48
+ c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}}a=a.replace(/(<(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g,function(m,j,i,l,f){i=i.toLowerCase();var h;l=l.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(o,
49
+ k){h=k.match(/^(["']?)(.*)\1/)[2];return""});if(h&&Ia)h=ca(h,Ia,P);l=l.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(o,k,q){k=k.toLowerCase();q=q.match(/^(["']?)(.*)\1/)[2];if(k==="class"){if(q.match(/^["']?(apple|webkit)/i))return"";q=q.replace(/\s?xhe-[a-z]+/ig,"");if(q==="")return""}else if(k.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return"";else if(h&&k.match(/^(src|href)$/i))return" "+k+'="'+h+'"';else if(k==="style")q=q.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i,
50
+ function(r,t,s,w,I){for(var N,D=0;D<$.length;D++){r=$[D];if(w===r.n){N=r.s;break}}return t+s+":"+N+I});return" "+k+'="'+q+'"'});if(i==="img"&&!l.match(/\s+alt\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i))l+=' alt=""';return j+l+f});a=a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)(<br(\s*\/)?>)?\s*<\/\2>/ig,function(m,j,i,l){return j+(l?l:"&nbsp;")+"</"+i+">"});a=a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(<span(?:\s+[^>]*?)?>\s*<\/span>|<br(?:\s+[^>]*?)?>|&nbsp;)*\s*(?:<\/\1>)?\s*$/i,"")}return a=a.replace(/(<pre(?:\s+[^>]*?)?>)([\s\S]+?)(<\/pre>)/gi,
51
+ function(m,j,i,l){return j+i.replace(/<br\s*\/?>/ig,"\r\n")+l})};this.getSource=function(a){var b,c=p.beforeGetSource;if(F){b=e("#sourceCode",v).val();c||(b=d.formatXHTML(b,false))}else{b=d.processHTML(v.body.innerHTML,"read");b=d.cleanHTML(b);b=d.formatXHTML(b,a);if(c)b=c(b)}return B.value=b};this.cleanWord=function(a){var b=p.cleanPaste;if(b>0&&b<3&&a.match(/mso(-|normal)|WordDocument|<table\s+[^>]*?x:str/i)){a=a.replace(/<!--[\s\S]*?--\>|<!(--)?\[[\s\S]+?\](--)?>|<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,
52
+ "");a=a.replace(/\r?\n/ig,"");a=a.replace(/(<(\/?)([\w\-:]+))((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?>)/g,function(g,n,m,j,i,l){j=j.toLowerCase();if(j.match(/^(link|img)$/)&&i.match(/file:\/\//i)||j.match(/:/)||j==="span"&&b===2)return"";m||(i=i.replace(/\s([\w\-:]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^>\s]+))?/ig,function(f,h,o){h=h.toLowerCase();o=o.match(/^(["']?)(.*)\1/)[2];if(h.match(/:/))return"";else if(h.match(/^(class|lang|language|span)$/))return"";else if(j==="td"&&(h===
53
+ "height"||h==="width"&&!i.match(/\scolspan="\d+"/i)))return"";else if(h==="style"){if(b===2)return"";return(o=e.trim(o.replace(/\s*(mso-[^:]+:.+?|margin\s*:\s*0cm 0cm 0pt\s*|(text-align|font-variant|line-height)\s*:\s*.+?)(;|$)\s*/ig,"")))?" "+h+'="'+o.replace(/"/g,"'")+'"':""}return f}));return n+i+l});for(var c=0;c<3;c++)a=a.replace(/<([^\s>]+)(\s+[^>]*)?>\s*<\/\1>/g,function(g,n){return n.match(/^a$/i)?g:""})}return a};this.cleanHTML=function(a){a=a.replace(/<!?\/?(DOCTYPE|html|body|meta)(\s+[^>]*?)?>/ig,
54
+ "");var b;a=a.replace(/<head(?:\s+[^>]*?)?>([\s\S]*?)<\/head>/i,function(c,g){b=g.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig);return""});if(b)a=b.join("")+a;a=a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig,"");p.internalScript||(a=a.replace(/<script(\s+[^>]*?)?>[\s\S]*?<\/script>/ig,""));p.internalStyle||(a=a.replace(/<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,""));if(!p.linkTag||!p.inlineScript||!p.inlineStyle)a=a.replace(/(<(\w+))((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/ig,
55
+ function(c,g,n,m,j){if(!p.linkTag&&n.toLowerCase()==="link")return"";p.inlineScript||(m=m.replace(/\s+on(?:click|dblclick|mouse(down|up|move|over|out|enter|leave|wheel)|key(down|press|up)|change|select|submit|reset|blur|focus|load|unload)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));p.inlineStyle||(m=m.replace(/\s+(style|class)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));return g+m+j});return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|<br\/?>|&nbsp;)*?)<\1(\s+[^>]*?)?>/ig,"$2")};this.formatXHTML=function(a,
56
+ b){function c(u){var x={};u=u.split(",");for(var z=0;z<u.length;z++)x[u[z]]=true;return x}function g(u){u=u.toLowerCase();var x=w[u];return x?x:u}function n(u,x,z){if(k[u])for(;G.last()&&q[G.last()];)m(G.last());r[u]&&G.last()===u&&m(u);(z=o[u]||!!z)||G.push(u);var K=[];K.push("<"+u);x.replace(N,function(tb,Aa,ub,vb,wb){Aa=Aa.toLowerCase();K.push(" "+Aa+'="'+(ub?ub:vb?vb:wb?wb:t[Aa]?Aa:"").replace(/"/g,"'")+'"')});K.push((z?" /":"")+">");l(K.join(""),u,true);if(u==="pre")Oa=true}function m(u){if(u)for(x=
57
+ G.length-1;x>=0;x--){if(G[x]===u)break}else var x=0;if(x>=0){for(var z=G.length-1;z>=x;z--)l("</"+G[z]+">",G[z]);G.length=x}if(u==="pre"){Oa=false;fa--}}function j(u){l(d.domEncode(u))}function i(u){D.push(u.replace(/^[\s\r\n]+|[\s\r\n]+$/g,""))}function l(u,x,z){Oa||(u=u.replace(/(\t*\r?\n\t*)+/g,""));if(!Oa&&b===true)if(u.match(/^\s*$/))D.push(u);else{var K=k[x],tb=K?x:"";if(K){z&&fa++;Pa===""&&fa--}else Pa&&fa++;if(tb!==Pa||K)f();D.push(u);x==="br"&&f();if(K&&(o[x]||!z))fa--;Pa=K?x:""}else D.push(u)}
58
+ function f(){D.push("\r\n");if(fa>0)for(var u=fa;u--;)D.push("\t")}function h(u,x,z,K){if(!z)return K;u="";if(x=z.match(/ face\s*=\s*"\s*([^"]+)\s*"/i))u+="font-family:"+x[1]+";";if(x=z.match(/ size\s*=\s*"\s*(\d+)\s*"/i))u+="font-size:"+$[(x[1]>7?7:x[1]<1?1:x[1])-1].s+";";if(x=z.match(/ color\s*=\s*"\s*([^"]+)\s*"/i))u+="color:"+x[1]+";";if(z=z.match(/ style\s*=\s*"\s*([^"]+)\s*"/i))u+=z[1];if(u)K='<span style="'+u+'">'+K+"</span>";return K}var o=c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),
59
+ k=c("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,table,tbody,td,tfoot,th,thead,tr,ul,script"),q=c("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),r=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),t=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),
60
+ s=c("script,style"),w={b:"strong",i:"em",s:"del",strike:"del"},I=/<(?:\/([^\s>]+)|!--([^>]*?)--|([\w\-:]+)((?:"[^"]*"|'[^']*'|[^"'<>])*)\s*(\/?))>/g,N=/\s*([\w\-:]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g,D=[],G=[];G.last=function(){return this[this.length-1]};for(var E,H,R=0,ga,Ba,fa=-1,Pa="body",Oa=false;E=I.exec(a);){H=E.index;if(H>R){R=a.substring(R,H);ga?Ba.push(R):j(R)}R=I.lastIndex;if(H=E[1]){H=g(H);if(ga&&H===ga){i(Ba.join(""));Ba=ga=null}if(!ga){m(H);continue}}if(ga)Ba.push(E[0]);
61
+ else if(H=E[3]){H=g(H);n(H,E[4],E[5]);if(s[H]){ga=H;Ba=[]}}else E[2]&&D.push(E[0])}a.length>R&&j(a.substring(R,a.length));m();a=D.join("");D=null;a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,
62
+ h);return a=a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g,"")};this.toggleShowBlocktag=function(a){if(wa!==a){wa=!wa;a=e(v.body);if(wa){pa+=" showBlocktag";a.addClass("showBlocktag")}else{pa=pa.replace(" showBlocktag","");a.removeClass("showBlocktag")}}};this.toggleSource=function(a){if(F!==a){C.find("[cmd=Source]").toggleClass("xheEnabled").toggleClass("xheActive");var b=v.body,c=e(b),g,n;a=0;var m="";if(F){g=d.getSource();c.html("").removeAttr("scroll").attr("class","editMode"+pa);if(y)b.contentEditable=
63
+ "true";else v.designMode="On";if(Da){d._exec("inserthtml","-");e("#"+Ma).show().focus().hide()}m="Edit source code"}else{d.pasteHTML('<span id="_xhe_cursor"></span>',true);g=d.getSource(true);a=g.indexOf('<span id="_xhe_cursor"></span>');if(!eb)a=g.substring(0,a).replace(/\r/g,"").length;g=g.replace(/(\r?\n\s*|)<span id="_xhe_cursor"><\/span>(\s*\r?\n|)/,function(j,i,l){return i&&l?"\r\n":i+l});if(y)b.contentEditable="false";else v.designMode="Off";c.attr("scroll","no").attr("class","sourceMode").html('<textarea id="sourceCode" wrap="soft" spellcheck="false" height="100%" />');
64
+ n=e("#sourceCode",c).blur(d.getSource)[0];m="WYSIWYG mode"}F=!F;d.setSource(g);d.focus();if(F)if(n.setSelectionRange)n.setSelectionRange(a,a);else{n=n.createTextRange();n.move("character",a);n.select()}else d.setTextCursor();C.find("[cmd=Source]").attr("title",m).find("span").text(m);C.find("[cmd=Source],[cmd=Preview]").toggleClass("xheEnabled");C.find(".xheButton").not("[cmd=Source],[cmd=Fullscreen],[cmd=About]").toggleClass("xheEnabled").attr("aria-disabled",F?true:false);setTimeout(Ya,300)}};this.showPreview=
65
+ function(){var a=p.beforeSetSource,b=d.getSource();if(a)b=a(b);a="<html><head>"+za+"<title>Preview</title>"+(P?'<base href="'+P+'"/>':"")+"</head><body>"+b+"</body></html>";b=window.screen;b=window.open("","xhePreview","toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+Math.round(b.width*0.9)+",height="+Math.round(b.height*0.8)+",left="+Math.round(b.width*0.05));var c=b.document;c.open();c.write(a);c.close();b.focus()};this.toggleFullscreen=function(a){if(ua!==a){a=
66
+ e("#"+ya).find(".xheLayout");var b=e("#"+ya),c=jQuery.browser.version;c=y&&(c==6||c==7);if(ua){c&&Q.after(b);a.attr("style",nb);O.height(X-C.outerHeight());e(window).scrollTop(bb);setTimeout(function(){e(window).scrollTop(bb)},10)}else{c&&e("body").append(b);bb=e(window).scrollTop();nb=a.attr("style");a.removeAttr("style");O.height("100%");setTimeout($a,100)}if(Da){e("#"+Ma).show().focus().hide();setTimeout(d.focus,1)}else c&&d.setTextCursor();ua=!ua;b.toggleClass("xhe_Fullscreen");e("html").toggleClass("xhe_Fullfix");
67
+ C.find("[cmd=Fullscreen]").toggleClass("xheActive");setTimeout(Ya,300)}};this.showMenu=function(a,b){var c=e('<div class="xheMenu"></div>'),g=a.length,n=[];e.each(a,function(m,j){n.push("<a href=\"javascript:void('"+j.v+'\')" title="'+(j.t?j.t:j.s)+'" v="'+j.v+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(m+1)+'" tabindex="0">'+j.s+"</a>")});c.append(n.join(""));c.click(function(m){m=m.target;if(!e.nodeName(m,"DIV")){d.loadBookmark();b(e(m).closest("a").attr("v"));d.hidePanel();return false}}).mousedown(W);
68
+ d.showPanel(c);d.saveBookmark()};this.showColor=function(a){var b=e('<div class="xheColor"></div>'),c=[],g=gb.length,n=0;e.each(gb,function(m,j){if(n%7===0)c.push((n>0?"</div>":"")+"<div>");c.push("<a href=\"javascript:void('"+j+'\')" xhev="'+j+'" title="'+j+'" style="background:'+j+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(n+1)+'"></a>');n++});c.push("</div>");b.append(c.join(""));b.click(function(m){m=m.target;if(e.nodeName(m,"A")){d.loadBookmark();a(e(m).attr("xhev"));d.hidePanel();
69
+ return false}}).mousedown(W);d.showPanel(b);d.saveBookmark()};this.showPastetext=function(){var a=e('<div><label for="xhePastetextValue">Use Ctrl+V on your keyboard to paste the text.</label></div><div><textarea id="xhePastetextValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>'),b=e("#xhePastetextValue",a);e("#xheSave",a).click(function(){d.loadBookmark();var c=b.val();c&&d.pasteText(c);
70
+ d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showLink=function(){var a='<div><label for="xheLinkUrl">Link URL: </label><input type="text" id="xheLinkUrl" value="http://" class="xheText" /></div><div><label for="xheLinkTarget">Target:&nbsp;&nbsp; </label><select id="xheLinkTarget"><option selected="selected" value="">Default</option><option value="_blank">New window</option><option value="_self">Same window</option><option value="_parent">Parent window</option></select></div><div style="display:none"><label for="xheLinkText">Link Text:</label><input type="text" id="xheLinkText" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>',
71
+ b=ma.find("a[name]").not("[href]"),c=b.length>0;if(c){var g=[];b.each(function(){var f=e(this).attr("name");g.push('<option value="#'+f+'">'+f+"</option>")});a=a.replace(/(<div><label for="xheLinkTarget)/,'<div><label for="xheLinkAnchor">Anchor: &nbsp;&nbsp;</label><select id="xheLinkAnchor"><option value="">None selected</option>'+g.join("")+"</select></div>$1")}a=e(a);var n=d.getParent("a"),m=e("#xheLinkText",a),j=e("#xheLinkUrl",a),i=e("#xheLinkTarget",a);b=e("#xheSave",a);var l=d.getSelect();
72
+ c&&a.find("#xheLinkAnchor").change(function(){var f=e(this).val();f!=""&&j.val(f)});if(n.length===1){if(!n.attr("href")){M=null;return d.exec("Anchor")}j.val(U(n,"href"));i.attr("value",n.attr("target"))}else l===""&&m.val(p.defLinkText).closest("div").show();p.upLinkUrl&&d.uploadInit(j,p.upLinkUrl,p.upLinkExt);b.click(function(){d.loadBookmark();var f=j.val();if(f===""||n.length===0)d._exec("unlink");if(f!==""&&f!=="http://"){var h=f.split(" "),o=i.val(),k=m.val();if(h.length>1){d._exec("unlink");
73
+ l=d.getSelect();var q='<a href="xhe_tmpurl"',r=[];if(o!=="")q+=' target="'+o+'"';q+=">xhe_tmptext</a>";k=l!==""?l:k?k:f;for(var t in h){f=h[t];if(f!==""){f=f.split("||");o=q;o=o.replace("xhe_tmpurl",f[0]);o=o.replace("xhe_tmptext",f[1]?f[1]:k);r.push(o)}}d.pasteHTML(r.join("&nbsp;"))}else{f=h[0].split("||");k||(k=f[0]);k=f[1]?f[1]:l!==""?"":k?k:f[0];if(n.length===0){k?d.pasteHTML('<a href="#xhe_tmpurl">'+k+"</a>"):d._exec("createlink","#xhe_tmpurl");n=e('a[href$="#xhe_tmpurl"]',v)}else k&&!Y&&n.text(k);
74
+ U(n,"href",f[0]);o!==""?n.attr("target",o):n.removeAttr("target")}}d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAnchor=function(){var a=e('<div><label for="xheAnchorName">Anchor name: </label><input type="text" id="xheAnchorName" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>'),b=d.getParent("a"),c=e("#xheAnchorName",a),g=e("#xheSave",a);if(b.length===1){if(b.attr("href")){M=null;return d.exec("Link")}c.val(b.attr("name"))}g.click(function(){d.loadBookmark();
75
+ var n=c.val();if(n)b.length===0?d.pasteHTML('<a name="'+n+'"></a>'):b.attr("name",n);else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showImg=function(){var a=e('<div><label for="xheImgUrl">Img URL:&nbsp; </label><input type="text" id="xheImgUrl" value="http://" class="xheText" /></div><div><div><label for="xheImgAlt">Alt text: </label><input type="text" id="xheImgAlt" /></div><div><label for="xheImgAlign">Alignment:</label><select id="xheImgAlign"><option selected="selected" value="">Default</option><option value="left">Left</option><option value="right">Right</option><option value="top">Top</option><option value="middle">Middle</option><option value="baseline">Baseline</option><option value="bottom">Bottom</option></select></div><div><label for="xheImgWidth">Width:&nbsp; &nbsp; </label><input type="text" id="xheImgWidth" style="width:40px;" /> <label for="xheImgHeight">Height:&nbsp; &nbsp;</label><input type="text" id="xheImgHeight" style="width:40px;" /></div><div><label for="xheImgBorder">Border:&nbsp; &nbsp;</label><input type="text" id="xheImgBorder" style="width:40px;" /></div><div><label for="xheImgHspace">Hspace:&nbsp;&nbsp;&nbsp;</label><input type="text" id="xheImgHspace" style="width:40px;" /> <label for="xheImgVspace">Vspace:&nbsp; &nbsp;</label><input type="text" id="xheImgVspace" style="width:40px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>'),
76
+ b=d.getParent("img"),c=e("#xheImgUrl",a),g=e("#xheImgAlt",a),n=e("#xheImgAlign",a),m=e("#xheImgWidth",a),j=e("#xheImgHeight",a),i=e("#xheImgBorder",a),l=e("#xheImgVspace",a),f=e("#xheImgHspace",a),h=e("#xheSave",a);if(b.length===1){c.val(U(b,"src"));g.val(b.attr("alt"));n.val(b.attr("align"));m.val(b.attr("width"));j.val(b.attr("height"));i.val(b.attr("border"));var o=b.attr("vspace"),k=b.attr("hspace");l.val(o<=0?"":o);f.val(k<=0?"":k)}p.upImgUrl&&d.uploadInit(c,p.upImgUrl,p.upImgExt);h.click(function(){d.loadBookmark();
77
+ var q=c.val();if(q!==""&&q!=="http://"){var r=q.split(" "),t=g.val(),s=n.val(),w=m.val(),I=j.val(),N=i.val(),D=l.val(),G=f.val();if(r.length>1){var E='<img src="xhe_tmpurl"',H=[];if(t!=="")E+=' alt="'+t+'"';if(s!=="")E+=' align="'+s+'"';if(w!=="")E+=' width="'+w+'"';if(I!=="")E+=' height="'+I+'"';if(N!=="")E+=' border="'+N+'"';if(D!=="")E+=' vspace="'+D+'"';if(G!=="")E+=' hspace="'+G+'"';E+=" />";for(var R in r){q=r[R];if(q!==""){q=q.split("||");t=E;t=t.replace("xhe_tmpurl",q[0]);if(q[1])t='<a href="'+
78
+ q[1]+'" target="_blank">'+t+"</a>";H.push(t)}}d.pasteHTML(H.join("&nbsp;"))}else if(r.length===1){q=r[0];if(q!==""){q=q.split("||");if(b.length===0){d.pasteHTML('<img src="'+q[0]+'#xhe_tmpurl" />');b=e('img[src$="#xhe_tmpurl"]',v)}U(b,"src",q[0]);t!==""&&b.attr("alt",t);s!==""?b.attr("align",s):b.removeAttr("align");w!==""?b.attr("width",w):b.removeAttr("width");I!==""?b.attr("height",I):b.removeAttr("height");N!==""?b.attr("border",N):b.removeAttr("border");D!==""?b.attr("vspace",D):b.removeAttr("vspace");
79
+ G!==""?b.attr("hspace",G):b.removeAttr("hspace");if(q[1]){r=b.parent("a");if(r.length===0){b.wrap("<a></a>");r=b.parent("a")}U(r,"href",q[1]);r.attr("target","_blank")}}}}else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showEmbed=function(a,b,c,g,n,m,j){b=e(b);var i=d.getParent('embed[type="'+c+'"],embed[classid="'+g+'"]'),l=e("#xhe"+a+"Url",b),f=e("#xhe"+a+"Width",b),h=e("#xhe"+a+"Height",b);a=e("#xheSave",b);m&&d.uploadInit(l,m,j);if(i.length===1){l.val(U(i,
80
+ "src"));f.val(i.attr("width"));h.val(i.attr("height"))}a.click(function(){d.loadBookmark();var o=l.val();if(o!==""&&o!=="http://"){var k=f.val(),q=h.val(),r=/^\d+%?$/;r.test(k)||(k=412);r.test(q)||(q=300);var t='<embed type="'+c+'" classid="'+g+'" src="xhe_tmpurl"'+n;r=o.split(" ");if(r.length>1){t=t+"";var s,w=[];t+=' width="xhe_width" height="xhe_height" />';for(var I in r){o=r[I].split("||");s=t;s=s.replace("xhe_tmpurl",o[0]);s=s.replace("xhe_width",o[1]?o[1]:k);s=s.replace("xhe_height",o[2]?o[2]:
81
+ q);o!==""&&w.push(s)}d.pasteHTML(w.join("&nbsp;"))}else if(r.length===1){o=r[0].split("||");if(i.length===0){d.pasteHTML(t.replace("xhe_tmpurl",o[0]+"#xhe_tmpurl")+" />");i=e('embed[src$="#xhe_tmpurl"]',v)}U(i,"src",o[0]);i.attr("width",o[1]?o[1]:k);i.attr("height",o[2]?o[2]:q)}}else i.length===1&&i.remove();d.hidePanel();return false});d.showDialog(b);d.saveBookmark()};this.showEmot=function(a){var b=e('<div class="xheEmot"></div>');a=a?a:db?db:"default";var c=Na[a],g=ea+a+"/",n=0,m=[],j="";j=c.width;
82
+ var i=c.height,l=c.line,f=c.count;c=c.list;if(f)for(c=1;c<=f;c++){n++;m.push("<a href=\"javascript:void('"+c+'\')" style="background-image:url('+g+c+'.gif);" emot="'+a+","+c+'" xhev="" title="'+c+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")}else e.each(c,function(k,q){n++;m.push("<a href=\"javascript:void('"+q+'\')" style="background-image:url('+g+k+'.gif);" emot="'+a+","+k+'" title="'+q+'" xhev="'+q+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")});f=l*(j+12);c=f*0.75;if(Math.ceil(n/
83
+ l)*(i+12)<=c)c="";j=e("<style>"+(c?".xheEmot div{width:"+(f+20)+"px;height:"+c+"px;}":"")+".xheEmot div a{width:"+j+"px;height:"+i+"px;}</style><div>"+m.join("")+"</div>").click(function(k){k=k.target;var q=e(k);if(e.nodeName(k,"A")){d.pasteHTML('<img emot="'+q.attr("emot")+'" alt="'+q.attr("xhev")+'">');d.hidePanel();return false}}).mousedown(W);b.append(j);var h=0,o=['<ul role="tablist">'];e.each(Na,function(k,q){h++;o.push("<li"+(a===k?' class="cur"':"")+' role="presentation"><a href="javascript:void(\''+
84
+ q.name+'\')" group="'+k+'" role="tab" tabindex="0">'+q.name+"</a></li>")});if(h>1){o.push('</ul><br style="clear:both;" />');j=e(o.join("")).click(function(k){db=e(k.target).attr("group");d.exec("Emot");return false}).mousedown(W);b.append(j)}d.showPanel(b)};this.showTable=function(){var a=e('<div><label for="xheTableRows">Rows:&nbsp; &nbsp; &nbsp; &nbsp;</label><input type="text" id="xheTableRows" style="width:40px;" value="3" /> <label for="xheTableColumns">Cols:&nbsp; &nbsp; &nbsp; &nbsp;</label><input type="text" id="xheTableColumns" style="width:40px;" value="2" /></div><div><label for="xheTableHeaders">Headers:&nbsp; &nbsp;&nbsp;</label><select id="xheTableHeaders"><option selected="selected" value="">None</option><option value="row">First row</option><option value="col">First column</option><option value="both">Both</option></select></div><div><label for="xheTableWidth">Width: &nbsp; &nbsp; &nbsp;</label><input type="text" id="xheTableWidth" style="width:40px;" value="200" /> <label for="xheTableHeight">Height:&nbsp; &nbsp; &nbsp;</label><input type="text" id="xheTableHeight" style="width:40px;" value="" /></div><div><label for="xheTableBorder">Border:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><input type="text" id="xheTableBorder" style="width:40px;" value="1" /></div><div><label for="xheTableCellSpacing">CellSpacing:</label><input type="text" id="xheTableCellSpacing" style="width:40px;" value="1" /> <label for="xheTableCellPadding">CellPadding:</label><input type="text" id="xheTableCellPadding" style="width:40px;" value="1" /></div><div><label for="xheTableAlign">Align:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><select id="xheTableAlign"><option selected="selected" value="">Default</option><option value="left">Left</option><option value="center">Center</option><option value="right">Right</option></select></div><div><label for="xheTableCaption">Caption:&nbsp;&nbsp;&nbsp;&nbsp;</label><input type="text" id="xheTableCaption" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>'),
85
+ b=e("#xheTableRows",a),c=e("#xheTableColumns",a),g=e("#xheTableHeaders",a),n=e("#xheTableWidth",a),m=e("#xheTableHeight",a),j=e("#xheTableBorder",a),i=e("#xheTableCellSpacing",a),l=e("#xheTableCellPadding",a),f=e("#xheTableAlign",a),h=e("#xheTableCaption",a);e("#xheSave",a).click(function(){d.loadBookmark();var o=h.val(),k=j.val(),q=b.val(),r=c.val(),t=g.val(),s=n.val(),w=m.val(),I=i.val(),N=l.val(),D=f.val();k="<table"+(k!==""?' border="'+k+'"':"")+(s!==""?' width="'+s+'"':"")+(w!==""?' height="'+
86
+ w+'"':"")+(I!==""?' cellspacing="'+I+'"':"")+(N!==""?' cellpadding="'+N+'"':"")+(D!==""?' align="'+D+'"':"")+">";if(o!=="")k+="<caption>"+o+"</caption>";if(t==="row"||t==="both"){k+="<tr>";for(o=0;o<r;o++)k+='<th scope="col"></th>';k+="</tr>";q--}k+="<tbody>";for(o=0;o<q;o++){k+="<tr>";for(s=0;s<r;s++)k+=s===0&&(t==="col"||t==="both")?'<th scope="row"></th>':"<td></td>";k+="</tr>"}k+="</tbody></table>";d.pasteHTML(k);d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAbout=function(){var a=
87
+ e('<div style="font:12px Arial;width:245px;word-wrap:break-word;word-break:break-all;outline:none;" role="dialog" tabindex="-1"><p><span style="font-size:20px;color:#1997DF;">xhEditor</span><br />v1.1.10 (build 110904)</p><p>xhEditor is a platform independent WYSWYG XHTML editor based by jQuery,released as Open Source under <a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">LGPL</a>.</p><p>Copyright &copy; <a href="http://xheditor.com/" target="_blank">xhEditor.com</a>. All rights reserved.</p></div>');
88
+ a.find("p").attr("role","presentation");d.showDialog(a,true);setTimeout(function(){a.focus()},100)};this.addShortcuts=function(a,b){a=a.toLowerCase();if(va[a]===ha)va[a]=[];va[a].push(b)};this.delShortcuts=function(a){delete va[a]};this.uploadInit=function(a,b,c){function g(f){if(V(f,"string"))f=[f];var h=false,o,k=f.length,q,r=[];(o=p.onUpload)&&o(f);for(o=0;o<k;o++){q=f[o];q=V(q,"string")?q:q.url;if(q.substr(0,1)==="!"){h=true;q=q.substr(1)}r.push(q)}a.val(r.join(" "));h&&a.closest(".xheDialog").find("#xheSave").click()}
89
+ var n=e('<span class="xheUpload"><input type="text" style="visibility:hidden;" tabindex="-1" /><input type="button" value="'+p.upBtnText+'" class="xheBtn" tabindex="-1" /></span>'),m=e(".xheBtn",n),j=p.html5Upload,i=j?p.upMultiple:1;a.after(n);m.before(a);b=b.replace(/{editorRoot}/ig,T);if(b.substr(0,1)==="!")m.click(function(){d.showIframeModal("Upload file",b.substr(1),g,null,null)});else{n.append('<input type="file"'+(i>1?' multiple=""':"")+' class="xheFile" size="13" name="filedata" tabindex="-1" />');
90
+ var l=e(".xheFile",n);l.change(function(){d.startUpload(l[0],b,c,g)});setTimeout(function(){a.closest(".xheDialog").bind("dragenter dragover",W).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(j&&f&&(h=f.files)&&h.length>0)d.startUpload(h,b,c,g);return false})},10)}};this.startUpload=function(a,b,c,g){function n(k,q){var r=Object,t=false;try{r=eval("("+k+")")}catch(s){}if(r.err===ha||r.msg===ha)alert(b+" upload interface error!\r\n\r\nreturn error:\r\n\r\n"+k);else if(r.err)alert(r.err);
91
+ else{m.push(r.msg);t=true}if(!t||q)d.removeModal();q&&t&&g(m);return t}var m=[],j=p.html5Upload,i=j?p.upMultiple:1,l,f=e('<div style="padding:22px 0;text-align:center;line-height:30px;">File uploading,please wait...<br /></div>'),h='<img src="'+Ha+'img/loading.gif">';if(!j||a.nodeType&&!((l=a.files)&&l[0].fileName)){if(!kb(a.value,c))return;f.append(h);c=new d.html4Upload(a,b,n)}else{l||(l=a);a=l.length;if(a>i){alert("Please do not upload more then "+i+" files.");return}for(i=0;i<a;i++)if(!kb(l[i].fileName,
92
+ c))return;var o=e('<div class="xheProgress"><div><span>0%</span></div></div>');f.append(o);c=new d.html5Upload("filedata",l,b,n,function(k){if(k.loaded>=0){var q=Math.round(k.loaded*100/k.total)+"%";e("div",o).css("width",q);e("span",o).text(q+" ( "+lb(k.loaded)+" / "+lb(k.total)+" )")}else o.replaceWith(h)})}d.showModal("File uploading(Esc cancel)",f,320,150);c.start()};this.html4Upload=function(a,b,c){var g="jUploadFrame"+(new Date).getTime(),n=this,m=e('<iframe name="'+g+'" class="xheHideArea" />').appendTo("body"),
93
+ j=e('<form action="'+b+'" target="'+g+'" method="post" enctype="multipart/form-data" class="xheHideArea"></form>').appendTo("body"),i=e(a),l=i.clone().attr("disabled","true");i.before(l).appendTo(j);this.remove=function(){if(n!==null){l.before(i).remove();m.remove();j.remove();n=null}};this.onLoad=function(){var f=m[0].contentWindow.document,h=e(f.body).text();f.write("");n.remove();c(h,true)};this.start=function(){j.submit();m.load(n.onLoad)};return this};this.html5Upload=function(a,b,c,g,n){function m(r,
94
+ t,s,w){i=new XMLHttpRequest;upload=i.upload;i.onreadystatechange=function(){i.readyState===4&&s(i.responseText)};if(upload)upload.onprogress=function(I){w(I.loaded)};else w(-1);i.open("POST",t);i.setRequestHeader("Content-Type","application/octet-stream");i.setRequestHeader("Content-Disposition",'attachment; name="'+a+'"; filename="'+r.fileName+'"');i.sendAsBinary?i.sendAsBinary(r.getAsBinary()):i.send(r)}function j(r){n&&n({loaded:h+r,total:o})}for(var i,l=0,f=b.length,h=0,o=0,k=this,q=0;q<f;q++)o+=
95
+ b[q].fileSize;this.remove=function(){if(i){i.abort();i=null}};this.uploadNext=function(r){if(r){h+=b[l-1].fileSize;j(0)}if((!r||r&&g(r,l===f)===true)&&l<f)m(b[l++],c,k.uploadNext,function(t){j(t)})};this.start=function(){k.uploadNext()}};this.showIframeModal=function(a,b,c,g,n,m){function j(){try{h.callback=i;h.unloadme=d.removeModal;e(h.document).keydown(Qa);o=h.name}catch(k){}}function i(k){h.document.write("");d.removeModal();k!=null&&c(k)}b=e('<iframe frameborder="0" src="'+b.replace(/{editorRoot}/ig,
96
+ T)+(/\?/.test(b)?"&":"?")+"parenthost="+location.host+'" style="width:100%;height:100%;display:none;" /><div class="xheModalIfmWait"></div>');var l=b.eq(0),f=b.eq(1);d.showModal(a,b,g,n,m);var h=l[0].contentWindow,o;j();l.load(function(){j();if(o){o=eval("("+unescape(o)+")");return i(o)}if(f.is(":visible")){l.show().focus();f.remove()}})};this.showModal=function(a,b,c,g,n){if(Ga)return false;d.panelState=Z;Z=false;ka=p.layerShadow;c=c?c:p.modalWidth;g=g?g:p.modalHeight;S=e('<div class="xheModal" style="width:'+
97
+ (c-1)+"px;height:"+g+"px;margin-left:-"+Math.ceil(c/2)+"px;"+(y&&Ca<7?"":"margin-top:-"+Math.ceil(g/2)+"px")+'">'+(p.modalTitle?'<div class="xheModalTitle"><span class="xheModalClose" title="Close (Esc)" tabindex="0" role="button"></span>'+a+"</div>":"")+'<div class="xheModalContent"></div></div>').appendTo("body");Sa=e('<div class="xheModalOverlay"></div>').appendTo("body");if(ka>0)Ra=e('<div class="xheModalShadow" style="width:'+S.outerWidth()+"px;height:"+S.outerHeight()+"px;margin-left:-"+(Math.ceil(c/
98
+ 2)-ka-2)+"px;"+(y&&Ca<7?"":"margin-top:-"+(Math.ceil(g/2)-ka-2)+"px")+'"></div>').appendTo("body");e(".xheModalContent",S).css("height",g-(p.modalTitle?e(".xheModalTitle").outerHeight():0)).html(b);if(y&&Ca===6)Ta=e("select:visible").css("visibility","hidden");e(".xheModalClose",S).click(d.removeModal);Sa.show();ka>0&&Ra.show();S.show();setTimeout(function(){S.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!=="hidden"}).eq(0).focus()},10);
99
+ Ga=true;Ua=n};this.removeModal=function(){Ta&&Ta.css("visibility","visible");S.html("").remove();ka>0&&Ra.remove();Sa.remove();Ua&&Ua();Ga=false;Z=d.panelState};this.showDialog=function(a,b){var c=e('<div class="xheDialog"></div>'),g=e(a),n=e("#xheSave",g);if(n.length===1){g.find("input[type=text],select").keypress(function(i){if(i.which===13){n.click();return false}});g.find("textarea").keydown(function(i){if(i.ctrlKey&&i.which===13){n.click();return false}});n.after(' <input type="button" id="xheCancel" value="Cancel" />');
100
+ e("#xheCancel",g).click(d.hidePanel);if(!p.clickCancelDialog){Fa=false;var m=e('<div class="xheFixCancel"></div>').appendTo("body").mousedown(W),j=O.offset();m.css({left:j.left,top:j.top,width:O.outerWidth(),height:O.outerHeight()})}c.mousedown(function(){xa=true})}c.append(g);d.showPanel(c,b)};this.showPanel=function(a,b){if(!M.target)return false;L.html("").append(a).css("left",-999).css("top",-999);ja=e(M.target).closest("a").addClass("xheActive");var c=ja.offset(),g=c.left;c=c.top;c+=ja.outerHeight()-
101
+ 1;sa.css({left:g+1,top:c,width:ja.width()}).show();var n=document.documentElement,m=document.body;if(g+L.outerWidth()>(window.pageXOffset||n.scrollLeft||m.scrollLeft)+(n.clientWidth||m.clientWidth))g-=L.outerWidth()-ja.outerWidth();n=p.layerShadow;n>0&&ra.css({left:g+n,top:c+n,width:L.outerWidth(),height:L.outerHeight()}).show();L.css({left:g,top:c}).show();b||setTimeout(function(){L.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!=="hidden"}).eq(0).focus()},
102
+ 10);cb=Z=true};this.hidePanel=function(){if(Z){ja.removeClass("xheActive");ra.hide();sa.hide();L.hide();Z=false;if(!Fa){e(".xheFixCancel").remove();Fa=true}cb=xa=false;da=null;d.focus();d.loadBookmark()}};this.exec=function(a){d.hidePanel();var b=ta[a];if(!b)return false;if(M===null){M={};var c=C.find(".xheButton[cmd="+a+"]");if(c.length===1)M.target=c}if(b.e)b.e.call(d);else{a=a.toLowerCase();switch(a){case "cut":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(g){alert("Currently not supported by your browser, use keyboard shortcuts(Ctrl+X) instead.")}break;
103
+ case "copy":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(n){alert("Currently not supported by your browser, use keyboard shortcuts(Ctrl+C) instead.")}break;case "paste":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(m){alert("Currently not supported by your browser, use keyboard shortcuts(Ctrl+V) instead.")}break;case "pastetext":window.clipboardData?d.pasteText(window.clipboardData.getData("Text",true)):d.showPastetext();break;case "blocktag":var j=
104
+ [];e.each(zb,function(f,h){j.push({s:"<"+h.n+">"+h.t+"</"+h.n+">",v:"<"+h.n+">",t:h.t})});d.showMenu(j,function(f){d._exec("formatblock",f)});break;case "fontface":var i=[];e.each(Ab,function(f,h){h.c=h.c?h.c:h.n;i.push({s:'<span style="font-family:'+h.c+'">'+h.n+"</span>",v:h.c,t:h.n})});d.showMenu(i,function(f){d._exec("fontname",f)});break;case "fontsize":var l=[];e.each($,function(f,h){l.push({s:'<span style="font-size:'+h.s+';">'+h.t+"("+h.s+")</span>",v:f+1,t:h.t})});d.showMenu(l,function(f){d._exec("fontsize",
105
+ f)});break;case "fontcolor":d.showColor(function(f){d._exec("forecolor",f)});break;case "backcolor":d.showColor(function(f){if(y)d._exec("backcolor",f);else{Xa(true);d._exec("hilitecolor",f);Xa(false)}});break;case "align":d.showMenu(Bb,function(f){d._exec(f)});break;case "list":d.showMenu(Cb,function(f){d._exec(f)});break;case "link":d.showLink();break;case "anchor":d.showAnchor();break;case "img":d.showImg();break;case "flash":d.showEmbed("Flash",'<div><label for="xheFlashUrl">Flash URL:</label><input type="text" id="xheFlashUrl" value="http://" class="xheText" /></div><div><label for="xheFlashWidth">Width:&nbsp; &nbsp; </label><input type="text" id="xheFlashWidth" style="width:40px;" value="480" /> <label for="xheFlashHeight">Height:&nbsp; &nbsp;</label><input type="text" id="xheFlashHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>',
106
+ "application/x-shockwave-flash","clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000",' wmode="opaque" quality="high" menu="false" play="true" loop="true" allowfullscreen="true"',p.upFlashUrl,p.upFlashExt);break;case "media":d.showEmbed("Media",'<div><label for="xheMediaUrl">Media URL:</label><input type="text" id="xheMediaUrl" value="http://" class="xheText" /></div><div><label for="xheMediaWidth">Width:&nbsp; &nbsp; </label><input type="text" id="xheMediaWidth" style="width:40px;" value="480" /> <label for="xheMediaHeight">Height:&nbsp; &nbsp;</label><input type="text" id="xheMediaHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="Ok" /></div>',
107
+ "application/x-mplayer2","clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",' enablecontextmenu="false" autostart="false"',p.upMediaUrl,p.upMediaExt);break;case "hr":d.pasteHTML("<hr />");break;case "emot":d.showEmot();break;case "table":d.showTable();break;case "source":d.toggleSource();break;case "preview":d.showPreview();break;case "print":la.print();break;case "fullscreen":d.toggleFullscreen();break;case "about":d.showAbout();break;default:d._exec(a)}}M=null};this._exec=function(a,b,c){c||d.focus();
108
+ return b!==ha?v.execCommand(a,false,b):v.execCommand(a,false,null)}};Ea.settings={skin:"default",tools:"full",clickCancelDialog:true,linkTag:false,internalScript:false,inlineScript:false,internalStyle:true,inlineStyle:true,showBlocktag:false,forcePtag:true,upLinkExt:"zip,rar,txt",upImgExt:"jpg,jpeg,gif,png",upFlashExt:"swf",upMediaExt:"wmv,avi,wma,mp3,mid",modalWidth:350,modalHeight:220,modalTitle:true,defLinkText:"Click here",layerShadow:3,emotMark:false,upBtnText:"Upload",cleanPaste:2,hoverExecDelay:100,
109
+ html5Upload:true,upMultiple:99};window.xheditor=Ea;e(function(){e.fn.oldVal=e.fn.val;e.fn.val=function(B){var A=this,J;if(B===ha)return A[0]&&(J=A[0].xheditor)?J.getSource():A.oldVal();return A.each(function(){(J=this.xheditor)?J.setSource(B):A.oldVal(B)})};e("textarea").each(function(){var B=e(this),A=B.attr("class");if(A&&(A=A.match(/(?:^|\s)xheditor(?:\-(m?full|simple|mini))?(?:\s|$)/i)))B.xheditor(A[1]?{tools:A[1]}:null)})})})(jQuery);
@@ -0,0 +1,112 @@
1
+ (function(e,ha){if(window.xheditor)return false;var xb=navigator.userAgent.toLowerCase().indexOf("mobile")>-1,qa=e.browser,Ca=parseFloat(qa.version),y=qa.msie,Da=qa.mozilla,Y=qa.safari,eb=qa.opera;e.fn.xheditor=function(B){if(xb)return false;var A=[];this.each(function(){if(e.nodeName(this,"TEXTAREA"))if(B===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(this.xheditor)A.push(this.xheditor);else{var J=/({.*})/.exec(e(this).attr("class"));if(J){try{J=eval("("+J[1]+")")}catch(Qa){}B=
2
+ e.extend({},J,B)}J=new Ea(this,B);if(J.init()){this.xheditor=J;A.push(J)}}});if(A.length===0)A=false;if(A.length===1)A=A[0];return A};var ia=0,Z=false,Fa=true,Ga=false,fb=false,L,ra,sa,ja,S,Ra,ka,Sa,Ta,Ua,T;e("script[src*=xheditor]").each(function(){var B=this.src;if(B.match(/xheditor[^\/]*\.js/i)){T=B.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});if(y)try{document.execCommand("BackgroundImageCache",false,true)}catch(Kb){}var yb={27:"esc",9:"tab",32:"space",13:"enter",8:"backspace",
3
+ 145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},gb=["#FFFFFF","#CCCCCC","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66",
4
+ "#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#99FF99","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],zb=[{n:"p",t:"\u666e\u901a\u6bb5\u843d"},
5
+ {n:"h1",t:"\u6807\u98981"},{n:"h2",t:"\u6807\u98982"},{n:"h3",t:"\u6807\u98983"},{n:"h4",t:"\u6807\u98984"},{n:"h5",t:"\u6807\u98985"},{n:"h6",t:"\u6807\u98986"},{n:"pre",t:"\u5df2\u7f16\u6392\u683c\u5f0f"},{n:"address",t:"\u5730\u5740"}],Ab=[{n:"\u5b8b\u4f53",c:"SimSun"},{n:"\u4eff\u5b8b\u4f53",c:"FangSong_GB2312"},{n:"\u9ed1\u4f53",c:"SimHei"},{n:"\u6977\u4f53",c:"KaiTi_GB2312"},{n:"\u5fae\u8f6f\u96c5\u9ed1",c:"Microsoft YaHei"},{n:"Arial"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"},
6
+ {n:"System"},{n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],$=[{n:"x-small",s:"10px",t:"\u6781\u5c0f"},{n:"small",s:"13px",t:"\u7279\u5c0f"},{n:"medium",s:"16px",t:"\u5c0f"},{n:"large",s:"18px",t:"\u4e2d"},{n:"x-large",s:"24px",t:"\u5927"},{n:"xx-large",s:"32px",t:"\u7279\u5927"},{n:"-webkit-xxx-large",s:"48px",t:"\u6781\u5927"}],Bb=[{s:"\u5de6\u5bf9\u9f50",v:"justifyleft"},{s:"\u5c45\u4e2d",v:"justifycenter"},{s:"\u53f3\u5bf9\u9f50",v:"justifyright"},{s:"\u4e24\u7aef\u5bf9\u9f50",v:"justifyfull"}],
7
+ Cb=[{s:"\u6570\u5b57\u5217\u8868",v:"insertOrderedList"},{s:"\u7b26\u53f7\u5217\u8868",v:"insertUnorderedList"}],Db={"default":{name:"\u9ed8\u8ba4",width:24,height:24,line:7,list:{smile:"\u5fae\u7b11",tongue:"\u5410\u820c\u5934",titter:"\u5077\u7b11",laugh:"\u5927\u7b11",sad:"\u96be\u8fc7",wronged:"\u59d4\u5c48",fastcry:"\u5feb\u54ed\u4e86",cry:"\u54ed",wail:"\u5927\u54ed",mad:"\u751f\u6c14",knock:"\u6572\u6253",curse:"\u9a82\u4eba",crazy:"\u6293\u72c2",angry:"\u53d1\u706b",ohmy:"\u60ca\u8bb6",awkward:"\u5c34\u5c2c",
8
+ panic:"\u60ca\u6050",shy:"\u5bb3\u7f9e",cute:"\u53ef\u601c",envy:"\u7fa1\u6155",proud:"\u5f97\u610f",struggle:"\u594b\u6597",quiet:"\u5b89\u9759",shutup:"\u95ed\u5634",doubt:"\u7591\u95ee",despise:"\u9119\u89c6",sleep:"\u7761\u89c9",bye:"\u518d\u89c1"}}},ta={Cut:{t:"\u526a\u5207 (Ctrl+X)"},Copy:{t:"\u590d\u5236 (Ctrl+C)"},Paste:{t:"\u7c98\u8d34 (Ctrl+V)"},Pastetext:{t:"\u7c98\u8d34\u6587\u672c",h:y?0:1},Blocktag:{t:"\u6bb5\u843d\u6807\u7b7e",h:1},Fontface:{t:"\u5b57\u4f53",h:1},FontSize:{t:"\u5b57\u4f53\u5927\u5c0f",
9
+ h:1},Bold:{t:"\u52a0\u7c97 (Ctrl+B)",s:"Ctrl+B"},Italic:{t:"\u659c\u4f53 (Ctrl+I)",s:"Ctrl+I"},Underline:{t:"\u4e0b\u5212\u7ebf (Ctrl+U)",s:"Ctrl+U"},Strikethrough:{t:"\u5220\u9664\u7ebf"},FontColor:{t:"\u5b57\u4f53\u989c\u8272",h:1},BackColor:{t:"\u80cc\u666f\u989c\u8272",h:1},SelectAll:{t:"\u5168\u9009 (Ctrl+A)"},Removeformat:{t:"\u5220\u9664\u6587\u5b57\u683c\u5f0f"},Align:{t:"\u5bf9\u9f50",h:1},List:{t:"\u5217\u8868",h:1},Outdent:{t:"\u51cf\u5c11\u7f29\u8fdb"},Indent:{t:"\u589e\u52a0\u7f29\u8fdb"},
10
+ Link:{t:"\u8d85\u94fe\u63a5 (Ctrl+L)",s:"Ctrl+L",h:1},Unlink:{t:"\u53d6\u6d88\u8d85\u94fe\u63a5"},Anchor:{t:"\u951a\u70b9",h:1},Img:{t:"\u56fe\u7247",h:1},Flash:{t:"Flash\u52a8\u753b",h:1},Media:{t:"\u591a\u5a92\u4f53\u6587\u4ef6",h:1},Hr:{t:"\u63d2\u5165\u6c34\u5e73\u7ebf"},Emot:{t:"\u8868\u60c5",s:"ctrl+e",h:1},Table:{t:"\u8868\u683c",h:1},Source:{t:"\u6e90\u4ee3\u7801"},Preview:{t:"\u9884\u89c8"},Print:{t:"\u6253\u5370 (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"\u5168\u5c4f\u7f16\u8f91 (Esc)",s:"Esc"},
11
+ About:{t:"\u5173\u4e8e xhEditor"}},Va={mini:"Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Link,Img,Emot",full:"Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen"};Va.mfull=
12
+ Va.full.replace(/\|(,Align)/i,"/$1");var Eb={a:"Link",img:"Img",embed:"Embed"},Fb={"<":"&lt;",">":"&gt;",'"':"&quot;","\u00ae":"&reg;","\u00a9":"&copy;"},Gb=/[<>"\u00ae\u00a9]/g,Ea=function(B,A){function J(a){a=a.target;var b=Eb[a.tagName.toLowerCase()];if(b){if(b==="Embed")b={"application/x-shockwave-flash":"Flash","application/x-mplayer2":"Media"}[a.type.toLowerCase()];d.exec(b)}}function Qa(a){if(a.which===27){if(Ga)d.removeModal();else Z&&d.hidePanel();return false}}function hb(){setTimeout(d.setSource,
13
+ 10)}function aa(){d.getSource()}function ib(a){var b,c,g;if(a&&(b=a.originalEvent.clipboardData)&&(c=b.items)&&(g=c[0])&&g.kind=="file"&&g.type.match(/^image\//i)){a=g.getAsFile();b=new FileReader;b.onload=function(){var j='<img src="'+event.target.result+'">';j=jb(j);d.pasteHTML(j)};b.readAsDataURL(a);return false}var n=p.cleanPaste;if(n===0||F||Wa)return true;Wa=true;d.saveBookmark();b=y?"pre":"div";var m=e("<"+b+' class="xhe-paste">\ufeff\ufeff</'+b+">",v).appendTo(v.body);b=m[0];c=d.getSel();
14
+ g=d.getRng(true);m.css("top",ba.scrollTop());if(y){g.moveToElementText(b);g.select();g.execCommand("Paste");if(b.innerHTML=="\ufeff\ufeff"){m.remove();return}a.preventDefault()}else{g.selectNodeContents(b);c.removeAllRanges();c.addRange(g)}setTimeout(function(){var j=n===3,i;if(j)i=m.text();else{var l=[];e(".xhe-paste",v.body).each(function(f,h){e(h).find(".xhe-paste").length==0&&l.push(h.innerHTML)});i=l.join("<br />")}m.remove();d.loadBookmark();if(j)d.pasteText(i);else{i=d.cleanHTML(i);i=d.cleanWord(i);
15
+ i=d.formatXHTML(i);if(!p.onPaste||p.onPaste&&(i=p.onPaste(i))!==false){i=jb(i);d.pasteHTML(i)}}Wa=false},0)}function jb(a){var b=p.localUrlTest,c=p.remoteImgSaveUrl;if(b&&c){var g=[],n=0;a=a.replace(/(<img)((?:\s+[^>]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(m,j,i,l,f){if(/^(https?|data:image)/i.test(l)&&!b.test(l)){g[n]=l;i=i.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+Ha+'img/waiting.gif" remoteimg="'+n++ +'"')}return j+i+f});g.length>0&&e.post(c,
16
+ {urls:g.join("|")},function(m){m=m.split("|");e("img[remoteimg]",d.doc).each(function(){var j=e(this);U(j,"src",m[j.attr("remoteimg")]);j.removeAttr("remoteimg")})})}return a}function Xa(a){try{d._exec("styleWithCSS",a,true)}catch(b){try{d._exec("useCSS",!a,true)}catch(c){}}}function Ya(){if(Za&&!F){Xa(false);try{d._exec("enableObjectResizing",true,true)}catch(a){}if(y)try{d._exec("BackgroundImageCache",true,true)}catch(b){}}}function Hb(a){if(F||a.which!==13||a.shiftKey||a.ctrlKey||a.altKey)return true;
17
+ a=d.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(p.forcePtag)a.length===0&&d._exec("formatblock","<p>");else{d.pasteHTML("<br />");y&&a.length>0&&d.getRng().parentElement().childNodes.length===2&&d.pasteHTML("<br />");return false}}function $a(){if(!Da&&!Y){ua&&O.height("100%").css("height",O.outerHeight()-C.outerHeight());y&&C.hide().show()}}function Ib(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var b=d.getSel(),c=d.getRng(true);c.selectNode(a);b.removeAllRanges();
18
+ b.addRange(c)}}function U(a,b,c){if(!b)return false;var g="_xhe_"+b;if(c){if(Ia)c=ca(c,Ia,P);a.attr(b,P?ca(c,"abs",P):c).removeAttr(g).attr(g,c)}return a.attr(g)||a.attr(b)}function ab(){Fa&&d.hidePanel()}function Jb(a){if(F)return true;var b=a.which,c=yb[b];b=c?c:String.fromCharCode(b).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=b;a=va[sKey];for(var g in a){g=a[g];if(e.isFunction(g)){if(g.call(d)===false)return false}else{d.exec(g);
19
+ return false}}}function V(a,b){var c=typeof a;if(!b)return c!="undefined";if(b==="array"&&a.hasOwnProperty&&a instanceof Array)return true;return c===b}function ca(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||a.match(/^#/i))return a;var g=c?e('<a href="'+c+'" />')[0]:location;c=g.protocol;var n=g.host,m=g.hostname,j=g.port;g=g.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");if(j==="")j="80";if(g==="")g="/";else if(g.charAt(0)!=="/")g="/"+g;a=e.trim(a);if(b!=="abs")a=a.replace(RegExp(c+
20
+ "\\/\\/"+m.replace(/\./g,"\\.")+"(?::"+j+")"+(j==="80"?"?":"")+"(/|$)","i"),"/");if(b==="rel")a=a.replace(RegExp("^"+g.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(b!=="rel"){a.match(/^(https?:\/\/|\/)/i)||(a=g+a);if(a.charAt(0)==="/"){m=[];a=a.split("/");var i=a.length;for(g=0;g<i;g++){j=a[g];if(j==="..")m.pop();else j!==""&&j!=="."&&m.push(j)}a[i-1]===""&&m.push("");a="/"+m.join("/")}}if(b==="abs"&&!a.match(/^https?:\/\//i))a=c+"//"+n+a;return a=a.replace(/(https?:\/\/[^:\/?#]+):80(\/|$)/i,
21
+ "$1$2")}function kb(a,b){if(b==="*"||a.match(RegExp(".("+b.replace(/,/g,"|")+")$","i")))return true;else{alert("\u4e0a\u4f20\u6587\u4ef6\u6269\u5c55\u540d\u5fc5\u9700\u4e3a: "+b);return false}}function lb(a){var b=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(b))).toFixed(2)+["Byte","KB","MB","GB","TB","PB"][b]}function W(){return false}var d=this,Q=e(B),mb=Q.closest("form"),C,O,la,ba,v,ma,na,Za=false,F=false,ua=false,Wa=false,bb,wa=false,nb="",M=null,Ja,xa=false,cb=false,
22
+ oa=null,da=null,X=0,p=d.settings=e.extend({},Ea.settings,A),Ka=p.plugins,La=[];if(Ka){ta=e.extend({},ta,Ka);e.each(Ka,function(a){La.push(a)});La=La.join(",")}if(p.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var ob=Va[e.trim(p.tools)];p.tools=p.tools.match(/m?full/i)&&Ka?ob.replace("Table","Table,"+La):ob}p.tools.match(/(^|,)\s*About\s*(,|$)/i)||(p.tools+=",About");p.tools=p.tools.split(",");if(p.editorRoot)T=p.editorRoot;T=ca(T,"abs");if(p.urlBase)p.urlBase=ca(p.urlBase,"abs");var pb="xheCSS_"+
23
+ p.skin,ya="xhe"+ia+"_container",qb="xhe"+ia+"_Tool",rb="xhe"+ia+"_iframearea",sb="xhe"+ia+"_iframe",Ma="xhe"+ia+"_fixffcursor",za="",pa="",Ha=T+"xheditor_skin/"+p.skin+"/",Na=Db,Ia=p.urlType,P=p.urlBase,ea=p.emotPath;ea=ea?ea:T+"xheditor_emot/";var db="";Na=e.extend({},Na,p.emots);ea=ca(ea,"rel",P?P:null);if(wa=p.showBlocktag)pa+=" showBlocktag";var va=[];this.init=function(){e("#"+pb).length===0&&e("head").append('<link id="'+pb+'" rel="stylesheet" type="text/css" href="'+Ha+'ui.css" />');var a=
24
+ Q.outerWidth(),b=Q.outerHeight();a=p.width||B.style.width||(a>10?a:0);X=p.height||B.style.height||(b>10?b:150);if(V(a,"number"))a+="px";if(V(X,"string"))X=X.replace(/[^\d]+/g,"");b=p.background||B.style.background;var c=['<span class="xheGStart"/>'],g,n,m=/\||\//i;e.each(p.tools,function(f,h){h.match(m)&&c.push('<span class="xheGEnd"/>');if(h==="|")c.push('<span class="xheSeparator"/>');else if(h==="/")c.push("<br />");else{g=ta[h];if(!g)return;n=g.c?g.c:"xheIcon xheBtn"+h;c.push('<span><a href="#" title="'+
25
+ g.t+'" cmd="'+h+'" class="xheButton xheEnabled" tabindex="-1" role="button"><span class="'+n+'" unselectable="on" style="font-size:0;color:transparent;text-indent:-999px;">'+g.t+"</span></a></span>");g.s&&d.addShortcuts(g.s,h)}h.match(m)&&c.push('<span class="xheGStart"/>')});c.push('<span class="xheGEnd"/><br />');Q.after(e('<input type="text" id="'+Ma+'" style="position:absolute;display:none;" /><span id="'+ya+'" class="xhe_'+p.skin+'" style="display:none"><table cellspacing="0" cellpadding="0" class="xheLayout" style="'+
26
+ (a!="0px"?"width:"+a+";":"")+"height:"+X+'px;" role="presentation"><tr><td id="'+qb+'" class="xheTool" unselectable="on" style="height:1px;" role="presentation"></td></tr><tr><td id="'+rb+'" class="xheIframeArea" role="presentation"><iframe frameborder="0" id="'+sb+'" src="javascript:;" style="width:100%;"></iframe></td></tr></table></span>'));C=e("#"+qb);O=e("#"+rb);za='<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><link rel="stylesheet" href="'+Ha+'iframe.css"/>';if(a=p.loadCSS)if(V(a,
27
+ "array"))for(var j in a)za+='<link rel="stylesheet" href="'+a[j]+'"/>';else za+=a.match(/\s*<style(\s+[^>]*?)?>[\s\S]+?<\/style>\s*/i)?a:'<link rel="stylesheet" href="'+a+'"/>';j="<html><head>"+za+"<title>\u53ef\u89c6\u5316\u7f16\u8f91\u5668,alt+1\u52309\u952e,\u5207\u6362\u5230\u5de5\u5177\u533a,tab\u952e,\u9009\u62e9\u6309\u94ae,esc\u952e,\u8fd4\u56de\u7f16\u8f91 "+(p.readTip?p.readTip:"")+"</title>";if(b)j+="<style>body{background:"+b+";}</style>";j+='</head><body spellcheck="0" class="editMode'+
28
+ pa+'"></body></html>';d.win=la=e("#"+sb)[0].contentWindow;ba=e(la);try{this.doc=v=la.document;ma=e(v);v.open();v.write(j);v.close();if(y)v.body.contentEditable="true";else v.designMode="On"}catch(i){}setTimeout(Ya,300);d.setSource();la.setInterval=null;C.append(c.join("")).bind("mousedown contextmenu",W).click(function(f){var h=e(f.target).closest("a");if(h.is(".xheEnabled")){clearTimeout(Ja);C.find("a").attr("tabindex","-1");M=f;d.exec(h.attr("cmd"))}return false});C.find(".xheButton").hover(function(f){var h=
29
+ e(this),o=p.hoverExecDelay,k=da;da=null;if(o===-1||xa||!h.is(".xheEnabled"))return false;if(k&&k>10){xa=true;setTimeout(function(){xa=false},100);return false}var q=h.attr("cmd");if(ta[q].h!==1){d.hidePanel();return false}if(cb)o=0;if(o>=0)Ja=setTimeout(function(){M=f;oa={x:M.clientX,y:M.clientY};d.exec(q)},o)},function(){oa=null;Ja&&clearTimeout(Ja)}).mousemove(function(f){if(oa){var h={x:f.clientX-oa.x,y:f.clientY-oa.y};if(Math.abs(h.x)>1||Math.abs(h.y)>1){if(h.x>0&&h.y>0){h=Math.round(Math.atan(h.y/
30
+ h.x)/0.017453293);da=da?(da+h)/2:h}else da=null;oa={x:f.clientX,y:f.clientY}}}});L=e("#xhePanel");ra=e("#xheShadow");sa=e("#xheCntLine");if(L.length===0){L=e('<div id="xhePanel"></div>').mousedown(function(f){f.stopPropagation()});ra=e('<div id="xheShadow"></div>');sa=e('<div id="xheCntLine"></div>');setTimeout(function(){e(document.body).append(L).append(ra).append(sa)},10)}e("#"+ya).show();Q.hide();O.css("height",X-C.outerHeight());y&Ca<8&&setTimeout(function(){O.css("height",X-C.outerHeight())},
31
+ 1);Q.focus(d.focus);mb.submit(aa).bind("reset",hb);p.submitID&&e("#"+p.submitID).click(aa);e(window).bind("unload beforeunload",aa).bind("resize",$a);e(document).mousedown(ab);if(!fb){e(document).keydown(Qa);fb=true}ba.focus(function(){p.focus&&p.focus()}).blur(function(){p.blur&&p.blur()});Y&&ba.click(Ib);ma.mousedown(ab).keydown(Jb).keypress(Hb).dblclick(J).bind("mousedown click",function(f){Q.trigger(f.type)});if(y){ma.keydown(function(f){var h=d.getRng();if(f.which===8&&h.item){e(h.item(0)).remove();
32
+ return false}});var l=function(f){f=e(f.target);var h;if(h=f.css("width"))f.css("width","").attr("width",h.replace(/[^0-9%]+/g,""));if(h=f.css("height"))f.css("height","").attr("height",h.replace(/[^0-9%]+/g,""))};ma.bind("controlselect",function(f){f=f.target;e.nodeName(f,"IMG")&&e(f).unbind("resizeend",l).bind("resizeend",l)})}ma.keydown(function(f){var h=f.which;if(f.altKey&&h>=49&&h<=57){C.find("a").attr("tabindex","0");C.find(".xheGStart").eq(h-49).next().find("a").focus();v.title="\ufeff\ufeff";
33
+ return false}}).click(function(){C.find("a").attr("tabindex","-1")});C.keydown(function(f){var h=f.which;if(h==27){C.find("a").attr("tabindex","-1");d.focus()}else if(f.altKey&&h>=49&&h<=57){C.find(".xheGStart").eq(h-49).next().find("a").focus();return false}});j=e(v.documentElement);eb?j.bind("keydown",function(f){f.ctrlKey&&f.which===86&&ib()}):j.bind("paste",ib);p.disableContextmenu&&j.bind("contextmenu",W);p.html5Upload&&j.bind("dragenter dragover",function(f){var h;if((h=f.originalEvent.dataTransfer.types)&&
34
+ e.inArray("Files",h)!==-1)return false}).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(f&&(h=f.files)&&h.length>0){var o,k;f=["Link","Img","Flash","Media"];var q=[],r;for(o in f){k=f[o];p["up"+k+"Url"]&&p["up"+k+"Url"].match(/^[^!].*/i)&&q.push(k+":,"+p["up"+k+"Ext"])}if(q.length===0)return false;else r=q.join(",");k=function(t){var s,w;for(o=0;o<t.length;o++){s=t[o].fileName.replace(/.+\./,"");if(s=r.match(RegExp("(\\w+):[^:]*,"+s+"(?:,|$)","i")))if(w){if(w!==s[1])return 2}else w=
35
+ s[1];else return 1}return w}(h);if(k===1)alert("\u4e0a\u4f20\u6587\u4ef6\u7684\u6269\u5c55\u540d\u5fc5\u9700\u4e3a\uff1a"+r.replace(/\w+:,/g,""));else if(k===2)alert("\u6bcf\u6b21\u53ea\u80fd\u62d6\u653e\u4e0a\u4f20\u540c\u4e00\u7c7b\u578b\u6587\u4ef6");else k&&d.startUpload(h,p["up"+k+"Url"],"*",function(t){var s=[],w;(w=p.onUpload)&&w(t);for(o in t){w=t[o];url=V(w,"string")?w:w.url;if(url.substr(0,1)==="!")url=url.substr(1);s.push(url)}d.exec(k);e("#xhe"+k+"Url").val(s.join(" "));e("#xheSave").click()});
36
+ return false}});(j=p.shortcuts)&&e.each(j,function(f,h){d.addShortcuts(f,h)});ia++;Za=true;if(p.fullscreen)d.toggleFullscreen();else p.sourceMode&&setTimeout(d.toggleSource,20);return true};this.remove=function(){d.hidePanel();aa();Q.unbind("focus",d.focus);mb.unbind("submit",aa).unbind("reset",hb);p.submitID&&e("#"+p.submitID).unbind("mousedown",aa);e(window).unbind("unload beforeunload",aa).unbind("resize",$a);e(document).unbind("mousedown",ab);e("#"+ya).remove();e("#"+Ma).remove();Q.show();Za=
37
+ false};this.saveBookmark=function(){if(!F){d.focus();var a=d.getRng();a=a.cloneRange?a.cloneRange():a;na={top:ba.scrollTop(),rng:a}}};this.loadBookmark=function(){if(!(F||!na)){d.focus();var a=na.rng;if(y)a.select();else{var b=d.getSel();b.removeAllRanges();b.addRange(a)}ba.scrollTop(na.top);na=null}};this.focus=function(){F?e("#sourceCode",v).focus():ba.focus();if(y){var a=d.getRng();a.parentElement&&a.parentElement().ownerDocument!==v&&d.setTextCursor()}return false};this.setTextCursor=function(a){var b=
38
+ d.getRng(true),c=v.body;if(y)b.moveToElementText(c);else{for(var g=a?"lastChild":"firstChild";c.nodeType!=3&&c[g];)c=c[g];b.selectNode(c)}b.collapse(a?false:true);if(y)b.select();else{a=d.getSel();a.removeAllRanges();a.addRange(b)}};this.getSel=function(){return v.selection?v.selection:la.getSelection()};this.getRng=function(a){var b,c;try{if(!a){b=d.getSel();c=b.createRange?b.createRange():b.rangeCount>0?b.getRangeAt(0):null}c||(c=v.body.createTextRange?v.body.createTextRange():v.createRange())}catch(g){}return c};
39
+ this.getParent=function(a){var b=d.getRng(),c;if(y)c=b.item?b.item(0):b.parentElement();else{c=b.commonAncestorContainer;if(!b.collapsed)if(b.startContainer===b.endContainer&&b.startOffset-b.endOffset<2&&b.startContainer.hasChildNodes())c=b.startContainer.childNodes[b.startOffset]}a=a?a:"*";c=e(c);c.is(a)||(c=e(c).closest(a));return c};this.getSelect=function(a){var b=d.getSel(),c=d.getRng(),g=true;g=!c||c.item?false:!b||c.boundingWidth===0||c.collapsed;if(a==="text")return g?"":c.text||(b.toString?
40
+ b.toString():"");if(c.cloneContents){a=e("<div></div>");(c=c.cloneContents())&&a.append(c);c=a.html()}else c=V(c.item)?c.item(0).outerHTML:V(c.htmlText)?c.htmlText:c.toString();if(g)c="";c=d.processHTML(c,"read");c=d.cleanHTML(c);return c=d.formatXHTML(c)};this.pasteHTML=function(a,b){if(F)return false;d.focus();a=d.processHTML(a,"write");var c=d.getSel(),g=d.getRng();if(b!==ha){if(g.item){var n=g.item(0);g=d.getRng(true);g.moveToElementText(n);g.select()}g.collapse(b)}a+="<"+(y?"img":"span")+' id="_xhe_temp" width="0" height="0" />';
41
+ if(g.insertNode){if(e(g.startContainer).closest("style,script").length>0)return false;g.deleteContents();g.insertNode(g.createContextualFragment(a))}else{if(c.type.toLowerCase()==="control"){c.clear();g=d.getRng()}g.pasteHTML(a)}n=e("#_xhe_temp",v);var m=n[0];if(y){g.moveToElementText(m);g.select()}else{g.selectNode(m);c.removeAllRanges();c.addRange(g)}n.remove()};this.pasteText=function(a,b){a||(a="");a=d.domEncode(a);a=a.replace(/\r?\n/g,"<br />");d.pasteHTML(a,b)};this.appendHTML=function(a){if(F)return false;
42
+ d.focus();a=d.processHTML(a,"write");e(v.body).append(a);d.setTextCursor(true)};this.domEncode=function(a){return a.replace(Gb,function(b){return Fb[b]})};this.setSource=function(a){na=null;if(typeof a!=="string"&&a!=="")a=B.value;if(F)e("#sourceCode",v).val(a);else{if(p.beforeSetSource)a=p.beforeSetSource(a);a=d.cleanHTML(a);a=d.formatXHTML(a);a=d.processHTML(a,"write");if(y){v.body.innerHTML='<img id="_xhe_temp" width="0" height="0" />'+a+"\n";e("#_xhe_temp",v).remove()}else v.body.innerHTML=a}};
43
+ this.processHTML=function(a,b){if(b==="write"){a=a.replace(/(<(\/?)(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g,function(m,j,i,l,f,h,o){l=l.toLowerCase();if(Da)if(l==="strong")l="b";else{if(l==="em")l="i"}else if(Y)if(l==="strong"){l="span";i||(f+=' class="Apple-style-span" style="font-weight: bold;"')}else if(l==="em"){l="span";i||(f+=' class="Apple-style-span" style="font-style: italic;"')}else if(l==="u"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: underline;"')}else if(l===
44
+ "strike"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: line-through;"')}var k,q="";if(l==="del")l="strike";else if(l==="img")f=f.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(t,s){k=s.match(/^(["']?)(.*)\1/)[2];k=k.split(",");if(!k[1]){k[1]=k[0];k[0]=""}if(k[0]==="default")k[0]="";return p.emotMark?t:""});else if(l==="a"){if(!f.match(/ href=[^ ]/i)&&f.match(/ name=[^ ]/i))q+=" xhe-anchor";if(o)h="></a>"}else if(l==="table"&&!i){m=f.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i);
45
+ if(!m||m[1].match(/^(["']?)\s*0\s*\1$/))q+=" xhe-border"}var r;f=f.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(t,s,w){s=s.toLowerCase();w=w.match(/^(["']?)(.*)\1/)[2];aft="";if(y&&s.match(/^(disabled|checked|readonly|selected)$/)&&w.match(/^(false|0)$/i))return"";if(l==="img"&&k&&s==="src")return"";if(s.match(/^(src|href)$/)){aft=" _xhe_"+s+'="'+w+'"';if(P)w=ca(w,"abs",P)}if(q&&s==="class"){w+=" "+q;q=""}if(Y&&s==="style")if(l==="span"&&w.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i))r=
46
+ true;return" "+s+'="'+w+'"'+aft});if(k){m=ea+(k[0]?k[0]:"default")+"/"+k[1]+".gif";f+=' src="'+m+'" _xhe_src="'+m+'"'}if(r)f+=' class="Apple-style-span"';if(q)f+=' class="'+q+'"';return"<"+i+l+f+h});if(y)a=a.replace(/&apos;/ig,"&#39;");if(!Y){var c=function(m,j,i,l){j="";var f,h;if(f=i.match(/font-family\s*:\s*([^;"]+)/i))j+=' face="'+f[1]+'"';if(f=i.match(/font-size\s*:\s*([^;"]+)/i)){f=f[1].toLowerCase();for(var o=0;o<$.length;o++)if(f===$[o].n||f===$[o].s){h=o+1;break}if(h){j+=' size="'+h+'"';
47
+ i=i.replace(/(^|;)(\s*font-size\s*:\s*[^;"]+;?)+/ig,"$1")}}if(h=i.match(/(?:^|[\s;])color\s*:\s*([^;"]+)/i)){if(f=h[1].match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)){h[1]="#";for(o=1;o<=3;o++)h[1]+=(f[o]-0).toString(16)}h[1]=h[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3");j+=' color="'+h[1]+'"'}i=i.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig,"$1");if(j!==""){if(i)j+=' style="'+i+'"';return"<font"+j+">"+l+"</font>"}else return m};a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
48
+ c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}a=a.replace(/<(td|th)(\s+[^>]*?)?>(\s|&nbsp;)*<\/\1>/ig,"<$1$2>"+(y?"":"<br />")+"</$1>")}else{if(Y){var g=[{r:/font-weight:\sbold/ig,
49
+ t:"strong"},{r:/font-style:\sitalic/ig,t:"em"},{r:/text-decoration:\sunderline/ig,t:"u"},{r:/text-decoration:\sline-through/ig,t:"strike"}];c=function(m,j,i,l,f){j=i+l;i="";if(!j)return f;for(l=0;l<g.length;l++)if(j.match(g[l].r)){i=g[l].t;break}return i?"<"+i+">"+f+"</"+i+">":m};for(var n=0;n<2;n++){a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
50
+ c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}}a=a.replace(/(<(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g,function(m,j,i,l,f){i=i.toLowerCase();var h;l=l.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(o,
51
+ k){h=k.match(/^(["']?)(.*)\1/)[2];return""});if(h&&Ia)h=ca(h,Ia,P);l=l.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(o,k,q){k=k.toLowerCase();q=q.match(/^(["']?)(.*)\1/)[2];if(k==="class"){if(q.match(/^["']?(apple|webkit)/i))return"";q=q.replace(/\s?xhe-[a-z]+/ig,"");if(q==="")return""}else if(k.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return"";else if(h&&k.match(/^(src|href)$/i))return" "+k+'="'+h+'"';else if(k==="style")q=q.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i,
52
+ function(r,t,s,w,I){for(var N,D=0;D<$.length;D++){r=$[D];if(w===r.n){N=r.s;break}}return t+s+":"+N+I});return" "+k+'="'+q+'"'});if(i==="img"&&!l.match(/\s+alt\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i))l+=' alt=""';return j+l+f});a=a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)(<br(\s*\/)?>)?\s*<\/\2>/ig,function(m,j,i,l){return j+(l?l:"&nbsp;")+"</"+i+">"});a=a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(<span(?:\s+[^>]*?)?>\s*<\/span>|<br(?:\s+[^>]*?)?>|&nbsp;)*\s*(?:<\/\1>)?\s*$/i,"")}return a=a.replace(/(<pre(?:\s+[^>]*?)?>)([\s\S]+?)(<\/pre>)/gi,
53
+ function(m,j,i,l){return j+i.replace(/<br\s*\/?>/ig,"\r\n")+l})};this.getSource=function(a){var b,c=p.beforeGetSource;if(F){b=e("#sourceCode",v).val();c||(b=d.formatXHTML(b,false))}else{b=d.processHTML(v.body.innerHTML,"read");b=d.cleanHTML(b);b=d.formatXHTML(b,a);if(c)b=c(b)}return B.value=b};this.cleanWord=function(a){var b=p.cleanPaste;if(b>0&&b<3&&a.match(/mso(-|normal)|WordDocument|<table\s+[^>]*?x:str/i)){a=a.replace(/<!--[\s\S]*?--\>|<!(--)?\[[\s\S]+?\](--)?>|<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,
54
+ "");a=a.replace(/\r?\n/ig,"");a=a.replace(/(<(\/?)([\w\-:]+))((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?>)/g,function(g,n,m,j,i,l){j=j.toLowerCase();if(j.match(/^(link|img)$/)&&i.match(/file:\/\//i)||j.match(/:/)||j==="span"&&b===2)return"";m||(i=i.replace(/\s([\w\-:]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^>\s]+))?/ig,function(f,h,o){h=h.toLowerCase();o=o.match(/^(["']?)(.*)\1/)[2];if(h.match(/:/))return"";else if(h.match(/^(class|lang|language|span)$/))return"";else if(j==="td"&&(h===
55
+ "height"||h==="width"&&!i.match(/\scolspan="\d+"/i)))return"";else if(h==="style"){if(b===2)return"";return(o=e.trim(o.replace(/\s*(mso-[^:]+:.+?|margin\s*:\s*0cm 0cm 0pt\s*|(text-align|font-variant|line-height)\s*:\s*.+?)(;|$)\s*/ig,"")))?" "+h+'="'+o.replace(/"/g,"'")+'"':""}return f}));return n+i+l});for(var c=0;c<3;c++)a=a.replace(/<([^\s>]+)(\s+[^>]*)?>\s*<\/\1>/g,function(g,n){return n.match(/^a$/i)?g:""})}return a};this.cleanHTML=function(a){a=a.replace(/<!?\/?(DOCTYPE|html|body|meta)(\s+[^>]*?)?>/ig,
56
+ "");var b;a=a.replace(/<head(?:\s+[^>]*?)?>([\s\S]*?)<\/head>/i,function(c,g){b=g.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig);return""});if(b)a=b.join("")+a;a=a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig,"");p.internalScript||(a=a.replace(/<script(\s+[^>]*?)?>[\s\S]*?<\/script>/ig,""));p.internalStyle||(a=a.replace(/<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,""));if(!p.linkTag||!p.inlineScript||!p.inlineStyle)a=a.replace(/(<(\w+))((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/ig,
57
+ function(c,g,n,m,j){if(!p.linkTag&&n.toLowerCase()==="link")return"";p.inlineScript||(m=m.replace(/\s+on(?:click|dblclick|mouse(down|up|move|over|out|enter|leave|wheel)|key(down|press|up)|change|select|submit|reset|blur|focus|load|unload)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));p.inlineStyle||(m=m.replace(/\s+(style|class)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));return g+m+j});return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|<br\/?>|&nbsp;)*?)<\1(\s+[^>]*?)?>/ig,"$2")};this.formatXHTML=function(a,
58
+ b){function c(u){var x={};u=u.split(",");for(var z=0;z<u.length;z++)x[u[z]]=true;return x}function g(u){u=u.toLowerCase();var x=w[u];return x?x:u}function n(u,x,z){if(k[u])for(;G.last()&&q[G.last()];)m(G.last());r[u]&&G.last()===u&&m(u);(z=o[u]||!!z)||G.push(u);var K=[];K.push("<"+u);x.replace(N,function(tb,Aa,ub,vb,wb){Aa=Aa.toLowerCase();K.push(" "+Aa+'="'+(ub?ub:vb?vb:wb?wb:t[Aa]?Aa:"").replace(/"/g,"'")+'"')});K.push((z?" /":"")+">");l(K.join(""),u,true);if(u==="pre")Oa=true}function m(u){if(u)for(x=
59
+ G.length-1;x>=0;x--){if(G[x]===u)break}else var x=0;if(x>=0){for(var z=G.length-1;z>=x;z--)l("</"+G[z]+">",G[z]);G.length=x}if(u==="pre"){Oa=false;fa--}}function j(u){l(d.domEncode(u))}function i(u){D.push(u.replace(/^[\s\r\n]+|[\s\r\n]+$/g,""))}function l(u,x,z){Oa||(u=u.replace(/(\t*\r?\n\t*)+/g,""));if(!Oa&&b===true)if(u.match(/^\s*$/))D.push(u);else{var K=k[x],tb=K?x:"";if(K){z&&fa++;Pa===""&&fa--}else Pa&&fa++;if(tb!==Pa||K)f();D.push(u);x==="br"&&f();if(K&&(o[x]||!z))fa--;Pa=K?x:""}else D.push(u)}
60
+ function f(){D.push("\r\n");if(fa>0)for(var u=fa;u--;)D.push("\t")}function h(u,x,z,K){if(!z)return K;u="";if(x=z.match(/ face\s*=\s*"\s*([^"]+)\s*"/i))u+="font-family:"+x[1]+";";if(x=z.match(/ size\s*=\s*"\s*(\d+)\s*"/i))u+="font-size:"+$[(x[1]>7?7:x[1]<1?1:x[1])-1].s+";";if(x=z.match(/ color\s*=\s*"\s*([^"]+)\s*"/i))u+="color:"+x[1]+";";if(z=z.match(/ style\s*=\s*"\s*([^"]+)\s*"/i))u+=z[1];if(u)K='<span style="'+u+'">'+K+"</span>";return K}var o=c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),
61
+ k=c("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,table,tbody,td,tfoot,th,thead,tr,ul,script"),q=c("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),r=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),t=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),
62
+ s=c("script,style"),w={b:"strong",i:"em",s:"del",strike:"del"},I=/<(?:\/([^\s>]+)|!--([^>]*?)--|([\w\-:]+)((?:"[^"]*"|'[^']*'|[^"'<>])*)\s*(\/?))>/g,N=/\s*([\w\-:]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g,D=[],G=[];G.last=function(){return this[this.length-1]};for(var E,H,R=0,ga,Ba,fa=-1,Pa="body",Oa=false;E=I.exec(a);){H=E.index;if(H>R){R=a.substring(R,H);ga?Ba.push(R):j(R)}R=I.lastIndex;if(H=E[1]){H=g(H);if(ga&&H===ga){i(Ba.join(""));Ba=ga=null}if(!ga){m(H);continue}}if(ga)Ba.push(E[0]);
63
+ else if(H=E[3]){H=g(H);n(H,E[4],E[5]);if(s[H]){ga=H;Ba=[]}}else E[2]&&D.push(E[0])}a.length>R&&j(a.substring(R,a.length));m();a=D.join("");D=null;a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,
64
+ h);return a=a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g,"")};this.toggleShowBlocktag=function(a){if(wa!==a){wa=!wa;a=e(v.body);if(wa){pa+=" showBlocktag";a.addClass("showBlocktag")}else{pa=pa.replace(" showBlocktag","");a.removeClass("showBlocktag")}}};this.toggleSource=function(a){if(F!==a){C.find("[cmd=Source]").toggleClass("xheEnabled").toggleClass("xheActive");var b=v.body,c=e(b),g,n;a=0;var m="";if(F){g=d.getSource();c.html("").removeAttr("scroll").attr("class","editMode"+pa);if(y)b.contentEditable=
65
+ "true";else v.designMode="On";if(Da){d._exec("inserthtml","-");e("#"+Ma).show().focus().hide()}m="\u6e90\u4ee3\u7801"}else{d.pasteHTML('<span id="_xhe_cursor"></span>',true);g=d.getSource(true);a=g.indexOf('<span id="_xhe_cursor"></span>');if(!eb)a=g.substring(0,a).replace(/\r/g,"").length;g=g.replace(/(\r?\n\s*|)<span id="_xhe_cursor"><\/span>(\s*\r?\n|)/,function(j,i,l){return i&&l?"\r\n":i+l});if(y)b.contentEditable="false";else v.designMode="Off";c.attr("scroll","no").attr("class","sourceMode").html('<textarea id="sourceCode" wrap="soft" spellcheck="false" height="100%" />');
66
+ n=e("#sourceCode",c).blur(d.getSource)[0];m="\u53ef\u89c6\u5316\u7f16\u8f91"}F=!F;d.setSource(g);d.focus();if(F)if(n.setSelectionRange)n.setSelectionRange(a,a);else{n=n.createTextRange();n.move("character",a);n.select()}else d.setTextCursor();C.find("[cmd=Source]").attr("title",m).find("span").text(m);C.find("[cmd=Source],[cmd=Preview]").toggleClass("xheEnabled");C.find(".xheButton").not("[cmd=Source],[cmd=Fullscreen],[cmd=About]").toggleClass("xheEnabled").attr("aria-disabled",F?true:false);setTimeout(Ya,
67
+ 300)}};this.showPreview=function(){var a=p.beforeSetSource,b=d.getSource();if(a)b=a(b);a="<html><head>"+za+"<title>\u9884\u89c8</title>"+(P?'<base href="'+P+'"/>':"")+"</head><body>"+b+"</body></html>";b=window.screen;b=window.open("","xhePreview","toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+Math.round(b.width*0.9)+",height="+Math.round(b.height*0.8)+",left="+Math.round(b.width*0.05));var c=b.document;c.open();c.write(a);c.close();b.focus()};this.toggleFullscreen=
68
+ function(a){if(ua!==a){a=e("#"+ya).find(".xheLayout");var b=e("#"+ya),c=jQuery.browser.version;c=y&&(c==6||c==7);if(ua){c&&Q.after(b);a.attr("style",nb);O.height(X-C.outerHeight());e(window).scrollTop(bb);setTimeout(function(){e(window).scrollTop(bb)},10)}else{c&&e("body").append(b);bb=e(window).scrollTop();nb=a.attr("style");a.removeAttr("style");O.height("100%");setTimeout($a,100)}if(Da){e("#"+Ma).show().focus().hide();setTimeout(d.focus,1)}else c&&d.setTextCursor();ua=!ua;b.toggleClass("xhe_Fullscreen");
69
+ e("html").toggleClass("xhe_Fullfix");C.find("[cmd=Fullscreen]").toggleClass("xheActive");setTimeout(Ya,300)}};this.showMenu=function(a,b){var c=e('<div class="xheMenu"></div>'),g=a.length,n=[];e.each(a,function(m,j){n.push("<a href=\"javascript:void('"+j.v+'\')" title="'+(j.t?j.t:j.s)+'" v="'+j.v+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(m+1)+'" tabindex="0">'+j.s+"</a>")});c.append(n.join(""));c.click(function(m){m=m.target;if(!e.nodeName(m,"DIV")){d.loadBookmark();b(e(m).closest("a").attr("v"));
70
+ d.hidePanel();return false}}).mousedown(W);d.showPanel(c);d.saveBookmark()};this.showColor=function(a){var b=e('<div class="xheColor"></div>'),c=[],g=gb.length,n=0;e.each(gb,function(m,j){if(n%7===0)c.push((n>0?"</div>":"")+"<div>");c.push("<a href=\"javascript:void('"+j+'\')" xhev="'+j+'" title="'+j+'" style="background:'+j+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(n+1)+'"></a>');n++});c.push("</div>");b.append(c.join(""));b.click(function(m){m=m.target;if(e.nodeName(m,"A")){d.loadBookmark();
71
+ a(e(m).attr("xhev"));d.hidePanel();return false}}).mousedown(W);d.showPanel(b);d.saveBookmark()};this.showPastetext=function(){var a=e('<div><label for="xhePastetextValue">\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u65b9\u6846\u91cc\uff0c\u6309 \u786e\u5b9a</label></div><div><textarea id="xhePastetextValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
72
+ b=e("#xhePastetextValue",a);e("#xheSave",a).click(function(){d.loadBookmark();var c=b.val();c&&d.pasteText(c);d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showLink=function(){var a='<div><label for="xheLinkUrl">\u94fe\u63a5\u5730\u5740: </label><input type="text" id="xheLinkUrl" value="http://" class="xheText" /></div><div><label for="xheLinkTarget">\u6253\u5f00\u65b9\u5f0f: </label><select id="xheLinkTarget"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="_blank">\u65b0\u7a97\u53e3</option><option value="_self">\u5f53\u524d\u7a97\u53e3</option><option value="_parent">\u7236\u7a97\u53e3</option></select></div><div style="display:none"><label for="xheLinkText">\u94fe\u63a5\u6587\u5b57: </label><input type="text" id="xheLinkText" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>',
73
+ b=ma.find("a[name]").not("[href]"),c=b.length>0;if(c){var g=[];b.each(function(){var f=e(this).attr("name");g.push('<option value="#'+f+'">'+f+"</option>")});a=a.replace(/(<div><label for="xheLinkTarget)/,'<div><label for="xheLinkAnchor">\u9875\u5185\u951a\u70b9: </label><select id="xheLinkAnchor"><option value="">\u672a\u9009\u62e9</option>'+g.join("")+"</select></div>$1")}a=e(a);var n=d.getParent("a"),m=e("#xheLinkText",a),j=e("#xheLinkUrl",a),i=e("#xheLinkTarget",a);b=e("#xheSave",a);var l=d.getSelect();
74
+ c&&a.find("#xheLinkAnchor").change(function(){var f=e(this).val();f!=""&&j.val(f)});if(n.length===1){if(!n.attr("href")){M=null;return d.exec("Anchor")}j.val(U(n,"href"));i.attr("value",n.attr("target"))}else l===""&&m.val(p.defLinkText).closest("div").show();p.upLinkUrl&&d.uploadInit(j,p.upLinkUrl,p.upLinkExt);b.click(function(){d.loadBookmark();var f=j.val();if(f===""||n.length===0)d._exec("unlink");if(f!==""&&f!=="http://"){var h=f.split(" "),o=i.val(),k=m.val();if(h.length>1){d._exec("unlink");
75
+ l=d.getSelect();var q='<a href="xhe_tmpurl"',r=[];if(o!=="")q+=' target="'+o+'"';q+=">xhe_tmptext</a>";k=l!==""?l:k?k:f;for(var t in h){f=h[t];if(f!==""){f=f.split("||");o=q;o=o.replace("xhe_tmpurl",f[0]);o=o.replace("xhe_tmptext",f[1]?f[1]:k);r.push(o)}}d.pasteHTML(r.join("&nbsp;"))}else{f=h[0].split("||");k||(k=f[0]);k=f[1]?f[1]:l!==""?"":k?k:f[0];if(n.length===0){k?d.pasteHTML('<a href="#xhe_tmpurl">'+k+"</a>"):d._exec("createlink","#xhe_tmpurl");n=e('a[href$="#xhe_tmpurl"]',v)}else k&&!Y&&n.text(k);
76
+ U(n,"href",f[0]);o!==""?n.attr("target",o):n.removeAttr("target")}}d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAnchor=function(){var a=e('<div><label for="xheAnchorName">\u951a\u70b9\u540d\u79f0: </label><input type="text" id="xheAnchorName" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),b=d.getParent("a"),c=e("#xheAnchorName",a),g=e("#xheSave",a);if(b.length===1){if(b.attr("href")){M=null;
77
+ return d.exec("Link")}c.val(b.attr("name"))}g.click(function(){d.loadBookmark();var n=c.val();if(n)b.length===0?d.pasteHTML('<a name="'+n+'"></a>'):b.attr("name",n);else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showImg=function(){var a=e('<div><label for="xheImgUrl">\u56fe\u7247\u6587\u4ef6: </label><input type="text" id="xheImgUrl" value="http://" class="xheText" /></div><div><div><label for="xheImgAlt">\u66ff\u6362\u6587\u672c: </label><input type="text" id="xheImgAlt" /></div><div><label for="xheImgAlign">\u5bf9\u9f50\u65b9\u5f0f: </label><select id="xheImgAlign"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="left">\u5de6\u5bf9\u9f50</option><option value="right">\u53f3\u5bf9\u9f50</option><option value="top">\u9876\u7aef</option><option value="middle">\u5c45\u4e2d</option><option value="baseline">\u57fa\u7ebf</option><option value="bottom">\u5e95\u8fb9</option></select></div><div><label for="xheImgWidth">\u5bbd\u3000\u3000\u5ea6: </label><input type="text" id="xheImgWidth" style="width:40px;" /> <label for="xheImgHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheImgHeight" style="width:40px;" /></div><div><label for="xheImgBorder">\u8fb9\u6846\u5927\u5c0f: </label><input type="text" id="xheImgBorder" style="width:40px;" /></div><div><label for="xheImgHspace">\u6c34\u5e73\u95f4\u8ddd: </label><input type="text" id="xheImgHspace" style="width:40px;" /> <label for="xheImgVspace">\u5782\u76f4\u95f4\u8ddd: </label><input type="text" id="xheImgVspace" style="width:40px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
78
+ b=d.getParent("img"),c=e("#xheImgUrl",a),g=e("#xheImgAlt",a),n=e("#xheImgAlign",a),m=e("#xheImgWidth",a),j=e("#xheImgHeight",a),i=e("#xheImgBorder",a),l=e("#xheImgVspace",a),f=e("#xheImgHspace",a),h=e("#xheSave",a);if(b.length===1){c.val(U(b,"src"));g.val(b.attr("alt"));n.val(b.attr("align"));m.val(b.attr("width"));j.val(b.attr("height"));i.val(b.attr("border"));var o=b.attr("vspace"),k=b.attr("hspace");l.val(o<=0?"":o);f.val(k<=0?"":k)}p.upImgUrl&&d.uploadInit(c,p.upImgUrl,p.upImgExt);h.click(function(){d.loadBookmark();
79
+ var q=c.val();if(q!==""&&q!=="http://"){var r=q.split(" "),t=g.val(),s=n.val(),w=m.val(),I=j.val(),N=i.val(),D=l.val(),G=f.val();if(r.length>1){var E='<img src="xhe_tmpurl"',H=[];if(t!=="")E+=' alt="'+t+'"';if(s!=="")E+=' align="'+s+'"';if(w!=="")E+=' width="'+w+'"';if(I!=="")E+=' height="'+I+'"';if(N!=="")E+=' border="'+N+'"';if(D!=="")E+=' vspace="'+D+'"';if(G!=="")E+=' hspace="'+G+'"';E+=" />";for(var R in r){q=r[R];if(q!==""){q=q.split("||");t=E;t=t.replace("xhe_tmpurl",q[0]);if(q[1])t='<a href="'+
80
+ q[1]+'" target="_blank">'+t+"</a>";H.push(t)}}d.pasteHTML(H.join("&nbsp;"))}else if(r.length===1){q=r[0];if(q!==""){q=q.split("||");if(b.length===0){d.pasteHTML('<img src="'+q[0]+'#xhe_tmpurl" />');b=e('img[src$="#xhe_tmpurl"]',v)}U(b,"src",q[0]);t!==""&&b.attr("alt",t);s!==""?b.attr("align",s):b.removeAttr("align");w!==""?b.attr("width",w):b.removeAttr("width");I!==""?b.attr("height",I):b.removeAttr("height");N!==""?b.attr("border",N):b.removeAttr("border");D!==""?b.attr("vspace",D):b.removeAttr("vspace");
81
+ G!==""?b.attr("hspace",G):b.removeAttr("hspace");if(q[1]){r=b.parent("a");if(r.length===0){b.wrap("<a></a>");r=b.parent("a")}U(r,"href",q[1]);r.attr("target","_blank")}}}}else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showEmbed=function(a,b,c,g,n,m,j){b=e(b);var i=d.getParent('embed[type="'+c+'"],embed[classid="'+g+'"]'),l=e("#xhe"+a+"Url",b),f=e("#xhe"+a+"Width",b),h=e("#xhe"+a+"Height",b);a=e("#xheSave",b);m&&d.uploadInit(l,m,j);if(i.length===1){l.val(U(i,
82
+ "src"));f.val(i.attr("width"));h.val(i.attr("height"))}a.click(function(){d.loadBookmark();var o=l.val();if(o!==""&&o!=="http://"){var k=f.val(),q=h.val(),r=/^\d+%?$/;r.test(k)||(k=412);r.test(q)||(q=300);var t='<embed type="'+c+'" classid="'+g+'" src="xhe_tmpurl"'+n;r=o.split(" ");if(r.length>1){t=t+"";var s,w=[];t+=' width="xhe_width" height="xhe_height" />';for(var I in r){o=r[I].split("||");s=t;s=s.replace("xhe_tmpurl",o[0]);s=s.replace("xhe_width",o[1]?o[1]:k);s=s.replace("xhe_height",o[2]?o[2]:
83
+ q);o!==""&&w.push(s)}d.pasteHTML(w.join("&nbsp;"))}else if(r.length===1){o=r[0].split("||");if(i.length===0){d.pasteHTML(t.replace("xhe_tmpurl",o[0]+"#xhe_tmpurl")+" />");i=e('embed[src$="#xhe_tmpurl"]',v)}U(i,"src",o[0]);i.attr("width",o[1]?o[1]:k);i.attr("height",o[2]?o[2]:q)}}else i.length===1&&i.remove();d.hidePanel();return false});d.showDialog(b);d.saveBookmark()};this.showEmot=function(a){var b=e('<div class="xheEmot"></div>');a=a?a:db?db:"default";var c=Na[a],g=ea+a+"/",n=0,m=[],j="";j=c.width;
84
+ var i=c.height,l=c.line,f=c.count;c=c.list;if(f)for(c=1;c<=f;c++){n++;m.push("<a href=\"javascript:void('"+c+'\')" style="background-image:url('+g+c+'.gif);" emot="'+a+","+c+'" xhev="" title="'+c+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")}else e.each(c,function(k,q){n++;m.push("<a href=\"javascript:void('"+q+'\')" style="background-image:url('+g+k+'.gif);" emot="'+a+","+k+'" title="'+q+'" xhev="'+q+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")});f=l*(j+12);c=f*0.75;if(Math.ceil(n/
85
+ l)*(i+12)<=c)c="";j=e("<style>"+(c?".xheEmot div{width:"+(f+20)+"px;height:"+c+"px;}":"")+".xheEmot div a{width:"+j+"px;height:"+i+"px;}</style><div>"+m.join("")+"</div>").click(function(k){k=k.target;var q=e(k);if(e.nodeName(k,"A")){d.pasteHTML('<img emot="'+q.attr("emot")+'" alt="'+q.attr("xhev")+'">');d.hidePanel();return false}}).mousedown(W);b.append(j);var h=0,o=['<ul role="tablist">'];e.each(Na,function(k,q){h++;o.push("<li"+(a===k?' class="cur"':"")+' role="presentation"><a href="javascript:void(\''+
86
+ q.name+'\')" group="'+k+'" role="tab" tabindex="0">'+q.name+"</a></li>")});if(h>1){o.push('</ul><br style="clear:both;" />');j=e(o.join("")).click(function(k){db=e(k.target).attr("group");d.exec("Emot");return false}).mousedown(W);b.append(j)}d.showPanel(b)};this.showTable=function(){var a=e('<div><label for="xheTableRows">\u884c\u3000\u3000\u6570: </label><input type="text" id="xheTableRows" style="width:40px;" value="3" /> <label for="xheTableColumns">\u5217\u3000\u3000\u6570: </label><input type="text" id="xheTableColumns" style="width:40px;" value="2" /></div><div><label for="xheTableHeaders">\u6807\u9898\u5355\u5143: </label><select id="xheTableHeaders"><option selected="selected" value="">\u65e0</option><option value="row">\u7b2c\u4e00\u884c</option><option value="col">\u7b2c\u4e00\u5217</option><option value="both">\u7b2c\u4e00\u884c\u548c\u7b2c\u4e00\u5217</option></select></div><div><label for="xheTableWidth">\u5bbd\u3000\u3000\u5ea6: </label><input type="text" id="xheTableWidth" style="width:40px;" value="200" /> <label for="xheTableHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheTableHeight" style="width:40px;" value="" /></div><div><label for="xheTableBorder">\u8fb9\u6846\u5927\u5c0f: </label><input type="text" id="xheTableBorder" style="width:40px;" value="1" /></div><div><label for="xheTableCellSpacing">\u8868\u683c\u95f4\u8ddd: </label><input type="text" id="xheTableCellSpacing" style="width:40px;" value="1" /> <label for="xheTableCellPadding">\u8868\u683c\u586b\u5145: </label><input type="text" id="xheTableCellPadding" style="width:40px;" value="1" /></div><div><label for="xheTableAlign">\u5bf9\u9f50\u65b9\u5f0f: </label><select id="xheTableAlign"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="left">\u5de6\u5bf9\u9f50</option><option value="center">\u5c45\u4e2d</option><option value="right">\u53f3\u5bf9\u9f50</option></select></div><div><label for="xheTableCaption">\u8868\u683c\u6807\u9898: </label><input type="text" id="xheTableCaption" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
87
+ b=e("#xheTableRows",a),c=e("#xheTableColumns",a),g=e("#xheTableHeaders",a),n=e("#xheTableWidth",a),m=e("#xheTableHeight",a),j=e("#xheTableBorder",a),i=e("#xheTableCellSpacing",a),l=e("#xheTableCellPadding",a),f=e("#xheTableAlign",a),h=e("#xheTableCaption",a);e("#xheSave",a).click(function(){d.loadBookmark();var o=h.val(),k=j.val(),q=b.val(),r=c.val(),t=g.val(),s=n.val(),w=m.val(),I=i.val(),N=l.val(),D=f.val();k="<table"+(k!==""?' border="'+k+'"':"")+(s!==""?' width="'+s+'"':"")+(w!==""?' height="'+
88
+ w+'"':"")+(I!==""?' cellspacing="'+I+'"':"")+(N!==""?' cellpadding="'+N+'"':"")+(D!==""?' align="'+D+'"':"")+">";if(o!=="")k+="<caption>"+o+"</caption>";if(t==="row"||t==="both"){k+="<tr>";for(o=0;o<r;o++)k+='<th scope="col"></th>';k+="</tr>";q--}k+="<tbody>";for(o=0;o<q;o++){k+="<tr>";for(s=0;s<r;s++)k+=s===0&&(t==="col"||t==="both")?'<th scope="row"></th>':"<td></td>";k+="</tr>"}k+="</tbody></table>";d.pasteHTML(k);d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAbout=function(){var a=
89
+ e('<div style="font:12px Arial;width:245px;word-wrap:break-word;word-break:break-all;outline:none;" role="dialog" tabindex="-1"><p><span style="font-size:20px;color:#1997DF;">xhEditor</span><br />v1.1.10 (build 110904)</p><p>xhEditor\u662f\u57fa\u4e8ejQuery\u5f00\u53d1\u7684\u8de8\u5e73\u53f0\u8f7b\u91cf\u53ef\u89c6\u5316XHTML\u7f16\u8f91\u5668\uff0c\u57fa\u4e8e<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">LGPL</a>\u5f00\u6e90\u534f\u8bae\u53d1\u5e03\u3002</p><p>Copyright &copy; <a href="http://xheditor.com/" target="_blank">xhEditor.com</a>. All rights reserved.</p></div>');
90
+ a.find("p").attr("role","presentation");d.showDialog(a,true);setTimeout(function(){a.focus()},100)};this.addShortcuts=function(a,b){a=a.toLowerCase();if(va[a]===ha)va[a]=[];va[a].push(b)};this.delShortcuts=function(a){delete va[a]};this.uploadInit=function(a,b,c){function g(f){if(V(f,"string"))f=[f];var h=false,o,k=f.length,q,r=[];(o=p.onUpload)&&o(f);for(o=0;o<k;o++){q=f[o];q=V(q,"string")?q:q.url;if(q.substr(0,1)==="!"){h=true;q=q.substr(1)}r.push(q)}a.val(r.join(" "));h&&a.closest(".xheDialog").find("#xheSave").click()}
91
+ var n=e('<span class="xheUpload"><input type="text" style="visibility:hidden;" tabindex="-1" /><input type="button" value="'+p.upBtnText+'" class="xheBtn" tabindex="-1" /></span>'),m=e(".xheBtn",n),j=p.html5Upload,i=j?p.upMultiple:1;a.after(n);m.before(a);b=b.replace(/{editorRoot}/ig,T);if(b.substr(0,1)==="!")m.click(function(){d.showIframeModal("\u4e0a\u4f20\u6587\u4ef6",b.substr(1),g,null,null)});else{n.append('<input type="file"'+(i>1?' multiple=""':"")+' class="xheFile" size="13" name="filedata" tabindex="-1" />');
92
+ var l=e(".xheFile",n);l.change(function(){d.startUpload(l[0],b,c,g)});setTimeout(function(){a.closest(".xheDialog").bind("dragenter dragover",W).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(j&&f&&(h=f.files)&&h.length>0)d.startUpload(h,b,c,g);return false})},10)}};this.startUpload=function(a,b,c,g){function n(k,q){var r=Object,t=false;try{r=eval("("+k+")")}catch(s){}if(r.err===ha||r.msg===ha)alert(b+" \u4e0a\u4f20\u63a5\u53e3\u53d1\u751f\u9519\u8bef\uff01\r\n\r\n\u8fd4\u56de\u7684\u9519\u8bef\u5185\u5bb9\u4e3a: \r\n\r\n"+
93
+ k);else if(r.err)alert(r.err);else{m.push(r.msg);t=true}if(!t||q)d.removeModal();q&&t&&g(m);return t}var m=[],j=p.html5Upload,i=j?p.upMultiple:1,l,f=e('<div style="padding:22px 0;text-align:center;line-height:30px;">\u6587\u4ef6\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u5019\u2026\u2026<br /></div>'),h='<img src="'+Ha+'img/loading.gif">';if(!j||a.nodeType&&!((l=a.files)&&l[0].fileName)){if(!kb(a.value,c))return;f.append(h);c=new d.html4Upload(a,b,n)}else{l||(l=a);a=l.length;if(a>i){alert("\u8bf7\u4e0d\u8981\u4e00\u6b21\u4e0a\u4f20\u8d85\u8fc7"+
94
+ i+"\u4e2a\u6587\u4ef6");return}for(i=0;i<a;i++)if(!kb(l[i].fileName,c))return;var o=e('<div class="xheProgress"><div><span>0%</span></div></div>');f.append(o);c=new d.html5Upload("filedata",l,b,n,function(k){if(k.loaded>=0){var q=Math.round(k.loaded*100/k.total)+"%";e("div",o).css("width",q);e("span",o).text(q+" ( "+lb(k.loaded)+" / "+lb(k.total)+" )")}else o.replaceWith(h)})}d.showModal("\u6587\u4ef6\u4e0a\u4f20\u4e2d(Esc\u53d6\u6d88\u4e0a\u4f20)",f,320,150);c.start()};this.html4Upload=function(a,
95
+ b,c){var g="jUploadFrame"+(new Date).getTime(),n=this,m=e('<iframe name="'+g+'" class="xheHideArea" />').appendTo("body"),j=e('<form action="'+b+'" target="'+g+'" method="post" enctype="multipart/form-data" class="xheHideArea"></form>').appendTo("body"),i=e(a),l=i.clone().attr("disabled","true");i.before(l).appendTo(j);this.remove=function(){if(n!==null){l.before(i).remove();m.remove();j.remove();n=null}};this.onLoad=function(){var f=m[0].contentWindow.document,h=e(f.body).text();f.write("");n.remove();
96
+ c(h,true)};this.start=function(){j.submit();m.load(n.onLoad)};return this};this.html5Upload=function(a,b,c,g,n){function m(r,t,s,w){i=new XMLHttpRequest;upload=i.upload;i.onreadystatechange=function(){i.readyState===4&&s(i.responseText)};if(upload)upload.onprogress=function(I){w(I.loaded)};else w(-1);i.open("POST",t);i.setRequestHeader("Content-Type","application/octet-stream");i.setRequestHeader("Content-Disposition",'attachment; name="'+a+'"; filename="'+r.fileName+'"');i.sendAsBinary?i.sendAsBinary(r.getAsBinary()):
97
+ i.send(r)}function j(r){n&&n({loaded:h+r,total:o})}for(var i,l=0,f=b.length,h=0,o=0,k=this,q=0;q<f;q++)o+=b[q].fileSize;this.remove=function(){if(i){i.abort();i=null}};this.uploadNext=function(r){if(r){h+=b[l-1].fileSize;j(0)}if((!r||r&&g(r,l===f)===true)&&l<f)m(b[l++],c,k.uploadNext,function(t){j(t)})};this.start=function(){k.uploadNext()}};this.showIframeModal=function(a,b,c,g,n,m){function j(){try{h.callback=i;h.unloadme=d.removeModal;e(h.document).keydown(Qa);o=h.name}catch(k){}}function i(k){h.document.write("");
98
+ d.removeModal();k!=null&&c(k)}b=e('<iframe frameborder="0" src="'+b.replace(/{editorRoot}/ig,T)+(/\?/.test(b)?"&":"?")+"parenthost="+location.host+'" style="width:100%;height:100%;display:none;" /><div class="xheModalIfmWait"></div>');var l=b.eq(0),f=b.eq(1);d.showModal(a,b,g,n,m);var h=l[0].contentWindow,o;j();l.load(function(){j();if(o){o=eval("("+unescape(o)+")");return i(o)}if(f.is(":visible")){l.show().focus();f.remove()}})};this.showModal=function(a,b,c,g,n){if(Ga)return false;d.panelState=
99
+ Z;Z=false;ka=p.layerShadow;c=c?c:p.modalWidth;g=g?g:p.modalHeight;S=e('<div class="xheModal" style="width:'+(c-1)+"px;height:"+g+"px;margin-left:-"+Math.ceil(c/2)+"px;"+(y&&Ca<7?"":"margin-top:-"+Math.ceil(g/2)+"px")+'">'+(p.modalTitle?'<div class="xheModalTitle"><span class="xheModalClose" title="\u5173\u95ed (Esc)" tabindex="0" role="button"></span>'+a+"</div>":"")+'<div class="xheModalContent"></div></div>').appendTo("body");Sa=e('<div class="xheModalOverlay"></div>').appendTo("body");if(ka>0)Ra=
100
+ e('<div class="xheModalShadow" style="width:'+S.outerWidth()+"px;height:"+S.outerHeight()+"px;margin-left:-"+(Math.ceil(c/2)-ka-2)+"px;"+(y&&Ca<7?"":"margin-top:-"+(Math.ceil(g/2)-ka-2)+"px")+'"></div>').appendTo("body");e(".xheModalContent",S).css("height",g-(p.modalTitle?e(".xheModalTitle").outerHeight():0)).html(b);if(y&&Ca===6)Ta=e("select:visible").css("visibility","hidden");e(".xheModalClose",S).click(d.removeModal);Sa.show();ka>0&&Ra.show();S.show();setTimeout(function(){S.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!==
101
+ "hidden"}).eq(0).focus()},10);Ga=true;Ua=n};this.removeModal=function(){Ta&&Ta.css("visibility","visible");S.html("").remove();ka>0&&Ra.remove();Sa.remove();Ua&&Ua();Ga=false;Z=d.panelState};this.showDialog=function(a,b){var c=e('<div class="xheDialog"></div>'),g=e(a),n=e("#xheSave",g);if(n.length===1){g.find("input[type=text],select").keypress(function(i){if(i.which===13){n.click();return false}});g.find("textarea").keydown(function(i){if(i.ctrlKey&&i.which===13){n.click();return false}});n.after(' <input type="button" id="xheCancel" value="\u53d6\u6d88" />');
102
+ e("#xheCancel",g).click(d.hidePanel);if(!p.clickCancelDialog){Fa=false;var m=e('<div class="xheFixCancel"></div>').appendTo("body").mousedown(W),j=O.offset();m.css({left:j.left,top:j.top,width:O.outerWidth(),height:O.outerHeight()})}c.mousedown(function(){xa=true})}c.append(g);d.showPanel(c,b)};this.showPanel=function(a,b){if(!M.target)return false;L.html("").append(a).css("left",-999).css("top",-999);ja=e(M.target).closest("a").addClass("xheActive");var c=ja.offset(),g=c.left;c=c.top;c+=ja.outerHeight()-
103
+ 1;sa.css({left:g+1,top:c,width:ja.width()}).show();var n=document.documentElement,m=document.body;if(g+L.outerWidth()>(window.pageXOffset||n.scrollLeft||m.scrollLeft)+(n.clientWidth||m.clientWidth))g-=L.outerWidth()-ja.outerWidth();n=p.layerShadow;n>0&&ra.css({left:g+n,top:c+n,width:L.outerWidth(),height:L.outerHeight()}).show();L.css({left:g,top:c}).show();b||setTimeout(function(){L.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!=="hidden"}).eq(0).focus()},
104
+ 10);cb=Z=true};this.hidePanel=function(){if(Z){ja.removeClass("xheActive");ra.hide();sa.hide();L.hide();Z=false;if(!Fa){e(".xheFixCancel").remove();Fa=true}cb=xa=false;da=null;d.focus();d.loadBookmark()}};this.exec=function(a){d.hidePanel();var b=ta[a];if(!b)return false;if(M===null){M={};var c=C.find(".xheButton[cmd="+a+"]");if(c.length===1)M.target=c}if(b.e)b.e.call(d);else{a=a.toLowerCase();switch(a){case "cut":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(g){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u526a\u5207\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + X)\u6765\u5b8c\u6210")}break;
105
+ case "copy":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(n){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u590d\u5236\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + C)\u6765\u5b8c\u6210")}break;case "paste":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(m){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u7c98\u8d34\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + V)\u6765\u5b8c\u6210")}break;
106
+ case "pastetext":window.clipboardData?d.pasteText(window.clipboardData.getData("Text",true)):d.showPastetext();break;case "blocktag":var j=[];e.each(zb,function(f,h){j.push({s:"<"+h.n+">"+h.t+"</"+h.n+">",v:"<"+h.n+">",t:h.t})});d.showMenu(j,function(f){d._exec("formatblock",f)});break;case "fontface":var i=[];e.each(Ab,function(f,h){h.c=h.c?h.c:h.n;i.push({s:'<span style="font-family:'+h.c+'">'+h.n+"</span>",v:h.c,t:h.n})});d.showMenu(i,function(f){d._exec("fontname",f)});break;case "fontsize":var l=
107
+ [];e.each($,function(f,h){l.push({s:'<span style="font-size:'+h.s+';">'+h.t+"("+h.s+")</span>",v:f+1,t:h.t})});d.showMenu(l,function(f){d._exec("fontsize",f)});break;case "fontcolor":d.showColor(function(f){d._exec("forecolor",f)});break;case "backcolor":d.showColor(function(f){if(y)d._exec("backcolor",f);else{Xa(true);d._exec("hilitecolor",f);Xa(false)}});break;case "align":d.showMenu(Bb,function(f){d._exec(f)});break;case "list":d.showMenu(Cb,function(f){d._exec(f)});break;case "link":d.showLink();
108
+ break;case "anchor":d.showAnchor();break;case "img":d.showImg();break;case "flash":d.showEmbed("Flash",'<div><label for="xheFlashUrl">\u52a8\u753b\u6587\u4ef6: </label><input type="text" id="xheFlashUrl" value="http://" class="xheText" /></div><div><label for="xheFlashWidth">\u5bbd\u3000\u3000\u5ea6: </label><input type="text" id="xheFlashWidth" style="width:40px;" value="480" /> <label for="xheFlashHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheFlashHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>',
109
+ "application/x-shockwave-flash","clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000",' wmode="opaque" quality="high" menu="false" play="true" loop="true" allowfullscreen="true"',p.upFlashUrl,p.upFlashExt);break;case "media":d.showEmbed("Media",'<div><label for="xheMediaUrl">\u5a92\u4f53\u6587\u4ef6: </label><input type="text" id="xheMediaUrl" value="http://" class="xheText" /></div><div><label for="xheMediaWidth">\u5bbd\u3000\u3000\u5ea6: </label><input type="text" id="xheMediaWidth" style="width:40px;" value="480" /> <label for="xheMediaHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheMediaHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>',
110
+ "application/x-mplayer2","clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",' enablecontextmenu="false" autostart="false"',p.upMediaUrl,p.upMediaExt);break;case "hr":d.pasteHTML("<hr />");break;case "emot":d.showEmot();break;case "table":d.showTable();break;case "source":d.toggleSource();break;case "preview":d.showPreview();break;case "print":la.print();break;case "fullscreen":d.toggleFullscreen();break;case "about":d.showAbout();break;default:d._exec(a)}}M=null};this._exec=function(a,b,c){c||d.focus();
111
+ return b!==ha?v.execCommand(a,false,b):v.execCommand(a,false,null)}};Ea.settings={skin:"default",tools:"full",clickCancelDialog:true,linkTag:false,internalScript:false,inlineScript:false,internalStyle:true,inlineStyle:true,showBlocktag:false,forcePtag:true,upLinkExt:"zip,rar,txt",upImgExt:"jpg,jpeg,gif,png",upFlashExt:"swf",upMediaExt:"wmv,avi,wma,mp3,mid",modalWidth:350,modalHeight:220,modalTitle:true,defLinkText:"\u70b9\u51fb\u6253\u5f00\u94fe\u63a5",layerShadow:3,emotMark:false,upBtnText:"\u4e0a\u4f20",
112
+ cleanPaste:2,hoverExecDelay:100,html5Upload:true,upMultiple:99};window.xheditor=Ea;e(function(){e.fn.oldVal=e.fn.val;e.fn.val=function(B){var A=this,J;if(B===ha)return A[0]&&(J=A[0].xheditor)?J.getSource():A.oldVal();return A.each(function(){(J=this.xheditor)?J.setSource(B):A.oldVal(B)})};e("textarea").each(function(){var B=e(this),A=B.attr("class");if(A&&(A=A.match(/(?:^|\s)xheditor(?:\-(m?full|simple|mini))?(?:\s|$)/i)))B.xheditor(A[1]?{tools:A[1]}:null)})})})(jQuery);
@@ -0,0 +1,112 @@
1
+ (function(e,ha){if(window.xheditor)return false;var xb=navigator.userAgent.toLowerCase().indexOf("mobile")>-1,qa=e.browser,Ca=parseFloat(qa.version),y=qa.msie,Da=qa.mozilla,Y=qa.safari,eb=qa.opera;e.fn.xheditor=function(B){if(xb)return false;var A=[];this.each(function(){if(e.nodeName(this,"TEXTAREA"))if(B===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(this.xheditor)A.push(this.xheditor);else{var J=/({.*})/.exec(e(this).attr("class"));if(J){try{J=eval("("+J[1]+")")}catch(Qa){}B=
2
+ e.extend({},J,B)}J=new Ea(this,B);if(J.init()){this.xheditor=J;A.push(J)}}});if(A.length===0)A=false;if(A.length===1)A=A[0];return A};var ia=0,Z=false,Fa=true,Ga=false,fb=false,L,ra,sa,ja,S,Ra,ka,Sa,Ta,Ua,T;e("script[src*=xheditor]").each(function(){var B=this.src;if(B.match(/xheditor[^\/]*\.js/i)){T=B.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});if(y)try{document.execCommand("BackgroundImageCache",false,true)}catch(Kb){}var yb={27:"esc",9:"tab",32:"space",13:"enter",8:"backspace",
3
+ 145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},gb=["#FFFFFF","#CCCCCC","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66",
4
+ "#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#99FF99","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],zb=[{n:"p",t:"\u666e\u901a\u6bb5\u843d"},
5
+ {n:"h1",t:"\u6a19\u984c1"},{n:"h2",t:"\u6a19\u984c2"},{n:"h3",t:"\u6a19\u984c3"},{n:"h4",t:"\u6a19\u984c4"},{n:"h5",t:"\u6a19\u984c5"},{n:"h6",t:"\u6a19\u984c6"},{n:"pre",t:"\u5df2\u7de8\u6392\u683c\u5f0f"},{n:"address",t:"\u5730\u5740"}],Ab=[{n:"\u65b0\u7d30\u660e\u9ad4",c:"PMingLiu"},{n:"\u7d30\u660e\u9ad4",c:"mingliu"},{n:"\u6a19\u6977\u9ad4",c:"DFKai-SB"},{n:"\u5fae\u8edf\u6b63\u9ed1\u9ad4",c:"Microsoft JhengHei"},{n:"Arial"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"},{n:"System"},
6
+ {n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],$=[{n:"x-small",s:"10px",t:"\u6975\u5c0f"},{n:"small",s:"13px",t:"\u7279\u5c0f"},{n:"medium",s:"16px",t:"\u5c0f"},{n:"large",s:"18px",t:"\u4e2d"},{n:"x-large",s:"24px",t:"\u5927"},{n:"xx-large",s:"32px",t:"\u7279\u5927"},{n:"-webkit-xxx-large",s:"48px",t:"\u6975\u5927"}],Bb=[{s:"\u9760\u5de6\u5c0d\u9f4a",v:"justifyleft"},{s:"\u7f6e\u4e2d",v:"justifycenter"},{s:"\u9760\u53f3\u5c0d\u9f4a",v:"justifyright"},{s:"\u5de6\u53f3\u5c0d\u9f4a",v:"justifyfull"}],
7
+ Cb=[{s:"\u6578\u5b57\u5217\u8868",v:"insertOrderedList"},{s:"\u7b26\u865f\u5217\u8868",v:"insertUnorderedList"}],Db={"default":{name:"\u9810\u8a2d",width:24,height:24,line:7,list:{smile:"\u5fae\u7b11",tongue:"\u5410\u820c\u982d",titter:"\u5077\u7b11",laugh:"\u5927\u7b11",sad:"\u96e3\u904e",wronged:"\u59d4\u5c48",fastcry:"\u5feb\u54ed\u4e86",cry:"\u54ed",wail:"\u5927\u54ed",mad:"\u751f\u6c23",knock:"\u6572\u6253",curse:"\u7f75\u4eba",crazy:"\u6293\u72c2",angry:"\u767c\u706b",ohmy:"\u9a5a\u8a1d",awkward:"\u5c37\u5c2c",
8
+ panic:"\u9a5a\u6050",shy:"\u5bb3\u7f9e",cute:"\u53ef\u6190",envy:"\u7fa8\u6155",proud:"\u5f97\u610f",struggle:"\u596e\u9b25",quiet:"\u5b89\u975c",shutup:"\u9589\u5634",doubt:"\u7591\u554f",despise:"\u9119\u8996",sleep:"\u7761\u89ba",bye:"\u518d\u898b"}}},ta={Cut:{t:"\u526a\u4e0b (Ctrl+X)"},Copy:{t:"\u8907\u88fd (Ctrl+C)"},Paste:{t:"\u8cbc\u4e0a (Ctrl+V)"},Pastetext:{t:"\u8cbc\u4e0a\u6587\u672c",h:y?0:1},Blocktag:{t:"\u6bb5\u843d\u6a19\u7c64",h:1},Fontface:{t:"\u5b57\u578b",h:1},FontSize:{t:"\u5b57\u578b\u5927\u5c0f",
9
+ h:1},Bold:{t:"\u7c97\u9ad4 (Ctrl+B)",s:"Ctrl+B"},Italic:{t:"\u659c\u9ad4 (Ctrl+I)",s:"Ctrl+I"},Underline:{t:"\u5e95\u7dda (Ctrl+U)",s:"Ctrl+U"},Strikethrough:{t:"\u522a\u9664\u7dda"},FontColor:{t:"\u5b57\u578b\u984f\u8272",h:1},BackColor:{t:"\u80cc\u666f\u984f\u8272",h:1},SelectAll:{t:"\u5168\u9078 (Ctrl+A)"},Removeformat:{t:"\u522a\u9664\u6587\u5b57\u683c\u5f0f"},Align:{t:"\u5c0d\u9f4a",h:1},List:{t:"\u5217\u8868",h:1},Outdent:{t:"\u6e1b\u5c11\u7e2e\u6392"},Indent:{t:"\u589e\u52a0\u7e2e\u6392"},
10
+ Link:{t:"\u8d85\u9023\u7d50 (Ctrl+L)",s:"Ctrl+L",h:1},Unlink:{t:"\u53d6\u6d88\u8d85\u9023\u7d50"},Anchor:{t:"\u9328\u9ede",h:1},Img:{t:"\u5716\u7247",h:1},Flash:{t:"Flash\u52d5\u756b",h:1},Media:{t:"\u591a\u5a92\u9ad4\u6587\u4ef6",h:1},Hr:{t:"\u63d2\u5165\u6c34\u5e73\u7dda"},Emot:{t:"\u8868\u60c5",s:"ctrl+e",h:1},Table:{t:"\u8868\u683c",h:1},Source:{t:"\u539f\u59cb\u78bc"},Preview:{t:"\u9810\u89bd"},Print:{t:"\u6253\u5370 (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"\u5168\u87a2\u5e55\u7de8\u8f2f (Esc)",
11
+ s:"Esc"},About:{t:"\u95dc\u65bc xhEditor"}},Va={mini:"Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Link,Img,Emot",full:"Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen"};
12
+ Va.mfull=Va.full.replace(/\|(,Align)/i,"/$1");var Eb={a:"Link",img:"Img",embed:"Embed"},Fb={"<":"&lt;",">":"&gt;",'"':"&quot;","\u00ae":"&reg;","\u00a9":"&copy;"},Gb=/[<>"\u00ae\u00a9]/g,Ea=function(B,A){function J(a){a=a.target;var b=Eb[a.tagName.toLowerCase()];if(b){if(b==="Embed")b={"application/x-shockwave-flash":"Flash","application/x-mplayer2":"Media"}[a.type.toLowerCase()];d.exec(b)}}function Qa(a){if(a.which===27){if(Ga)d.removeModal();else Z&&d.hidePanel();return false}}function hb(){setTimeout(d.setSource,
13
+ 10)}function aa(){d.getSource()}function ib(a){var b,c,g;if(a&&(b=a.originalEvent.clipboardData)&&(c=b.items)&&(g=c[0])&&g.kind=="file"&&g.type.match(/^image\//i)){a=g.getAsFile();b=new FileReader;b.onload=function(){var j='<img src="'+event.target.result+'">';j=jb(j);d.pasteHTML(j)};b.readAsDataURL(a);return false}var n=p.cleanPaste;if(n===0||F||Wa)return true;Wa=true;d.saveBookmark();b=y?"pre":"div";var m=e("<"+b+' class="xhe-paste">\ufeff\ufeff</'+b+">",v).appendTo(v.body);b=m[0];c=d.getSel();
14
+ g=d.getRng(true);m.css("top",ba.scrollTop());if(y){g.moveToElementText(b);g.select();g.execCommand("Paste");if(b.innerHTML=="\ufeff\ufeff"){m.remove();return}a.preventDefault()}else{g.selectNodeContents(b);c.removeAllRanges();c.addRange(g)}setTimeout(function(){var j=n===3,i;if(j)i=m.text();else{var l=[];e(".xhe-paste",v.body).each(function(f,h){e(h).find(".xhe-paste").length==0&&l.push(h.innerHTML)});i=l.join("<br />")}m.remove();d.loadBookmark();if(j)d.pasteText(i);else{i=d.cleanHTML(i);i=d.cleanWord(i);
15
+ i=d.formatXHTML(i);if(!p.onPaste||p.onPaste&&(i=p.onPaste(i))!==false){i=jb(i);d.pasteHTML(i)}}Wa=false},0)}function jb(a){var b=p.localUrlTest,c=p.remoteImgSaveUrl;if(b&&c){var g=[],n=0;a=a.replace(/(<img)((?:\s+[^>]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(m,j,i,l,f){if(/^(https?|data:image)/i.test(l)&&!b.test(l)){g[n]=l;i=i.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+Ha+'img/waiting.gif" remoteimg="'+n++ +'"')}return j+i+f});g.length>0&&e.post(c,
16
+ {urls:g.join("|")},function(m){m=m.split("|");e("img[remoteimg]",d.doc).each(function(){var j=e(this);U(j,"src",m[j.attr("remoteimg")]);j.removeAttr("remoteimg")})})}return a}function Xa(a){try{d._exec("styleWithCSS",a,true)}catch(b){try{d._exec("useCSS",!a,true)}catch(c){}}}function Ya(){if(Za&&!F){Xa(false);try{d._exec("enableObjectResizing",true,true)}catch(a){}if(y)try{d._exec("BackgroundImageCache",true,true)}catch(b){}}}function Hb(a){if(F||a.which!==13||a.shiftKey||a.ctrlKey||a.altKey)return true;
17
+ a=d.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(p.forcePtag)a.length===0&&d._exec("formatblock","<p>");else{d.pasteHTML("<br />");y&&a.length>0&&d.getRng().parentElement().childNodes.length===2&&d.pasteHTML("<br />");return false}}function $a(){if(!Da&&!Y){ua&&O.height("100%").css("height",O.outerHeight()-C.outerHeight());y&&C.hide().show()}}function Ib(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var b=d.getSel(),c=d.getRng(true);c.selectNode(a);b.removeAllRanges();
18
+ b.addRange(c)}}function U(a,b,c){if(!b)return false;var g="_xhe_"+b;if(c){if(Ia)c=ca(c,Ia,P);a.attr(b,P?ca(c,"abs",P):c).removeAttr(g).attr(g,c)}return a.attr(g)||a.attr(b)}function ab(){Fa&&d.hidePanel()}function Jb(a){if(F)return true;var b=a.which,c=yb[b];b=c?c:String.fromCharCode(b).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=b;a=va[sKey];for(var g in a){g=a[g];if(e.isFunction(g)){if(g.call(d)===false)return false}else{d.exec(g);
19
+ return false}}}function V(a,b){var c=typeof a;if(!b)return c!="undefined";if(b==="array"&&a.hasOwnProperty&&a instanceof Array)return true;return c===b}function ca(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||a.match(/^#/i))return a;var g=c?e('<a href="'+c+'" />')[0]:location;c=g.protocol;var n=g.host,m=g.hostname,j=g.port;g=g.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");if(j==="")j="80";if(g==="")g="/";else if(g.charAt(0)!=="/")g="/"+g;a=e.trim(a);if(b!=="abs")a=a.replace(RegExp(c+
20
+ "\\/\\/"+m.replace(/\./g,"\\.")+"(?::"+j+")"+(j==="80"?"?":"")+"(/|$)","i"),"/");if(b==="rel")a=a.replace(RegExp("^"+g.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(b!=="rel"){a.match(/^(https?:\/\/|\/)/i)||(a=g+a);if(a.charAt(0)==="/"){m=[];a=a.split("/");var i=a.length;for(g=0;g<i;g++){j=a[g];if(j==="..")m.pop();else j!==""&&j!=="."&&m.push(j)}a[i-1]===""&&m.push("");a="/"+m.join("/")}}if(b==="abs"&&!a.match(/^https?:\/\//i))a=c+"//"+n+a;return a=a.replace(/(https?:\/\/[^:\/?#]+):80(\/|$)/i,
21
+ "$1$2")}function kb(a,b){if(b==="*"||a.match(RegExp(".("+b.replace(/,/g,"|")+")$","i")))return true;else{alert("\u4e0a\u50b3\u6587\u4ef6\u64f4\u5c55\u540d\u5fc5\u9700\u70ba: "+b);return false}}function lb(a){var b=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(b))).toFixed(2)+["Byte","KB","MB","GB","TB","PB"][b]}function W(){return false}var d=this,Q=e(B),mb=Q.closest("form"),C,O,la,ba,v,ma,na,Za=false,F=false,ua=false,Wa=false,bb,wa=false,nb="",M=null,Ja,xa=false,cb=false,
22
+ oa=null,da=null,X=0,p=d.settings=e.extend({},Ea.settings,A),Ka=p.plugins,La=[];if(Ka){ta=e.extend({},ta,Ka);e.each(Ka,function(a){La.push(a)});La=La.join(",")}if(p.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var ob=Va[e.trim(p.tools)];p.tools=p.tools.match(/m?full/i)&&Ka?ob.replace("Table","Table,"+La):ob}p.tools.match(/(^|,)\s*About\s*(,|$)/i)||(p.tools+=",About");p.tools=p.tools.split(",");if(p.editorRoot)T=p.editorRoot;T=ca(T,"abs");if(p.urlBase)p.urlBase=ca(p.urlBase,"abs");var pb="xheCSS_"+
23
+ p.skin,ya="xhe"+ia+"_container",qb="xhe"+ia+"_Tool",rb="xhe"+ia+"_iframearea",sb="xhe"+ia+"_iframe",Ma="xhe"+ia+"_fixffcursor",za="",pa="",Ha=T+"xheditor_skin/"+p.skin+"/",Na=Db,Ia=p.urlType,P=p.urlBase,ea=p.emotPath;ea=ea?ea:T+"xheditor_emot/";var db="";Na=e.extend({},Na,p.emots);ea=ca(ea,"rel",P?P:null);if(wa=p.showBlocktag)pa+=" showBlocktag";var va=[];this.init=function(){e("#"+pb).length===0&&e("head").append('<link id="'+pb+'" rel="stylesheet" type="text/css" href="'+Ha+'ui.css" />');var a=
24
+ Q.outerWidth(),b=Q.outerHeight();a=p.width||B.style.width||(a>10?a:0);X=p.height||B.style.height||(b>10?b:150);if(V(a,"number"))a+="px";if(V(X,"string"))X=X.replace(/[^\d]+/g,"");b=p.background||B.style.background;var c=['<span class="xheGStart"/>'],g,n,m=/\||\//i;e.each(p.tools,function(f,h){h.match(m)&&c.push('<span class="xheGEnd"/>');if(h==="|")c.push('<span class="xheSeparator"/>');else if(h==="/")c.push("<br />");else{g=ta[h];if(!g)return;n=g.c?g.c:"xheIcon xheBtn"+h;c.push('<span><a href="#" title="'+
25
+ g.t+'" cmd="'+h+'" class="xheButton xheEnabled" tabindex="-1" role="button"><span class="'+n+'" unselectable="on" style="font-size:0;color:transparent;text-indent:-999px;">'+g.t+"</span></a></span>");g.s&&d.addShortcuts(g.s,h)}h.match(m)&&c.push('<span class="xheGStart"/>')});c.push('<span class="xheGEnd"/><br />');Q.after(e('<input type="text" id="'+Ma+'" style="position:absolute;display:none;" /><span id="'+ya+'" class="xhe_'+p.skin+'" style="display:none"><table cellspacing="0" cellpadding="0" class="xheLayout" style="'+
26
+ (a!="0px"?"width:"+a+";":"")+"height:"+X+'px;" role="presentation"><tr><td id="'+qb+'" class="xheTool" unselectable="on" style="height:1px;" role="presentation"></td></tr><tr><td id="'+rb+'" class="xheIframeArea" role="presentation"><iframe frameborder="0" id="'+sb+'" src="javascript:;" style="width:100%;"></iframe></td></tr></table></span>'));C=e("#"+qb);O=e("#"+rb);za='<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><link rel="stylesheet" href="'+Ha+'iframe.css"/>';if(a=p.loadCSS)if(V(a,
27
+ "array"))for(var j in a)za+='<link rel="stylesheet" href="'+a[j]+'"/>';else za+=a.match(/\s*<style(\s+[^>]*?)?>[\s\S]+?<\/style>\s*/i)?a:'<link rel="stylesheet" href="'+a+'"/>';j="<html><head>"+za+"<title>\u53ef\u8996\u5316\u7de8\u8f2f\u5668,alt+1\u52309\u9375,\u5207\u63db\u5230\u5de5\u5177\u5340,tab\u9375,\u9078\u64c7\u6309\u9215,esc\u9375,\u8fd4\u56de\u7de8\u8f2f "+(p.readTip?p.readTip:"")+"</title>";if(b)j+="<style>body{background:"+b+";}</style>";j+='</head><body spellcheck="0" class="editMode'+
28
+ pa+'"></body></html>';d.win=la=e("#"+sb)[0].contentWindow;ba=e(la);try{this.doc=v=la.document;ma=e(v);v.open();v.write(j);v.close();if(y)v.body.contentEditable="true";else v.designMode="On"}catch(i){}setTimeout(Ya,300);d.setSource();la.setInterval=null;C.append(c.join("")).bind("mousedown contextmenu",W).click(function(f){var h=e(f.target).closest("a");if(h.is(".xheEnabled")){clearTimeout(Ja);C.find("a").attr("tabindex","-1");M=f;d.exec(h.attr("cmd"))}return false});C.find(".xheButton").hover(function(f){var h=
29
+ e(this),o=p.hoverExecDelay,k=da;da=null;if(o===-1||xa||!h.is(".xheEnabled"))return false;if(k&&k>10){xa=true;setTimeout(function(){xa=false},100);return false}var q=h.attr("cmd");if(ta[q].h!==1){d.hidePanel();return false}if(cb)o=0;if(o>=0)Ja=setTimeout(function(){M=f;oa={x:M.clientX,y:M.clientY};d.exec(q)},o)},function(){oa=null;Ja&&clearTimeout(Ja)}).mousemove(function(f){if(oa){var h={x:f.clientX-oa.x,y:f.clientY-oa.y};if(Math.abs(h.x)>1||Math.abs(h.y)>1){if(h.x>0&&h.y>0){h=Math.round(Math.atan(h.y/
30
+ h.x)/0.017453293);da=da?(da+h)/2:h}else da=null;oa={x:f.clientX,y:f.clientY}}}});L=e("#xhePanel");ra=e("#xheShadow");sa=e("#xheCntLine");if(L.length===0){L=e('<div id="xhePanel"></div>').mousedown(function(f){f.stopPropagation()});ra=e('<div id="xheShadow"></div>');sa=e('<div id="xheCntLine"></div>');setTimeout(function(){e(document.body).append(L).append(ra).append(sa)},10)}e("#"+ya).show();Q.hide();O.css("height",X-C.outerHeight());y&Ca<8&&setTimeout(function(){O.css("height",X-C.outerHeight())},
31
+ 1);Q.focus(d.focus);mb.submit(aa).bind("reset",hb);p.submitID&&e("#"+p.submitID).click(aa);e(window).bind("unload beforeunload",aa).bind("resize",$a);e(document).mousedown(ab);if(!fb){e(document).keydown(Qa);fb=true}ba.focus(function(){p.focus&&p.focus()}).blur(function(){p.blur&&p.blur()});Y&&ba.click(Ib);ma.mousedown(ab).keydown(Jb).keypress(Hb).dblclick(J).bind("mousedown click",function(f){Q.trigger(f.type)});if(y){ma.keydown(function(f){var h=d.getRng();if(f.which===8&&h.item){e(h.item(0)).remove();
32
+ return false}});var l=function(f){f=e(f.target);var h;if(h=f.css("width"))f.css("width","").attr("width",h.replace(/[^0-9%]+/g,""));if(h=f.css("height"))f.css("height","").attr("height",h.replace(/[^0-9%]+/g,""))};ma.bind("controlselect",function(f){f=f.target;e.nodeName(f,"IMG")&&e(f).unbind("resizeend",l).bind("resizeend",l)})}ma.keydown(function(f){var h=f.which;if(f.altKey&&h>=49&&h<=57){C.find("a").attr("tabindex","0");C.find(".xheGStart").eq(h-49).next().find("a").focus();v.title="\ufeff\ufeff";
33
+ return false}}).click(function(){C.find("a").attr("tabindex","-1")});C.keydown(function(f){var h=f.which;if(h==27){C.find("a").attr("tabindex","-1");d.focus()}else if(f.altKey&&h>=49&&h<=57){C.find(".xheGStart").eq(h-49).next().find("a").focus();return false}});j=e(v.documentElement);eb?j.bind("keydown",function(f){f.ctrlKey&&f.which===86&&ib()}):j.bind("paste",ib);p.disableContextmenu&&j.bind("contextmenu",W);p.html5Upload&&j.bind("dragenter dragover",function(f){var h;if((h=f.originalEvent.dataTransfer.types)&&
34
+ e.inArray("Files",h)!==-1)return false}).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(f&&(h=f.files)&&h.length>0){var o,k;f=["Link","Img","Flash","Media"];var q=[],r;for(o in f){k=f[o];p["up"+k+"Url"]&&p["up"+k+"Url"].match(/^[^!].*/i)&&q.push(k+":,"+p["up"+k+"Ext"])}if(q.length===0)return false;else r=q.join(",");k=function(t){var s,w;for(o=0;o<t.length;o++){s=t[o].fileName.replace(/.+\./,"");if(s=r.match(RegExp("(\\w+):[^:]*,"+s+"(?:,|$)","i")))if(w){if(w!==s[1])return 2}else w=
35
+ s[1];else return 1}return w}(h);if(k===1)alert("\u4e0a\u50b3\u6587\u4ef6\u7684\u64f4\u5c55\u540d\u5fc5\u9700\u70ba\uff1a"+r.replace(/\w+:,/g,""));else if(k===2)alert("\u6bcf\u6b21\u53ea\u80fd\u62d6\u653e\u4e0a\u50b3\u540c\u4e00\u985e\u578b\u6587\u4ef6");else k&&d.startUpload(h,p["up"+k+"Url"],"*",function(t){var s=[],w;(w=p.onUpload)&&w(t);for(o in t){w=t[o];url=V(w,"string")?w:w.url;if(url.substr(0,1)==="!")url=url.substr(1);s.push(url)}d.exec(k);e("#xhe"+k+"Url").val(s.join(" "));e("#xheSave").click()});
36
+ return false}});(j=p.shortcuts)&&e.each(j,function(f,h){d.addShortcuts(f,h)});ia++;Za=true;if(p.fullscreen)d.toggleFullscreen();else p.sourceMode&&setTimeout(d.toggleSource,20);return true};this.remove=function(){d.hidePanel();aa();Q.unbind("focus",d.focus);mb.unbind("submit",aa).unbind("reset",hb);p.submitID&&e("#"+p.submitID).unbind("mousedown",aa);e(window).unbind("unload beforeunload",aa).unbind("resize",$a);e(document).unbind("mousedown",ab);e("#"+ya).remove();e("#"+Ma).remove();Q.show();Za=
37
+ false};this.saveBookmark=function(){if(!F){d.focus();var a=d.getRng();a=a.cloneRange?a.cloneRange():a;na={top:ba.scrollTop(),rng:a}}};this.loadBookmark=function(){if(!(F||!na)){d.focus();var a=na.rng;if(y)a.select();else{var b=d.getSel();b.removeAllRanges();b.addRange(a)}ba.scrollTop(na.top);na=null}};this.focus=function(){F?e("#sourceCode",v).focus():ba.focus();if(y){var a=d.getRng();a.parentElement&&a.parentElement().ownerDocument!==v&&d.setTextCursor()}return false};this.setTextCursor=function(a){var b=
38
+ d.getRng(true),c=v.body;if(y)b.moveToElementText(c);else{for(var g=a?"lastChild":"firstChild";c.nodeType!=3&&c[g];)c=c[g];b.selectNode(c)}b.collapse(a?false:true);if(y)b.select();else{a=d.getSel();a.removeAllRanges();a.addRange(b)}};this.getSel=function(){return v.selection?v.selection:la.getSelection()};this.getRng=function(a){var b,c;try{if(!a){b=d.getSel();c=b.createRange?b.createRange():b.rangeCount>0?b.getRangeAt(0):null}c||(c=v.body.createTextRange?v.body.createTextRange():v.createRange())}catch(g){}return c};
39
+ this.getParent=function(a){var b=d.getRng(),c;if(y)c=b.item?b.item(0):b.parentElement();else{c=b.commonAncestorContainer;if(!b.collapsed)if(b.startContainer===b.endContainer&&b.startOffset-b.endOffset<2&&b.startContainer.hasChildNodes())c=b.startContainer.childNodes[b.startOffset]}a=a?a:"*";c=e(c);c.is(a)||(c=e(c).closest(a));return c};this.getSelect=function(a){var b=d.getSel(),c=d.getRng(),g=true;g=!c||c.item?false:!b||c.boundingWidth===0||c.collapsed;if(a==="text")return g?"":c.text||(b.toString?
40
+ b.toString():"");if(c.cloneContents){a=e("<div></div>");(c=c.cloneContents())&&a.append(c);c=a.html()}else c=V(c.item)?c.item(0).outerHTML:V(c.htmlText)?c.htmlText:c.toString();if(g)c="";c=d.processHTML(c,"read");c=d.cleanHTML(c);return c=d.formatXHTML(c)};this.pasteHTML=function(a,b){if(F)return false;d.focus();a=d.processHTML(a,"write");var c=d.getSel(),g=d.getRng();if(b!==ha){if(g.item){var n=g.item(0);g=d.getRng(true);g.moveToElementText(n);g.select()}g.collapse(b)}a+="<"+(y?"img":"span")+' id="_xhe_temp" width="0" height="0" />';
41
+ if(g.insertNode){if(e(g.startContainer).closest("style,script").length>0)return false;g.deleteContents();g.insertNode(g.createContextualFragment(a))}else{if(c.type.toLowerCase()==="control"){c.clear();g=d.getRng()}g.pasteHTML(a)}n=e("#_xhe_temp",v);var m=n[0];if(y){g.moveToElementText(m);g.select()}else{g.selectNode(m);c.removeAllRanges();c.addRange(g)}n.remove()};this.pasteText=function(a,b){a||(a="");a=d.domEncode(a);a=a.replace(/\r?\n/g,"<br />");d.pasteHTML(a,b)};this.appendHTML=function(a){if(F)return false;
42
+ d.focus();a=d.processHTML(a,"write");e(v.body).append(a);d.setTextCursor(true)};this.domEncode=function(a){return a.replace(Gb,function(b){return Fb[b]})};this.setSource=function(a){na=null;if(typeof a!=="string"&&a!=="")a=B.value;if(F)e("#sourceCode",v).val(a);else{if(p.beforeSetSource)a=p.beforeSetSource(a);a=d.cleanHTML(a);a=d.formatXHTML(a);a=d.processHTML(a,"write");if(y){v.body.innerHTML='<img id="_xhe_temp" width="0" height="0" />'+a+"\n";e("#_xhe_temp",v).remove()}else v.body.innerHTML=a}};
43
+ this.processHTML=function(a,b){if(b==="write"){a=a.replace(/(<(\/?)(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g,function(m,j,i,l,f,h,o){l=l.toLowerCase();if(Da)if(l==="strong")l="b";else{if(l==="em")l="i"}else if(Y)if(l==="strong"){l="span";i||(f+=' class="Apple-style-span" style="font-weight: bold;"')}else if(l==="em"){l="span";i||(f+=' class="Apple-style-span" style="font-style: italic;"')}else if(l==="u"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: underline;"')}else if(l===
44
+ "strike"){l="span";i||(f+=' class="Apple-style-span" style="text-decoration: line-through;"')}var k,q="";if(l==="del")l="strike";else if(l==="img")f=f.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(t,s){k=s.match(/^(["']?)(.*)\1/)[2];k=k.split(",");if(!k[1]){k[1]=k[0];k[0]=""}if(k[0]==="default")k[0]="";return p.emotMark?t:""});else if(l==="a"){if(!f.match(/ href=[^ ]/i)&&f.match(/ name=[^ ]/i))q+=" xhe-anchor";if(o)h="></a>"}else if(l==="table"&&!i){m=f.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i);
45
+ if(!m||m[1].match(/^(["']?)\s*0\s*\1$/))q+=" xhe-border"}var r;f=f.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(t,s,w){s=s.toLowerCase();w=w.match(/^(["']?)(.*)\1/)[2];aft="";if(y&&s.match(/^(disabled|checked|readonly|selected)$/)&&w.match(/^(false|0)$/i))return"";if(l==="img"&&k&&s==="src")return"";if(s.match(/^(src|href)$/)){aft=" _xhe_"+s+'="'+w+'"';if(P)w=ca(w,"abs",P)}if(q&&s==="class"){w+=" "+q;q=""}if(Y&&s==="style")if(l==="span"&&w.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i))r=
46
+ true;return" "+s+'="'+w+'"'+aft});if(k){m=ea+(k[0]?k[0]:"default")+"/"+k[1]+".gif";f+=' src="'+m+'" _xhe_src="'+m+'"'}if(r)f+=' class="Apple-style-span"';if(q)f+=' class="'+q+'"';return"<"+i+l+f+h});if(y)a=a.replace(/&apos;/ig,"&#39;");if(!Y){var c=function(m,j,i,l){j="";var f,h;if(f=i.match(/font-family\s*:\s*([^;"]+)/i))j+=' face="'+f[1]+'"';if(f=i.match(/font-size\s*:\s*([^;"]+)/i)){f=f[1].toLowerCase();for(var o=0;o<$.length;o++)if(f===$[o].n||f===$[o].s){h=o+1;break}if(h){j+=' size="'+h+'"';
47
+ i=i.replace(/(^|;)(\s*font-size\s*:\s*[^;"]+;?)+/ig,"$1")}}if(h=i.match(/(?:^|[\s;])color\s*:\s*([^;"]+)/i)){if(f=h[1].match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)){h[1]="#";for(o=1;o<=3;o++)h[1]+=(f[o]-0).toString(16)}h[1]=h[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3");j+=' color="'+h[1]+'"'}i=i.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig,"$1");if(j!==""){if(i)j+=' style="'+i+'"';return"<font"+j+">"+l+"</font>"}else return m};a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
48
+ c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}a=a.replace(/<(td|th)(\s+[^>]*?)?>(\s|&nbsp;)*<\/\1>/ig,"<$1$2>"+(y?"":"<br />")+"</$1>")}else{if(Y){var g=[{r:/font-weight:\sbold/ig,
49
+ t:"strong"},{r:/font-style:\sitalic/ig,t:"em"},{r:/text-decoration:\sunderline/ig,t:"u"},{r:/text-decoration:\sline-through/ig,t:"strike"}];c=function(m,j,i,l,f){j=i+l;i="";if(!j)return f;for(l=0;l<g.length;l++)if(j.match(g[l].r)){i=g[l].t;break}return i?"<"+i+">"+f+"</"+i+">":m};for(var n=0;n<2;n++){a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,
50
+ c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}}a=a.replace(/(<(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g,function(m,j,i,l,f){i=i.toLowerCase();var h;l=l.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(o,
51
+ k){h=k.match(/^(["']?)(.*)\1/)[2];return""});if(h&&Ia)h=ca(h,Ia,P);l=l.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(o,k,q){k=k.toLowerCase();q=q.match(/^(["']?)(.*)\1/)[2];if(k==="class"){if(q.match(/^["']?(apple|webkit)/i))return"";q=q.replace(/\s?xhe-[a-z]+/ig,"");if(q==="")return""}else if(k.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return"";else if(h&&k.match(/^(src|href)$/i))return" "+k+'="'+h+'"';else if(k==="style")q=q.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i,
52
+ function(r,t,s,w,I){for(var N,D=0;D<$.length;D++){r=$[D];if(w===r.n){N=r.s;break}}return t+s+":"+N+I});return" "+k+'="'+q+'"'});if(i==="img"&&!l.match(/\s+alt\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i))l+=' alt=""';return j+l+f});a=a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)(<br(\s*\/)?>)?\s*<\/\2>/ig,function(m,j,i,l){return j+(l?l:"&nbsp;")+"</"+i+">"});a=a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(<span(?:\s+[^>]*?)?>\s*<\/span>|<br(?:\s+[^>]*?)?>|&nbsp;)*\s*(?:<\/\1>)?\s*$/i,"")}return a=a.replace(/(<pre(?:\s+[^>]*?)?>)([\s\S]+?)(<\/pre>)/gi,
53
+ function(m,j,i,l){return j+i.replace(/<br\s*\/?>/ig,"\r\n")+l})};this.getSource=function(a){var b,c=p.beforeGetSource;if(F){b=e("#sourceCode",v).val();c||(b=d.formatXHTML(b,false))}else{b=d.processHTML(v.body.innerHTML,"read");b=d.cleanHTML(b);b=d.formatXHTML(b,a);if(c)b=c(b)}return B.value=b};this.cleanWord=function(a){var b=p.cleanPaste;if(b>0&&b<3&&a.match(/mso(-|normal)|WordDocument|<table\s+[^>]*?x:str/i)){a=a.replace(/<!--[\s\S]*?--\>|<!(--)?\[[\s\S]+?\](--)?>|<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,
54
+ "");a=a.replace(/\r?\n/ig,"");a=a.replace(/(<(\/?)([\w\-:]+))((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?>)/g,function(g,n,m,j,i,l){j=j.toLowerCase();if(j.match(/^(link|img)$/)&&i.match(/file:\/\//i)||j.match(/:/)||j==="span"&&b===2)return"";m||(i=i.replace(/\s([\w\-:]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^>\s]+))?/ig,function(f,h,o){h=h.toLowerCase();o=o.match(/^(["']?)(.*)\1/)[2];if(h.match(/:/))return"";else if(h.match(/^(class|lang|language|span)$/))return"";else if(j==="td"&&(h===
55
+ "height"||h==="width"&&!i.match(/\scolspan="\d+"/i)))return"";else if(h==="style"){if(b===2)return"";return(o=e.trim(o.replace(/\s*(mso-[^:]+:.+?|margin\s*:\s*0cm 0cm 0pt\s*|(text-align|font-variant|line-height)\s*:\s*.+?)(;|$)\s*/ig,"")))?" "+h+'="'+o.replace(/"/g,"'")+'"':""}return f}));return n+i+l});for(var c=0;c<3;c++)a=a.replace(/<([^\s>]+)(\s+[^>]*)?>\s*<\/\1>/g,function(g,n){return n.match(/^a$/i)?g:""})}return a};this.cleanHTML=function(a){a=a.replace(/<!?\/?(DOCTYPE|html|body|meta)(\s+[^>]*?)?>/ig,
56
+ "");var b;a=a.replace(/<head(?:\s+[^>]*?)?>([\s\S]*?)<\/head>/i,function(c,g){b=g.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig);return""});if(b)a=b.join("")+a;a=a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig,"");p.internalScript||(a=a.replace(/<script(\s+[^>]*?)?>[\s\S]*?<\/script>/ig,""));p.internalStyle||(a=a.replace(/<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,""));if(!p.linkTag||!p.inlineScript||!p.inlineStyle)a=a.replace(/(<(\w+))((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/ig,
57
+ function(c,g,n,m,j){if(!p.linkTag&&n.toLowerCase()==="link")return"";p.inlineScript||(m=m.replace(/\s+on(?:click|dblclick|mouse(down|up|move|over|out|enter|leave|wheel)|key(down|press|up)|change|select|submit|reset|blur|focus|load|unload)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));p.inlineStyle||(m=m.replace(/\s+(style|class)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));return g+m+j});return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|<br\/?>|&nbsp;)*?)<\1(\s+[^>]*?)?>/ig,"$2")};this.formatXHTML=function(a,
58
+ b){function c(u){var x={};u=u.split(",");for(var z=0;z<u.length;z++)x[u[z]]=true;return x}function g(u){u=u.toLowerCase();var x=w[u];return x?x:u}function n(u,x,z){if(k[u])for(;G.last()&&q[G.last()];)m(G.last());r[u]&&G.last()===u&&m(u);(z=o[u]||!!z)||G.push(u);var K=[];K.push("<"+u);x.replace(N,function(tb,Aa,ub,vb,wb){Aa=Aa.toLowerCase();K.push(" "+Aa+'="'+(ub?ub:vb?vb:wb?wb:t[Aa]?Aa:"").replace(/"/g,"'")+'"')});K.push((z?" /":"")+">");l(K.join(""),u,true);if(u==="pre")Oa=true}function m(u){if(u)for(x=
59
+ G.length-1;x>=0;x--){if(G[x]===u)break}else var x=0;if(x>=0){for(var z=G.length-1;z>=x;z--)l("</"+G[z]+">",G[z]);G.length=x}if(u==="pre"){Oa=false;fa--}}function j(u){l(d.domEncode(u))}function i(u){D.push(u.replace(/^[\s\r\n]+|[\s\r\n]+$/g,""))}function l(u,x,z){Oa||(u=u.replace(/(\t*\r?\n\t*)+/g,""));if(!Oa&&b===true)if(u.match(/^\s*$/))D.push(u);else{var K=k[x],tb=K?x:"";if(K){z&&fa++;Pa===""&&fa--}else Pa&&fa++;if(tb!==Pa||K)f();D.push(u);x==="br"&&f();if(K&&(o[x]||!z))fa--;Pa=K?x:""}else D.push(u)}
60
+ function f(){D.push("\r\n");if(fa>0)for(var u=fa;u--;)D.push("\t")}function h(u,x,z,K){if(!z)return K;u="";if(x=z.match(/ face\s*=\s*"\s*([^"]+)\s*"/i))u+="font-family:"+x[1]+";";if(x=z.match(/ size\s*=\s*"\s*(\d+)\s*"/i))u+="font-size:"+$[(x[1]>7?7:x[1]<1?1:x[1])-1].s+";";if(x=z.match(/ color\s*=\s*"\s*([^"]+)\s*"/i))u+="color:"+x[1]+";";if(z=z.match(/ style\s*=\s*"\s*([^"]+)\s*"/i))u+=z[1];if(u)K='<span style="'+u+'">'+K+"</span>";return K}var o=c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),
61
+ k=c("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,table,tbody,td,tfoot,th,thead,tr,ul,script"),q=c("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),r=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),t=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),
62
+ s=c("script,style"),w={b:"strong",i:"em",s:"del",strike:"del"},I=/<(?:\/([^\s>]+)|!--([^>]*?)--|([\w\-:]+)((?:"[^"]*"|'[^']*'|[^"'<>])*)\s*(\/?))>/g,N=/\s*([\w\-:]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g,D=[],G=[];G.last=function(){return this[this.length-1]};for(var E,H,R=0,ga,Ba,fa=-1,Pa="body",Oa=false;E=I.exec(a);){H=E.index;if(H>R){R=a.substring(R,H);ga?Ba.push(R):j(R)}R=I.lastIndex;if(H=E[1]){H=g(H);if(ga&&H===ga){i(Ba.join(""));Ba=ga=null}if(!ga){m(H);continue}}if(ga)Ba.push(E[0]);
63
+ else if(H=E[3]){H=g(H);n(H,E[4],E[5]);if(s[H]){ga=H;Ba=[]}}else E[2]&&D.push(E[0])}a.length>R&&j(a.substring(R,a.length));m();a=D.join("");D=null;a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,h);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,
64
+ h);return a=a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g,"")};this.toggleShowBlocktag=function(a){if(wa!==a){wa=!wa;a=e(v.body);if(wa){pa+=" showBlocktag";a.addClass("showBlocktag")}else{pa=pa.replace(" showBlocktag","");a.removeClass("showBlocktag")}}};this.toggleSource=function(a){if(F!==a){C.find("[cmd=Source]").toggleClass("xheEnabled").toggleClass("xheActive");var b=v.body,c=e(b),g,n;a=0;var m="";if(F){g=d.getSource();c.html("").removeAttr("scroll").attr("class","editMode"+pa);if(y)b.contentEditable=
65
+ "true";else v.designMode="On";if(Da){d._exec("inserthtml","-");e("#"+Ma).show().focus().hide()}m="\u539f\u59cb\u78bc"}else{d.pasteHTML('<span id="_xhe_cursor"></span>',true);g=d.getSource(true);a=g.indexOf('<span id="_xhe_cursor"></span>');if(!eb)a=g.substring(0,a).replace(/\r/g,"").length;g=g.replace(/(\r?\n\s*|)<span id="_xhe_cursor"><\/span>(\s*\r?\n|)/,function(j,i,l){return i&&l?"\r\n":i+l});if(y)b.contentEditable="false";else v.designMode="Off";c.attr("scroll","no").attr("class","sourceMode").html('<textarea id="sourceCode" wrap="soft" spellcheck="false" height="100%" />');
66
+ n=e("#sourceCode",c).blur(d.getSource)[0];m="\u53ef\u8996\u5316\u7de8\u8f2f"}F=!F;d.setSource(g);d.focus();if(F)if(n.setSelectionRange)n.setSelectionRange(a,a);else{n=n.createTextRange();n.move("character",a);n.select()}else d.setTextCursor();C.find("[cmd=Source]").attr("title",m).find("span").text(m);C.find("[cmd=Source],[cmd=Preview]").toggleClass("xheEnabled");C.find(".xheButton").not("[cmd=Source],[cmd=Fullscreen],[cmd=About]").toggleClass("xheEnabled").attr("aria-disabled",F?true:false);setTimeout(Ya,
67
+ 300)}};this.showPreview=function(){var a=p.beforeSetSource,b=d.getSource();if(a)b=a(b);a="<html><head>"+za+"<title>\u9810\u89bd</title>"+(P?'<base href="'+P+'"/>':"")+"</head><body>"+b+"</body></html>";b=window.screen;b=window.open("","xhePreview","toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+Math.round(b.width*0.9)+",height="+Math.round(b.height*0.8)+",left="+Math.round(b.width*0.05));var c=b.document;c.open();c.write(a);c.close();b.focus()};this.toggleFullscreen=
68
+ function(a){if(ua!==a){a=e("#"+ya).find(".xheLayout");var b=e("#"+ya),c=jQuery.browser.version;c=y&&(c==6||c==7);if(ua){c&&Q.after(b);a.attr("style",nb);O.height(X-C.outerHeight());e(window).scrollTop(bb);setTimeout(function(){e(window).scrollTop(bb)},10)}else{c&&e("body").append(b);bb=e(window).scrollTop();nb=a.attr("style");a.removeAttr("style");O.height("100%");setTimeout($a,100)}if(Da){e("#"+Ma).show().focus().hide();setTimeout(d.focus,1)}else c&&d.setTextCursor();ua=!ua;b.toggleClass("xhe_Fullscreen");
69
+ e("html").toggleClass("xhe_Fullfix");C.find("[cmd=Fullscreen]").toggleClass("xheActive");setTimeout(Ya,300)}};this.showMenu=function(a,b){var c=e('<div class="xheMenu"></div>'),g=a.length,n=[];e.each(a,function(m,j){n.push("<a href=\"javascript:void('"+j.v+'\')" title="'+(j.t?j.t:j.s)+'" v="'+j.v+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(m+1)+'" tabindex="0">'+j.s+"</a>")});c.append(n.join(""));c.click(function(m){m=m.target;if(!e.nodeName(m,"DIV")){d.loadBookmark();b(e(m).closest("a").attr("v"));
70
+ d.hidePanel();return false}}).mousedown(W);d.showPanel(c);d.saveBookmark()};this.showColor=function(a){var b=e('<div class="xheColor"></div>'),c=[],g=gb.length,n=0;e.each(gb,function(m,j){if(n%7===0)c.push((n>0?"</div>":"")+"<div>");c.push("<a href=\"javascript:void('"+j+'\')" xhev="'+j+'" title="'+j+'" style="background:'+j+'" role="option" aria-setsize="'+g+'" aria-posinset="'+(n+1)+'"></a>');n++});c.push("</div>");b.append(c.join(""));b.click(function(m){m=m.target;if(e.nodeName(m,"A")){d.loadBookmark();
71
+ a(e(m).attr("xhev"));d.hidePanel();return false}}).mousedown(W);d.showPanel(b);d.saveBookmark()};this.showPastetext=function(){var a=e('<div><label for="xhePastetextValue">\u4f7f\u7528\u9375\u76e4\u5feb\u6377\u9375(Ctrl+V)\u628a\u5167\u5bb9\u8cbc\u4e0a\u5230\u65b9\u6846\u88e1\uff0c\u6309 \u78ba\u5b9a</label></div><div><textarea id="xhePastetextValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>'),
72
+ b=e("#xhePastetextValue",a);e("#xheSave",a).click(function(){d.loadBookmark();var c=b.val();c&&d.pasteText(c);d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showLink=function(){var a='<div><label for="xheLinkUrl">\u93c8\u63a5\u5730\u5740: </label><input type="text" id="xheLinkUrl" value="http://" class="xheText" /></div><div><label for="xheLinkTarget">\u6253\u958b\u65b9\u5f0f: </label><select id="xheLinkTarget"><option selected="selected" value="">\u9810\u8a2d</option><option value="_blank">\u65b0\u7a97\u53e3</option><option value="_self">\u7576\u524d\u7a97\u53e3</option><option value="_parent">\u7236\u7a97\u53e3</option></select></div><div style="display:none"><label for="xheLinkText">\u93c8\u63a5\u6587\u5b57: </label><input type="text" id="xheLinkText" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>',
73
+ b=ma.find("a[name]").not("[href]"),c=b.length>0;if(c){var g=[];b.each(function(){var f=e(this).attr("name");g.push('<option value="#'+f+'">'+f+"</option>")});a=a.replace(/(<div><label for="xheLinkTarget)/,'<div><label for="xheLinkAnchor">\u9801\u5167\u9328\u9ede: </label><select id="xheLinkAnchor"><option value="">\u672a\u9078\u64c7</option>'+g.join("")+"</select></div>$1")}a=e(a);var n=d.getParent("a"),m=e("#xheLinkText",a),j=e("#xheLinkUrl",a),i=e("#xheLinkTarget",a);b=e("#xheSave",a);var l=d.getSelect();
74
+ c&&a.find("#xheLinkAnchor").change(function(){var f=e(this).val();f!=""&&j.val(f)});if(n.length===1){if(!n.attr("href")){M=null;return d.exec("Anchor")}j.val(U(n,"href"));i.attr("value",n.attr("target"))}else l===""&&m.val(p.defLinkText).closest("div").show();p.upLinkUrl&&d.uploadInit(j,p.upLinkUrl,p.upLinkExt);b.click(function(){d.loadBookmark();var f=j.val();if(f===""||n.length===0)d._exec("unlink");if(f!==""&&f!=="http://"){var h=f.split(" "),o=i.val(),k=m.val();if(h.length>1){d._exec("unlink");
75
+ l=d.getSelect();var q='<a href="xhe_tmpurl"',r=[];if(o!=="")q+=' target="'+o+'"';q+=">xhe_tmptext</a>";k=l!==""?l:k?k:f;for(var t in h){f=h[t];if(f!==""){f=f.split("||");o=q;o=o.replace("xhe_tmpurl",f[0]);o=o.replace("xhe_tmptext",f[1]?f[1]:k);r.push(o)}}d.pasteHTML(r.join("&nbsp;"))}else{f=h[0].split("||");k||(k=f[0]);k=f[1]?f[1]:l!==""?"":k?k:f[0];if(n.length===0){k?d.pasteHTML('<a href="#xhe_tmpurl">'+k+"</a>"):d._exec("createlink","#xhe_tmpurl");n=e('a[href$="#xhe_tmpurl"]',v)}else k&&!Y&&n.text(k);
76
+ U(n,"href",f[0]);o!==""?n.attr("target",o):n.removeAttr("target")}}d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAnchor=function(){var a=e('<div><label for="xheAnchorName">\u9328\u9ede\u540d\u7a31: </label><input type="text" id="xheAnchorName" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>'),b=d.getParent("a"),c=e("#xheAnchorName",a),g=e("#xheSave",a);if(b.length===1){if(b.attr("href")){M=null;
77
+ return d.exec("Link")}c.val(b.attr("name"))}g.click(function(){d.loadBookmark();var n=c.val();if(n)b.length===0?d.pasteHTML('<a name="'+n+'"></a>'):b.attr("name",n);else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showImg=function(){var a=e('<div><label for="xheImgUrl">\u5716\u7247\u6587\u4ef6: </label><input type="text" id="xheImgUrl" value="http://" class="xheText" /></div><div><div><label for="xheImgAlt">\u66ff\u63db\u6587\u672c: </label><input type="text" id="xheImgAlt" /></div><div><label for="xheImgAlign">\u5c0d\u9f4a\u65b9\u5f0f: </label><select id="xheImgAlign"><option selected="selected" value="">\u9810\u8a2d</option><option value="left">\u9760\u5de6\u5c0d\u9f4a</option><option value="right">\u9760\u53f3\u5c0d\u9f4a</option><option value="top">\u9802\u7aef</option><option value="middle">\u7f6e\u4e2d</option><option value="baseline">\u57fa\u7dda</option><option value="bottom">\u5e95\u908a</option></select></div><div><label for="xheImgWidth">\u5bec\u3000\u3000\u5ea6: </label><input type="text" id="xheImgWidth" style="width:40px;" /> <label for="xheImgHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheImgHeight" style="width:40px;" /></div><div><label for="xheImgBorder">\u908a\u6846\u5927\u5c0f: </label><input type="text" id="xheImgBorder" style="width:40px;" /></div><div><label for="xheImgHspace">\u6c34\u5e73\u9593\u8ddd: </label><input type="text" id="xheImgHspace" style="width:40px;" /> <label for="xheImgVspace">\u5782\u76f4\u9593\u8ddd: </label><input type="text" id="xheImgVspace" style="width:40px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>'),
78
+ b=d.getParent("img"),c=e("#xheImgUrl",a),g=e("#xheImgAlt",a),n=e("#xheImgAlign",a),m=e("#xheImgWidth",a),j=e("#xheImgHeight",a),i=e("#xheImgBorder",a),l=e("#xheImgVspace",a),f=e("#xheImgHspace",a),h=e("#xheSave",a);if(b.length===1){c.val(U(b,"src"));g.val(b.attr("alt"));n.val(b.attr("align"));m.val(b.attr("width"));j.val(b.attr("height"));i.val(b.attr("border"));var o=b.attr("vspace"),k=b.attr("hspace");l.val(o<=0?"":o);f.val(k<=0?"":k)}p.upImgUrl&&d.uploadInit(c,p.upImgUrl,p.upImgExt);h.click(function(){d.loadBookmark();
79
+ var q=c.val();if(q!==""&&q!=="http://"){var r=q.split(" "),t=g.val(),s=n.val(),w=m.val(),I=j.val(),N=i.val(),D=l.val(),G=f.val();if(r.length>1){var E='<img src="xhe_tmpurl"',H=[];if(t!=="")E+=' alt="'+t+'"';if(s!=="")E+=' align="'+s+'"';if(w!=="")E+=' width="'+w+'"';if(I!=="")E+=' height="'+I+'"';if(N!=="")E+=' border="'+N+'"';if(D!=="")E+=' vspace="'+D+'"';if(G!=="")E+=' hspace="'+G+'"';E+=" />";for(var R in r){q=r[R];if(q!==""){q=q.split("||");t=E;t=t.replace("xhe_tmpurl",q[0]);if(q[1])t='<a href="'+
80
+ q[1]+'" target="_blank">'+t+"</a>";H.push(t)}}d.pasteHTML(H.join("&nbsp;"))}else if(r.length===1){q=r[0];if(q!==""){q=q.split("||");if(b.length===0){d.pasteHTML('<img src="'+q[0]+'#xhe_tmpurl" />');b=e('img[src$="#xhe_tmpurl"]',v)}U(b,"src",q[0]);t!==""&&b.attr("alt",t);s!==""?b.attr("align",s):b.removeAttr("align");w!==""?b.attr("width",w):b.removeAttr("width");I!==""?b.attr("height",I):b.removeAttr("height");N!==""?b.attr("border",N):b.removeAttr("border");D!==""?b.attr("vspace",D):b.removeAttr("vspace");
81
+ G!==""?b.attr("hspace",G):b.removeAttr("hspace");if(q[1]){r=b.parent("a");if(r.length===0){b.wrap("<a></a>");r=b.parent("a")}U(r,"href",q[1]);r.attr("target","_blank")}}}}else b.length===1&&b.remove();d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showEmbed=function(a,b,c,g,n,m,j){b=e(b);var i=d.getParent('embed[type="'+c+'"],embed[classid="'+g+'"]'),l=e("#xhe"+a+"Url",b),f=e("#xhe"+a+"Width",b),h=e("#xhe"+a+"Height",b);a=e("#xheSave",b);m&&d.uploadInit(l,m,j);if(i.length===1){l.val(U(i,
82
+ "src"));f.val(i.attr("width"));h.val(i.attr("height"))}a.click(function(){d.loadBookmark();var o=l.val();if(o!==""&&o!=="http://"){var k=f.val(),q=h.val(),r=/^\d+%?$/;r.test(k)||(k=412);r.test(q)||(q=300);var t='<embed type="'+c+'" classid="'+g+'" src="xhe_tmpurl"'+n;r=o.split(" ");if(r.length>1){t=t+"";var s,w=[];t+=' width="xhe_width" height="xhe_height" />';for(var I in r){o=r[I].split("||");s=t;s=s.replace("xhe_tmpurl",o[0]);s=s.replace("xhe_width",o[1]?o[1]:k);s=s.replace("xhe_height",o[2]?o[2]:
83
+ q);o!==""&&w.push(s)}d.pasteHTML(w.join("&nbsp;"))}else if(r.length===1){o=r[0].split("||");if(i.length===0){d.pasteHTML(t.replace("xhe_tmpurl",o[0]+"#xhe_tmpurl")+" />");i=e('embed[src$="#xhe_tmpurl"]',v)}U(i,"src",o[0]);i.attr("width",o[1]?o[1]:k);i.attr("height",o[2]?o[2]:q)}}else i.length===1&&i.remove();d.hidePanel();return false});d.showDialog(b);d.saveBookmark()};this.showEmot=function(a){var b=e('<div class="xheEmot"></div>');a=a?a:db?db:"default";var c=Na[a],g=ea+a+"/",n=0,m=[],j="";j=c.width;
84
+ var i=c.height,l=c.line,f=c.count;c=c.list;if(f)for(c=1;c<=f;c++){n++;m.push("<a href=\"javascript:void('"+c+'\')" style="background-image:url('+g+c+'.gif);" emot="'+a+","+c+'" xhev="" title="'+c+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")}else e.each(c,function(k,q){n++;m.push("<a href=\"javascript:void('"+q+'\')" style="background-image:url('+g+k+'.gif);" emot="'+a+","+k+'" title="'+q+'" xhev="'+q+'" role="option">&nbsp;</a>');n%l===0&&m.push("<br />")});f=l*(j+12);c=f*0.75;if(Math.ceil(n/
85
+ l)*(i+12)<=c)c="";j=e("<style>"+(c?".xheEmot div{width:"+(f+20)+"px;height:"+c+"px;}":"")+".xheEmot div a{width:"+j+"px;height:"+i+"px;}</style><div>"+m.join("")+"</div>").click(function(k){k=k.target;var q=e(k);if(e.nodeName(k,"A")){d.pasteHTML('<img emot="'+q.attr("emot")+'" alt="'+q.attr("xhev")+'">');d.hidePanel();return false}}).mousedown(W);b.append(j);var h=0,o=['<ul role="tablist">'];e.each(Na,function(k,q){h++;o.push("<li"+(a===k?' class="cur"':"")+' role="presentation"><a href="javascript:void(\''+
86
+ q.name+'\')" group="'+k+'" role="tab" tabindex="0">'+q.name+"</a></li>")});if(h>1){o.push('</ul><br style="clear:both;" />');j=e(o.join("")).click(function(k){db=e(k.target).attr("group");d.exec("Emot");return false}).mousedown(W);b.append(j)}d.showPanel(b)};this.showTable=function(){var a=e('<div><label for="xheTableRows">\u884c\u3000\u3000\u6578: </label><input type="text" id="xheTableRows" style="width:40px;" value="3" /> <label for="xheTableColumns">\u5217\u3000\u3000\u6578: </label><input type="text" id="xheTableColumns" style="width:40px;" value="2" /></div><div><label for="xheTableHeaders">\u6a19\u984c\u55ae\u5143: </label><select id="xheTableHeaders"><option selected="selected" value="">\u7121</option><option value="row">\u7b2c\u4e00\u884c</option><option value="col">\u7b2c\u4e00\u5217</option><option value="both">\u7b2c\u4e00\u884c\u548c\u7b2c\u4e00\u5217</option></select></div><div><label for="xheTableWidth">\u5bec\u3000\u3000\u5ea6: </label><input type="text" id="xheTableWidth" style="width:40px;" value="200" /> <label for="xheTableHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheTableHeight" style="width:40px;" value="" /></div><div><label for="xheTableBorder">\u908a\u6846\u5927\u5c0f: </label><input type="text" id="xheTableBorder" style="width:40px;" value="1" /></div><div><label for="xheTableCellSpacing">\u8868\u683c\u9593\u8ddd: </label><input type="text" id="xheTableCellSpacing" style="width:40px;" value="1" /> <label for="xheTableCellPadding">\u8868\u683c\u586b\u5145: </label><input type="text" id="xheTableCellPadding" style="width:40px;" value="1" /></div><div><label for="xheTableAlign">\u5c0d\u9f4a\u65b9\u5f0f: </label><select id="xheTableAlign"><option selected="selected" value="">\u9810\u8a2d</option><option value="left">\u9760\u5de6\u5c0d\u9f4a</option><option value="center">\u7f6e\u4e2d</option><option value="right">\u9760\u53f3\u5c0d\u9f4a</option></select></div><div><label for="xheTableCaption">\u8868\u683c\u6a19\u984c: </label><input type="text" id="xheTableCaption" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>'),
87
+ b=e("#xheTableRows",a),c=e("#xheTableColumns",a),g=e("#xheTableHeaders",a),n=e("#xheTableWidth",a),m=e("#xheTableHeight",a),j=e("#xheTableBorder",a),i=e("#xheTableCellSpacing",a),l=e("#xheTableCellPadding",a),f=e("#xheTableAlign",a),h=e("#xheTableCaption",a);e("#xheSave",a).click(function(){d.loadBookmark();var o=h.val(),k=j.val(),q=b.val(),r=c.val(),t=g.val(),s=n.val(),w=m.val(),I=i.val(),N=l.val(),D=f.val();k="<table"+(k!==""?' border="'+k+'"':"")+(s!==""?' width="'+s+'"':"")+(w!==""?' height="'+
88
+ w+'"':"")+(I!==""?' cellspacing="'+I+'"':"")+(N!==""?' cellpadding="'+N+'"':"")+(D!==""?' align="'+D+'"':"")+">";if(o!=="")k+="<caption>"+o+"</caption>";if(t==="row"||t==="both"){k+="<tr>";for(o=0;o<r;o++)k+='<th scope="col"></th>';k+="</tr>";q--}k+="<tbody>";for(o=0;o<q;o++){k+="<tr>";for(s=0;s<r;s++)k+=s===0&&(t==="col"||t==="both")?'<th scope="row"></th>':"<td></td>";k+="</tr>"}k+="</tbody></table>";d.pasteHTML(k);d.hidePanel();return false});d.showDialog(a);d.saveBookmark()};this.showAbout=function(){var a=
89
+ e('<div style="font:12px Arial;width:245px;word-wrap:break-word;word-break:break-all;outline:none;" role="dialog" tabindex="-1"><p><span style="font-size:20px;color:#1997DF;">xhEditor</span><br />v1.1.10 (build 110904)</p><p>xhEditor\u662f\u57fa\u65bcjQuery\u958b\u767c\u7684\u8de8\u5e73\u53f0\u8f15\u91cf\u53ef\u8996\u5316XHTML\u7de8\u8f2f\u5668\uff0c\u57fa\u65bc<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">LGPL</a>\u958b\u6e90\u5354\u8b70\u767c\u4f48\u3002</p><p>Copyright &copy; <a href="http://xheditor.com/" target="_blank">xhEditor.com</a>. All rights reserved.</p></div>');
90
+ a.find("p").attr("role","presentation");d.showDialog(a,true);setTimeout(function(){a.focus()},100)};this.addShortcuts=function(a,b){a=a.toLowerCase();if(va[a]===ha)va[a]=[];va[a].push(b)};this.delShortcuts=function(a){delete va[a]};this.uploadInit=function(a,b,c){function g(f){if(V(f,"string"))f=[f];var h=false,o,k=f.length,q,r=[];(o=p.onUpload)&&o(f);for(o=0;o<k;o++){q=f[o];q=V(q,"string")?q:q.url;if(q.substr(0,1)==="!"){h=true;q=q.substr(1)}r.push(q)}a.val(r.join(" "));h&&a.closest(".xheDialog").find("#xheSave").click()}
91
+ var n=e('<span class="xheUpload"><input type="text" style="visibility:hidden;" tabindex="-1" /><input type="button" value="'+p.upBtnText+'" class="xheBtn" tabindex="-1" /></span>'),m=e(".xheBtn",n),j=p.html5Upload,i=j?p.upMultiple:1;a.after(n);m.before(a);b=b.replace(/{editorRoot}/ig,T);if(b.substr(0,1)==="!")m.click(function(){d.showIframeModal("\u4e0a\u50b3\u6587\u4ef6",b.substr(1),g,null,null)});else{n.append('<input type="file"'+(i>1?' multiple=""':"")+' class="xheFile" size="13" name="filedata" tabindex="-1" />');
92
+ var l=e(".xheFile",n);l.change(function(){d.startUpload(l[0],b,c,g)});setTimeout(function(){a.closest(".xheDialog").bind("dragenter dragover",W).bind("drop",function(f){f=f.originalEvent.dataTransfer;var h;if(j&&f&&(h=f.files)&&h.length>0)d.startUpload(h,b,c,g);return false})},10)}};this.startUpload=function(a,b,c,g){function n(k,q){var r=Object,t=false;try{r=eval("("+k+")")}catch(s){}if(r.err===ha||r.msg===ha)alert(b+" \u4e0a\u50b3\u63a5\u53e3\u767c\u751f\u932f\u8aa4\uff01\r\n\r\n\u8fd4\u56de\u7684\u932f\u8aa4\u5167\u5bb9\u70ba: \r\n\r\n"+
93
+ k);else if(r.err)alert(r.err);else{m.push(r.msg);t=true}if(!t||q)d.removeModal();q&&t&&g(m);return t}var m=[],j=p.html5Upload,i=j?p.upMultiple:1,l,f=e('<div style="padding:22px 0;text-align:center;line-height:30px;">\u6587\u4ef6\u4e0a\u50b3\u4e2d\uff0c\u8acb\u7a0d\u5019\u2026\u2026<br /></div>'),h='<img src="'+Ha+'img/loading.gif">';if(!j||a.nodeType&&!((l=a.files)&&l[0].fileName)){if(!kb(a.value,c))return;f.append(h);c=new d.html4Upload(a,b,n)}else{l||(l=a);a=l.length;if(a>i){alert("\u8acb\u4e0d\u8981\u4e00\u6b21\u4e0a\u50b3\u8d85\u904e"+
94
+ i+"\u500b\u6587\u4ef6");return}for(i=0;i<a;i++)if(!kb(l[i].fileName,c))return;var o=e('<div class="xheProgress"><div><span>0%</span></div></div>');f.append(o);c=new d.html5Upload("filedata",l,b,n,function(k){if(k.loaded>=0){var q=Math.round(k.loaded*100/k.total)+"%";e("div",o).css("width",q);e("span",o).text(q+" ( "+lb(k.loaded)+" / "+lb(k.total)+" )")}else o.replaceWith(h)})}d.showModal("\u6587\u4ef6\u4e0a\u50b3\u4e2d(Esc\u53d6\u6d88\u4e0a\u50b3)",f,320,150);c.start()};this.html4Upload=function(a,
95
+ b,c){var g="jUploadFrame"+(new Date).getTime(),n=this,m=e('<iframe name="'+g+'" class="xheHideArea" />').appendTo("body"),j=e('<form action="'+b+'" target="'+g+'" method="post" enctype="multipart/form-data" class="xheHideArea"></form>').appendTo("body"),i=e(a),l=i.clone().attr("disabled","true");i.before(l).appendTo(j);this.remove=function(){if(n!==null){l.before(i).remove();m.remove();j.remove();n=null}};this.onLoad=function(){var f=m[0].contentWindow.document,h=e(f.body).text();f.write("");n.remove();
96
+ c(h,true)};this.start=function(){j.submit();m.load(n.onLoad)};return this};this.html5Upload=function(a,b,c,g,n){function m(r,t,s,w){i=new XMLHttpRequest;upload=i.upload;i.onreadystatechange=function(){i.readyState===4&&s(i.responseText)};if(upload)upload.onprogress=function(I){w(I.loaded)};else w(-1);i.open("POST",t);i.setRequestHeader("Content-Type","application/octet-stream");i.setRequestHeader("Content-Disposition",'attachment; name="'+a+'"; filename="'+r.fileName+'"');i.sendAsBinary?i.sendAsBinary(r.getAsBinary()):
97
+ i.send(r)}function j(r){n&&n({loaded:h+r,total:o})}for(var i,l=0,f=b.length,h=0,o=0,k=this,q=0;q<f;q++)o+=b[q].fileSize;this.remove=function(){if(i){i.abort();i=null}};this.uploadNext=function(r){if(r){h+=b[l-1].fileSize;j(0)}if((!r||r&&g(r,l===f)===true)&&l<f)m(b[l++],c,k.uploadNext,function(t){j(t)})};this.start=function(){k.uploadNext()}};this.showIframeModal=function(a,b,c,g,n,m){function j(){try{h.callback=i;h.unloadme=d.removeModal;e(h.document).keydown(Qa);o=h.name}catch(k){}}function i(k){h.document.write("");
98
+ d.removeModal();k!=null&&c(k)}b=e('<iframe frameborder="0" src="'+b.replace(/{editorRoot}/ig,T)+(/\?/.test(b)?"&":"?")+"parenthost="+location.host+'" style="width:100%;height:100%;display:none;" /><div class="xheModalIfmWait"></div>');var l=b.eq(0),f=b.eq(1);d.showModal(a,b,g,n,m);var h=l[0].contentWindow,o;j();l.load(function(){j();if(o){o=eval("("+unescape(o)+")");return i(o)}if(f.is(":visible")){l.show().focus();f.remove()}})};this.showModal=function(a,b,c,g,n){if(Ga)return false;d.panelState=
99
+ Z;Z=false;ka=p.layerShadow;c=c?c:p.modalWidth;g=g?g:p.modalHeight;S=e('<div class="xheModal" style="width:'+(c-1)+"px;height:"+g+"px;margin-left:-"+Math.ceil(c/2)+"px;"+(y&&Ca<7?"":"margin-top:-"+Math.ceil(g/2)+"px")+'">'+(p.modalTitle?'<div class="xheModalTitle"><span class="xheModalClose" title="\u95dc\u9589 (Esc)" tabindex="0" role="button"></span>'+a+"</div>":"")+'<div class="xheModalContent"></div></div>').appendTo("body");Sa=e('<div class="xheModalOverlay"></div>').appendTo("body");if(ka>0)Ra=
100
+ e('<div class="xheModalShadow" style="width:'+S.outerWidth()+"px;height:"+S.outerHeight()+"px;margin-left:-"+(Math.ceil(c/2)-ka-2)+"px;"+(y&&Ca<7?"":"margin-top:-"+(Math.ceil(g/2)-ka-2)+"px")+'"></div>').appendTo("body");e(".xheModalContent",S).css("height",g-(p.modalTitle?e(".xheModalTitle").outerHeight():0)).html(b);if(y&&Ca===6)Ta=e("select:visible").css("visibility","hidden");e(".xheModalClose",S).click(d.removeModal);Sa.show();ka>0&&Ra.show();S.show();setTimeout(function(){S.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!==
101
+ "hidden"}).eq(0).focus()},10);Ga=true;Ua=n};this.removeModal=function(){Ta&&Ta.css("visibility","visible");S.html("").remove();ka>0&&Ra.remove();Sa.remove();Ua&&Ua();Ga=false;Z=d.panelState};this.showDialog=function(a,b){var c=e('<div class="xheDialog"></div>'),g=e(a),n=e("#xheSave",g);if(n.length===1){g.find("input[type=text],select").keypress(function(i){if(i.which===13){n.click();return false}});g.find("textarea").keydown(function(i){if(i.ctrlKey&&i.which===13){n.click();return false}});n.after(' <input type="button" id="xheCancel" value="\u53d6\u6d88" />');
102
+ e("#xheCancel",g).click(d.hidePanel);if(!p.clickCancelDialog){Fa=false;var m=e('<div class="xheFixCancel"></div>').appendTo("body").mousedown(W),j=O.offset();m.css({left:j.left,top:j.top,width:O.outerWidth(),height:O.outerHeight()})}c.mousedown(function(){xa=true})}c.append(g);d.showPanel(c,b)};this.showPanel=function(a,b){if(!M.target)return false;L.html("").append(a).css("left",-999).css("top",-999);ja=e(M.target).closest("a").addClass("xheActive");var c=ja.offset(),g=c.left;c=c.top;c+=ja.outerHeight()-
103
+ 1;sa.css({left:g+1,top:c,width:ja.width()}).show();var n=document.documentElement,m=document.body;if(g+L.outerWidth()>(window.pageXOffset||n.scrollLeft||m.scrollLeft)+(n.clientWidth||m.clientWidth))g-=L.outerWidth()-ja.outerWidth();n=p.layerShadow;n>0&&ra.css({left:g+n,top:c+n,width:L.outerWidth(),height:L.outerHeight()}).show();L.css({left:g,top:c}).show();b||setTimeout(function(){L.find("a,input[type=text],textarea").filter(":visible").filter(function(){return e(this).css("visibility")!=="hidden"}).eq(0).focus()},
104
+ 10);cb=Z=true};this.hidePanel=function(){if(Z){ja.removeClass("xheActive");ra.hide();sa.hide();L.hide();Z=false;if(!Fa){e(".xheFixCancel").remove();Fa=true}cb=xa=false;da=null;d.focus();d.loadBookmark()}};this.exec=function(a){d.hidePanel();var b=ta[a];if(!b)return false;if(M===null){M={};var c=C.find(".xheButton[cmd="+a+"]");if(c.length===1)M.target=c}if(b.e)b.e.call(d);else{a=a.toLowerCase();switch(a){case "cut":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(g){alert("\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u526a\u4e0b\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u9375\u76e4\u5feb\u6377\u9375(Ctrl + X)\u4f86\u5b8c\u6210")}break;
105
+ case "copy":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(n){alert("\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u8907\u88fd\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u9375\u76e4\u5feb\u6377\u9375(Ctrl + C)\u4f86\u5b8c\u6210")}break;case "paste":try{v.execCommand(a);if(!v.queryCommandSupported(a))throw"Error";}catch(m){alert("\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u8cbc\u4e0a\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u9375\u76e4\u5feb\u6377\u9375(Ctrl + V)\u4f86\u5b8c\u6210")}break;
106
+ case "pastetext":window.clipboardData?d.pasteText(window.clipboardData.getData("Text",true)):d.showPastetext();break;case "blocktag":var j=[];e.each(zb,function(f,h){j.push({s:"<"+h.n+">"+h.t+"</"+h.n+">",v:"<"+h.n+">",t:h.t})});d.showMenu(j,function(f){d._exec("formatblock",f)});break;case "fontface":var i=[];e.each(Ab,function(f,h){h.c=h.c?h.c:h.n;i.push({s:'<span style="font-family:'+h.c+'">'+h.n+"</span>",v:h.c,t:h.n})});d.showMenu(i,function(f){d._exec("fontname",f)});break;case "fontsize":var l=
107
+ [];e.each($,function(f,h){l.push({s:'<span style="font-size:'+h.s+';">'+h.t+"("+h.s+")</span>",v:f+1,t:h.t})});d.showMenu(l,function(f){d._exec("fontsize",f)});break;case "fontcolor":d.showColor(function(f){d._exec("forecolor",f)});break;case "backcolor":d.showColor(function(f){if(y)d._exec("backcolor",f);else{Xa(true);d._exec("hilitecolor",f);Xa(false)}});break;case "align":d.showMenu(Bb,function(f){d._exec(f)});break;case "list":d.showMenu(Cb,function(f){d._exec(f)});break;case "link":d.showLink();
108
+ break;case "anchor":d.showAnchor();break;case "img":d.showImg();break;case "flash":d.showEmbed("Flash",'<div><label for="xheFlashUrl">\u52d5\u756b\u6587\u4ef6: </label><input type="text" id="xheFlashUrl" value="http://" class="xheText" /></div><div><label for="xheFlashWidth">\u5bec\u3000\u3000\u5ea6: </label><input type="text" id="xheFlashWidth" style="width:40px;" value="480" /> <label for="xheFlashHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheFlashHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>',
109
+ "application/x-shockwave-flash","clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000",' wmode="opaque" quality="high" menu="false" play="true" loop="true" allowfullscreen="true"',p.upFlashUrl,p.upFlashExt);break;case "media":d.showEmbed("Media",'<div><label for="xheMediaUrl">\u5a92\u9ad4\u6587\u4ef6: </label><input type="text" id="xheMediaUrl" value="http://" class="xheText" /></div><div><label for="xheMediaWidth">\u5bec\u3000\u3000\u5ea6: </label><input type="text" id="xheMediaWidth" style="width:40px;" value="480" /> <label for="xheMediaHeight">\u9ad8\u3000\u3000\u5ea6: </label><input type="text" id="xheMediaHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u78ba\u5b9a" /></div>',
110
+ "application/x-mplayer2","clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",' enablecontextmenu="false" autostart="false"',p.upMediaUrl,p.upMediaExt);break;case "hr":d.pasteHTML("<hr />");break;case "emot":d.showEmot();break;case "table":d.showTable();break;case "source":d.toggleSource();break;case "preview":d.showPreview();break;case "print":la.print();break;case "fullscreen":d.toggleFullscreen();break;case "about":d.showAbout();break;default:d._exec(a)}}M=null};this._exec=function(a,b,c){c||d.focus();
111
+ return b!==ha?v.execCommand(a,false,b):v.execCommand(a,false,null)}};Ea.settings={skin:"default",tools:"full",clickCancelDialog:true,linkTag:false,internalScript:false,inlineScript:false,internalStyle:true,inlineStyle:true,showBlocktag:false,forcePtag:true,upLinkExt:"zip,rar,txt",upImgExt:"jpg,jpeg,gif,png",upFlashExt:"swf",upMediaExt:"wmv,avi,wma,mp3,mid",modalWidth:350,modalHeight:220,modalTitle:true,defLinkText:"\u9ede\u64ca\u6253\u958b\u93c8\u63a5",layerShadow:3,emotMark:false,upBtnText:"\u4e0a\u50b3",
112
+ cleanPaste:2,hoverExecDelay:100,html5Upload:true,upMultiple:99};window.xheditor=Ea;e(function(){e.fn.oldVal=e.fn.val;e.fn.val=function(B){var A=this,J;if(B===ha)return A[0]&&(J=A[0].xheditor)?J.getSource():A.oldVal();return A.each(function(){(J=this.xheditor)?J.setSource(B):A.oldVal(B)})};e("textarea").each(function(){var B=e(this),A=B.attr("class");if(A&&(A=A.match(/(?:^|\s)xheditor(?:\-(m?full|simple|mini))?(?:\s|$)/i)))B.xheditor(A[1]?{tools:A[1]}:null)})})})(jQuery);