sunspot_solr 2.2.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (515) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +1 -1
  4. data/Rakefile +9 -0
  5. data/bin/sunspot-solr +2 -10
  6. data/lib/sunspot/solr/installer.rb +66 -8
  7. data/lib/sunspot/solr/java.rb +17 -4
  8. data/lib/sunspot/solr/server.rb +25 -37
  9. data/solr/.gitignore +2 -0
  10. data/solr/README.txt +181 -42
  11. data/solr/bin/init.d/solr +78 -0
  12. data/solr/bin/install_solr_service.sh +270 -0
  13. data/solr/bin/oom_solr.sh +30 -0
  14. data/solr/bin/post +228 -0
  15. data/solr/bin/solr +1350 -0
  16. data/solr/bin/solr.cmd +1230 -0
  17. data/solr/bin/solr.in.cmd +99 -0
  18. data/solr/bin/solr.in.sh +119 -0
  19. data/solr/server/README.txt +110 -0
  20. data/solr/server/contexts/solr-jetty-context.xml +8 -0
  21. data/solr/server/etc/jetty-http.xml +47 -0
  22. data/solr/{etc/jetty.xml → server/etc/jetty-https-ssl.xml} +175 -167
  23. data/solr/server/etc/jetty-https.xml +53 -0
  24. data/solr/server/etc/jetty-ssl.xml +46 -0
  25. data/solr/server/etc/jetty.xml +189 -0
  26. data/solr/{etc → server/etc}/webdefault.xml +527 -527
  27. data/solr/server/lib/ext/jcl-over-slf4j-1.7.7.jar +0 -0
  28. data/solr/server/lib/ext/jul-to-slf4j-1.7.7.jar +0 -0
  29. data/solr/server/lib/ext/log4j-1.2.17.jar +0 -0
  30. data/solr/server/lib/ext/slf4j-api-1.7.7.jar +0 -0
  31. data/solr/server/lib/ext/slf4j-log4j12-1.7.7.jar +0 -0
  32. data/solr/server/lib/javax.servlet-api-3.1.0.jar +0 -0
  33. data/solr/server/lib/jetty-continuation-9.2.11.v20150529.jar +0 -0
  34. data/solr/server/lib/jetty-deploy-9.2.11.v20150529.jar +0 -0
  35. data/solr/server/lib/jetty-http-9.2.11.v20150529.jar +0 -0
  36. data/solr/server/lib/jetty-io-9.2.11.v20150529.jar +0 -0
  37. data/solr/server/lib/jetty-jmx-9.2.11.v20150529.jar +0 -0
  38. data/solr/server/lib/jetty-rewrite-9.2.11.v20150529.jar +0 -0
  39. data/solr/server/lib/jetty-security-9.2.11.v20150529.jar +0 -0
  40. data/solr/server/lib/jetty-server-9.2.11.v20150529.jar +0 -0
  41. data/solr/server/lib/jetty-servlet-9.2.11.v20150529.jar +0 -0
  42. data/solr/server/lib/jetty-servlets-9.2.11.v20150529.jar +0 -0
  43. data/solr/server/lib/jetty-util-9.2.11.v20150529.jar +0 -0
  44. data/solr/server/lib/jetty-webapp-9.2.11.v20150529.jar +0 -0
  45. data/solr/server/lib/jetty-xml-9.2.11.v20150529.jar +0 -0
  46. data/solr/server/modules/http.mod +9 -0
  47. data/solr/server/modules/https.mod +9 -0
  48. data/solr/server/modules/server.mod +11 -0
  49. data/solr/server/modules/ssl.mod +9 -0
  50. data/solr/server/resources/jetty-logging.properties +1 -0
  51. data/solr/server/resources/log4j.properties +24 -0
  52. data/solr/server/solr-webapp/webapp/WEB-INF/lib/antlr-runtime-3.5.jar +0 -0
  53. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-4.1.jar +0 -0
  54. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-commons-4.1.jar +0 -0
  55. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-cli-1.2.jar +0 -0
  56. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-codec-1.10.jar +0 -0
  57. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-collections-3.2.1.jar +0 -0
  58. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-configuration-1.6.jar +0 -0
  59. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-exec-1.3.jar +0 -0
  60. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-fileupload-1.2.1.jar +0 -0
  61. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-io-2.4.jar +0 -0
  62. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-lang-2.6.jar +0 -0
  63. data/solr/server/solr-webapp/webapp/WEB-INF/lib/concurrentlinkedhashmap-lru-1.2.jar +0 -0
  64. data/solr/server/solr-webapp/webapp/WEB-INF/lib/dom4j-1.6.1.jar +0 -0
  65. data/solr/server/solr-webapp/webapp/WEB-INF/lib/guava-14.0.1.jar +0 -0
  66. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-annotations-2.6.0.jar +0 -0
  67. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.6.0.jar +0 -0
  68. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.6.0.jar +0 -0
  69. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.6.0.jar +0 -0
  70. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hppc-0.5.2.jar +0 -0
  71. data/solr/server/solr-webapp/webapp/WEB-INF/lib/htrace-core-3.0.4.jar +0 -0
  72. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.4.1.jar +0 -0
  73. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.4.1.jar +0 -0
  74. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.4.1.jar +0 -0
  75. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.5.4.jar +0 -0
  76. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.5.4.jar +0 -0
  77. data/solr/server/solr-webapp/webapp/WEB-INF/lib/joda-time-2.2.jar +0 -0
  78. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-common-5.3.1.jar +0 -0
  79. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-kuromoji-5.3.1.jar +0 -0
  80. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-phonetic-5.3.1.jar +0 -0
  81. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.3.1.jar +0 -0
  82. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.3.1.jar +0 -0
  83. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.3.1.jar +0 -0
  84. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-expressions-5.3.1.jar +0 -0
  85. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-grouping-5.3.1.jar +0 -0
  86. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.3.1.jar +0 -0
  87. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.3.1.jar +0 -0
  88. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.3.1.jar +0 -0
  89. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.3.1.jar +0 -0
  90. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.3.1.jar +0 -0
  91. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queryparser-5.3.1.jar +0 -0
  92. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-sandbox-5.3.1.jar +0 -0
  93. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.3.1.jar +0 -0
  94. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.3.1.jar +0 -0
  95. data/solr/server/solr-webapp/webapp/WEB-INF/lib/noggit-0.6.jar +0 -0
  96. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.3.0.jar +0 -0
  97. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar +0 -0
  98. data/solr/server/solr-webapp/webapp/WEB-INF/lib/protobuf-java-2.5.0.jar +0 -0
  99. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.3.1.jar +0 -0
  100. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.3.1.jar +0 -0
  101. data/solr/server/solr-webapp/webapp/WEB-INF/lib/spatial4j-0.4.1.jar +0 -0
  102. data/solr/server/solr-webapp/webapp/WEB-INF/lib/stax2-api-3.1.4.jar +0 -0
  103. data/solr/server/solr-webapp/webapp/WEB-INF/lib/t-digest-3.1.jar +0 -0
  104. data/solr/server/solr-webapp/webapp/WEB-INF/lib/woodstox-core-asl-4.4.1.jar +0 -0
  105. data/solr/server/solr-webapp/webapp/WEB-INF/lib/zookeeper-3.4.6.jar +0 -0
  106. data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +169 -0
  107. data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -0
  108. data/solr/server/solr-webapp/webapp/admin.html +164 -0
  109. data/solr/server/solr-webapp/webapp/css/angular/analysis.css +304 -0
  110. data/solr/server/solr-webapp/webapp/css/angular/chosen.css +465 -0
  111. data/solr/server/solr-webapp/webapp/css/angular/cloud.css +398 -0
  112. data/solr/server/solr-webapp/webapp/css/angular/common.css +724 -0
  113. data/solr/server/solr-webapp/webapp/css/angular/cores.css +233 -0
  114. data/solr/server/solr-webapp/webapp/css/angular/dataimport.css +370 -0
  115. data/solr/server/solr-webapp/webapp/css/angular/documents.css +179 -0
  116. data/solr/server/solr-webapp/webapp/css/angular/files.css +53 -0
  117. data/solr/server/solr-webapp/webapp/css/angular/index.css +206 -0
  118. data/solr/server/solr-webapp/webapp/css/angular/logging.css +376 -0
  119. data/solr/server/solr-webapp/webapp/css/angular/menu.css +321 -0
  120. data/solr/server/solr-webapp/webapp/css/angular/plugins.css +212 -0
  121. data/solr/server/solr-webapp/webapp/css/angular/query.css +162 -0
  122. data/solr/server/solr-webapp/webapp/css/angular/replication.css +500 -0
  123. data/solr/server/solr-webapp/webapp/css/angular/schema-browser.css +567 -0
  124. data/solr/server/solr-webapp/webapp/css/angular/segments.css +173 -0
  125. data/solr/server/solr-webapp/webapp/css/angular/threads.css +161 -0
  126. data/solr/server/solr-webapp/webapp/css/chosen.css +421 -0
  127. data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -0
  128. data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -0
  129. data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -0
  130. data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -0
  131. data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -0
  132. data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -0
  133. data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -0
  134. data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -0
  135. data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -0
  136. data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -0
  137. data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -0
  138. data/solr/server/solr-webapp/webapp/css/styles/menu.css +329 -0
  139. data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -0
  140. data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -0
  141. data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -0
  142. data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -0
  143. data/solr/server/solr-webapp/webapp/css/styles/segments.css +145 -0
  144. data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -0
  145. data/solr/server/solr-webapp/webapp/favicon.ico +0 -0
  146. data/solr/server/solr-webapp/webapp/img/ZeroClipboard.swf +0 -0
  147. data/solr/server/solr-webapp/webapp/img/chosen-sprite-2x.png +0 -0
  148. data/solr/server/solr-webapp/webapp/img/chosen-sprite.png +0 -0
  149. data/solr/server/solr-webapp/webapp/img/div.gif +0 -0
  150. data/solr/server/solr-webapp/webapp/img/favicon.ico +0 -0
  151. data/solr/server/solr-webapp/webapp/img/filetypes/7z.png +0 -0
  152. data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -0
  153. data/solr/server/solr-webapp/webapp/img/filetypes/ai.png +0 -0
  154. data/solr/server/solr-webapp/webapp/img/filetypes/aiff.png +0 -0
  155. data/solr/server/solr-webapp/webapp/img/filetypes/asc.png +0 -0
  156. data/solr/server/solr-webapp/webapp/img/filetypes/audio.png +0 -0
  157. data/solr/server/solr-webapp/webapp/img/filetypes/bin.png +0 -0
  158. data/solr/server/solr-webapp/webapp/img/filetypes/bz2.png +0 -0
  159. data/solr/server/solr-webapp/webapp/img/filetypes/c.png +0 -0
  160. data/solr/server/solr-webapp/webapp/img/filetypes/cfc.png +0 -0
  161. data/solr/server/solr-webapp/webapp/img/filetypes/cfm.png +0 -0
  162. data/solr/server/solr-webapp/webapp/img/filetypes/chm.png +0 -0
  163. data/solr/server/solr-webapp/webapp/img/filetypes/class.png +0 -0
  164. data/solr/server/solr-webapp/webapp/img/filetypes/conf.png +0 -0
  165. data/solr/server/solr-webapp/webapp/img/filetypes/cpp.png +0 -0
  166. data/solr/server/solr-webapp/webapp/img/filetypes/cs.png +0 -0
  167. data/solr/server/solr-webapp/webapp/img/filetypes/css.png +0 -0
  168. data/solr/server/solr-webapp/webapp/img/filetypes/csv.png +0 -0
  169. data/solr/server/solr-webapp/webapp/img/filetypes/deb.png +0 -0
  170. data/solr/server/solr-webapp/webapp/img/filetypes/divx.png +0 -0
  171. data/solr/server/solr-webapp/webapp/img/filetypes/doc.png +0 -0
  172. data/solr/server/solr-webapp/webapp/img/filetypes/dot.png +0 -0
  173. data/solr/server/solr-webapp/webapp/img/filetypes/eml.png +0 -0
  174. data/solr/server/solr-webapp/webapp/img/filetypes/enc.png +0 -0
  175. data/solr/server/solr-webapp/webapp/img/filetypes/file.png +0 -0
  176. data/solr/server/solr-webapp/webapp/img/filetypes/gif.png +0 -0
  177. data/solr/server/solr-webapp/webapp/img/filetypes/gz.png +0 -0
  178. data/solr/server/solr-webapp/webapp/img/filetypes/hlp.png +0 -0
  179. data/solr/server/solr-webapp/webapp/img/filetypes/htm.png +0 -0
  180. data/solr/server/solr-webapp/webapp/img/filetypes/html.png +0 -0
  181. data/solr/server/solr-webapp/webapp/img/filetypes/image.png +0 -0
  182. data/solr/server/solr-webapp/webapp/img/filetypes/iso.png +0 -0
  183. data/solr/server/solr-webapp/webapp/img/filetypes/jar.png +0 -0
  184. data/solr/server/solr-webapp/webapp/img/filetypes/java.png +0 -0
  185. data/solr/server/solr-webapp/webapp/img/filetypes/jpeg.png +0 -0
  186. data/solr/server/solr-webapp/webapp/img/filetypes/jpg.png +0 -0
  187. data/solr/server/solr-webapp/webapp/img/filetypes/js.png +0 -0
  188. data/solr/server/solr-webapp/webapp/img/filetypes/lua.png +0 -0
  189. data/solr/server/solr-webapp/webapp/img/filetypes/m.png +0 -0
  190. data/solr/server/solr-webapp/webapp/img/filetypes/mm.png +0 -0
  191. data/solr/server/solr-webapp/webapp/img/filetypes/mov.png +0 -0
  192. data/solr/server/solr-webapp/webapp/img/filetypes/mp3.png +0 -0
  193. data/solr/server/solr-webapp/webapp/img/filetypes/mpg.png +0 -0
  194. data/solr/server/solr-webapp/webapp/img/filetypes/odc.png +0 -0
  195. data/solr/server/solr-webapp/webapp/img/filetypes/odf.png +0 -0
  196. data/solr/server/solr-webapp/webapp/img/filetypes/odg.png +0 -0
  197. data/solr/server/solr-webapp/webapp/img/filetypes/odi.png +0 -0
  198. data/solr/server/solr-webapp/webapp/img/filetypes/odp.png +0 -0
  199. data/solr/server/solr-webapp/webapp/img/filetypes/ods.png +0 -0
  200. data/solr/server/solr-webapp/webapp/img/filetypes/odt.png +0 -0
  201. data/solr/server/solr-webapp/webapp/img/filetypes/ogg.png +0 -0
  202. data/solr/server/solr-webapp/webapp/img/filetypes/pdf.png +0 -0
  203. data/solr/server/solr-webapp/webapp/img/filetypes/pgp.png +0 -0
  204. data/solr/server/solr-webapp/webapp/img/filetypes/php.png +0 -0
  205. data/solr/server/solr-webapp/webapp/img/filetypes/pl.png +0 -0
  206. data/solr/server/solr-webapp/webapp/img/filetypes/png.png +0 -0
  207. data/solr/server/solr-webapp/webapp/img/filetypes/ppt.png +0 -0
  208. data/solr/server/solr-webapp/webapp/img/filetypes/ps.png +0 -0
  209. data/solr/server/solr-webapp/webapp/img/filetypes/py.png +0 -0
  210. data/solr/server/solr-webapp/webapp/img/filetypes/ram.png +0 -0
  211. data/solr/server/solr-webapp/webapp/img/filetypes/rar.png +0 -0
  212. data/solr/server/solr-webapp/webapp/img/filetypes/rb.png +0 -0
  213. data/solr/server/solr-webapp/webapp/img/filetypes/rm.png +0 -0
  214. data/solr/server/solr-webapp/webapp/img/filetypes/rpm.png +0 -0
  215. data/solr/server/solr-webapp/webapp/img/filetypes/rtf.png +0 -0
  216. data/solr/server/solr-webapp/webapp/img/filetypes/sig.png +0 -0
  217. data/solr/server/solr-webapp/webapp/img/filetypes/sql.png +0 -0
  218. data/solr/server/solr-webapp/webapp/img/filetypes/swf.png +0 -0
  219. data/solr/server/solr-webapp/webapp/img/filetypes/sxc.png +0 -0
  220. data/solr/server/solr-webapp/webapp/img/filetypes/sxd.png +0 -0
  221. data/solr/server/solr-webapp/webapp/img/filetypes/sxi.png +0 -0
  222. data/solr/server/solr-webapp/webapp/img/filetypes/sxw.png +0 -0
  223. data/solr/server/solr-webapp/webapp/img/filetypes/tar.png +0 -0
  224. data/solr/server/solr-webapp/webapp/img/filetypes/tex.png +0 -0
  225. data/solr/server/solr-webapp/webapp/img/filetypes/tgz.png +0 -0
  226. data/solr/server/solr-webapp/webapp/img/filetypes/txt.png +0 -0
  227. data/solr/server/solr-webapp/webapp/img/filetypes/vcf.png +0 -0
  228. data/solr/server/solr-webapp/webapp/img/filetypes/video.png +0 -0
  229. data/solr/server/solr-webapp/webapp/img/filetypes/vsd.png +0 -0
  230. data/solr/server/solr-webapp/webapp/img/filetypes/wav.png +0 -0
  231. data/solr/server/solr-webapp/webapp/img/filetypes/wma.png +0 -0
  232. data/solr/server/solr-webapp/webapp/img/filetypes/wmv.png +0 -0
  233. data/solr/server/solr-webapp/webapp/img/filetypes/xls.png +0 -0
  234. data/solr/server/solr-webapp/webapp/img/filetypes/xml.png +0 -0
  235. data/solr/server/solr-webapp/webapp/img/filetypes/xpi.png +0 -0
  236. data/solr/server/solr-webapp/webapp/img/filetypes/xvid.png +0 -0
  237. data/solr/server/solr-webapp/webapp/img/filetypes/zip.png +0 -0
  238. data/solr/server/solr-webapp/webapp/img/ico/arrow-000-small.png +0 -0
  239. data/solr/server/solr-webapp/webapp/img/ico/arrow-circle.png +0 -0
  240. data/solr/server/solr-webapp/webapp/img/ico/arrow-switch.png +0 -0
  241. data/solr/server/solr-webapp/webapp/img/ico/asterisk.png +0 -0
  242. data/solr/server/solr-webapp/webapp/img/ico/battery.png +0 -0
  243. data/solr/server/solr-webapp/webapp/img/ico/block-small.png +0 -0
  244. data/solr/server/solr-webapp/webapp/img/ico/block.png +0 -0
  245. data/solr/server/solr-webapp/webapp/img/ico/book-open-text.png +0 -0
  246. data/solr/server/solr-webapp/webapp/img/ico/box.png +0 -0
  247. data/solr/server/solr-webapp/webapp/img/ico/bug.png +0 -0
  248. data/solr/server/solr-webapp/webapp/img/ico/chart.png +0 -0
  249. data/solr/server/solr-webapp/webapp/img/ico/chevron-small-expand.png +0 -0
  250. data/solr/server/solr-webapp/webapp/img/ico/chevron-small.png +0 -0
  251. data/solr/server/solr-webapp/webapp/img/ico/clipboard-list.png +0 -0
  252. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste-document-text.png +0 -0
  253. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste.png +0 -0
  254. data/solr/server/solr-webapp/webapp/img/ico/clock-select-remain.png +0 -0
  255. data/solr/server/solr-webapp/webapp/img/ico/clock-select.png +0 -0
  256. data/solr/server/solr-webapp/webapp/img/ico/construction.png +0 -0
  257. data/solr/server/solr-webapp/webapp/img/ico/cross-0.png +0 -0
  258. data/solr/server/solr-webapp/webapp/img/ico/cross-1.png +0 -0
  259. data/solr/server/solr-webapp/webapp/img/ico/cross-button.png +0 -0
  260. data/solr/server/solr-webapp/webapp/img/ico/cross.png +0 -0
  261. data/solr/server/solr-webapp/webapp/img/ico/dashboard.png +0 -0
  262. data/solr/server/solr-webapp/webapp/img/ico/database--plus.png +0 -0
  263. data/solr/server/solr-webapp/webapp/img/ico/database.png +0 -0
  264. data/solr/server/solr-webapp/webapp/img/ico/databases.png +0 -0
  265. data/solr/server/solr-webapp/webapp/img/ico/disk-black.png +0 -0
  266. data/solr/server/solr-webapp/webapp/img/ico/document-convert.png +0 -0
  267. data/solr/server/solr-webapp/webapp/img/ico/document-import.png +0 -0
  268. data/solr/server/solr-webapp/webapp/img/ico/document-list.png +0 -0
  269. data/solr/server/solr-webapp/webapp/img/ico/document-text.png +0 -0
  270. data/solr/server/solr-webapp/webapp/img/ico/documents-stack.png +0 -0
  271. data/solr/server/solr-webapp/webapp/img/ico/download-cloud.png +0 -0
  272. data/solr/server/solr-webapp/webapp/img/ico/drive-upload.png +0 -0
  273. data/solr/server/solr-webapp/webapp/img/ico/exclamation-button.png +0 -0
  274. data/solr/server/solr-webapp/webapp/img/ico/eye.png +0 -0
  275. data/solr/server/solr-webapp/webapp/img/ico/folder-export.png +0 -0
  276. data/solr/server/solr-webapp/webapp/img/ico/folder-tree.png +0 -0
  277. data/solr/server/solr-webapp/webapp/img/ico/folder.png +0 -0
  278. data/solr/server/solr-webapp/webapp/img/ico/funnel-small.png +0 -0
  279. data/solr/server/solr-webapp/webapp/img/ico/funnel.png +0 -0
  280. data/solr/server/solr-webapp/webapp/img/ico/gear.png +0 -0
  281. data/solr/server/solr-webapp/webapp/img/ico/globe-network.png +0 -0
  282. data/solr/server/solr-webapp/webapp/img/ico/globe.png +0 -0
  283. data/solr/server/solr-webapp/webapp/img/ico/hammer-screwdriver.png +0 -0
  284. data/solr/server/solr-webapp/webapp/img/ico/hammer.png +0 -0
  285. data/solr/server/solr-webapp/webapp/img/ico/hand.png +0 -0
  286. data/solr/server/solr-webapp/webapp/img/ico/highlighter-text.png +0 -0
  287. data/solr/server/solr-webapp/webapp/img/ico/home.png +0 -0
  288. data/solr/server/solr-webapp/webapp/img/ico/hourglass--exclamation.png +0 -0
  289. data/solr/server/solr-webapp/webapp/img/ico/hourglass.png +0 -0
  290. data/solr/server/solr-webapp/webapp/img/ico/inbox-document-text.png +0 -0
  291. data/solr/server/solr-webapp/webapp/img/ico/information-button.png +0 -0
  292. data/solr/server/solr-webapp/webapp/img/ico/information-small.png +0 -0
  293. data/solr/server/solr-webapp/webapp/img/ico/information-white.png +0 -0
  294. data/solr/server/solr-webapp/webapp/img/ico/information.png +0 -0
  295. data/solr/server/solr-webapp/webapp/img/ico/jar.png +0 -0
  296. data/solr/server/solr-webapp/webapp/img/ico/magnifier.png +0 -0
  297. data/solr/server/solr-webapp/webapp/img/ico/mail.png +0 -0
  298. data/solr/server/solr-webapp/webapp/img/ico/memory.png +0 -0
  299. data/solr/server/solr-webapp/webapp/img/ico/minus-button.png +0 -0
  300. data/solr/server/solr-webapp/webapp/img/ico/molecule.png +0 -0
  301. data/solr/server/solr-webapp/webapp/img/ico/network-cloud.png +0 -0
  302. data/solr/server/solr-webapp/webapp/img/ico/network-status-away.png +0 -0
  303. data/solr/server/solr-webapp/webapp/img/ico/network-status-busy.png +0 -0
  304. data/solr/server/solr-webapp/webapp/img/ico/network-status-offline.png +0 -0
  305. data/solr/server/solr-webapp/webapp/img/ico/network-status.png +0 -0
  306. data/solr/server/solr-webapp/webapp/img/ico/network.png +0 -0
  307. data/solr/server/solr-webapp/webapp/img/ico/node-design.png +0 -0
  308. data/solr/server/solr-webapp/webapp/img/ico/node-master.png +0 -0
  309. data/solr/server/solr-webapp/webapp/img/ico/node-select.png +0 -0
  310. data/solr/server/solr-webapp/webapp/img/ico/node-slave.png +0 -0
  311. data/solr/server/solr-webapp/webapp/img/ico/node.png +0 -0
  312. data/solr/server/solr-webapp/webapp/img/ico/pencil-small.png +0 -0
  313. data/solr/server/solr-webapp/webapp/img/ico/pencil.png +0 -0
  314. data/solr/server/solr-webapp/webapp/img/ico/plus-button.png +0 -0
  315. data/solr/server/solr-webapp/webapp/img/ico/processor.png +0 -0
  316. data/solr/server/solr-webapp/webapp/img/ico/prohibition.png +0 -0
  317. data/solr/server/solr-webapp/webapp/img/ico/property.png +0 -0
  318. data/solr/server/solr-webapp/webapp/img/ico/question-small-white.png +0 -0
  319. data/solr/server/solr-webapp/webapp/img/ico/question-white.png +0 -0
  320. data/solr/server/solr-webapp/webapp/img/ico/question.png +0 -0
  321. data/solr/server/solr-webapp/webapp/img/ico/receipt-invoice.png +0 -0
  322. data/solr/server/solr-webapp/webapp/img/ico/receipt.png +0 -0
  323. data/solr/server/solr-webapp/webapp/img/ico/script-code.png +0 -0
  324. data/solr/server/solr-webapp/webapp/img/ico/server-cast.png +0 -0
  325. data/solr/server/solr-webapp/webapp/img/ico/server.png +0 -0
  326. data/solr/server/solr-webapp/webapp/img/ico/sitemap.png +0 -0
  327. data/solr/server/solr-webapp/webapp/img/ico/slash.png +0 -0
  328. data/solr/server/solr-webapp/webapp/img/ico/status-away.png +0 -0
  329. data/solr/server/solr-webapp/webapp/img/ico/status-busy.png +0 -0
  330. data/solr/server/solr-webapp/webapp/img/ico/status-offline.png +0 -0
  331. data/solr/server/solr-webapp/webapp/img/ico/status.png +0 -0
  332. data/solr/server/solr-webapp/webapp/img/ico/system-monitor--exclamation.png +0 -0
  333. data/solr/server/solr-webapp/webapp/img/ico/system-monitor.png +0 -0
  334. data/solr/server/solr-webapp/webapp/img/ico/table.png +0 -0
  335. data/solr/server/solr-webapp/webapp/img/ico/terminal.png +0 -0
  336. data/solr/server/solr-webapp/webapp/img/ico/tick-circle.png +0 -0
  337. data/solr/server/solr-webapp/webapp/img/ico/tick-red.png +0 -0
  338. data/solr/server/solr-webapp/webapp/img/ico/tick.png +0 -0
  339. data/solr/server/solr-webapp/webapp/img/ico/toggle-small-expand.png +0 -0
  340. data/solr/server/solr-webapp/webapp/img/ico/toggle-small.png +0 -0
  341. data/solr/server/solr-webapp/webapp/img/ico/toolbox.png +0 -0
  342. data/solr/server/solr-webapp/webapp/img/ico/ui-accordion.png +0 -0
  343. data/solr/server/solr-webapp/webapp/img/ico/ui-address-bar.png +0 -0
  344. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box-uncheck.png +0 -0
  345. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box.png +0 -0
  346. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
  347. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button.png +0 -0
  348. data/solr/server/solr-webapp/webapp/img/ico/ui-text-field-select.png +0 -0
  349. data/solr/server/solr-webapp/webapp/img/ico/users.png +0 -0
  350. data/solr/server/solr-webapp/webapp/img/ico/wooden-box.png +0 -0
  351. data/solr/server/solr-webapp/webapp/img/ico/zone.png +0 -0
  352. data/solr/server/solr-webapp/webapp/img/loader-light.gif +0 -0
  353. data/solr/server/solr-webapp/webapp/img/loader.gif +0 -0
  354. data/solr/server/solr-webapp/webapp/img/lucene-ico.png +0 -0
  355. data/solr/server/solr-webapp/webapp/img/solr-ico.png +0 -0
  356. data/solr/server/solr-webapp/webapp/img/solr.svg +39 -0
  357. data/solr/server/solr-webapp/webapp/img/tree.png +0 -0
  358. data/solr/server/solr-webapp/webapp/index.html +208 -0
  359. data/solr/server/solr-webapp/webapp/js/angular/app.js +713 -0
  360. data/solr/server/solr-webapp/webapp/js/angular/controllers/analysis.js +199 -0
  361. data/solr/server/solr-webapp/webapp/js/angular/controllers/cloud.js +528 -0
  362. data/solr/server/solr-webapp/webapp/js/angular/controllers/core-overview.js +225 -0
  363. data/solr/server/solr-webapp/webapp/js/angular/controllers/cores.js +465 -0
  364. data/solr/server/solr-webapp/webapp/js/angular/controllers/dataimport.js +284 -0
  365. data/solr/server/solr-webapp/webapp/js/angular/controllers/documents.js +139 -0
  366. data/solr/server/solr-webapp/webapp/js/angular/controllers/files.js +92 -0
  367. data/solr/server/solr-webapp/webapp/js/angular/controllers/index.js +95 -0
  368. data/solr/server/solr-webapp/webapp/js/angular/controllers/java-properties.js +45 -0
  369. data/solr/server/solr-webapp/webapp/js/angular/controllers/logging.js +146 -0
  370. data/solr/server/solr-webapp/webapp/js/angular/controllers/plugins.js +166 -0
  371. data/solr/server/solr-webapp/webapp/js/angular/controllers/query.js +99 -0
  372. data/solr/server/solr-webapp/webapp/js/angular/controllers/replication.js +227 -0
  373. data/solr/server/solr-webapp/webapp/js/angular/controllers/schema-browser.js +432 -0
  374. data/solr/server/solr-webapp/webapp/js/angular/controllers/segments.js +94 -0
  375. data/solr/server/solr-webapp/webapp/js/angular/controllers/threads.js +51 -0
  376. data/solr/server/solr-webapp/webapp/js/angular/services.js +214 -0
  377. data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -0
  378. data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -0
  379. data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -0
  380. data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -0
  381. data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -0
  382. data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -0
  383. data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -0
  384. data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -0
  385. data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -0
  386. data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -0
  387. data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -0
  388. data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -0
  389. data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -0
  390. data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -0
  391. data/solr/server/solr-webapp/webapp/js/lib/naturalSort.js +82 -0
  392. data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -0
  393. data/solr/server/solr-webapp/webapp/js/main.js +60 -0
  394. data/solr/server/solr-webapp/webapp/js/require.js +11349 -0
  395. data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -0
  396. data/solr/server/solr-webapp/webapp/js/scripts/app.js +680 -0
  397. data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -0
  398. data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -0
  399. data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -0
  400. data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -0
  401. data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -0
  402. data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -0
  403. data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -0
  404. data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -0
  405. data/solr/server/solr-webapp/webapp/js/scripts/logging.js +578 -0
  406. data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -0
  407. data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -0
  408. data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -0
  409. data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -0
  410. data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -0
  411. data/solr/server/solr-webapp/webapp/js/scripts/segments.js +206 -0
  412. data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -0
  413. data/solr/server/solr-webapp/webapp/libs/angular-chosen.js +139 -0
  414. data/solr/server/solr-webapp/webapp/libs/angular-cookies.js +229 -0
  415. data/solr/server/solr-webapp/webapp/libs/angular-cookies.min.js +31 -0
  416. data/solr/server/solr-webapp/webapp/libs/angular-resource.min.js +36 -0
  417. data/solr/server/solr-webapp/webapp/libs/angular-route.js +1018 -0
  418. data/solr/server/solr-webapp/webapp/libs/angular-route.min.js +38 -0
  419. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.js +703 -0
  420. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.min.js +39 -0
  421. data/solr/server/solr-webapp/webapp/libs/angular.js +26093 -0
  422. data/solr/server/solr-webapp/webapp/libs/angular.min.js +273 -0
  423. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.js +1194 -0
  424. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.min.js +30 -0
  425. data/solr/server/solr-webapp/webapp/libs/d3.js +9373 -0
  426. data/solr/server/solr-webapp/webapp/libs/highlight.js +31 -0
  427. data/solr/server/solr-webapp/webapp/libs/jquery-2.1.3.min.js +29 -0
  428. data/solr/server/solr-webapp/webapp/libs/jquery.jstree.js +3534 -0
  429. data/solr/server/solr-webapp/webapp/libs/ngtimeago.js +102 -0
  430. data/solr/server/solr-webapp/webapp/partials/analysis.html +128 -0
  431. data/solr/server/solr-webapp/webapp/partials/cloud.html +104 -0
  432. data/solr/server/solr-webapp/webapp/partials/core_overview.html +227 -0
  433. data/solr/server/solr-webapp/webapp/partials/cores.html +231 -0
  434. data/solr/server/solr-webapp/webapp/partials/dataimport.html +209 -0
  435. data/solr/server/solr-webapp/webapp/partials/documents.html +118 -0
  436. data/solr/server/solr-webapp/webapp/partials/files.html +47 -0
  437. data/solr/server/solr-webapp/webapp/partials/index.html +261 -0
  438. data/solr/server/solr-webapp/webapp/partials/java-properties.html +27 -0
  439. data/solr/server/solr-webapp/webapp/partials/logging-levels.html +56 -0
  440. data/solr/server/solr-webapp/webapp/partials/logging.html +56 -0
  441. data/solr/server/solr-webapp/webapp/partials/plugins.html +72 -0
  442. data/solr/server/solr-webapp/webapp/partials/query.html +356 -0
  443. data/solr/server/solr-webapp/webapp/partials/replication.html +239 -0
  444. data/solr/server/solr-webapp/webapp/partials/schema-browser.html +206 -0
  445. data/solr/server/solr-webapp/webapp/partials/segments.html +99 -0
  446. data/solr/server/solr-webapp/webapp/partials/threads.html +65 -0
  447. data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -0
  448. data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -0
  449. data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -0
  450. data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -0
  451. data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -0
  452. data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -0
  453. data/solr/server/solr-webapp/webapp/tpl/files.html +44 -0
  454. data/solr/server/solr-webapp/webapp/tpl/index.html +250 -0
  455. data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -0
  456. data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -0
  457. data/solr/server/solr-webapp/webapp/tpl/query.html +361 -0
  458. data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -0
  459. data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -0
  460. data/solr/server/solr-webapp/webapp/tpl/segments.html +49 -0
  461. data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -0
  462. data/solr/server/solr/README.txt +77 -0
  463. data/solr/server/solr/solr.xml +51 -0
  464. data/solr/server/solr/zoo.cfg +17 -0
  465. data/solr/server/start.jar +0 -0
  466. data/solr/solr/README.txt +77 -0
  467. data/solr/solr/configsets/sunspot/conf/_rest_managed.json +1 -0
  468. data/solr/solr/{conf → configsets/sunspot/conf}/admin-extra.html +0 -0
  469. data/solr/solr/configsets/sunspot/conf/currency.xml +67 -0
  470. data/solr/solr/{conf → configsets/sunspot/conf}/elevate.xml +0 -0
  471. data/solr/solr/{conf/stopwords.txt → configsets/sunspot/conf/lang/stopwords_en.txt} +1 -5
  472. data/solr/solr/{conf → configsets/sunspot/conf}/mapping-ISOLatin1Accent.txt +0 -0
  473. data/solr/solr/{conf → configsets/sunspot/conf}/protwords.txt +0 -0
  474. data/solr/solr/{conf → configsets/sunspot/conf}/schema.xml +38 -35
  475. data/solr/solr/{conf → configsets/sunspot/conf}/scripts.conf +0 -0
  476. data/solr/solr/{conf → configsets/sunspot/conf}/solrconfig.xml +271 -320
  477. data/solr/solr/{conf → configsets/sunspot/conf}/spellings.txt +0 -0
  478. data/solr/solr/{conf → configsets/sunspot/conf}/synonyms.txt +3 -5
  479. data/solr/solr/default/core.properties +3 -0
  480. data/solr/solr/development/core.properties +3 -0
  481. data/solr/solr/solr.xml +49 -6
  482. data/solr/solr/test/core.properties +3 -0
  483. data/solr/solr/zoo.cfg +17 -0
  484. data/spec/installer_spec.rb +82 -0
  485. data/spec/java_spec.rb +58 -0
  486. data/spec/server_spec.rb +36 -79
  487. data/spec/spec_helper.rb +4 -16
  488. data/sunspot_solr.gemspec +3 -7
  489. metadata +496 -67
  490. data/lib/sunspot/solr/installer/config_installer.rb +0 -53
  491. data/lib/sunspot/solr/installer/task_helper.rb +0 -13
  492. data/solr/contexts/solr.xml +0 -7
  493. data/solr/lib/jetty-continuation-8.1.8.v20121106.jar +0 -0
  494. data/solr/lib/jetty-deploy-8.1.8.v20121106.jar +0 -0
  495. data/solr/lib/jetty-http-8.1.8.v20121106.jar +0 -0
  496. data/solr/lib/jetty-io-8.1.8.v20121106.jar +0 -0
  497. data/solr/lib/jetty-jmx-8.1.8.v20121106.jar +0 -0
  498. data/solr/lib/jetty-security-8.1.8.v20121106.jar +0 -0
  499. data/solr/lib/jetty-server-8.1.8.v20121106.jar +0 -0
  500. data/solr/lib/jetty-servlet-8.1.8.v20121106.jar +0 -0
  501. data/solr/lib/jetty-util-8.1.8.v20121106.jar +0 -0
  502. data/solr/lib/jetty-webapp-8.1.8.v20121106.jar +0 -0
  503. data/solr/lib/jetty-xml-8.1.8.v20121106.jar +0 -0
  504. data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
  505. data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
  506. data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
  507. data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
  508. data/solr/lib/servlet-api-3.0.jar +0 -0
  509. data/solr/solr/conf/xslt/example.xsl +0 -132
  510. data/solr/solr/conf/xslt/example_atom.xsl +0 -67
  511. data/solr/solr/conf/xslt/example_rss.xsl +0 -66
  512. data/solr/solr/conf/xslt/luke.xsl +0 -337
  513. data/solr/solr/default/README.txt +0 -54
  514. data/solr/start.jar +0 -0
  515. data/solr/webapps/solr.war +0 -0
@@ -0,0 +1,229 @@
1
+ /**
2
+ The MIT License
3
+
4
+ Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+ */
24
+ /**
25
+ * @license AngularJS v1.3.8
26
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
27
+ * License: MIT
28
+ */
29
+ (function(window, angular, undefined) {'use strict';
30
+
31
+ /**
32
+ * @ngdoc module
33
+ * @name ngCookies
34
+ * @description
35
+ *
36
+ * # ngCookies
37
+ *
38
+ * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
39
+ *
40
+ *
41
+ * <div doc-module-components="ngCookies"></div>
42
+ *
43
+ * See {@link ngCookies.$cookies `$cookies`} and
44
+ * {@link ngCookies.$cookieStore `$cookieStore`} for usage.
45
+ */
46
+
47
+
48
+ angular.module('ngCookies', ['ng']).
49
+ /**
50
+ * @ngdoc service
51
+ * @name $cookies
52
+ *
53
+ * @description
54
+ * Provides read/write access to browser's cookies.
55
+ *
56
+ * Only a simple Object is exposed and by adding or removing properties to/from this object, new
57
+ * cookies are created/deleted at the end of current $eval.
58
+ * The object's properties can only be strings.
59
+ *
60
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
61
+ *
62
+ * @example
63
+ *
64
+ * ```js
65
+ * angular.module('cookiesExample', ['ngCookies'])
66
+ * .controller('ExampleController', ['$cookies', function($cookies) {
67
+ * // Retrieving a cookie
68
+ * var favoriteCookie = $cookies.myFavorite;
69
+ * // Setting a cookie
70
+ * $cookies.myFavorite = 'oatmeal';
71
+ * }]);
72
+ * ```
73
+ */
74
+ factory('$cookies', ['$rootScope', '$browser', function($rootScope, $browser) {
75
+ var cookies = {},
76
+ lastCookies = {},
77
+ lastBrowserCookies,
78
+ runEval = false,
79
+ copy = angular.copy,
80
+ isUndefined = angular.isUndefined;
81
+
82
+ //creates a poller fn that copies all cookies from the $browser to service & inits the service
83
+ $browser.addPollFn(function() {
84
+ var currentCookies = $browser.cookies();
85
+ if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
86
+ lastBrowserCookies = currentCookies;
87
+ copy(currentCookies, lastCookies);
88
+ copy(currentCookies, cookies);
89
+ if (runEval) $rootScope.$apply();
90
+ }
91
+ })();
92
+
93
+ runEval = true;
94
+
95
+ //at the end of each eval, push cookies
96
+ //TODO: this should happen before the "delayed" watches fire, because if some cookies are not
97
+ // strings or browser refuses to store some cookies, we update the model in the push fn.
98
+ $rootScope.$watch(push);
99
+
100
+ return cookies;
101
+
102
+
103
+ /**
104
+ * Pushes all the cookies from the service to the browser and verifies if all cookies were
105
+ * stored.
106
+ */
107
+ function push() {
108
+ var name,
109
+ value,
110
+ browserCookies,
111
+ updated;
112
+
113
+ //delete any cookies deleted in $cookies
114
+ for (name in lastCookies) {
115
+ if (isUndefined(cookies[name])) {
116
+ $browser.cookies(name, undefined);
117
+ }
118
+ }
119
+
120
+ //update all cookies updated in $cookies
121
+ for (name in cookies) {
122
+ value = cookies[name];
123
+ if (!angular.isString(value)) {
124
+ value = '' + value;
125
+ cookies[name] = value;
126
+ }
127
+ if (value !== lastCookies[name]) {
128
+ $browser.cookies(name, value);
129
+ updated = true;
130
+ }
131
+ }
132
+
133
+ //verify what was actually stored
134
+ if (updated) {
135
+ updated = false;
136
+ browserCookies = $browser.cookies();
137
+
138
+ for (name in cookies) {
139
+ if (cookies[name] !== browserCookies[name]) {
140
+ //delete or reset all cookies that the browser dropped from $cookies
141
+ if (isUndefined(browserCookies[name])) {
142
+ delete cookies[name];
143
+ } else {
144
+ cookies[name] = browserCookies[name];
145
+ }
146
+ updated = true;
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }]).
152
+
153
+
154
+ /**
155
+ * @ngdoc service
156
+ * @name $cookieStore
157
+ * @requires $cookies
158
+ *
159
+ * @description
160
+ * Provides a key-value (string-object) storage, that is backed by session cookies.
161
+ * Objects put or retrieved from this storage are automatically serialized or
162
+ * deserialized by angular's toJson/fromJson.
163
+ *
164
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
165
+ *
166
+ * @example
167
+ *
168
+ * ```js
169
+ * angular.module('cookieStoreExample', ['ngCookies'])
170
+ * .controller('ExampleController', ['$cookieStore', function($cookieStore) {
171
+ * // Put cookie
172
+ * $cookieStore.put('myFavorite','oatmeal');
173
+ * // Get cookie
174
+ * var favoriteCookie = $cookieStore.get('myFavorite');
175
+ * // Removing a cookie
176
+ * $cookieStore.remove('myFavorite');
177
+ * }]);
178
+ * ```
179
+ */
180
+ factory('$cookieStore', ['$cookies', function($cookies) {
181
+
182
+ return {
183
+ /**
184
+ * @ngdoc method
185
+ * @name $cookieStore#get
186
+ *
187
+ * @description
188
+ * Returns the value of given cookie key
189
+ *
190
+ * @param {string} key Id to use for lookup.
191
+ * @returns {Object} Deserialized cookie value.
192
+ */
193
+ get: function(key) {
194
+ var value = $cookies[key];
195
+ return value ? angular.fromJson(value) : value;
196
+ },
197
+
198
+ /**
199
+ * @ngdoc method
200
+ * @name $cookieStore#put
201
+ *
202
+ * @description
203
+ * Sets a value for given cookie key
204
+ *
205
+ * @param {string} key Id for the `value`.
206
+ * @param {Object} value Value to be stored.
207
+ */
208
+ put: function(key, value) {
209
+ $cookies[key] = angular.toJson(value);
210
+ },
211
+
212
+ /**
213
+ * @ngdoc method
214
+ * @name $cookieStore#remove
215
+ *
216
+ * @description
217
+ * Remove given cookie
218
+ *
219
+ * @param {string} key Id of the key-value pair to delete.
220
+ */
221
+ remove: function(key) {
222
+ delete $cookies[key];
223
+ }
224
+ };
225
+
226
+ }]);
227
+
228
+
229
+ })(window, window.angular);
@@ -0,0 +1,31 @@
1
+ /**
2
+ The MIT License
3
+
4
+ Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+ */
24
+ /*
25
+ AngularJS v1.3.8
26
+ (c) 2010-2014 Google, Inc. http://angularjs.org
27
+ License: MIT
28
+ */
29
+ (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore",
30
+ ["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular);
31
+ //# sourceMappingURL=angular-cookies.min.js.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ The MIT License
3
+
4
+ Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+ */
24
+ /*
25
+ AngularJS v1.3.8
26
+ (c) 2010-2014 Google, Inc. http://angularjs.org
27
+ License: MIT
28
+ */
29
+ (function(I,d,B){'use strict';function D(f,q){q=q||{};d.forEach(q,function(d,h){delete q[h]});for(var h in f)!f.hasOwnProperty(h)||"$"===h.charAt(0)&&"$"===h.charAt(1)||(q[h]=f[h]);return q}var w=d.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var f=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
30
+ this.$get=["$http","$q",function(q,h){function t(d,g){this.template=d;this.defaults=s({},f.defaults,g);this.urlParams={}}function v(x,g,l,m){function c(b,k){var c={};k=s({},g,k);r(k,function(a,k){u(a)&&(a=a());var d;if(a&&a.charAt&&"@"==a.charAt(0)){d=b;var e=a.substr(1);if(null==e||""===e||"hasOwnProperty"===e||!C.test("."+e))throw w("badmember",e);for(var e=e.split("."),n=0,g=e.length;n<g&&d!==B;n++){var h=e[n];d=null!==d?d[h]:B}}else d=a;c[k]=d});return c}function F(b){return b.resource}function e(b){D(b||
31
+ {},this)}var G=new t(x,m);l=s({},f.defaults.actions,l);e.prototype.toJSON=function(){var b=s({},this);delete b.$promise;delete b.$resolved;return b};r(l,function(b,k){var g=/^(POST|PUT|PATCH)$/i.test(b.method);e[k]=function(a,y,m,x){var n={},f,l,z;switch(arguments.length){case 4:z=x,l=m;case 3:case 2:if(u(y)){if(u(a)){l=a;z=y;break}l=y;z=m}else{n=a;f=y;l=m;break}case 1:u(a)?l=a:g?f=a:n=a;break;case 0:break;default:throw w("badargs",arguments.length);}var t=this instanceof e,p=t?f:b.isArray?[]:new e(f),
32
+ A={},v=b.interceptor&&b.interceptor.response||F,C=b.interceptor&&b.interceptor.responseError||B;r(b,function(b,a){"params"!=a&&"isArray"!=a&&"interceptor"!=a&&(A[a]=H(b))});g&&(A.data=f);G.setUrlParams(A,s({},c(f,b.params||{}),n),b.url);n=q(A).then(function(a){var c=a.data,g=p.$promise;if(c){if(d.isArray(c)!==!!b.isArray)throw w("badcfg",k,b.isArray?"array":"object",d.isArray(c)?"array":"object");b.isArray?(p.length=0,r(c,function(a){"object"===typeof a?p.push(new e(a)):p.push(a)})):(D(c,p),p.$promise=
33
+ g)}p.$resolved=!0;a.resource=p;return a},function(a){p.$resolved=!0;(z||E)(a);return h.reject(a)});n=n.then(function(a){var b=v(a);(l||E)(b,a.headers);return b},C);return t?n:(p.$promise=n,p.$resolved=!1,p)};e.prototype["$"+k]=function(a,b,c){u(a)&&(c=b,b=a,a={});a=e[k].call(this,a,this,b,c);return a.$promise||a}});e.bind=function(b){return v(x,s({},g,b),l)};return e}var E=d.noop,r=d.forEach,s=d.extend,H=d.copy,u=d.isFunction;t.prototype={setUrlParams:function(f,g,l){var m=this,c=l||m.template,h,
34
+ e,q=m.urlParams={};r(c.split(/\W/),function(b){if("hasOwnProperty"===b)throw w("badname");!/^\d+$/.test(b)&&b&&(new RegExp("(^|[^\\\\]):"+b+"(\\W|$)")).test(c)&&(q[b]=!0)});c=c.replace(/\\:/g,":");g=g||{};r(m.urlParams,function(b,k){h=g.hasOwnProperty(k)?g[k]:m.defaults[k];d.isDefined(h)&&null!==h?(e=encodeURIComponent(h).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+
35
+ k+"(\\W|$)","g"),function(b,a){return e+a})):c=c.replace(new RegExp("(/?):"+k+"(\\W|$)","g"),function(b,a,c){return"/"==c.charAt(0)?c:a+c})});m.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");f.url=c.replace(/\/\\\./,"/.");r(g,function(b,c){m.urlParams[c]||(f.params=f.params||{},f.params[c]=b)})}};return v}]})})(window,window.angular);
36
+ //# sourceMappingURL=angular-resource.min.js.map
@@ -0,0 +1,1018 @@
1
+ /**
2
+ The MIT License
3
+
4
+ Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+ */
24
+ /**
25
+ * @license AngularJS v1.3.8
26
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
27
+ * License: MIT
28
+ */
29
+ (function(window, angular, undefined) {'use strict';
30
+
31
+ /**
32
+ * @ngdoc module
33
+ * @name ngRoute
34
+ * @description
35
+ *
36
+ * # ngRoute
37
+ *
38
+ * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
39
+ *
40
+ * ## Example
41
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
42
+ *
43
+ *
44
+ * <div doc-module-components="ngRoute"></div>
45
+ */
46
+ /* global -ngRouteModule */
47
+ var ngRouteModule = angular.module('ngRoute', ['ng']).
48
+ provider('$route', $RouteProvider),
49
+ $routeMinErr = angular.$$minErr('ngRoute');
50
+
51
+ /**
52
+ * @ngdoc provider
53
+ * @name $routeProvider
54
+ *
55
+ * @description
56
+ *
57
+ * Used for configuring routes.
58
+ *
59
+ * ## Example
60
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
61
+ *
62
+ * ## Dependencies
63
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
64
+ */
65
+ function $RouteProvider() {
66
+ function inherit(parent, extra) {
67
+ return angular.extend(Object.create(parent), extra);
68
+ }
69
+
70
+ var routes = {};
71
+
72
+ /**
73
+ * @ngdoc method
74
+ * @name $routeProvider#when
75
+ *
76
+ * @param {string} path Route path (matched against `$location.path`). If `$location.path`
77
+ * contains redundant trailing slash or is missing one, the route will still match and the
78
+ * `$location.path` will be updated to add or drop the trailing slash to exactly match the
79
+ * route definition.
80
+ *
81
+ * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
82
+ * to the next slash are matched and stored in `$routeParams` under the given `name`
83
+ * when the route matches.
84
+ * * `path` can contain named groups starting with a colon and ending with a star:
85
+ * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
86
+ * when the route matches.
87
+ * * `path` can contain optional named groups with a question mark: e.g.`:name?`.
88
+ *
89
+ * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
90
+ * `/color/brown/largecode/code/with/slashes/edit` and extract:
91
+ *
92
+ * * `color: brown`
93
+ * * `largecode: code/with/slashes`.
94
+ *
95
+ *
96
+ * @param {Object} route Mapping information to be assigned to `$route.current` on route
97
+ * match.
98
+ *
99
+ * Object properties:
100
+ *
101
+ * - `controller` – `{(string|function()=}` – Controller fn that should be associated with
102
+ * newly created scope or the name of a {@link angular.Module#controller registered
103
+ * controller} if passed as a string.
104
+ * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be
105
+ * published to scope under the `controllerAs` name.
106
+ * - `template` – `{string=|function()=}` – html template as a string or a function that
107
+ * returns an html template as a string which should be used by {@link
108
+ * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
109
+ * This property takes precedence over `templateUrl`.
110
+ *
111
+ * If `template` is a function, it will be called with the following parameters:
112
+ *
113
+ * - `{Array.<Object>}` - route parameters extracted from the current
114
+ * `$location.path()` by applying the current route
115
+ *
116
+ * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
117
+ * template that should be used by {@link ngRoute.directive:ngView ngView}.
118
+ *
119
+ * If `templateUrl` is a function, it will be called with the following parameters:
120
+ *
121
+ * - `{Array.<Object>}` - route parameters extracted from the current
122
+ * `$location.path()` by applying the current route
123
+ *
124
+ * - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
125
+ * be injected into the controller. If any of these dependencies are promises, the router
126
+ * will wait for them all to be resolved or one to be rejected before the controller is
127
+ * instantiated.
128
+ * If all the promises are resolved successfully, the values of the resolved promises are
129
+ * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
130
+ * fired. If any of the promises are rejected the
131
+ * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
132
+ * is:
133
+ *
134
+ * - `key` – `{string}`: a name of a dependency to be injected into the controller.
135
+ * - `factory` - `{string|function}`: If `string` then it is an alias for a service.
136
+ * Otherwise if function, then it is {@link auto.$injector#invoke injected}
137
+ * and the return value is treated as the dependency. If the result is a promise, it is
138
+ * resolved before its value is injected into the controller. Be aware that
139
+ * `ngRoute.$routeParams` will still refer to the previous route within these resolve
140
+ * functions. Use `$route.current.params` to access the new route parameters, instead.
141
+ *
142
+ * - `redirectTo` – {(string|function())=} – value to update
143
+ * {@link ng.$location $location} path with and trigger route redirection.
144
+ *
145
+ * If `redirectTo` is a function, it will be called with the following parameters:
146
+ *
147
+ * - `{Object.<string>}` - route parameters extracted from the current
148
+ * `$location.path()` by applying the current route templateUrl.
149
+ * - `{string}` - current `$location.path()`
150
+ * - `{Object}` - current `$location.search()`
151
+ *
152
+ * The custom `redirectTo` function is expected to return a string which will be used
153
+ * to update `$location.path()` and `$location.search()`.
154
+ *
155
+ * - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
156
+ * or `$location.hash()` changes.
157
+ *
158
+ * If the option is set to `false` and url in the browser changes, then
159
+ * `$routeUpdate` event is broadcasted on the root scope.
160
+ *
161
+ * - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
162
+ *
163
+ * If the option is set to `true`, then the particular route can be matched without being
164
+ * case sensitive
165
+ *
166
+ * @returns {Object} self
167
+ *
168
+ * @description
169
+ * Adds a new route definition to the `$route` service.
170
+ */
171
+ this.when = function(path, route) {
172
+ //copy original route object to preserve params inherited from proto chain
173
+ var routeCopy = angular.copy(route);
174
+ if (angular.isUndefined(routeCopy.reloadOnSearch)) {
175
+ routeCopy.reloadOnSearch = true;
176
+ }
177
+ if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
178
+ routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
179
+ }
180
+ routes[path] = angular.extend(
181
+ routeCopy,
182
+ path && pathRegExp(path, routeCopy)
183
+ );
184
+
185
+ // create redirection for trailing slashes
186
+ if (path) {
187
+ var redirectPath = (path[path.length - 1] == '/')
188
+ ? path.substr(0, path.length - 1)
189
+ : path + '/';
190
+
191
+ routes[redirectPath] = angular.extend(
192
+ {redirectTo: path},
193
+ pathRegExp(redirectPath, routeCopy)
194
+ );
195
+ }
196
+
197
+ return this;
198
+ };
199
+
200
+ /**
201
+ * @ngdoc property
202
+ * @name $routeProvider#caseInsensitiveMatch
203
+ * @description
204
+ *
205
+ * A boolean property indicating if routes defined
206
+ * using this provider should be matched using a case insensitive
207
+ * algorithm. Defaults to `false`.
208
+ */
209
+ this.caseInsensitiveMatch = false;
210
+
211
+ /**
212
+ * @param path {string} path
213
+ * @param opts {Object} options
214
+ * @return {?Object}
215
+ *
216
+ * @description
217
+ * Normalizes the given path, returning a regular expression
218
+ * and the original path.
219
+ *
220
+ * Inspired by pathRexp in visionmedia/express/lib/utils.js.
221
+ */
222
+ function pathRegExp(path, opts) {
223
+ var insensitive = opts.caseInsensitiveMatch,
224
+ ret = {
225
+ originalPath: path,
226
+ regexp: path
227
+ },
228
+ keys = ret.keys = [];
229
+
230
+ path = path
231
+ .replace(/([().])/g, '\\$1')
232
+ .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
233
+ var optional = option === '?' ? option : null;
234
+ var star = option === '*' ? option : null;
235
+ keys.push({ name: key, optional: !!optional });
236
+ slash = slash || '';
237
+ return ''
238
+ + (optional ? '' : slash)
239
+ + '(?:'
240
+ + (optional ? slash : '')
241
+ + (star && '(.+?)' || '([^/]+)')
242
+ + (optional || '')
243
+ + ')'
244
+ + (optional || '');
245
+ })
246
+ .replace(/([\/$\*])/g, '\\$1');
247
+
248
+ ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
249
+ return ret;
250
+ }
251
+
252
+ /**
253
+ * @ngdoc method
254
+ * @name $routeProvider#otherwise
255
+ *
256
+ * @description
257
+ * Sets route definition that will be used on route change when no other route definition
258
+ * is matched.
259
+ *
260
+ * @param {Object|string} params Mapping information to be assigned to `$route.current`.
261
+ * If called with a string, the value maps to `redirectTo`.
262
+ * @returns {Object} self
263
+ */
264
+ this.otherwise = function(params) {
265
+ if (typeof params === 'string') {
266
+ params = {redirectTo: params};
267
+ }
268
+ this.when(null, params);
269
+ return this;
270
+ };
271
+
272
+
273
+ this.$get = ['$rootScope',
274
+ '$location',
275
+ '$routeParams',
276
+ '$q',
277
+ '$injector',
278
+ '$templateRequest',
279
+ '$sce',
280
+ function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
281
+
282
+ /**
283
+ * @ngdoc service
284
+ * @name $route
285
+ * @requires $location
286
+ * @requires $routeParams
287
+ *
288
+ * @property {Object} current Reference to the current route definition.
289
+ * The route definition contains:
290
+ *
291
+ * - `controller`: The controller constructor as define in route definition.
292
+ * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
293
+ * controller instantiation. The `locals` contain
294
+ * the resolved values of the `resolve` map. Additionally the `locals` also contain:
295
+ *
296
+ * - `$scope` - The current route scope.
297
+ * - `$template` - The current route template HTML.
298
+ *
299
+ * @property {Object} routes Object with all route configuration Objects as its properties.
300
+ *
301
+ * @description
302
+ * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
303
+ * It watches `$location.url()` and tries to map the path to an existing route definition.
304
+ *
305
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
306
+ *
307
+ * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
308
+ *
309
+ * The `$route` service is typically used in conjunction with the
310
+ * {@link ngRoute.directive:ngView `ngView`} directive and the
311
+ * {@link ngRoute.$routeParams `$routeParams`} service.
312
+ *
313
+ * @example
314
+ * This example shows how changing the URL hash causes the `$route` to match a route against the
315
+ * URL, and the `ngView` pulls in the partial.
316
+ *
317
+ * <example name="$route-service" module="ngRouteExample"
318
+ * deps="angular-route.js" fixBase="true">
319
+ * <file name="index.html">
320
+ * <div ng-controller="MainController">
321
+ * Choose:
322
+ * <a href="Book/Moby">Moby</a> |
323
+ * <a href="Book/Moby/ch/1">Moby: Ch1</a> |
324
+ * <a href="Book/Gatsby">Gatsby</a> |
325
+ * <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
326
+ * <a href="Book/Scarlet">Scarlet Letter</a><br/>
327
+ *
328
+ * <div ng-view></div>
329
+ *
330
+ * <hr />
331
+ *
332
+ * <pre>$location.path() = {{$location.path()}}</pre>
333
+ * <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
334
+ * <pre>$route.current.params = {{$route.current.params}}</pre>
335
+ * <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
336
+ * <pre>$routeParams = {{$routeParams}}</pre>
337
+ * </div>
338
+ * </file>
339
+ *
340
+ * <file name="book.html">
341
+ * controller: {{name}}<br />
342
+ * Book Id: {{params.bookId}}<br />
343
+ * </file>
344
+ *
345
+ * <file name="chapter.html">
346
+ * controller: {{name}}<br />
347
+ * Book Id: {{params.bookId}}<br />
348
+ * Chapter Id: {{params.chapterId}}
349
+ * </file>
350
+ *
351
+ * <file name="script.js">
352
+ * angular.module('ngRouteExample', ['ngRoute'])
353
+ *
354
+ * .controller('MainController', function($scope, $route, $routeParams, $location) {
355
+ * $scope.$route = $route;
356
+ * $scope.$location = $location;
357
+ * $scope.$routeParams = $routeParams;
358
+ * })
359
+ *
360
+ * .controller('BookController', function($scope, $routeParams) {
361
+ * $scope.name = "BookController";
362
+ * $scope.params = $routeParams;
363
+ * })
364
+ *
365
+ * .controller('ChapterController', function($scope, $routeParams) {
366
+ * $scope.name = "ChapterController";
367
+ * $scope.params = $routeParams;
368
+ * })
369
+ *
370
+ * .config(function($routeProvider, $locationProvider) {
371
+ * $routeProvider
372
+ * .when('/Book/:bookId', {
373
+ * templateUrl: 'book.html',
374
+ * controller: 'BookController',
375
+ * resolve: {
376
+ * // I will cause a 1 second delay
377
+ * delay: function($q, $timeout) {
378
+ * var delay = $q.defer();
379
+ * $timeout(delay.resolve, 1000);
380
+ * return delay.promise;
381
+ * }
382
+ * }
383
+ * })
384
+ * .when('/Book/:bookId/ch/:chapterId', {
385
+ * templateUrl: 'chapter.html',
386
+ * controller: 'ChapterController'
387
+ * });
388
+ *
389
+ * // configure html5 to get links working on jsfiddle
390
+ * $locationProvider.html5Mode(true);
391
+ * });
392
+ *
393
+ * </file>
394
+ *
395
+ * <file name="protractor.js" type="protractor">
396
+ * it('should load and compile correct template', function() {
397
+ * element(by.linkText('Moby: Ch1')).click();
398
+ * var content = element(by.css('[ng-view]')).getText();
399
+ * expect(content).toMatch(/controller\: ChapterController/);
400
+ * expect(content).toMatch(/Book Id\: Moby/);
401
+ * expect(content).toMatch(/Chapter Id\: 1/);
402
+ *
403
+ * element(by.partialLinkText('Scarlet')).click();
404
+ *
405
+ * content = element(by.css('[ng-view]')).getText();
406
+ * expect(content).toMatch(/controller\: BookController/);
407
+ * expect(content).toMatch(/Book Id\: Scarlet/);
408
+ * });
409
+ * </file>
410
+ * </example>
411
+ */
412
+
413
+ /**
414
+ * @ngdoc event
415
+ * @name $route#$routeChangeStart
416
+ * @eventType broadcast on root scope
417
+ * @description
418
+ * Broadcasted before a route change. At this point the route services starts
419
+ * resolving all of the dependencies needed for the route change to occur.
420
+ * Typically this involves fetching the view template as well as any dependencies
421
+ * defined in `resolve` route property. Once all of the dependencies are resolved
422
+ * `$routeChangeSuccess` is fired.
423
+ *
424
+ * The route change (and the `$location` change that triggered it) can be prevented
425
+ * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
426
+ * for more details about event object.
427
+ *
428
+ * @param {Object} angularEvent Synthetic event object.
429
+ * @param {Route} next Future route information.
430
+ * @param {Route} current Current route information.
431
+ */
432
+
433
+ /**
434
+ * @ngdoc event
435
+ * @name $route#$routeChangeSuccess
436
+ * @eventType broadcast on root scope
437
+ * @description
438
+ * Broadcasted after a route dependencies are resolved.
439
+ * {@link ngRoute.directive:ngView ngView} listens for the directive
440
+ * to instantiate the controller and render the view.
441
+ *
442
+ * @param {Object} angularEvent Synthetic event object.
443
+ * @param {Route} current Current route information.
444
+ * @param {Route|Undefined} previous Previous route information, or undefined if current is
445
+ * first route entered.
446
+ */
447
+
448
+ /**
449
+ * @ngdoc event
450
+ * @name $route#$routeChangeError
451
+ * @eventType broadcast on root scope
452
+ * @description
453
+ * Broadcasted if any of the resolve promises are rejected.
454
+ *
455
+ * @param {Object} angularEvent Synthetic event object
456
+ * @param {Route} current Current route information.
457
+ * @param {Route} previous Previous route information.
458
+ * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
459
+ */
460
+
461
+ /**
462
+ * @ngdoc event
463
+ * @name $route#$routeUpdate
464
+ * @eventType broadcast on root scope
465
+ * @description
466
+ *
467
+ * The `reloadOnSearch` property has been set to false, and we are reusing the same
468
+ * instance of the Controller.
469
+ */
470
+
471
+ var forceReload = false,
472
+ preparedRoute,
473
+ preparedRouteIsUpdateOnly,
474
+ $route = {
475
+ routes: routes,
476
+
477
+ /**
478
+ * @ngdoc method
479
+ * @name $route#reload
480
+ *
481
+ * @description
482
+ * Causes `$route` service to reload the current route even if
483
+ * {@link ng.$location $location} hasn't changed.
484
+ *
485
+ * As a result of that, {@link ngRoute.directive:ngView ngView}
486
+ * creates new scope and reinstantiates the controller.
487
+ */
488
+ reload: function() {
489
+ forceReload = true;
490
+ $rootScope.$evalAsync(function() {
491
+ // Don't support cancellation of a reload for now...
492
+ prepareRoute();
493
+ commitRoute();
494
+ });
495
+ },
496
+
497
+ /**
498
+ * @ngdoc method
499
+ * @name $route#updateParams
500
+ *
501
+ * @description
502
+ * Causes `$route` service to update the current URL, replacing
503
+ * current route parameters with those specified in `newParams`.
504
+ * Provided property names that match the route's path segment
505
+ * definitions will be interpolated into the location's path, while
506
+ * remaining properties will be treated as query params.
507
+ *
508
+ * @param {Object} newParams mapping of URL parameter names to values
509
+ */
510
+ updateParams: function(newParams) {
511
+ if (this.current && this.current.$$route) {
512
+ var searchParams = {}, self=this;
513
+
514
+ angular.forEach(Object.keys(newParams), function(key) {
515
+ if (!self.current.pathParams[key]) searchParams[key] = newParams[key];
516
+ });
517
+
518
+ newParams = angular.extend({}, this.current.params, newParams);
519
+ $location.path(interpolate(this.current.$$route.originalPath, newParams));
520
+ $location.search(angular.extend({}, $location.search(), searchParams));
521
+ }
522
+ else {
523
+ throw $routeMinErr('norout', 'Tried updating route when with no current route');
524
+ }
525
+ }
526
+ };
527
+
528
+ $rootScope.$on('$locationChangeStart', prepareRoute);
529
+ $rootScope.$on('$locationChangeSuccess', commitRoute);
530
+
531
+ return $route;
532
+
533
+ /////////////////////////////////////////////////////
534
+
535
+ /**
536
+ * @param on {string} current url
537
+ * @param route {Object} route regexp to match the url against
538
+ * @return {?Object}
539
+ *
540
+ * @description
541
+ * Check if the route matches the current url.
542
+ *
543
+ * Inspired by match in
544
+ * visionmedia/express/lib/router/router.js.
545
+ */
546
+ function switchRouteMatcher(on, route) {
547
+ var keys = route.keys,
548
+ params = {};
549
+
550
+ if (!route.regexp) return null;
551
+
552
+ var m = route.regexp.exec(on);
553
+ if (!m) return null;
554
+
555
+ for (var i = 1, len = m.length; i < len; ++i) {
556
+ var key = keys[i - 1];
557
+
558
+ var val = m[i];
559
+
560
+ if (key && val) {
561
+ params[key.name] = val;
562
+ }
563
+ }
564
+ return params;
565
+ }
566
+
567
+ function prepareRoute($locationEvent) {
568
+ var lastRoute = $route.current;
569
+
570
+ preparedRoute = parseRoute();
571
+ preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
572
+ && angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
573
+ && !preparedRoute.reloadOnSearch && !forceReload;
574
+
575
+ if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
576
+ if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
577
+ if ($locationEvent) {
578
+ $locationEvent.preventDefault();
579
+ }
580
+ }
581
+ }
582
+ }
583
+
584
+ function commitRoute() {
585
+ var lastRoute = $route.current;
586
+ var nextRoute = preparedRoute;
587
+
588
+ if (preparedRouteIsUpdateOnly) {
589
+ lastRoute.params = nextRoute.params;
590
+ angular.copy(lastRoute.params, $routeParams);
591
+ $rootScope.$broadcast('$routeUpdate', lastRoute);
592
+ } else if (nextRoute || lastRoute) {
593
+ forceReload = false;
594
+ $route.current = nextRoute;
595
+ if (nextRoute) {
596
+ if (nextRoute.redirectTo) {
597
+ if (angular.isString(nextRoute.redirectTo)) {
598
+ $location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
599
+ .replace();
600
+ } else {
601
+ $location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
602
+ .replace();
603
+ }
604
+ }
605
+ }
606
+
607
+ $q.when(nextRoute).
608
+ then(function() {
609
+ if (nextRoute) {
610
+ var locals = angular.extend({}, nextRoute.resolve),
611
+ template, templateUrl;
612
+
613
+ angular.forEach(locals, function(value, key) {
614
+ locals[key] = angular.isString(value) ?
615
+ $injector.get(value) : $injector.invoke(value, null, null, key);
616
+ });
617
+
618
+ if (angular.isDefined(template = nextRoute.template)) {
619
+ if (angular.isFunction(template)) {
620
+ template = template(nextRoute.params);
621
+ }
622
+ } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
623
+ if (angular.isFunction(templateUrl)) {
624
+ templateUrl = templateUrl(nextRoute.params);
625
+ }
626
+ templateUrl = $sce.getTrustedResourceUrl(templateUrl);
627
+ if (angular.isDefined(templateUrl)) {
628
+ nextRoute.loadedTemplateUrl = templateUrl;
629
+ template = $templateRequest(templateUrl);
630
+ }
631
+ }
632
+ if (angular.isDefined(template)) {
633
+ locals['$template'] = template;
634
+ }
635
+ return $q.all(locals);
636
+ }
637
+ }).
638
+ // after route change
639
+ then(function(locals) {
640
+ if (nextRoute == $route.current) {
641
+ if (nextRoute) {
642
+ nextRoute.locals = locals;
643
+ angular.copy(nextRoute.params, $routeParams);
644
+ }
645
+ $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
646
+ }
647
+ }, function(error) {
648
+ if (nextRoute == $route.current) {
649
+ $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
650
+ }
651
+ });
652
+ }
653
+ }
654
+
655
+
656
+ /**
657
+ * @returns {Object} the current active route, by matching it against the URL
658
+ */
659
+ function parseRoute() {
660
+ // Match a route
661
+ var params, match;
662
+ angular.forEach(routes, function(route, path) {
663
+ if (!match && (params = switchRouteMatcher($location.path(), route))) {
664
+ match = inherit(route, {
665
+ params: angular.extend({}, $location.search(), params),
666
+ pathParams: params});
667
+ match.$$route = route;
668
+ }
669
+ });
670
+ // No route matched; fallback to "otherwise" route
671
+ return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
672
+ }
673
+
674
+ /**
675
+ * @returns {string} interpolation of the redirect path with the parameters
676
+ */
677
+ function interpolate(string, params) {
678
+ var result = [];
679
+ angular.forEach((string || '').split(':'), function(segment, i) {
680
+ if (i === 0) {
681
+ result.push(segment);
682
+ } else {
683
+ var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
684
+ var key = segmentMatch[1];
685
+ result.push(params[key]);
686
+ result.push(segmentMatch[2] || '');
687
+ delete params[key];
688
+ }
689
+ });
690
+ return result.join('');
691
+ }
692
+ }];
693
+ }
694
+
695
+ ngRouteModule.provider('$routeParams', $RouteParamsProvider);
696
+
697
+
698
+ /**
699
+ * @ngdoc service
700
+ * @name $routeParams
701
+ * @requires $route
702
+ *
703
+ * @description
704
+ * The `$routeParams` service allows you to retrieve the current set of route parameters.
705
+ *
706
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
707
+ *
708
+ * The route parameters are a combination of {@link ng.$location `$location`}'s
709
+ * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
710
+ * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
711
+ *
712
+ * In case of parameter name collision, `path` params take precedence over `search` params.
713
+ *
714
+ * The service guarantees that the identity of the `$routeParams` object will remain unchanged
715
+ * (but its properties will likely change) even when a route change occurs.
716
+ *
717
+ * Note that the `$routeParams` are only updated *after* a route change completes successfully.
718
+ * This means that you cannot rely on `$routeParams` being correct in route resolve functions.
719
+ * Instead you can use `$route.current.params` to access the new route's parameters.
720
+ *
721
+ * @example
722
+ * ```js
723
+ * // Given:
724
+ * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
725
+ * // Route: /Chapter/:chapterId/Section/:sectionId
726
+ * //
727
+ * // Then
728
+ * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
729
+ * ```
730
+ */
731
+ function $RouteParamsProvider() {
732
+ this.$get = function() { return {}; };
733
+ }
734
+
735
+ ngRouteModule.directive('ngView', ngViewFactory);
736
+ ngRouteModule.directive('ngView', ngViewFillContentFactory);
737
+
738
+
739
+ /**
740
+ * @ngdoc directive
741
+ * @name ngView
742
+ * @restrict ECA
743
+ *
744
+ * @description
745
+ * # Overview
746
+ * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
747
+ * including the rendered template of the current route into the main layout (`index.html`) file.
748
+ * Every time the current route changes, the included view changes with it according to the
749
+ * configuration of the `$route` service.
750
+ *
751
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
752
+ *
753
+ * @animations
754
+ * enter - animation is used to bring new content into the browser.
755
+ * leave - animation is used to animate existing content away.
756
+ *
757
+ * The enter and leave animation occur concurrently.
758
+ *
759
+ * @scope
760
+ * @priority 400
761
+ * @param {string=} onload Expression to evaluate whenever the view updates.
762
+ *
763
+ * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
764
+ * $anchorScroll} to scroll the viewport after the view is updated.
765
+ *
766
+ * - If the attribute is not set, disable scrolling.
767
+ * - If the attribute is set without value, enable scrolling.
768
+ * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
769
+ * as an expression yields a truthy value.
770
+ * @example
771
+ <example name="ngView-directive" module="ngViewExample"
772
+ deps="angular-route.js;angular-animate.js"
773
+ animations="true" fixBase="true">
774
+ <file name="index.html">
775
+ <div ng-controller="MainCtrl as main">
776
+ Choose:
777
+ <a href="Book/Moby">Moby</a> |
778
+ <a href="Book/Moby/ch/1">Moby: Ch1</a> |
779
+ <a href="Book/Gatsby">Gatsby</a> |
780
+ <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
781
+ <a href="Book/Scarlet">Scarlet Letter</a><br/>
782
+
783
+ <div class="view-animate-container">
784
+ <div ng-view class="view-animate"></div>
785
+ </div>
786
+ <hr />
787
+
788
+ <pre>$location.path() = {{main.$location.path()}}</pre>
789
+ <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
790
+ <pre>$route.current.params = {{main.$route.current.params}}</pre>
791
+ <pre>$routeParams = {{main.$routeParams}}</pre>
792
+ </div>
793
+ </file>
794
+
795
+ <file name="book.html">
796
+ <div>
797
+ controller: {{book.name}}<br />
798
+ Book Id: {{book.params.bookId}}<br />
799
+ </div>
800
+ </file>
801
+
802
+ <file name="chapter.html">
803
+ <div>
804
+ controller: {{chapter.name}}<br />
805
+ Book Id: {{chapter.params.bookId}}<br />
806
+ Chapter Id: {{chapter.params.chapterId}}
807
+ </div>
808
+ </file>
809
+
810
+ <file name="animations.css">
811
+ .view-animate-container {
812
+ position:relative;
813
+ height:100px!important;
814
+ background:white;
815
+ border:1px solid black;
816
+ height:40px;
817
+ overflow:hidden;
818
+ }
819
+
820
+ .view-animate {
821
+ padding:10px;
822
+ }
823
+
824
+ .view-animate.ng-enter, .view-animate.ng-leave {
825
+ -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
826
+ transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
827
+
828
+ display:block;
829
+ width:100%;
830
+ border-left:1px solid black;
831
+
832
+ position:absolute;
833
+ top:0;
834
+ left:0;
835
+ right:0;
836
+ bottom:0;
837
+ padding:10px;
838
+ }
839
+
840
+ .view-animate.ng-enter {
841
+ left:100%;
842
+ }
843
+ .view-animate.ng-enter.ng-enter-active {
844
+ left:0;
845
+ }
846
+ .view-animate.ng-leave.ng-leave-active {
847
+ left:-100%;
848
+ }
849
+ </file>
850
+
851
+ <file name="script.js">
852
+ angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
853
+ .config(['$routeProvider', '$locationProvider',
854
+ function($routeProvider, $locationProvider) {
855
+ $routeProvider
856
+ .when('/Book/:bookId', {
857
+ templateUrl: 'book.html',
858
+ controller: 'BookCtrl',
859
+ controllerAs: 'book'
860
+ })
861
+ .when('/Book/:bookId/ch/:chapterId', {
862
+ templateUrl: 'chapter.html',
863
+ controller: 'ChapterCtrl',
864
+ controllerAs: 'chapter'
865
+ });
866
+
867
+ $locationProvider.html5Mode(true);
868
+ }])
869
+ .controller('MainCtrl', ['$route', '$routeParams', '$location',
870
+ function($route, $routeParams, $location) {
871
+ this.$route = $route;
872
+ this.$location = $location;
873
+ this.$routeParams = $routeParams;
874
+ }])
875
+ .controller('BookCtrl', ['$routeParams', function($routeParams) {
876
+ this.name = "BookCtrl";
877
+ this.params = $routeParams;
878
+ }])
879
+ .controller('ChapterCtrl', ['$routeParams', function($routeParams) {
880
+ this.name = "ChapterCtrl";
881
+ this.params = $routeParams;
882
+ }]);
883
+
884
+ </file>
885
+
886
+ <file name="protractor.js" type="protractor">
887
+ it('should load and compile correct template', function() {
888
+ element(by.linkText('Moby: Ch1')).click();
889
+ var content = element(by.css('[ng-view]')).getText();
890
+ expect(content).toMatch(/controller\: ChapterCtrl/);
891
+ expect(content).toMatch(/Book Id\: Moby/);
892
+ expect(content).toMatch(/Chapter Id\: 1/);
893
+
894
+ element(by.partialLinkText('Scarlet')).click();
895
+
896
+ content = element(by.css('[ng-view]')).getText();
897
+ expect(content).toMatch(/controller\: BookCtrl/);
898
+ expect(content).toMatch(/Book Id\: Scarlet/);
899
+ });
900
+ </file>
901
+ </example>
902
+ */
903
+
904
+
905
+ /**
906
+ * @ngdoc event
907
+ * @name ngView#$viewContentLoaded
908
+ * @eventType emit on the current ngView scope
909
+ * @description
910
+ * Emitted every time the ngView content is reloaded.
911
+ */
912
+ ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
913
+ function ngViewFactory($route, $anchorScroll, $animate) {
914
+ return {
915
+ restrict: 'ECA',
916
+ terminal: true,
917
+ priority: 400,
918
+ transclude: 'element',
919
+ link: function(scope, $element, attr, ctrl, $transclude) {
920
+ var currentScope,
921
+ currentElement,
922
+ previousLeaveAnimation,
923
+ autoScrollExp = attr.autoscroll,
924
+ onloadExp = attr.onload || '';
925
+
926
+ scope.$on('$routeChangeSuccess', update);
927
+ update();
928
+
929
+ function cleanupLastView() {
930
+ if (previousLeaveAnimation) {
931
+ $animate.cancel(previousLeaveAnimation);
932
+ previousLeaveAnimation = null;
933
+ }
934
+
935
+ if (currentScope) {
936
+ currentScope.$destroy();
937
+ currentScope = null;
938
+ }
939
+ if (currentElement) {
940
+ previousLeaveAnimation = $animate.leave(currentElement);
941
+ previousLeaveAnimation.then(function() {
942
+ previousLeaveAnimation = null;
943
+ });
944
+ currentElement = null;
945
+ }
946
+ }
947
+
948
+ function update() {
949
+ var locals = $route.current && $route.current.locals,
950
+ template = locals && locals.$template;
951
+
952
+ if (angular.isDefined(template)) {
953
+ var newScope = scope.$new();
954
+ var current = $route.current;
955
+
956
+ // Note: This will also link all children of ng-view that were contained in the original
957
+ // html. If that content contains controllers, ... they could pollute/change the scope.
958
+ // However, using ng-view on an element with additional content does not make sense...
959
+ // Note: We can't remove them in the cloneAttchFn of $transclude as that
960
+ // function is called before linking the content, which would apply child
961
+ // directives to non existing elements.
962
+ var clone = $transclude(newScope, function(clone) {
963
+ $animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
964
+ if (angular.isDefined(autoScrollExp)
965
+ && (!autoScrollExp || scope.$eval(autoScrollExp))) {
966
+ $anchorScroll();
967
+ }
968
+ });
969
+ cleanupLastView();
970
+ });
971
+
972
+ currentElement = clone;
973
+ currentScope = current.scope = newScope;
974
+ currentScope.$emit('$viewContentLoaded');
975
+ currentScope.$eval(onloadExp);
976
+ } else {
977
+ cleanupLastView();
978
+ }
979
+ }
980
+ }
981
+ };
982
+ }
983
+
984
+ // This directive is called during the $transclude call of the first `ngView` directive.
985
+ // It will replace and compile the content of the element with the loaded template.
986
+ // We need this directive so that the element content is already filled when
987
+ // the link function of another directive on the same element as ngView
988
+ // is called.
989
+ ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
990
+ function ngViewFillContentFactory($compile, $controller, $route) {
991
+ return {
992
+ restrict: 'ECA',
993
+ priority: -400,
994
+ link: function(scope, $element) {
995
+ var current = $route.current,
996
+ locals = current.locals;
997
+
998
+ $element.html(locals.$template);
999
+
1000
+ var link = $compile($element.contents());
1001
+
1002
+ if (current.controller) {
1003
+ locals.$scope = scope;
1004
+ var controller = $controller(current.controller, locals);
1005
+ if (current.controllerAs) {
1006
+ scope[current.controllerAs] = controller;
1007
+ }
1008
+ $element.data('$ngControllerController', controller);
1009
+ $element.children().data('$ngControllerController', controller);
1010
+ }
1011
+
1012
+ link(scope);
1013
+ }
1014
+ };
1015
+ }
1016
+
1017
+
1018
+ })(window, window.angular);