sw2at-ui 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/Gemfile +21 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/app/assets/images/swat/loading-green.gif +0 -0
- data/app/assets/javascripts/swat/.bowerrc +3 -0
- data/app/assets/javascripts/swat/app/app.coffee +38 -0
- data/app/assets/javascripts/swat/app/controllers/revision.coffee +25 -0
- data/app/assets/javascripts/swat/app/controllers/revisions.coffee +10 -0
- data/app/assets/javascripts/swat/app/controllers/root.coffee +8 -0
- data/app/assets/javascripts/swat/app/factories/response.coffee +9 -0
- data/app/assets/javascripts/swat/app/factories/revision_model.coffee +20 -0
- data/app/assets/javascripts/swat/app/services/revision.coffee +16 -0
- data/app/assets/javascripts/swat/app/services/test_case.coffee +8 -0
- data/app/assets/javascripts/swat/application.coffee +5 -0
- data/app/assets/javascripts/swat/bower.json +16 -0
- data/app/assets/javascripts/swat/bower_components/angular/angular-csp.css +21 -0
- data/app/assets/javascripts/swat/bower_components/angular/angular.js +28133 -0
- data/app/assets/javascripts/swat/bower_components/angular/angular.min.js +289 -0
- data/app/assets/javascripts/swat/bower_components/angular/index.js +2 -0
- data/app/assets/javascripts/swat/bower_components/angular-animate/angular-animate.js +2137 -0
- data/app/assets/javascripts/swat/bower_components/angular-animate/angular-animate.min.js +33 -0
- data/app/assets/javascripts/swat/bower_components/angular-aria/angular-aria.js +339 -0
- data/app/assets/javascripts/swat/bower_components/angular-aria/angular-aria.min.js +12 -0
- data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-csp.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-tpls.js +4840 -0
- data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js +10 -0
- data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap.js +4461 -0
- data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap.min.js +9 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/LICENSE.txt +21 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.css +6228 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.js +8602 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.min.js +277 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/default-theme.css +394 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop.css +54 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop.js +40 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.css +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.css +161 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.js +263 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button-default-theme.css +49 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button.css +134 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button.js +101 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card-default-theme.css +10 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card.css +26 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card.js +60 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css +38 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox.css +78 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox.js +135 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content.css +24 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content.js +87 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/core.css +2736 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/core.js +3090 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/default-theme.js +1 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.css +11 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog.css +75 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog.js +500 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider.css +12 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider.js +50 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/icon/icon.css +24 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/icon/icon.js +52 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input-default-theme.css +39 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input.css +113 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input.js +355 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/list/list.css +56 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/list/list.js +96 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/menu/menu.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/menu/menu.js +29 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.css +35 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular.css +1395 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular.js +129 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.css +26 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear.css +366 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear.js +130 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.css +39 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton.css +66 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton.js +302 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav.css +86 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav.js +320 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider-default-theme.css +55 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider.css +210 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider.js +391 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sticky/sticky.css +20 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sticky/sticky.js +314 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.css +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader.css +62 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader.js +89 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/swipe/swipe.js +79 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch-default-theme.css +29 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch.css +81 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch.js +171 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.css +34 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs.css +171 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs.js +1009 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField-default-theme.css +29 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField.css +72 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField.js +145 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast-default-theme.css +17 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast.css +110 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast.js +236 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.css +17 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar.css +69 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar.js +161 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.css +10 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip.css +133 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip.js +199 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/whiteframe/whiteframe.css +20 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/whiteframe/whiteframe.js +17 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/css/angular-material-layout.css +2582 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.css +54 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.js +38 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.css +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.css +188 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.js +293 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button-default-theme.css +42 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.css +132 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.js +94 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card-default-theme.css +10 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.css +31 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.js +58 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.css +38 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.css +79 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.js +133 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.css +24 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.js +60 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.css +3067 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.js +2780 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/default-theme.js +1 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog-default-theme.css +11 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.css +88 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.js +495 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.css +12 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.js +48 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.css +24 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.js +50 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input-default-theme.css +40 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.css +102 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.js +333 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.css +61 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.js +94 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/bower.json +5 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.js +27 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.css +35 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.css +1445 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.js +127 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.css +28 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.css +368 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.js +128 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.css +39 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.css +67 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.js +296 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.css +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.css +90 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.js +302 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider-default-theme.css +55 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.css +218 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.js +411 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.css +20 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.js +309 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader-default-theme.css +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.css +61 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.js +86 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/bower.json +5 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/swipe.js +213 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/swipe.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch-default-theme.css +29 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.css +77 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.js +144 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs-default-theme.css +34 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.css +181 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.js +992 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField-default-theme.css +29 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.css +76 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.js +143 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/bower.json +9 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast-default-theme.css +17 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.css +115 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.js +235 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/bower.json +8 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.css +17 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.css +78 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.js +158 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/bower.json +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.css +10 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.css +136 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.js +197 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/bower.json +5 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.css +20 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.js +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.css +6 -0
- data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-resource/angular-resource.js +668 -0
- data/app/assets/javascripts/swat/bower_components/angular-resource/angular-resource.min.js +13 -0
- data/app/assets/javascripts/swat/bower_components/angular-resource/index.js +2 -0
- data/app/assets/javascripts/swat/bower_components/angular-route/angular-route.js +991 -0
- data/app/assets/javascripts/swat/bower_components/angular-route/angular-route.min.js +15 -0
- data/app/assets/javascripts/swat/bower_components/angular-route/index.js +2 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/LICENSE.txt +21 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/api/angular-ui-router.d.ts +126 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/release/angular-ui-router.js +4370 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/release/angular-ui-router.min.js +7 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/common.js +292 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/resolve.js +252 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/state.js +1465 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/stateDirectives.js +285 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/stateFilters.js +39 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/templateFactory.js +110 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/urlMatcherFactory.js +1050 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/urlRouter.js +427 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/view.js +71 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/viewDirective.js +303 -0
- data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/viewScroll.js +52 -0
- data/app/assets/javascripts/swat/bower_components/lodash/lodash.js +12235 -0
- data/app/assets/javascripts/swat/bower_components/lodash/lodash.min.js +98 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/.editorconfig +10 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/.gitignore +3 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/Gruntfile.js +96 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/dest/ng-clip.min.js +2 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/example/bootstrap-tooltip.html +49 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/example/index.html +68 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/example/ng-repeat.html +44 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/npm-debug.log +145 -0
- data/app/assets/javascripts/swat/bower_components/ng-clip/src/ngClip.js +84 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/.jshintrc +70 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.Core.js +2017 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.Core.min.js +10 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.js +2581 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.min.js +10 -0
- data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.swf +0 -0
- data/app/assets/javascripts/swat/bower_components.coffee +12 -0
- data/app/assets/stylesheets/swat/application.sass +59 -0
- data/app/assets/stylesheets/swat/default-theme.css +394 -0
- data/app/assets/stylesheets/swat/font-awesome.css +1801 -0
- data/app/assets/stylesheets/swat/fonts/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.svg +565 -0
- data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/stylesheets/swat/swat_theme.sass +177 -0
- data/app/controllers/swat/api/revisions_controller.rb +27 -0
- data/app/controllers/swat/api/test_cases_controller.rb +20 -0
- data/app/controllers/swat/application_controller.rb +4 -0
- data/app/controllers/swat/info/states_controller.rb +12 -0
- data/app/controllers/swat/pages/base_pages_controller.rb +7 -0
- data/app/controllers/swat/pages/revisions_controller.rb +8 -0
- data/app/controllers/swat/revisions_controller.rb +4 -0
- data/app/helpers/swat/application_helper.rb +4 -0
- data/app/models/concerns/root_revision_ext.rb +14 -0
- data/app/models/full_revision.rb +88 -0
- data/app/models/revision.rb +84 -0
- data/app/models/revision_status_calculator.rb +98 -0
- data/app/models/test_case.rb +25 -0
- data/app/views/layouts/swat/application.slim +36 -0
- data/app/views/layouts/swat/page.slim +2 -0
- data/app/views/swat/application/index.slim +0 -0
- data/app/views/swat/pages/revisions/index.slim +25 -0
- data/app/views/swat/pages/revisions/show.slim +43 -0
- data/app/views/swat/shared/_footer.slim +5 -0
- data/app/views/swat/shared/_header.slim +9 -0
- data/bin/rails +12 -0
- data/config/routes.rb +38 -0
- data/fixtures/firebase_collection.rb +97 -0
- data/lib/sw2at-ui.rb +19 -0
- data/lib/swat/engine.rb +5 -0
- data/lib/swat/ui/config.rb +28 -0
- data/lib/swat/ui/rspec_commands.rb +191 -0
- data/lib/swat/ui/rspec_setup.rb +42 -0
- data/lib/swat/ui/stats_collector.rb +90 -0
- data/lib/swat/ui/version.rb +5 -0
- data/lib/tasks/swat_tasks.rake +36 -0
- data/spec/lib/commands_spec.rb +88 -0
- data/spec/models/calculator_spec.rb +130 -0
- data/spec/models/full_revision_spec.rb +263 -0
- data/spec/models/revision_spec.rb +59 -0
- data/spec/models/testcase_spec.rb +94 -0
- data/spec/spec_helper.rb +45 -0
- data/sw2at-ui.gemspec +465 -0
- data/test/helper.rb +34 -0
- data/test/test_sw2at-ui.rb +7 -0
- metadata +628 -0
@@ -0,0 +1,668 @@
|
|
1
|
+
/**
|
2
|
+
* @license AngularJS v1.4.0
|
3
|
+
* (c) 2010-2015 Google, Inc. http://angularjs.org
|
4
|
+
* License: MIT
|
5
|
+
*/
|
6
|
+
(function(window, angular, undefined) {'use strict';
|
7
|
+
|
8
|
+
var $resourceMinErr = angular.$$minErr('$resource');
|
9
|
+
|
10
|
+
// Helper functions and regex to lookup a dotted path on an object
|
11
|
+
// stopping at undefined/null. The path must be composed of ASCII
|
12
|
+
// identifiers (just like $parse)
|
13
|
+
var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;
|
14
|
+
|
15
|
+
function isValidDottedPath(path) {
|
16
|
+
return (path != null && path !== '' && path !== 'hasOwnProperty' &&
|
17
|
+
MEMBER_NAME_REGEX.test('.' + path));
|
18
|
+
}
|
19
|
+
|
20
|
+
function lookupDottedPath(obj, path) {
|
21
|
+
if (!isValidDottedPath(path)) {
|
22
|
+
throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
|
23
|
+
}
|
24
|
+
var keys = path.split('.');
|
25
|
+
for (var i = 0, ii = keys.length; i < ii && obj !== undefined; i++) {
|
26
|
+
var key = keys[i];
|
27
|
+
obj = (obj !== null) ? obj[key] : undefined;
|
28
|
+
}
|
29
|
+
return obj;
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Create a shallow copy of an object and clear other fields from the destination
|
34
|
+
*/
|
35
|
+
function shallowClearAndCopy(src, dst) {
|
36
|
+
dst = dst || {};
|
37
|
+
|
38
|
+
angular.forEach(dst, function(value, key) {
|
39
|
+
delete dst[key];
|
40
|
+
});
|
41
|
+
|
42
|
+
for (var key in src) {
|
43
|
+
if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
|
44
|
+
dst[key] = src[key];
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
return dst;
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* @ngdoc module
|
53
|
+
* @name ngResource
|
54
|
+
* @description
|
55
|
+
*
|
56
|
+
* # ngResource
|
57
|
+
*
|
58
|
+
* The `ngResource` module provides interaction support with RESTful services
|
59
|
+
* via the $resource service.
|
60
|
+
*
|
61
|
+
*
|
62
|
+
* <div doc-module-components="ngResource"></div>
|
63
|
+
*
|
64
|
+
* See {@link ngResource.$resource `$resource`} for usage.
|
65
|
+
*/
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @ngdoc service
|
69
|
+
* @name $resource
|
70
|
+
* @requires $http
|
71
|
+
*
|
72
|
+
* @description
|
73
|
+
* A factory which creates a resource object that lets you interact with
|
74
|
+
* [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
|
75
|
+
*
|
76
|
+
* The returned resource object has action methods which provide high-level behaviors without
|
77
|
+
* the need to interact with the low level {@link ng.$http $http} service.
|
78
|
+
*
|
79
|
+
* Requires the {@link ngResource `ngResource`} module to be installed.
|
80
|
+
*
|
81
|
+
* By default, trailing slashes will be stripped from the calculated URLs,
|
82
|
+
* which can pose problems with server backends that do not expect that
|
83
|
+
* behavior. This can be disabled by configuring the `$resourceProvider` like
|
84
|
+
* this:
|
85
|
+
*
|
86
|
+
* ```js
|
87
|
+
app.config(['$resourceProvider', function($resourceProvider) {
|
88
|
+
// Don't strip trailing slashes from calculated URLs
|
89
|
+
$resourceProvider.defaults.stripTrailingSlashes = false;
|
90
|
+
}]);
|
91
|
+
* ```
|
92
|
+
*
|
93
|
+
* @param {string} url A parameterized URL template with parameters prefixed by `:` as in
|
94
|
+
* `/user/:username`. If you are using a URL with a port number (e.g.
|
95
|
+
* `http://example.com:8080/api`), it will be respected.
|
96
|
+
*
|
97
|
+
* If you are using a url with a suffix, just add the suffix, like this:
|
98
|
+
* `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
|
99
|
+
* or even `$resource('http://example.com/resource/:resource_id.:format')`
|
100
|
+
* If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
|
101
|
+
* collapsed down to a single `.`. If you need this sequence to appear and not collapse then you
|
102
|
+
* can escape it with `/\.`.
|
103
|
+
*
|
104
|
+
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
|
105
|
+
* `actions` methods. If any of the parameter value is a function, it will be executed every time
|
106
|
+
* when a param value needs to be obtained for a request (unless the param was overridden).
|
107
|
+
*
|
108
|
+
* Each key value in the parameter object is first bound to url template if present and then any
|
109
|
+
* excess keys are appended to the url search query after the `?`.
|
110
|
+
*
|
111
|
+
* Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
|
112
|
+
* URL `/path/greet?salutation=Hello`.
|
113
|
+
*
|
114
|
+
* If the parameter value is prefixed with `@` then the value for that parameter will be extracted
|
115
|
+
* from the corresponding property on the `data` object (provided when calling an action method). For
|
116
|
+
* example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`
|
117
|
+
* will be `data.someProp`.
|
118
|
+
*
|
119
|
+
* @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend
|
120
|
+
* the default set of resource actions. The declaration should be created in the format of {@link
|
121
|
+
* ng.$http#usage $http.config}:
|
122
|
+
*
|
123
|
+
* {action1: {method:?, params:?, isArray:?, headers:?, ...},
|
124
|
+
* action2: {method:?, params:?, isArray:?, headers:?, ...},
|
125
|
+
* ...}
|
126
|
+
*
|
127
|
+
* Where:
|
128
|
+
*
|
129
|
+
* - **`action`** – {string} – The name of action. This name becomes the name of the method on
|
130
|
+
* your resource object.
|
131
|
+
* - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
|
132
|
+
* `DELETE`, `JSONP`, etc).
|
133
|
+
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
|
134
|
+
* the parameter value is a function, it will be executed every time when a param value needs to
|
135
|
+
* be obtained for a request (unless the param was overridden).
|
136
|
+
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
|
137
|
+
* like for the resource-level urls.
|
138
|
+
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
|
139
|
+
* see `returns` section.
|
140
|
+
* - **`transformRequest`** –
|
141
|
+
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
142
|
+
* transform function or an array of such functions. The transform function takes the http
|
143
|
+
* request body and headers and returns its transformed (typically serialized) version.
|
144
|
+
* By default, transformRequest will contain one function that checks if the request data is
|
145
|
+
* an object and serializes to using `angular.toJson`. To prevent this behavior, set
|
146
|
+
* `transformRequest` to an empty array: `transformRequest: []`
|
147
|
+
* - **`transformResponse`** –
|
148
|
+
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
149
|
+
* transform function or an array of such functions. The transform function takes the http
|
150
|
+
* response body and headers and returns its transformed (typically deserialized) version.
|
151
|
+
* By default, transformResponse will contain one function that checks if the response looks like
|
152
|
+
* a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
|
153
|
+
* `transformResponse` to an empty array: `transformResponse: []`
|
154
|
+
* - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
|
155
|
+
* GET request, otherwise if a cache instance built with
|
156
|
+
* {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
|
157
|
+
* caching.
|
158
|
+
* - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
|
159
|
+
* should abort the request when resolved.
|
160
|
+
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
|
161
|
+
* XHR object. See
|
162
|
+
* [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
|
163
|
+
* for more information.
|
164
|
+
* - **`responseType`** - `{string}` - see
|
165
|
+
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
|
166
|
+
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
|
167
|
+
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
|
168
|
+
* with `http response` object. See {@link ng.$http $http interceptors}.
|
169
|
+
*
|
170
|
+
* @param {Object} options Hash with custom settings that should extend the
|
171
|
+
* default `$resourceProvider` behavior. The only supported option is
|
172
|
+
*
|
173
|
+
* Where:
|
174
|
+
*
|
175
|
+
* - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
|
176
|
+
* slashes from any calculated URL will be stripped. (Defaults to true.)
|
177
|
+
*
|
178
|
+
* @returns {Object} A resource "class" object with methods for the default set of resource actions
|
179
|
+
* optionally extended with custom `actions`. The default set contains these actions:
|
180
|
+
* ```js
|
181
|
+
* { 'get': {method:'GET'},
|
182
|
+
* 'save': {method:'POST'},
|
183
|
+
* 'query': {method:'GET', isArray:true},
|
184
|
+
* 'remove': {method:'DELETE'},
|
185
|
+
* 'delete': {method:'DELETE'} };
|
186
|
+
* ```
|
187
|
+
*
|
188
|
+
* Calling these methods invoke an {@link ng.$http} with the specified http method,
|
189
|
+
* destination and parameters. When the data is returned from the server then the object is an
|
190
|
+
* instance of the resource class. The actions `save`, `remove` and `delete` are available on it
|
191
|
+
* as methods with the `$` prefix. This allows you to easily perform CRUD operations (create,
|
192
|
+
* read, update, delete) on server-side data like this:
|
193
|
+
* ```js
|
194
|
+
* var User = $resource('/user/:userId', {userId:'@id'});
|
195
|
+
* var user = User.get({userId:123}, function() {
|
196
|
+
* user.abc = true;
|
197
|
+
* user.$save();
|
198
|
+
* });
|
199
|
+
* ```
|
200
|
+
*
|
201
|
+
* It is important to realize that invoking a $resource object method immediately returns an
|
202
|
+
* empty reference (object or array depending on `isArray`). Once the data is returned from the
|
203
|
+
* server the existing reference is populated with the actual data. This is a useful trick since
|
204
|
+
* usually the resource is assigned to a model which is then rendered by the view. Having an empty
|
205
|
+
* object results in no rendering, once the data arrives from the server then the object is
|
206
|
+
* populated with the data and the view automatically re-renders itself showing the new data. This
|
207
|
+
* means that in most cases one never has to write a callback function for the action methods.
|
208
|
+
*
|
209
|
+
* The action methods on the class object or instance object can be invoked with the following
|
210
|
+
* parameters:
|
211
|
+
*
|
212
|
+
* - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
|
213
|
+
* - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
|
214
|
+
* - non-GET instance actions: `instance.$action([parameters], [success], [error])`
|
215
|
+
*
|
216
|
+
*
|
217
|
+
* Success callback is called with (value, responseHeaders) arguments. Error callback is called
|
218
|
+
* with (httpResponse) argument.
|
219
|
+
*
|
220
|
+
* Class actions return empty instance (with additional properties below).
|
221
|
+
* Instance actions return promise of the action.
|
222
|
+
*
|
223
|
+
* The Resource instances and collection have these additional properties:
|
224
|
+
*
|
225
|
+
* - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
|
226
|
+
* instance or collection.
|
227
|
+
*
|
228
|
+
* On success, the promise is resolved with the same resource instance or collection object,
|
229
|
+
* updated with data from server. This makes it easy to use in
|
230
|
+
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
|
231
|
+
* rendering until the resource(s) are loaded.
|
232
|
+
*
|
233
|
+
* On failure, the promise is resolved with the {@link ng.$http http response} object, without
|
234
|
+
* the `resource` property.
|
235
|
+
*
|
236
|
+
* If an interceptor object was provided, the promise will instead be resolved with the value
|
237
|
+
* returned by the interceptor.
|
238
|
+
*
|
239
|
+
* - `$resolved`: `true` after first server interaction is completed (either with success or
|
240
|
+
* rejection), `false` before that. Knowing if the Resource has been resolved is useful in
|
241
|
+
* data-binding.
|
242
|
+
*
|
243
|
+
* @example
|
244
|
+
*
|
245
|
+
* # Credit card resource
|
246
|
+
*
|
247
|
+
* ```js
|
248
|
+
// Define CreditCard class
|
249
|
+
var CreditCard = $resource('/user/:userId/card/:cardId',
|
250
|
+
{userId:123, cardId:'@id'}, {
|
251
|
+
charge: {method:'POST', params:{charge:true}}
|
252
|
+
});
|
253
|
+
|
254
|
+
// We can retrieve a collection from the server
|
255
|
+
var cards = CreditCard.query(function() {
|
256
|
+
// GET: /user/123/card
|
257
|
+
// server returns: [ {id:456, number:'1234', name:'Smith'} ];
|
258
|
+
|
259
|
+
var card = cards[0];
|
260
|
+
// each item is an instance of CreditCard
|
261
|
+
expect(card instanceof CreditCard).toEqual(true);
|
262
|
+
card.name = "J. Smith";
|
263
|
+
// non GET methods are mapped onto the instances
|
264
|
+
card.$save();
|
265
|
+
// POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
|
266
|
+
// server returns: {id:456, number:'1234', name: 'J. Smith'};
|
267
|
+
|
268
|
+
// our custom method is mapped as well.
|
269
|
+
card.$charge({amount:9.99});
|
270
|
+
// POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
|
271
|
+
});
|
272
|
+
|
273
|
+
// we can create an instance as well
|
274
|
+
var newCard = new CreditCard({number:'0123'});
|
275
|
+
newCard.name = "Mike Smith";
|
276
|
+
newCard.$save();
|
277
|
+
// POST: /user/123/card {number:'0123', name:'Mike Smith'}
|
278
|
+
// server returns: {id:789, number:'0123', name: 'Mike Smith'};
|
279
|
+
expect(newCard.id).toEqual(789);
|
280
|
+
* ```
|
281
|
+
*
|
282
|
+
* The object returned from this function execution is a resource "class" which has "static" method
|
283
|
+
* for each action in the definition.
|
284
|
+
*
|
285
|
+
* Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
|
286
|
+
* `headers`.
|
287
|
+
* When the data is returned from the server then the object is an instance of the resource type and
|
288
|
+
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
|
289
|
+
* operations (create, read, update, delete) on server-side data.
|
290
|
+
|
291
|
+
```js
|
292
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
293
|
+
User.get({userId:123}, function(user) {
|
294
|
+
user.abc = true;
|
295
|
+
user.$save();
|
296
|
+
});
|
297
|
+
```
|
298
|
+
*
|
299
|
+
* It's worth noting that the success callback for `get`, `query` and other methods gets passed
|
300
|
+
* in the response that came from the server as well as $http header getter function, so one
|
301
|
+
* could rewrite the above example and get access to http headers as:
|
302
|
+
*
|
303
|
+
```js
|
304
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
305
|
+
User.get({userId:123}, function(u, getResponseHeaders){
|
306
|
+
u.abc = true;
|
307
|
+
u.$save(function(u, putResponseHeaders) {
|
308
|
+
//u => saved user object
|
309
|
+
//putResponseHeaders => $http header getter
|
310
|
+
});
|
311
|
+
});
|
312
|
+
```
|
313
|
+
*
|
314
|
+
* You can also access the raw `$http` promise via the `$promise` property on the object returned
|
315
|
+
*
|
316
|
+
```
|
317
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
318
|
+
User.get({userId:123})
|
319
|
+
.$promise.then(function(user) {
|
320
|
+
$scope.user = user;
|
321
|
+
});
|
322
|
+
```
|
323
|
+
|
324
|
+
* # Creating a custom 'PUT' request
|
325
|
+
* In this example we create a custom method on our resource to make a PUT request
|
326
|
+
* ```js
|
327
|
+
* var app = angular.module('app', ['ngResource', 'ngRoute']);
|
328
|
+
*
|
329
|
+
* // Some APIs expect a PUT request in the format URL/object/ID
|
330
|
+
* // Here we are creating an 'update' method
|
331
|
+
* app.factory('Notes', ['$resource', function($resource) {
|
332
|
+
* return $resource('/notes/:id', null,
|
333
|
+
* {
|
334
|
+
* 'update': { method:'PUT' }
|
335
|
+
* });
|
336
|
+
* }]);
|
337
|
+
*
|
338
|
+
* // In our controller we get the ID from the URL using ngRoute and $routeParams
|
339
|
+
* // We pass in $routeParams and our Notes factory along with $scope
|
340
|
+
* app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
|
341
|
+
function($scope, $routeParams, Notes) {
|
342
|
+
* // First get a note object from the factory
|
343
|
+
* var note = Notes.get({ id:$routeParams.id });
|
344
|
+
* $id = note.id;
|
345
|
+
*
|
346
|
+
* // Now call update passing in the ID first then the object you are updating
|
347
|
+
* Notes.update({ id:$id }, note);
|
348
|
+
*
|
349
|
+
* // This will PUT /notes/ID with the note object in the request payload
|
350
|
+
* }]);
|
351
|
+
* ```
|
352
|
+
*/
|
353
|
+
angular.module('ngResource', ['ng']).
|
354
|
+
provider('$resource', function() {
|
355
|
+
var provider = this;
|
356
|
+
|
357
|
+
this.defaults = {
|
358
|
+
// Strip slashes by default
|
359
|
+
stripTrailingSlashes: true,
|
360
|
+
|
361
|
+
// Default actions configuration
|
362
|
+
actions: {
|
363
|
+
'get': {method: 'GET'},
|
364
|
+
'save': {method: 'POST'},
|
365
|
+
'query': {method: 'GET', isArray: true},
|
366
|
+
'remove': {method: 'DELETE'},
|
367
|
+
'delete': {method: 'DELETE'}
|
368
|
+
}
|
369
|
+
};
|
370
|
+
|
371
|
+
this.$get = ['$http', '$q', function($http, $q) {
|
372
|
+
|
373
|
+
var noop = angular.noop,
|
374
|
+
forEach = angular.forEach,
|
375
|
+
extend = angular.extend,
|
376
|
+
copy = angular.copy,
|
377
|
+
isFunction = angular.isFunction;
|
378
|
+
|
379
|
+
/**
|
380
|
+
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
|
381
|
+
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set
|
382
|
+
* (pchar) allowed in path segments:
|
383
|
+
* segment = *pchar
|
384
|
+
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
385
|
+
* pct-encoded = "%" HEXDIG HEXDIG
|
386
|
+
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
387
|
+
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
388
|
+
* / "*" / "+" / "," / ";" / "="
|
389
|
+
*/
|
390
|
+
function encodeUriSegment(val) {
|
391
|
+
return encodeUriQuery(val, true).
|
392
|
+
replace(/%26/gi, '&').
|
393
|
+
replace(/%3D/gi, '=').
|
394
|
+
replace(/%2B/gi, '+');
|
395
|
+
}
|
396
|
+
|
397
|
+
|
398
|
+
/**
|
399
|
+
* This method is intended for encoding *key* or *value* parts of query component. We need a
|
400
|
+
* custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
|
401
|
+
* have to be encoded per http://tools.ietf.org/html/rfc3986:
|
402
|
+
* query = *( pchar / "/" / "?" )
|
403
|
+
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
404
|
+
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
405
|
+
* pct-encoded = "%" HEXDIG HEXDIG
|
406
|
+
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
407
|
+
* / "*" / "+" / "," / ";" / "="
|
408
|
+
*/
|
409
|
+
function encodeUriQuery(val, pctEncodeSpaces) {
|
410
|
+
return encodeURIComponent(val).
|
411
|
+
replace(/%40/gi, '@').
|
412
|
+
replace(/%3A/gi, ':').
|
413
|
+
replace(/%24/g, '$').
|
414
|
+
replace(/%2C/gi, ',').
|
415
|
+
replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
|
416
|
+
}
|
417
|
+
|
418
|
+
function Route(template, defaults) {
|
419
|
+
this.template = template;
|
420
|
+
this.defaults = extend({}, provider.defaults, defaults);
|
421
|
+
this.urlParams = {};
|
422
|
+
}
|
423
|
+
|
424
|
+
Route.prototype = {
|
425
|
+
setUrlParams: function(config, params, actionUrl) {
|
426
|
+
var self = this,
|
427
|
+
url = actionUrl || self.template,
|
428
|
+
val,
|
429
|
+
encodedVal;
|
430
|
+
|
431
|
+
var urlParams = self.urlParams = {};
|
432
|
+
forEach(url.split(/\W/), function(param) {
|
433
|
+
if (param === 'hasOwnProperty') {
|
434
|
+
throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
|
435
|
+
}
|
436
|
+
if (!(new RegExp("^\\d+$").test(param)) && param &&
|
437
|
+
(new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
|
438
|
+
urlParams[param] = true;
|
439
|
+
}
|
440
|
+
});
|
441
|
+
url = url.replace(/\\:/g, ':');
|
442
|
+
|
443
|
+
params = params || {};
|
444
|
+
forEach(self.urlParams, function(_, urlParam) {
|
445
|
+
val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
|
446
|
+
if (angular.isDefined(val) && val !== null) {
|
447
|
+
encodedVal = encodeUriSegment(val);
|
448
|
+
url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
|
449
|
+
return encodedVal + p1;
|
450
|
+
});
|
451
|
+
} else {
|
452
|
+
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
|
453
|
+
leadingSlashes, tail) {
|
454
|
+
if (tail.charAt(0) == '/') {
|
455
|
+
return tail;
|
456
|
+
} else {
|
457
|
+
return leadingSlashes + tail;
|
458
|
+
}
|
459
|
+
});
|
460
|
+
}
|
461
|
+
});
|
462
|
+
|
463
|
+
// strip trailing slashes and set the url (unless this behavior is specifically disabled)
|
464
|
+
if (self.defaults.stripTrailingSlashes) {
|
465
|
+
url = url.replace(/\/+$/, '') || '/';
|
466
|
+
}
|
467
|
+
|
468
|
+
// then replace collapse `/.` if found in the last URL path segment before the query
|
469
|
+
// E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
|
470
|
+
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
|
471
|
+
// replace escaped `/\.` with `/.`
|
472
|
+
config.url = url.replace(/\/\\\./, '/.');
|
473
|
+
|
474
|
+
|
475
|
+
// set params - delegate param encoding to $http
|
476
|
+
forEach(params, function(value, key) {
|
477
|
+
if (!self.urlParams[key]) {
|
478
|
+
config.params = config.params || {};
|
479
|
+
config.params[key] = value;
|
480
|
+
}
|
481
|
+
});
|
482
|
+
}
|
483
|
+
};
|
484
|
+
|
485
|
+
|
486
|
+
function resourceFactory(url, paramDefaults, actions, options) {
|
487
|
+
var route = new Route(url, options);
|
488
|
+
|
489
|
+
actions = extend({}, provider.defaults.actions, actions);
|
490
|
+
|
491
|
+
function extractParams(data, actionParams) {
|
492
|
+
var ids = {};
|
493
|
+
actionParams = extend({}, paramDefaults, actionParams);
|
494
|
+
forEach(actionParams, function(value, key) {
|
495
|
+
if (isFunction(value)) { value = value(); }
|
496
|
+
ids[key] = value && value.charAt && value.charAt(0) == '@' ?
|
497
|
+
lookupDottedPath(data, value.substr(1)) : value;
|
498
|
+
});
|
499
|
+
return ids;
|
500
|
+
}
|
501
|
+
|
502
|
+
function defaultResponseInterceptor(response) {
|
503
|
+
return response.resource;
|
504
|
+
}
|
505
|
+
|
506
|
+
function Resource(value) {
|
507
|
+
shallowClearAndCopy(value || {}, this);
|
508
|
+
}
|
509
|
+
|
510
|
+
Resource.prototype.toJSON = function() {
|
511
|
+
var data = extend({}, this);
|
512
|
+
delete data.$promise;
|
513
|
+
delete data.$resolved;
|
514
|
+
return data;
|
515
|
+
};
|
516
|
+
|
517
|
+
forEach(actions, function(action, name) {
|
518
|
+
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
|
519
|
+
|
520
|
+
Resource[name] = function(a1, a2, a3, a4) {
|
521
|
+
var params = {}, data, success, error;
|
522
|
+
|
523
|
+
/* jshint -W086 */ /* (purposefully fall through case statements) */
|
524
|
+
switch (arguments.length) {
|
525
|
+
case 4:
|
526
|
+
error = a4;
|
527
|
+
success = a3;
|
528
|
+
//fallthrough
|
529
|
+
case 3:
|
530
|
+
case 2:
|
531
|
+
if (isFunction(a2)) {
|
532
|
+
if (isFunction(a1)) {
|
533
|
+
success = a1;
|
534
|
+
error = a2;
|
535
|
+
break;
|
536
|
+
}
|
537
|
+
|
538
|
+
success = a2;
|
539
|
+
error = a3;
|
540
|
+
//fallthrough
|
541
|
+
} else {
|
542
|
+
params = a1;
|
543
|
+
data = a2;
|
544
|
+
success = a3;
|
545
|
+
break;
|
546
|
+
}
|
547
|
+
case 1:
|
548
|
+
if (isFunction(a1)) success = a1;
|
549
|
+
else if (hasBody) data = a1;
|
550
|
+
else params = a1;
|
551
|
+
break;
|
552
|
+
case 0: break;
|
553
|
+
default:
|
554
|
+
throw $resourceMinErr('badargs',
|
555
|
+
"Expected up to 4 arguments [params, data, success, error], got {0} arguments",
|
556
|
+
arguments.length);
|
557
|
+
}
|
558
|
+
/* jshint +W086 */ /* (purposefully fall through case statements) */
|
559
|
+
|
560
|
+
var isInstanceCall = this instanceof Resource;
|
561
|
+
var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
|
562
|
+
var httpConfig = {};
|
563
|
+
var responseInterceptor = action.interceptor && action.interceptor.response ||
|
564
|
+
defaultResponseInterceptor;
|
565
|
+
var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
|
566
|
+
undefined;
|
567
|
+
|
568
|
+
forEach(action, function(value, key) {
|
569
|
+
if (key != 'params' && key != 'isArray' && key != 'interceptor') {
|
570
|
+
httpConfig[key] = copy(value);
|
571
|
+
}
|
572
|
+
});
|
573
|
+
|
574
|
+
if (hasBody) httpConfig.data = data;
|
575
|
+
route.setUrlParams(httpConfig,
|
576
|
+
extend({}, extractParams(data, action.params || {}), params),
|
577
|
+
action.url);
|
578
|
+
|
579
|
+
var promise = $http(httpConfig).then(function(response) {
|
580
|
+
var data = response.data,
|
581
|
+
promise = value.$promise;
|
582
|
+
|
583
|
+
if (data) {
|
584
|
+
// Need to convert action.isArray to boolean in case it is undefined
|
585
|
+
// jshint -W018
|
586
|
+
if (angular.isArray(data) !== (!!action.isArray)) {
|
587
|
+
throw $resourceMinErr('badcfg',
|
588
|
+
'Error in resource configuration for action `{0}`. Expected response to ' +
|
589
|
+
'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',
|
590
|
+
angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);
|
591
|
+
}
|
592
|
+
// jshint +W018
|
593
|
+
if (action.isArray) {
|
594
|
+
value.length = 0;
|
595
|
+
forEach(data, function(item) {
|
596
|
+
if (typeof item === "object") {
|
597
|
+
value.push(new Resource(item));
|
598
|
+
} else {
|
599
|
+
// Valid JSON values may be string literals, and these should not be converted
|
600
|
+
// into objects. These items will not have access to the Resource prototype
|
601
|
+
// methods, but unfortunately there
|
602
|
+
value.push(item);
|
603
|
+
}
|
604
|
+
});
|
605
|
+
} else {
|
606
|
+
shallowClearAndCopy(data, value);
|
607
|
+
value.$promise = promise;
|
608
|
+
}
|
609
|
+
}
|
610
|
+
|
611
|
+
value.$resolved = true;
|
612
|
+
|
613
|
+
response.resource = value;
|
614
|
+
|
615
|
+
return response;
|
616
|
+
}, function(response) {
|
617
|
+
value.$resolved = true;
|
618
|
+
|
619
|
+
(error || noop)(response);
|
620
|
+
|
621
|
+
return $q.reject(response);
|
622
|
+
});
|
623
|
+
|
624
|
+
promise = promise.then(
|
625
|
+
function(response) {
|
626
|
+
var value = responseInterceptor(response);
|
627
|
+
(success || noop)(value, response.headers);
|
628
|
+
return value;
|
629
|
+
},
|
630
|
+
responseErrorInterceptor);
|
631
|
+
|
632
|
+
if (!isInstanceCall) {
|
633
|
+
// we are creating instance / collection
|
634
|
+
// - set the initial promise
|
635
|
+
// - return the instance / collection
|
636
|
+
value.$promise = promise;
|
637
|
+
value.$resolved = false;
|
638
|
+
|
639
|
+
return value;
|
640
|
+
}
|
641
|
+
|
642
|
+
// instance call
|
643
|
+
return promise;
|
644
|
+
};
|
645
|
+
|
646
|
+
|
647
|
+
Resource.prototype['$' + name] = function(params, success, error) {
|
648
|
+
if (isFunction(params)) {
|
649
|
+
error = success; success = params; params = {};
|
650
|
+
}
|
651
|
+
var result = Resource[name].call(this, params, this, success, error);
|
652
|
+
return result.$promise || result;
|
653
|
+
};
|
654
|
+
});
|
655
|
+
|
656
|
+
Resource.bind = function(additionalParamDefaults) {
|
657
|
+
return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
|
658
|
+
};
|
659
|
+
|
660
|
+
return Resource;
|
661
|
+
}
|
662
|
+
|
663
|
+
return resourceFactory;
|
664
|
+
}];
|
665
|
+
});
|
666
|
+
|
667
|
+
|
668
|
+
})(window, window.angular);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
AngularJS v1.4.0
|
3
|
+
(c) 2010-2015 Google, Inc. http://angularjs.org
|
4
|
+
License: MIT
|
5
|
+
*/
|
6
|
+
(function(I,d,B){'use strict';function D(f,q){q=q||{};d.forEach(q,function(d,h){delete q[h]});for(var h in f)!f.hasOwnProperty(h)||"$"===h.charAt(0)&&"$"===h.charAt(1)||(q[h]=f[h]);return q}var x=d.$$minErr("$resource"),C=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var f=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
|
7
|
+
this.$get=["$http","$q",function(q,h){function u(d,g){this.template=d;this.defaults=s({},f.defaults,g);this.urlParams={}}function w(y,g,l,m){function c(b,k){var c={};k=s({},g,k);r(k,function(a,k){v(a)&&(a=a());var d;if(a&&a.charAt&&"@"==a.charAt(0)){d=b;var e=a.substr(1);if(null==e||""===e||"hasOwnProperty"===e||!C.test("."+e))throw x("badmember",e);for(var e=e.split("."),n=0,g=e.length;n<g&&d!==B;n++){var h=e[n];d=null!==d?d[h]:B}}else d=a;c[k]=d});return c}function F(b){return b.resource}function e(b){D(b||
|
8
|
+
{},this)}var G=new u(y,m);l=s({},f.defaults.actions,l);e.prototype.toJSON=function(){var b=s({},this);delete b.$promise;delete b.$resolved;return b};r(l,function(b,k){var g=/^(POST|PUT|PATCH)$/i.test(b.method);e[k]=function(a,z,m,y){var n={},f,l,A;switch(arguments.length){case 4:A=y,l=m;case 3:case 2:if(v(z)){if(v(a)){l=a;A=z;break}l=z;A=m}else{n=a;f=z;l=m;break}case 1:v(a)?l=a:g?f=a:n=a;break;case 0:break;default:throw x("badargs",arguments.length);}var u=this instanceof e,p=u?f:b.isArray?[]:new e(f),
|
9
|
+
t={},w=b.interceptor&&b.interceptor.response||F,C=b.interceptor&&b.interceptor.responseError||B;r(b,function(b,a){"params"!=a&&"isArray"!=a&&"interceptor"!=a&&(t[a]=H(b))});g&&(t.data=f);G.setUrlParams(t,s({},c(f,b.params||{}),n),b.url);n=q(t).then(function(a){var c=a.data,g=p.$promise;if(c){if(d.isArray(c)!==!!b.isArray)throw x("badcfg",k,b.isArray?"array":"object",d.isArray(c)?"array":"object",t.method,t.url);b.isArray?(p.length=0,r(c,function(a){"object"===typeof a?p.push(new e(a)):p.push(a)})):
|
10
|
+
(D(c,p),p.$promise=g)}p.$resolved=!0;a.resource=p;return a},function(a){p.$resolved=!0;(A||E)(a);return h.reject(a)});n=n.then(function(a){var b=w(a);(l||E)(b,a.headers);return b},C);return u?n:(p.$promise=n,p.$resolved=!1,p)};e.prototype["$"+k]=function(a,b,c){v(a)&&(c=b,b=a,a={});a=e[k].call(this,a,this,b,c);return a.$promise||a}});e.bind=function(b){return w(y,s({},g,b),l)};return e}var E=d.noop,r=d.forEach,s=d.extend,H=d.copy,v=d.isFunction;u.prototype={setUrlParams:function(f,g,l){var m=this,
|
11
|
+
c=l||m.template,h,e,q=m.urlParams={};r(c.split(/\W/),function(b){if("hasOwnProperty"===b)throw x("badname");!/^\d+$/.test(b)&&b&&(new RegExp("(^|[^\\\\]):"+b+"(\\W|$)")).test(c)&&(q[b]=!0)});c=c.replace(/\\:/g,":");g=g||{};r(m.urlParams,function(b,k){h=g.hasOwnProperty(k)?g[k]:m.defaults[k];d.isDefined(h)&&null!==h?(e=encodeURIComponent(h).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,
|
12
|
+
"+"),c=c.replace(new RegExp(":"+k+"(\\W|$)","g"),function(b,a){return e+a})):c=c.replace(new RegExp("(/?):"+k+"(\\W|$)","g"),function(b,a,c){return"/"==c.charAt(0)?c:a+c})});m.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");f.url=c.replace(/\/\\\./,"/.");r(g,function(b,c){m.urlParams[c]||(f.params=f.params||{},f.params[c]=b)})}};return w}]})})(window,window.angular);
|
13
|
+
//# sourceMappingURL=angular-resource.min.js.map
|