sunspot_solr 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sunspot-solr +2 -6
  3. data/lib/sunspot/solr/server.rb +2 -3
  4. data/solr/README.txt +181 -181
  5. data/solr/bin/post +29 -19
  6. data/solr/bin/solr +247 -428
  7. data/solr/bin/solr.cmd +102 -256
  8. data/solr/bin/solr.in.cmd +15 -7
  9. data/solr/bin/solr.in.sh +26 -12
  10. data/solr/server/README.txt +110 -113
  11. data/solr/server/contexts/solr-jetty-context.xml +8 -8
  12. data/solr/server/etc/jetty-http.xml +47 -0
  13. data/solr/server/etc/jetty-https-ssl.xml +175 -159
  14. data/solr/server/etc/jetty-https.xml +53 -0
  15. data/solr/server/etc/jetty-ssl.xml +46 -0
  16. data/solr/server/etc/jetty.xml +189 -167
  17. data/solr/server/etc/webdefault.xml +527 -527
  18. data/solr/server/lib/javax.servlet-api-3.1.0.jar +0 -0
  19. data/solr/server/lib/jetty-continuation-9.2.11.v20150529.jar +0 -0
  20. data/solr/server/lib/jetty-deploy-9.2.11.v20150529.jar +0 -0
  21. data/solr/server/lib/jetty-http-9.2.11.v20150529.jar +0 -0
  22. data/solr/server/lib/jetty-io-9.2.11.v20150529.jar +0 -0
  23. data/solr/server/lib/jetty-jmx-9.2.11.v20150529.jar +0 -0
  24. data/solr/server/lib/jetty-rewrite-9.2.11.v20150529.jar +0 -0
  25. data/solr/server/lib/jetty-security-9.2.11.v20150529.jar +0 -0
  26. data/solr/server/lib/jetty-server-9.2.11.v20150529.jar +0 -0
  27. data/solr/server/lib/jetty-servlet-9.2.11.v20150529.jar +0 -0
  28. data/solr/server/lib/jetty-servlets-9.2.11.v20150529.jar +0 -0
  29. data/solr/server/lib/jetty-util-9.2.11.v20150529.jar +0 -0
  30. data/solr/server/lib/jetty-webapp-9.2.11.v20150529.jar +0 -0
  31. data/solr/server/lib/jetty-xml-9.2.11.v20150529.jar +0 -0
  32. data/solr/server/modules/http.mod +9 -0
  33. data/solr/server/modules/https.mod +9 -0
  34. data/solr/server/modules/server.mod +11 -0
  35. data/solr/server/modules/ssl.mod +9 -0
  36. data/solr/server/resources/jetty-logging.properties +1 -0
  37. data/solr/server/resources/log4j.properties +24 -24
  38. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-exec-1.3.jar +0 -0
  39. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{hadoop-annotations-2.3.0.jar → hadoop-annotations-2.6.0.jar} +0 -0
  40. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.6.0.jar +0 -0
  41. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.6.0.jar +0 -0
  42. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.6.0.jar +0 -0
  43. data/solr/server/solr-webapp/webapp/WEB-INF/lib/htrace-core-3.0.4.jar +0 -0
  44. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.4.1.jar +0 -0
  45. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.4.1.jar +0 -0
  46. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.4.1.jar +0 -0
  47. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.5.4.jar +0 -0
  48. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.5.4.jar +0 -0
  49. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-common-5.0.0.jar → lucene-analyzers-common-5.3.1.jar} +0 -0
  50. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-kuromoji-5.0.0.jar → lucene-analyzers-kuromoji-5.3.1.jar} +0 -0
  51. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-analyzers-phonetic-5.0.0.jar → lucene-analyzers-phonetic-5.3.1.jar} +0 -0
  52. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.3.1.jar +0 -0
  53. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.3.1.jar +0 -0
  54. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.3.1.jar +0 -0
  55. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-expressions-5.0.0.jar → lucene-expressions-5.3.1.jar} +0 -0
  56. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-grouping-5.0.0.jar → lucene-grouping-5.3.1.jar} +0 -0
  57. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.3.1.jar +0 -0
  58. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.3.1.jar +0 -0
  59. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.3.1.jar +0 -0
  60. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.3.1.jar +0 -0
  61. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.3.1.jar +0 -0
  62. data/solr/server/solr-webapp/webapp/WEB-INF/lib/{lucene-queryparser-5.0.0.jar → lucene-queryparser-5.3.1.jar} +0 -0
  63. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-sandbox-5.3.1.jar +0 -0
  64. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.3.1.jar +0 -0
  65. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.3.1.jar +0 -0
  66. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.3.0.jar +0 -0
  67. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar +0 -0
  68. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.3.1.jar +0 -0
  69. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.3.1.jar +0 -0
  70. data/solr/server/solr-webapp/webapp/WEB-INF/lib/t-digest-3.1.jar +0 -0
  71. data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +169 -181
  72. data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -28
  73. data/solr/server/solr-webapp/webapp/admin.html +164 -163
  74. data/solr/server/solr-webapp/webapp/css/angular/analysis.css +304 -0
  75. data/solr/server/solr-webapp/webapp/css/angular/chosen.css +465 -0
  76. data/solr/server/solr-webapp/webapp/css/angular/cloud.css +398 -0
  77. data/solr/server/solr-webapp/webapp/css/angular/common.css +724 -0
  78. data/solr/server/solr-webapp/webapp/css/angular/cores.css +233 -0
  79. data/solr/server/solr-webapp/webapp/css/angular/dataimport.css +370 -0
  80. data/solr/server/solr-webapp/webapp/css/angular/documents.css +179 -0
  81. data/solr/server/solr-webapp/webapp/css/angular/files.css +53 -0
  82. data/solr/server/solr-webapp/webapp/css/angular/index.css +206 -0
  83. data/solr/server/solr-webapp/webapp/css/angular/logging.css +376 -0
  84. data/solr/server/solr-webapp/webapp/css/angular/menu.css +321 -0
  85. data/solr/server/solr-webapp/webapp/css/angular/plugins.css +212 -0
  86. data/solr/server/solr-webapp/webapp/css/angular/query.css +162 -0
  87. data/solr/server/solr-webapp/webapp/css/angular/replication.css +500 -0
  88. data/solr/server/solr-webapp/webapp/css/angular/schema-browser.css +567 -0
  89. data/solr/server/solr-webapp/webapp/css/angular/segments.css +173 -0
  90. data/solr/server/solr-webapp/webapp/css/angular/threads.css +161 -0
  91. data/solr/server/solr-webapp/webapp/css/chosen.css +421 -421
  92. data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -311
  93. data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -410
  94. data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -701
  95. data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -244
  96. data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -155
  97. data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -403
  98. data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -197
  99. data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -54
  100. data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -207
  101. data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -52
  102. data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -391
  103. data/solr/server/solr-webapp/webapp/css/styles/menu.css +329 -328
  104. data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -195
  105. data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -173
  106. data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -515
  107. data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -578
  108. data/solr/server/solr-webapp/webapp/css/styles/segments.css +145 -0
  109. data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -172
  110. data/solr/server/solr-webapp/webapp/img/chosen-sprite-2x.png +0 -0
  111. data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -27
  112. data/solr/server/solr-webapp/webapp/img/solr.svg +39 -39
  113. data/solr/server/solr-webapp/webapp/index.html +208 -0
  114. data/solr/server/solr-webapp/webapp/js/angular/app.js +713 -0
  115. data/solr/server/solr-webapp/webapp/js/angular/controllers/analysis.js +199 -0
  116. data/solr/server/solr-webapp/webapp/js/angular/controllers/cloud.js +528 -0
  117. data/solr/server/solr-webapp/webapp/js/angular/controllers/core-overview.js +225 -0
  118. data/solr/server/solr-webapp/webapp/js/angular/controllers/cores.js +465 -0
  119. data/solr/server/solr-webapp/webapp/js/angular/controllers/dataimport.js +284 -0
  120. data/solr/server/solr-webapp/webapp/js/angular/controllers/documents.js +139 -0
  121. data/solr/server/solr-webapp/webapp/js/angular/controllers/files.js +92 -0
  122. data/solr/server/solr-webapp/webapp/js/angular/controllers/index.js +95 -0
  123. data/solr/server/solr-webapp/webapp/js/angular/controllers/java-properties.js +45 -0
  124. data/solr/server/solr-webapp/webapp/js/angular/controllers/logging.js +146 -0
  125. data/solr/server/solr-webapp/webapp/js/angular/controllers/plugins.js +166 -0
  126. data/solr/server/solr-webapp/webapp/js/angular/controllers/query.js +99 -0
  127. data/solr/server/solr-webapp/webapp/js/angular/controllers/replication.js +227 -0
  128. data/solr/server/solr-webapp/webapp/js/angular/controllers/schema-browser.js +432 -0
  129. data/solr/server/solr-webapp/webapp/js/angular/controllers/segments.js +94 -0
  130. data/solr/server/solr-webapp/webapp/js/angular/controllers/threads.js +51 -0
  131. data/solr/server/solr-webapp/webapp/js/angular/services.js +214 -0
  132. data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -342
  133. data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -982
  134. data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -29
  135. data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -9373
  136. data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -31
  137. data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -30
  138. data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -184
  139. data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -523
  140. data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -71
  141. data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -806
  142. data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -3534
  143. data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -1863
  144. data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -189
  145. data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -48
  146. data/solr/server/solr-webapp/webapp/js/lib/naturalSort.js +82 -0
  147. data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -216
  148. data/solr/server/solr-webapp/webapp/js/main.js +60 -58
  149. data/solr/server/solr-webapp/webapp/js/require.js +11349 -11349
  150. data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -545
  151. data/solr/server/solr-webapp/webapp/js/scripts/app.js +680 -679
  152. data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -877
  153. data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -719
  154. data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -562
  155. data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -812
  156. data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -370
  157. data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -265
  158. data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -340
  159. data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -106
  160. data/solr/server/solr-webapp/webapp/js/scripts/logging.js +578 -576
  161. data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -72
  162. data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -462
  163. data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -229
  164. data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -527
  165. data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -1229
  166. data/solr/server/solr-webapp/webapp/js/scripts/segments.js +206 -0
  167. data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -158
  168. data/solr/server/solr-webapp/webapp/libs/angular-chosen.js +139 -0
  169. data/solr/server/solr-webapp/webapp/libs/angular-cookies.js +229 -0
  170. data/solr/server/solr-webapp/webapp/libs/angular-cookies.min.js +31 -0
  171. data/solr/server/solr-webapp/webapp/libs/angular-resource.min.js +36 -0
  172. data/solr/server/solr-webapp/webapp/libs/angular-route.js +1018 -0
  173. data/solr/server/solr-webapp/webapp/libs/angular-route.min.js +38 -0
  174. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.js +703 -0
  175. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.min.js +39 -0
  176. data/solr/server/solr-webapp/webapp/libs/angular.js +26093 -0
  177. data/solr/server/solr-webapp/webapp/libs/angular.min.js +273 -0
  178. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.js +1194 -0
  179. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.min.js +30 -0
  180. data/solr/server/solr-webapp/webapp/libs/d3.js +9373 -0
  181. data/solr/server/solr-webapp/webapp/libs/highlight.js +31 -0
  182. data/solr/server/solr-webapp/webapp/libs/jquery-2.1.3.min.js +29 -0
  183. data/solr/server/solr-webapp/webapp/libs/jquery.jstree.js +3534 -0
  184. data/solr/server/solr-webapp/webapp/libs/ngtimeago.js +102 -0
  185. data/solr/server/solr-webapp/webapp/partials/analysis.html +128 -0
  186. data/solr/server/solr-webapp/webapp/partials/cloud.html +104 -0
  187. data/solr/server/solr-webapp/webapp/partials/core_overview.html +227 -0
  188. data/solr/server/solr-webapp/webapp/partials/cores.html +231 -0
  189. data/solr/server/solr-webapp/webapp/partials/dataimport.html +209 -0
  190. data/solr/server/solr-webapp/webapp/partials/documents.html +118 -0
  191. data/solr/server/solr-webapp/webapp/partials/files.html +47 -0
  192. data/solr/server/solr-webapp/webapp/partials/index.html +261 -0
  193. data/solr/server/solr-webapp/webapp/partials/java-properties.html +27 -0
  194. data/solr/server/solr-webapp/webapp/partials/logging-levels.html +56 -0
  195. data/solr/server/solr-webapp/webapp/partials/logging.html +56 -0
  196. data/solr/server/solr-webapp/webapp/partials/plugins.html +72 -0
  197. data/solr/server/solr-webapp/webapp/partials/query.html +356 -0
  198. data/solr/server/solr-webapp/webapp/partials/replication.html +239 -0
  199. data/solr/server/solr-webapp/webapp/partials/schema-browser.html +206 -0
  200. data/solr/server/solr-webapp/webapp/partials/segments.html +99 -0
  201. data/solr/server/solr-webapp/webapp/partials/threads.html +65 -0
  202. data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -83
  203. data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -87
  204. data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -226
  205. data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -201
  206. data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -183
  207. data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -107
  208. data/solr/server/solr-webapp/webapp/tpl/files.html +44 -44
  209. data/solr/server/solr-webapp/webapp/tpl/index.html +250 -250
  210. data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -23
  211. data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -39
  212. data/solr/server/solr-webapp/webapp/tpl/query.html +361 -361
  213. data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -216
  214. data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -192
  215. data/solr/server/solr-webapp/webapp/tpl/segments.html +49 -0
  216. data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -56
  217. data/solr/server/solr/README.txt +77 -77
  218. data/solr/server/solr/solr.xml +51 -51
  219. data/solr/server/solr/zoo.cfg +17 -17
  220. data/solr/server/start.jar +0 -0
  221. data/spec/server_spec.rb +3 -8
  222. metadata +132 -43
  223. data/solr/server/lib/jetty-continuation-8.1.10.v20130312.jar +0 -0
  224. data/solr/server/lib/jetty-deploy-8.1.10.v20130312.jar +0 -0
  225. data/solr/server/lib/jetty-http-8.1.10.v20130312.jar +0 -0
  226. data/solr/server/lib/jetty-io-8.1.10.v20130312.jar +0 -0
  227. data/solr/server/lib/jetty-jmx-8.1.10.v20130312.jar +0 -0
  228. data/solr/server/lib/jetty-security-8.1.10.v20130312.jar +0 -0
  229. data/solr/server/lib/jetty-server-8.1.10.v20130312.jar +0 -0
  230. data/solr/server/lib/jetty-servlet-8.1.10.v20130312.jar +0 -0
  231. data/solr/server/lib/jetty-util-8.1.10.v20130312.jar +0 -0
  232. data/solr/server/lib/jetty-webapp-8.1.10.v20130312.jar +0 -0
  233. data/solr/server/lib/jetty-xml-8.1.10.v20130312.jar +0 -0
  234. data/solr/server/lib/servlet-api-3.0.jar +0 -0
  235. data/solr/server/solr-webapp/webapp/.gitignore +0 -1
  236. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.3.0.jar +0 -0
  237. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.3.0.jar +0 -0
  238. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.3.0.jar +0 -0
  239. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.3.1.jar +0 -0
  240. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.3.jar +0 -0
  241. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.3.1.jar +0 -0
  242. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.0.0.jar +0 -0
  243. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.0.0.jar +0 -0
  244. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.0.0.jar +0 -0
  245. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.0.0.jar +0 -0
  246. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.0.0.jar +0 -0
  247. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.0.0.jar +0 -0
  248. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.0.0.jar +0 -0
  249. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.0.0.jar +0 -0
  250. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.0.0.jar +0 -0
  251. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.0.0.jar +0 -0
  252. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.1.1.jar +0 -0
  253. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.1.1.jar +0 -0
  254. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.0.0.jar +0 -0
  255. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.0.0.jar +0 -0
  256. data/solr/server/webapps/solr.war +0 -0
@@ -1,523 +1,523 @@
1
- /*
2
-
3
- The MIT License (MIT)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
22
-
23
- */
24
-
25
- /*!
26
- * jQuery blockUI plugin
27
- * Version 2.39 (23-MAY-2011)
28
- * @requires jQuery v1.2.3 or later
29
- *
30
- * Examples at: http://malsup.com/jquery/block/
31
- * Copyright (c) 2007-2010 M. Alsup
32
- * Dual licensed under the MIT and GPL licenses:
33
- * http://www.opensource.org/licenses/mit-license.php
34
- * http://www.gnu.org/licenses/gpl.html
35
- *
36
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!
37
- */
38
-
39
- ;(function($) {
40
-
41
- if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
42
- alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery);
43
- return;
44
- }
45
-
46
- $.fn._fadeIn = $.fn.fadeIn;
47
-
48
- var noOp = function() {};
49
-
50
- // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
51
- // retarded userAgent strings on Vista)
52
- var mode = document.documentMode || 0;
53
- var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);
54
- var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;
55
-
56
- // global $ methods for blocking/unblocking the entire page
57
- $.blockUI = function(opts) { install(window, opts); };
58
- $.unblockUI = function(opts) { remove(window, opts); };
59
-
60
- // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
61
- $.growlUI = function(title, message, timeout, onClose) {
62
- var $m = $('<div class="growlUI"></div>');
63
- if (title) $m.append('<h1>'+title+'</h1>');
64
- if (message) $m.append('<h2>'+message+'</h2>');
65
- if (timeout == undefined) timeout = 3000;
66
- $.blockUI({
67
- message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
68
- timeout: timeout, showOverlay: false,
69
- onUnblock: onClose,
70
- css: $.blockUI.defaults.growlCSS
71
- });
72
- };
73
-
74
- // plugin method for blocking element content
75
- $.fn.block = function(opts) {
76
- return this.unblock({ fadeOut: 0 }).each(function() {
77
- if ($.css(this,'position') == 'static')
78
- this.style.position = 'relative';
79
- if ($.browser.msie)
80
- this.style.zoom = 1; // force 'hasLayout'
81
- install(this, opts);
82
- });
83
- };
84
-
85
- // plugin method for unblocking element content
86
- $.fn.unblock = function(opts) {
87
- return this.each(function() {
88
- remove(this, opts);
89
- });
90
- };
91
-
92
- $.blockUI.version = 2.39; // 2nd generation blocking at no extra cost!
93
-
94
- // override these in your code to change the default behavior and style
95
- $.blockUI.defaults = {
96
- // message displayed when blocking (use null for no message)
97
- message: '<h1>Please wait...</h1>',
98
-
99
- title: null, // title string; only used when theme == true
100
- draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
101
-
102
- theme: false, // set to true to use with jQuery UI themes
103
-
104
- // styles for the message when blocking; if you wish to disable
105
- // these and use an external stylesheet then do this in your code:
106
- // $.blockUI.defaults.css = {};
107
- css: {
108
- padding: 0,
109
- margin: 0,
110
- width: '30%',
111
- top: '40%',
112
- left: '35%',
113
- textAlign: 'center',
114
- color: '#000',
115
- border: '3px solid #aaa',
116
- backgroundColor:'#fff',
117
- cursor: 'wait'
118
- },
119
-
120
- // minimal style set used when themes are used
121
- themedCSS: {
122
- width: '30%',
123
- top: '40%',
124
- left: '35%'
125
- },
126
-
127
- // styles for the overlay
128
- overlayCSS: {
129
- backgroundColor: '#000',
130
- opacity: 0.6,
131
- cursor: 'wait'
132
- },
133
-
134
- // styles applied when using $.growlUI
135
- growlCSS: {
136
- width: '350px',
137
- top: '10px',
138
- left: '',
139
- right: '10px',
140
- border: 'none',
141
- padding: '5px',
142
- opacity: 0.6,
143
- cursor: 'default',
144
- color: '#fff',
145
- backgroundColor: '#000',
146
- '-webkit-border-radius': '10px',
147
- '-moz-border-radius': '10px',
148
- 'border-radius': '10px'
149
- },
150
-
151
- // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
152
- // (hat tip to Jorge H. N. de Vasconcelos)
153
- iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
154
-
155
- // force usage of iframe in non-IE browsers (handy for blocking applets)
156
- forceIframe: false,
157
-
158
- // z-index for the blocking overlay
159
- baseZ: 1000,
160
-
161
- // set these to true to have the message automatically centered
162
- centerX: true, // <-- only effects element blocking (page block controlled via css above)
163
- centerY: true,
164
-
165
- // allow body element to be stetched in ie6; this makes blocking look better
166
- // on "short" pages. disable if you wish to prevent changes to the body height
167
- allowBodyStretch: true,
168
-
169
- // enable if you want key and mouse events to be disabled for content that is blocked
170
- bindEvents: true,
171
-
172
- // be default blockUI will supress tab navigation from leaving blocking content
173
- // (if bindEvents is true)
174
- constrainTabKey: true,
175
-
176
- // fadeIn time in millis; set to 0 to disable fadeIn on block
177
- fadeIn: 200,
178
-
179
- // fadeOut time in millis; set to 0 to disable fadeOut on unblock
180
- fadeOut: 400,
181
-
182
- // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
183
- timeout: 0,
184
-
185
- // disable if you don't want to show the overlay
186
- showOverlay: true,
187
-
188
- // if true, focus will be placed in the first available input field when
189
- // page blocking
190
- focusInput: true,
191
-
192
- // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
193
- applyPlatformOpacityRules: true,
194
-
195
- // callback method invoked when fadeIn has completed and blocking message is visible
196
- onBlock: null,
197
-
198
- // callback method invoked when unblocking has completed; the callback is
199
- // passed the element that has been unblocked (which is the window object for page
200
- // blocks) and the options that were passed to the unblock call:
201
- // onUnblock(element, options)
202
- onUnblock: null,
203
-
204
- // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
205
- quirksmodeOffsetHack: 4,
206
-
207
- // class name of the message block
208
- blockMsgClass: 'blockMsg'
209
- };
210
-
211
- // private data and functions follow...
212
-
213
- var pageBlock = null;
214
- var pageBlockEls = [];
215
-
216
- function install(el, opts) {
217
- var full = (el == window);
218
- var msg = opts && opts.message !== undefined ? opts.message : undefined;
219
- opts = $.extend({}, $.blockUI.defaults, opts || {});
220
- opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
221
- var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
222
- var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
223
- msg = msg === undefined ? opts.message : msg;
224
-
225
- // remove the current block (if there is one)
226
- if (full && pageBlock)
227
- remove(window, {fadeOut:0});
228
-
229
- // if an existing element is being used as the blocking content then we capture
230
- // its current place in the DOM (and current display style) so we can restore
231
- // it when we unblock
232
- if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
233
- var node = msg.jquery ? msg[0] : msg;
234
- var data = {};
235
- $(el).data('blockUI.history', data);
236
- data.el = node;
237
- data.parent = node.parentNode;
238
- data.display = node.style.display;
239
- data.position = node.style.position;
240
- if (data.parent)
241
- data.parent.removeChild(node);
242
- }
243
-
244
- $(el).data('blockUI.onUnblock', opts.onUnblock);
245
- var z = opts.baseZ;
246
-
247
- // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
248
- // layer1 is the iframe layer which is used to supress bleed through of underlying content
249
- // layer2 is the overlay layer which has opacity and a wait cursor (by default)
250
- // layer3 is the message content that is displayed while blocking
251
-
252
- var lyr1 = ($.browser.msie || opts.forceIframe)
253
- ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')
254
- : $('<div class="blockUI" style="display:none"></div>');
255
-
256
- var lyr2 = opts.theme
257
- ? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>')
258
- : $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
259
-
260
- var lyr3, s;
261
- if (opts.theme && full) {
262
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">' +
263
- '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
264
- '<div class="ui-widget-content ui-dialog-content"></div>' +
265
- '</div>';
266
- }
267
- else if (opts.theme) {
268
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">' +
269
- '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
270
- '<div class="ui-widget-content ui-dialog-content"></div>' +
271
- '</div>';
272
- }
273
- else if (full) {
274
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
275
- }
276
- else {
277
- s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
278
- }
279
- lyr3 = $(s);
280
-
281
- // if we have a message, style it
282
- if (msg) {
283
- if (opts.theme) {
284
- lyr3.css(themedCSS);
285
- lyr3.addClass('ui-widget-content');
286
- }
287
- else
288
- lyr3.css(css);
289
- }
290
-
291
- // style the overlay
292
- if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))))
293
- lyr2.css(opts.overlayCSS);
294
- lyr2.css('position', full ? 'fixed' : 'absolute');
295
-
296
- // make iframe layer transparent in IE
297
- if ($.browser.msie || opts.forceIframe)
298
- lyr1.css('opacity',0.0);
299
-
300
- //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
301
- var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
302
- $.each(layers, function() {
303
- this.appendTo($par);
304
- });
305
-
306
- if (opts.theme && opts.draggable && $.fn.draggable) {
307
- lyr3.draggable({
308
- handle: '.ui-dialog-titlebar',
309
- cancel: 'li'
310
- });
311
- }
312
-
313
- // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
314
- var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
315
- if (ie6 || expr) {
316
- // give body 100% height
317
- if (full && opts.allowBodyStretch && $.boxModel)
318
- $('html,body').css('height','100%');
319
-
320
- // fix ie6 issue when blocked element has a border width
321
- if ((ie6 || !$.boxModel) && !full) {
322
- var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
323
- var fixT = t ? '(0 - '+t+')' : 0;
324
- var fixL = l ? '(0 - '+l+')' : 0;
325
- }
326
-
327
- // simulate fixed position
328
- $.each([lyr1,lyr2,lyr3], function(i,o) {
329
- var s = o[0].style;
330
- s.position = 'absolute';
331
- if (i < 2) {
332
- full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
333
- : s.setExpression('height','this.parentNode.offsetHeight + "px"');
334
- full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
335
- : s.setExpression('width','this.parentNode.offsetWidth + "px"');
336
- if (fixL) s.setExpression('left', fixL);
337
- if (fixT) s.setExpression('top', fixT);
338
- }
339
- else if (opts.centerY) {
340
- if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
341
- s.marginTop = 0;
342
- }
343
- else if (!opts.centerY && full) {
344
- var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;
345
- var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
346
- s.setExpression('top',expression);
347
- }
348
- });
349
- }
350
-
351
- // show the message
352
- if (msg) {
353
- if (opts.theme)
354
- lyr3.find('.ui-widget-content').append(msg);
355
- else
356
- lyr3.append(msg);
357
- if (msg.jquery || msg.nodeType)
358
- $(msg).show();
359
- }
360
-
361
- if (($.browser.msie || opts.forceIframe) && opts.showOverlay)
362
- lyr1.show(); // opacity is zero
363
- if (opts.fadeIn) {
364
- var cb = opts.onBlock ? opts.onBlock : noOp;
365
- var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
366
- var cb2 = msg ? cb : noOp;
367
- if (opts.showOverlay)
368
- lyr2._fadeIn(opts.fadeIn, cb1);
369
- if (msg)
370
- lyr3._fadeIn(opts.fadeIn, cb2);
371
- }
372
- else {
373
- if (opts.showOverlay)
374
- lyr2.show();
375
- if (msg)
376
- lyr3.show();
377
- if (opts.onBlock)
378
- opts.onBlock();
379
- }
380
-
381
- // bind key and mouse events
382
- bind(1, el, opts);
383
-
384
- if (full) {
385
- pageBlock = lyr3[0];
386
- pageBlockEls = $(':input:enabled:visible',pageBlock);
387
- if (opts.focusInput)
388
- setTimeout(focus, 20);
389
- }
390
- else
391
- center(lyr3[0], opts.centerX, opts.centerY);
392
-
393
- if (opts.timeout) {
394
- // auto-unblock
395
- var to = setTimeout(function() {
396
- full ? $.unblockUI(opts) : $(el).unblock(opts);
397
- }, opts.timeout);
398
- $(el).data('blockUI.timeout', to);
399
- }
400
- };
401
-
402
- // remove the block
403
- function remove(el, opts) {
404
- var full = (el == window);
405
- var $el = $(el);
406
- var data = $el.data('blockUI.history');
407
- var to = $el.data('blockUI.timeout');
408
- if (to) {
409
- clearTimeout(to);
410
- $el.removeData('blockUI.timeout');
411
- }
412
- opts = $.extend({}, $.blockUI.defaults, opts || {});
413
- bind(0, el, opts); // unbind events
414
-
415
- if (opts.onUnblock === null) {
416
- opts.onUnblock = $el.data('blockUI.onUnblock');
417
- $el.removeData('blockUI.onUnblock');
418
- }
419
-
420
- var els;
421
- if (full) // crazy selector to handle odd field errors in ie6/7
422
- els = $('body').children().filter('.blockUI').add('body > .blockUI');
423
- else
424
- els = $('.blockUI', el);
425
-
426
- if (full)
427
- pageBlock = pageBlockEls = null;
428
-
429
- if (opts.fadeOut) {
430
- els.fadeOut(opts.fadeOut);
431
- setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
432
- }
433
- else
434
- reset(els, data, opts, el);
435
- };
436
-
437
- // move blocking element back into the DOM where it started
438
- function reset(els,data,opts,el) {
439
- els.each(function(i,o) {
440
- // remove via DOM calls so we don't lose event handlers
441
- if (this.parentNode)
442
- this.parentNode.removeChild(this);
443
- });
444
-
445
- if (data && data.el) {
446
- data.el.style.display = data.display;
447
- data.el.style.position = data.position;
448
- if (data.parent)
449
- data.parent.appendChild(data.el);
450
- $(el).removeData('blockUI.history');
451
- }
452
-
453
- if (typeof opts.onUnblock == 'function')
454
- opts.onUnblock(el,opts);
455
- };
456
-
457
- // bind/unbind the handler
458
- function bind(b, el, opts) {
459
- var full = el == window, $el = $(el);
460
-
461
- // don't bother unbinding if there is nothing to unbind
462
- if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
463
- return;
464
- if (!full)
465
- $el.data('blockUI.isBlocked', b);
466
-
467
- // don't bind events when overlay is not in use or if bindEvents is false
468
- if (!opts.bindEvents || (b && !opts.showOverlay))
469
- return;
470
-
471
- // bind anchors and inputs for mouse and key events
472
- var events = 'mousedown mouseup keydown keypress';
473
- b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
474
-
475
- // former impl...
476
- // var $e = $('a,:input');
477
- // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
478
- };
479
-
480
- // event handler to suppress keyboard/mouse events when blocking
481
- function handler(e) {
482
- // allow tab navigation (conditionally)
483
- if (e.keyCode && e.keyCode == 9) {
484
- if (pageBlock && e.data.constrainTabKey) {
485
- var els = pageBlockEls;
486
- var fwd = !e.shiftKey && e.target === els[els.length-1];
487
- var back = e.shiftKey && e.target === els[0];
488
- if (fwd || back) {
489
- setTimeout(function(){focus(back)},10);
490
- return false;
491
- }
492
- }
493
- }
494
- var opts = e.data;
495
- // allow events within the message content
496
- if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0)
497
- return true;
498
-
499
- // allow events for content that is not being blocked
500
- return $(e.target).parents().children().filter('div.blockUI').length == 0;
501
- };
502
-
503
- function focus(back) {
504
- if (!pageBlockEls)
505
- return;
506
- var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
507
- if (e)
508
- e.focus();
509
- };
510
-
511
- function center(el, x, y) {
512
- var p = el.parentNode, s = el.style;
513
- var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
514
- var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
515
- if (x) s.left = l > 0 ? (l+'px') : '0';
516
- if (y) s.top = t > 0 ? (t+'px') : '0';
517
- };
518
-
519
- function sz(el, p) {
520
- return parseInt($.css(el,p))||0;
521
- };
522
-
523
- })(jQuery);
1
+ /*
2
+
3
+ The MIT License (MIT)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
23
+ */
24
+
25
+ /*!
26
+ * jQuery blockUI plugin
27
+ * Version 2.39 (23-MAY-2011)
28
+ * @requires jQuery v1.2.3 or later
29
+ *
30
+ * Examples at: http://malsup.com/jquery/block/
31
+ * Copyright (c) 2007-2010 M. Alsup
32
+ * Dual licensed under the MIT and GPL licenses:
33
+ * http://www.opensource.org/licenses/mit-license.php
34
+ * http://www.gnu.org/licenses/gpl.html
35
+ *
36
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!
37
+ */
38
+
39
+ ;(function($) {
40
+
41
+ if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
42
+ alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery);
43
+ return;
44
+ }
45
+
46
+ $.fn._fadeIn = $.fn.fadeIn;
47
+
48
+ var noOp = function() {};
49
+
50
+ // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
51
+ // retarded userAgent strings on Vista)
52
+ var mode = document.documentMode || 0;
53
+ var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);
54
+ var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;
55
+
56
+ // global $ methods for blocking/unblocking the entire page
57
+ $.blockUI = function(opts) { install(window, opts); };
58
+ $.unblockUI = function(opts) { remove(window, opts); };
59
+
60
+ // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
61
+ $.growlUI = function(title, message, timeout, onClose) {
62
+ var $m = $('<div class="growlUI"></div>');
63
+ if (title) $m.append('<h1>'+title+'</h1>');
64
+ if (message) $m.append('<h2>'+message+'</h2>');
65
+ if (timeout == undefined) timeout = 3000;
66
+ $.blockUI({
67
+ message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
68
+ timeout: timeout, showOverlay: false,
69
+ onUnblock: onClose,
70
+ css: $.blockUI.defaults.growlCSS
71
+ });
72
+ };
73
+
74
+ // plugin method for blocking element content
75
+ $.fn.block = function(opts) {
76
+ return this.unblock({ fadeOut: 0 }).each(function() {
77
+ if ($.css(this,'position') == 'static')
78
+ this.style.position = 'relative';
79
+ if ($.browser.msie)
80
+ this.style.zoom = 1; // force 'hasLayout'
81
+ install(this, opts);
82
+ });
83
+ };
84
+
85
+ // plugin method for unblocking element content
86
+ $.fn.unblock = function(opts) {
87
+ return this.each(function() {
88
+ remove(this, opts);
89
+ });
90
+ };
91
+
92
+ $.blockUI.version = 2.39; // 2nd generation blocking at no extra cost!
93
+
94
+ // override these in your code to change the default behavior and style
95
+ $.blockUI.defaults = {
96
+ // message displayed when blocking (use null for no message)
97
+ message: '<h1>Please wait...</h1>',
98
+
99
+ title: null, // title string; only used when theme == true
100
+ draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
101
+
102
+ theme: false, // set to true to use with jQuery UI themes
103
+
104
+ // styles for the message when blocking; if you wish to disable
105
+ // these and use an external stylesheet then do this in your code:
106
+ // $.blockUI.defaults.css = {};
107
+ css: {
108
+ padding: 0,
109
+ margin: 0,
110
+ width: '30%',
111
+ top: '40%',
112
+ left: '35%',
113
+ textAlign: 'center',
114
+ color: '#000',
115
+ border: '3px solid #aaa',
116
+ backgroundColor:'#fff',
117
+ cursor: 'wait'
118
+ },
119
+
120
+ // minimal style set used when themes are used
121
+ themedCSS: {
122
+ width: '30%',
123
+ top: '40%',
124
+ left: '35%'
125
+ },
126
+
127
+ // styles for the overlay
128
+ overlayCSS: {
129
+ backgroundColor: '#000',
130
+ opacity: 0.6,
131
+ cursor: 'wait'
132
+ },
133
+
134
+ // styles applied when using $.growlUI
135
+ growlCSS: {
136
+ width: '350px',
137
+ top: '10px',
138
+ left: '',
139
+ right: '10px',
140
+ border: 'none',
141
+ padding: '5px',
142
+ opacity: 0.6,
143
+ cursor: 'default',
144
+ color: '#fff',
145
+ backgroundColor: '#000',
146
+ '-webkit-border-radius': '10px',
147
+ '-moz-border-radius': '10px',
148
+ 'border-radius': '10px'
149
+ },
150
+
151
+ // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
152
+ // (hat tip to Jorge H. N. de Vasconcelos)
153
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
154
+
155
+ // force usage of iframe in non-IE browsers (handy for blocking applets)
156
+ forceIframe: false,
157
+
158
+ // z-index for the blocking overlay
159
+ baseZ: 1000,
160
+
161
+ // set these to true to have the message automatically centered
162
+ centerX: true, // <-- only effects element blocking (page block controlled via css above)
163
+ centerY: true,
164
+
165
+ // allow body element to be stetched in ie6; this makes blocking look better
166
+ // on "short" pages. disable if you wish to prevent changes to the body height
167
+ allowBodyStretch: true,
168
+
169
+ // enable if you want key and mouse events to be disabled for content that is blocked
170
+ bindEvents: true,
171
+
172
+ // be default blockUI will supress tab navigation from leaving blocking content
173
+ // (if bindEvents is true)
174
+ constrainTabKey: true,
175
+
176
+ // fadeIn time in millis; set to 0 to disable fadeIn on block
177
+ fadeIn: 200,
178
+
179
+ // fadeOut time in millis; set to 0 to disable fadeOut on unblock
180
+ fadeOut: 400,
181
+
182
+ // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
183
+ timeout: 0,
184
+
185
+ // disable if you don't want to show the overlay
186
+ showOverlay: true,
187
+
188
+ // if true, focus will be placed in the first available input field when
189
+ // page blocking
190
+ focusInput: true,
191
+
192
+ // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
193
+ applyPlatformOpacityRules: true,
194
+
195
+ // callback method invoked when fadeIn has completed and blocking message is visible
196
+ onBlock: null,
197
+
198
+ // callback method invoked when unblocking has completed; the callback is
199
+ // passed the element that has been unblocked (which is the window object for page
200
+ // blocks) and the options that were passed to the unblock call:
201
+ // onUnblock(element, options)
202
+ onUnblock: null,
203
+
204
+ // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
205
+ quirksmodeOffsetHack: 4,
206
+
207
+ // class name of the message block
208
+ blockMsgClass: 'blockMsg'
209
+ };
210
+
211
+ // private data and functions follow...
212
+
213
+ var pageBlock = null;
214
+ var pageBlockEls = [];
215
+
216
+ function install(el, opts) {
217
+ var full = (el == window);
218
+ var msg = opts && opts.message !== undefined ? opts.message : undefined;
219
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
220
+ opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
221
+ var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
222
+ var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
223
+ msg = msg === undefined ? opts.message : msg;
224
+
225
+ // remove the current block (if there is one)
226
+ if (full && pageBlock)
227
+ remove(window, {fadeOut:0});
228
+
229
+ // if an existing element is being used as the blocking content then we capture
230
+ // its current place in the DOM (and current display style) so we can restore
231
+ // it when we unblock
232
+ if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
233
+ var node = msg.jquery ? msg[0] : msg;
234
+ var data = {};
235
+ $(el).data('blockUI.history', data);
236
+ data.el = node;
237
+ data.parent = node.parentNode;
238
+ data.display = node.style.display;
239
+ data.position = node.style.position;
240
+ if (data.parent)
241
+ data.parent.removeChild(node);
242
+ }
243
+
244
+ $(el).data('blockUI.onUnblock', opts.onUnblock);
245
+ var z = opts.baseZ;
246
+
247
+ // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
248
+ // layer1 is the iframe layer which is used to supress bleed through of underlying content
249
+ // layer2 is the overlay layer which has opacity and a wait cursor (by default)
250
+ // layer3 is the message content that is displayed while blocking
251
+
252
+ var lyr1 = ($.browser.msie || opts.forceIframe)
253
+ ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')
254
+ : $('<div class="blockUI" style="display:none"></div>');
255
+
256
+ var lyr2 = opts.theme
257
+ ? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>')
258
+ : $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
259
+
260
+ var lyr3, s;
261
+ if (opts.theme && full) {
262
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">' +
263
+ '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
264
+ '<div class="ui-widget-content ui-dialog-content"></div>' +
265
+ '</div>';
266
+ }
267
+ else if (opts.theme) {
268
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">' +
269
+ '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>' +
270
+ '<div class="ui-widget-content ui-dialog-content"></div>' +
271
+ '</div>';
272
+ }
273
+ else if (full) {
274
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
275
+ }
276
+ else {
277
+ s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
278
+ }
279
+ lyr3 = $(s);
280
+
281
+ // if we have a message, style it
282
+ if (msg) {
283
+ if (opts.theme) {
284
+ lyr3.css(themedCSS);
285
+ lyr3.addClass('ui-widget-content');
286
+ }
287
+ else
288
+ lyr3.css(css);
289
+ }
290
+
291
+ // style the overlay
292
+ if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))))
293
+ lyr2.css(opts.overlayCSS);
294
+ lyr2.css('position', full ? 'fixed' : 'absolute');
295
+
296
+ // make iframe layer transparent in IE
297
+ if ($.browser.msie || opts.forceIframe)
298
+ lyr1.css('opacity',0.0);
299
+
300
+ //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
301
+ var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
302
+ $.each(layers, function() {
303
+ this.appendTo($par);
304
+ });
305
+
306
+ if (opts.theme && opts.draggable && $.fn.draggable) {
307
+ lyr3.draggable({
308
+ handle: '.ui-dialog-titlebar',
309
+ cancel: 'li'
310
+ });
311
+ }
312
+
313
+ // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
314
+ var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
315
+ if (ie6 || expr) {
316
+ // give body 100% height
317
+ if (full && opts.allowBodyStretch && $.boxModel)
318
+ $('html,body').css('height','100%');
319
+
320
+ // fix ie6 issue when blocked element has a border width
321
+ if ((ie6 || !$.boxModel) && !full) {
322
+ var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
323
+ var fixT = t ? '(0 - '+t+')' : 0;
324
+ var fixL = l ? '(0 - '+l+')' : 0;
325
+ }
326
+
327
+ // simulate fixed position
328
+ $.each([lyr1,lyr2,lyr3], function(i,o) {
329
+ var s = o[0].style;
330
+ s.position = 'absolute';
331
+ if (i < 2) {
332
+ full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
333
+ : s.setExpression('height','this.parentNode.offsetHeight + "px"');
334
+ full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
335
+ : s.setExpression('width','this.parentNode.offsetWidth + "px"');
336
+ if (fixL) s.setExpression('left', fixL);
337
+ if (fixT) s.setExpression('top', fixT);
338
+ }
339
+ else if (opts.centerY) {
340
+ if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
341
+ s.marginTop = 0;
342
+ }
343
+ else if (!opts.centerY && full) {
344
+ var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;
345
+ var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
346
+ s.setExpression('top',expression);
347
+ }
348
+ });
349
+ }
350
+
351
+ // show the message
352
+ if (msg) {
353
+ if (opts.theme)
354
+ lyr3.find('.ui-widget-content').append(msg);
355
+ else
356
+ lyr3.append(msg);
357
+ if (msg.jquery || msg.nodeType)
358
+ $(msg).show();
359
+ }
360
+
361
+ if (($.browser.msie || opts.forceIframe) && opts.showOverlay)
362
+ lyr1.show(); // opacity is zero
363
+ if (opts.fadeIn) {
364
+ var cb = opts.onBlock ? opts.onBlock : noOp;
365
+ var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
366
+ var cb2 = msg ? cb : noOp;
367
+ if (opts.showOverlay)
368
+ lyr2._fadeIn(opts.fadeIn, cb1);
369
+ if (msg)
370
+ lyr3._fadeIn(opts.fadeIn, cb2);
371
+ }
372
+ else {
373
+ if (opts.showOverlay)
374
+ lyr2.show();
375
+ if (msg)
376
+ lyr3.show();
377
+ if (opts.onBlock)
378
+ opts.onBlock();
379
+ }
380
+
381
+ // bind key and mouse events
382
+ bind(1, el, opts);
383
+
384
+ if (full) {
385
+ pageBlock = lyr3[0];
386
+ pageBlockEls = $(':input:enabled:visible',pageBlock);
387
+ if (opts.focusInput)
388
+ setTimeout(focus, 20);
389
+ }
390
+ else
391
+ center(lyr3[0], opts.centerX, opts.centerY);
392
+
393
+ if (opts.timeout) {
394
+ // auto-unblock
395
+ var to = setTimeout(function() {
396
+ full ? $.unblockUI(opts) : $(el).unblock(opts);
397
+ }, opts.timeout);
398
+ $(el).data('blockUI.timeout', to);
399
+ }
400
+ };
401
+
402
+ // remove the block
403
+ function remove(el, opts) {
404
+ var full = (el == window);
405
+ var $el = $(el);
406
+ var data = $el.data('blockUI.history');
407
+ var to = $el.data('blockUI.timeout');
408
+ if (to) {
409
+ clearTimeout(to);
410
+ $el.removeData('blockUI.timeout');
411
+ }
412
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
413
+ bind(0, el, opts); // unbind events
414
+
415
+ if (opts.onUnblock === null) {
416
+ opts.onUnblock = $el.data('blockUI.onUnblock');
417
+ $el.removeData('blockUI.onUnblock');
418
+ }
419
+
420
+ var els;
421
+ if (full) // crazy selector to handle odd field errors in ie6/7
422
+ els = $('body').children().filter('.blockUI').add('body > .blockUI');
423
+ else
424
+ els = $('.blockUI', el);
425
+
426
+ if (full)
427
+ pageBlock = pageBlockEls = null;
428
+
429
+ if (opts.fadeOut) {
430
+ els.fadeOut(opts.fadeOut);
431
+ setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
432
+ }
433
+ else
434
+ reset(els, data, opts, el);
435
+ };
436
+
437
+ // move blocking element back into the DOM where it started
438
+ function reset(els,data,opts,el) {
439
+ els.each(function(i,o) {
440
+ // remove via DOM calls so we don't lose event handlers
441
+ if (this.parentNode)
442
+ this.parentNode.removeChild(this);
443
+ });
444
+
445
+ if (data && data.el) {
446
+ data.el.style.display = data.display;
447
+ data.el.style.position = data.position;
448
+ if (data.parent)
449
+ data.parent.appendChild(data.el);
450
+ $(el).removeData('blockUI.history');
451
+ }
452
+
453
+ if (typeof opts.onUnblock == 'function')
454
+ opts.onUnblock(el,opts);
455
+ };
456
+
457
+ // bind/unbind the handler
458
+ function bind(b, el, opts) {
459
+ var full = el == window, $el = $(el);
460
+
461
+ // don't bother unbinding if there is nothing to unbind
462
+ if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
463
+ return;
464
+ if (!full)
465
+ $el.data('blockUI.isBlocked', b);
466
+
467
+ // don't bind events when overlay is not in use or if bindEvents is false
468
+ if (!opts.bindEvents || (b && !opts.showOverlay))
469
+ return;
470
+
471
+ // bind anchors and inputs for mouse and key events
472
+ var events = 'mousedown mouseup keydown keypress';
473
+ b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);
474
+
475
+ // former impl...
476
+ // var $e = $('a,:input');
477
+ // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
478
+ };
479
+
480
+ // event handler to suppress keyboard/mouse events when blocking
481
+ function handler(e) {
482
+ // allow tab navigation (conditionally)
483
+ if (e.keyCode && e.keyCode == 9) {
484
+ if (pageBlock && e.data.constrainTabKey) {
485
+ var els = pageBlockEls;
486
+ var fwd = !e.shiftKey && e.target === els[els.length-1];
487
+ var back = e.shiftKey && e.target === els[0];
488
+ if (fwd || back) {
489
+ setTimeout(function(){focus(back)},10);
490
+ return false;
491
+ }
492
+ }
493
+ }
494
+ var opts = e.data;
495
+ // allow events within the message content
496
+ if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0)
497
+ return true;
498
+
499
+ // allow events for content that is not being blocked
500
+ return $(e.target).parents().children().filter('div.blockUI').length == 0;
501
+ };
502
+
503
+ function focus(back) {
504
+ if (!pageBlockEls)
505
+ return;
506
+ var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
507
+ if (e)
508
+ e.focus();
509
+ };
510
+
511
+ function center(el, x, y) {
512
+ var p = el.parentNode, s = el.style;
513
+ var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
514
+ var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
515
+ if (x) s.left = l > 0 ? (l+'px') : '0';
516
+ if (y) s.top = t > 0 ? (t+'px') : '0';
517
+ };
518
+
519
+ function sz(el, p) {
520
+ return parseInt($.css(el,p))||0;
521
+ };
522
+
523
+ })(jQuery);