RubyApp 0.6.67 → 0.6.68

Sign up to get free protection for your applications and to get access to all the features.
Files changed (460) hide show
  1. data/lib/ruby_app/application.rb +1 -1
  2. data/lib/ruby_app/elements/mobile/document.js.haml +0 -1
  3. data/lib/ruby_app/elements/mobile/document.rb +2 -4
  4. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0 → jquery.mobile-1.3.0}/demos/css/themes/default/images/ajax-loader.gif +0 -0
  5. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/images/icons-18-black.png +0 -0
  6. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/images/icons-18-white.png +0 -0
  7. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/images/icons-36-black.png +0 -0
  8. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/images/icons-36-white.png +0 -0
  9. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile-1.3.0.css +3357 -0
  10. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile-1.3.0.min.css +2 -0
  11. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile.structure-1.3.0.css +2197 -0
  12. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile.structure-1.3.0.min.css +2 -0
  13. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/jquery.mobile.theme-1.1.0.css → jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile.theme-1.3.0.css} +367 -367
  14. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/css/themes/default/jquery.mobile.theme-1.3.0.min.css +2 -0
  15. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/css/jqm-demos.css +1032 -0
  16. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/css/jqm_demo-icons-hd.png +0 -0
  17. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/css/jqm_demo-icons-sd.png +0 -0
  18. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-af.jpg +0 -0
  19. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-ag.jpg +0 -0
  20. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/album-bb.jpg +0 -0
  21. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-bk.jpg +0 -0
  22. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-hc.jpg +0 -0
  23. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-k.jpg +0 -0
  24. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-mg.jpg +0 -0
  25. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-ok.jpg +0 -0
  26. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-p.jpg +0 -0
  27. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-rh.jpg +0 -0
  28. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-ws.jpg +0 -0
  29. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/album-xx.jpg +0 -0
  30. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/apple.png +0 -0
  31. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/bg-pattern.png +0 -0
  32. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/bike.jpg +0 -0
  33. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/blackberry_10.png +0 -0
  34. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/bmw-thumb.jpg +0 -0
  35. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/bmw.jpg +0 -0
  36. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/buenosaires.jpg +0 -0
  37. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/capetown.jpg +0 -0
  38. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/de.png +0 -0
  39. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/fi.png +0 -0
  40. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/firefox-logo.png +0 -0
  41. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/firefox_os.png +0 -0
  42. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/galaxy_express.png +0 -0
  43. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/gb.png +0 -0
  44. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/gf.png +0 -0
  45. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/09-chat2.png +0 -0
  46. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/100-coffee.png +0 -0
  47. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/18-envelope.png +0 -0
  48. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/19-gear.png +0 -0
  49. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/21-skull.png +0 -0
  50. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/30-key.png +0 -0
  51. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/34-coffee.png +0 -0
  52. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars → jquery.mobile-1.3.0/demos/docs/_assets/img}/glyphish-icons/88-beermug.png +0 -0
  53. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/glyphish-icons/Read me first - license.txt b/data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/glyphish-icons/Read me first - → license.txt +0 -0
  54. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/jquery-logo.png +0 -0
  55. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/landrover-thumb.jpg +0 -0
  56. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/landrover.jpg +0 -0
  57. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/lumia_800.png +0 -0
  58. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/newyork.jpg +0 -0
  59. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/nexus_7.png +0 -0
  60. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/paris.jpg +0 -0
  61. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/phone_galaxy3.png +0 -0
  62. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/phone_iphone5.png +0 -0
  63. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/phone_lumia920.png +0 -0
  64. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/phone_onex.png +0 -0
  65. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/photo-landscape.jpg +0 -0
  66. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/photo-portrait.jpg +0 -0
  67. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/photo-run.jpeg +0 -0
  68. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/seoul.jpg +0 -0
  69. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/sydney.jpg +0 -0
  70. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/tesla-thumb.jpg +0 -0
  71. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/tesla.jpg +0 -0
  72. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/img/tizen.png +0 -0
  73. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/lists/images → jquery.mobile-1.3.0/demos/docs/_assets/img}/us.png +0 -0
  74. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/globalnav.js +35 -0
  75. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/h2widget.js +169 -0
  76. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/index.html +10 -0
  77. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/jqm-demos.js +336 -0
  78. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/jquery.mobile.demos.js +1076 -0
  79. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/_assets/js/view-source.js +533 -0
  80. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/backbone-require.html +83 -0
  81. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/index.html +445 -0
  82. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/collections/CategoriesCollection.js +98 -0
  83. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/libs/backbone.js +1431 -0
  84. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/js → jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/libs}/jquery.js +3932 -3731
  85. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/libs/jquerymobile.js +10945 -0
  86. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/libs/lodash.js +4215 -0
  87. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/libs/require.js +1981 -0
  88. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/mobile.js +45 -0
  89. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/models/CategoryModel.js +15 -0
  90. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/routers/mobileRouter.js +83 -0
  91. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/backbone-require/js/views/CategoryView.js +37 -0
  92. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/collapsibles/dynamic-collapsible.html +363 -0
  93. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/controlgroups/dynamic-controlgroup.html +428 -0
  94. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/index.html +388 -0
  95. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/autodividers-linkbar-demo.html +158 -0
  96. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/autodividers-linkbar.css +20 -0
  97. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/autodividers-linkbar.html +692 -0
  98. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/autodividers-linkbar.js +58 -0
  99. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/autodividers-selector.html +368 -0
  100. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/grid-listview-demo.html +84 -0
  101. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/grid-listview.css +180 -0
  102. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/listviews/grid-listview.html +411 -0
  103. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/panels/panel-styling.html +551 -0
  104. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/panels/panel-swipe-open.html +413 -0
  105. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/popups/arrow.html +363 -0
  106. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/popups/dynamic-popup.html +407 -0
  107. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/popups/jquery.mobile.popup.arrow.css +233 -0
  108. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/popups/popup.arrow.js +276 -0
  109. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/redirect/index.html +375 -0
  110. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/redirect/redirect-target.html +27 -0
  111. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/redirect/redirect.php +19 -0
  112. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/redirect/source.php +4 -0
  113. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/slider/slider.tooltip.css +15 -0
  114. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/slider/slider.tooltip.js +111 -0
  115. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/slider/tooltip.html +339 -0
  116. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/buenosaires.html +46 -0
  117. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/capetown.html +46 -0
  118. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/newyork.html +46 -0
  119. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/paris.html +46 -0
  120. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/seoul.html +46 -0
  121. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/swipe-list.html +805 -0
  122. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/swipe-page.css +39 -0
  123. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/swipe-page.html +368 -0
  124. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/swipe-page.js +37 -0
  125. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/swipe/sydney.html +46 -0
  126. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/tables/financial-grouped-columns.html +506 -0
  127. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/tables/financial-grouped-reflow.html +503 -0
  128. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/tables/movie-list-toggle-options.html +422 -0
  129. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/tables/movie-list.html +529 -0
  130. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/examples/tables/phone-compare.html +477 -0
  131. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/controls-in-header-footer.html +335 -0
  132. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/disabling-a-button-does-not-work.html +335 -0
  133. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/dom-ready-not-working.html +349 -0
  134. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-can-i-stop-auto-enhancement-of-a-block-of-elements.html +342 -0
  135. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-can-i-stop-auto-enhancement-of-elements.html +348 -0
  136. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-configure-phonegap-cordova.html +398 -0
  137. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-do-i-control-page-titles.html +344 -0
  138. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-do-i-load-a-page.html +338 -0
  139. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-do-i-scroll-to-a-position.html +340 -0
  140. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-do-i-use-touch-mouse-events.html +335 -0
  141. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/how-does-theming-work.html +446 -0
  142. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/index.html +424 -0
  143. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/injected-content-is-not-enhanced.html +360 -0
  144. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/my-html-5-inputs-look-different-in-browsers.html +335 -0
  145. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/my-range-search-input-type-is-being-changed.html +335 -0
  146. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/pass-query-params-to-page.html +343 -0
  147. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/pass-via-the-hash-to-page.html +334 -0
  148. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/question-template.html +353 -0
  149. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/scripts-and-styles-not-loading.html +342 -0
  150. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/sometimes-custom-select-shows-as-dialog-popup.html +335 -0
  151. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/the-application-cache-is-not-working.html +346 -0
  152. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/triggering-create-on-injected-content-does-not-work.html +346 -0
  153. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/updating-the-value-of-enhanced-form-elements-does-not-work.html +364 -0
  154. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/faq/why-is-only-the-first-page-loaded.html +334 -0
  155. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/favicon.ico +0 -0
  156. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/global-nav.html +73 -0
  157. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/index.html +31 -0
  158. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/intro/index.html +418 -0
  159. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/intro/rwd.html +409 -0
  160. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/nav-examples.html +55 -0
  161. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/nav-faq.html +91 -0
  162. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/nav-widgets.html +61 -0
  163. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/search-results.html +540 -0
  164. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/search.html +214 -0
  165. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/accordions/index.html +513 -0
  166. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/autocomplete/autocomplete-remote.html +376 -0
  167. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/autocomplete/index.html +416 -0
  168. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/buttons/buttons-grids.html +453 -0
  169. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/buttons/index.html +476 -0
  170. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/checkbox/index.html +426 -0
  171. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/collapsibles/index.html +512 -0
  172. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/controlgroups/index.html +651 -0
  173. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog-alt.html +4 -6
  174. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog-buttons.html +4 -6
  175. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/dialog/dialog-corners.html +29 -0
  176. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/dialog/dialog-noclosebtn.html +29 -0
  177. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog-overlay.html +4 -6
  178. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/dialog/dialog-rightclosebtn.html +29 -0
  179. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog-success.html +6 -8
  180. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog-with-select.html +7 -9
  181. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/dialog}/dialog.html +8 -10
  182. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/dialog/index.html +403 -0
  183. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars/footer-persist-d.html → jquery.mobile-1.3.0/demos/docs/widgets/footers/footer-persist-a.html} +32 -33
  184. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars/footer-persist-a.html → jquery.mobile-1.3.0/demos/docs/widgets/footers/footer-persist-b.html} +17 -28
  185. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars/footer-persist-b.html → jquery.mobile-1.3.0/demos/docs/widgets/footers/footer-persist-c.html} +22 -26
  186. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/toolbars/footer-persist-c.html → jquery.mobile-1.3.0/demos/docs/widgets/footers/footer-persist-d.html} +17 -40
  187. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/footers/index.html +387 -0
  188. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/form-disabled.html +795 -0
  189. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/form-fieldcontain.html +785 -0
  190. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/form-hide-label.html +785 -0
  191. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/form-label-hidden.html +713 -0
  192. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/form.html +646 -0
  193. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/forms/index.html +706 -0
  194. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/grids/grid-custom.html +438 -0
  195. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/grids/index.html +497 -0
  196. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/headers/bars-fixed-forms.html +121 -0
  197. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/headers/bars-fixed.html +471 -0
  198. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/headers/bars-fullscreen.html +333 -0
  199. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/headers/index.html +444 -0
  200. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/icons/index.html +642 -0
  201. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/index.html +395 -0
  202. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/links/index.html +411 -0
  203. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/listviews/index.html +853 -0
  204. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/loader/index.html +384 -0
  205. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navbar/footer-persist-a.html +358 -0
  206. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navbar/footer-persist-b.html +370 -0
  207. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navbar/footer-persist-c.html +408 -0
  208. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navbar/footer-persist-d.html +386 -0
  209. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navbar/index.html +599 -0
  210. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navigation/demo.js +38 -0
  211. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/navigation/index.html +429 -0
  212. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/pages/index.html +524 -0
  213. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs → jquery.mobile-1.3.0/demos/docs/widgets}/pages/multipage-template.html +32 -31
  214. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/panels/index.html +535 -0
  215. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/panels/panel-fixed.html +170 -0
  216. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/index.html +582 -0
  217. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/map.html +38 -0
  218. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/popup-examples.css +16 -0
  219. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/popup-examples.js +98 -0
  220. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/popup-iframes.html +526 -0
  221. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/popup/popup-images.html +361 -0
  222. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/radiobuttons/index.html +434 -0
  223. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/selects/custom-selects.html +598 -0
  224. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/selects/index.html +545 -0
  225. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/sliders/index.html +479 -0
  226. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/sliders/rangeslider.html +534 -0
  227. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/sliders/switch.html +485 -0
  228. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/table-column-toggle/index.html +602 -0
  229. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/table-reflow/index.html +458 -0
  230. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/textinputs/index.html +689 -0
  231. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/docs/widgets/transitions/index.html +447 -0
  232. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/transitions}/page-transitions-dialog.html +11 -11
  233. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/docs/pages → jquery.mobile-1.3.0/demos/docs/widgets/transitions}/page-transitions-page.html +13 -15
  234. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/index.html +340 -0
  235. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/js/jquery.js +9597 -0
  236. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/js/jquery.mobile-1.3.0.js +11092 -0
  237. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/demos/js/jquery.mobile-1.3.0.min.js +2 -0
  238. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0 → jquery.mobile-1.3.0}/images/ajax-loader.gif +0 -0
  239. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/images/icons-18-black.png +0 -0
  240. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/images/icons-18-white.png +0 -0
  241. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/images/icons-36-black.png +0 -0
  242. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/images/icons-36-white.png +0 -0
  243. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.css +3357 -0
  244. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.js +11092 -0
  245. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.css +2 -0
  246. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.js +2 -0
  247. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile.structure-1.3.0.css +2197 -0
  248. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile.structure-1.3.0.min.css +2 -0
  249. data/lib/ruby_app/resources/elements/mobile/document/{jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile.theme-1.1.0.css → jquery.mobile-1.3.0/jquery.mobile.theme-1.3.0.css} +367 -367
  250. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile.theme-1.3.0.min.css +2 -0
  251. data/lib/ruby_app/scripts/phantom/phantom.js +23 -0
  252. data/lib/ruby_app/scripts/phantom/standard_no_logon.rb +3 -0
  253. data/lib/ruby_app/version.rb +1 -1
  254. metadata +253 -254
  255. data/lib/ruby_app/resources/elements/mobile/document/fastclick-0.5.6.js +0 -660
  256. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/images/ajax-loader.png +0 -0
  257. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/images/icons-18-black.png +0 -0
  258. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/images/icons-18-white.png +0 -0
  259. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/images/icons-36-black.png +0 -0
  260. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/images/icons-36-white.png +0 -0
  261. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile-1.1.0.css +0 -2053
  262. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile-1.1.0.min.css +0 -2
  263. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile.structure-1.1.0.css +0 -946
  264. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile.structure-1.1.0.min.css +0 -2
  265. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/css/themes/default/jquery.mobile.theme-1.1.0.min.css +0 -2
  266. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/css/jqm-docs.css +0 -359
  267. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/ios_icon.png +0 -0
  268. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/ios_startup.png +0 -0
  269. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/jqm-sitebg.png +0 -0
  270. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/jquery-logo.png +0 -0
  271. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/mobile-devices.png +0 -0
  272. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/px-ccc.gif +0 -0
  273. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/themroller-mobile-logo.png +0 -0
  274. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/images/version.png +0 -0
  275. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/js/_viewsource.js +0 -42
  276. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/_assets/js/jqm-docs.js +0 -52
  277. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/accessibility.html +0 -70
  278. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/features.html +0 -77
  279. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/getting-started.html +0 -171
  280. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/index.html +0 -40
  281. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/intro.html +0 -70
  282. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/about/platforms.html +0 -108
  283. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/data-attributes.html +0 -530
  284. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/events-nav.html +0 -557
  285. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/events.html +0 -514
  286. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/globalconfig.html +0 -181
  287. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/index.html +0 -40
  288. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/mediahelpers.html +0 -133
  289. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/methods.html +0 -597
  290. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/api/themes.html +0 -291
  291. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/api-buttons.html +0 -45
  292. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-events.html +0 -92
  293. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-grouped.html +0 -112
  294. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-icons.html +0 -247
  295. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-inline.html +0 -99
  296. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-methods.html +0 -98
  297. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-options.html +0 -153
  298. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-themes.html +0 -130
  299. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/buttons-types.html +0 -119
  300. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/buttons/index.html +0 -43
  301. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/dialogTransition.html +0 -44
  302. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/iOSFullscreen.html +0 -50
  303. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/index.html +0 -86
  304. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/jq17b1.html +0 -37
  305. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/loadingMessage.html +0 -43
  306. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/loadingMessageTextVisible.html +0 -84
  307. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/minScrollBack.html +0 -43
  308. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/pageLoadErrorMessage.html +0 -45
  309. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/pageTransition.html +0 -43
  310. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/pushState.html +0 -44
  311. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/config/touchOverflow.html +0 -51
  312. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/api-content.html +0 -42
  313. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-events.html +0 -109
  314. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-methods.html +0 -67
  315. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-options.html +0 -178
  316. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-set-events.html +0 -89
  317. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-set-methods.html +0 -80
  318. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-set-options.html +0 -112
  319. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible-set.html +0 -198
  320. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-collapsible.html +0 -226
  321. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-grids.html +0 -193
  322. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-html.html +0 -144
  323. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/content-themes.html +0 -144
  324. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/content/index.html +0 -45
  325. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/checkboxes/events.html +0 -104
  326. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/checkboxes/index.html +0 -189
  327. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/checkboxes/methods.html +0 -108
  328. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/checkboxes/options.html +0 -98
  329. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/docs-forms.html +0 -267
  330. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-all-compare.html +0 -263
  331. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-all-mini.html +0 -245
  332. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-all-native.html +0 -250
  333. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-all.html +0 -247
  334. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-sample-response.php +0 -81
  335. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-sample-selfsubmit.php +0 -80
  336. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-sample.html +0 -114
  337. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/forms-themes.html +0 -408
  338. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/index.html +0 -50
  339. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/plugin-eventsmethods.html +0 -73
  340. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/radiobuttons/events.html +0 -106
  341. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/radiobuttons/index.html +0 -225
  342. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/radiobuttons/methods.html +0 -108
  343. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/radiobuttons/options.html +0 -98
  344. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/search/events.html +0 -103
  345. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/search/index.html +0 -141
  346. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/search/methods.html +0 -100
  347. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/search/options.html +0 -113
  348. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/selects/custom.html +0 -424
  349. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/selects/events.html +0 -105
  350. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/selects/index.html +0 -418
  351. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/selects/methods.html +0 -126
  352. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/selects/options.html +0 -173
  353. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/slider/events.html +0 -104
  354. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/slider/index.html +0 -179
  355. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/slider/methods.html +0 -108
  356. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/slider/options.html +0 -131
  357. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/switch/events.html +0 -104
  358. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/switch/index.html +0 -210
  359. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/switch/methods.html +0 -108
  360. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/switch/options.html +0 -123
  361. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/textinputs/events.html +0 -103
  362. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/textinputs/index.html +0 -244
  363. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/textinputs/methods.html +0 -100
  364. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/forms/textinputs/options.html +0 -117
  365. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/index.html +0 -33
  366. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/docs-lists.html +0 -177
  367. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/images/album-bb.jpg +0 -0
  368. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/images/sj.png +0 -0
  369. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/index.html +0 -72
  370. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-all-full.html +0 -174
  371. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-count.html +0 -83
  372. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-divider.html +0 -114
  373. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-events.html +0 -108
  374. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-formatting.html +0 -135
  375. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-forms-inset.html +0 -249
  376. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-forms.html +0 -249
  377. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-icons.html +0 -89
  378. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-inset.html +0 -175
  379. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-methods.html +0 -108
  380. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-nested.html +0 -194
  381. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-ol.html +0 -98
  382. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-options.html +0 -222
  383. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-performance.html +0 -578
  384. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-readonly-inset.html +0 -171
  385. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-readonly.html +0 -173
  386. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-search-filtertext.html +0 -94
  387. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-search-inset.html +0 -100
  388. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-search-with-dividers.html +0 -113
  389. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-search.html +0 -100
  390. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-split-purchase.html +0 -35
  391. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-split.html +0 -147
  392. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-themes.html +0 -264
  393. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-thumbnails.html +0 -135
  394. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/lists/lists-ul.html +0 -100
  395. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/nav.html +0 -296
  396. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/docs-links-urltest/index.html +0 -28
  397. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/animals.html +0 -27
  398. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/category.php +0 -150
  399. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/colors.html +0 -31
  400. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/index.html +0 -26
  401. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/sample-reuse-page-external.html +0 -121
  402. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/sample-reuse-page.html +0 -197
  403. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/dynamic-samples/vehicles.html +0 -27
  404. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/index.html +0 -52
  405. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-anatomy.html +0 -225
  406. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-cache.html +0 -125
  407. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-customtransitions.html +0 -297
  408. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-dialogs.html +0 -129
  409. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-dynamic.html +0 -300
  410. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-links.html +0 -147
  411. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-navmodel.html +0 -182
  412. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-scripting.html +0 -156
  413. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-template.html +0 -34
  414. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-titles.html +0 -82
  415. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/page-transitions.html +0 -174
  416. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes.html +0 -150
  417. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-a.html +0 -163
  418. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-b.html +0 -163
  419. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-c.html +0 -163
  420. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-d.html +0 -163
  421. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/pages-themes/theme-e.html +0 -163
  422. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/phonegap.html +0 -115
  423. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/touchoverflow.html +0 -127
  424. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/pages/transition-success.html +0 -33
  425. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-events.html +0 -84
  426. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-a.html +0 -299
  427. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-b.html +0 -129
  428. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-c.html +0 -129
  429. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-d.html +0 -153
  430. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-e.html +0 -153
  431. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-f.html +0 -129
  432. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-g.html +0 -231
  433. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms-h.html +0 -135
  434. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-forms.html +0 -45
  435. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-methods.html +0 -134
  436. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed-options.html +0 -177
  437. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fixed.html +0 -231
  438. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-fullscreen.html +0 -68
  439. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/bars-themes.html +0 -177
  440. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/docs-bars.html +0 -85
  441. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/docs-footers.html +0 -153
  442. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/docs-headers.html +0 -216
  443. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/docs-navbar.html +0 -318
  444. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/docs/toolbars/index.html +0 -45
  445. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/index.html +0 -76
  446. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/js/jquery.mobile-1.1.0.js +0 -7551
  447. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/demos/js/jquery.mobile-1.1.0.min.js +0 -177
  448. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/images/ajax-loader.png +0 -0
  449. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/images/icons-18-black.png +0 -0
  450. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/images/icons-18-white.png +0 -0
  451. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/images/icons-36-black.png +0 -0
  452. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/images/icons-36-white.png +0 -0
  453. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile-1.1.0.css +0 -2053
  454. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile-1.1.0.js +0 -7551
  455. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile-1.1.0.min.css +0 -2
  456. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile-1.1.0.min.js +0 -177
  457. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile.structure-1.1.0.css +0 -946
  458. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile.structure-1.1.0.min.css +0 -2
  459. data/lib/ruby_app/resources/elements/mobile/document/jquery.mobile-1.1.0/jquery.mobile.theme-1.1.0.min.css +0 -2
  460. data/lib/ruby_app/resources/elements/mobile/document/jquery.ui.touch-punch-0.2.2.min.js +0 -11
@@ -0,0 +1,4215 @@
1
+ /*!
2
+ * Lo-Dash v0.8.2 <http://lodash.com>
3
+ * (c) 2012 John-David Dalton <http://allyoucanleet.com/>
4
+ * Based on Underscore.js 1.4.2 <http://underscorejs.org>
5
+ * (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
6
+ * Available under MIT license <http://lodash.com/license>
7
+ */
8
+ ;(function(window, undefined) {
9
+ 'use strict';
10
+
11
+ /** Detect free variable `exports` */
12
+ var freeExports = typeof exports == 'object' && exports &&
13
+ (typeof global == 'object' && global && global == global.global && (window = global), exports);
14
+
15
+ /** Native prototype shortcuts */
16
+ var ArrayProto = Array.prototype,
17
+ BoolProto = Boolean.prototype,
18
+ ObjectProto = Object.prototype,
19
+ NumberProto = Number.prototype,
20
+ StringProto = String.prototype;
21
+
22
+ /** Used to generate unique IDs */
23
+ var idCounter = 0;
24
+
25
+ /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */
26
+ var largeArraySize = 30;
27
+
28
+ /** Used to restore the original `_` reference in `noConflict` */
29
+ var oldDash = window._;
30
+
31
+ /** Used to detect delimiter values that should be processed by `tokenizeEvaluate` */
32
+ var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/;
33
+
34
+ /** Used to match HTML entities */
35
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g;
36
+
37
+ /** Used to match empty string literals in compiled template source */
38
+ var reEmptyStringLeading = /\b__p \+= '';/g,
39
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
40
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
41
+
42
+ /** Used to match regexp flags from their coerced string values */
43
+ var reFlags = /\w*$/;
44
+
45
+ /** Used to insert the data object variable into compiled template source */
46
+ var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g;
47
+
48
+ /** Used to detect if a method is native */
49
+ var reNative = RegExp('^' +
50
+ (ObjectProto.valueOf + '')
51
+ .replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&')
52
+ .replace(/valueOf|for [^\]]+/g, '.+?') + '$'
53
+ );
54
+
55
+ /** Used to ensure capturing order and avoid matches for undefined delimiters */
56
+ var reNoMatch = /($^)/;
57
+
58
+ /** Used to match HTML characters */
59
+ var reUnescapedHtml = /[&<>"']/g;
60
+
61
+ /** Used to match unescaped characters in compiled string literals */
62
+ var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
63
+
64
+ /** Used to fix the JScript [[DontEnum]] bug */
65
+ var shadowed = [
66
+ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
67
+ 'toLocaleString', 'toString', 'valueOf'
68
+ ];
69
+
70
+ /** Used to make template sourceURLs easier to identify */
71
+ var templateCounter = 0;
72
+
73
+ /** Native method shortcuts */
74
+ var ceil = Math.ceil,
75
+ concat = ArrayProto.concat,
76
+ floor = Math.floor,
77
+ getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
78
+ hasOwnProperty = ObjectProto.hasOwnProperty,
79
+ push = ArrayProto.push,
80
+ propertyIsEnumerable = ObjectProto.propertyIsEnumerable,
81
+ slice = ArrayProto.slice,
82
+ toString = ObjectProto.toString;
83
+
84
+ /* Native method shortcuts for methods with the same name as other `lodash` methods */
85
+ var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
86
+ nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
87
+ nativeIsFinite = window.isFinite,
88
+ nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
89
+ nativeMax = Math.max,
90
+ nativeMin = Math.min,
91
+ nativeRandom = Math.random;
92
+
93
+ /** `Object#toString` result shortcuts */
94
+ var argsClass = '[object Arguments]',
95
+ arrayClass = '[object Array]',
96
+ boolClass = '[object Boolean]',
97
+ dateClass = '[object Date]',
98
+ funcClass = '[object Function]',
99
+ numberClass = '[object Number]',
100
+ objectClass = '[object Object]',
101
+ regexpClass = '[object RegExp]',
102
+ stringClass = '[object String]';
103
+
104
+ /** Timer shortcuts */
105
+ var clearTimeout = window.clearTimeout,
106
+ setTimeout = window.setTimeout;
107
+
108
+ /**
109
+ * Detect the JScript [[DontEnum]] bug:
110
+ *
111
+ * In IE < 9 an objects own properties, shadowing non-enumerable ones, are
112
+ * made non-enumerable as well.
113
+ */
114
+ var hasDontEnumBug;
115
+
116
+ /**
117
+ * Detect if `Array#shift` and `Array#splice` augment array-like objects
118
+ * incorrectly:
119
+ *
120
+ * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()`
121
+ * and `splice()` functions that fail to remove the last element, `value[0]`,
122
+ * of array-like objects even though the `length` property is set to `0`.
123
+ * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()`
124
+ * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9.
125
+ */
126
+ var hasObjectSpliceBug;
127
+
128
+ /** Detect if own properties are iterated after inherited properties (IE < 9) */
129
+ var iteratesOwnLast;
130
+
131
+ /** Detect if an `arguments` object's indexes are non-enumerable (IE < 9) */
132
+ var noArgsEnum = true;
133
+
134
+ (function() {
135
+ var object = { '0': 1, 'length': 1 },
136
+ props = [];
137
+
138
+ function ctor() { this.x = 1; }
139
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
140
+ for (var prop in new ctor) { props.push(prop); }
141
+ for (prop in arguments) { noArgsEnum = !prop; }
142
+
143
+ hasDontEnumBug = (props + '').length < 4;
144
+ iteratesOwnLast = props[0] != 'x';
145
+ hasObjectSpliceBug = (props.splice.call(object, 0, 1), object[0]);
146
+ }(1));
147
+
148
+ /** Detect if an `arguments` object's [[Class]] is unresolvable (Firefox < 4, IE < 9) */
149
+ var noArgsClass = !isArguments(arguments);
150
+
151
+ /** Detect if `Array#slice` cannot be used to convert strings to arrays (Opera < 10.52) */
152
+ var noArraySliceOnStrings = slice.call('x')[0] != 'x';
153
+
154
+ /**
155
+ * Detect lack of support for accessing string characters by index:
156
+ *
157
+ * IE < 8 can't access characters by index and IE 8 can only access
158
+ * characters by index on string literals.
159
+ */
160
+ var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx';
161
+
162
+ /**
163
+ * Detect if a node's [[Class]] is unresolvable (IE < 9)
164
+ * and that the JS engine won't error when attempting to coerce an object to
165
+ * a string without a `toString` property value of `typeof` "function".
166
+ */
167
+ try {
168
+ var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass);
169
+ } catch(e) { }
170
+
171
+ /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */
172
+ var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera));
173
+
174
+ /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */
175
+ var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent);
176
+
177
+ /* Detect if strict mode, "use strict", is inferred to be fast (V8) */
178
+ var isStrictFast = !isBindFast;
179
+
180
+ /**
181
+ * Detect if sourceURL syntax is usable without erroring:
182
+ *
183
+ * The JS engine in Adobe products, like InDesign, will throw a syntax error
184
+ * when it encounters a single line comment beginning with the `@` symbol.
185
+ *
186
+ * The JS engine in Narwhal will generate the function `function anonymous(){//}`
187
+ * and throw a syntax error.
188
+ *
189
+ * Avoid comments beginning `@` symbols in IE because they are part of its
190
+ * non-standard conditional compilation support.
191
+ * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx
192
+ */
193
+ try {
194
+ var useSourceURL = (Function('//@')(), !window.attachEvent);
195
+ } catch(e) { }
196
+
197
+ /** Used to identify object classifications that `_.clone` supports */
198
+ var cloneableClasses = {};
199
+ cloneableClasses[argsClass] = cloneableClasses[funcClass] = false;
200
+ cloneableClasses[arrayClass] = cloneableClasses[boolClass] = cloneableClasses[dateClass] =
201
+ cloneableClasses[numberClass] = cloneableClasses[objectClass] = cloneableClasses[regexpClass] =
202
+ cloneableClasses[stringClass] = true;
203
+
204
+ /** Used to determine if values are of the language type Object */
205
+ var objectTypes = {
206
+ 'boolean': false,
207
+ 'function': true,
208
+ 'object': true,
209
+ 'number': false,
210
+ 'string': false,
211
+ 'undefined': false,
212
+ 'unknown': true
213
+ };
214
+
215
+ /** Used to escape characters for inclusion in compiled string literals */
216
+ var stringEscapes = {
217
+ '\\': '\\',
218
+ "'": "'",
219
+ '\n': 'n',
220
+ '\r': 'r',
221
+ '\t': 't',
222
+ '\u2028': 'u2028',
223
+ '\u2029': 'u2029'
224
+ };
225
+
226
+ /*--------------------------------------------------------------------------*/
227
+
228
+ /**
229
+ * The `lodash` function.
230
+ *
231
+ * @name _
232
+ * @constructor
233
+ * @category Chaining
234
+ * @param {Mixed} value The value to wrap in a `lodash` instance.
235
+ * @returns {Object} Returns a `lodash` instance.
236
+ */
237
+ function lodash(value) {
238
+ // exit early if already wrapped
239
+ if (value && value.__wrapped__) {
240
+ return value;
241
+ }
242
+ // allow invoking `lodash` without the `new` operator
243
+ if (!(this instanceof lodash)) {
244
+ return new lodash(value);
245
+ }
246
+ this.__wrapped__ = value;
247
+ }
248
+
249
+ /**
250
+ * By default, the template delimiters used by Lo-Dash are similar to those in
251
+ * embedded Ruby (ERB). Change the following template settings to use alternative
252
+ * delimiters.
253
+ *
254
+ * @static
255
+ * @memberOf _
256
+ * @type Object
257
+ */
258
+ lodash.templateSettings = {
259
+
260
+ /**
261
+ * Used to detect `data` property values to be HTML-escaped.
262
+ *
263
+ * @static
264
+ * @memberOf _.templateSettings
265
+ * @type RegExp
266
+ */
267
+ 'escape': /<%-([\s\S]+?)%>/g,
268
+
269
+ /**
270
+ * Used to detect code to be evaluated.
271
+ *
272
+ * @static
273
+ * @memberOf _.templateSettings
274
+ * @type RegExp
275
+ */
276
+ 'evaluate': /<%([\s\S]+?)%>/g,
277
+
278
+ /**
279
+ * Used to detect `data` property values to inject.
280
+ *
281
+ * @static
282
+ * @memberOf _.templateSettings
283
+ * @type RegExp
284
+ */
285
+ 'interpolate': /<%=([\s\S]+?)%>/g,
286
+
287
+ /**
288
+ * Used to reference the data object in the template text.
289
+ *
290
+ * @static
291
+ * @memberOf _.templateSettings
292
+ * @type String
293
+ */
294
+ 'variable': ''
295
+ };
296
+
297
+ /*--------------------------------------------------------------------------*/
298
+
299
+ /**
300
+ * The template used to create iterator functions.
301
+ *
302
+ * @private
303
+ * @param {Obect} data The data object used to populate the text.
304
+ * @returns {String} Returns the interpolated text.
305
+ */
306
+ var iteratorTemplate = template(
307
+ // conditional strict mode
308
+ '<% if (useStrict) { %>\'use strict\';\n<% } %>' +
309
+
310
+ // the `iteratee` may be reassigned by the `top` snippet
311
+ 'var index, value, iteratee = <%= firstArg %>, ' +
312
+ // assign the `result` variable an initial value
313
+ 'result = <%= firstArg %>;\n' +
314
+ // exit early if the first argument is falsey
315
+ 'if (!<%= firstArg %>) return result;\n' +
316
+ // add code before the iteration branches
317
+ '<%= top %>;\n' +
318
+
319
+ // the following branch is for iterating arrays and array-like objects
320
+ '<% if (arrayLoop) { %>' +
321
+ 'var length = iteratee.length; index = -1;' +
322
+ ' <% if (objectLoop) { %>\nif (typeof length == \'number\') {<% } %>' +
323
+
324
+ // add support for accessing string characters by index if needed
325
+ ' <% if (noCharByIndex) { %>\n' +
326
+ ' if (toString.call(iteratee) == stringClass) {\n' +
327
+ ' iteratee = iteratee.split(\'\')\n' +
328
+ ' }' +
329
+ ' <% } %>\n' +
330
+
331
+ ' while (++index < length) {\n' +
332
+ ' value = iteratee[index];\n' +
333
+ ' <%= arrayLoop %>\n' +
334
+ ' }' +
335
+ ' <% if (objectLoop) { %>\n}<% } %>' +
336
+ '<% } %>' +
337
+
338
+ // the following branch is for iterating an object's own/inherited properties
339
+ '<% if (objectLoop) { %>' +
340
+ ' <% if (arrayLoop) { %>\nelse {' +
341
+
342
+ // add support for iterating over `arguments` objects if needed
343
+ ' <% } else if (noArgsEnum) { %>\n' +
344
+ ' var length = iteratee.length; index = -1;\n' +
345
+ ' if (length && isArguments(iteratee)) {\n' +
346
+ ' while (++index < length) {\n' +
347
+ ' value = iteratee[index += \'\'];\n' +
348
+ ' <%= objectLoop %>\n' +
349
+ ' }\n' +
350
+ ' } else {' +
351
+ ' <% } %>' +
352
+
353
+ // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
354
+ // (if the prototype or a property on the prototype has been set)
355
+ // incorrectly sets a function's `prototype` property [[Enumerable]]
356
+ // value to `true`. Because of this Lo-Dash standardizes on skipping
357
+ // the the `prototype` property of functions regardless of its
358
+ // [[Enumerable]] value.
359
+ ' <% if (!hasDontEnumBug) { %>\n' +
360
+ ' var skipProto = typeof iteratee == \'function\' && \n' +
361
+ ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' +
362
+ ' <% } %>' +
363
+
364
+ // iterate own properties using `Object.keys` if it's fast
365
+ ' <% if (isKeysFast && useHas) { %>\n' +
366
+ ' var ownIndex = -1,\n' +
367
+ ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' +
368
+ ' length = ownProps.length;\n\n' +
369
+ ' while (++ownIndex < length) {\n' +
370
+ ' index = ownProps[ownIndex];\n' +
371
+ ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' +
372
+ ' value = iteratee[index];\n' +
373
+ ' <%= objectLoop %>\n' +
374
+ ' <% if (!hasDontEnumBug) { %>}\n<% } %>' +
375
+ ' }' +
376
+
377
+ // else using a for-in loop
378
+ ' <% } else { %>\n' +
379
+ ' for (index in iteratee) {<%' +
380
+ ' if (!hasDontEnumBug || useHas) { %>\n if (<%' +
381
+ ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' +
382
+ ' if (!hasDontEnumBug && useHas) { %> && <% }' +
383
+ ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' +
384
+ ' %>) {' +
385
+ ' <% } %>\n' +
386
+ ' value = iteratee[index];\n' +
387
+ ' <%= objectLoop %>;' +
388
+ ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' +
389
+ ' }' +
390
+ ' <% } %>' +
391
+
392
+ // Because IE < 9 can't set the `[[Enumerable]]` attribute of an
393
+ // existing property and the `constructor` property of a prototype
394
+ // defaults to non-enumerable, Lo-Dash skips the `constructor`
395
+ // property when it infers it's iterating over a `prototype` object.
396
+ ' <% if (hasDontEnumBug) { %>\n\n' +
397
+ ' var ctor = iteratee.constructor;\n' +
398
+ ' <% for (var k = 0; k < 7; k++) { %>\n' +
399
+ ' index = \'<%= shadowed[k] %>\';\n' +
400
+ ' if (<%' +
401
+ ' if (shadowed[k] == \'constructor\') {' +
402
+ ' %>!(ctor && ctor.prototype === iteratee) && <%' +
403
+ ' } %>hasOwnProperty.call(iteratee, index)) {\n' +
404
+ ' value = iteratee[index];\n' +
405
+ ' <%= objectLoop %>\n' +
406
+ ' }' +
407
+ ' <% } %>' +
408
+ ' <% } %>' +
409
+ ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>' +
410
+ '<% } %>\n' +
411
+
412
+ // add code to the bottom of the iteration function
413
+ '<%= bottom %>;\n' +
414
+ // finally, return the `result`
415
+ 'return result'
416
+ );
417
+
418
+ /**
419
+ * Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`.
420
+ */
421
+ var forEachIteratorOptions = {
422
+ 'args': 'collection, callback, thisArg',
423
+ 'top': 'callback = createCallback(callback, thisArg)',
424
+ 'loop': 'if (callback(value, index, collection) === false) return result'
425
+ };
426
+
427
+ /** Reusable iterator options for `defaults`, and `extend` */
428
+ var extendIteratorOptions = {
429
+ 'useHas': false,
430
+ 'useStrict': false,
431
+ 'args': 'object',
432
+ 'top':
433
+ 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
434
+ ' if (iteratee = arguments[argsIndex]) {',
435
+ 'objectLoop': 'result[index] = value',
436
+ 'bottom': ' }\n}'
437
+ };
438
+
439
+ /** Reusable iterator options for `forIn` and `forOwn` */
440
+ var forOwnIteratorOptions = {
441
+ 'loop': null,
442
+ 'objectLoop': forEachIteratorOptions.loop
443
+ };
444
+
445
+ /*--------------------------------------------------------------------------*/
446
+
447
+ /**
448
+ * Creates a function optimized for searching large arrays for a given `value`,
449
+ * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`.
450
+ *
451
+ * @private
452
+ * @param {Array} array The array to search.
453
+ * @param {Mixed} value The value to search for.
454
+ * @param {Number} [fromIndex=0] The index to start searching from.
455
+ * @param {Number} [largeSize=30] The length at which an array is considered large.
456
+ * @returns {Boolean} Returns `true` if `value` is found, else `false`.
457
+ */
458
+ function cachedContains(array, fromIndex, largeSize) {
459
+ fromIndex || (fromIndex = 0);
460
+
461
+ var length = array.length,
462
+ isLarge = (length - fromIndex) >= (largeSize || largeArraySize),
463
+ cache = isLarge ? {} : array;
464
+
465
+ if (isLarge) {
466
+ // init value cache
467
+ var index = fromIndex - 1;
468
+ while (++index < length) {
469
+ // manually coerce `value` to string because `hasOwnProperty`, in some
470
+ // older versions of Firefox, coerces objects incorrectly
471
+ var key = array[index] + '';
472
+ (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
473
+ }
474
+ }
475
+ return function(value) {
476
+ if (isLarge) {
477
+ var key = value + '';
478
+ return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
479
+ }
480
+ return indexOf(cache, value, fromIndex) > -1;
481
+ }
482
+ }
483
+
484
+ /**
485
+ * Used by `sortBy` to compare transformed `collection` values, stable sorting
486
+ * them in ascending order.
487
+ *
488
+ * @private
489
+ * @param {Object} a The object to compare to `b`.
490
+ * @param {Object} b The object to compare to `a`.
491
+ * @returns {Number} Returns the sort order indicator of `1` or `-1`.
492
+ */
493
+ function compareAscending(a, b) {
494
+ var ai = a.index,
495
+ bi = b.index;
496
+
497
+ a = a.criteria;
498
+ b = b.criteria;
499
+
500
+ // ensure a stable sort in V8 and other engines
501
+ // http://code.google.com/p/v8/issues/detail?id=90
502
+ if (a !== b) {
503
+ if (a > b || a === undefined) {
504
+ return 1;
505
+ }
506
+ if (a < b || b === undefined) {
507
+ return -1;
508
+ }
509
+ }
510
+ return ai < bi ? -1 : 1;
511
+ }
512
+
513
+ /**
514
+ * Creates a function that, when called, invokes `func` with the `this`
515
+ * binding of `thisArg` and prepends any `partailArgs` to the arguments passed
516
+ * to the bound function.
517
+ *
518
+ * @private
519
+ * @param {Function|String} func The function to bind or the method name.
520
+ * @param {Mixed} [thisArg] The `this` binding of `func`.
521
+ * @param {Array} partialArgs An array of arguments to be partially applied.
522
+ * @returns {Function} Returns the new bound function.
523
+ */
524
+ function createBound(func, thisArg, partialArgs) {
525
+ var isFunc = isFunction(func),
526
+ isPartial = !partialArgs,
527
+ methodName = func;
528
+
529
+ // juggle arguments
530
+ if (isPartial) {
531
+ partialArgs = thisArg;
532
+ }
533
+
534
+ function bound() {
535
+ // `Function#bind` spec
536
+ // http://es5.github.com/#x15.3.4.5
537
+ var args = arguments,
538
+ thisBinding = isPartial ? this : thisArg;
539
+
540
+ if (!isFunc) {
541
+ func = thisArg[methodName];
542
+ }
543
+ if (partialArgs.length) {
544
+ args = args.length
545
+ ? partialArgs.concat(slice.call(args))
546
+ : partialArgs;
547
+ }
548
+ if (this instanceof bound) {
549
+ // get `func` instance if `bound` is invoked in a `new` expression
550
+ noop.prototype = func.prototype;
551
+ thisBinding = new noop;
552
+
553
+ // mimic the constructor's `return` behavior
554
+ // http://es5.github.com/#x13.2.2
555
+ var result = func.apply(thisBinding, args);
556
+ return result && objectTypes[typeof result]
557
+ ? result
558
+ : thisBinding
559
+ }
560
+ return func.apply(thisBinding, args);
561
+ }
562
+ return bound;
563
+ }
564
+
565
+ /**
566
+ * Produces an iteration callback bound to an optional `thisArg`. If `func` is
567
+ * a property name, the callback will return the property value for a given element.
568
+ *
569
+ * @private
570
+ * @param {Function|String} [func=identity|property] The function called per
571
+ * iteration or property name to query.
572
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
573
+ * @returns {Function} Returns a callback function.
574
+ */
575
+ function createCallback(func, thisArg) {
576
+ if (!func) {
577
+ return identity;
578
+ }
579
+ if (typeof func != 'function') {
580
+ return function(object) {
581
+ return object[func];
582
+ };
583
+ }
584
+ if (thisArg !== undefined) {
585
+ return function(value, index, object) {
586
+ return func.call(thisArg, value, index, object);
587
+ };
588
+ }
589
+ return func;
590
+ }
591
+
592
+ /**
593
+ * Creates compiled iteration functions.
594
+ *
595
+ * @private
596
+ * @param {Object} [options1, options2, ...] The compile options objects.
597
+ *
598
+ * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
599
+ * useStrict - A boolean to specify including the "use strict" directive.
600
+ * args - A string of comma separated arguments the iteration function will accept.
601
+ * top - A string of code to execute before the iteration branches.
602
+ * arrayLoop - A string of code to execute in the array loop.
603
+ * objectLoop - A string of code to execute in the object loop.
604
+ * loop - A string of code to execute in the array or object loops.
605
+ * bottom - A string of code to execute after the iteration branches.
606
+ *
607
+ * @returns {Function} Returns the compiled function.
608
+ */
609
+ function createIterator() {
610
+ var data = {
611
+ 'arrayLoop': '',
612
+ 'bottom': '',
613
+ 'hasDontEnumBug': hasDontEnumBug,
614
+ 'isKeysFast': isKeysFast,
615
+ 'objectLoop': '',
616
+ 'noArgsEnum': noArgsEnum,
617
+ 'noCharByIndex': noCharByIndex,
618
+ 'shadowed': shadowed,
619
+ 'top': '',
620
+ 'useHas': true,
621
+ 'useStrict': isStrictFast
622
+ };
623
+
624
+ var object,
625
+ index = -1;
626
+
627
+ // merge options into a template data object
628
+ while (object = arguments[++index]) {
629
+ for (var prop in object) {
630
+ var value = object[prop];
631
+ if (prop == 'loop') {
632
+ data.arrayLoop = value;
633
+ data.objectLoop = value;
634
+ } else {
635
+ data[prop] = value;
636
+ }
637
+ }
638
+ }
639
+ // set additional template `data` properties
640
+ var args = data.args;
641
+ data.firstArg = /^[^,]+/.exec(args)[0];
642
+
643
+ // create the function factory
644
+ var factory = Function(
645
+ 'bind, createCallback, functions, hasOwnProperty, isArguments, isFunction, ' +
646
+ 'objectTypes, nativeKeys, propertyIsEnumerable, stringClass, toString',
647
+ 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
648
+ );
649
+ // return the compiled function
650
+ return factory(
651
+ bind, createCallback, functions, hasOwnProperty, isArguments, isFunction,
652
+ objectTypes, nativeKeys, propertyIsEnumerable, stringClass, toString
653
+ );
654
+ }
655
+
656
+ /**
657
+ * Used by `template` to escape characters for inclusion in compiled
658
+ * string literals.
659
+ *
660
+ * @private
661
+ * @param {String} match The matched character to escape.
662
+ * @returns {String} Returns the escaped character.
663
+ */
664
+ function escapeStringChar(match) {
665
+ return '\\' + stringEscapes[match];
666
+ }
667
+
668
+ /**
669
+ * Used by `escape` to convert characters to HTML entities.
670
+ *
671
+ * @private
672
+ * @param {String} match The matched character to escape.
673
+ * @returns {String} Returns the escaped character.
674
+ */
675
+ function escapeHtmlChar(match) {
676
+ return htmlEscapes[match];
677
+ }
678
+
679
+ /**
680
+ * A no-operation function.
681
+ *
682
+ * @private
683
+ */
684
+ function noop() {
685
+ // no operation performed
686
+ }
687
+
688
+ /**
689
+ * Used by `unescape` to convert HTML entities to characters.
690
+ *
691
+ * @private
692
+ * @param {String} match The matched character to unescape.
693
+ * @returns {String} Returns the unescaped character.
694
+ */
695
+ function unescapeHtmlChar(match) {
696
+ return htmlUnescapes[match];
697
+ }
698
+
699
+ /*--------------------------------------------------------------------------*/
700
+
701
+ /**
702
+ * Iterates over `object`'s own and inherited enumerable properties, executing
703
+ * the `callback` for each property. The `callback` is bound to `thisArg` and
704
+ * invoked with three arguments; (value, key, object). Callbacks may exit iteration
705
+ * early by explicitly returning `false`.
706
+ *
707
+ * @static
708
+ * @memberOf _
709
+ * @category Objects
710
+ * @param {Object} object The object to iterate over.
711
+ * @param {Function} callback The function called per iteration.
712
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
713
+ * @returns {Object} Returns `object`.
714
+ * @example
715
+ *
716
+ * function Dog(name) {
717
+ * this.name = name;
718
+ * }
719
+ *
720
+ * Dog.prototype.bark = function() {
721
+ * alert('Woof, woof!');
722
+ * };
723
+ *
724
+ * _.forIn(new Dog('Dagny'), function(value, key) {
725
+ * alert(key);
726
+ * });
727
+ * // => alerts 'name' and 'bark' (order is not guaranteed)
728
+ */
729
+ var forIn = createIterator(forEachIteratorOptions, forOwnIteratorOptions, {
730
+ 'useHas': false
731
+ });
732
+
733
+ /**
734
+ * Iterates over `object`'s own enumerable properties, executing the `callback`
735
+ * for each property. The `callback` is bound to `thisArg` and invoked with three
736
+ * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
737
+ * returning `false`.
738
+ *
739
+ * @static
740
+ * @memberOf _
741
+ * @category Objects
742
+ * @param {Object} object The object to iterate over.
743
+ * @param {Function} callback The function called per iteration.
744
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
745
+ * @returns {Object} Returns `object`.
746
+ * @example
747
+ *
748
+ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
749
+ * alert(key);
750
+ * });
751
+ * // => alerts '0', '1', and 'length' (order is not guaranteed)
752
+ */
753
+ var forOwn = createIterator(forEachIteratorOptions, forOwnIteratorOptions);
754
+
755
+ /**
756
+ * Checks if `value` is an `arguments` object.
757
+ *
758
+ * @static
759
+ * @memberOf _
760
+ * @category Objects
761
+ * @param {Mixed} value The value to check.
762
+ * @returns {Boolean} Returns `true` if the `value` is an `arguments` object, else `false`.
763
+ * @example
764
+ *
765
+ * (function() { return _.isArguments(arguments); })(1, 2, 3);
766
+ * // => true
767
+ *
768
+ * _.isArguments([1, 2, 3]);
769
+ * // => false
770
+ */
771
+ function isArguments(value) {
772
+ return toString.call(value) == argsClass;
773
+ }
774
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
775
+ if (noArgsClass) {
776
+ isArguments = function(value) {
777
+ return value ? hasOwnProperty.call(value, 'callee') : false;
778
+ };
779
+ }
780
+
781
+ /**
782
+ * Checks if `value` is an array.
783
+ *
784
+ * @static
785
+ * @memberOf _
786
+ * @category Objects
787
+ * @param {Mixed} value The value to check.
788
+ * @returns {Boolean} Returns `true` if the `value` is an array, else `false`.
789
+ * @example
790
+ *
791
+ * (function() { return _.isArray(arguments); })();
792
+ * // => false
793
+ *
794
+ * _.isArray([1, 2, 3]);
795
+ * // => true
796
+ */
797
+ var isArray = nativeIsArray || function(value) {
798
+ return toString.call(value) == arrayClass;
799
+ };
800
+
801
+ /**
802
+ * Checks if `value` is a function.
803
+ *
804
+ * @static
805
+ * @memberOf _
806
+ * @category Objects
807
+ * @param {Mixed} value The value to check.
808
+ * @returns {Boolean} Returns `true` if the `value` is a function, else `false`.
809
+ * @example
810
+ *
811
+ * _.isFunction(_);
812
+ * // => true
813
+ */
814
+ function isFunction(value) {
815
+ return typeof value == 'function';
816
+ }
817
+ // fallback for older versions of Chrome and Safari
818
+ if (isFunction(/x/)) {
819
+ isFunction = function(value) {
820
+ return toString.call(value) == funcClass;
821
+ };
822
+ }
823
+
824
+ /**
825
+ * Checks if a given `value` is an object created by the `Object` constructor.
826
+ *
827
+ * @static
828
+ * @memberOf _
829
+ * @category Objects
830
+ * @param {Mixed} value The value to check.
831
+ * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`.
832
+ * @example
833
+ *
834
+ * function Stooge(name, age) {
835
+ * this.name = name;
836
+ * this.age = age;
837
+ * }
838
+ *
839
+ * _.isPlainObject(new Stooge('moe', 40));
840
+ * // => false
841
+ *
842
+ * _.isPlainObject([1, 2, 3]);
843
+ * // => false
844
+ *
845
+ * _.isPlainObject({ 'name': 'moe', 'age': 40 });
846
+ * // => true
847
+ */
848
+ var isPlainObject = !getPrototypeOf ? isPlainFallback : function(value) {
849
+ if (!(value && typeof value == 'object')) {
850
+ return false;
851
+ }
852
+ var valueOf = value.valueOf,
853
+ objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
854
+
855
+ return objProto
856
+ ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value))
857
+ : isPlainFallback(value);
858
+ };
859
+
860
+ /**
861
+ * A fallback implementation of `isPlainObject` that checks if a given `value`
862
+ * is an object created by the `Object` constructor, assuming objects created
863
+ * by the `Object` constructor have no inherited enumerable properties and that
864
+ * there are no `Object.prototype` extensions.
865
+ *
866
+ * @private
867
+ * @param {Mixed} value The value to check.
868
+ * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`.
869
+ */
870
+ function isPlainFallback(value) {
871
+ // avoid non-objects and false positives for `arguments` objects
872
+ var result = false;
873
+ if (!(value && typeof value == 'object') || isArguments(value)) {
874
+ return result;
875
+ }
876
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
877
+ // methods that are `typeof` "string" and still can coerce nodes to strings.
878
+ // Also check that the constructor is `Object` (i.e. `Object instanceof Object`)
879
+ var ctor = value.constructor;
880
+ if ((!noNodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) &&
881
+ (!isFunction(ctor) || ctor instanceof ctor)) {
882
+ // IE < 9 iterates inherited properties before own properties. If the first
883
+ // iterated property is an object's own property then there are no inherited
884
+ // enumerable properties.
885
+ if (iteratesOwnLast) {
886
+ forIn(value, function(value, key, object) {
887
+ result = !hasOwnProperty.call(object, key);
888
+ return false;
889
+ });
890
+ return result === false;
891
+ }
892
+ // In most environments an object's own properties are iterated before
893
+ // its inherited properties. If the last iterated property is an object's
894
+ // own property then there are no inherited enumerable properties.
895
+ forIn(value, function(value, key) {
896
+ result = key;
897
+ });
898
+ return result === false || hasOwnProperty.call(value, result);
899
+ }
900
+ return result;
901
+ }
902
+
903
+ /**
904
+ * A shim implementation of `Object.keys` that produces an array of the given
905
+ * object's own enumerable property names.
906
+ *
907
+ * @private
908
+ * @param {Object} object The object to inspect.
909
+ * @returns {Array} Returns a new array of property names.
910
+ */
911
+ function shimKeys(object) {
912
+ var result = [];
913
+ forOwn(object, function(value, key) {
914
+ result.push(key);
915
+ });
916
+ return result;
917
+ }
918
+
919
+ /**
920
+ * Used to convert characters to HTML entities:
921
+ *
922
+ * Though the `>` character is escaped for symmetry, characters like `>` and `/`
923
+ * don't require escaping in HTML and have no special meaning unless they're part
924
+ * of a tag or an unquoted attribute value.
925
+ * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact")
926
+ */
927
+ var htmlEscapes = {
928
+ '&': '&amp;',
929
+ '<': '&lt;',
930
+ '>': '&gt;',
931
+ '"': '&quot;',
932
+ "'": '&#x27;'
933
+ };
934
+
935
+ /** Used to convert HTML entities to characters */
936
+ var htmlUnescapes = invert(htmlEscapes);
937
+
938
+ /*--------------------------------------------------------------------------*/
939
+
940
+ /**
941
+ * Creates a clone of `value`. If `deep` is `true`, all nested objects will
942
+ * also be cloned otherwise they will be assigned by reference. Functions, DOM
943
+ * nodes, `arguments` objects, and objects created by constructors other than
944
+ * `Object` are **not** cloned.
945
+ *
946
+ * @static
947
+ * @memberOf _
948
+ * @category Objects
949
+ * @param {Mixed} value The value to clone.
950
+ * @param {Boolean} deep A flag to indicate a deep clone.
951
+ * @param- {Object} [guard] Internally used to allow this method to work with
952
+ * others like `_.map` without using their callback `index` argument for `deep`.
953
+ * @param- {Array} [stackA=[]] Internally used to track traversed source objects.
954
+ * @param- {Array} [stackB=[]] Internally used to associate clones with their
955
+ * source counterparts.
956
+ * @returns {Mixed} Returns the cloned `value`.
957
+ * @example
958
+ *
959
+ * var stooges = [
960
+ * { 'name': 'moe', 'age': 40 },
961
+ * { 'name': 'larry', 'age': 50 },
962
+ * { 'name': 'curly', 'age': 60 }
963
+ * ];
964
+ *
965
+ * _.clone({ 'name': 'moe' });
966
+ * // => { 'name': 'moe' }
967
+ *
968
+ * var shallow = _.clone(stooges);
969
+ * shallow[0] === stooges[0];
970
+ * // => true
971
+ *
972
+ * var deep = _.clone(stooges, true);
973
+ * shallow[0] === stooges[0];
974
+ * // => false
975
+ */
976
+ function clone(value, deep, guard, stackA, stackB) {
977
+ if (value == null) {
978
+ return value;
979
+ }
980
+ if (guard) {
981
+ deep = false;
982
+ }
983
+ // inspect [[Class]]
984
+ var isObj = objectTypes[typeof value];
985
+ if (isObj) {
986
+ // don't clone `arguments` objects, functions, or non-object Objects
987
+ var className = toString.call(value);
988
+ if (!cloneableClasses[className] || (noArgsClass && isArguments(value))) {
989
+ return value;
990
+ }
991
+ var isArr = className == arrayClass;
992
+ isObj = isArr || (className == objectClass ? isPlainObject(value) : isObj);
993
+ }
994
+ // shallow clone
995
+ if (!isObj || !deep) {
996
+ // don't clone functions
997
+ return isObj
998
+ ? (isArr ? slice.call(value) : extend({}, value))
999
+ : value;
1000
+ }
1001
+
1002
+ var ctor = value.constructor;
1003
+ switch (className) {
1004
+ case boolClass:
1005
+ case dateClass:
1006
+ return new ctor(+value);
1007
+
1008
+ case numberClass:
1009
+ case stringClass:
1010
+ return new ctor(value);
1011
+
1012
+ case regexpClass:
1013
+ return ctor(value.source, reFlags.exec(value));
1014
+ }
1015
+ // check for circular references and return corresponding clone
1016
+ stackA || (stackA = []);
1017
+ stackB || (stackB = []);
1018
+
1019
+ var length = stackA.length;
1020
+ while (length--) {
1021
+ if (stackA[length] == value) {
1022
+ return stackB[length];
1023
+ }
1024
+ }
1025
+ // init cloned object
1026
+ var result = isArr ? ctor(value.length) : {};
1027
+
1028
+ // add the source value to the stack of traversed objects
1029
+ // and associate it with its clone
1030
+ stackA.push(value);
1031
+ stackB.push(result);
1032
+
1033
+ // recursively populate clone (susceptible to call stack limits)
1034
+ (isArr ? forEach : forOwn)(value, function(objValue, key) {
1035
+ result[key] = clone(objValue, deep, null, stackA, stackB);
1036
+ });
1037
+
1038
+ return result;
1039
+ }
1040
+
1041
+ /**
1042
+ * Assigns enumerable properties of the default object(s) to the `destination`
1043
+ * object for all `destination` properties that resolve to `null`/`undefined`.
1044
+ * Once a property is set, additional defaults of the same property will be
1045
+ * ignored.
1046
+ *
1047
+ * @static
1048
+ * @memberOf _
1049
+ * @category Objects
1050
+ * @param {Object} object The destination object.
1051
+ * @param {Object} [default1, default2, ...] The default objects.
1052
+ * @returns {Object} Returns the destination object.
1053
+ * @example
1054
+ *
1055
+ * var iceCream = { 'flavor': 'chocolate' };
1056
+ * _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
1057
+ * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
1058
+ */
1059
+ var defaults = createIterator(extendIteratorOptions, {
1060
+ 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop
1061
+ });
1062
+
1063
+ /**
1064
+ * Assigns enumerable properties of the source object(s) to the `destination`
1065
+ * object. Subsequent sources will overwrite propery assignments of previous
1066
+ * sources.
1067
+ *
1068
+ * @static
1069
+ * @memberOf _
1070
+ * @category Objects
1071
+ * @param {Object} object The destination object.
1072
+ * @param {Object} [source1, source2, ...] The source objects.
1073
+ * @returns {Object} Returns the destination object.
1074
+ * @example
1075
+ *
1076
+ * _.extend({ 'name': 'moe' }, { 'age': 40 });
1077
+ * // => { 'name': 'moe', 'age': 40 }
1078
+ */
1079
+ var extend = createIterator(extendIteratorOptions);
1080
+
1081
+ /**
1082
+ * Creates a sorted array of all enumerable properties, own and inherited,
1083
+ * of `object` that have function values.
1084
+ *
1085
+ * @static
1086
+ * @memberOf _
1087
+ * @alias methods
1088
+ * @category Objects
1089
+ * @param {Object} object The object to inspect.
1090
+ * @returns {Array} Returns a new array of property names that have function values.
1091
+ * @example
1092
+ *
1093
+ * _.functions(_);
1094
+ * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]
1095
+ */
1096
+ function functions(object) {
1097
+ var result = [];
1098
+ forIn(object, function(value, key) {
1099
+ if (isFunction(value)) {
1100
+ result.push(key);
1101
+ }
1102
+ });
1103
+ return result.sort();
1104
+ }
1105
+
1106
+ /**
1107
+ * Checks if the specified object `property` exists and is a direct property,
1108
+ * instead of an inherited property.
1109
+ *
1110
+ * @static
1111
+ * @memberOf _
1112
+ * @category Objects
1113
+ * @param {Object} object The object to check.
1114
+ * @param {String} property The property to check for.
1115
+ * @returns {Boolean} Returns `true` if key is a direct property, else `false`.
1116
+ * @example
1117
+ *
1118
+ * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
1119
+ * // => true
1120
+ */
1121
+ function has(object, property) {
1122
+ return object ? hasOwnProperty.call(object, property) : false;
1123
+ }
1124
+
1125
+ /**
1126
+ * Creates an object composed of the inverted keys and values of the given `object`.
1127
+ *
1128
+ * @static
1129
+ * @memberOf _
1130
+ * @category Objects
1131
+ * @param {Object} object The object to invert.
1132
+ * @returns {Object} Returns the created inverted object.
1133
+ * @example
1134
+ *
1135
+ * _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' });
1136
+ * // => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed)
1137
+ */
1138
+ function invert(object) {
1139
+ var result = {};
1140
+ forOwn(object, function(value, key) {
1141
+ result[value] = key;
1142
+ });
1143
+ return result;
1144
+ }
1145
+
1146
+ /**
1147
+ * Checks if `value` is a boolean (`true` or `false`) value.
1148
+ *
1149
+ * @static
1150
+ * @memberOf _
1151
+ * @category Objects
1152
+ * @param {Mixed} value The value to check.
1153
+ * @returns {Boolean} Returns `true` if the `value` is a boolean value, else `false`.
1154
+ * @example
1155
+ *
1156
+ * _.isBoolean(null);
1157
+ * // => false
1158
+ */
1159
+ function isBoolean(value) {
1160
+ return value === true || value === false || toString.call(value) == boolClass;
1161
+ }
1162
+
1163
+ /**
1164
+ * Checks if `value` is a date.
1165
+ *
1166
+ * @static
1167
+ * @memberOf _
1168
+ * @category Objects
1169
+ * @param {Mixed} value The value to check.
1170
+ * @returns {Boolean} Returns `true` if the `value` is a date, else `false`.
1171
+ * @example
1172
+ *
1173
+ * _.isDate(new Date);
1174
+ * // => true
1175
+ */
1176
+ function isDate(value) {
1177
+ return toString.call(value) == dateClass;
1178
+ }
1179
+
1180
+ /**
1181
+ * Checks if `value` is a DOM element.
1182
+ *
1183
+ * @static
1184
+ * @memberOf _
1185
+ * @category Objects
1186
+ * @param {Mixed} value The value to check.
1187
+ * @returns {Boolean} Returns `true` if the `value` is a DOM element, else `false`.
1188
+ * @example
1189
+ *
1190
+ * _.isElement(document.body);
1191
+ * // => true
1192
+ */
1193
+ function isElement(value) {
1194
+ return value ? value.nodeType === 1 : false;
1195
+ }
1196
+
1197
+ /**
1198
+ * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a
1199
+ * length of `0` and objects with no own enumerable properties are considered
1200
+ * "empty".
1201
+ *
1202
+ * @static
1203
+ * @memberOf _
1204
+ * @category Objects
1205
+ * @param {Array|Object|String} value The value to inspect.
1206
+ * @returns {Boolean} Returns `true` if the `value` is empty, else `false`.
1207
+ * @example
1208
+ *
1209
+ * _.isEmpty([1, 2, 3]);
1210
+ * // => false
1211
+ *
1212
+ * _.isEmpty({});
1213
+ * // => true
1214
+ *
1215
+ * _.isEmpty('');
1216
+ * // => true
1217
+ */
1218
+ function isEmpty(value) {
1219
+ var result = true;
1220
+ if (!value) {
1221
+ return result;
1222
+ }
1223
+ var className = toString.call(value),
1224
+ length = value.length;
1225
+
1226
+ if ((className == arrayClass || className == stringClass ||
1227
+ className == argsClass || (noArgsClass && isArguments(value))) ||
1228
+ (className == objectClass && typeof length == 'number' && isFunction(value.splice))) {
1229
+ return !length;
1230
+ }
1231
+ forOwn(value, function() {
1232
+ return (result = false);
1233
+ });
1234
+ return result;
1235
+ }
1236
+
1237
+ /**
1238
+ * Performs a deep comparison between two values to determine if they are
1239
+ * equivalent to each other.
1240
+ *
1241
+ * @static
1242
+ * @memberOf _
1243
+ * @category Objects
1244
+ * @param {Mixed} a The value to compare.
1245
+ * @param {Mixed} b The other value to compare.
1246
+ * @param- {Object} [stackA=[]] Internally used track traversed `a` objects.
1247
+ * @param- {Object} [stackB=[]] Internally used track traversed `b` objects.
1248
+ * @returns {Boolean} Returns `true` if the values are equvalent, else `false`.
1249
+ * @example
1250
+ *
1251
+ * var moe = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] };
1252
+ * var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] };
1253
+ *
1254
+ * moe == clone;
1255
+ * // => false
1256
+ *
1257
+ * _.isEqual(moe, clone);
1258
+ * // => true
1259
+ */
1260
+ function isEqual(a, b, stackA, stackB) {
1261
+ // exit early for identical values
1262
+ if (a === b) {
1263
+ // treat `+0` vs. `-0` as not equal
1264
+ return a !== 0 || (1 / a == 1 / b);
1265
+ }
1266
+ // a strict comparison is necessary because `null == undefined`
1267
+ if (a == null || b == null) {
1268
+ return a === b;
1269
+ }
1270
+ // compare [[Class]] names
1271
+ var className = toString.call(a);
1272
+ if (className != toString.call(b)) {
1273
+ return false;
1274
+ }
1275
+ switch (className) {
1276
+ case boolClass:
1277
+ case dateClass:
1278
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
1279
+ // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal
1280
+ return +a == +b;
1281
+
1282
+ case numberClass:
1283
+ // treat `NaN` vs. `NaN` as equal
1284
+ return a != +a
1285
+ ? b != +b
1286
+ // but treat `+0` vs. `-0` as not equal
1287
+ : (a == 0 ? (1 / a == 1 / b) : a == +b);
1288
+
1289
+ case regexpClass:
1290
+ case stringClass:
1291
+ // coerce regexes to strings (http://es5.github.com/#x15.10.6.4)
1292
+ // treat string primitives and their corresponding object instances as equal
1293
+ return a == b + '';
1294
+ }
1295
+ // exit early, in older browsers, if `a` is array-like but not `b`
1296
+ var isArr = className == arrayClass || className == argsClass;
1297
+ if (noArgsClass && !isArr && (isArr = isArguments(a)) && !isArguments(b)) {
1298
+ return false;
1299
+ }
1300
+ if (!isArr) {
1301
+ // unwrap any `lodash` wrapped values
1302
+ if (a.__wrapped__ || b.__wrapped__) {
1303
+ return isEqual(a.__wrapped__ || a, b.__wrapped__ || b);
1304
+ }
1305
+ // exit for functions and DOM nodes
1306
+ if (className != objectClass || (noNodeClass && (
1307
+ (typeof a.toString != 'function' && typeof (a + '') == 'string') ||
1308
+ (typeof b.toString != 'function' && typeof (b + '') == 'string')))) {
1309
+ return false;
1310
+ }
1311
+ var ctorA = a.constructor,
1312
+ ctorB = b.constructor;
1313
+
1314
+ // non `Object` object instances with different constructors are not equal
1315
+ if (ctorA != ctorB && !(
1316
+ isFunction(ctorA) && ctorA instanceof ctorA &&
1317
+ isFunction(ctorB) && ctorB instanceof ctorB
1318
+ )) {
1319
+ return false;
1320
+ }
1321
+ }
1322
+ // assume cyclic structures are equal
1323
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
1324
+ // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3)
1325
+ stackA || (stackA = []);
1326
+ stackB || (stackB = []);
1327
+
1328
+ var length = stackA.length;
1329
+ while (length--) {
1330
+ if (stackA[length] == a) {
1331
+ return stackB[length] == b;
1332
+ }
1333
+ }
1334
+
1335
+ var index = -1,
1336
+ result = true,
1337
+ size = 0;
1338
+
1339
+ // add `a` and `b` to the stack of traversed objects
1340
+ stackA.push(a);
1341
+ stackB.push(b);
1342
+
1343
+ // recursively compare objects and arrays (susceptible to call stack limits)
1344
+ if (isArr) {
1345
+ // compare lengths to determine if a deep comparison is necessary
1346
+ size = a.length;
1347
+ result = size == b.length;
1348
+
1349
+ if (result) {
1350
+ // deep compare the contents, ignoring non-numeric properties
1351
+ while (size--) {
1352
+ if (!(result = isEqual(a[size], b[size], stackA, stackB))) {
1353
+ break;
1354
+ }
1355
+ }
1356
+ }
1357
+ return result;
1358
+ }
1359
+ // deep compare objects
1360
+ for (var prop in a) {
1361
+ if (hasOwnProperty.call(a, prop)) {
1362
+ // count the number of properties.
1363
+ size++;
1364
+ // deep compare each property value.
1365
+ if (!(hasOwnProperty.call(b, prop) && isEqual(a[prop], b[prop], stackA, stackB))) {
1366
+ return false;
1367
+ }
1368
+ }
1369
+ }
1370
+ // ensure both objects have the same number of properties
1371
+ for (prop in b) {
1372
+ // The JS engine in Adobe products, like InDesign, has a bug that causes
1373
+ // `!size--` to throw an error so it must be wrapped in parentheses.
1374
+ // https://github.com/documentcloud/underscore/issues/355
1375
+ if (hasOwnProperty.call(b, prop) && !(size--)) {
1376
+ // `size` will be `-1` if `b` has more properties than `a`
1377
+ return false;
1378
+ }
1379
+ }
1380
+ // handle JScript [[DontEnum]] bug
1381
+ if (hasDontEnumBug) {
1382
+ while (++index < 7) {
1383
+ prop = shadowed[index];
1384
+ if (hasOwnProperty.call(a, prop) &&
1385
+ !(hasOwnProperty.call(b, prop) && isEqual(a[prop], b[prop], stackA, stackB))) {
1386
+ return false;
1387
+ }
1388
+ }
1389
+ }
1390
+ return true;
1391
+ }
1392
+
1393
+ /**
1394
+ * Checks if `value` is a finite number.
1395
+ *
1396
+ * Note: This is not the same as native `isFinite`, which will return true for
1397
+ * booleans and other values. See http://es5.github.com/#x15.1.2.5.
1398
+ *
1399
+ * @deprecated
1400
+ * @static
1401
+ * @memberOf _
1402
+ * @category Objects
1403
+ * @param {Mixed} value The value to check.
1404
+ * @returns {Boolean} Returns `true` if the `value` is a finite number, else `false`.
1405
+ * @example
1406
+ *
1407
+ * _.isFinite(-101);
1408
+ * // => true
1409
+ *
1410
+ * _.isFinite('10');
1411
+ * // => false
1412
+ *
1413
+ * _.isFinite(Infinity);
1414
+ * // => false
1415
+ */
1416
+ function isFinite(value) {
1417
+ return nativeIsFinite(value) && toString.call(value) == numberClass;
1418
+ }
1419
+
1420
+ /**
1421
+ * Checks if `value` is the language type of Object.
1422
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1423
+ *
1424
+ * @static
1425
+ * @memberOf _
1426
+ * @category Objects
1427
+ * @param {Mixed} value The value to check.
1428
+ * @returns {Boolean} Returns `true` if the `value` is an object, else `false`.
1429
+ * @example
1430
+ *
1431
+ * _.isObject({});
1432
+ * // => true
1433
+ *
1434
+ * _.isObject([1, 2, 3]);
1435
+ * // => true
1436
+ *
1437
+ * _.isObject(1);
1438
+ * // => false
1439
+ */
1440
+ function isObject(value) {
1441
+ // check if the value is the ECMAScript language type of Object
1442
+ // http://es5.github.com/#x8
1443
+ // and avoid a V8 bug
1444
+ // http://code.google.com/p/v8/issues/detail?id=2291
1445
+ return value ? objectTypes[typeof value] : false;
1446
+ }
1447
+
1448
+ /**
1449
+ * Checks if `value` is `NaN`.
1450
+ *
1451
+ * Note: This is not the same as native `isNaN`, which will return true for
1452
+ * `undefined` and other values. See http://es5.github.com/#x15.1.2.4.
1453
+ *
1454
+ * @deprecated
1455
+ * @static
1456
+ * @memberOf _
1457
+ * @category Objects
1458
+ * @param {Mixed} value The value to check.
1459
+ * @returns {Boolean} Returns `true` if the `value` is `NaN`, else `false`.
1460
+ * @example
1461
+ *
1462
+ * _.isNaN(NaN);
1463
+ * // => true
1464
+ *
1465
+ * _.isNaN(new Number(NaN));
1466
+ * // => true
1467
+ *
1468
+ * isNaN(undefined);
1469
+ * // => true
1470
+ *
1471
+ * _.isNaN(undefined);
1472
+ * // => false
1473
+ */
1474
+ function isNaN(value) {
1475
+ // `NaN` as a primitive is the only value that is not equal to itself
1476
+ // (perform the [[Class]] check first to avoid errors with some host objects in IE)
1477
+ return toString.call(value) == numberClass && value != +value
1478
+ }
1479
+
1480
+ /**
1481
+ * Checks if `value` is `null`.
1482
+ *
1483
+ * @deprecated
1484
+ * @static
1485
+ * @memberOf _
1486
+ * @category Objects
1487
+ * @param {Mixed} value The value to check.
1488
+ * @returns {Boolean} Returns `true` if the `value` is `null`, else `false`.
1489
+ * @example
1490
+ *
1491
+ * _.isNull(null);
1492
+ * // => true
1493
+ *
1494
+ * _.isNull(undefined);
1495
+ * // => false
1496
+ */
1497
+ function isNull(value) {
1498
+ return value === null;
1499
+ }
1500
+
1501
+ /**
1502
+ * Checks if `value` is a number.
1503
+ *
1504
+ * @static
1505
+ * @memberOf _
1506
+ * @category Objects
1507
+ * @param {Mixed} value The value to check.
1508
+ * @returns {Boolean} Returns `true` if the `value` is a number, else `false`.
1509
+ * @example
1510
+ *
1511
+ * _.isNumber(8.4 * 5);
1512
+ * // => true
1513
+ */
1514
+ function isNumber(value) {
1515
+ return toString.call(value) == numberClass;
1516
+ }
1517
+
1518
+ /**
1519
+ * Checks if `value` is a regular expression.
1520
+ *
1521
+ * @static
1522
+ * @memberOf _
1523
+ * @category Objects
1524
+ * @param {Mixed} value The value to check.
1525
+ * @returns {Boolean} Returns `true` if the `value` is a regular expression, else `false`.
1526
+ * @example
1527
+ *
1528
+ * _.isRegExp(/moe/);
1529
+ * // => true
1530
+ */
1531
+ function isRegExp(value) {
1532
+ return toString.call(value) == regexpClass;
1533
+ }
1534
+
1535
+ /**
1536
+ * Checks if `value` is a string.
1537
+ *
1538
+ * @static
1539
+ * @memberOf _
1540
+ * @category Objects
1541
+ * @param {Mixed} value The value to check.
1542
+ * @returns {Boolean} Returns `true` if the `value` is a string, else `false`.
1543
+ * @example
1544
+ *
1545
+ * _.isString('moe');
1546
+ * // => true
1547
+ */
1548
+ function isString(value) {
1549
+ return toString.call(value) == stringClass;
1550
+ }
1551
+
1552
+ /**
1553
+ * Checks if `value` is `undefined`.
1554
+ *
1555
+ * @deprecated
1556
+ * @static
1557
+ * @memberOf _
1558
+ * @category Objects
1559
+ * @param {Mixed} value The value to check.
1560
+ * @returns {Boolean} Returns `true` if the `value` is `undefined`, else `false`.
1561
+ * @example
1562
+ *
1563
+ * _.isUndefined(void 0);
1564
+ * // => true
1565
+ */
1566
+ function isUndefined(value) {
1567
+ return value === undefined;
1568
+ }
1569
+
1570
+ /**
1571
+ * Creates an array composed of the own enumerable property names of `object`.
1572
+ *
1573
+ * @static
1574
+ * @memberOf _
1575
+ * @category Objects
1576
+ * @param {Object} object The object to inspect.
1577
+ * @returns {Array} Returns a new array of property names.
1578
+ * @example
1579
+ *
1580
+ * _.keys({ 'one': 1, 'two': 2, 'three': 3 });
1581
+ * // => ['one', 'two', 'three'] (order is not guaranteed)
1582
+ */
1583
+ var keys = !nativeKeys ? shimKeys : function(object) {
1584
+ var type = typeof object;
1585
+
1586
+ // avoid iterating over the `prototype` property
1587
+ if (type == 'function' && propertyIsEnumerable.call(object, 'prototype')) {
1588
+ return shimKeys(object);
1589
+ }
1590
+ return object && objectTypes[type]
1591
+ ? nativeKeys(object)
1592
+ : [];
1593
+ };
1594
+
1595
+ /**
1596
+ * Merges enumerable properties of the source object(s) into the `destination`
1597
+ * object. Subsequent sources will overwrite propery assignments of previous
1598
+ * sources.
1599
+ *
1600
+ * @static
1601
+ * @memberOf _
1602
+ * @category Objects
1603
+ * @param {Object} object The destination object.
1604
+ * @param {Object} [source1, source2, ...] The source objects.
1605
+ * @param- {Object} [indicator] Internally used to indicate that the `stack`
1606
+ * argument is an array of traversed objects instead of another source object.
1607
+ * @param- {Array} [stackA=[]] Internally used to track traversed source objects.
1608
+ * @param- {Array} [stackB=[]] Internally used to associate values with their
1609
+ * source counterparts.
1610
+ * @returns {Object} Returns the destination object.
1611
+ * @example
1612
+ *
1613
+ * var stooges = [
1614
+ * { 'name': 'moe' },
1615
+ * { 'name': 'larry' }
1616
+ * ];
1617
+ *
1618
+ * var ages = [
1619
+ * { 'age': 40 },
1620
+ * { 'age': 50 }
1621
+ * ];
1622
+ *
1623
+ * _.merge(stooges, ages);
1624
+ * // => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }]
1625
+ */
1626
+ function merge(object, source, indicator) {
1627
+ var args = arguments,
1628
+ index = 0,
1629
+ length = 2,
1630
+ stackA = args[3],
1631
+ stackB = args[4];
1632
+
1633
+ if (indicator != compareAscending) {
1634
+ stackA = [];
1635
+ stackB = [];
1636
+ length = args.length;
1637
+ }
1638
+ while (++index < length) {
1639
+ forOwn(args[index], function(source, key) {
1640
+ var found, isArr, value;
1641
+ if (source && ((isArr = isArray(source)) || isPlainObject(source))) {
1642
+ // avoid merging previously merged cyclic sources
1643
+ var stackLength = stackA.length;
1644
+ while (stackLength--) {
1645
+ found = stackA[stackLength] == source;
1646
+ if (found) {
1647
+ break;
1648
+ }
1649
+ }
1650
+ if (found) {
1651
+ object[key] = stackB[stackLength];
1652
+ }
1653
+ else {
1654
+ // add `source` and associated `value` to the stack of traversed objects
1655
+ stackA.push(source);
1656
+ stackB.push(value = (value = object[key], isArr)
1657
+ ? (isArray(value) ? value : [])
1658
+ : (isPlainObject(value) ? value : {})
1659
+ );
1660
+ // recursively merge objects and arrays (susceptible to call stack limits)
1661
+ object[key] = merge(value, source, compareAscending, stackA, stackB);
1662
+ }
1663
+ } else if (source != null) {
1664
+ object[key] = source;
1665
+ }
1666
+ });
1667
+ }
1668
+ return object;
1669
+ }
1670
+
1671
+ /**
1672
+ * Creates a shallow clone of `object` excluding the specified properties.
1673
+ * Property names may be specified as individual arguments or as arrays of
1674
+ * property names. If `callback` is passed, it will be executed for each property
1675
+ * in the `object`, omitting the properties `callback` returns truthy for. The
1676
+ * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object).
1677
+ *
1678
+ * @static
1679
+ * @memberOf _
1680
+ * @category Objects
1681
+ * @param {Object} object The source object.
1682
+ * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit
1683
+ * or the function called per iteration.
1684
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1685
+ * @returns {Object} Returns an object without the omitted properties.
1686
+ * @example
1687
+ *
1688
+ * _.omit({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid');
1689
+ * // => { 'name': 'moe', 'age': 40 }
1690
+ *
1691
+ * _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) {
1692
+ * return key.charAt(0) == '_';
1693
+ * });
1694
+ * // => { 'name': 'moe' }
1695
+ */
1696
+ function omit(object, callback, thisArg) {
1697
+ var isFunc = typeof callback == 'function',
1698
+ result = {};
1699
+
1700
+ if (isFunc) {
1701
+ callback = createCallback(callback, thisArg);
1702
+ } else {
1703
+ var props = concat.apply(ArrayProto, arguments);
1704
+ }
1705
+ forIn(object, function(value, key, object) {
1706
+ if (isFunc
1707
+ ? !callback(value, key, object)
1708
+ : indexOf(props, key, 1) < 0
1709
+ ) {
1710
+ result[key] = value;
1711
+ }
1712
+ });
1713
+ return result;
1714
+ }
1715
+
1716
+ /**
1717
+ * Creates a two dimensional array of the given object's key-value pairs,
1718
+ * i.e. `[[key1, value1], [key2, value2]]`.
1719
+ *
1720
+ * @static
1721
+ * @memberOf _
1722
+ * @category Objects
1723
+ * @param {Object} object The object to inspect.
1724
+ * @returns {Array} Returns new array of key-value pairs.
1725
+ * @example
1726
+ *
1727
+ * _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 });
1728
+ * // => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed)
1729
+ */
1730
+ function pairs(object) {
1731
+ var result = [];
1732
+ forOwn(object, function(value, key) {
1733
+ result.push([key, value]);
1734
+ });
1735
+ return result;
1736
+ }
1737
+
1738
+ /**
1739
+ * Creates a shallow clone of `object` composed of the specified properties.
1740
+ * Property names may be specified as individual arguments or as arrays of
1741
+ * property names. If `callback` is passed, it will be executed for each property
1742
+ * in the `object`, picking the properties `callback` returns truthy for. The
1743
+ * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object).
1744
+ *
1745
+ * @static
1746
+ * @memberOf _
1747
+ * @category Objects
1748
+ * @param {Object} object The source object.
1749
+ * @param {Function|String} callback|[prop1, prop2, ...] The properties to pick
1750
+ * or the function called per iteration.
1751
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1752
+ * @returns {Object} Returns an object composed of the picked properties.
1753
+ * @example
1754
+ *
1755
+ * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age');
1756
+ * // => { 'name': 'moe', 'age': 40 }
1757
+ *
1758
+ * _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) {
1759
+ * return key.charAt(0) != '_';
1760
+ * });
1761
+ * // => { 'name': 'moe' }
1762
+ */
1763
+ function pick(object, callback, thisArg) {
1764
+ var result = {};
1765
+ if (typeof callback != 'function') {
1766
+ var index = 0,
1767
+ props = concat.apply(ArrayProto, arguments),
1768
+ length = props.length;
1769
+
1770
+ while (++index < length) {
1771
+ var prop = props[index];
1772
+ if (prop in object) {
1773
+ result[prop] = object[prop];
1774
+ }
1775
+ }
1776
+ } else {
1777
+ callback = createCallback(callback, thisArg);
1778
+ forIn(object, function(value, key, object) {
1779
+ if (callback(value, key, object)) {
1780
+ result[key] = value;
1781
+ }
1782
+ });
1783
+ }
1784
+ return result;
1785
+ }
1786
+
1787
+ /**
1788
+ * Creates an array composed of the own enumerable property values of `object`.
1789
+ *
1790
+ * @static
1791
+ * @memberOf _
1792
+ * @category Objects
1793
+ * @param {Object} object The object to inspect.
1794
+ * @returns {Array} Returns a new array of property values.
1795
+ * @example
1796
+ *
1797
+ * _.values({ 'one': 1, 'two': 2, 'three': 3 });
1798
+ * // => [1, 2, 3]
1799
+ */
1800
+ function values(object) {
1801
+ var result = [];
1802
+ forOwn(object, function(value) {
1803
+ result.push(value);
1804
+ });
1805
+ return result;
1806
+ }
1807
+
1808
+ /*--------------------------------------------------------------------------*/
1809
+
1810
+ /**
1811
+ * Checks if a given `target` element is present in a `collection` using strict
1812
+ * equality for comparisons, i.e. `===`.
1813
+ *
1814
+ * @static
1815
+ * @memberOf _
1816
+ * @alias include
1817
+ * @category Collections
1818
+ * @param {Array|Object|String} collection The collection to iterate over.
1819
+ * @param {Mixed} target The value to check for.
1820
+ * @returns {Boolean} Returns `true` if the `target` element is found, else `false`.
1821
+ * @example
1822
+ *
1823
+ * _.contains([1, 2, 3], 3);
1824
+ * // => true
1825
+ *
1826
+ * _.contains({ 'name': 'moe', 'age': 40 }, 'moe');
1827
+ * // => true
1828
+ *
1829
+ * _.contains('curly', 'ur');
1830
+ * // => true
1831
+ */
1832
+ function contains(collection, target) {
1833
+ var length = collection ? collection.length : 0;
1834
+ if (typeof length == 'number') {
1835
+ return (toString.call(collection) == stringClass
1836
+ ? collection.indexOf(target)
1837
+ : indexOf(collection, target)
1838
+ ) > -1;
1839
+ }
1840
+ return some(collection, function(value) {
1841
+ return value === target;
1842
+ });
1843
+ }
1844
+
1845
+ /**
1846
+ * Creates an object composed of keys returned from running each element of
1847
+ * `collection` through a `callback`. The corresponding value of each key is
1848
+ * the number of times the key was returned by `callback`. The `callback` is
1849
+ * bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
1850
+ * The `callback` argument may also be the name of a property to count by (e.g. 'length').
1851
+ *
1852
+ * @static
1853
+ * @memberOf _
1854
+ * @category Collections
1855
+ * @param {Array|Object|String} collection The collection to iterate over.
1856
+ * @param {Function|String} callback|property The function called per iteration
1857
+ * or property name to count by.
1858
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1859
+ * @returns {Object} Returns the composed aggregate object.
1860
+ * @example
1861
+ *
1862
+ * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); });
1863
+ * // => { '4': 1, '6': 2 }
1864
+ *
1865
+ * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
1866
+ * // => { '4': 1, '6': 2 }
1867
+ *
1868
+ * _.countBy(['one', 'two', 'three'], 'length');
1869
+ * // => { '3': 2, '5': 1 }
1870
+ */
1871
+ function countBy(collection, callback, thisArg) {
1872
+ var result = {};
1873
+ callback = createCallback(callback, thisArg);
1874
+ forEach(collection, function(value, key, collection) {
1875
+ key = callback(value, key, collection);
1876
+ (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
1877
+ });
1878
+ return result;
1879
+ }
1880
+
1881
+ /**
1882
+ * Checks if the `callback` returns a truthy value for **all** elements of a
1883
+ * `collection`. The `callback` is bound to `thisArg` and invoked with three
1884
+ * arguments; (value, index|key, collection).
1885
+ *
1886
+ * @static
1887
+ * @memberOf _
1888
+ * @alias all
1889
+ * @category Collections
1890
+ * @param {Array|Object|String} collection The collection to iterate over.
1891
+ * @param {Function} [callback=identity] The function called per iteration.
1892
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1893
+ * @returns {Boolean} Returns `true` if all elements pass the callback check,
1894
+ * else `false`.
1895
+ * @example
1896
+ *
1897
+ * _.every([true, 1, null, 'yes'], Boolean);
1898
+ * // => false
1899
+ */
1900
+ function every(collection, callback, thisArg) {
1901
+ var result = true;
1902
+ callback = createCallback(callback, thisArg);
1903
+ forEach(collection, function(value, index, collection) {
1904
+ return (result = callback(value, index, collection));
1905
+ });
1906
+ return !!result;
1907
+ }
1908
+
1909
+ /**
1910
+ * Examines each element in a `collection`, returning an array of all elements
1911
+ * the `callback` returns truthy for. The `callback` is bound to `thisArg` and
1912
+ * invoked with three arguments; (value, index|key, collection).
1913
+ *
1914
+ * @static
1915
+ * @memberOf _
1916
+ * @alias select
1917
+ * @category Collections
1918
+ * @param {Array|Object|String} collection The collection to iterate over.
1919
+ * @param {Function} [callback=identity] The function called per iteration.
1920
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1921
+ * @returns {Array} Returns a new array of elements that passed the callback check.
1922
+ * @example
1923
+ *
1924
+ * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
1925
+ * // => [2, 4, 6]
1926
+ */
1927
+ function filter(collection, callback, thisArg) {
1928
+ var result = [];
1929
+ callback = createCallback(callback, thisArg);
1930
+ forEach(collection, function(value, index, collection) {
1931
+ if (callback(value, index, collection)) {
1932
+ result.push(value);
1933
+ }
1934
+ });
1935
+ return result;
1936
+ }
1937
+
1938
+ /**
1939
+ * Examines each element in a `collection`, returning the first one the `callback`
1940
+ * returns truthy for. The function returns as soon as it finds an acceptable
1941
+ * element, and does not iterate over the entire `collection`. The `callback` is
1942
+ * bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
1943
+ *
1944
+ * @static
1945
+ * @memberOf _
1946
+ * @alias detect
1947
+ * @category Collections
1948
+ * @param {Array|Object|String} collection The collection to iterate over.
1949
+ * @param {Function} callback The function called per iteration.
1950
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1951
+ * @returns {Mixed} Returns the element that passed the callback check,
1952
+ * else `undefined`.
1953
+ * @example
1954
+ *
1955
+ * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
1956
+ * // => 2
1957
+ */
1958
+ function find(collection, callback, thisArg) {
1959
+ var result;
1960
+ callback = createCallback(callback, thisArg);
1961
+ some(collection, function(value, index, collection) {
1962
+ return callback(value, index, collection) && (result = value, true);
1963
+ });
1964
+ return result;
1965
+ }
1966
+
1967
+ /**
1968
+ * Iterates over a `collection`, executing the `callback` for each element in
1969
+ * the `collection`. The `callback` is bound to `thisArg` and invoked with three
1970
+ * arguments; (value, index|key, collection). Callbacks may exit iteration early
1971
+ * by explicitly returning `false`.
1972
+ *
1973
+ * @static
1974
+ * @memberOf _
1975
+ * @alias each
1976
+ * @category Collections
1977
+ * @param {Array|Object|String} collection The collection to iterate over.
1978
+ * @param {Function} callback The function called per iteration.
1979
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
1980
+ * @returns {Array|Object|String} Returns `collection`.
1981
+ * @example
1982
+ *
1983
+ * _([1, 2, 3]).forEach(alert).join(',');
1984
+ * // => alerts each number and returns '1,2,3'
1985
+ *
1986
+ * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert);
1987
+ * // => alerts each number (order is not guaranteed)
1988
+ */
1989
+ var forEach = createIterator(forEachIteratorOptions);
1990
+
1991
+ /**
1992
+ * Creates an object composed of keys returned from running each element of
1993
+ * `collection` through a `callback`. The corresponding value of each key is an
1994
+ * array of elements passed to `callback` that returned the key. The `callback`
1995
+ * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
1996
+ * The `callback` argument may also be the name of a property to count by (e.g. 'length').
1997
+ *
1998
+ * @static
1999
+ * @memberOf _
2000
+ * @category Collections
2001
+ * @param {Array|Object|String} collection The collection to iterate over.
2002
+ * @param {Function|String} callback|property The function called per iteration
2003
+ * or property name to group by.
2004
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2005
+ * @returns {Object} Returns the composed aggregate object.
2006
+ * @example
2007
+ *
2008
+ * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); });
2009
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
2010
+ *
2011
+ * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
2012
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
2013
+ *
2014
+ * _.groupBy(['one', 'two', 'three'], 'length');
2015
+ * // => { '3': ['one', 'two'], '5': ['three'] }
2016
+ */
2017
+ function groupBy(collection, callback, thisArg) {
2018
+ var result = {};
2019
+ callback = createCallback(callback, thisArg);
2020
+ forEach(collection, function(value, key, collection) {
2021
+ key = callback(value, key, collection);
2022
+ (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
2023
+ });
2024
+ return result;
2025
+ }
2026
+
2027
+ /**
2028
+ * Invokes the method named by `methodName` on each element in the `collection`,
2029
+ * returning an array of the results of each invoked method. Additional arguments
2030
+ * will be passed to each invoked method. If `methodName` is a function it will
2031
+ * be invoked for, and `this` bound to, each element in the `collection`.
2032
+ *
2033
+ * @static
2034
+ * @memberOf _
2035
+ * @category Collections
2036
+ * @param {Array|Object|String} collection The collection to iterate over.
2037
+ * @param {Function|String} methodName The name of the method to invoke or
2038
+ * the function invoked per iteration.
2039
+ * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with.
2040
+ * @returns {Array} Returns a new array of the results of each invoked method.
2041
+ * @example
2042
+ *
2043
+ * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
2044
+ * // => [[1, 5, 7], [1, 2, 3]]
2045
+ *
2046
+ * _.invoke([123, 456], String.prototype.split, '');
2047
+ * // => [['1', '2', '3'], ['4', '5', '6']]
2048
+ */
2049
+ function invoke(collection, methodName) {
2050
+ var args = slice.call(arguments, 2),
2051
+ isFunc = typeof methodName == 'function',
2052
+ result = [];
2053
+
2054
+ forEach(collection, function(value) {
2055
+ result.push((isFunc ? methodName : value[methodName]).apply(value, args));
2056
+ });
2057
+ return result;
2058
+ }
2059
+
2060
+ /**
2061
+ * Creates an array of values by running each element in the `collection`
2062
+ * through a `callback`. The `callback` is bound to `thisArg` and invoked with
2063
+ * three arguments; (value, index|key, collection).
2064
+ *
2065
+ * @static
2066
+ * @memberOf _
2067
+ * @alias collect
2068
+ * @category Collections
2069
+ * @param {Array|Object|String} collection The collection to iterate over.
2070
+ * @param {Function} [callback=identity] The function called per iteration.
2071
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2072
+ * @returns {Array} Returns a new array of the results of each `callback` execution.
2073
+ * @example
2074
+ *
2075
+ * _.map([1, 2, 3], function(num) { return num * 3; });
2076
+ * // => [3, 6, 9]
2077
+ *
2078
+ * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
2079
+ * // => [3, 6, 9] (order is not guaranteed)
2080
+ */
2081
+ function map(collection, callback, thisArg) {
2082
+ var index = -1,
2083
+ length = collection ? collection.length : 0,
2084
+ result = Array(length);
2085
+
2086
+ callback = createCallback(callback, thisArg);
2087
+ if (isArray(collection)) {
2088
+ while (++index < length) {
2089
+ result[index] = callback(collection[index], index, collection);
2090
+ }
2091
+ } else {
2092
+ forEach(collection, function(value, key, collection) {
2093
+ result[++index] = callback(value, key, collection);
2094
+ });
2095
+ }
2096
+ return result;
2097
+ }
2098
+
2099
+ /**
2100
+ * Retrieves the maximum value of an `array`. If `callback` is passed,
2101
+ * it will be executed for each value in the `array` to generate the
2102
+ * criterion by which the value is ranked. The `callback` is bound to
2103
+ * `thisArg` and invoked with three arguments; (value, index, collection).
2104
+ *
2105
+ * @static
2106
+ * @memberOf _
2107
+ * @category Collections
2108
+ * @param {Array} collection The collection to iterate over.
2109
+ * @param {Function} [callback] The function called per iteration.
2110
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2111
+ * @returns {Mixed} Returns the maximum value.
2112
+ * @example
2113
+ *
2114
+ * var stooges = [
2115
+ * { 'name': 'moe', 'age': 40 },
2116
+ * { 'name': 'larry', 'age': 50 },
2117
+ * { 'name': 'curly', 'age': 60 }
2118
+ * ];
2119
+ *
2120
+ * _.max(stooges, function(stooge) { return stooge.age; });
2121
+ * // => { 'name': 'curly', 'age': 60 };
2122
+ */
2123
+ function max(collection, callback, thisArg) {
2124
+ var computed = -Infinity,
2125
+ index = -1,
2126
+ length = collection ? collection.length : 0,
2127
+ result = computed;
2128
+
2129
+ if (callback || length !== +length) {
2130
+ callback = createCallback(callback, thisArg);
2131
+ forEach(collection, function(value, index, collection) {
2132
+ var current = callback(value, index, collection);
2133
+ if (current > computed) {
2134
+ computed = current;
2135
+ result = value;
2136
+ }
2137
+ });
2138
+ } else {
2139
+ while (++index < length) {
2140
+ if (collection[index] > result) {
2141
+ result = collection[index];
2142
+ }
2143
+ }
2144
+ }
2145
+ return result;
2146
+ }
2147
+
2148
+ /**
2149
+ * Retrieves the minimum value of an `array`. If `callback` is passed,
2150
+ * it will be executed for each value in the `array` to generate the
2151
+ * criterion by which the value is ranked. The `callback` is bound to `thisArg`
2152
+ * and invoked with three arguments; (value, index, collection).
2153
+ *
2154
+ * @static
2155
+ * @memberOf _
2156
+ * @category Collections
2157
+ * @param {Array} collection The collection to iterate over.
2158
+ * @param {Function} [callback] The function called per iteration.
2159
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2160
+ * @returns {Mixed} Returns the minimum value.
2161
+ * @example
2162
+ *
2163
+ * _.min([10, 5, 100, 2, 1000]);
2164
+ * // => 2
2165
+ */
2166
+ function min(collection, callback, thisArg) {
2167
+ var computed = Infinity,
2168
+ index = -1,
2169
+ length = collection ? collection.length : 0,
2170
+ result = computed;
2171
+
2172
+ if (callback || length !== +length) {
2173
+ callback = createCallback(callback, thisArg);
2174
+ forEach(collection, function(value, index, collection) {
2175
+ var current = callback(value, index, collection);
2176
+ if (current < computed) {
2177
+ computed = current;
2178
+ result = value;
2179
+ }
2180
+ });
2181
+ } else {
2182
+ while (++index < length) {
2183
+ if (collection[index] < result) {
2184
+ result = collection[index];
2185
+ }
2186
+ }
2187
+ }
2188
+ return result;
2189
+ }
2190
+
2191
+ /**
2192
+ * Retrieves the value of a specified property from all elements in
2193
+ * the `collection`.
2194
+ *
2195
+ * @static
2196
+ * @memberOf _
2197
+ * @category Collections
2198
+ * @param {Array|Object|String} collection The collection to iterate over.
2199
+ * @param {String} property The property to pluck.
2200
+ * @returns {Array} Returns a new array of property values.
2201
+ * @example
2202
+ *
2203
+ * var stooges = [
2204
+ * { 'name': 'moe', 'age': 40 },
2205
+ * { 'name': 'larry', 'age': 50 },
2206
+ * { 'name': 'curly', 'age': 60 }
2207
+ * ];
2208
+ *
2209
+ * _.pluck(stooges, 'name');
2210
+ * // => ['moe', 'larry', 'curly']
2211
+ */
2212
+ function pluck(collection, property) {
2213
+ var result = [];
2214
+ forEach(collection, function(value) {
2215
+ result.push(value[property]);
2216
+ });
2217
+ return result;
2218
+ }
2219
+
2220
+ /**
2221
+ * Boils down a `collection` to a single value. The initial state of the
2222
+ * reduction is `accumulator` and each successive step of it should be returned
2223
+ * by the `callback`. The `callback` is bound to `thisArg` and invoked with 4
2224
+ * arguments; for arrays they are (accumulator, value, index|key, collection).
2225
+ *
2226
+ * @static
2227
+ * @memberOf _
2228
+ * @alias foldl, inject
2229
+ * @category Collections
2230
+ * @param {Array|Object|String} collection The collection to iterate over.
2231
+ * @param {Function} callback The function called per iteration.
2232
+ * @param {Mixed} [accumulator] Initial value of the accumulator.
2233
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2234
+ * @returns {Mixed} Returns the accumulated value.
2235
+ * @example
2236
+ *
2237
+ * var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; });
2238
+ * // => 6
2239
+ */
2240
+ function reduce(collection, callback, accumulator, thisArg) {
2241
+ var noaccum = arguments.length < 3;
2242
+ callback = createCallback(callback, thisArg);
2243
+ forEach(collection, function(value, index, collection) {
2244
+ accumulator = noaccum
2245
+ ? (noaccum = false, value)
2246
+ : callback(accumulator, value, index, collection)
2247
+ });
2248
+ return accumulator;
2249
+ }
2250
+
2251
+ /**
2252
+ * The right-associative version of `_.reduce`.
2253
+ *
2254
+ * @static
2255
+ * @memberOf _
2256
+ * @alias foldr
2257
+ * @category Collections
2258
+ * @param {Array|Object|String} collection The collection to iterate over.
2259
+ * @param {Function} callback The function called per iteration.
2260
+ * @param {Mixed} [accumulator] Initial value of the accumulator.
2261
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2262
+ * @returns {Mixed} Returns the accumulated value.
2263
+ * @example
2264
+ *
2265
+ * var list = [[0, 1], [2, 3], [4, 5]];
2266
+ * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
2267
+ * // => [4, 5, 2, 3, 0, 1]
2268
+ */
2269
+ function reduceRight(collection, callback, accumulator, thisArg) {
2270
+ var iteratee = collection,
2271
+ length = collection ? collection.length : 0,
2272
+ noaccum = arguments.length < 3;
2273
+
2274
+ if (length !== +length) {
2275
+ var props = keys(collection);
2276
+ length = props.length;
2277
+ } else if (noCharByIndex && toString.call(collection) == stringClass) {
2278
+ iteratee = collection.split('');
2279
+ }
2280
+ forEach(collection, function(value, index, object) {
2281
+ index = props ? props[--length] : --length;
2282
+ accumulator = noaccum
2283
+ ? (noaccum = false, iteratee[index])
2284
+ : callback.call(thisArg, accumulator, iteratee[index], index, object);
2285
+ });
2286
+ return accumulator;
2287
+ }
2288
+
2289
+ /**
2290
+ * The opposite of `_.filter`, this method returns the values of a
2291
+ * `collection` that `callback` does **not** return truthy for.
2292
+ *
2293
+ * @static
2294
+ * @memberOf _
2295
+ * @category Collections
2296
+ * @param {Array|Object|String} collection The collection to iterate over.
2297
+ * @param {Function} [callback=identity] The function called per iteration.
2298
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2299
+ * @returns {Array} Returns a new array of elements that did **not** pass the
2300
+ * callback check.
2301
+ * @example
2302
+ *
2303
+ * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
2304
+ * // => [1, 3, 5]
2305
+ */
2306
+ function reject(collection, callback, thisArg) {
2307
+ callback = createCallback(callback, thisArg);
2308
+ return filter(collection, function(value, index, collection) {
2309
+ return !callback(value, index, collection);
2310
+ });
2311
+ }
2312
+
2313
+ /**
2314
+ * Creates an array of shuffled `array` values, using a version of the
2315
+ * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
2316
+ *
2317
+ * @static
2318
+ * @memberOf _
2319
+ * @category Collections
2320
+ * @param {Array} collection The collection to shuffle.
2321
+ * @returns {Array} Returns a new shuffled collection.
2322
+ * @example
2323
+ *
2324
+ * _.shuffle([1, 2, 3, 4, 5, 6]);
2325
+ * // => [4, 1, 6, 3, 5, 2]
2326
+ */
2327
+ function shuffle(collection) {
2328
+ var index = -1,
2329
+ result = Array(collection ? collection.length : 0);
2330
+
2331
+ forEach(collection, function(value) {
2332
+ var rand = floor(nativeRandom() * (++index + 1));
2333
+ result[index] = result[rand];
2334
+ result[rand] = value;
2335
+ });
2336
+ return result;
2337
+ }
2338
+
2339
+ /**
2340
+ * Gets the size of the `collection` by returning `collection.length` for arrays
2341
+ * and array-like objects or the number of own enumerable properties for objects.
2342
+ *
2343
+ * @static
2344
+ * @memberOf _
2345
+ * @category Collections
2346
+ * @param {Array|Object|String} collection The collection to inspect.
2347
+ * @returns {Number} Returns `collection.length` or number of own enumerable properties.
2348
+ * @example
2349
+ *
2350
+ * _.size([1, 2]);
2351
+ * // => 2
2352
+ *
2353
+ * _.size({ 'one': 1, 'two': 2, 'three': 3 });
2354
+ * // => 3
2355
+ *
2356
+ * _.size('curly');
2357
+ * // => 5
2358
+ */
2359
+ function size(collection) {
2360
+ var length = collection ? collection.length : 0;
2361
+ return typeof length == 'number' ? length : keys(collection).length;
2362
+ }
2363
+
2364
+ /**
2365
+ * Checks if the `callback` returns a truthy value for **any** element of a
2366
+ * `collection`. The function returns as soon as it finds passing value, and
2367
+ * does not iterate over the entire `collection`. The `callback` is bound to
2368
+ * `thisArg` and invoked with three arguments; (value, index|key, collection).
2369
+ *
2370
+ * @static
2371
+ * @memberOf _
2372
+ * @alias any
2373
+ * @category Collections
2374
+ * @param {Array|Object|String} collection The collection to iterate over.
2375
+ * @param {Function} [callback=identity] The function called per iteration.
2376
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2377
+ * @returns {Boolean} Returns `true` if any element passes the callback check,
2378
+ * else `false`.
2379
+ * @example
2380
+ *
2381
+ * _.some([null, 0, 'yes', false]);
2382
+ * // => true
2383
+ */
2384
+ function some(collection, callback, thisArg) {
2385
+ var result;
2386
+ callback = createCallback(callback, thisArg);
2387
+ forEach(collection, function(value, index, collection) {
2388
+ return !(result = callback(value, index, collection));
2389
+ });
2390
+ return !!result;
2391
+ }
2392
+
2393
+ /**
2394
+ * Creates an array, stable sorted in ascending order by the results of
2395
+ * running each element of `collection` through a `callback`. The `callback`
2396
+ * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
2397
+ * The `callback` argument may also be the name of a property to sort by (e.g. 'length').
2398
+ *
2399
+ * @static
2400
+ * @memberOf _
2401
+ * @category Collections
2402
+ * @param {Array|Object|String} collection The collection to iterate over.
2403
+ * @param {Function|String} callback|property The function called per iteration
2404
+ * or property name to sort by.
2405
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2406
+ * @returns {Array} Returns a new array of sorted elements.
2407
+ * @example
2408
+ *
2409
+ * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); });
2410
+ * // => [3, 1, 2]
2411
+ *
2412
+ * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
2413
+ * // => [3, 1, 2]
2414
+ *
2415
+ * _.sortBy(['larry', 'brendan', 'moe'], 'length');
2416
+ * // => ['moe', 'larry', 'brendan']
2417
+ */
2418
+ function sortBy(collection, callback, thisArg) {
2419
+ var result = [];
2420
+ callback = createCallback(callback, thisArg);
2421
+ forEach(collection, function(value, index, collection) {
2422
+ result.push({
2423
+ 'criteria': callback(value, index, collection),
2424
+ 'index': index,
2425
+ 'value': value
2426
+ });
2427
+ });
2428
+
2429
+ var length = result.length;
2430
+ result.sort(compareAscending);
2431
+ while (length--) {
2432
+ result[length] = result[length].value;
2433
+ }
2434
+ return result;
2435
+ }
2436
+
2437
+ /**
2438
+ * Converts the `collection`, to an array.
2439
+ *
2440
+ * @static
2441
+ * @memberOf _
2442
+ * @category Collections
2443
+ * @param {Array|Object|String} collection The collection to convert.
2444
+ * @returns {Array} Returns the new converted array.
2445
+ * @example
2446
+ *
2447
+ * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
2448
+ * // => [2, 3, 4]
2449
+ */
2450
+ function toArray(collection) {
2451
+ if (!collection) {
2452
+ return [];
2453
+ }
2454
+ if (typeof collection.length == 'number') {
2455
+ return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
2456
+ ? collection.split('')
2457
+ : slice.call(collection);
2458
+ }
2459
+ return values(collection);
2460
+ }
2461
+
2462
+ /**
2463
+ * Examines each element in a `collection`, returning an array of all elements
2464
+ * that contain the given `properties`.
2465
+ *
2466
+ * @static
2467
+ * @memberOf _
2468
+ * @category Collections
2469
+ * @param {Array|Object|String} collection The collection to iterate over.
2470
+ * @param {Object} properties The object of property values to filter by.
2471
+ * @returns {Array} Returns a new array of elements that contain the given `properties`.
2472
+ * @example
2473
+ *
2474
+ * var stooges = [
2475
+ * { 'name': 'moe', 'age': 40 },
2476
+ * { 'name': 'larry', 'age': 50 },
2477
+ * { 'name': 'curly', 'age': 60 }
2478
+ * ];
2479
+ *
2480
+ * _.where(stooges, { 'age': 40 });
2481
+ * // => [{ 'name': 'moe', 'age': 40 }]
2482
+ */
2483
+ function where(collection, properties) {
2484
+ var props = [];
2485
+ forIn(properties, function(value, prop) { props.push(prop); });
2486
+
2487
+ var length = props.length,
2488
+ result = [];
2489
+
2490
+ forEach(collection, function(value) {
2491
+ var index = -1;
2492
+ while (++index < length) {
2493
+ var prop = props[index],
2494
+ pass = value[prop] === properties[prop];
2495
+ if (!pass) {
2496
+ break;
2497
+ }
2498
+ }
2499
+ if (pass) {
2500
+ result.push(value);
2501
+ }
2502
+ });
2503
+ return result;
2504
+ }
2505
+
2506
+ /*--------------------------------------------------------------------------*/
2507
+
2508
+ /**
2509
+ * Creates an array with all falsey values of `array` removed. The values
2510
+ * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey.
2511
+ *
2512
+ * @static
2513
+ * @memberOf _
2514
+ * @category Arrays
2515
+ * @param {Array} array The array to compact.
2516
+ * @returns {Array} Returns a new filtered array.
2517
+ * @example
2518
+ *
2519
+ * _.compact([0, 1, false, 2, '', 3]);
2520
+ * // => [1, 2, 3]
2521
+ */
2522
+ function compact(array) {
2523
+ var index = -1,
2524
+ length = array ? array.length : 0,
2525
+ result = [];
2526
+
2527
+ while (++index < length) {
2528
+ var value = array[index];
2529
+ if (value) {
2530
+ result.push(value);
2531
+ }
2532
+ }
2533
+ return result;
2534
+ }
2535
+
2536
+ /**
2537
+ * Creates an array of `array` elements not present in the other arrays
2538
+ * using strict equality for comparisons, i.e. `===`.
2539
+ *
2540
+ * @static
2541
+ * @memberOf _
2542
+ * @category Arrays
2543
+ * @param {Array} array The array to process.
2544
+ * @param {Array} [array1, array2, ...] Arrays to check.
2545
+ * @returns {Array} Returns a new array of `array` elements not present in the
2546
+ * other arrays.
2547
+ * @example
2548
+ *
2549
+ * _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
2550
+ * // => [1, 3, 4]
2551
+ */
2552
+ function difference(array) {
2553
+ var result = [];
2554
+ if (!array) {
2555
+ return result;
2556
+ }
2557
+ var index = -1,
2558
+ length = array.length,
2559
+ flattened = concat.apply(ArrayProto, arguments),
2560
+ contains = cachedContains(flattened, length);
2561
+
2562
+ while (++index < length) {
2563
+ var value = array[index];
2564
+ if (!contains(value)) {
2565
+ result.push(value);
2566
+ }
2567
+ }
2568
+ return result;
2569
+ }
2570
+
2571
+ /**
2572
+ * Gets the first element of the `array`. Pass `n` to return the first `n`
2573
+ * elements of the `array`.
2574
+ *
2575
+ * @static
2576
+ * @memberOf _
2577
+ * @alias head, take
2578
+ * @category Arrays
2579
+ * @param {Array} array The array to query.
2580
+ * @param {Number} [n] The number of elements to return.
2581
+ * @param- {Object} [guard] Internally used to allow this method to work with
2582
+ * others like `_.map` without using their callback `index` argument for `n`.
2583
+ * @returns {Mixed} Returns the first element or an array of the first `n`
2584
+ * elements of `array`.
2585
+ * @example
2586
+ *
2587
+ * _.first([5, 4, 3, 2, 1]);
2588
+ * // => 5
2589
+ */
2590
+ function first(array, n, guard) {
2591
+ if (array) {
2592
+ return (n == null || guard) ? array[0] : slice.call(array, 0, n);
2593
+ }
2594
+ }
2595
+
2596
+ /**
2597
+ * Flattens a nested array (the nesting can be to any depth). If `shallow` is
2598
+ * truthy, `array` will only be flattened a single level.
2599
+ *
2600
+ * @static
2601
+ * @memberOf _
2602
+ * @category Arrays
2603
+ * @param {Array} array The array to compact.
2604
+ * @param {Boolean} shallow A flag to indicate only flattening a single level.
2605
+ * @returns {Array} Returns a new flattened array.
2606
+ * @example
2607
+ *
2608
+ * _.flatten([1, [2], [3, [[4]]]]);
2609
+ * // => [1, 2, 3, 4];
2610
+ *
2611
+ * _.flatten([1, [2], [3, [[4]]]], true);
2612
+ * // => [1, 2, 3, [[4]]];
2613
+ */
2614
+ function flatten(array, shallow) {
2615
+ var index = -1,
2616
+ length = array ? array.length : 0,
2617
+ result = [];
2618
+
2619
+ while (++index < length) {
2620
+ var value = array[index];
2621
+
2622
+ // recursively flatten arrays (susceptible to call stack limits)
2623
+ if (isArray(value)) {
2624
+ push.apply(result, shallow ? value : flatten(value));
2625
+ } else {
2626
+ result.push(value);
2627
+ }
2628
+ }
2629
+ return result;
2630
+ }
2631
+
2632
+ /**
2633
+ * Gets the index at which the first occurrence of `value` is found using
2634
+ * strict equality for comparisons, i.e. `===`. If the `array` is already
2635
+ * sorted, passing `true` for `fromIndex` will run a faster binary search.
2636
+ *
2637
+ * @static
2638
+ * @memberOf _
2639
+ * @category Arrays
2640
+ * @param {Array} array The array to search.
2641
+ * @param {Mixed} value The value to search for.
2642
+ * @param {Boolean|Number} [fromIndex=0] The index to start searching from or
2643
+ * `true` to perform a binary search on a sorted `array`.
2644
+ * @returns {Number} Returns the index of the matched value or `-1`.
2645
+ * @example
2646
+ *
2647
+ * _.indexOf([1, 2, 3, 1, 2, 3], 2);
2648
+ * // => 1
2649
+ *
2650
+ * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3);
2651
+ * // => 4
2652
+ *
2653
+ * _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
2654
+ * // => 2
2655
+ */
2656
+ function indexOf(array, value, fromIndex) {
2657
+ var index = -1,
2658
+ length = array ? array.length : 0;
2659
+
2660
+ if (typeof fromIndex == 'number') {
2661
+ index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1;
2662
+ } else if (fromIndex) {
2663
+ index = sortedIndex(array, value);
2664
+ return array[index] === value ? index : -1;
2665
+ }
2666
+ while (++index < length) {
2667
+ if (array[index] === value) {
2668
+ return index;
2669
+ }
2670
+ }
2671
+ return -1;
2672
+ }
2673
+
2674
+ /**
2675
+ * Gets all but the last element of `array`. Pass `n` to exclude the last `n`
2676
+ * elements from the result.
2677
+ *
2678
+ * @static
2679
+ * @memberOf _
2680
+ * @category Arrays
2681
+ * @param {Array} array The array to query.
2682
+ * @param {Number} [n] The number of elements to return.
2683
+ * @param- {Object} [guard] Internally used to allow this method to work with
2684
+ * others like `_.map` without using their callback `index` argument for `n`.
2685
+ * @returns {Array} Returns all but the last element or `n` elements of `array`.
2686
+ * @example
2687
+ *
2688
+ * _.initial([3, 2, 1]);
2689
+ * // => [3, 2]
2690
+ */
2691
+ function initial(array, n, guard) {
2692
+ return array
2693
+ ? slice.call(array, 0, -((n == null || guard) ? 1 : n))
2694
+ : [];
2695
+ }
2696
+
2697
+ /**
2698
+ * Computes the intersection of all the passed-in arrays using strict equality
2699
+ * for comparisons, i.e. `===`.
2700
+ *
2701
+ * @static
2702
+ * @memberOf _
2703
+ * @category Arrays
2704
+ * @param {Array} [array1, array2, ...] Arrays to process.
2705
+ * @returns {Array} Returns a new array of unique elements, in order, that are
2706
+ * present in **all** of the arrays.
2707
+ * @example
2708
+ *
2709
+ * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
2710
+ * // => [1, 2]
2711
+ */
2712
+ function intersection(array) {
2713
+ var argsLength = arguments.length,
2714
+ cache = [],
2715
+ index = -1,
2716
+ length = array ? array.length : 0,
2717
+ result = [];
2718
+
2719
+ array: while (++index < length) {
2720
+ var value = array[index];
2721
+ if (indexOf(result, value) < 0) {
2722
+ for (var argsIndex = 1; argsIndex < argsLength; argsIndex++) {
2723
+ if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(arguments[argsIndex])))(value)) {
2724
+ continue array;
2725
+ }
2726
+ }
2727
+ result.push(value);
2728
+ }
2729
+ }
2730
+ return result;
2731
+ }
2732
+
2733
+ /**
2734
+ * Gets the last element of the `array`. Pass `n` to return the last `n`
2735
+ * elements of the `array`.
2736
+ *
2737
+ * @static
2738
+ * @memberOf _
2739
+ * @category Arrays
2740
+ * @param {Array} array The array to query.
2741
+ * @param {Number} [n] The number of elements to return.
2742
+ * @param- {Object} [guard] Internally used to allow this method to work with
2743
+ * others like `_.map` without using their callback `index` argument for `n`.
2744
+ * @returns {Mixed} Returns the last element or an array of the last `n`
2745
+ * elements of `array`.
2746
+ * @example
2747
+ *
2748
+ * _.last([3, 2, 1]);
2749
+ * // => 1
2750
+ */
2751
+ function last(array, n, guard) {
2752
+ if (array) {
2753
+ var length = array.length;
2754
+ return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length);
2755
+ }
2756
+ }
2757
+
2758
+ /**
2759
+ * Gets the index at which the last occurrence of `value` is found using
2760
+ * strict equality for comparisons, i.e. `===`.
2761
+ *
2762
+ * @static
2763
+ * @memberOf _
2764
+ * @category Arrays
2765
+ * @param {Array} array The array to search.
2766
+ * @param {Mixed} value The value to search for.
2767
+ * @param {Number} [fromIndex=array.length-1] The index to start searching from.
2768
+ * @returns {Number} Returns the index of the matched value or `-1`.
2769
+ * @example
2770
+ *
2771
+ * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
2772
+ * // => 4
2773
+ *
2774
+ * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
2775
+ * // => 1
2776
+ */
2777
+ function lastIndexOf(array, value, fromIndex) {
2778
+ var index = array ? array.length : 0;
2779
+ if (typeof fromIndex == 'number') {
2780
+ index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;
2781
+ }
2782
+ while (index--) {
2783
+ if (array[index] === value) {
2784
+ return index;
2785
+ }
2786
+ }
2787
+ return -1;
2788
+ }
2789
+
2790
+ /**
2791
+ * Creates an object composed from arrays of `keys` and `values`. Pass either
2792
+ * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or
2793
+ * two arrays, one of `keys` and one of corresponding `values`.
2794
+ *
2795
+ * @static
2796
+ * @memberOf _
2797
+ * @category Arrays
2798
+ * @param {Array} keys The array of keys.
2799
+ * @param {Array} [values=[]] The array of values.
2800
+ * @returns {Object} Returns an object composed of the given keys and
2801
+ * corresponding values.
2802
+ * @example
2803
+ *
2804
+ * _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
2805
+ * // => { 'moe': 30, 'larry': 40, 'curly': 50 }
2806
+ */
2807
+ function object(keys, values) {
2808
+ var index = -1,
2809
+ length = keys ? keys.length : 0,
2810
+ result = {};
2811
+
2812
+ while (++index < length) {
2813
+ var key = keys[index];
2814
+ if (values) {
2815
+ result[key] = values[index];
2816
+ } else {
2817
+ result[key[0]] = key[1];
2818
+ }
2819
+ }
2820
+ return result;
2821
+ }
2822
+
2823
+ /**
2824
+ * Creates an array of numbers (positive and/or negative) progressing from
2825
+ * `start` up to but not including `stop`. This method is a port of Python's
2826
+ * `range()` function. See http://docs.python.org/library/functions.html#range.
2827
+ *
2828
+ * @static
2829
+ * @memberOf _
2830
+ * @category Arrays
2831
+ * @param {Number} [start=0] The start of the range.
2832
+ * @param {Number} end The end of the range.
2833
+ * @param {Number} [step=1] The value to increment or descrement by.
2834
+ * @returns {Array} Returns a new range array.
2835
+ * @example
2836
+ *
2837
+ * _.range(10);
2838
+ * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
2839
+ *
2840
+ * _.range(1, 11);
2841
+ * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
2842
+ *
2843
+ * _.range(0, 30, 5);
2844
+ * // => [0, 5, 10, 15, 20, 25]
2845
+ *
2846
+ * _.range(0, -10, -1);
2847
+ * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
2848
+ *
2849
+ * _.range(0);
2850
+ * // => []
2851
+ */
2852
+ function range(start, end, step) {
2853
+ start = +start || 0;
2854
+ step = +step || 1;
2855
+
2856
+ if (end == null) {
2857
+ end = start;
2858
+ start = 0;
2859
+ }
2860
+ // use `Array(length)` so V8 will avoid the slower "dictionary" mode
2861
+ // http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s
2862
+ var index = -1,
2863
+ length = nativeMax(0, ceil((end - start) / step)),
2864
+ result = Array(length);
2865
+
2866
+ while (++index < length) {
2867
+ result[index] = start;
2868
+ start += step;
2869
+ }
2870
+ return result;
2871
+ }
2872
+
2873
+ /**
2874
+ * The opposite of `_.initial`, this method gets all but the first value of
2875
+ * `array`. Pass `n` to exclude the first `n` values from the result.
2876
+ *
2877
+ * @static
2878
+ * @memberOf _
2879
+ * @alias drop, tail
2880
+ * @category Arrays
2881
+ * @param {Array} array The array to query.
2882
+ * @param {Number} [n] The number of elements to return.
2883
+ * @param- {Object} [guard] Internally used to allow this method to work with
2884
+ * others like `_.map` without using their callback `index` argument for `n`.
2885
+ * @returns {Array} Returns all but the first value or `n` values of `array`.
2886
+ * @example
2887
+ *
2888
+ * _.rest([3, 2, 1]);
2889
+ * // => [2, 1]
2890
+ */
2891
+ function rest(array, n, guard) {
2892
+ return array
2893
+ ? slice.call(array, (n == null || guard) ? 1 : n)
2894
+ : [];
2895
+ }
2896
+
2897
+ /**
2898
+ * Uses a binary search to determine the smallest index at which the `value`
2899
+ * should be inserted into `array` in order to maintain the sort order of the
2900
+ * sorted `array`. If `callback` is passed, it will be executed for `value` and
2901
+ * each element in `array` to compute their sort ranking. The `callback` is
2902
+ * bound to `thisArg` and invoked with one argument; (value). The `callback`
2903
+ * argument may also be the name of a property to order by.
2904
+ *
2905
+ * @static
2906
+ * @memberOf _
2907
+ * @category Arrays
2908
+ * @param {Array} array The array to iterate over.
2909
+ * @param {Mixed} value The value to evaluate.
2910
+ * @param {Function|String} [callback=identity|property] The function called
2911
+ * per iteration or property name to order by.
2912
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
2913
+ * @returns {Number} Returns the index at which the value should be inserted
2914
+ * into `array`.
2915
+ * @example
2916
+ *
2917
+ * _.sortedIndex([20, 30, 50], 40);
2918
+ * // => 2
2919
+ *
2920
+ * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
2921
+ * // => 2
2922
+ *
2923
+ * var dict = {
2924
+ * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 }
2925
+ * };
2926
+ *
2927
+ * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
2928
+ * return dict.wordToNumber[word];
2929
+ * });
2930
+ * // => 2
2931
+ *
2932
+ * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
2933
+ * return this.wordToNumber[word];
2934
+ * }, dict);
2935
+ * // => 2
2936
+ */
2937
+ function sortedIndex(array, value, callback, thisArg) {
2938
+ var low = 0,
2939
+ high = array ? array.length : low;
2940
+
2941
+ if (callback) {
2942
+ callback = createCallback(callback, thisArg);
2943
+ value = callback(value);
2944
+ while (low < high) {
2945
+ var mid = (low + high) >>> 1;
2946
+ callback(array[mid]) < value ? low = mid + 1 : high = mid;
2947
+ }
2948
+ } else {
2949
+ while (low < high) {
2950
+ var mid = (low + high) >>> 1;
2951
+ array[mid] < value ? low = mid + 1 : high = mid;
2952
+ }
2953
+ }
2954
+ return low;
2955
+ }
2956
+
2957
+ /**
2958
+ * Computes the union of the passed-in arrays using strict equality for
2959
+ * comparisons, i.e. `===`.
2960
+ *
2961
+ * @static
2962
+ * @memberOf _
2963
+ * @category Arrays
2964
+ * @param {Array} [array1, array2, ...] Arrays to process.
2965
+ * @returns {Array} Returns a new array of unique values, in order, that are
2966
+ * present in one or more of the arrays.
2967
+ * @example
2968
+ *
2969
+ * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
2970
+ * // => [1, 2, 3, 101, 10]
2971
+ */
2972
+ function union() {
2973
+ var index = -1,
2974
+ flattened = concat.apply(ArrayProto, arguments),
2975
+ length = flattened.length,
2976
+ result = [];
2977
+
2978
+ while (++index < length) {
2979
+ var value = flattened[index];
2980
+ if (indexOf(result, value) < 0) {
2981
+ result.push(value);
2982
+ }
2983
+ }
2984
+ return result;
2985
+ }
2986
+
2987
+ /**
2988
+ * Creates a duplicate-value-free version of the `array` using strict equality
2989
+ * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true`
2990
+ * for `isSorted` will run a faster algorithm. If `callback` is passed, each
2991
+ * element of `array` is passed through a callback` before uniqueness is computed.
2992
+ * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
2993
+ *
2994
+ * @static
2995
+ * @memberOf _
2996
+ * @alias unique
2997
+ * @category Arrays
2998
+ * @param {Array} array The array to process.
2999
+ * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
3000
+ * @param {Function} [callback=identity] The function called per iteration.
3001
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
3002
+ * @returns {Array} Returns a duplicate-value-free array.
3003
+ * @example
3004
+ *
3005
+ * _.uniq([1, 2, 1, 3, 1]);
3006
+ * // => [1, 2, 3]
3007
+ *
3008
+ * _.uniq([1, 1, 2, 2, 3], true);
3009
+ * // => [1, 2, 3]
3010
+ *
3011
+ * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); });
3012
+ * // => [1, 2, 3]
3013
+ *
3014
+ * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
3015
+ * // => [1, 2, 3]
3016
+ */
3017
+ function uniq(array, isSorted, callback, thisArg) {
3018
+ var index = -1,
3019
+ length = array ? array.length : 0,
3020
+ result = [],
3021
+ seen = [];
3022
+
3023
+ // juggle arguments
3024
+ if (typeof isSorted == 'function') {
3025
+ thisArg = callback;
3026
+ callback = isSorted;
3027
+ isSorted = false;
3028
+ }
3029
+ callback = createCallback(callback, thisArg);
3030
+ while (++index < length) {
3031
+ var computed = callback(array[index], index, array);
3032
+ if (isSorted
3033
+ ? !index || seen[seen.length - 1] !== computed
3034
+ : indexOf(seen, computed) < 0
3035
+ ) {
3036
+ seen.push(computed);
3037
+ result.push(array[index]);
3038
+ }
3039
+ }
3040
+ return result;
3041
+ }
3042
+
3043
+ /**
3044
+ * Creates an array with all occurrences of the passed values removed using
3045
+ * strict equality for comparisons, i.e. `===`.
3046
+ *
3047
+ * @static
3048
+ * @memberOf _
3049
+ * @category Arrays
3050
+ * @param {Array} array The array to filter.
3051
+ * @param {Mixed} [value1, value2, ...] Values to remove.
3052
+ * @returns {Array} Returns a new filtered array.
3053
+ * @example
3054
+ *
3055
+ * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
3056
+ * // => [2, 3, 4]
3057
+ */
3058
+ function without(array) {
3059
+ var index = -1,
3060
+ length = array ? array.length : 0,
3061
+ contains = cachedContains(arguments, 1, 20),
3062
+ result = [];
3063
+
3064
+ while (++index < length) {
3065
+ var value = array[index];
3066
+ if (!contains(value)) {
3067
+ result.push(value);
3068
+ }
3069
+ }
3070
+ return result;
3071
+ }
3072
+
3073
+ /**
3074
+ * Groups the elements of each array at their corresponding indexes. Useful for
3075
+ * separate data sources that are coordinated through matching array indexes.
3076
+ * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix
3077
+ * in a similar fashion.
3078
+ *
3079
+ * @static
3080
+ * @memberOf _
3081
+ * @category Arrays
3082
+ * @param {Array} [array1, array2, ...] Arrays to process.
3083
+ * @returns {Array} Returns a new array of grouped elements.
3084
+ * @example
3085
+ *
3086
+ * _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
3087
+ * // => [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]]
3088
+ */
3089
+ function zip(array) {
3090
+ var index = -1,
3091
+ length = array ? max(pluck(arguments, 'length')) : 0,
3092
+ result = Array(length);
3093
+
3094
+ while (++index < length) {
3095
+ result[index] = pluck(arguments, index);
3096
+ }
3097
+ return result;
3098
+ }
3099
+
3100
+ /*--------------------------------------------------------------------------*/
3101
+
3102
+ /**
3103
+ * Creates a function that is restricted to executing only after it is
3104
+ * called `n` times.
3105
+ *
3106
+ * @static
3107
+ * @memberOf _
3108
+ * @category Functions
3109
+ * @param {Number} n The number of times the function must be called before
3110
+ * it is executed.
3111
+ * @param {Function} func The function to restrict.
3112
+ * @returns {Function} Returns the new restricted function.
3113
+ * @example
3114
+ *
3115
+ * var renderNotes = _.after(notes.length, render);
3116
+ * _.forEach(notes, function(note) {
3117
+ * note.asyncSave({ 'success': renderNotes });
3118
+ * });
3119
+ * // `renderNotes` is run once, after all notes have saved
3120
+ */
3121
+ function after(n, func) {
3122
+ if (n < 1) {
3123
+ return func();
3124
+ }
3125
+ return function() {
3126
+ if (--n < 1) {
3127
+ return func.apply(this, arguments);
3128
+ }
3129
+ };
3130
+ }
3131
+
3132
+ /**
3133
+ * Creates a function that, when called, invokes `func` with the `this`
3134
+ * binding of `thisArg` and prepends any additional `bind` arguments to those
3135
+ * passed to the bound function.
3136
+ *
3137
+ * @static
3138
+ * @memberOf _
3139
+ * @category Functions
3140
+ * @param {Function} func The function to bind.
3141
+ * @param {Mixed} [thisArg] The `this` binding of `func`.
3142
+ * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
3143
+ * @returns {Function} Returns the new bound function.
3144
+ * @example
3145
+ *
3146
+ * var func = function(greeting) {
3147
+ * return greeting + ' ' + this.name;
3148
+ * };
3149
+ *
3150
+ * func = _.bind(func, { 'name': 'moe' }, 'hi');
3151
+ * func();
3152
+ * // => 'hi moe'
3153
+ */
3154
+ function bind(func, thisArg) {
3155
+ // use `Function#bind` if it exists and is fast
3156
+ // (in V8 `Function#bind` is slower except when partially applied)
3157
+ return isBindFast || (nativeBind && arguments.length > 2)
3158
+ ? nativeBind.call.apply(nativeBind, arguments)
3159
+ : createBound(func, thisArg, slice.call(arguments, 2));
3160
+ }
3161
+
3162
+ /**
3163
+ * Binds methods on `object` to `object`, overwriting the existing method.
3164
+ * If no method names are provided, all the function properties of `object`
3165
+ * will be bound.
3166
+ *
3167
+ * @static
3168
+ * @memberOf _
3169
+ * @category Functions
3170
+ * @param {Object} object The object to bind and assign the bound methods to.
3171
+ * @param {String} [methodName1, methodName2, ...] Method names on the object to bind.
3172
+ * @returns {Object} Returns `object`.
3173
+ * @example
3174
+ *
3175
+ * var buttonView = {
3176
+ * 'label': 'lodash',
3177
+ * 'onClick': function() { alert('clicked: ' + this.label); }
3178
+ * };
3179
+ *
3180
+ * _.bindAll(buttonView);
3181
+ * jQuery('#lodash_button').on('click', buttonView.onClick);
3182
+ * // => When the button is clicked, `this.label` will have the correct value
3183
+ */
3184
+ var bindAll = createIterator({
3185
+ 'useStrict': false,
3186
+ 'args': 'object',
3187
+ 'top':
3188
+ 'var funcs = arguments,\n' +
3189
+ ' index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),\n' +
3190
+ ' length = funcs.length;' +
3191
+ 'while (++index < length) {\n' +
3192
+ ' value = funcs[index];\n' +
3193
+ ' result[value] = bind(result[value], result)\n' +
3194
+ '}\n' +
3195
+ 'return result'
3196
+ });
3197
+
3198
+ /**
3199
+ * Creates a function that is the composition of the passed functions,
3200
+ * where each function consumes the return value of the function that follows.
3201
+ * In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
3202
+ *
3203
+ * @static
3204
+ * @memberOf _
3205
+ * @category Functions
3206
+ * @param {Function} [func1, func2, ...] Functions to compose.
3207
+ * @returns {Function} Returns the new composed function.
3208
+ * @example
3209
+ *
3210
+ * var greet = function(name) { return 'hi: ' + name; };
3211
+ * var exclaim = function(statement) { return statement + '!'; };
3212
+ * var welcome = _.compose(exclaim, greet);
3213
+ * welcome('moe');
3214
+ * // => 'hi: moe!'
3215
+ */
3216
+ function compose() {
3217
+ var funcs = arguments;
3218
+ return function() {
3219
+ var args = arguments,
3220
+ length = funcs.length;
3221
+
3222
+ while (length--) {
3223
+ args = [funcs[length].apply(this, args)];
3224
+ }
3225
+ return args[0];
3226
+ };
3227
+ }
3228
+
3229
+ /**
3230
+ * Creates a function that will delay the execution of `func` until after
3231
+ * `wait` milliseconds have elapsed since the last time it was invoked. Pass
3232
+ * `true` for `immediate` to cause debounce to invoke `func` on the leading,
3233
+ * instead of the trailing, edge of the `wait` timeout. Subsequent calls to
3234
+ * the debounced function will return the result of the last `func` call.
3235
+ *
3236
+ * @static
3237
+ * @memberOf _
3238
+ * @category Functions
3239
+ * @param {Function} func The function to debounce.
3240
+ * @param {Number} wait The number of milliseconds to delay.
3241
+ * @param {Boolean} immediate A flag to indicate execution is on the leading
3242
+ * edge of the timeout.
3243
+ * @returns {Function} Returns the new debounced function.
3244
+ * @example
3245
+ *
3246
+ * var lazyLayout = _.debounce(calculateLayout, 300);
3247
+ * jQuery(window).on('resize', lazyLayout);
3248
+ */
3249
+ function debounce(func, wait, immediate) {
3250
+ var args,
3251
+ result,
3252
+ thisArg,
3253
+ timeoutId;
3254
+
3255
+ function delayed() {
3256
+ timeoutId = null;
3257
+ if (!immediate) {
3258
+ result = func.apply(thisArg, args);
3259
+ }
3260
+ }
3261
+
3262
+ return function() {
3263
+ var isImmediate = immediate && !timeoutId;
3264
+ args = arguments;
3265
+ thisArg = this;
3266
+
3267
+ clearTimeout(timeoutId);
3268
+ timeoutId = setTimeout(delayed, wait);
3269
+
3270
+ if (isImmediate) {
3271
+ result = func.apply(thisArg, args);
3272
+ }
3273
+ return result;
3274
+ };
3275
+ }
3276
+
3277
+ /**
3278
+ * Executes the `func` function after `wait` milliseconds. Additional arguments
3279
+ * will be passed to `func` when it is invoked.
3280
+ *
3281
+ * @static
3282
+ * @memberOf _
3283
+ * @category Functions
3284
+ * @param {Function} func The function to delay.
3285
+ * @param {Number} wait The number of milliseconds to delay execution.
3286
+ * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with.
3287
+ * @returns {Number} Returns the `setTimeout` timeout id.
3288
+ * @example
3289
+ *
3290
+ * var log = _.bind(console.log, console);
3291
+ * _.delay(log, 1000, 'logged later');
3292
+ * // => 'logged later' (Appears after one second.)
3293
+ */
3294
+ function delay(func, wait) {
3295
+ var args = slice.call(arguments, 2);
3296
+ return setTimeout(function() { return func.apply(undefined, args); }, wait);
3297
+ }
3298
+
3299
+ /**
3300
+ * Defers executing the `func` function until the current call stack has cleared.
3301
+ * Additional arguments will be passed to `func` when it is invoked.
3302
+ *
3303
+ * @static
3304
+ * @memberOf _
3305
+ * @category Functions
3306
+ * @param {Function} func The function to defer.
3307
+ * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with.
3308
+ * @returns {Number} Returns the `setTimeout` timeout id.
3309
+ * @example
3310
+ *
3311
+ * _.defer(function() { alert('deferred'); });
3312
+ * // returns from the function before `alert` is called
3313
+ */
3314
+ function defer(func) {
3315
+ var args = slice.call(arguments, 1);
3316
+ return setTimeout(function() { return func.apply(undefined, args); }, 1);
3317
+ }
3318
+
3319
+ /**
3320
+ * Creates a function that, when called, invokes `object[methodName]` and
3321
+ * prepends any additional `lateBind` arguments to those passed to the bound
3322
+ * function. This method differs from `_.bind` by allowing bound functions to
3323
+ * reference methods that will be redefined or don't yet exist.
3324
+ *
3325
+ * @static
3326
+ * @memberOf _
3327
+ * @category Functions
3328
+ * @param {Object} object The object the method belongs to.
3329
+ * @param {String} methodName The method name.
3330
+ * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
3331
+ * @returns {Function} Returns the new bound function.
3332
+ * @example
3333
+ *
3334
+ * var object = {
3335
+ * 'name': 'moe',
3336
+ * 'greet': function(greeting) {
3337
+ * return greeting + ' ' + this.name;
3338
+ * }
3339
+ * };
3340
+ *
3341
+ * var func = _.lateBind(object, 'greet', 'hi');
3342
+ * func();
3343
+ * // => 'hi moe'
3344
+ *
3345
+ * object.greet = function(greeting) {
3346
+ * return greeting + ', ' + this.name + '!';
3347
+ * };
3348
+ *
3349
+ * func();
3350
+ * // => 'hi, moe!'
3351
+ */
3352
+ function lateBind(object, methodName) {
3353
+ return createBound(methodName, object, slice.call(arguments, 2));
3354
+ }
3355
+
3356
+ /**
3357
+ * Creates a function that memoizes the result of `func`. If `resolver` is
3358
+ * passed, it will be used to determine the cache key for storing the result
3359
+ * based on the arguments passed to the memoized function. By default, the first
3360
+ * argument passed to the memoized function is used as the cache key.
3361
+ *
3362
+ * @static
3363
+ * @memberOf _
3364
+ * @category Functions
3365
+ * @param {Function} func The function to have its output memoized.
3366
+ * @param {Function} [resolver] A function used to resolve the cache key.
3367
+ * @returns {Function} Returns the new memoizing function.
3368
+ * @example
3369
+ *
3370
+ * var fibonacci = _.memoize(function(n) {
3371
+ * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
3372
+ * });
3373
+ */
3374
+ function memoize(func, resolver) {
3375
+ var cache = {};
3376
+ return function() {
3377
+ var prop = resolver ? resolver.apply(this, arguments) : arguments[0];
3378
+ return hasOwnProperty.call(cache, prop)
3379
+ ? cache[prop]
3380
+ : (cache[prop] = func.apply(this, arguments));
3381
+ };
3382
+ }
3383
+
3384
+ /**
3385
+ * Creates a function that is restricted to one execution. Repeat calls to
3386
+ * the function will return the value of the first call.
3387
+ *
3388
+ * @static
3389
+ * @memberOf _
3390
+ * @category Functions
3391
+ * @param {Function} func The function to restrict.
3392
+ * @returns {Function} Returns the new restricted function.
3393
+ * @example
3394
+ *
3395
+ * var initialize = _.once(createApplication);
3396
+ * initialize();
3397
+ * initialize();
3398
+ * // Application is only created once.
3399
+ */
3400
+ function once(func) {
3401
+ var result,
3402
+ ran = false;
3403
+
3404
+ return function() {
3405
+ if (ran) {
3406
+ return result;
3407
+ }
3408
+ ran = true;
3409
+ result = func.apply(this, arguments);
3410
+
3411
+ // clear the `func` variable so the function may be garbage collected
3412
+ func = null;
3413
+ return result;
3414
+ };
3415
+ }
3416
+
3417
+ /**
3418
+ * Creates a function that, when called, invokes `func` with any additional
3419
+ * `partial` arguments prepended to those passed to the new function. This method
3420
+ * is similar to `bind`, except it does **not** alter the `this` binding.
3421
+ *
3422
+ * @static
3423
+ * @memberOf _
3424
+ * @category Functions
3425
+ * @param {Function} func The function to partially apply arguments to.
3426
+ * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
3427
+ * @returns {Function} Returns the new partially applied function.
3428
+ * @example
3429
+ *
3430
+ * var greet = function(greeting, name) { return greeting + ': ' + name; };
3431
+ * var hi = _.partial(greet, 'hi');
3432
+ * hi('moe');
3433
+ * // => 'hi: moe'
3434
+ */
3435
+ function partial(func) {
3436
+ return createBound(func, slice.call(arguments, 1));
3437
+ }
3438
+
3439
+ /**
3440
+ * Creates a function that, when executed, will only call the `func`
3441
+ * function at most once per every `wait` milliseconds. If the throttled
3442
+ * function is invoked more than once during the `wait` timeout, `func` will
3443
+ * also be called on the trailing edge of the timeout. Subsequent calls to the
3444
+ * throttled function will return the result of the last `func` call.
3445
+ *
3446
+ * @static
3447
+ * @memberOf _
3448
+ * @category Functions
3449
+ * @param {Function} func The function to throttle.
3450
+ * @param {Number} wait The number of milliseconds to throttle executions to.
3451
+ * @returns {Function} Returns the new throttled function.
3452
+ * @example
3453
+ *
3454
+ * var throttled = _.throttle(updatePosition, 100);
3455
+ * jQuery(window).on('scroll', throttled);
3456
+ */
3457
+ function throttle(func, wait) {
3458
+ var args,
3459
+ result,
3460
+ thisArg,
3461
+ timeoutId,
3462
+ lastCalled = 0;
3463
+
3464
+ function trailingCall() {
3465
+ lastCalled = new Date;
3466
+ timeoutId = null;
3467
+ result = func.apply(thisArg, args);
3468
+ }
3469
+
3470
+ return function() {
3471
+ var now = new Date,
3472
+ remaining = wait - (now - lastCalled);
3473
+
3474
+ args = arguments;
3475
+ thisArg = this;
3476
+
3477
+ if (remaining <= 0) {
3478
+ clearTimeout(timeoutId);
3479
+ lastCalled = now;
3480
+ result = func.apply(thisArg, args);
3481
+ }
3482
+ else if (!timeoutId) {
3483
+ timeoutId = setTimeout(trailingCall, remaining);
3484
+ }
3485
+ return result;
3486
+ };
3487
+ }
3488
+
3489
+ /**
3490
+ * Creates a function that passes `value` to the `wrapper` function as its
3491
+ * first argument. Additional arguments passed to the new function are appended
3492
+ * to those passed to the `wrapper` function.
3493
+ *
3494
+ * @static
3495
+ * @memberOf _
3496
+ * @category Functions
3497
+ * @param {Mixed} value The value to wrap.
3498
+ * @param {Function} wrapper The wrapper function.
3499
+ * @returns {Function} Returns the new function.
3500
+ * @example
3501
+ *
3502
+ * var hello = function(name) { return 'hello: ' + name; };
3503
+ * hello = _.wrap(hello, function(func) {
3504
+ * return 'before, ' + func('moe') + ', after';
3505
+ * });
3506
+ * hello();
3507
+ * // => 'before, hello: moe, after'
3508
+ */
3509
+ function wrap(value, wrapper) {
3510
+ return function() {
3511
+ var args = [value];
3512
+ if (arguments.length) {
3513
+ push.apply(args, arguments);
3514
+ }
3515
+ return wrapper.apply(this, args);
3516
+ };
3517
+ }
3518
+
3519
+ /*--------------------------------------------------------------------------*/
3520
+
3521
+ /**
3522
+ * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
3523
+ * corresponding HTML entities.
3524
+ *
3525
+ * @static
3526
+ * @memberOf _
3527
+ * @category Utilities
3528
+ * @param {String} string The string to escape.
3529
+ * @returns {String} Returns the escaped string.
3530
+ * @example
3531
+ *
3532
+ * _.escape('Moe, Larry & Curly');
3533
+ * // => "Moe, Larry &amp; Curly"
3534
+ */
3535
+ function escape(string) {
3536
+ return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar);
3537
+ }
3538
+
3539
+ /**
3540
+ * This function returns the first argument passed to it.
3541
+ *
3542
+ * Note: It is used throughout Lo-Dash as a default callback.
3543
+ *
3544
+ * @static
3545
+ * @memberOf _
3546
+ * @category Utilities
3547
+ * @param {Mixed} value Any value.
3548
+ * @returns {Mixed} Returns `value`.
3549
+ * @example
3550
+ *
3551
+ * var moe = { 'name': 'moe' };
3552
+ * moe === _.identity(moe);
3553
+ * // => true
3554
+ */
3555
+ function identity(value) {
3556
+ return value;
3557
+ }
3558
+
3559
+ /**
3560
+ * Adds functions properties of `object` to the `lodash` function and chainable
3561
+ * wrapper.
3562
+ *
3563
+ * @static
3564
+ * @memberOf _
3565
+ * @category Utilities
3566
+ * @param {Object} object The object of function properties to add to `lodash`.
3567
+ * @example
3568
+ *
3569
+ * _.mixin({
3570
+ * 'capitalize': function(string) {
3571
+ * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
3572
+ * }
3573
+ * });
3574
+ *
3575
+ * _.capitalize('larry');
3576
+ * // => 'Larry'
3577
+ *
3578
+ * _('curly').capitalize();
3579
+ * // => 'Curly'
3580
+ */
3581
+ function mixin(object) {
3582
+ forEach(functions(object), function(methodName) {
3583
+ var func = lodash[methodName] = object[methodName];
3584
+
3585
+ lodash.prototype[methodName] = function() {
3586
+ var args = [this.__wrapped__];
3587
+ if (arguments.length) {
3588
+ push.apply(args, arguments);
3589
+ }
3590
+ var result = func.apply(lodash, args);
3591
+ if (this.__chain__) {
3592
+ result = new lodash(result);
3593
+ result.__chain__ = true;
3594
+ }
3595
+ return result;
3596
+ };
3597
+ });
3598
+ }
3599
+
3600
+ /**
3601
+ * Reverts the '_' variable to its previous value and returns a reference to
3602
+ * the `lodash` function.
3603
+ *
3604
+ * @static
3605
+ * @memberOf _
3606
+ * @category Utilities
3607
+ * @returns {Function} Returns the `lodash` function.
3608
+ * @example
3609
+ *
3610
+ * var lodash = _.noConflict();
3611
+ */
3612
+ function noConflict() {
3613
+ window._ = oldDash;
3614
+ return this;
3615
+ }
3616
+
3617
+ /**
3618
+ * Produces a random number between `min` and `max` (inclusive). If only one
3619
+ * argument is passed, a number between `0` and the given number will be returned.
3620
+ *
3621
+ * @static
3622
+ * @memberOf _
3623
+ * @category Utilities
3624
+ * @param {Number} [min=0] The minimum possible value.
3625
+ * @param {Number} [max=1] The maximum possible value.
3626
+ * @returns {Number} Returns a random number.
3627
+ * @example
3628
+ *
3629
+ * _.random(0, 5);
3630
+ * // => a number between 1 and 5
3631
+ *
3632
+ * _.random(5);
3633
+ * // => also a number between 1 and 5
3634
+ */
3635
+ function random(min, max) {
3636
+ if (min == null && max == null) {
3637
+ max = 1;
3638
+ }
3639
+ min = +min || 0;
3640
+ if (max == null) {
3641
+ max = min;
3642
+ min = 0;
3643
+ }
3644
+ return min + floor(nativeRandom() * ((+max || 0) - min + 1));
3645
+ }
3646
+
3647
+ /**
3648
+ * Resolves the value of `property` on `object`. If `property` is a function
3649
+ * it will be invoked and its result returned, else the property value is
3650
+ * returned. If `object` is falsey, then `null` is returned.
3651
+ *
3652
+ * @deprecated
3653
+ * @static
3654
+ * @memberOf _
3655
+ * @category Utilities
3656
+ * @param {Object} object The object to inspect.
3657
+ * @param {String} property The property to get the value of.
3658
+ * @returns {Mixed} Returns the resolved value.
3659
+ * @example
3660
+ *
3661
+ * var object = {
3662
+ * 'cheese': 'crumpets',
3663
+ * 'stuff': function() {
3664
+ * return 'nonsense';
3665
+ * }
3666
+ * };
3667
+ *
3668
+ * _.result(object, 'cheese');
3669
+ * // => 'crumpets'
3670
+ *
3671
+ * _.result(object, 'stuff');
3672
+ * // => 'nonsense'
3673
+ */
3674
+ function result(object, property) {
3675
+ // based on Backbone's private `getValue` function
3676
+ // https://github.com/documentcloud/backbone/blob/0.9.2/backbone.js#L1419-1424
3677
+ var value = object ? object[property] : null;
3678
+ return isFunction(value) ? object[property]() : value;
3679
+ }
3680
+
3681
+ /**
3682
+ * A micro-templating method that handles arbitrary delimiters, preserves
3683
+ * whitespace, and correctly escapes quotes within interpolated code.
3684
+ *
3685
+ * Note: In the development build `_.template` utilizes sourceURLs for easier
3686
+ * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
3687
+ *
3688
+ * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
3689
+ * build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page.
3690
+ * See http://developer.chrome.com/trunk/extensions/sandboxingEval.html
3691
+ *
3692
+ * @static
3693
+ * @memberOf _
3694
+ * @category Utilities
3695
+ * @param {String} text The template text.
3696
+ * @param {Obect} data The data object used to populate the text.
3697
+ * @param {Object} options The options object.
3698
+ * @returns {Function|String} Returns a compiled function when no `data` object
3699
+ * is given, else it returns the interpolated text.
3700
+ * @example
3701
+ *
3702
+ * // using a compiled template
3703
+ * var compiled = _.template('hello <%= name %>');
3704
+ * compiled({ 'name': 'moe' });
3705
+ * // => 'hello moe'
3706
+ *
3707
+ * var list = '<% _.forEach(people, function(name) { %><li><%= name %></li><% }); %>';
3708
+ * _.template(list, { 'people': ['moe', 'larry', 'curly'] });
3709
+ * // => '<li>moe</li><li>larry</li><li>curly</li>'
3710
+ *
3711
+ * // using the "escape" delimiter to escape HTML in data property values
3712
+ * _.template('<b><%- value %></b>', { 'value': '<script>' });
3713
+ * // => '<b>&lt;script></b>'
3714
+ *
3715
+ * // using the internal `print` function in "evaluate" delimiters
3716
+ * _.template('<% print("hello " + epithet); %>!', { 'epithet': 'stooge' });
3717
+ * // => 'hello stooge!'
3718
+ *
3719
+ * // using custom template delimiter settings
3720
+ * _.templateSettings = {
3721
+ * 'interpolate': /\{\{([\s\S]+?)\}\}/g
3722
+ * };
3723
+ *
3724
+ * _.template('hello {{ name }}!', { 'name': 'mustache' });
3725
+ * // => 'hello mustache!'
3726
+ *
3727
+ * // using the `variable` option to ensure a with-statement isn't used in the compiled template
3728
+ * var compiled = _.template('hello <%= data.name %>!', null, { 'variable': 'data' });
3729
+ * compiled.source;
3730
+ * // => function(data) {
3731
+ * var __t, __p = '', __e = _.escape;
3732
+ * __p += 'hello ' + ((__t = ( data.name )) == null ? '' : __t) + '!';
3733
+ * return __p;
3734
+ * }
3735
+ *
3736
+ * // using the `sourceURL` option to specify a custom sourceURL for the template
3737
+ * var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
3738
+ * compiled(data);
3739
+ * // => find the source of "greeting.jst" under the sources tab or resources panel of the web inspector
3740
+ *
3741
+ * // using the `source` property to inline compiled templates for meaningful
3742
+ * // line numbers in error messages and a stack trace
3743
+ * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
3744
+ * var JST = {\
3745
+ * "main": ' + _.template(mainText).source + '\
3746
+ * };\
3747
+ * ');
3748
+ */
3749
+ function template(text, data, options) {
3750
+ // based on John Resig's `tmpl` implementation
3751
+ // http://ejohn.org/blog/javascript-micro-templating/
3752
+ // and Laura Doktorova's doT.js
3753
+ // https://github.com/olado/doT
3754
+ text || (text = '');
3755
+ options || (options = {});
3756
+
3757
+ var isEvaluating,
3758
+ result,
3759
+ index = 0,
3760
+ settings = lodash.templateSettings,
3761
+ source = "__p += '",
3762
+ variable = options.variable || settings.variable,
3763
+ hasVariable = variable;
3764
+
3765
+ // compile regexp to match each delimiter
3766
+ var reDelimiters = RegExp(
3767
+ (options.escape || settings.escape || reNoMatch).source + '|' +
3768
+ (options.interpolate || settings.interpolate || reNoMatch).source + '|' +
3769
+ (options.evaluate || settings.evaluate || reNoMatch).source + '|$'
3770
+ , 'g');
3771
+
3772
+ text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {
3773
+ // escape characters that cannot be included in string literals
3774
+ source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
3775
+
3776
+ // replace delimiters with snippets
3777
+ source +=
3778
+ escapeValue ? "' +\n__e(" + escapeValue + ") +\n'" :
3779
+ evaluateValue ? "';\n" + evaluateValue + ";\n__p += '" :
3780
+ interpolateValue ? "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'" : '';
3781
+
3782
+ isEvaluating || (isEvaluating = evaluateValue || reComplexDelimiter.test(escapeValue || interpolateValue));
3783
+ index = offset + match.length;
3784
+ });
3785
+
3786
+ source += "';\n";
3787
+
3788
+ // if `variable` is not specified and the template contains "evaluate"
3789
+ // delimiters, wrap a with-statement around the generated code to add the
3790
+ // data object to the top of the scope chain
3791
+ if (!hasVariable) {
3792
+ variable = 'obj';
3793
+ if (isEvaluating) {
3794
+ source = 'with (' + variable + ') {\n' + source + '\n}\n';
3795
+ }
3796
+ else {
3797
+ // avoid a with-statement by prepending data object references to property names
3798
+ var reDoubleVariable = RegExp('(\\(\\s*)' + variable + '\\.' + variable + '\\b', 'g');
3799
+ source = source
3800
+ .replace(reInsertVariable, '$&' + variable + '.')
3801
+ .replace(reDoubleVariable, '$1__d');
3802
+ }
3803
+ }
3804
+
3805
+ // cleanup code by stripping empty strings
3806
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
3807
+ .replace(reEmptyStringMiddle, '$1')
3808
+ .replace(reEmptyStringTrailing, '$1;');
3809
+
3810
+ // frame code as the function body
3811
+ source = 'function(' + variable + ') {\n' +
3812
+ (hasVariable ? '' : variable + ' || (' + variable + ' = {});\n') +
3813
+ 'var __t, __p = \'\', __e = _.escape' +
3814
+ (isEvaluating
3815
+ ? ', __j = Array.prototype.join;\n' +
3816
+ 'function print() { __p += __j.call(arguments, \'\') }\n'
3817
+ : (hasVariable ? '' : ', __d = ' + variable + '.' + variable + ' || ' + variable) + ';\n'
3818
+ ) +
3819
+ source +
3820
+ 'return __p\n}';
3821
+
3822
+ // use a sourceURL for easier debugging
3823
+ // http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
3824
+ var sourceURL = useSourceURL
3825
+ ? '\n//@ sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']')
3826
+ : '';
3827
+
3828
+ try {
3829
+ result = Function('_', 'return ' + source + sourceURL)(lodash);
3830
+ } catch(e) {
3831
+ e.source = source;
3832
+ throw e;
3833
+ }
3834
+
3835
+ if (data) {
3836
+ return result(data);
3837
+ }
3838
+ // provide the compiled function's source via its `toString` method, in
3839
+ // supported environments, or the `source` property as a convenience for
3840
+ // inlining compiled templates during the build process
3841
+ result.source = source;
3842
+ return result;
3843
+ }
3844
+
3845
+ /**
3846
+ * Executes the `callback` function `n` times, returning an array of the results
3847
+ * of each `callback` execution. The `callback` is bound to `thisArg` and invoked
3848
+ * with one argument; (index).
3849
+ *
3850
+ * @static
3851
+ * @memberOf _
3852
+ * @category Utilities
3853
+ * @param {Number} n The number of times to execute the callback.
3854
+ * @param {Function} callback The function called per iteration.
3855
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
3856
+ * @returns {Array} Returns a new array of the results of each `callback` execution.
3857
+ * @example
3858
+ *
3859
+ * var diceRolls = _.times(3, _.partial(_.random, 1, 6));
3860
+ * // => [3, 6, 4]
3861
+ *
3862
+ * _.times(3, function(n) { mage.castSpell(n); });
3863
+ * // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively
3864
+ *
3865
+ * _.times(3, function(n) { this.cast(n); }, mage);
3866
+ * // => also calls `mage.castSpell(n)` three times
3867
+ */
3868
+ function times(n, callback, thisArg) {
3869
+ n = +n || 0;
3870
+ var index = -1,
3871
+ result = Array(n);
3872
+
3873
+ while (++index < n) {
3874
+ result[index] = callback.call(thisArg, index);
3875
+ }
3876
+ return result;
3877
+ }
3878
+
3879
+ /**
3880
+ * Converts the HTML entities `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#x27;`
3881
+ * in `string` to their corresponding characters.
3882
+ *
3883
+ * @static
3884
+ * @memberOf _
3885
+ * @category Utilities
3886
+ * @param {String} string The string to unescape.
3887
+ * @returns {String} Returns the unescaped string.
3888
+ * @example
3889
+ *
3890
+ * _.unescape('Moe, Larry &amp; Curly');
3891
+ * // => "Moe, Larry & Curly"
3892
+ */
3893
+ function unescape(string) {
3894
+ return string == null ? '' : (string + '').replace(reEscapedHtml, unescapeHtmlChar);
3895
+ }
3896
+
3897
+ /**
3898
+ * Generates a unique id. If `prefix` is passed, the id will be appended to it.
3899
+ *
3900
+ * @static
3901
+ * @memberOf _
3902
+ * @category Utilities
3903
+ * @param {String} [prefix] The value to prefix the id with.
3904
+ * @returns {Number|String} Returns a numeric id if no prefix is passed, else
3905
+ * a string id may be returned.
3906
+ * @example
3907
+ *
3908
+ * _.uniqueId('contact_');
3909
+ * // => 'contact_104'
3910
+ */
3911
+ function uniqueId(prefix) {
3912
+ var id = idCounter++;
3913
+ return prefix ? prefix + id : id;
3914
+ }
3915
+
3916
+ /*--------------------------------------------------------------------------*/
3917
+
3918
+ /**
3919
+ * Wraps the value in a `lodash` wrapper object.
3920
+ *
3921
+ * @static
3922
+ * @memberOf _
3923
+ * @category Chaining
3924
+ * @param {Mixed} value The value to wrap.
3925
+ * @returns {Object} Returns the wrapper object.
3926
+ * @example
3927
+ *
3928
+ * var stooges = [
3929
+ * { 'name': 'moe', 'age': 40 },
3930
+ * { 'name': 'larry', 'age': 50 },
3931
+ * { 'name': 'curly', 'age': 60 }
3932
+ * ];
3933
+ *
3934
+ * var youngest = _.chain(stooges)
3935
+ * .sortBy(function(stooge) { return stooge.age; })
3936
+ * .map(function(stooge) { return stooge.name + ' is ' + stooge.age; })
3937
+ * .first()
3938
+ * .value();
3939
+ * // => 'moe is 40'
3940
+ */
3941
+ function chain(value) {
3942
+ value = new lodash(value);
3943
+ value.__chain__ = true;
3944
+ return value;
3945
+ }
3946
+
3947
+ /**
3948
+ * Invokes `interceptor` with the `value` as the first argument, and then
3949
+ * returns `value`. The purpose of this method is to "tap into" a method chain,
3950
+ * in order to perform operations on intermediate results within the chain.
3951
+ *
3952
+ * @static
3953
+ * @memberOf _
3954
+ * @category Chaining
3955
+ * @param {Mixed} value The value to pass to `interceptor`.
3956
+ * @param {Function} interceptor The function to invoke.
3957
+ * @returns {Mixed} Returns `value`.
3958
+ * @example
3959
+ *
3960
+ * _.chain([1, 2, 3, 200])
3961
+ * .filter(function(num) { return num % 2 == 0; })
3962
+ * .tap(alert)
3963
+ * .map(function(num) { return num * num })
3964
+ * .value();
3965
+ * // => // [2, 200] (alerted)
3966
+ * // => [4, 40000]
3967
+ */
3968
+ function tap(value, interceptor) {
3969
+ interceptor(value);
3970
+ return value;
3971
+ }
3972
+
3973
+ /**
3974
+ * Enables method chaining on the wrapper object.
3975
+ *
3976
+ * @name chain
3977
+ * @deprecated
3978
+ * @memberOf _
3979
+ * @category Chaining
3980
+ * @returns {Mixed} Returns the wrapper object.
3981
+ * @example
3982
+ *
3983
+ * _([1, 2, 3]).value();
3984
+ * // => [1, 2, 3]
3985
+ */
3986
+ function wrapperChain() {
3987
+ this.__chain__ = true;
3988
+ return this;
3989
+ }
3990
+
3991
+ /**
3992
+ * Extracts the wrapped value.
3993
+ *
3994
+ * @name value
3995
+ * @memberOf _
3996
+ * @category Chaining
3997
+ * @returns {Mixed} Returns the wrapped value.
3998
+ * @example
3999
+ *
4000
+ * _([1, 2, 3]).value();
4001
+ * // => [1, 2, 3]
4002
+ */
4003
+ function wrapperValue() {
4004
+ return this.__wrapped__;
4005
+ }
4006
+
4007
+ /*--------------------------------------------------------------------------*/
4008
+
4009
+ /**
4010
+ * The semantic version number.
4011
+ *
4012
+ * @static
4013
+ * @memberOf _
4014
+ * @type String
4015
+ */
4016
+ lodash.VERSION = '0.8.2';
4017
+
4018
+ // assign static methods
4019
+ lodash.after = after;
4020
+ lodash.bind = bind;
4021
+ lodash.bindAll = bindAll;
4022
+ lodash.chain = chain;
4023
+ lodash.clone = clone;
4024
+ lodash.compact = compact;
4025
+ lodash.compose = compose;
4026
+ lodash.contains = contains;
4027
+ lodash.countBy = countBy;
4028
+ lodash.debounce = debounce;
4029
+ lodash.defaults = defaults;
4030
+ lodash.defer = defer;
4031
+ lodash.delay = delay;
4032
+ lodash.difference = difference;
4033
+ lodash.escape = escape;
4034
+ lodash.every = every;
4035
+ lodash.extend = extend;
4036
+ lodash.filter = filter;
4037
+ lodash.find = find;
4038
+ lodash.first = first;
4039
+ lodash.flatten = flatten;
4040
+ lodash.forEach = forEach;
4041
+ lodash.forIn = forIn;
4042
+ lodash.forOwn = forOwn;
4043
+ lodash.functions = functions;
4044
+ lodash.groupBy = groupBy;
4045
+ lodash.has = has;
4046
+ lodash.identity = identity;
4047
+ lodash.indexOf = indexOf;
4048
+ lodash.initial = initial;
4049
+ lodash.intersection = intersection;
4050
+ lodash.invert = invert;
4051
+ lodash.invoke = invoke;
4052
+ lodash.isArguments = isArguments;
4053
+ lodash.isArray = isArray;
4054
+ lodash.isBoolean = isBoolean;
4055
+ lodash.isDate = isDate;
4056
+ lodash.isElement = isElement;
4057
+ lodash.isEmpty = isEmpty;
4058
+ lodash.isEqual = isEqual;
4059
+ lodash.isFinite = isFinite;
4060
+ lodash.isFunction = isFunction;
4061
+ lodash.isNaN = isNaN;
4062
+ lodash.isNull = isNull;
4063
+ lodash.isNumber = isNumber;
4064
+ lodash.isObject = isObject;
4065
+ lodash.isPlainObject = isPlainObject;
4066
+ lodash.isRegExp = isRegExp;
4067
+ lodash.isString = isString;
4068
+ lodash.isUndefined = isUndefined;
4069
+ lodash.keys = keys;
4070
+ lodash.last = last;
4071
+ lodash.lastIndexOf = lastIndexOf;
4072
+ lodash.lateBind = lateBind;
4073
+ lodash.map = map;
4074
+ lodash.max = max;
4075
+ lodash.memoize = memoize;
4076
+ lodash.merge = merge;
4077
+ lodash.min = min;
4078
+ lodash.mixin = mixin;
4079
+ lodash.noConflict = noConflict;
4080
+ lodash.object = object;
4081
+ lodash.omit = omit;
4082
+ lodash.once = once;
4083
+ lodash.pairs = pairs;
4084
+ lodash.partial = partial;
4085
+ lodash.pick = pick;
4086
+ lodash.pluck = pluck;
4087
+ lodash.random = random;
4088
+ lodash.range = range;
4089
+ lodash.reduce = reduce;
4090
+ lodash.reduceRight = reduceRight;
4091
+ lodash.reject = reject;
4092
+ lodash.rest = rest;
4093
+ lodash.result = result;
4094
+ lodash.shuffle = shuffle;
4095
+ lodash.size = size;
4096
+ lodash.some = some;
4097
+ lodash.sortBy = sortBy;
4098
+ lodash.sortedIndex = sortedIndex;
4099
+ lodash.tap = tap;
4100
+ lodash.template = template;
4101
+ lodash.throttle = throttle;
4102
+ lodash.times = times;
4103
+ lodash.toArray = toArray;
4104
+ lodash.unescape = unescape;
4105
+ lodash.union = union;
4106
+ lodash.uniq = uniq;
4107
+ lodash.uniqueId = uniqueId;
4108
+ lodash.values = values;
4109
+ lodash.where = where;
4110
+ lodash.without = without;
4111
+ lodash.wrap = wrap;
4112
+ lodash.zip = zip;
4113
+
4114
+ // assign aliases
4115
+ lodash.all = every;
4116
+ lodash.any = some;
4117
+ lodash.collect = map;
4118
+ lodash.detect = find;
4119
+ lodash.drop = rest;
4120
+ lodash.each = forEach;
4121
+ lodash.foldl = reduce;
4122
+ lodash.foldr = reduceRight;
4123
+ lodash.head = first;
4124
+ lodash.include = contains;
4125
+ lodash.inject = reduce;
4126
+ lodash.methods = functions;
4127
+ lodash.select = filter;
4128
+ lodash.tail = rest;
4129
+ lodash.take = first;
4130
+ lodash.unique = uniq;
4131
+
4132
+ // add pseudo private properties used and removed during the build process
4133
+ lodash._iteratorTemplate = iteratorTemplate;
4134
+ lodash._shimKeys = shimKeys;
4135
+
4136
+ /*--------------------------------------------------------------------------*/
4137
+
4138
+ // add all static functions to `lodash.prototype`
4139
+ mixin(lodash);
4140
+
4141
+ // add `lodash.prototype.chain` after calling `mixin()` to avoid overwriting
4142
+ // it with the wrapped `lodash.chain`
4143
+ lodash.prototype.chain = wrapperChain;
4144
+ lodash.prototype.value = wrapperValue;
4145
+
4146
+ // add all mutator Array functions to the wrapper.
4147
+ forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
4148
+ var func = ArrayProto[methodName];
4149
+
4150
+ lodash.prototype[methodName] = function() {
4151
+ var value = this.__wrapped__;
4152
+ func.apply(value, arguments);
4153
+
4154
+ // avoid array-like object bugs with `Array#shift` and `Array#splice` in
4155
+ // Firefox < 10 and IE < 9
4156
+ if (hasObjectSpliceBug && value.length === 0) {
4157
+ delete value[0];
4158
+ }
4159
+ if (this.__chain__) {
4160
+ value = new lodash(value);
4161
+ value.__chain__ = true;
4162
+ }
4163
+ return value;
4164
+ };
4165
+ });
4166
+
4167
+ // add all accessor Array functions to the wrapper.
4168
+ forEach(['concat', 'join', 'slice'], function(methodName) {
4169
+ var func = ArrayProto[methodName];
4170
+
4171
+ lodash.prototype[methodName] = function() {
4172
+ var value = this.__wrapped__,
4173
+ result = func.apply(value, arguments);
4174
+
4175
+ if (this.__chain__) {
4176
+ result = new lodash(result);
4177
+ result.__chain__ = true;
4178
+ }
4179
+ return result;
4180
+ };
4181
+ });
4182
+
4183
+ /*--------------------------------------------------------------------------*/
4184
+
4185
+ // expose Lo-Dash
4186
+ // some AMD build optimizers, like r.js, check for specific condition patterns like the following:
4187
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
4188
+ // Expose Lo-Dash to the global object even when an AMD loader is present in
4189
+ // case Lo-Dash was injected by a third-party script and not intended to be
4190
+ // loaded as a module. The global assignment can be reverted in the Lo-Dash
4191
+ // module via its `noConflict()` method.
4192
+ window._ = lodash;
4193
+
4194
+ // define as an anonymous module so, through path mapping, it can be
4195
+ // referenced as the "underscore" module
4196
+ define(function() {
4197
+ return lodash;
4198
+ });
4199
+ }
4200
+ // check for `exports` after `define` in case a build optimizer adds an `exports` object
4201
+ else if (freeExports) {
4202
+ // in Node.js or RingoJS v0.8.0+
4203
+ if (typeof module == 'object' && module && module.exports == freeExports) {
4204
+ (module.exports = lodash)._ = lodash;
4205
+ }
4206
+ // in Narwhal or RingoJS v0.7.0-
4207
+ else {
4208
+ freeExports._ = lodash;
4209
+ }
4210
+ }
4211
+ else {
4212
+ // in a browser or Rhino
4213
+ window._ = lodash;
4214
+ }
4215
+ }(this));