/www/NEOSYS/scripts/colors.js

http://exodusdb.googlecode.com/ · JavaScript · 301 lines · 256 code · 35 blank · 10 comment · 16 complexity · 26aa5a15b3b466c83e8c6f53f7238d3d MD5 · raw file

  1. // JScript File
  2. function neosys_val_font()
  3. {
  4. if (gvalue.toUpperCase()=='DEFAULT') gvalue=''
  5. return true
  6. }
  7. function neosys_val_color()
  8. {
  9. if (gvalue.toUpperCase()=='DEFAULT') gvalue=''
  10. return true
  11. }
  12. function neosys_dict_font(di)
  13. {
  14. di.lowercase=true;
  15. di.allowcursor=true
  16. //get fonts
  17. var tt=''
  18. if (!di.required) tt+='Default;Default:'
  19. tt=neosys_get_fonts(tt)
  20. di.conversion=tt
  21. di.popup='neosys_pop_font('
  22. if (di.required) di.popup+='true'
  23. di.popup+=')'
  24. return
  25. }
  26. function neosys_pop_font(required,many)
  27. {
  28. //get colors
  29. var tt=''
  30. if (!required) tt+='Default;Default:'
  31. tt=neosys_get_fonts(tt)
  32. tt=tt.split(':')
  33. for (ii=tt.length-1;ii>=0;ii--)
  34. {
  35. var ttt=tt[ii].split(';')
  36. ttt[1]=''
  37. ttt[2]='<div width=100% style="font:'+ttt[0]+'">'+ttt[0]
  38. //exclude this since it still works without it and it triggers XML mode in neosysdecide2
  39. //ttt[2]+='</div>'
  40. tt[ii]=ttt.join(vm)
  41. }
  42. tt=tt.join(fm)
  43. return neosysdecide2('',tt,[[2,'']],0,'',many)
  44. }
  45. function neosys_dict_color(di)
  46. {
  47. di.lowercase=true;
  48. di.allowcursor=true
  49. //get colors
  50. var tt=''
  51. if (!di.required) tt+=';Default:'
  52. tt=neosys_get_colors(tt)
  53. di.conversion=tt
  54. di.popup='neosys_pop_color('
  55. if (di.required) di.popup+='true'
  56. di.popup+=')'
  57. return
  58. }
  59. function neosys_pop_color(required,many)
  60. {
  61. //get colors
  62. var tt=''
  63. if (!required) tt+=';Default:'
  64. tt=neosys_get_colors(tt)
  65. //use contents to show colors in popup
  66. tt=tt.split(':')
  67. for (ii=tt.length-1;ii>=0;ii--)
  68. {
  69. var ttt=tt[ii].split(';')
  70. ttt[2]='<div width=100% style="background-color:'+ttt[0]+'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'//+ttt[1]
  71. //exclude this since it still works without it and it triggers XML mode in neosysdecide2
  72. //ttt[2]+='</div>'
  73. tt[ii]=ttt.join(vm)
  74. }
  75. tt=tt.join(fm)
  76. return neosysdecide2('',tt,[[2,''],[1,''],[0,'']],1,'',many)
  77. }
  78. function neosys_get_colors(tt)
  79. {
  80. if (!tt) tt=''
  81. tt+='#000000;Black:'
  82. tt+='#000080;Navy:'
  83. tt+='#00008B;DarkBlue:'
  84. tt+='#0000CD;MediumBlue:'
  85. tt+='#0000FF;Blue:'
  86. tt+='#006400;DarkGreen:'
  87. tt+='#008000;Green:'
  88. tt+='#008080;Teal:'
  89. tt+='#008B8B;DarkCyan:'
  90. tt+='#00BFFF;DeepSkyBlue:'
  91. tt+='#00CED1;DarkTurquoise:'
  92. tt+='#00FA9A;MediumSpringGreen:'
  93. tt+='#00FF00;Lime:'
  94. tt+='#00FF7F;SpringGreen:'
  95. tt+='#00FFFF;Aqua:'
  96. tt+='#00FFFF;Cyan:'
  97. tt+='#191970;MidnightBlue:'
  98. tt+='#1E90FF;DodgerBlue:'
  99. tt+='#20B2AA;LightSeaGreen:'
  100. tt+='#228B22;ForestGreen:'
  101. tt+='#2E8B57;SeaGreen:'
  102. tt+='#2F4F4F;DarkSlateGray:'
  103. tt+='#2F4F4F;DarkSlateGrey:'
  104. tt+='#32CD32;LimeGreen:'
  105. tt+='#333399;NavyBlue:'
  106. tt+='#3CB371;MediumSeaGreen:'
  107. tt+='#40E0D0;Turquoise:'
  108. tt+='#4169E1;RoyalBlue:'
  109. tt+='#4682B4;SteelBlue:'
  110. tt+='#483D8B;DarkSlateBlue:'
  111. tt+='#48D1CC;MediumTurquoise:'
  112. tt+='#4B0082;Indigo :'
  113. tt+='#556B2F;DarkOliveGreen:'
  114. tt+='#5F9EA0;CadetBlue:'
  115. tt+='#6495ED;CornflowerBlue:'
  116. tt+='#66CDAA;MediumAquaMarine:'
  117. tt+='#696969;DimGray:'
  118. tt+='#696969;DimGrey:'
  119. tt+='#6A5ACD;SlateBlue:'
  120. tt+='#6B8E23;OliveDrab:'
  121. tt+='#708090;SlateGray:'
  122. tt+='#708090;SlateGrey:'
  123. tt+='#778899;LightSlateGray:'
  124. tt+='#778899;LightSlateGrey:'
  125. tt+='#7B68EE;MediumSlateBlue:'
  126. tt+='#7CFC00;LawnGreen:'
  127. tt+='#7FFF00;Chartreuse:'
  128. tt+='#7FFFD4;Aquamarine:'
  129. tt+='#800000;Maroon:'
  130. tt+='#800080;Purple:'
  131. tt+='#808000;Olive:'
  132. tt+='#808080;Gray:'
  133. tt+='#808080;Grey:'
  134. tt+='#87CEEB;SkyBlue:'
  135. tt+='#87CEFA;LightSkyBlue:'
  136. tt+='#8A2BE2;BlueViolet:'
  137. tt+='#8B0000;DarkRed:'
  138. tt+='#8B008B;DarkMagenta:'
  139. tt+='#8B4513;SaddleBrown:'
  140. tt+='#8FBC8F;DarkSeaGreen:'
  141. tt+='#90EE90;LightGreen:'
  142. tt+='#9370D8;MediumPurple:'
  143. tt+='#9400D3;DarkViolet:'
  144. tt+='#98FB98;PaleGreen:'
  145. tt+='#9932CC;DarkOrchid:'
  146. tt+='#9ACD32;YellowGreen:'
  147. tt+='#A0522D;Sienna:'
  148. tt+='#A52A2A;Brown:'
  149. tt+='#A9A9A9;DarkGray:'
  150. tt+='#A9A9A9;DarkGrey:'
  151. tt+='#ADD8E6;LightBlue:'
  152. tt+='#ADFF2F;GreenYellow:'
  153. tt+='#AFEEEE;PaleTurquoise:'
  154. tt+='#B0C4DE;LightSteelBlue:'
  155. tt+='#B0E0E6;PowderBlue:'
  156. tt+='#B22222;FireBrick:'
  157. tt+='#B8860B;DarkGoldenRod:'
  158. tt+='#BA55D3;MediumOrchid:'
  159. tt+='#BC8F8F;RosyBrown:'
  160. tt+='#BDB76B;DarkKhaki:'
  161. tt+='#C0C0C0;Silver:'
  162. tt+='#C71585;MediumVioletRed:'
  163. tt+='#CD5C5C;IndianRed :'
  164. tt+='#CD853F;Peru:'
  165. tt+='#D2691E;Chocolate:'
  166. tt+='#D2B48C;Tan:'
  167. tt+='#D3D3D3;LightGray:'
  168. tt+='#D3D3D3;LightGrey:'
  169. tt+='#D87093;PaleVioletRed:'
  170. tt+='#D8BFD8;Thistle:'
  171. tt+='#DA70D6;Orchid:'
  172. tt+='#DAA520;GoldenRod:'
  173. tt+='#DC143C;Crimson:'
  174. tt+='#DCDCDC;Gainsboro:'
  175. tt+='#DDA0DD;Plum:'
  176. tt+='#DEB887;BurlyWood:'
  177. tt+='#E0FFFF;LightCyan:'
  178. tt+='#E6E6FA;Lavender:'
  179. tt+='#E9967A;DarkSalmon:'
  180. tt+='#EE82EE;Violet:'
  181. tt+='#EEE8AA;PaleGoldenRod:'
  182. tt+='#F08080;LightCoral:'
  183. tt+='#F0E68C;Khaki:'
  184. tt+='#F0F8FF;AliceBlue:'
  185. tt+='#F0FFF0;HoneyDew:'
  186. tt+='#F0FFFF;Azure:'
  187. tt+='#F4A460;SandyBrown:'
  188. tt+='#F5DEB3;Wheat:'
  189. tt+='#F5F5DC;Beige:'
  190. tt+='#F5F5F5;WhiteSmoke:'
  191. tt+='#F5FFFA;MintCream:'
  192. tt+='#F8F8FF;GhostWhite:'
  193. tt+='#FA8072;Salmon:'
  194. tt+='#FAEBD7;AntiqueWhite:'
  195. tt+='#FAF0E6;Linen:'
  196. tt+='#FAFAD2;LightGoldenRodYellow:'
  197. tt+='#FDF5E6;OldLace:'
  198. tt+='#FF0000;Red:'
  199. tt+='#FF00FF;Fuchsia:'
  200. tt+='#FF00FF;Magenta:'
  201. tt+='#FF1493;DeepPink:'
  202. tt+='#FF4500;OrangeRed:'
  203. tt+='#FF6347;Tomato:'
  204. tt+='#FF69B4;HotPink:'
  205. tt+='#FF7F50;Coral:'
  206. tt+='#FF8C00;Darkorange:'
  207. tt+='#FFA07A;LightSalmon:'
  208. tt+='#FFA500;Orange:'
  209. tt+='#FFB6C1;LightPink:'
  210. tt+='#FFC0CB;Pink:'
  211. tt+='#FFD700;Gold:'
  212. tt+='#FFDAB9;PeachPuff:'
  213. tt+='#FFDEAD;NavajoWhite:'
  214. tt+='#FFE4B5;Moccasin:'
  215. tt+='#FFE4C4;Bisque:'
  216. tt+='#FFE4E1;MistyRose:'
  217. tt+='#FFEBCD;BlanchedAlmond:'
  218. tt+='#FFEFD5;PapayaWhip:'
  219. tt+='#FFF0F5;LavenderBlush:'
  220. tt+='#FFF5EE;SeaShell:'
  221. tt+='#FFF8DC;Cornsilk:'
  222. tt+='#FFFACD;LemonChiffon:'
  223. tt+='#FFFAF0;FloralWhite:'
  224. tt+='#FFFAFA;Snow:'
  225. tt+='#FFFF00;Yellow:'
  226. tt+='#FFFFE0;LightYellow:'
  227. tt+='#FFFFF0;Ivory:'
  228. tt+='#FFFFFF;White:'
  229. if (tt.slice(-1)==':') tt=tt.slice(0,-1)
  230. if (tt.slice(0,1)==':') tt=tt.slice(1)
  231. return tt
  232. }
  233. function neosys_get_fonts(tt)
  234. {
  235. if (!tt) tt=''
  236. tt+='SANS SERIF,HELVETICA:'
  237. tt+=' Arial:'
  238. tt+=' Arial Black:'
  239. tt+=' Arial Narrow:'
  240. tt+=' Century Gothic:'
  241. tt+=' Comic Sans MS:'
  242. tt+=' Franklin Gothic Medium:'
  243. tt+=' Haettenschweiler:'
  244. tt+=' Impact:'
  245. tt+=' Lucida Console:'
  246. tt+=' Lucida Sans Unicode:'
  247. tt+=' Microsoft Sans Serif:'
  248. tt+=' MS Reference Sans Serif:'
  249. tt+=' Nina:'
  250. tt+=' Tahoma:'
  251. tt+=' Trebuchet MS:'
  252. tt+=' Verdana:'
  253. tt+='SERIF,TIMES:'
  254. tt+=' Book Antiqua:'
  255. tt+=' Bookman Old Style:'
  256. tt+=' Courier New:'
  257. tt+=' Garamond:'
  258. tt+=' Georgia:'
  259. tt+=' Palatino Linotype:'
  260. tt+=' Sylfaen:'
  261. tt+=' Times New Roman:'
  262. tt+=' Monotype Corsiva:'
  263. if (tt.slice(-1)==':') tt=tt.slice(0,-1)
  264. if (tt.slice(0,1)==':') tt=tt.slice(1)
  265. return tt
  266. }