From 1b25394ec755a2e0826f7af3f907d400be63fcf6 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 12 Sep 2014 14:06:06 +0200 Subject: [PATCH] New & changed files for v7 --- .gitignore | 1 + Notification/Notification.csproj | 6 +- NotificationsWeb/NotificationsWeb.csproj | 10 +- OurUmbraco.Site/Global.asax | 1 + OurUmbraco.Site/OurUmbraco.Site.csproj | 64 +- OurUmbraco.Site/Views/Web.config | 30 +- .../config/ClientDependency.config | 101 +- OurUmbraco.Site/config/Dashboard.config | 137 +- OurUmbraco.Site/config/EmbeddedMedia.config | 5 +- OurUmbraco.Site/config/ExamineIndex.config | 15 +- OurUmbraco.Site/config/UrlRewriting.config | 1 + OurUmbraco.Site/config/applications.config | 16 +- OurUmbraco.Site/config/feedProxy.config | 2 + OurUmbraco.Site/config/log4net.config | 1 + OurUmbraco.Site/config/scripting.config | 1 + OurUmbraco.Site/config/splashes/booting.aspx | 14 +- OurUmbraco.Site/config/splashes/noNodes.aspx | 253 +- OurUmbraco.Site/config/tinyMceConfig.config | 424 +- OurUmbraco.Site/config/trees.config | 68 +- OurUmbraco.Site/config/umbracoSettings.config | 273 +- OurUmbraco.Site/config/xsltExtensions.config | 3 +- OurUmbraco.Site/umbraco/ClientRedirect.aspx | 57 + OurUmbraco.Site/umbraco/Default.aspx | 2 +- .../Install/Legacy/loadStarterKits.ascx | 98 + .../umbraco/Install/Views/Index.cshtml | 60 + .../umbraco/Install/Views/Web.config | 58 + .../Modules/SkinModule/ModuleInjector.aspx | 3 +- .../Templates/Breadcrumb.cshtml | 22 + .../Templates/EditProfile.cshtml | 66 + .../Empty (ForUseWithCustomViews).cshtml | 1 + .../PartialViewMacros/Templates/Empty.cshtml | 1 + .../Templates/Gallery.cshtml | 31 + .../ListAncestorsFromCurrentPage.cshtml | 16 + .../ListChildPagesFromChangeableSource.cshtml | 21 + .../ListChildPagesFromCurrentPage.cshtml | 15 + .../ListChildPagesOrderedByDate.cshtml | 10 + .../ListChildPagesOrderedByName.cshtml | 8 + .../ListChildPagesOrderedByProperty.cshtml | 18 + .../ListChildPagesWithDoctype.cshtml | 30 + .../ListDescendantsFromCurrentPage.cshtml | 54 + .../ListImagesFromMediaFolder.cshtml | 23 + .../PartialViewMacros/Templates/Login.cshtml | 41 + .../Templates/LoginStatus.cshtml | 43 + .../Templates/MultinodeTree-picker.cshtml | 20 + .../Templates/Navigation.cshtml | 21 + .../Templates/RegisterMember.cshtml | 101 + .../Templates/SiteMap.cshtml | 32 + .../umbraco/Search/QuickSearch.ascx | 4 +- OurUmbraco.Site/umbraco/Search/quickSearch.js | 5 +- .../umbraco/Views/AuthorizeUpgrade.cshtml | 62 + OurUmbraco.Site/umbraco/Views/Default.cshtml | 88 + .../umbraco/Views/common/dashboard.html | 31 + .../Views/common/dialogs/content/edit.html | 58 + .../Views/common/dialogs/contentpicker.html | 66 + .../umbraco/Views/common/dialogs/help.html | 58 + .../Views/common/dialogs/iconpicker.html | 63 + .../Views/common/dialogs/insertmacro.html | 46 + .../Views/common/dialogs/legacydelete.html | 14 + .../Views/common/dialogs/linkpicker.html | 59 + .../umbraco/Views/common/dialogs/login.html | 26 + .../Views/common/dialogs/macropicker.html | 38 + .../Views/common/dialogs/mediapicker.html | 133 + .../common/dialogs/membergrouppicker.html | 36 + .../Views/common/dialogs/memberpicker.html | 68 + .../Views/common/dialogs/property.html | 1 + .../Views/common/dialogs/rteembed.html | 35 + .../Views/common/dialogs/treepicker.html | 70 + .../umbraco/Views/common/dialogs/user.html | 48 + .../umbraco/Views/common/dialogs/ysod.html | 28 + .../umbraco/Views/common/legacy.html | 3 + .../umbraco/Views/common/login.html | 3 + .../notifications/confirmroutechange.html | 7 + .../umbraco/Views/content/copy.html | 52 + .../umbraco/Views/content/create.html | 45 + .../umbraco/Views/content/delete.html | 12 + .../umbraco/Views/content/edit.html | 83 + .../Views/content/emptyrecyclebin.html | 8 + .../umbraco/Views/content/move.html | 38 + .../umbraco/Views/content/recyclebin.html | 14 + .../umbraco/Views/content/umbpreview.html | 9 + .../umbraco/Views/contenttype/edit.html | 74 + .../Views/dashboard/ChangePassword.html | 18 + .../default/StartupDashboardIntro.html | 49 + .../default/StartupDashboardKits.html | 15 + .../default/StartupDashboardLastEdits.html | 0 .../default/StartupDashboardVideos.html | 18 + .../Views/dashboard/default/ourumbraco.png | Bin 0 -> 75730 bytes .../Views/dashboard/default/umbracotv.png | Bin 0 -> 106574 bytes .../developer/developerdashboardintro.html | 14 + .../developer/developerdashboardvideos.html | 21 + .../dashboard/media/desktopmediauploader.html | 38 + .../dashboard/media/mediadashboardintro.html | 14 + .../dashboard/media/mediadashboardvideos.html | 18 + .../dashboard/media/mediafolderbrowser.html | 26 + .../members/membersdashboardintro.html | 10 + .../members/membersdashboardvideos.html | 18 + .../settings/settingsdashboardintro.html | 14 + .../settings/settingsdashboardvideos.html | 18 + .../umbraco/Views/datatype/delete.html | 12 + .../umbraco/Views/datatype/edit.html | 67 + .../Views/directives/button-group.html | 21 + .../directives/html/umb-control-group.html | 13 + .../Views/directives/html/umb-pane.html | 3 + .../Views/directives/html/umb-panel.html | 3 + .../directives/html/umb-photo-folder.html | 26 + .../directives/html/umb-upload-dropzone.html | 13 + .../directives/imaging/umb-image-crop.html | 19 + .../directives/imaging/umb-image-gravity.html | 12 + .../imaging/umb-image-thumbnail.html | 4 + .../umbraco/Views/directives/umb-avatar.html | 3 + .../umbraco/Views/directives/umb-confirm.html | 10 + .../Views/directives/umb-content-name.html | 19 + .../Views/directives/umb-contextmenu.html | 17 + .../umbraco/Views/directives/umb-editor.html | 3 + .../umbraco/Views/directives/umb-header.html | 14 + .../Views/directives/umb-item-sorter.html | 38 + .../umbraco/Views/directives/umb-login.html | 12 + .../Views/directives/umb-navigation.html | 100 + .../Views/directives/umb-notifications.html | 18 + .../Views/directives/umb-optionsmenu.html | 21 + .../Views/directives/umb-property.html | 18 + .../Views/directives/umb-sections.html | 47 + .../Views/directives/umb-tab-view.html | 5 + .../umbraco/Views/directives/umb-tab.html | 5 + .../Views/install/continueinstall.html | 13 + .../umbraco/Views/install/database.html | 123 + .../umbraco/Views/install/error.html | 9 + .../Views/install/permissionsreport.html | 26 + .../umbraco/Views/install/starterkit.html | 20 + .../umbraco/Views/install/upgrade.html | 13 + .../umbraco/Views/install/user.html | 68 + .../Views/install/version7upgradereport.html | 22 + .../umbraco/Views/media/create.html | 50 + .../umbraco/Views/media/delete.html | 10 + OurUmbraco.Site/umbraco/Views/media/edit.html | 59 + .../umbraco/Views/media/emptyrecyclebin.html | 8 + OurUmbraco.Site/umbraco/Views/media/move.html | 37 + .../umbraco/Views/media/recyclebin.html | 14 + .../umbraco/Views/member/create.html | 25 + .../umbraco/Views/member/delete.html | 12 + .../umbraco/Views/member/edit.html | 52 + .../Views/prevalueeditors/boolean.html | 1 + .../umbraco/Views/prevalueeditors/hidden.html | 1 + .../Views/prevalueeditors/mediapicker.html | 22 + .../Views/prevalueeditors/multivalues.html | 13 + .../Views/prevalueeditors/nodetype.html | 5 + .../umbraco/Views/prevalueeditors/number.html | 11 + .../prevalueeditors/readonlykeyvalues.html | 7 + .../Views/prevalueeditors/requiredfield.html | 9 + .../Views/prevalueeditors/textarea.html | 1 + .../Views/prevalueeditors/textstring.html | 1 + .../Views/prevalueeditors/treepicker.html | 22 + .../Views/prevalueeditors/treesource.html | 77 + .../propertyeditors/boolean/boolean.html | 3 + .../changepassword/changepassword.html | 53 + .../checkboxlist/checkboxlist.html | 14 + .../colorpicker/colorpicker.html | 15 + .../colorpicker/colorpicker.prevalues.html | 12 + .../contentpicker/contentpicker.html | 44 + .../datepicker/datepicker.html | 14 + .../propertyeditors/dropdown/dropdown.html | 19 + .../Views/propertyeditors/email/email.html | 13 + .../entitypicker/entitypicker.html | 19 + .../fileupload/fileupload.html | 28 + .../folderbrowser/folderbrowser.html | 29 + .../googlemaps/googlemaps.html | 3 + .../Views/propertyeditors/grid/css/iframe.css | 13 + .../Views/propertyeditors/grid/grid.html | 3 + .../Views/propertyeditors/grid/iframe.html | 69 + .../Views/propertyeditors/grid/js/iframe.js | 19 + .../imagecropper/imagecropper.html | 63 + .../imagecropper/imagecropper.prevalues.html | 49 + .../propertyeditors/integer/integer.html | 10 + .../propertyeditors/listview/listview.html | 130 + .../macrocontainer/macrocontainer.html | 28 + .../markdowneditor/markdowneditor.html | 7 + .../mediapicker/mediapicker.html | 24 + .../membergrouppicker/membergrouppicker.html | 25 + .../membergroups/membergroups.html | 18 + .../memberpicker/memberpicker.html | 26 + .../multipletextbox/multipletextbox.html | 17 + .../radiobuttons/radiobuttons.html | 12 + .../readonlyvalue/readonlyvalue.html | 3 + .../relatedlinks/relatedlinks.html | 81 + .../Views/propertyeditors/rte/rte.html | 5 + .../propertyeditors/rte/rte.prevalues.html | 36 + .../slider/orientation.prevalues.html | 8 + .../Views/propertyeditors/slider/slider.html | 5 + .../Views/propertyeditors/tags/tags.html | 19 + .../propertyeditors/tags/tags.prevalues.html | 10 + .../templatepicker/templatepicker.html | 3 + .../Views/propertyeditors/test/test.html | 18 + .../propertyeditors/textarea/textarea.html | 2 + .../propertyeditors/textbox/textbox.html | 9 + .../ultrasimple/ultrasimple.html | 2 + .../propertyeditors/urllist/urllist.html | 7 + .../validationtest/validationtest.html | 12 + .../umbraco/Views/templates/edit.html | 19 + .../umbraco/assets/css/installer.css | 2449 ++ .../umbraco/assets/css/umbraco.css | 8 + .../assets/fonts/helveticons/helveticons.eot | Bin 0 -> 117324 bytes .../assets/fonts/helveticons/helveticons.svg | 6176 ++++ .../assets/fonts/helveticons/helveticons.ttf | Bin 0 -> 117160 bytes .../assets/fonts/helveticons/helveticons.woff | Bin 0 -> 294540 bytes .../opensans/OpenSans-Regular-webfont.eot | Bin 0 -> 19836 bytes .../opensans/OpenSans-Regular-webfont.svg | 1831 + .../opensans/OpenSans-Regular-webfont.ttf | Bin 0 -> 38232 bytes .../opensans/OpenSans-Regular-webfont.woff | Bin 0 -> 22660 bytes .../fonts/opensans/OpenSans-Regular.ttf | Bin 0 -> 217360 bytes .../opensans/OpenSans-Semibold-webfont.eot | Bin 0 -> 20028 bytes .../opensans/OpenSans-Semibold-webfont.svg | 1830 + .../opensans/OpenSans-Semibold-webfont.ttf | Bin 0 -> 39476 bytes .../opensans/OpenSans-Semibold-webfont.woff | Bin 0 -> 22908 bytes .../umbraco/assets/img/application/logo.png | Bin 0 -> 1409 bytes .../assets/img/application/logo_black.png | Bin 0 -> 1280 bytes .../assets/img/application/logo_white.png | Bin 0 -> 1333 bytes .../assets/img/applicationIcons/content.png | Bin 0 -> 1139 bytes .../assets/img/applicationIcons/default.png | Bin 0 -> 1581 bytes .../assets/img/applicationIcons/developer.png | Bin 0 -> 1376 bytes .../assets/img/applicationIcons/help.svg | 22 + .../applicationIcons/hlvticons-umbraco.svg | 87 + .../assets/img/applicationIcons/media.png | Bin 0 -> 1386 bytes .../assets/img/applicationIcons/members.png | Bin 0 -> 1342 bytes .../assets/img/applicationIcons/search.png | Bin 0 -> 1179 bytes .../assets/img/applicationIcons/settings.png | Bin 0 -> 1612 bytes .../img/applicationIcons/tree-arrow.png | Bin 0 -> 2828 bytes .../assets/img/applicationIcons/users.png | Bin 0 -> 1304 bytes .../assets/img/checkered-background.png | Bin 0 -> 165 bytes .../umbraco/assets/img/installer.jpg | Bin 0 -> 781354 bytes OurUmbraco.Site/umbraco/assets/img/loader.gif | Bin 0 -> 23155 bytes .../umbraco/assets/img/mocks/big-image.jpg | Bin 0 -> 316178 bytes .../umbraco/assets/img/mocks/big-thumb.jpg | Bin 0 -> 5093 bytes OurUmbraco.Site/umbraco/channels/rsd.aspx | 17 +- .../umbraco/channels/wlwmanifest.aspx | 31 +- OurUmbraco.Site/umbraco/config/create/UI.xml | 117 +- OurUmbraco.Site/umbraco/config/lang/da.xml | 95 +- OurUmbraco.Site/umbraco/config/lang/de.xml | 303 +- OurUmbraco.Site/umbraco/config/lang/en.xml | 449 +- OurUmbraco.Site/umbraco/config/lang/en_us.xml | 1001 + OurUmbraco.Site/umbraco/config/lang/es.xml | 29 +- OurUmbraco.Site/umbraco/config/lang/fr.xml | 1238 +- OurUmbraco.Site/umbraco/config/lang/he.xml | 37 +- OurUmbraco.Site/umbraco/config/lang/it.xml | 47 +- OurUmbraco.Site/umbraco/config/lang/ja.xml | 49 +- OurUmbraco.Site/umbraco/config/lang/ko.xml | 27 +- OurUmbraco.Site/umbraco/config/lang/nl.xml | 265 +- OurUmbraco.Site/umbraco/config/lang/no.xml | 463 +- OurUmbraco.Site/umbraco/config/lang/pl.xml | 9 +- OurUmbraco.Site/umbraco/config/lang/pt.xml | 33 +- OurUmbraco.Site/umbraco/config/lang/ru.xml | 79 +- OurUmbraco.Site/umbraco/config/lang/sv.xml | 242 +- OurUmbraco.Site/umbraco/config/lang/zh.xml | 128 +- .../controls/ContentTypeControlNew.ascx | 106 +- .../GenericProperties/GenericProperty.ascx | 134 +- .../umbraco/controls/Images/ImageViewer.ascx | 41 +- .../umbraco/controls/ProgressBar.ascx | 2 +- .../umbraco/controls/Tree/TreeControl.ascx | 41 +- .../umbraco/controls/passwordChanger.ascx | 145 +- OurUmbraco.Site/umbraco/create.aspx | 9 +- .../umbraco/create/DLRScripting.ascx | 57 +- .../umbraco/create/PartialView.ascx | 26 + .../umbraco/create/PartialViewMacro.ascx | 31 + OurUmbraco.Site/umbraco/create/User.ascx | 35 + OurUmbraco.Site/umbraco/create/content.ascx | 2 +- OurUmbraco.Site/umbraco/create/language.ascx | 25 +- OurUmbraco.Site/umbraco/create/member.ascx | 11 +- OurUmbraco.Site/umbraco/create/nodeType.ascx | 42 +- OurUmbraco.Site/umbraco/create/script.ascx | 31 +- OurUmbraco.Site/umbraco/create/simple.ascx | 29 +- OurUmbraco.Site/umbraco/create/xslt.ascx | 41 +- OurUmbraco.Site/umbraco/dashboard.aspx | 2 +- .../umbraco/dashboard/ChangePassword.ascx | 114 +- .../dashboard/DesktopMediaUploader.ascx | 47 +- .../dashboard/DeveloperDashboardIntro.ascx | 40 +- .../dashboard/DeveloperDashboardVideos.ascx | 35 +- .../umbraco/dashboard/ExamineManagement.ascx | 216 + .../umbraco/dashboard/LatestEdits.ascx | 21 +- .../dashboard/MediaDashboardIntro.ascx | 18 +- .../dashboard/MediaDashboardVideos.ascx | 34 +- .../dashboard/MembersDashboardIntro.ascx | 23 +- .../dashboard/MembersDashboardVideos.ascx | 34 +- .../dashboard/SettingsDashboardIntro.ascx | 39 +- .../dashboard/SettingsDashboardVideos.ascx | 34 +- .../dashboard/StartupDashboardIntro.ascx | 61 +- .../dashboard/StartupDashboardKits.ascx | 26 +- .../dashboard/StartupDashboardVideos.ascx | 35 +- .../umbraco/dashboard/UserControlProxy.aspx | 30 + .../dashboard/images/access-denied.png | Bin 0 -> 1690 bytes .../developer/DataTypes/editDatatype.aspx | 2 + .../umbraco/developer/Macros/editMacro.aspx | 327 +- .../developer/Packages/StarterKits.aspx | 55 +- .../developer/Packages/directoryBrowser.aspx | 150 +- .../developer/Packages/editPackage.aspx | 9 +- .../developer/Packages/installedPackage.aspx | 296 +- .../umbraco/developer/Packages/installer.aspx | 203 +- .../umbraco/developer/Packages/proxy.htm | 54 +- .../umbraco/developer/Python/editPython.aspx | 86 +- .../RelationTypes/EditRelationType.aspx | 6 +- .../RelationTypes/NewRelationType.aspx | 32 +- .../umbraco/developer/Xslt/editXslt.aspx | 113 +- .../developer/Xslt/xsltChooseExtension.aspx | 27 +- .../developer/Xslt/xsltInsertValueOf.aspx | 5 +- .../umbraco/developer/Xslt/xsltVisualize.aspx | 61 +- .../umbraco/dialogs/AssignDomain.aspx | 15 +- .../umbraco/dialogs/AssignDomain2.aspx | 78 + .../umbraco/dialogs/ChangeDocType.aspx | 124 + OurUmbraco.Site/umbraco/dialogs/Preview.aspx | 2 +- OurUmbraco.Site/umbraco/dialogs/about.aspx | 3 +- OurUmbraco.Site/umbraco/dialogs/create.aspx | 13 +- OurUmbraco.Site/umbraco/dialogs/cruds.aspx | 27 +- .../umbraco/dialogs/editMacro.aspx | 169 +- .../umbraco/dialogs/emptyTrashcan.aspx | 13 +- .../umbraco/dialogs/insertMacro.aspx | 13 +- .../dialogs/insertMasterpageContent.aspx | 43 +- .../dialogs/insertMasterpagePlaceholder.aspx | 31 +- .../umbraco/dialogs/moveOrCopy.aspx | 19 +- .../umbraco/dialogs/notifications.aspx | 24 +- .../umbraco/dialogs/protectPage.aspx | 317 +- OurUmbraco.Site/umbraco/dialogs/publish.aspx | 186 +- .../umbraco/dialogs/republish.aspx | 19 +- OurUmbraco.Site/umbraco/dialogs/rollBack.aspx | 138 +- OurUmbraco.Site/umbraco/dialogs/sort.aspx | 181 +- .../umbraco/dialogs/treePicker.aspx | 2 +- .../umbraco/dialogs/umbracoField.aspx | 202 +- OurUmbraco.Site/umbraco/editContent.aspx | 9 +- OurUmbraco.Site/umbraco/images/loginBg.png | Bin 16433 -> 17566 bytes .../umbraco/images/umbracoSplash.png | Bin 4678 -> 3134 bytes OurUmbraco.Site/umbraco/installer.html | 24 + .../umbraco/js/UmbracoSpeechBubbleBackEnd.js | 2 +- OurUmbraco.Site/umbraco/js/app.dev.js | 18 + OurUmbraco.Site/umbraco/js/app.js | 12 + OurUmbraco.Site/umbraco/js/guiFunctions.js | 45 +- OurUmbraco.Site/umbraco/js/init.js | 66 + OurUmbraco.Site/umbraco/js/install.loader.js | 16 + OurUmbraco.Site/umbraco/js/loader.js | 47 + OurUmbraco.Site/umbraco/js/routes.js | 176 + .../umbraco/js/umbraco.controllers.js | 6159 ++++ .../umbraco/js/umbraco.directives.js | 3274 ++ OurUmbraco.Site/umbraco/js/umbraco.filters.js | 26 + .../umbraco/js/umbraco.httpbackend.js | 30 + .../umbraco/js/umbraco.installer.js | 465 + .../umbraco/js/umbraco.resources.js | 2517 ++ .../umbraco/js/umbraco.security.js | 161 + .../umbraco/js/umbraco.servervariables.js | 45 + .../umbraco/js/umbraco.services.js | 7958 +++++ OurUmbraco.Site/umbraco/js/umbraco.testing.js | 2151 ++ .../umbraco/js/umbracoUpgradeChecker.js | 21 +- .../lib/angular/1.1.5/angular-cookies.js | 185 + .../lib/angular/1.1.5/angular-cookies.min.js | 7 + .../lib/angular/1.1.5/angular-loader.js | 304 + .../lib/angular/1.1.5/angular-loader.min.js | 7 + .../lib/angular/1.1.5/angular-mobile.js | 462 + .../lib/angular/1.1.5/angular-mobile.min.js | 11 + .../lib/angular/1.1.5/angular-mocks.js | 1886 + .../lib/angular/1.1.5/angular-resource.js | 537 + .../lib/angular/1.1.5/angular-resource.min.js | 11 + .../lib/angular/1.1.5/angular-sanitize.js | 558 + .../lib/angular/1.1.5/angular-sanitize.min.js | 13 + .../lib/angular/1.1.5/angular-scenario.js | 28463 ++++++++++++++++ .../umbraco/lib/angular/1.1.5/angular.js | 16876 +++++++++ .../umbraco/lib/angular/1.1.5/angular.min.js | 178 + .../1.1.5/i18n/angular-locale_af-na.js | 98 + .../1.1.5/i18n/angular-locale_af-za.js | 98 + .../angular/1.1.5/i18n/angular-locale_af.js | 98 + .../1.1.5/i18n/angular-locale_am-et.js | 98 + .../angular/1.1.5/i18n/angular-locale_am.js | 98 + .../1.1.5/i18n/angular-locale_ar-001.js | 98 + .../1.1.5/i18n/angular-locale_ar-ae.js | 98 + .../1.1.5/i18n/angular-locale_ar-bh.js | 98 + .../1.1.5/i18n/angular-locale_ar-dz.js | 98 + .../1.1.5/i18n/angular-locale_ar-eg.js | 98 + .../1.1.5/i18n/angular-locale_ar-iq.js | 98 + .../1.1.5/i18n/angular-locale_ar-jo.js | 98 + .../1.1.5/i18n/angular-locale_ar-kw.js | 98 + .../1.1.5/i18n/angular-locale_ar-lb.js | 98 + .../1.1.5/i18n/angular-locale_ar-ly.js | 98 + .../1.1.5/i18n/angular-locale_ar-ma.js | 98 + .../1.1.5/i18n/angular-locale_ar-om.js | 98 + .../1.1.5/i18n/angular-locale_ar-qa.js | 98 + .../1.1.5/i18n/angular-locale_ar-sa.js | 98 + .../1.1.5/i18n/angular-locale_ar-sd.js | 98 + .../1.1.5/i18n/angular-locale_ar-sy.js | 98 + .../1.1.5/i18n/angular-locale_ar-tn.js | 98 + .../1.1.5/i18n/angular-locale_ar-ye.js | 98 + .../angular/1.1.5/i18n/angular-locale_ar.js | 98 + .../1.1.5/i18n/angular-locale_bg-bg.js | 98 + .../angular/1.1.5/i18n/angular-locale_bg.js | 98 + .../1.1.5/i18n/angular-locale_bn-bd.js | 98 + .../1.1.5/i18n/angular-locale_bn-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_bn.js | 98 + .../1.1.5/i18n/angular-locale_ca-ad.js | 98 + .../1.1.5/i18n/angular-locale_ca-es.js | 98 + .../angular/1.1.5/i18n/angular-locale_ca.js | 98 + .../angular/1.1.5/i18n/angular-locale_chr.js | 4 + .../1.1.5/i18n/angular-locale_cs-cz.js | 98 + .../angular/1.1.5/i18n/angular-locale_cs.js | 98 + .../angular/1.1.5/i18n/angular-locale_cy.js | 4 + .../1.1.5/i18n/angular-locale_da-dk.js | 98 + .../angular/1.1.5/i18n/angular-locale_da.js | 98 + .../1.1.5/i18n/angular-locale_de-at.js | 98 + .../1.1.5/i18n/angular-locale_de-be.js | 98 + .../1.1.5/i18n/angular-locale_de-ch.js | 98 + .../1.1.5/i18n/angular-locale_de-de.js | 98 + .../1.1.5/i18n/angular-locale_de-li.js | 98 + .../1.1.5/i18n/angular-locale_de-lu.js | 98 + .../angular/1.1.5/i18n/angular-locale_de.js | 98 + .../1.1.5/i18n/angular-locale_el-cy.js | 98 + .../1.1.5/i18n/angular-locale_el-gr.js | 98 + .../1.1.5/i18n/angular-locale_el-polyton.js | 4 + .../angular/1.1.5/i18n/angular-locale_el.js | 98 + .../1.1.5/i18n/angular-locale_en-as.js | 98 + .../1.1.5/i18n/angular-locale_en-au.js | 98 + .../1.1.5/i18n/angular-locale_en-bb.js | 98 + .../1.1.5/i18n/angular-locale_en-be.js | 98 + .../1.1.5/i18n/angular-locale_en-bm.js | 98 + .../1.1.5/i18n/angular-locale_en-bw.js | 98 + .../1.1.5/i18n/angular-locale_en-bz.js | 98 + .../1.1.5/i18n/angular-locale_en-ca.js | 98 + .../1.1.5/i18n/angular-locale_en-dsrt-us.js | 98 + .../1.1.5/i18n/angular-locale_en-dsrt.js | 98 + .../1.1.5/i18n/angular-locale_en-fm.js | 98 + .../1.1.5/i18n/angular-locale_en-gb.js | 98 + .../1.1.5/i18n/angular-locale_en-gu.js | 98 + .../1.1.5/i18n/angular-locale_en-gy.js | 98 + .../1.1.5/i18n/angular-locale_en-hk.js | 98 + .../1.1.5/i18n/angular-locale_en-ie.js | 98 + .../1.1.5/i18n/angular-locale_en-in.js | 98 + .../1.1.5/i18n/angular-locale_en-iso.js | 98 + .../1.1.5/i18n/angular-locale_en-jm.js | 98 + .../1.1.5/i18n/angular-locale_en-mh.js | 98 + .../1.1.5/i18n/angular-locale_en-mp.js | 98 + .../1.1.5/i18n/angular-locale_en-mt.js | 98 + .../1.1.5/i18n/angular-locale_en-mu.js | 98 + .../1.1.5/i18n/angular-locale_en-na.js | 98 + .../1.1.5/i18n/angular-locale_en-nz.js | 98 + .../1.1.5/i18n/angular-locale_en-ph.js | 98 + .../1.1.5/i18n/angular-locale_en-pk.js | 98 + .../1.1.5/i18n/angular-locale_en-pr.js | 98 + .../1.1.5/i18n/angular-locale_en-pw.js | 98 + .../1.1.5/i18n/angular-locale_en-sg.js | 98 + .../1.1.5/i18n/angular-locale_en-tc.js | 98 + .../1.1.5/i18n/angular-locale_en-tt.js | 98 + .../1.1.5/i18n/angular-locale_en-um.js | 98 + .../1.1.5/i18n/angular-locale_en-us.js | 98 + .../1.1.5/i18n/angular-locale_en-vg.js | 98 + .../1.1.5/i18n/angular-locale_en-vi.js | 98 + .../1.1.5/i18n/angular-locale_en-za.js | 98 + .../1.1.5/i18n/angular-locale_en-zw.js | 98 + .../1.1.5/i18n/angular-locale_en-zz.js | 4 + .../angular/1.1.5/i18n/angular-locale_en.js | 98 + .../1.1.5/i18n/angular-locale_es-419.js | 98 + .../1.1.5/i18n/angular-locale_es-ar.js | 98 + .../1.1.5/i18n/angular-locale_es-bo.js | 98 + .../1.1.5/i18n/angular-locale_es-cl.js | 98 + .../1.1.5/i18n/angular-locale_es-co.js | 98 + .../1.1.5/i18n/angular-locale_es-cr.js | 98 + .../1.1.5/i18n/angular-locale_es-do.js | 98 + .../1.1.5/i18n/angular-locale_es-ea.js | 98 + .../1.1.5/i18n/angular-locale_es-ec.js | 98 + .../1.1.5/i18n/angular-locale_es-es.js | 98 + .../1.1.5/i18n/angular-locale_es-gq.js | 98 + .../1.1.5/i18n/angular-locale_es-gt.js | 98 + .../1.1.5/i18n/angular-locale_es-hn.js | 98 + .../1.1.5/i18n/angular-locale_es-ic.js | 98 + .../1.1.5/i18n/angular-locale_es-mx.js | 98 + .../1.1.5/i18n/angular-locale_es-ni.js | 98 + .../1.1.5/i18n/angular-locale_es-pa.js | 98 + .../1.1.5/i18n/angular-locale_es-pe.js | 98 + .../1.1.5/i18n/angular-locale_es-pr.js | 98 + .../1.1.5/i18n/angular-locale_es-py.js | 98 + .../1.1.5/i18n/angular-locale_es-sv.js | 98 + .../1.1.5/i18n/angular-locale_es-us.js | 98 + .../1.1.5/i18n/angular-locale_es-uy.js | 98 + .../1.1.5/i18n/angular-locale_es-ve.js | 98 + .../angular/1.1.5/i18n/angular-locale_es.js | 98 + .../1.1.5/i18n/angular-locale_et-ee.js | 98 + .../angular/1.1.5/i18n/angular-locale_et.js | 98 + .../1.1.5/i18n/angular-locale_eu-es.js | 98 + .../angular/1.1.5/i18n/angular-locale_eu.js | 98 + .../1.1.5/i18n/angular-locale_fa-af.js | 98 + .../1.1.5/i18n/angular-locale_fa-ir.js | 98 + .../angular/1.1.5/i18n/angular-locale_fa.js | 98 + .../1.1.5/i18n/angular-locale_fi-fi.js | 98 + .../angular/1.1.5/i18n/angular-locale_fi.js | 98 + .../1.1.5/i18n/angular-locale_fil-ph.js | 98 + .../angular/1.1.5/i18n/angular-locale_fil.js | 98 + .../1.1.5/i18n/angular-locale_fr-be.js | 98 + .../1.1.5/i18n/angular-locale_fr-bf.js | 98 + .../1.1.5/i18n/angular-locale_fr-bi.js | 98 + .../1.1.5/i18n/angular-locale_fr-bj.js | 98 + .../1.1.5/i18n/angular-locale_fr-bl.js | 98 + .../1.1.5/i18n/angular-locale_fr-ca.js | 98 + .../1.1.5/i18n/angular-locale_fr-cd.js | 98 + .../1.1.5/i18n/angular-locale_fr-cf.js | 98 + .../1.1.5/i18n/angular-locale_fr-cg.js | 98 + .../1.1.5/i18n/angular-locale_fr-ch.js | 98 + .../1.1.5/i18n/angular-locale_fr-ci.js | 98 + .../1.1.5/i18n/angular-locale_fr-cm.js | 98 + .../1.1.5/i18n/angular-locale_fr-dj.js | 98 + .../1.1.5/i18n/angular-locale_fr-fr.js | 98 + .../1.1.5/i18n/angular-locale_fr-ga.js | 98 + .../1.1.5/i18n/angular-locale_fr-gf.js | 98 + .../1.1.5/i18n/angular-locale_fr-gn.js | 98 + .../1.1.5/i18n/angular-locale_fr-gp.js | 98 + .../1.1.5/i18n/angular-locale_fr-gq.js | 98 + .../1.1.5/i18n/angular-locale_fr-km.js | 98 + .../1.1.5/i18n/angular-locale_fr-lu.js | 98 + .../1.1.5/i18n/angular-locale_fr-mc.js | 98 + .../1.1.5/i18n/angular-locale_fr-mf.js | 98 + .../1.1.5/i18n/angular-locale_fr-mg.js | 98 + .../1.1.5/i18n/angular-locale_fr-ml.js | 98 + .../1.1.5/i18n/angular-locale_fr-mq.js | 98 + .../1.1.5/i18n/angular-locale_fr-ne.js | 98 + .../1.1.5/i18n/angular-locale_fr-re.js | 98 + .../1.1.5/i18n/angular-locale_fr-rw.js | 98 + .../1.1.5/i18n/angular-locale_fr-sn.js | 98 + .../1.1.5/i18n/angular-locale_fr-td.js | 98 + .../1.1.5/i18n/angular-locale_fr-tg.js | 98 + .../1.1.5/i18n/angular-locale_fr-yt.js | 98 + .../angular/1.1.5/i18n/angular-locale_fr.js | 98 + .../1.1.5/i18n/angular-locale_gl-es.js | 98 + .../angular/1.1.5/i18n/angular-locale_gl.js | 98 + .../1.1.5/i18n/angular-locale_gsw-ch.js | 98 + .../angular/1.1.5/i18n/angular-locale_gsw.js | 98 + .../1.1.5/i18n/angular-locale_gu-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_gu.js | 98 + .../angular/1.1.5/i18n/angular-locale_haw.js | 4 + .../1.1.5/i18n/angular-locale_he-il.js | 98 + .../angular/1.1.5/i18n/angular-locale_he.js | 98 + .../1.1.5/i18n/angular-locale_hi-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_hi.js | 98 + .../1.1.5/i18n/angular-locale_hr-hr.js | 98 + .../angular/1.1.5/i18n/angular-locale_hr.js | 98 + .../1.1.5/i18n/angular-locale_hu-hu.js | 98 + .../angular/1.1.5/i18n/angular-locale_hu.js | 98 + .../1.1.5/i18n/angular-locale_id-id.js | 98 + .../angular/1.1.5/i18n/angular-locale_id.js | 98 + .../angular/1.1.5/i18n/angular-locale_in.js | 98 + .../1.1.5/i18n/angular-locale_is-is.js | 98 + .../angular/1.1.5/i18n/angular-locale_is.js | 98 + .../1.1.5/i18n/angular-locale_it-ch.js | 98 + .../1.1.5/i18n/angular-locale_it-it.js | 98 + .../1.1.5/i18n/angular-locale_it-sm.js | 98 + .../angular/1.1.5/i18n/angular-locale_it.js | 98 + .../angular/1.1.5/i18n/angular-locale_iw.js | 98 + .../1.1.5/i18n/angular-locale_ja-jp.js | 98 + .../angular/1.1.5/i18n/angular-locale_ja.js | 98 + .../1.1.5/i18n/angular-locale_kn-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_kn.js | 98 + .../1.1.5/i18n/angular-locale_ko-kr.js | 98 + .../angular/1.1.5/i18n/angular-locale_ko.js | 98 + .../1.1.5/i18n/angular-locale_ln-cd.js | 98 + .../1.1.5/i18n/angular-locale_ln-cg.js | 98 + .../angular/1.1.5/i18n/angular-locale_ln.js | 98 + .../1.1.5/i18n/angular-locale_lt-lt.js | 98 + .../angular/1.1.5/i18n/angular-locale_lt.js | 98 + .../1.1.5/i18n/angular-locale_lv-lv.js | 98 + .../angular/1.1.5/i18n/angular-locale_lv.js | 98 + .../1.1.5/i18n/angular-locale_ml-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_ml.js | 98 + .../angular/1.1.5/i18n/angular-locale_mo.js | 4 + .../1.1.5/i18n/angular-locale_mr-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_mr.js | 98 + .../1.1.5/i18n/angular-locale_ms-bn.js | 98 + .../1.1.5/i18n/angular-locale_ms-my.js | 98 + .../angular/1.1.5/i18n/angular-locale_ms.js | 98 + .../1.1.5/i18n/angular-locale_mt-mt.js | 98 + .../angular/1.1.5/i18n/angular-locale_mt.js | 98 + .../1.1.5/i18n/angular-locale_nl-aw.js | 98 + .../1.1.5/i18n/angular-locale_nl-be.js | 98 + .../1.1.5/i18n/angular-locale_nl-cw.js | 98 + .../1.1.5/i18n/angular-locale_nl-nl.js | 98 + .../1.1.5/i18n/angular-locale_nl-sx.js | 98 + .../angular/1.1.5/i18n/angular-locale_nl.js | 98 + .../angular/1.1.5/i18n/angular-locale_no.js | 98 + .../1.1.5/i18n/angular-locale_or-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_or.js | 98 + .../1.1.5/i18n/angular-locale_pl-pl.js | 98 + .../angular/1.1.5/i18n/angular-locale_pl.js | 98 + .../1.1.5/i18n/angular-locale_pt-ao.js | 98 + .../1.1.5/i18n/angular-locale_pt-br.js | 98 + .../1.1.5/i18n/angular-locale_pt-gw.js | 98 + .../1.1.5/i18n/angular-locale_pt-mz.js | 98 + .../1.1.5/i18n/angular-locale_pt-pt.js | 98 + .../1.1.5/i18n/angular-locale_pt-st.js | 98 + .../angular/1.1.5/i18n/angular-locale_pt.js | 98 + .../1.1.5/i18n/angular-locale_ro-md.js | 98 + .../1.1.5/i18n/angular-locale_ro-ro.js | 98 + .../angular/1.1.5/i18n/angular-locale_ro.js | 98 + .../1.1.5/i18n/angular-locale_ru-md.js | 98 + .../1.1.5/i18n/angular-locale_ru-ru.js | 98 + .../1.1.5/i18n/angular-locale_ru-ua.js | 98 + .../angular/1.1.5/i18n/angular-locale_ru.js | 98 + .../1.1.5/i18n/angular-locale_sk-sk.js | 98 + .../angular/1.1.5/i18n/angular-locale_sk.js | 98 + .../1.1.5/i18n/angular-locale_sl-si.js | 98 + .../angular/1.1.5/i18n/angular-locale_sl.js | 98 + .../1.1.5/i18n/angular-locale_sq-al.js | 98 + .../angular/1.1.5/i18n/angular-locale_sq.js | 98 + .../1.1.5/i18n/angular-locale_sr-cyrl-ba.js | 98 + .../1.1.5/i18n/angular-locale_sr-cyrl-me.js | 98 + .../1.1.5/i18n/angular-locale_sr-cyrl-rs.js | 98 + .../1.1.5/i18n/angular-locale_sr-cyrl.js | 98 + .../1.1.5/i18n/angular-locale_sr-latn-ba.js | 98 + .../1.1.5/i18n/angular-locale_sr-latn-me.js | 98 + .../1.1.5/i18n/angular-locale_sr-latn-rs.js | 98 + .../1.1.5/i18n/angular-locale_sr-latn.js | 98 + .../1.1.5/i18n/angular-locale_sr-rs.js | 4 + .../angular/1.1.5/i18n/angular-locale_sr.js | 98 + .../1.1.5/i18n/angular-locale_sv-fi.js | 98 + .../1.1.5/i18n/angular-locale_sv-se.js | 98 + .../angular/1.1.5/i18n/angular-locale_sv.js | 98 + .../1.1.5/i18n/angular-locale_sw-ke.js | 98 + .../1.1.5/i18n/angular-locale_sw-tz.js | 98 + .../angular/1.1.5/i18n/angular-locale_sw.js | 98 + .../1.1.5/i18n/angular-locale_ta-in.js | 98 + .../1.1.5/i18n/angular-locale_ta-lk.js | 98 + .../angular/1.1.5/i18n/angular-locale_ta.js | 98 + .../1.1.5/i18n/angular-locale_te-in.js | 98 + .../angular/1.1.5/i18n/angular-locale_te.js | 98 + .../1.1.5/i18n/angular-locale_th-th.js | 98 + .../angular/1.1.5/i18n/angular-locale_th.js | 98 + .../1.1.5/i18n/angular-locale_tl-ph.js | 4 + .../angular/1.1.5/i18n/angular-locale_tl.js | 98 + .../1.1.5/i18n/angular-locale_tr-tr.js | 98 + .../angular/1.1.5/i18n/angular-locale_tr.js | 98 + .../1.1.5/i18n/angular-locale_uk-ua.js | 98 + .../angular/1.1.5/i18n/angular-locale_uk.js | 98 + .../1.1.5/i18n/angular-locale_ur-in.js | 98 + .../1.1.5/i18n/angular-locale_ur-pk.js | 98 + .../angular/1.1.5/i18n/angular-locale_ur.js | 98 + .../1.1.5/i18n/angular-locale_vi-vn.js | 98 + .../angular/1.1.5/i18n/angular-locale_vi.js | 98 + .../1.1.5/i18n/angular-locale_zh-cn.js | 98 + .../1.1.5/i18n/angular-locale_zh-hans-cn.js | 98 + .../1.1.5/i18n/angular-locale_zh-hans-hk.js | 98 + .../1.1.5/i18n/angular-locale_zh-hans-mo.js | 98 + .../1.1.5/i18n/angular-locale_zh-hans-sg.js | 98 + .../1.1.5/i18n/angular-locale_zh-hans.js | 98 + .../1.1.5/i18n/angular-locale_zh-hant-hk.js | 98 + .../1.1.5/i18n/angular-locale_zh-hant-mo.js | 98 + .../1.1.5/i18n/angular-locale_zh-hant-tw.js | 98 + .../1.1.5/i18n/angular-locale_zh-hant.js | 98 + .../1.1.5/i18n/angular-locale_zh-hk.js | 98 + .../1.1.5/i18n/angular-locale_zh-tw.js | 98 + .../angular/1.1.5/i18n/angular-locale_zh.js | 98 + .../1.1.5/i18n/angular-locale_zu-za.js | 98 + .../angular/1.1.5/i18n/angular-locale_zu.js | 98 + .../lib/angular/angular-ui-sortable.js | 1 + .../bootstrap/css/bootstrap-responsive.css | 1058 + .../css/bootstrap-responsive.min.css | 9 + .../lib/bootstrap/css/bootstrap.cosmo.min.css | 20 + .../umbraco/lib/bootstrap/css/bootstrap.css | 9 + .../lib/bootstrap/css/bootstrap.min.css | 9 + .../umbraco/lib/bootstrap/css/responsive.css | 9 + .../img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes .../bootstrap/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes .../lib/bootstrap/js/bootstrap.2.3.2.js | 2284 ++ .../lib/bootstrap/js/bootstrap.2.3.2.min.js | 6 + .../umbraco/lib/bootstrap/less/accordion.less | 34 + .../umbraco/lib/bootstrap/less/alerts.less | 79 + .../umbraco/lib/bootstrap/less/bootstrap.less | 63 + .../lib/bootstrap/less/breadcrumbs.less | 24 + .../lib/bootstrap/less/button-groups.less | 229 + .../umbraco/lib/bootstrap/less/buttons.less | 228 + .../umbraco/lib/bootstrap/less/carousel.less | 158 + .../umbraco/lib/bootstrap/less/close.less | 32 + .../umbraco/lib/bootstrap/less/code.less | 61 + .../bootstrap/less/component-animations.less | 22 + .../umbraco/lib/bootstrap/less/dropdowns.less | 237 + .../umbraco/lib/bootstrap/less/forms.less | 690 + .../umbraco/lib/bootstrap/less/grid.less | 21 + .../umbraco/lib/bootstrap/less/hero-unit.less | 25 + .../lib/bootstrap/less/labels-badges.less | 84 + .../umbraco/lib/bootstrap/less/layouts.less | 16 + .../umbraco/lib/bootstrap/less/media.less | 55 + .../umbraco/lib/bootstrap/less/mixins.less | 702 + .../umbraco/lib/bootstrap/less/modals.less | 95 + .../umbraco/lib/bootstrap/less/navbar.less | 497 + .../umbraco/lib/bootstrap/less/navs.less | 409 + .../umbraco/lib/bootstrap/less/pager.less | 43 + .../lib/bootstrap/less/pagination.less | 123 + .../umbraco/lib/bootstrap/less/popovers.less | 133 + .../lib/bootstrap/less/progress-bars.less | 122 + .../umbraco/lib/bootstrap/less/reset.less | 216 + .../bootstrap/less/responsive-1200px-min.less | 28 + .../bootstrap/less/responsive-767px-max.less | 193 + .../less/responsive-768px-979px.less | 19 + .../lib/bootstrap/less/responsive-navbar.less | 189 + .../bootstrap/less/responsive-utilities.less | 59 + .../lib/bootstrap/less/responsive.less | 48 + .../lib/bootstrap/less/scaffolding.less | 53 + .../umbraco/lib/bootstrap/less/sprites.less | 197 + .../umbraco/lib/bootstrap/less/tables.less | 244 + .../lib/bootstrap/less/tests/buttons.html | 139 + .../lib/bootstrap/less/tests/css-tests.css | 150 + .../lib/bootstrap/less/tests/css-tests.html | 1399 + .../less/tests/forms-responsive.html | 71 + .../lib/bootstrap/less/tests/forms.html | 179 + .../less/tests/navbar-fixed-top.html | 104 + .../less/tests/navbar-static-top.html | 107 + .../lib/bootstrap/less/tests/navbar.html | 107 + .../lib/bootstrap/less/thumbnails.less | 56 + .../umbraco/lib/bootstrap/less/tooltip.less | 70 + .../umbraco/lib/bootstrap/less/type.less | 247 + .../umbraco/lib/bootstrap/less/utilities.less | 30 + .../umbraco/lib/bootstrap/less/variables.less | 301 + .../umbraco/lib/bootstrap/less/wells.less | 29 + .../bootstrap-datetimepicker.js | 1314 + .../bootstrap-datetimepicker.min.css | 8 + .../bootstrap-datetimepicker.min.js | 27 + .../langs/datetimepicker.pt-BR.js | 14 + .../umbraco/lib/jquery/jquery-2.0.3.min.js | 15 + .../lib/jquery/jquery-ui-1.10.3.custom.min.js | 6 + .../jquery.sortable/jquery.sortable.min.js | 17 + .../umbraco/lib/jquery/jquery.ui.core.min.js | 4 + .../umbraco/lib/jquery/jquery.ui.draggable.js | 958 + .../jquery/jquery.ui.effect-highlight.min.js | 4 + .../lib/jquery/jquery.ui.effect.min.js | 4 + .../umbraco/lib/jquery/jquery.ui.mouse.min.js | 4 + .../lib/jquery/jquery.ui.sortable.min.js | 4 + .../lib/jquery/jquery.ui.widget.min.js | 4 + .../lib/jquery/jquery.upload/README.md | 123 + .../jquery.upload/cors/postmessage.html | 75 + .../lib/jquery/jquery.upload/cors/result.html | 24 + .../css/jquery.fileupload-ui.css | 68 + .../lib/jquery/jquery.upload/img/loading.gif | Bin 0 -> 3897 bytes .../jquery/jquery.upload/img/progressbar.gif | Bin 0 -> 3323 bytes .../lib/jquery/jquery.upload/js/app.js | 101 + .../js/cors/jquery.postmessage-transport.js | 118 + .../js/cors/jquery.xdr-transport.js | 87 + .../js/jquery.fileupload-angular.js | 402 + .../js/jquery.fileupload-audio.js | 106 + .../js/jquery.fileupload-image.js | 292 + .../js/jquery.fileupload-jquery-ui.js | 138 + .../js/jquery.fileupload-process.js | 164 + .../jquery.upload/js/jquery.fileupload-ui.js | 643 + .../js/jquery.fileupload-validate.js | 117 + .../js/jquery.fileupload-video.js | 106 + .../jquery.upload/js/jquery.fileupload.js | 1333 + .../js/jquery.iframe-transport.js | 205 + .../jquery/jquery.upload/js/load-image.min.js | 1 + .../lib/jquery/jquery.upload/js/main.js | 76 + .../js/vendor/jquery.ui.widget.js | 530 + .../umbraco/lib/lazyload/lazyload.min.js | 388 + .../lib/markdown/markdown.converter.js | 1344 + .../umbraco/lib/markdown/markdown.css | 80 + .../umbraco/lib/markdown/markdown.editor.js | 2110 ++ .../lib/markdown/markdown.sanitizer.js | 111 + OurUmbraco.Site/umbraco/lib/markdown/red.css | 6 + .../umbraco/lib/slider/js/bootstrap-slider.js | 388 + OurUmbraco.Site/umbraco/lib/slider/slider.css | 138 + .../umbraco/lib/spectrum/spectrum.css | 519 + .../umbraco/lib/spectrum/spectrum.js | 9 + .../umbraco/lib/tinymce/langs/readme.md | 3 + .../umbraco/lib/tinymce/license.txt | 504 + .../lib/tinymce/plugins/advlist/plugin.min.js | 1 + .../lib/tinymce/plugins/anchor/plugin.min.js | 1 + .../tinymce/plugins/autolink/plugin.min.js | 1 + .../tinymce/plugins/autoresize/plugin.min.js | 1 + .../tinymce/plugins/autosave/plugin.min.js | 1 + .../lib/tinymce/plugins/bbcode/plugin.min.js | 1 + .../lib/tinymce/plugins/charmap/plugin.min.js | 1 + .../lib/tinymce/plugins/code/plugin.min.js | 1 + .../plugins/compat3x/editable_selects.js | 70 + .../tinymce/plugins/compat3x/form_utils.js | 210 + .../lib/tinymce/plugins/compat3x/mctabs.js | 162 + .../plugins/compat3x/tiny_mce_popup.js | 435 + .../lib/tinymce/plugins/compat3x/validate.js | 252 + .../tinymce/plugins/contextmenu/plugin.min.js | 1 + .../plugins/directionality/plugin.min.js | 1 + .../plugins/emoticons/img/smiley-cool.gif | Bin 0 -> 354 bytes .../plugins/emoticons/img/smiley-cry.gif | Bin 0 -> 329 bytes .../emoticons/img/smiley-embarassed.gif | Bin 0 -> 331 bytes .../emoticons/img/smiley-foot-in-mouth.gif | Bin 0 -> 342 bytes .../plugins/emoticons/img/smiley-frown.gif | Bin 0 -> 340 bytes .../plugins/emoticons/img/smiley-innocent.gif | Bin 0 -> 336 bytes .../plugins/emoticons/img/smiley-kiss.gif | Bin 0 -> 338 bytes .../plugins/emoticons/img/smiley-laughing.gif | Bin 0 -> 343 bytes .../emoticons/img/smiley-money-mouth.gif | Bin 0 -> 321 bytes .../plugins/emoticons/img/smiley-sealed.gif | Bin 0 -> 323 bytes .../plugins/emoticons/img/smiley-smile.gif | Bin 0 -> 344 bytes .../emoticons/img/smiley-surprised.gif | Bin 0 -> 338 bytes .../emoticons/img/smiley-tongue-out.gif | Bin 0 -> 328 bytes .../emoticons/img/smiley-undecided.gif | Bin 0 -> 337 bytes .../plugins/emoticons/img/smiley-wink.gif | Bin 0 -> 350 bytes .../plugins/emoticons/img/smiley-yell.gif | Bin 0 -> 336 bytes .../tinymce/plugins/emoticons/plugin.min.js | 1 + .../lib/tinymce/plugins/example/plugin.min.js | 1 + .../plugins/example_dependency/plugin.min.js | 1 + .../tinymce/plugins/fullpage/plugin.min.js | 1 + .../tinymce/plugins/fullscreen/plugin.min.js | 1 + .../lib/tinymce/plugins/hr/plugin.min.js | 1 + .../lib/tinymce/plugins/image/plugin.min.js | 1 + .../tinymce/plugins/importcss/plugin.min.js | 1 + .../plugins/insertdatetime/plugin.min.js | 1 + .../lib/tinymce/plugins/layer/plugin.min.js | 1 + .../plugins/legacyoutput/plugin.min.js | 1 + .../lib/tinymce/plugins/link/plugin.min.js | 1 + .../lib/tinymce/plugins/lists/plugin.min.js | 1 + .../lib/tinymce/plugins/media/moxieplayer.swf | Bin 0 -> 20017 bytes .../lib/tinymce/plugins/media/plugin.min.js | 1 + .../tinymce/plugins/nonbreaking/plugin.min.js | 1 + .../tinymce/plugins/noneditable/plugin.min.js | 1 + .../tinymce/plugins/pagebreak/plugin.min.js | 1 + .../lib/tinymce/plugins/paste/plugin.min.js | 1 + .../lib/tinymce/plugins/preview/plugin.min.js | 1 + .../lib/tinymce/plugins/print/plugin.min.js | 1 + .../lib/tinymce/plugins/save/plugin.min.js | 1 + .../plugins/searchreplace/plugin.min.js | 1 + .../plugins/spellchecker/plugin.min.js | 1 + .../tinymce/plugins/tabfocus/plugin.min.js | 1 + .../lib/tinymce/plugins/table/plugin.min.js | 1 + .../tinymce/plugins/template/plugin.min.js | 1 + .../tinymce/plugins/textcolor/plugin.min.js | 1 + .../umbracocontextmenu/editor_plugin_src.js | 69 + .../plugins/umbracocontextmenu/plugin.min.js | 69 + .../plugins/umbracocss/img/example.gif | Bin 0 -> 87 bytes .../tinymce/plugins/umbracocss/js/dialog.js | 19 + .../tinymce/plugins/umbracocss/langs/en.js | 3 + .../plugins/umbracocss/langs/en_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/en_us.js | 3 + .../plugins/umbracocss/langs/en_us_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/it.js | 3 + .../plugins/umbracocss/langs/it_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/ja.js | 3 + .../plugins/umbracocss/langs/ja_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/ru.js | 3 + .../plugins/umbracocss/langs/ru_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/sv.js | 3 + .../plugins/umbracocss/langs/sv_dlg.js | 3 + .../tinymce/plugins/umbracocss/langs/zh.js | 3 + .../plugins/umbracocss/langs/zh_dlg.js | 3 + .../tinymce/plugins/umbracocss/plugin.min.js | 182 + .../tinymce/plugins/umbracoembed/dialog.htm | 92 + .../plugins/umbracoembed/editor_plugin.js | 1 + .../plugins/umbracoembed/editor_plugin_src.js | 84 + .../plugins/umbracoembed/img/ajax-loader.gif | Bin 0 -> 1928 bytes .../plugins/umbracoembed/img/embed.gif | Bin 0 -> 260 bytes .../plugins/umbracoembed/img/embed.png | Bin 0 -> 537 bytes .../tinymce/plugins/umbracoembed/js/dialog.js | 90 + .../tinymce/plugins/umbracoembed/langs/da.js | 3 + .../plugins/umbracoembed/langs/da_dlg.js | 9 + .../tinymce/plugins/umbracoembed/langs/de.js | 10 + .../plugins/umbracoembed/langs/de_dlg.js | 10 + .../tinymce/plugins/umbracoembed/langs/en.js | 3 + .../plugins/umbracoembed/langs/en_dlg.js | 10 + .../plugins/umbracoembed/langs/en_us.js | 3 + .../plugins/umbracoembed/langs/en_us_dlg.js | 10 + .../tinymce/plugins/umbracoembed/langs/it.js | 9 + .../plugins/umbracoembed/langs/it_dlg.js | 9 + .../tinymce/plugins/umbracoembed/langs/ja.js | 10 + .../plugins/umbracoembed/langs/ja_dlg.js | 10 + .../tinymce/plugins/umbracoembed/langs/ru.js | 10 + .../plugins/umbracoembed/langs/ru_dlg.js | 10 + .../tinymce/plugins/umbracoembed/langs/sv.js | 10 + .../plugins/umbracoembed/langs/sv_dlg.js | 10 + .../tinymce/plugins/umbracoembed/langs/zh.js | 10 + .../plugins/umbracoembed/langs/zh_dlg.js | 9 + .../plugins/umbracoimg/editor_plugin_src.js | 52 + .../tinymce/plugins/umbracoimg/js/image.js | 332 + .../plugins/umbracoimg/langs/en_dlg.js | 43 + .../plugins/umbracoimg/langs/en_us_dlg.js | 43 + .../plugins/umbracoimg/langs/he_dlg.js | 43 + .../plugins/umbracoimg/langs/it_dlg.js | 43 + .../plugins/umbracoimg/langs/ja_dlg.js | 43 + .../plugins/umbracoimg/langs/ru_dlg.js | 43 + .../plugins/umbracoimg/langs/sv_dlg.js | 43 + .../plugins/umbracoimg/langs/zh_dlg.js | 43 + .../tinymce/plugins/umbracolink/plugin.min.js | 264 + .../tinymce/plugins/umbracomacro/dialog.htm | 27 + .../plugins/umbracomacro/editor_plugin_src.js | 145 + .../plugins/umbracomacro/img/insMacro.gif | Bin 0 -> 603 bytes .../tinymce/plugins/umbracomacro/js/dialog.js | 19 + .../tinymce/plugins/umbracomacro/langs/en.js | 3 + .../plugins/umbracomacro/langs/en_dlg.js | 3 + .../plugins/umbracomacro/langs/en_us.js | 3 + .../plugins/umbracomacro/langs/en_us_dlg.js | 3 + .../tinymce/plugins/umbracomacro/langs/he.js | 3 + .../plugins/umbracomacro/langs/he_dlg.js | 3 + .../tinymce/plugins/umbracomacro/langs/ja.js | 3 + .../plugins/umbracomacro/langs/ja_dlg.js | 3 + .../tinymce/plugins/umbracomacro/langs/ru.js | 3 + .../plugins/umbracomacro/langs/ru_dlg.js | 3 + .../tinymce/plugins/umbracomacro/langs/sv.js | 3 + .../plugins/umbracomacro/langs/sv_dlg.js | 3 + .../tinymce/plugins/umbracomacro/langs/zh.js | 3 + .../plugins/umbracomacro/langs/zh_dlg.js | 3 + .../plugins/umbracopaste/editor_plugin_src.js | 53 + .../umbracoshortcut/editor_plugin_src.js | 43 + .../plugins/visualblocks/css/visualblocks.css | 128 + .../plugins/visualblocks/plugin.min.js | 1 + .../tinymce/plugins/visualchars/plugin.min.js | 1 + .../tinymce/plugins/wordcount/plugin.min.js | 1 + .../skins/lightgray/content.inline.min.css | 1 + .../tinymce/skins/lightgray/content.min.css | 1 + .../skins/lightgray/fonts/icomoon-small.eot | Bin 0 -> 8344 bytes .../skins/lightgray/fonts/icomoon-small.svg | 175 + .../skins/lightgray/fonts/icomoon-small.ttf | Bin 0 -> 8160 bytes .../skins/lightgray/fonts/icomoon-small.woff | Bin 0 -> 8336 bytes .../tinymce/skins/lightgray/fonts/icomoon.eot | Bin 0 -> 8268 bytes .../tinymce/skins/lightgray/fonts/icomoon.svg | 153 + .../tinymce/skins/lightgray/fonts/icomoon.ttf | Bin 0 -> 8104 bytes .../skins/lightgray/fonts/icomoon.woff | Bin 0 -> 8400 bytes .../tinymce/skins/lightgray/fonts/readme.md | 1 + .../skins/lightgray/fonts/tinymce-small.eot | Bin 0 -> 8348 bytes .../skins/lightgray/fonts/tinymce-small.svg | 175 + .../skins/lightgray/fonts/tinymce-small.ttf | Bin 0 -> 8164 bytes .../skins/lightgray/fonts/tinymce-small.woff | Bin 0 -> 8340 bytes .../tinymce/skins/lightgray/fonts/tinymce.eot | Bin 0 -> 8276 bytes .../tinymce/skins/lightgray/fonts/tinymce.svg | 153 + .../tinymce/skins/lightgray/fonts/tinymce.ttf | Bin 0 -> 8112 bytes .../skins/lightgray/fonts/tinymce.woff | Bin 0 -> 8408 bytes .../tinymce/skins/lightgray/img/anchor.gif | Bin 0 -> 53 bytes .../tinymce/skins/lightgray/img/loader.gif | Bin 0 -> 2608 bytes .../tinymce/skins/lightgray/img/object.gif | Bin 0 -> 152 bytes .../lib/tinymce/skins/lightgray/img/trans.gif | Bin 0 -> 43 bytes .../lib/tinymce/skins/lightgray/img/wline.gif | Bin 0 -> 46 bytes .../skins/lightgray/skin.classic.min.css | 1 + .../tinymce/skins/lightgray/skin.ie7.min.css | 1 + .../lib/tinymce/skins/lightgray/skin.min.css | 1 + .../lib/tinymce/skins/umbraco/content.min.css | 98 + .../tinymce/skins/umbraco/fonts/icomoon.eot | Bin 0 -> 8196 bytes .../tinymce/skins/umbraco/fonts/icomoon.svg | 150 + .../tinymce/skins/umbraco/fonts/icomoon.ttf | Bin 0 -> 8032 bytes .../tinymce/skins/umbraco/fonts/icomoon.woff | Bin 0 -> 8340 bytes .../lib/tinymce/skins/umbraco/fonts/readme.md | 1 + .../lib/tinymce/skins/umbraco/img/anchor.gif | Bin 0 -> 53 bytes .../lib/tinymce/skins/umbraco/img/loader.gif | Bin 0 -> 2608 bytes .../lib/tinymce/skins/umbraco/img/object.gif | Bin 0 -> 152 bytes .../lib/tinymce/skins/umbraco/img/trans.gif | Bin 0 -> 43 bytes .../lib/tinymce/skins/umbraco/img/wline.gif | Bin 0 -> 46 bytes .../skins/umbraco/skin.classic.min.css | 1 + .../tinymce/skins/umbraco/skin.ie7.min.css | 1 + .../lib/tinymce/skins/umbraco/skin.min.css | 1 + .../lib/tinymce/themes/modern/theme.min.js | 1 + .../lib/tinymce/themes/umbraco/theme.min.js | 1 + .../umbraco/lib/tinymce/tinymce.min.js | 10 + .../lib/typeahead/typeahead.bundle.min.js | 7 + .../umbraco/lib/umbraco/Extensions.js | 335 + .../umbraco/lib/umbraco/LegacySpeechBubble.js | 76 + .../umbraco/lib/umbraco/LegacyUmbClientMgr.js | 389 + .../umbraco/lib/umbraco/NamespaceManager.js | 17 + OurUmbraco.Site/umbraco/lib/umbraco/compat.js | 47 + .../umbraco/lib/underscore/underscore-min.js | 5 + .../umbraco/lib/underscore/underscore.js | 1189 + OurUmbraco.Site/umbraco/login.aspx | 23 +- OurUmbraco.Site/umbraco/logout.aspx | 59 +- .../umbraco/masterpages/default.Master | 2 +- .../umbraco/masterpages/umbracoDialog.Master | 41 +- .../umbraco/masterpages/umbracoPage.Master | 47 +- .../umbraco/members/EditMember.aspx | 7 +- .../umbraco/members/EditMemberType.aspx | 8 +- .../umbraco/members/MemberSearch.ascx | 6 +- OurUmbraco.Site/umbraco/ping.aspx | 2 +- .../umbraco/plugins/tinymce3/insertImage.aspx | 6 +- .../umbraco/plugins/tinymce3/insertLink.aspx | 9 +- .../umbraco/plugins/tinymce3/insertMacro.aspx | 21 +- .../umbraco/plugins/uGoLive/Dashboard.ascx | 18 +- .../templates/cshtml/Breadcrumb.cshtml | 27 +- .../templates/cshtml/EmptyTemplate.cshtml | 15 + .../scripting/templates/cshtml/Gallery.cshtml | 32 + .../ListAncestorsFromCurrentPage.cshtml | 16 + .../ListChildPagesFromChangeableSource.cshtml | 26 + .../ListChildPagesFromCurrentPage.cshtml | 16 + .../cshtml/ListChildPagesOrderedByDate.cshtml | 10 + .../cshtml/ListChildPagesOrderedByName.cshtml | 9 + .../ListChildPagesOrderedByProperty.cshtml | 20 + .../cshtml/ListChildPagesWithDoctype.cshtml | 30 + .../ListDescendantsFromCurrentPage.cshtml | 54 + .../cshtml/ListImagesFromMediaFolder.cshtml | 23 + .../cshtml/MultinodeTree-picker.cshtml | 24 + .../templates/cshtml/Navigation.cshtml | 47 +- .../scripting/templates/cshtml/SiteMap.cshtml | 68 +- .../umbraco/settings/EditMediaType.aspx | 1 + .../umbraco/settings/EditNodeTypeNew.aspx | 9 +- .../umbraco/settings/editLanguage.aspx | 3 +- .../umbraco/settings/editTemplate.aspx | 292 +- .../settings/modals/ShowUmbracoTags.aspx | 5 +- .../umbraco/settings/scripts/editScript.aspx | 74 +- .../settings/stylesheet/editstylesheet.aspx | 90 +- .../property/EditStyleSheetProperty.aspx | 28 +- .../umbraco/settings/views/EditView.aspx | 55 +- OurUmbraco.Site/umbraco/treeInit.aspx | 2 +- OurUmbraco.Site/umbraco/umbraco.aspx | 381 +- OurUmbraco.Site/umbraco/users/EditUser.aspx | 2 +- .../umbraco/users/NodePermissions.ascx | 16 +- .../umbraco/users/PermissionEditor.aspx | 3 +- .../UltimatePickerAutoCompleteHandler.ashx | 1 + OurUmbraco.Site/umbraco/xslt/Web.config | 18 + .../umbraco/xslt/searchResult.xslt | 1 + .../umbraco_client/Application/Extensions.js | 360 + .../Application/HistoryManager.js | 30 +- .../Application/JQuery/jquery.autocomplete.js | 32 +- .../JQuery/jquery.unobtrusive-ajax.min.js | 5 + .../Application/JQuery/jquery.validate.min.js | 4 + .../JQuery/jquery.validate.unobtrusive.min.js | 5 + .../Application/UmbracoApplicationActions.js | 186 +- .../Application/UmbracoClientManager.js | 96 +- .../Application/UmbracoUtils.js | 8 +- .../umbraco_client/CodeArea/UmbracoEditor.js | 85 +- .../umbraco_client/CodeArea/styles.css | 4 +- .../Dashboards/ExamineManagement.css | 124 + .../Dashboards/ExamineManagement.js | 289 + .../Dashboards/ExamineManagementIco.png | Bin 0 -> 1818 bytes .../DateTimePicker/timepicker.js | 10 + .../umbraco_client/Dialogs/AssignDomain2.css | 25 + .../umbraco_client/Dialogs/AssignDomain2.js | 130 + .../umbraco_client/Dialogs/CreateDialog.css | 19 + .../umbraco_client/Dialogs/EditMacro.css | 25 + .../umbraco_client/Dialogs/EditMacro.js | 194 + .../umbraco_client/Dialogs/PublishDialog.css | 27 + .../umbraco_client/Dialogs/PublishDialog.js | 98 + .../umbraco_client/Dialogs/SortDialog.css | 59 + .../umbraco_client/Dialogs/SortDialog.js | 121 + .../Editors/DirectoryBrowser.css | 28 + .../umbraco_client/Editors/EditMacro.css | 36 + .../Editors/EditMacroScripts.js | 81 + .../umbraco_client/Editors/EditScript.js | 79 + .../umbraco_client/Editors/EditStyleSheet.js | 66 + .../umbraco_client/Editors/EditTemplate.js | 175 + .../umbraco_client/Editors/EditView.js | 172 +- .../umbraco_client/Editors/EditXslt.css | 14 + .../umbraco_client/Editors/EditXslt.js | 80 + .../FolderBrowser/Css/folderbrowser.css | 14 +- .../FolderBrowser/Js/folderbrowser.js | 41 +- .../GenericProperty/genericProperty.js | 85 +- .../GenericProperty/genericproperty.css | 62 +- .../umbraco_client/IconPicker/iconpicker.js | 5 + .../umbraco_client/Installer/css/all.css | 183 +- .../Installer/images/zoom-in.png | Bin 0 -> 1207 bytes .../Installer/js/PackageInstaller.js | 20 +- .../Installer/js/jquery.main.js | 2 +- .../umbraco_client/Panel/javascript.js | 48 +- .../umbraco_client/Panel/style.css | 2 +- .../umbraco_client/Tree/UmbracoTree.js | 24 +- .../umbraco_client/Tree/menuIcons.css | 7 +- .../umbraco_client/Tree/sprites.png | Bin 12301 -> 12897 bytes OurUmbraco.Site/umbraco_client/modal/modal.js | 3 +- .../passwordStrength/passwordstrength.js | 7 +- .../umbraco_client/propertypane/style.css | 4 + .../splitbutton/InsertMacroSplitButton.js | 57 + .../umbraco_client/tablesorting/img/asc.gif | Bin 0 -> 830 bytes .../umbraco_client/tablesorting/img/desc.gif | Bin 0 -> 833 bytes .../tablesorting/jquery.tablesorter.min.js | 4 + .../tablesorting/tableFilter.js | 524 +- .../tags/css/jquery.tagsinput.css | 5 + .../umbraco_client/tinymce3/langs/en_us.js | 1 + .../umbraco_client/tinymce3/langs/ru.js | 1 + .../umbraco_client/tinymce3/license.txt | 2 +- .../tinymce3/plugins/advhr/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/advhr/langs/ru_dlg.js | 1 + .../plugins/advimage/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/advimage/langs/ru_dlg.js | 1 + .../plugins/advlink/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/advlink/langs/ru_dlg.js | 1 + .../plugins/autolink/editor_plugin.js | 2 +- .../plugins/autolink/editor_plugin_src.js | 4 +- .../tinymce3/plugins/autosave/langs/en_us.js | 4 + .../plugins/emotions/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/emotions/langs/ru_dlg.js | 1 + .../plugins/example/editor_plugin_src.js | 2 +- .../plugins/fullpage/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/fullpage/langs/ru_dlg.js | 1 + .../plugins/fullscreen/editor_plugin.js | 2 +- .../plugins/fullscreen/editor_plugin_src.js | 131 +- .../plugins/fullscreen/fullscreen.htm | 25 +- .../plugins/inlinepopups/editor_plugin.js | 2 +- .../plugins/inlinepopups/editor_plugin_src.js | 26 +- .../tinymce3/plugins/media/js/media.js | 44 +- .../tinymce3/plugins/media/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/media/langs/fi_dlg.js | 1 + .../tinymce3/plugins/media/langs/he_dlg.js | 1 + .../tinymce3/plugins/media/langs/ja_dlg.js | 1 + .../tinymce3/plugins/media/langs/pl_dlg.js | 1 + .../tinymce3/plugins/media/langs/pt_dlg.js | 1 + .../tinymce3/plugins/media/langs/ru_dlg.js | 1 + .../tinymce3/plugins/media/langs/zh_dlg.js | 1 + .../tinymce3/plugins/paste/editor_plugin.js | 2 +- .../plugins/paste/editor_plugin_src.js | 10 +- .../tinymce3/plugins/paste/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/paste/langs/ru_dlg.js | 1 + .../plugins/searchreplace/js/searchreplace.js | 6 + .../plugins/searchreplace/langs/en_us_dlg.js | 1 + .../plugins/searchreplace/langs/ru_dlg.js | 1 + .../plugins/spellchecker/editor_plugin.js | 2 +- .../plugins/spellchecker/editor_plugin_src.js | 45 +- .../tinymce3/plugins/style/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/style/langs/ru_dlg.js | 1 + .../tinymce3/plugins/table/editor_plugin.js | 2 +- .../plugins/table/editor_plugin_src.js | 10 +- .../tinymce3/plugins/table/js/row.js | 17 + .../tinymce3/plugins/table/js/table.js | 14 +- .../tinymce3/plugins/table/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/table/langs/ru_dlg.js | 1 + .../tinymce3/plugins/table/row.htm | 30 +- .../plugins/template/langs/en_us_dlg.js | 1 + .../tinymce3/plugins/template/langs/ru_dlg.js | 1 + .../plugins/umbracocss/langs/en_us.js | 3 + .../plugins/umbracocss/langs/en_us_dlg.js | 3 + .../tinymce3/plugins/umbracocss/langs/it.js | 3 + .../plugins/umbracocss/langs/it_dlg.js | 3 + .../tinymce3/plugins/umbracocss/langs/ja.js | 3 + .../plugins/umbracocss/langs/ja_dlg.js | 3 + .../tinymce3/plugins/umbracocss/langs/sv.js | 3 + .../plugins/umbracocss/langs/sv_dlg.js | 3 + .../plugins/umbracoembed/editor_plugin_src.js | 2 +- .../plugins/umbracoembed/js/dialog.js | 72 +- .../tinymce3/plugins/umbracoembed/langs/da.js | 3 + .../plugins/umbracoembed/langs/da_dlg.js | 9 + .../tinymce3/plugins/umbracoembed/langs/de.js | 10 + .../plugins/umbracoembed/langs/de_dlg.js | 10 + .../tinymce3/plugins/umbracoembed/langs/en.js | 11 +- .../plugins/umbracoembed/langs/en_us.js | 3 + .../plugins/umbracoembed/langs/en_us_dlg.js | 10 + .../tinymce3/plugins/umbracoembed/langs/it.js | 9 + .../plugins/umbracoembed/langs/it_dlg.js | 9 + .../tinymce3/plugins/umbracoembed/langs/ja.js | 10 + .../plugins/umbracoembed/langs/ja_dlg.js | 10 + .../tinymce3/plugins/umbracoembed/langs/sv.js | 10 + .../plugins/umbracoembed/langs/sv_dlg.js | 10 + .../plugins/umbracoimg/langs/en_us_dlg.js | 43 + .../plugins/umbracoimg/langs/it_dlg.js | 43 + .../plugins/umbracoimg/langs/sv_dlg.js | 43 + .../plugins/umbracolink/js/umbracolink.js | 1 + .../plugins/umbracolink/langs/da_dlg.js | 1 + .../plugins/umbracolink/langs/de_dlg.js | 1 + .../plugins/umbracolink/langs/en_us_dlg.js | 1 + .../plugins/umbracolink/langs/fi_dlg.js | 1 + .../plugins/umbracolink/langs/fr_dlg.js | 1 + .../plugins/umbracolink/langs/he_dlg.js | 2 +- .../plugins/umbracolink/langs/it_dlg.js | 1 + .../plugins/umbracolink/langs/ja_dlg.js | 2 +- .../plugins/umbracolink/langs/nl_dlg.js | 1 + .../plugins/umbracolink/langs/no_dlg.js | 1 + .../plugins/umbracolink/langs/pl_dlg.js | 1 + .../plugins/umbracolink/langs/pt_dlg.js | 1 + .../plugins/umbracolink/langs/sv_dlg.js | 1 + .../plugins/umbracolink/langs/zh_dlg.js | 2 +- .../plugins/umbracomacro/langs/en_us.js | 3 + .../plugins/umbracomacro/langs/en_us_dlg.js | 3 + .../tinymce3/plugins/umbracomacro/langs/sv.js | 3 + .../plugins/umbracomacro/langs/sv_dlg.js | 3 + .../plugins/xhtmlxtras/langs/en_us_dlg.js | 1 + .../plugins/xhtmlxtras/langs/ru_dlg.js | 1 + .../themes/advanced/editor_template.js | 2 +- .../themes/advanced/editor_template_src.js | 2 +- .../themes/umbraco/editor_template_src.js | 25 +- .../tinymce3/themes/umbraco/langs/en_us.js | 74 + .../themes/umbraco/langs/en_us_dlg.js | 55 + .../tinymce3/themes/umbraco/langs/it.js | 36 +- .../tinymce3/themes/umbraco/langs/it_dlg.js | 101 +- .../themes/umbraco/skins/umbraco/content.css | 2 +- .../umbraco_client/tinymce3/tiny_mce.js | 2 +- .../umbraco_client/tinymce3/tiny_mce_popup.js | 2 +- .../umbraco_client/tinymce3/tiny_mce_src.js | 341 +- OurUmbraco.Site/umbraco_client/ui/default.css | 41 +- .../umbraco_client/ui/jquery.dd.js | 41 +- OurUmbraco.Site/web.config | 231 +- .../Umb.OurUmb.MemberLocator.csproj | 10 +- dependencies/7.1.6/ClientDependency.Core.dll | Bin 0 -> 142336 bytes .../CookComputing.XmlRpcV2.dll | Bin dependencies/7.1.6/Examine.dll | Bin 0 -> 87040 bytes dependencies/7.1.6/HtmlAgilityPack.dll | Bin 0 -> 134656 bytes .../ICSharpCode.SharpZipLib.dll | Bin dependencies/{4.11.2 => 7.1.6}/Lucene.Net.dll | Bin .../Microsoft.ApplicationBlocks.Data.dll | Bin dependencies/7.1.6/MySql.Data.dll | Bin 0 -> 391680 bytes dependencies/7.1.6/SQLCE4Umbraco.dll | Bin 0 -> 19968 bytes .../System.Data.SqlServerCe.Entity.dll | Bin .../System.Data.SqlServerCe.dll | Bin dependencies/{4.11.2 => 7.1.6}/TidyNet.dll | Bin dependencies/7.1.6/Umbraco.Core.dll | Bin 0 -> 1934848 bytes dependencies/7.1.6/Umbraco.Web.UI.dll | Bin 0 -> 57344 bytes dependencies/7.1.6/UmbracoExamine.dll | Bin 0 -> 34816 bytes .../UrlRewritingNet.UrlRewriter.dll | Bin dependencies/7.1.6/businesslogic.dll | Bin 0 -> 114688 bytes dependencies/7.1.6/cms.dll | Bin 0 -> 512000 bytes dependencies/7.1.6/controls.dll | Bin 0 -> 51712 bytes dependencies/7.1.6/interfaces.dll | Bin 0 -> 24576 bytes dependencies/7.1.6/umbraco.DataLayer.dll | Bin 0 -> 38912 bytes dependencies/7.1.6/umbraco.MacroEngines.dll | Bin 0 -> 131072 bytes dependencies/7.1.6/umbraco.XmlSerializers.dll | Bin 0 -> 78336 bytes dependencies/7.1.6/umbraco.dll | Bin 0 -> 1839104 bytes dependencies/7.1.6/umbraco.editorControls.dll | Bin 0 -> 372736 bytes dependencies/7.1.6/umbraco.providers.dll | Bin 0 -> 37888 bytes .../ClientDependency.Core.dll | Bin .../CookComputing.XmlRpcV2.dll | Bin dependencies/{4.11.2 => _4.11.2}/Examine.dll | Bin .../{4.11.2 => _4.11.2}/HtmlAgilityPack.dll | Bin .../ICSharpCode.SharpZipLib.dll | Bin .../{4.9.1 => _4.11.2}/Lucene.Net.dll | Bin .../Microsoft.ApplicationBlocks.Data.dll | Bin .../{4.11.2 => _4.11.2}/MySql.Data.dll | Bin .../Our.Umbraco.uGoLive.47x.dll | Bin .../Our.Umbraco.uGoLive.Checks.dll | Bin .../Our.Umbraco.uGoLive.dll | Bin .../{4.11.2 => _4.11.2}/SQLCE4Umbraco.dll | Bin .../System.Data.SqlServerCe.Entity.dll | Bin 0 -> 240352 bytes .../_4.11.2/System.Data.SqlServerCe.dll | Bin 0 -> 470240 bytes dependencies/{4.9.1 => _4.11.2}/TidyNet.dll | Bin .../{4.11.2 => _4.11.2}/Umbraco.Core.dll | Bin .../{4.11.2 => _4.11.2}/Umbraco.Web.UI.dll | Bin .../{4.11.2 => _4.11.2}/UmbracoExamine.dll | Bin .../UrlRewritingNet.UrlRewriter.dll | Bin .../{4.11.2 => _4.11.2}/businesslogic.dll | Bin dependencies/{4.11.2 => _4.11.2}/cms.dll | Bin dependencies/{4.11.2 => _4.11.2}/controls.dll | Bin .../{4.11.2 => _4.11.2}/interfaces.dll | Bin dependencies/{4.11.2 => _4.11.2}/log4net.dll | Bin .../{4.11.2 => _4.11.2}/umbraco.DataLayer.dll | Bin .../umbraco.MacroEngines.dll | Bin .../umbraco.XmlSerializers.dll | Bin dependencies/{4.11.2 => _4.11.2}/umbraco.dll | Bin .../umbraco.editorControls.dll | Bin .../umbraco.macroRenderings.dll | Bin .../{4.11.2 => _4.11.2}/umbraco.providers.dll | Bin .../ClientDependency.Core.dll | Bin .../_4.9.1/CookComputing.XmlRpcV2.dll | Bin 0 -> 122880 bytes dependencies/{4.9.1 => _4.9.1}/Examine.dll | Bin .../{4.9.1 => _4.9.1}/HtmlAgilityPack.dll | Bin .../_4.9.1/ICSharpCode.SharpZipLib.dll | Bin 0 -> 200704 bytes dependencies/_4.9.1/Lucene.Net.dll | Bin 0 -> 786432 bytes .../Microsoft.ApplicationBlocks.Data.dll | Bin 0 -> 11264 bytes dependencies/{4.9.1 => _4.9.1}/MySql.Data.dll | Bin .../Our.Umbraco.uGoLive.47x.dll | Bin .../Our.Umbraco.uGoLive.Checks.dll | Bin .../{4.9.1 => _4.9.1}/Our.Umbraco.uGoLive.dll | Bin .../{4.9.1 => _4.9.1}/SQLCE4Umbraco.dll | Bin .../System.Data.SqlServerCe.Entity.dll | Bin .../System.Data.SqlServerCe.dll | Bin dependencies/_4.9.1/TidyNet.dll | Bin 0 -> 192512 bytes .../{4.9.1 => _4.9.1}/Umbraco.Core.dll | Bin .../{4.9.1 => _4.9.1}/Umbraco.Web.UI.dll | Bin .../{4.9.1 => _4.9.1}/UmbracoExamine.dll | Bin .../_4.9.1/UrlRewritingNet.UrlRewriter.dll | Bin 0 -> 22528 bytes .../{4.9.1 => _4.9.1}/businesslogic.dll | Bin dependencies/{4.9.1 => _4.9.1}/cms.dll | Bin dependencies/{4.9.1 => _4.9.1}/controls.dll | Bin dependencies/{4.9.1 => _4.9.1}/interfaces.dll | Bin .../{4.9.1 => _4.9.1}/umbraco.DataLayer.dll | Bin .../umbraco.MacroEngines.dll | Bin .../umbraco.XmlSerializers.dll | Bin dependencies/{4.9.1 => _4.9.1}/umbraco.dll | Bin .../umbraco.editorControls.dll | Bin .../umbraco.macroRenderings.dll | Bin .../{4.9.1 => _4.9.1}/umbraco.providers.dll | Bin our.umbraco.org/our.umbraco.org.csproj | 20 +- uDocumentation/uDocumentation.csproj | 6 +- uEvents/uEvents.csproj | 12 +- uForum/uForum.csproj | 13 +- uPowers/uPowers.csproj | 13 +- uRelease/uRelease.csproj | 4 +- uRepo/uRepo.csproj | 6 +- uSearch/uSearch.csproj | 14 +- uVersion/uVersion.csproj | 8 +- uWiki/uWiki.csproj | 10 +- 1257 files changed, 159986 insertions(+), 6251 deletions(-) create mode 100644 OurUmbraco.Site/Global.asax create mode 100644 OurUmbraco.Site/umbraco/ClientRedirect.aspx create mode 100644 OurUmbraco.Site/umbraco/Install/Legacy/loadStarterKits.ascx create mode 100644 OurUmbraco.Site/umbraco/Install/Views/Index.cshtml create mode 100644 OurUmbraco.Site/umbraco/Install/Views/Web.config create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Breadcrumb.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/EditProfile.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Empty (ForUseWithCustomViews).cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Empty.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Gallery.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Login.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/LoginStatus.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/Navigation.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml create mode 100644 OurUmbraco.Site/umbraco/PartialViewMacros/Templates/SiteMap.cshtml create mode 100644 OurUmbraco.Site/umbraco/Views/AuthorizeUpgrade.cshtml create mode 100644 OurUmbraco.Site/umbraco/Views/Default.cshtml create mode 100644 OurUmbraco.Site/umbraco/Views/common/dashboard.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/content/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/contentpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/help.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/iconpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/insertmacro.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/legacydelete.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/linkpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/login.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/macropicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/mediapicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/membergrouppicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/memberpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/property.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/rteembed.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/treepicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/user.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/dialogs/ysod.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/legacy.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/login.html create mode 100644 OurUmbraco.Site/umbraco/Views/common/notifications/confirmroutechange.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/copy.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/create.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/delete.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/emptyrecyclebin.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/move.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/recyclebin.html create mode 100644 OurUmbraco.Site/umbraco/Views/content/umbpreview.html create mode 100644 OurUmbraco.Site/umbraco/Views/contenttype/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/ChangePassword.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardIntro.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardKits.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardLastEdits.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardVideos.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/ourumbraco.png create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/default/umbracotv.png create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardintro.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardvideos.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/media/desktopmediauploader.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardintro.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardvideos.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/media/mediafolderbrowser.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardintro.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardvideos.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardintro.html create mode 100644 OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardvideos.html create mode 100644 OurUmbraco.Site/umbraco/Views/datatype/delete.html create mode 100644 OurUmbraco.Site/umbraco/Views/datatype/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/button-group.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/html/umb-control-group.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/html/umb-pane.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/html/umb-panel.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/html/umb-photo-folder.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/html/umb-upload-dropzone.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-crop.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-gravity.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-thumbnail.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-avatar.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-confirm.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-content-name.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-contextmenu.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-editor.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-header.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-item-sorter.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-login.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-navigation.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-notifications.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-optionsmenu.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-property.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-sections.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-tab-view.html create mode 100644 OurUmbraco.Site/umbraco/Views/directives/umb-tab.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/continueinstall.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/database.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/error.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/permissionsreport.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/starterkit.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/upgrade.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/user.html create mode 100644 OurUmbraco.Site/umbraco/Views/install/version7upgradereport.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/create.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/delete.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/emptyrecyclebin.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/move.html create mode 100644 OurUmbraco.Site/umbraco/Views/media/recyclebin.html create mode 100644 OurUmbraco.Site/umbraco/Views/member/create.html create mode 100644 OurUmbraco.Site/umbraco/Views/member/delete.html create mode 100644 OurUmbraco.Site/umbraco/Views/member/edit.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/boolean.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/hidden.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/mediapicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/multivalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/nodetype.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/number.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/readonlykeyvalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/requiredfield.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/textarea.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/textstring.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/treepicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/prevalueeditors/treesource.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/boolean/boolean.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/changepassword/changepassword.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/checkboxlist/checkboxlist.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.prevalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/contentpicker/contentpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/datepicker/datepicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/dropdown/dropdown.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/email/email.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/entitypicker/entitypicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/fileupload/fileupload.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/folderbrowser/folderbrowser.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/googlemaps/googlemaps.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/grid/css/iframe.css create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/grid/grid.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/grid/iframe.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/grid/js/iframe.js create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.prevalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/integer/integer.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/listview/listview.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/macrocontainer/macrocontainer.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/markdowneditor/markdowneditor.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/mediapicker/mediapicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/membergrouppicker/membergrouppicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/membergroups/membergroups.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/memberpicker/memberpicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/multipletextbox/multipletextbox.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/radiobuttons/radiobuttons.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/readonlyvalue/readonlyvalue.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/relatedlinks/relatedlinks.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.prevalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/slider/orientation.prevalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/slider/slider.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.prevalues.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/templatepicker/templatepicker.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/test/test.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/textarea/textarea.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/textbox/textbox.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/ultrasimple/ultrasimple.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/urllist/urllist.html create mode 100644 OurUmbraco.Site/umbraco/Views/propertyeditors/validationtest/validationtest.html create mode 100644 OurUmbraco.Site/umbraco/Views/templates/edit.html create mode 100644 OurUmbraco.Site/umbraco/assets/css/installer.css create mode 100644 OurUmbraco.Site/umbraco/assets/css/umbraco.css create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/helveticons/helveticons.eot create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/helveticons/helveticons.svg create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/helveticons/helveticons.ttf create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/helveticons/helveticons.woff create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Regular-webfont.eot create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Regular-webfont.svg create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Regular-webfont.ttf create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Regular-webfont.woff create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Regular.ttf create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Semibold-webfont.eot create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Semibold-webfont.svg create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Semibold-webfont.ttf create mode 100644 OurUmbraco.Site/umbraco/assets/fonts/opensans/OpenSans-Semibold-webfont.woff create mode 100644 OurUmbraco.Site/umbraco/assets/img/application/logo.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/application/logo_black.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/application/logo_white.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/content.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/default.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/developer.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/help.svg create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/hlvticons-umbraco.svg create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/media.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/members.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/search.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/settings.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/tree-arrow.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/applicationIcons/users.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/checkered-background.png create mode 100644 OurUmbraco.Site/umbraco/assets/img/installer.jpg create mode 100644 OurUmbraco.Site/umbraco/assets/img/loader.gif create mode 100644 OurUmbraco.Site/umbraco/assets/img/mocks/big-image.jpg create mode 100644 OurUmbraco.Site/umbraco/assets/img/mocks/big-thumb.jpg create mode 100644 OurUmbraco.Site/umbraco/config/lang/en_us.xml create mode 100644 OurUmbraco.Site/umbraco/create/PartialView.ascx create mode 100644 OurUmbraco.Site/umbraco/create/PartialViewMacro.ascx create mode 100644 OurUmbraco.Site/umbraco/create/User.ascx create mode 100644 OurUmbraco.Site/umbraco/dashboard/ExamineManagement.ascx create mode 100644 OurUmbraco.Site/umbraco/dashboard/UserControlProxy.aspx create mode 100644 OurUmbraco.Site/umbraco/dashboard/images/access-denied.png create mode 100644 OurUmbraco.Site/umbraco/dialogs/AssignDomain2.aspx create mode 100644 OurUmbraco.Site/umbraco/dialogs/ChangeDocType.aspx create mode 100644 OurUmbraco.Site/umbraco/installer.html create mode 100644 OurUmbraco.Site/umbraco/js/app.dev.js create mode 100644 OurUmbraco.Site/umbraco/js/app.js create mode 100644 OurUmbraco.Site/umbraco/js/init.js create mode 100644 OurUmbraco.Site/umbraco/js/install.loader.js create mode 100644 OurUmbraco.Site/umbraco/js/loader.js create mode 100644 OurUmbraco.Site/umbraco/js/routes.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.controllers.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.directives.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.filters.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.httpbackend.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.installer.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.resources.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.security.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.servervariables.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.services.js create mode 100644 OurUmbraco.Site/umbraco/js/umbraco.testing.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mocks.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-scenario.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_af-na.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_af-za.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_af.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_am-et.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_am.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-001.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-ae.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-bh.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-dz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-eg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-iq.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-jo.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-kw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-lb.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-ly.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-ma.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-om.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-qa.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-sa.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-sd.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-sy.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-tn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar-ye.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ar.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_bg-bg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_bg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_bn-bd.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_bn-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_bn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ca-ad.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ca-es.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ca.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_chr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_cs-cz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_cs.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_cy.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_da-dk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_da.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-at.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-be.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-ch.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-de.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-li.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de-lu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_de.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_el-cy.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_el-gr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_el-polyton.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_el.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-as.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-au.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-bb.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-be.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-bm.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-bw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-bz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-ca.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-dsrt-us.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-dsrt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-fm.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-gb.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-gu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-gy.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-hk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-ie.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-iso.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-jm.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-mh.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-mp.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-mt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-mu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-na.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-nz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-ph.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-pk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-pr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-pw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-sg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-tc.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-tt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-um.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-us.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-vg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-vi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-za.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-zw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en-zz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_en.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-419.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ar.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-bo.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-cl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-co.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-cr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-do.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ea.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ec.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-es.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-gq.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-gt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-hn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ic.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-mx.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ni.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-pa.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-pe.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-pr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-py.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-sv.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-us.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-uy.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es-ve.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_es.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_et-ee.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_et.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_eu-es.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_eu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fa-af.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fa-ir.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fa.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fi-fi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fil-ph.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fil.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-be.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-bf.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-bi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-bj.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-bl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ca.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-cd.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-cf.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-cg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ch.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ci.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-cm.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-dj.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-fr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ga.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-gf.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-gn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-gp.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-gq.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-km.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-lu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-mc.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-mf.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-mg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ml.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-mq.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-ne.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-re.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-rw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-sn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-td.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-tg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr-yt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_fr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gl-es.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gsw-ch.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gsw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gu-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_gu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_haw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_he-il.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_he.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hi-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hr-hr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hu-hu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_hu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_id-id.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_id.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_is-is.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_is.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_it-ch.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_it-it.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_it-sm.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_it.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_iw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ja-jp.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ja.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_kn-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_kn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ko-kr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ko.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ln-cd.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ln-cg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ln.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_lt-lt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_lt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_lv-lv.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_lv.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ml-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ml.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_mo.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_mr-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_mr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ms-bn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ms-my.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ms.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_mt-mt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_mt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl-aw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl-be.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl-cw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl-nl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl-sx.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_nl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_no.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_or-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_or.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pl-pl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-ao.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-br.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-gw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-mz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-pt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt-st.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_pt.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ro-md.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ro-ro.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ro.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ru-md.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ru-ru.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ru-ua.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ru.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sk-sk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sl-si.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sq-al.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sq.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-cyrl-ba.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-cyrl-me.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-cyrl-rs.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-cyrl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-latn-ba.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-latn-me.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-latn-rs.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-latn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr-rs.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sv-fi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sv-se.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sv.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sw-ke.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sw-tz.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_sw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ta-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ta-lk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ta.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_te-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_te.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_th-th.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_th.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_tl-ph.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_tl.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_tr-tr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_tr.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_uk-ua.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_uk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ur-in.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ur-pk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_ur.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_vi-vn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_vi.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-cn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hans-cn.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hans-hk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hans-mo.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hans-sg.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hans.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hant-hk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hant-mo.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hant-tw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hant.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-hk.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh-tw.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zh.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zu-za.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/1.1.5/i18n/angular-locale_zu.js create mode 100644 OurUmbraco.Site/umbraco/lib/angular/angular-ui-sortable.js create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/bootstrap-responsive.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/bootstrap-responsive.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/bootstrap.cosmo.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/bootstrap.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/bootstrap.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/css/responsive.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/img/glyphicons-halflings-white.png create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/img/glyphicons-halflings.png create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/js/bootstrap.2.3.2.js create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/js/bootstrap.2.3.2.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/accordion.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/alerts.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/bootstrap.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/breadcrumbs.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/button-groups.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/buttons.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/carousel.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/close.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/code.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/component-animations.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/dropdowns.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/forms.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/grid.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/hero-unit.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/labels-badges.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/layouts.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/media.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/mixins.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/modals.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/navbar.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/navs.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/pager.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/pagination.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/popovers.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/progress-bars.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/reset.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive-1200px-min.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive-767px-max.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive-768px-979px.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive-navbar.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive-utilities.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/responsive.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/scaffolding.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/sprites.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tables.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/buttons.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/css-tests.css create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/css-tests.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/forms-responsive.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/forms.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/navbar-fixed-top.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/navbar-static-top.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tests/navbar.html create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/thumbnails.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/tooltip.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/type.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/utilities.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/variables.less create mode 100644 OurUmbraco.Site/umbraco/lib/bootstrap/less/wells.less create mode 100644 OurUmbraco.Site/umbraco/lib/datetimepicker/bootstrap-datetimepicker.js create mode 100644 OurUmbraco.Site/umbraco/lib/datetimepicker/bootstrap-datetimepicker.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/datetimepicker/bootstrap-datetimepicker.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/datetimepicker/langs/datetimepicker.pt-BR.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery-2.0.3.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery-ui-1.10.3.custom.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.sortable/jquery.sortable.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.core.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.draggable.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.effect-highlight.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.effect.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.mouse.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.sortable.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.ui.widget.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/README.md create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/cors/postmessage.html create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/cors/result.html create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/css/jquery.fileupload-ui.css create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/img/loading.gif create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/img/progressbar.gif create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/app.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/cors/jquery.postmessage-transport.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/cors/jquery.xdr-transport.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-angular.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-audio.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-image.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-jquery-ui.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-process.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-ui.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-validate.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload-video.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.fileupload.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/jquery.iframe-transport.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/load-image.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/main.js create mode 100644 OurUmbraco.Site/umbraco/lib/jquery/jquery.upload/js/vendor/jquery.ui.widget.js create mode 100644 OurUmbraco.Site/umbraco/lib/lazyload/lazyload.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/markdown/markdown.converter.js create mode 100644 OurUmbraco.Site/umbraco/lib/markdown/markdown.css create mode 100644 OurUmbraco.Site/umbraco/lib/markdown/markdown.editor.js create mode 100644 OurUmbraco.Site/umbraco/lib/markdown/markdown.sanitizer.js create mode 100644 OurUmbraco.Site/umbraco/lib/markdown/red.css create mode 100644 OurUmbraco.Site/umbraco/lib/slider/js/bootstrap-slider.js create mode 100644 OurUmbraco.Site/umbraco/lib/slider/slider.css create mode 100644 OurUmbraco.Site/umbraco/lib/spectrum/spectrum.css create mode 100644 OurUmbraco.Site/umbraco/lib/spectrum/spectrum.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/langs/readme.md create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/license.txt create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/advlist/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/anchor/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/autolink/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/autoresize/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/autosave/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/bbcode/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/charmap/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/code/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/compat3x/editable_selects.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/compat3x/form_utils.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/compat3x/mctabs.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/compat3x/tiny_mce_popup.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/compat3x/validate.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/contextmenu/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/directionality/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-cool.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-cry.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-embarassed.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-frown.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-innocent.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-kiss.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-laughing.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-money-mouth.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-sealed.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-smile.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-surprised.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-tongue-out.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-undecided.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-wink.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/img/smiley-yell.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/emoticons/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/example/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/example_dependency/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/fullpage/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/fullscreen/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/hr/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/image/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/importcss/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/insertdatetime/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/layer/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/legacyoutput/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/link/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/lists/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/media/moxieplayer.swf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/media/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/nonbreaking/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/noneditable/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/pagebreak/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/paste/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/preview/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/print/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/save/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/searchreplace/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/spellchecker/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/tabfocus/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/table/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/template/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/textcolor/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocontextmenu/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocontextmenu/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/img/example.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/js/dialog.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/en.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/en_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/it.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/ja.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/ru.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/zh.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/langs/zh_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracocss/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/dialog.htm create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/editor_plugin.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/img/ajax-loader.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/img/embed.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/img/embed.png create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/js/dialog.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/da.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/da_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/de.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/de_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/en.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/en_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/it.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/ja.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/ru.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/zh.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoembed/langs/zh_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/js/image.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/en_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/he_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoimg/langs/zh_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracolink/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/dialog.htm create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/img/insMacro.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/js/dialog.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/en.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/en_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/he.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/he_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/ja.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/ru.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/zh.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracomacro/langs/zh_dlg.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracopaste/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/umbracoshortcut/editor_plugin_src.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/visualblocks/css/visualblocks.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/visualblocks/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/visualchars/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/plugins/wordcount/plugin.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/content.inline.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/content.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon-small.eot create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon-small.svg create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon-small.ttf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon-small.woff create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon.eot create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon.svg create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon.ttf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/icomoon.woff create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/readme.md create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce-small.eot create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce-small.svg create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce-small.ttf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce-small.woff create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce.eot create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce.svg create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce.ttf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/fonts/tinymce.woff create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/img/anchor.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/img/loader.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/img/object.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/img/trans.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/img/wline.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/skin.classic.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/skin.ie7.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/lightgray/skin.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/content.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/fonts/icomoon.eot create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/fonts/icomoon.svg create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/fonts/icomoon.ttf create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/fonts/icomoon.woff create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/fonts/readme.md create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/img/anchor.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/img/loader.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/img/object.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/img/trans.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/img/wline.gif create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/skin.classic.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/skin.ie7.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/skins/umbraco/skin.min.css create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/themes/modern/theme.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/themes/umbraco/theme.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/tinymce/tinymce.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/typeahead/typeahead.bundle.min.js create mode 100644 OurUmbraco.Site/umbraco/lib/umbraco/Extensions.js create mode 100644 OurUmbraco.Site/umbraco/lib/umbraco/LegacySpeechBubble.js create mode 100644 OurUmbraco.Site/umbraco/lib/umbraco/LegacyUmbClientMgr.js create mode 100644 OurUmbraco.Site/umbraco/lib/umbraco/NamespaceManager.js create mode 100644 OurUmbraco.Site/umbraco/lib/umbraco/compat.js create mode 100644 OurUmbraco.Site/umbraco/lib/underscore/underscore-min.js create mode 100644 OurUmbraco.Site/umbraco/lib/underscore/underscore.js create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/EmptyTemplate.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/Gallery.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListAncestorsFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesFromChangeableSource.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesOrderedByDate.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesOrderedByName.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesOrderedByProperty.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListChildPagesWithDoctype.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListDescendantsFromCurrentPage.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/ListImagesFromMediaFolder.cshtml create mode 100644 OurUmbraco.Site/umbraco/scripting/templates/cshtml/MultinodeTree-picker.cshtml create mode 100644 OurUmbraco.Site/umbraco/webservices/UltimatePickerAutoCompleteHandler.ashx create mode 100644 OurUmbraco.Site/umbraco/xslt/Web.config create mode 100644 OurUmbraco.Site/umbraco_client/Application/Extensions.js create mode 100644 OurUmbraco.Site/umbraco_client/Application/JQuery/jquery.unobtrusive-ajax.min.js create mode 100644 OurUmbraco.Site/umbraco_client/Application/JQuery/jquery.validate.min.js create mode 100644 OurUmbraco.Site/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js create mode 100644 OurUmbraco.Site/umbraco_client/Dashboards/ExamineManagement.css create mode 100644 OurUmbraco.Site/umbraco_client/Dashboards/ExamineManagement.js create mode 100644 OurUmbraco.Site/umbraco_client/Dashboards/ExamineManagementIco.png create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/AssignDomain2.css create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/AssignDomain2.js create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/CreateDialog.css create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/EditMacro.css create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/EditMacro.js create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/PublishDialog.css create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/PublishDialog.js create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/SortDialog.css create mode 100644 OurUmbraco.Site/umbraco_client/Dialogs/SortDialog.js create mode 100644 OurUmbraco.Site/umbraco_client/Editors/DirectoryBrowser.css create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditMacro.css create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditMacroScripts.js create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditScript.js create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditStyleSheet.js create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditTemplate.js create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditXslt.css create mode 100644 OurUmbraco.Site/umbraco_client/Editors/EditXslt.js create mode 100644 OurUmbraco.Site/umbraco_client/IconPicker/iconpicker.js create mode 100644 OurUmbraco.Site/umbraco_client/Installer/images/zoom-in.png create mode 100644 OurUmbraco.Site/umbraco_client/splitbutton/InsertMacroSplitButton.js create mode 100644 OurUmbraco.Site/umbraco_client/tablesorting/img/asc.gif create mode 100644 OurUmbraco.Site/umbraco_client/tablesorting/img/desc.gif create mode 100644 OurUmbraco.Site/umbraco_client/tablesorting/jquery.tablesorter.min.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/langs/ru.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advhr/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advhr/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advimage/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advimage/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advlink/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/advlink/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/autosave/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/emotions/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/emotions/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/fullpage/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/fullpage/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/fi_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/he_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/pl_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/pt_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/media/langs/zh_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/paste/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/paste/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/searchreplace/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/searchreplace/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/style/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/style/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/table/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/table/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/template/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/template/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/it.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/ja.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracocss/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/da.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/da_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/de.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/de_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/it.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/ja.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/ja_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoembed/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoimg/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoimg/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracoimg/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/da_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/de_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/fi_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/fr_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/it_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/nl_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/no_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/pl_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/pt_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracolink/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracomacro/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracomacro/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracomacro/langs/sv.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/umbracomacro/langs/sv_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/xhtmlxtras/langs/en_us_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/plugins/xhtmlxtras/langs/ru_dlg.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/themes/umbraco/langs/en_us.js create mode 100644 OurUmbraco.Site/umbraco_client/tinymce3/themes/umbraco/langs/en_us_dlg.js create mode 100644 dependencies/7.1.6/ClientDependency.Core.dll rename dependencies/{4.11.2 => 7.1.6}/CookComputing.XmlRpcV2.dll (100%) create mode 100644 dependencies/7.1.6/Examine.dll create mode 100644 dependencies/7.1.6/HtmlAgilityPack.dll rename dependencies/{4.11.2 => 7.1.6}/ICSharpCode.SharpZipLib.dll (100%) rename dependencies/{4.11.2 => 7.1.6}/Lucene.Net.dll (100%) rename dependencies/{4.11.2 => 7.1.6}/Microsoft.ApplicationBlocks.Data.dll (100%) create mode 100644 dependencies/7.1.6/MySql.Data.dll create mode 100644 dependencies/7.1.6/SQLCE4Umbraco.dll rename dependencies/{4.11.2 => 7.1.6}/System.Data.SqlServerCe.Entity.dll (100%) rename dependencies/{4.11.2 => 7.1.6}/System.Data.SqlServerCe.dll (100%) rename dependencies/{4.11.2 => 7.1.6}/TidyNet.dll (100%) create mode 100644 dependencies/7.1.6/Umbraco.Core.dll create mode 100644 dependencies/7.1.6/Umbraco.Web.UI.dll create mode 100644 dependencies/7.1.6/UmbracoExamine.dll rename dependencies/{4.11.2 => 7.1.6}/UrlRewritingNet.UrlRewriter.dll (100%) create mode 100644 dependencies/7.1.6/businesslogic.dll create mode 100644 dependencies/7.1.6/cms.dll create mode 100644 dependencies/7.1.6/controls.dll create mode 100644 dependencies/7.1.6/interfaces.dll create mode 100644 dependencies/7.1.6/umbraco.DataLayer.dll create mode 100644 dependencies/7.1.6/umbraco.MacroEngines.dll create mode 100644 dependencies/7.1.6/umbraco.XmlSerializers.dll create mode 100644 dependencies/7.1.6/umbraco.dll create mode 100644 dependencies/7.1.6/umbraco.editorControls.dll create mode 100644 dependencies/7.1.6/umbraco.providers.dll rename dependencies/{4.11.2 => _4.11.2}/ClientDependency.Core.dll (100%) rename dependencies/{4.9.1 => _4.11.2}/CookComputing.XmlRpcV2.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Examine.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/HtmlAgilityPack.dll (100%) rename dependencies/{4.9.1 => _4.11.2}/ICSharpCode.SharpZipLib.dll (100%) rename dependencies/{4.9.1 => _4.11.2}/Lucene.Net.dll (100%) rename dependencies/{4.9.1 => _4.11.2}/Microsoft.ApplicationBlocks.Data.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/MySql.Data.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Our.Umbraco.uGoLive.47x.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Our.Umbraco.uGoLive.Checks.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Our.Umbraco.uGoLive.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/SQLCE4Umbraco.dll (100%) create mode 100644 dependencies/_4.11.2/System.Data.SqlServerCe.Entity.dll create mode 100644 dependencies/_4.11.2/System.Data.SqlServerCe.dll rename dependencies/{4.9.1 => _4.11.2}/TidyNet.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Umbraco.Core.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/Umbraco.Web.UI.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/UmbracoExamine.dll (100%) rename dependencies/{4.9.1 => _4.11.2}/UrlRewritingNet.UrlRewriter.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/businesslogic.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/cms.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/controls.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/interfaces.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/log4net.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.DataLayer.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.MacroEngines.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.XmlSerializers.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.editorControls.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.macroRenderings.dll (100%) rename dependencies/{4.11.2 => _4.11.2}/umbraco.providers.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/ClientDependency.Core.dll (100%) create mode 100644 dependencies/_4.9.1/CookComputing.XmlRpcV2.dll rename dependencies/{4.9.1 => _4.9.1}/Examine.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/HtmlAgilityPack.dll (100%) create mode 100644 dependencies/_4.9.1/ICSharpCode.SharpZipLib.dll create mode 100644 dependencies/_4.9.1/Lucene.Net.dll create mode 100644 dependencies/_4.9.1/Microsoft.ApplicationBlocks.Data.dll rename dependencies/{4.9.1 => _4.9.1}/MySql.Data.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/Our.Umbraco.uGoLive.47x.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/Our.Umbraco.uGoLive.Checks.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/Our.Umbraco.uGoLive.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/SQLCE4Umbraco.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/System.Data.SqlServerCe.Entity.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/System.Data.SqlServerCe.dll (100%) create mode 100644 dependencies/_4.9.1/TidyNet.dll rename dependencies/{4.9.1 => _4.9.1}/Umbraco.Core.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/Umbraco.Web.UI.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/UmbracoExamine.dll (100%) create mode 100644 dependencies/_4.9.1/UrlRewritingNet.UrlRewriter.dll rename dependencies/{4.9.1 => _4.9.1}/businesslogic.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/cms.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/controls.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/interfaces.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.DataLayer.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.MacroEngines.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.XmlSerializers.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.editorControls.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.macroRenderings.dll (100%) rename dependencies/{4.9.1 => _4.9.1}/umbraco.providers.dll (100%) diff --git a/.gitignore b/.gitignore index 4dabb789..f79abb7a 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ OurUmbraco.Site/App_Data/YouTrack/all.json OurUmbraco.Site/App_Data/communityblogs.xml OurUmbraco.Site/App_Data/Meetup/searchresults.json OurUmbraco.Site/[Dd]ocumentation/ +OurUmbraco.Site_419 diff --git a/Notification/Notification.csproj b/Notification/Notification.csproj index 43c230f8..f404fe5a 100644 --- a/Notification/Notification.csproj +++ b/Notification/Notification.csproj @@ -39,11 +39,11 @@ False - ..\dependencies\4.9.1\businesslogic.dll + ..\dependencies\7.1.6\businesslogic.dll False - ..\dependencies\4.9.1\cms.dll + ..\dependencies\7.1.6\cms.dll @@ -55,7 +55,7 @@ False - ..\dependencies\4.9.1\umbraco.dll + ..\dependencies\7.1.6\umbraco.dll diff --git a/NotificationsWeb/NotificationsWeb.csproj b/NotificationsWeb/NotificationsWeb.csproj index 8039e6fb..1369ebb6 100644 --- a/NotificationsWeb/NotificationsWeb.csproj +++ b/NotificationsWeb/NotificationsWeb.csproj @@ -38,13 +38,13 @@ - ..\dependencies\4.9.1\businesslogic.dll + ..\dependencies\7.1.6\businesslogic.dll - ..\dependencies\4.9.1\cms.dll + ..\dependencies\7.1.6\cms.dll - ..\dependencies\4.9.1\interfaces.dll + ..\dependencies\7.1.6\interfaces.dll @@ -62,10 +62,10 @@ - ..\dependencies\4.9.1\umbraco.dll + ..\dependencies\7.1.6\umbraco.dll - ..\dependencies\4.9.1\umbraco.DataLayer.dll + ..\dependencies\7.1.6\umbraco.DataLayer.dll diff --git a/OurUmbraco.Site/Global.asax b/OurUmbraco.Site/Global.asax new file mode 100644 index 00000000..3d213eb6 --- /dev/null +++ b/OurUmbraco.Site/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %> diff --git a/OurUmbraco.Site/OurUmbraco.Site.csproj b/OurUmbraco.Site/OurUmbraco.Site.csproj index 2656dc88..fab9a068 100644 --- a/OurUmbraco.Site/OurUmbraco.Site.csproj +++ b/OurUmbraco.Site/OurUmbraco.Site.csproj @@ -43,22 +43,22 @@ False - ..\dependencies\4.9.1\businesslogic.dll + ..\dependencies\7.1.6\businesslogic.dll - ..\dependencies\4.9.1\ClientDependency.Core.dll + ..\dependencies\7.1.6\ClientDependency.Core.dll False - ..\dependencies\4.9.1\cms.dll + ..\dependencies\7.1.6\cms.dll False - ..\dependencies\4.9.1\controls.dll + ..\dependencies\7.1.6\controls.dll False - ..\dependencies\4.9.1\CookComputing.XmlRpcV2.dll + ..\dependencies\7.1.6\CookComputing.XmlRpcV2.dll ..\dependencies\Our\DotNetOpenMail.dll @@ -72,7 +72,7 @@ False - ..\dependencies\4.9.1\Examine.dll + ..\dependencies\7.1.6\Examine.dll ..\dependencies\Our\FergusonMoriyama.ConfigFormRenderer.dll @@ -94,11 +94,11 @@ False - ..\dependencies\4.9.1\HtmlAgilityPack.dll + ..\dependencies\7.1.6\HtmlAgilityPack.dll False - ..\dependencies\4.9.1\ICSharpCode.SharpZipLib.dll + ..\dependencies\7.1.6\ICSharpCode.SharpZipLib.dll ..\dependencies\Our\imagegen.dll @@ -108,7 +108,7 @@ False - ..\dependencies\4.9.1\interfaces.dll + ..\dependencies\7.1.6\interfaces.dll ..\dependencies\Our\itextsharp.dll @@ -118,7 +118,7 @@ ..\packages\JsonFx.2.0.1209.2802\lib\net40\JsonFx.dll - ..\dependencies\4.9.1\Lucene.Net.dll + ..\dependencies\7.1.6\Lucene.Net.dll ..\dependencies\Our\LuceneTools.dll @@ -148,7 +148,7 @@ ..\dependencies\Our\MemberTools.dll - ..\dependencies\4.9.1\Microsoft.ApplicationBlocks.Data.dll + ..\dependencies\7.1.6\Microsoft.ApplicationBlocks.Data.dll @@ -161,7 +161,7 @@ False - ..\dependencies\4.9.1\MySql.Data.dll + ..\dependencies\7.1.6\MySql.Data.dll ..\dependencies\Our\Nibble.Umb.Poll.dll @@ -169,15 +169,6 @@ ..\dependencies\Our\our.mapR.dll - - ..\dependencies\4.9.1\Our.Umbraco.uGoLive.dll - - - ..\dependencies\4.9.1\Our.Umbraco.uGoLive.47x.dll - - - ..\dependencies\4.9.1\Our.Umbraco.uGoLive.Checks.dll - False ..\dependencies\uTwit\Our.Umbraco.uTwit.DataType.dll @@ -200,16 +191,16 @@ ..\dependencies\Our\SignalR.dll - ..\dependencies\4.9.1\SQLCE4Umbraco.dll + ..\dependencies\7.1.6\SQLCE4Umbraco.dll False - ..\dependencies\4.9.1\System.Data.SqlServerCe.dll + ..\dependencies\7.1.6\System.Data.SqlServerCe.dll False - ..\dependencies\4.9.1\System.Data.SqlServerCe.Entity.dll + ..\dependencies\7.1.6\System.Data.SqlServerCe.Entity.dll @@ -254,29 +245,29 @@ False - ..\dependencies\4.9.1\TidyNet.dll + ..\dependencies\7.1.6\TidyNet.dll ..\dependencies\Our\uComponents.Core.dll False - ..\dependencies\4.9.1\umbraco.dll + ..\dependencies\7.1.6\umbraco.dll False - ..\dependencies\4.9.1\Umbraco.Core.dll + ..\dependencies\7.1.6\Umbraco.Core.dll False - ..\dependencies\4.9.1\umbraco.DataLayer.dll + ..\dependencies\7.1.6\umbraco.DataLayer.dll ..\dependencies\Our\Umbraco.Ecommerce.dll False - ..\dependencies\4.9.1\umbraco.editorControls.dll + ..\dependencies\7.1.6\umbraco.editorControls.dll ..\dependencies\Contour\Umbraco.Forms.CodeFirst.dll @@ -294,14 +285,11 @@ ..\dependencies\Contour\Umbraco.Forms.UI.dll - ..\dependencies\4.9.1\umbraco.MacroEngines.dll - - - ..\dependencies\4.9.1\umbraco.macroRenderings.dll + ..\dependencies\7.1.6\umbraco.MacroEngines.dll False - ..\dependencies\4.9.1\umbraco.providers.dll + ..\dependencies\7.1.6\umbraco.providers.dll ..\dependencies\Our\Umbraco.Support.dll @@ -316,14 +304,14 @@ ..\dependencies\Our\umbraco.UQL.RazorContext.dll - ..\dependencies\4.9.1\Umbraco.Web.UI.dll + ..\dependencies\7.1.6\Umbraco.Web.UI.dll - ..\dependencies\4.9.1\umbraco.XmlSerializers.dll + ..\dependencies\7.1.6\umbraco.XmlSerializers.dll False - ..\dependencies\4.9.1\UmbracoExamine.dll + ..\dependencies\7.1.6\UmbracoExamine.dll ..\dependencies\Our\UmbracoExamine.PDF.dll @@ -332,7 +320,7 @@ ..\dependencies\Our\umbracoMemberControls.dll - ..\dependencies\4.9.1\UrlRewritingNet.UrlRewriter.dll + ..\dependencies\7.1.6\UrlRewritingNet.UrlRewriter.dll ..\packages\YouTrackSharp.2.0.11.0\lib\net40\YouTrackSharp.dll diff --git a/OurUmbraco.Site/Views/Web.config b/OurUmbraco.Site/Views/Web.config index 5b163e5d..801d9519 100644 --- a/OurUmbraco.Site/Views/Web.config +++ b/OurUmbraco.Site/Views/Web.config @@ -1,26 +1,30 @@  + - -
-
+ +
+
- + - - - - - + + + + + + + + @@ -42,11 +46,11 @@ --> + pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" + pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" + userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - + diff --git a/OurUmbraco.Site/config/ClientDependency.config b/OurUmbraco.Site/config/ClientDependency.config index 30dd45e7..e4160d06 100644 --- a/OurUmbraco.Site/config/ClientDependency.config +++ b/OurUmbraco.Site/config/ClientDependency.config @@ -2,7 +2,7 @@ - + - + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - --> + + + + + + + + + + + + + diff --git a/OurUmbraco.Site/config/Dashboard.config b/OurUmbraco.Site/config/Dashboard.config index 6151e89c..f9500a44 100644 --- a/OurUmbraco.Site/config/Dashboard.config +++ b/OurUmbraco.Site/config/Dashboard.config @@ -1,98 +1,75 @@  - -
+
+ + settings + + + + views/dashboard/settings/settingsdashboardintro.html + + +
+ +
+ + developer + + + + views/dashboard/developer/developerdashboardvideos.html + + + + /umbraco/dashboard/ExamineManagement.ascx + +
+ +
+ + media + + + + views/dashboard/media/mediafolderbrowser.html + + + +
+ +
+ + translator + - default content - - /usercontrols/our.umbraco.org/ForumSpamCleaner.ascx - - - /usercontrols/our.umbraco.org/ForumSpamListTopics.ascx - - - /usercontrols/our.umbraco.org/ForumSpamListComments.ascx - -
-
- - deli - - - /umbraco/dashboard/deli/orderreview.ascx - - - /umbraco/dashboard/deli/processrefund.ascx - - - /umbraco/dashboard/deli/vendorpayoutreport.ascx + + + admin + + + + views/dashboard/default/startupdashboardintro.html + + + + + views/dashboard/ChangePassword.html + +
+
member - /umbraco/dashboard/membersdashboardintro.ascx + views/dashboard/members/membersdashboardvideos.html - - /umbraco/members/membersearch.ascx - - - /umbraco/dashboard/membersdashboardvideos.ascx - - -
- -
- - courier - - - /umbraco/plugins/courier/dashboard/CourierDashboard.ascx - -
-
- - developer - - - /usercontrols/IndexStatus.ascx - -
-
- - contour - - - /umbraco/plugins/umbracocontour/formsdashboard.ascx
\ No newline at end of file diff --git a/OurUmbraco.Site/config/EmbeddedMedia.config b/OurUmbraco.Site/config/EmbeddedMedia.config index 13cc3aa3..fe58a8fa 100644 --- a/OurUmbraco.Site/config/EmbeddedMedia.config +++ b/OurUmbraco.Site/config/EmbeddedMedia.config @@ -15,7 +15,7 @@ - + xml @@ -33,10 +33,11 @@ - + 1 xml + https diff --git a/OurUmbraco.Site/config/ExamineIndex.config b/OurUmbraco.Site/config/ExamineIndex.config index d8343767..90c2ab55 100644 --- a/OurUmbraco.Site/config/ExamineIndex.config +++ b/OurUmbraco.Site/config/ExamineIndex.config @@ -8,20 +8,7 @@ More information and documentation can be found on CodePlex: http://umbracoexami --> - - - - - - - - - - - - - - + diff --git a/OurUmbraco.Site/config/UrlRewriting.config b/OurUmbraco.Site/config/UrlRewriting.config index ff180807..a0bbeebe 100644 --- a/OurUmbraco.Site/config/UrlRewriting.config +++ b/OurUmbraco.Site/config/UrlRewriting.config @@ -1,3 +1,4 @@ + + + diff --git a/OurUmbraco.Site/config/log4net.config b/OurUmbraco.Site/config/log4net.config index dd9a5e46..b7304ca2 100644 --- a/OurUmbraco.Site/config/log4net.config +++ b/OurUmbraco.Site/config/log4net.config @@ -21,5 +21,6 @@ + diff --git a/OurUmbraco.Site/config/scripting.config b/OurUmbraco.Site/config/scripting.config index 6de82e06..ec59c35a 100644 --- a/OurUmbraco.Site/config/scripting.config +++ b/OurUmbraco.Site/config/scripting.config @@ -1,3 +1,4 @@ + diff --git a/OurUmbraco.Site/config/splashes/booting.aspx b/OurUmbraco.Site/config/splashes/booting.aspx index 39e97e4f..1bea61f8 100644 --- a/OurUmbraco.Site/config/splashes/booting.aspx +++ b/OurUmbraco.Site/config/splashes/booting.aspx @@ -1,15 +1,23 @@ <%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> +<% + // NH: Adds this inline check to avoid a simple codebehind file in the legacy project! + if (Request["url"].ToLower().Contains("booting.aspx") || !umbraco.cms.helpers.url.ValidateProxyUrl(Request["url"], Request.Url.AbsoluteUri)) + { + throw new ArgumentException("Can't redirect to the requested url - it's not local or an approved proxy url", + "url"); + } +%> - + The website is restarting - "> + ">

The website is restarting

Please wait for 10s while we prepare to serve the page you have requested...

- +

You can modify the design of this page by editing /config/splashes/booting.aspx

diff --git a/OurUmbraco.Site/config/splashes/noNodes.aspx b/OurUmbraco.Site/config/splashes/noNodes.aspx index 03ec792a..b66780d8 100644 --- a/OurUmbraco.Site/config/splashes/noNodes.aspx +++ b/OurUmbraco.Site/config/splashes/noNodes.aspx @@ -1,182 +1,149 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> +<%@ Page Language="C#" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Config.Splashes.NoNodes" CodeBehind="NoNodes.aspx.cs" %> +<%@ Import Namespace="Umbraco.Core.Configuration" %> +<%@ Import Namespace="Umbraco.Core.IO" %> - - - Umbraco - <%=umbraco.GlobalSettings.CurrentVersion%> - - no pages found - + + Umbraco - no pages found + " /> - + - + - + - - - + + + - - - - - - + +
- + -
+
-
+
- + - + - + - +
+
+

Looks like there's still work to do

+

+ You're seeing the wonderful page because your website doesn't contain any published content yet. +

+

+ So get rid of this page by starting umbraco and publishing some content. You can do this by clicking the "set up your new website" button below. +

+ +
+
+
+   +
+
+
- -
- - - - -
-
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- - -
-
- -
- + + + + + + + + +
+
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ diff --git a/OurUmbraco.Site/config/tinyMceConfig.config b/OurUmbraco.Site/config/tinyMceConfig.config index ae2aa171..2cae6d6f 100644 --- a/OurUmbraco.Site/config/tinyMceConfig.config +++ b/OurUmbraco.Site/config/tinyMceConfig.config @@ -2,221 +2,213 @@ - - - code - images/editor/code.gif - code - 1 - - - removeformat - images/editor/removeformat.gif - removeformat - 2 - + + + code + images/editor/code.gif + code + 1 + + + removeformat + images/editor/removeformat.gif + removeformat + 2 + - - Undo - images/editor/undo.gif - undo - 11 - - - Redo - images/editor/redo.gif - redo - 12 - - - Cut - images/editor/cut.gif - cut - 13 - - - Copy - images/editor/copy.gif - copy - 14 - - - mcePasteWord - images/editor/paste.gif - pasteword - 15 - + + Undo + images/editor/undo.gif + undo + 11 + + + Redo + images/editor/redo.gif + redo + 12 + + + Cut + images/editor/cut.gif + cut + 13 + + + Copy + images/editor/copy.gif + copy + 14 + + + + styleselect + images/editor/showStyles.png + styleselect + 20 + + + bold + images/editor/bold.gif + bold + 21 + + + italic + images/editor/italic.gif + italic + 22 + + + Underline + images/editor/underline.gif + underline + 23 + + + Strikethrough + images/editor/strikethrough.gif + strikethrough + 24 + - - stylePicker - images/editor/showStyles.png - umbracocss - 20 - - - bold - images/editor/bold.gif - bold - 21 - - - italic - images/editor/italic.gif - italic - 22 - - - Underline - images/editor/underline.gif - underline - 23 - - - Strikethrough - images/editor/strikethrough.gif - strikethrough - 24 - + + JustifyLeft + images/editor/justifyleft.gif + justifyleft + 31 + + + JustifyCenter + images/editor/justifycenter.gif + justifycenter + 32 + + + JustifyRight + images/editor/justifyright.gif + justifyright + 33 + + + JustifyFull + images/editor/justifyfull.gif + alignjustify + 34 + - - JustifyLeft - images/editor/justifyleft.gif - justifyleft - 31 - - - JustifyCenter - images/editor/justifycenter.gif - justifycenter - 32 - - - JustifyRight - images/editor/justifyright.gif - justifyright - 33 - - - JustifyFull - images/editor/justifyfull.gif - justifyfull - 34 - + + bullist + images/editor/bullist.gif + bullist + 41 + + + numlist + images/editor/numlist.gif + numlist + 42 + + + Outdent + images/editor/outdent.gif + outdent + 43 + + + Indent + images/editor/indent.gif + indent + 44 + - - bullist - images/editor/bullist.gif - bullist - 41 - - - numlist - images/editor/numlist.gif - numlist - 42 - - - Outdent - images/editor/outdent.gif - outdent - 43 - - - Indent - images/editor/indent.gif - indent - 44 - + + mceLink + images/editor/link.gif + link + 51 + + + unlink + images/editor/unLink.gif + unlink + 52 + + + mceInsertAnchor + images/editor/anchor.gif + anchor + 53 + - - mceLink - images/editor/link.gif - link - 51 - - - unlink - images/editor/unLink.gif - unlink - 52 - - - mceInsertAnchor - images/editor/anchor.gif - anchor - 53 - + + mceImage + images/editor/image.gif + image + 61 + - - mceImage - images/editor/image.gif - image - 61 - - - umbracomacro - images/editor/insMacro.gif - umbracomacro - 62 - - - mceInsertTable - images/editor/table.gif - table - 63 - - - umbracoembed - images/editor/media.gif - umbracoembed - 66 - - - inserthorizontalrule - images/editor/hr.gif - hr - 71 - - - subscript - images/editor/sub.gif - sub - 72 - - - superscript - images/editor/sup.gif - sup - 73 - - - mceCharMap - images/editor/charmap.gif - charmap - 74 - - - mceSpellCheck - images/editor/spellchecker.gif - spellchecker - 75 - + + umbracomacro + images/editor/insMacro.gif + umbracomacro + 62 + + + + + + mceInsertTable + images/editor/table.gif + table + 63 + + + + umbracoembed + images/editor/media.gif + umbracoembed + 66 + + + inserthorizontalrule + images/editor/hr.gif + hr + 71 + + + subscript + images/editor/sub.gif + subscript + 72 + - - - paste - inlinepopups - noneditable - table - umbracomacro - umbracoimg - advlink - umbracocss - umbracoembed - spellchecker - - - + superscript + images/editor/sup.gif + superscript + 73 + + + + mceCharMap + images/editor/charmap.gif + charmap + 74 + + + + + code + paste + umbracolink + anchor + charmap + table + lists + + + - - font + + font - - - - raw - GoogleSpellChecker.ashx - + + + + raw + GoogleSpellChecker.ashx + \ No newline at end of file diff --git a/OurUmbraco.Site/config/trees.config b/OurUmbraco.Site/config/trees.config index 548e39f2..92e4f40c 100644 --- a/OurUmbraco.Site/config/trees.config +++ b/OurUmbraco.Site/config/trees.config @@ -1,51 +1,45 @@  - - + + - - + + - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + - - - + + + - - - + + + + + + - - - - - - - - - - \ No newline at end of file diff --git a/OurUmbraco.Site/config/umbracoSettings.config b/OurUmbraco.Site/config/umbracoSettings.config index 9bd856a3..c8d03d9e 100644 --- a/OurUmbraco.Site/config/umbracoSettings.config +++ b/OurUmbraco.Site/config/umbracoSettings.config @@ -1,89 +1,68 @@  - - - - jpeg,jpg,gif,bmp,png,tiff,tif - - alt,border,class,style,align,id,name,onclick,usemap - - - umbracoWidth - umbracoHeight - umbracoBytes - umbracoExtension - - - - - - /scripts - - js,xml - - - false - - - True - - - - - 1 - - - - your@email.here - + + + + + + 1 + + + + + + your@email.here + - - True + + text - - False + + In Preview Mode - click to end]]> - - UTF8 + + + 1800 - - false - - - true + + throw - - False + + HideFileDuplicates - - True + + ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd - - False - - - False - - - text - - - false - - - In Preview Mode - click to end]]> - - - - 1800 - - - - - false + + Textstring @@ -129,55 +108,12 @@ - - true + + WebForms - - - - cs - vb - - - - - - - - p - div - ul - span - - - - - - - - - - - - true - true - - - - - - - @@ -186,48 +122,67 @@ - - - - - 0 - - - - - + + + + + 0 - - - - - your-username - your-username - your-username - your-username - your-username - - css,xslt - + - - - - - + - - - - - UsersMembershipProvider - - + - - - - - + + + + + + diff --git a/OurUmbraco.Site/config/xsltExtensions.config b/OurUmbraco.Site/config/xsltExtensions.config index bf8c8da7..66bf39c0 100644 --- a/OurUmbraco.Site/config/xsltExtensions.config +++ b/OurUmbraco.Site/config/xsltExtensions.config @@ -10,7 +10,8 @@ - + + diff --git a/OurUmbraco.Site/umbraco/ClientRedirect.aspx b/OurUmbraco.Site/umbraco/ClientRedirect.aspx new file mode 100644 index 00000000..72232c99 --- /dev/null +++ b/OurUmbraco.Site/umbraco/ClientRedirect.aspx @@ -0,0 +1,57 @@ +<%@ Page Language="C#" AutoEventWireup="true" Inherits="Umbraco.Web.UI.Pages.UmbracoEnsuredPage" %> +<%-- + This page is required because we cannot reload the angular app with a changed Hash since it just detects the hash and doesn't reload. + So this is used purely for a full reload of an angular app with a changed hash. +--%> + + + + Redirecting... + + + + Redirecting... + + diff --git a/OurUmbraco.Site/umbraco/Default.aspx b/OurUmbraco.Site/umbraco/Default.aspx index 963ced80..d3421e39 100644 --- a/OurUmbraco.Site/umbraco/Default.aspx +++ b/OurUmbraco.Site/umbraco/Default.aspx @@ -12,7 +12,7 @@ } - + + + + + + + + @* + These are the bare minimal server variables that are required for the application to start without being authenticated, + we will load the rest of the server vars after the user is authenticated. + *@ + + + @*And finally we can load in our angular app*@ + + + + + + diff --git a/OurUmbraco.Site/umbraco/Views/Default.cshtml b/OurUmbraco.Site/umbraco/Views/Default.cshtml new file mode 100644 index 00000000..2b3aa309 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/Default.cshtml @@ -0,0 +1,88 @@ +@using System.Net.Http +@using System.Web.Mvc.Html +@using Umbraco.Core +@using ClientDependency.Core +@using ClientDependency.Core.Mvc +@using Umbraco.Core.IO +@using Umbraco.Web +@using Umbraco.Web.Editors +@using umbraco + +@inherits System.Web.Mvc.WebViewPage + + + + + + + + + + + + + Umbraco + + @{ Html.RequiresCss("assets/css/umbraco.css", "Umbraco");} + @{ Html.RequiresCss("tree/treeicons.css", "UmbracoClient");} + @Html.RenderCssHere( + new BasicPath("Umbraco", IOHelper.ResolveUrl(SystemDirectories.Umbraco)), + new BasicPath("UmbracoClient", IOHelper.ResolveUrl(SystemDirectories.UmbracoClient))) + + + + +
+ + + +
+
+
+
+ +
+ + + + + @* + These are the bare minimal server variables that are required for the application to start without being authenticated, + we will load the rest of the server vars after the user is authenticated. + *@ + + + @*And finally we can load in our angular app*@ + + + + @{ + var isDebug = false; + if (Request.RawUrl.IndexOf('?') >= 0) + { + var parsed = HttpUtility.ParseQueryString(Request.RawUrl.Split('?')[1]); + var attempt = parsed["umbDebug"].TryConvertTo(); + if (attempt && attempt.Result) + { + isDebug = true; + } + } + + } + @if (isDebug) + { + @Html.RenderProfiler() + } + + + + diff --git a/OurUmbraco.Site/umbraco/Views/common/dashboard.html b/OurUmbraco.Site/umbraco/Views/common/dashboard.html new file mode 100644 index 00000000..56ba1b58 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dashboard.html @@ -0,0 +1,31 @@ +
+ + +
+

{{dashboard.name}}

+
+
+ + +
+
+ +
+

{{property.caption}}

+
+
+ +
+

{{property.caption}}

+ + +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/content/edit.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/content/edit.html new file mode 100644 index 00000000..fb353723 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/content/edit.html @@ -0,0 +1,58 @@ +
+ +
+
+

{{model.entity.name}}

+
+ + + + + +
+ +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/contentpicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/contentpicker.html new file mode 100644 index 00000000..0cfb25a2 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/contentpicker.html @@ -0,0 +1,66 @@ +
+
+
+ +
+
+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/help.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/help.html new file mode 100644 index 00000000..ef759c8b --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/help.html @@ -0,0 +1,58 @@ +
+
+

Help

+ Umbraco version {{version}} +
+ +
+
+
+
Help topics for: {{section}}
+ + + +
+ +
+
Video chapters for: {{section}}
+ + + + +
+
+
+
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/iconpicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/iconpicker.html new file mode 100644 index 00000000..bcf7fe32 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/iconpicker.html @@ -0,0 +1,63 @@ +
+
+
+ +
+
+ + + + +
diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/insertmacro.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/insertmacro.html new file mode 100644 index 00000000..02865391 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/insertmacro.html @@ -0,0 +1,46 @@ +
+
+ + + +
+ + + + + + + +
+ +
{{$parent.$parent.selectedMacro.name}}
+ +
    +
  • + + + + + + + +
  • +
+ +
+ +
+ +
+
diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/legacydelete.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/legacydelete.html new file mode 100644 index 00000000..5545dace --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/legacydelete.html @@ -0,0 +1,14 @@ +
+
+ +
+

+ Are you sure you want to delete {{currentNode.name}} ? +

+ + + + +
+
+
diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/linkpicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/linkpicker.html new file mode 100644 index 00000000..cb47826c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/linkpicker.html @@ -0,0 +1,59 @@ +
+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/login.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/login.html new file mode 100644 index 00000000..2e9709e1 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/login.html @@ -0,0 +1,26 @@ +
+
+ +
+

{{greeting}}

+

+ Log in below. + Log in below +

+ +
+ +
+ +
+ +
+ + + +
+
{{errorMsg}}
+
+
+
+
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/macropicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/macropicker.html new file mode 100644 index 00000000..115109cd --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/macropicker.html @@ -0,0 +1,38 @@ +
+ + + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/mediapicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/mediapicker.html new file mode 100644 index 00000000..a9bda987 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/mediapicker.html @@ -0,0 +1,133 @@ +
+ +
+ + + +
+ + +
+
+ +
+
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ + + + + + +
+ +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/membergrouppicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/membergrouppicker.html new file mode 100644 index 00000000..f7fb8f85 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/membergrouppicker.html @@ -0,0 +1,36 @@ +
+ + + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/memberpicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/memberpicker.html new file mode 100644 index 00000000..e6cc181b --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/memberpicker.html @@ -0,0 +1,68 @@ +
+
+
+ +
+
+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/property.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/property.html new file mode 100644 index 00000000..89bb3383 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/property.html @@ -0,0 +1 @@ +{{propertyTypeToRender}} \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/rteembed.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/rteembed.html new file mode 100644 index 00000000..df544a74 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/rteembed.html @@ -0,0 +1,35 @@ +
+
+ + + +
+
diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/treepicker.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/treepicker.html new file mode 100644 index 00000000..507a3d78 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/treepicker.html @@ -0,0 +1,70 @@ +
+
+
+ +
+
+ + + + +
diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/user.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/user.html new file mode 100644 index 00000000..1cc194ea --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/user.html @@ -0,0 +1,48 @@ +
+
+
+
+ +
+
+

{{user.name}}

+

+ + : {{remainingAuthSeconds | timespan}} +

+ +
+ +
+
+ +
+
+

+ + Edit + +

+
+ + +
+
+ +
+ +
+ + Umbraco version {{version}} +
+
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/dialogs/ysod.html b/OurUmbraco.Site/umbraco/Views/common/dialogs/ysod.html new file mode 100644 index 00000000..a0965460 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/dialogs/ysod.html @@ -0,0 +1,28 @@ +
+ + Close + +

{{error.errorMsg}}

+
+

{{error.data.ExceptionMessage || error.data.Message}}

+
+ Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. +
+
+ Exception Details: {{error.data.ExceptionType}}: {{error.data.ExceptionMessage}} +
+
+ Stack Trace: +
+
+ + + + + +
+
{{error.data.StackTrace}}
+
+ +
+
diff --git a/OurUmbraco.Site/umbraco/Views/common/legacy.html b/OurUmbraco.Site/umbraco/Views/common/legacy.html new file mode 100644 index 00000000..2fd41be4 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/legacy.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/login.html b/OurUmbraco.Site/umbraco/Views/common/login.html new file mode 100644 index 00000000..d490d395 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/login.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/common/notifications/confirmroutechange.html b/OurUmbraco.Site/umbraco/Views/common/notifications/confirmroutechange.html new file mode 100644 index 00000000..97be02ba --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/common/notifications/confirmroutechange.html @@ -0,0 +1,7 @@ +
+

You have unsaved changes

+

Are you sure you want to navigate away from this page? - you have unsaved changes

+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/content/copy.html b/OurUmbraco.Site/umbraco/Views/content/copy.html new file mode 100644 index 00000000..ff74b3c5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/copy.html @@ -0,0 +1,52 @@ +
+
+
+ + +

+ Choose where to copy {{currentNode.name}} to in the tree structure below +

+ +
+

{{error.errorMsg}}

+

{{error.data.Message}}

+
+ +
+

+ {{currentNode.name}} was copied to + {{target.name}} +

+ + +
+ +
+ + + + + + + + + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/content/create.html b/OurUmbraco.Site/umbraco/Views/content/create.html new file mode 100644 index 00000000..8c24bce0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/create.html @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/content/delete.html b/OurUmbraco.Site/umbraco/Views/content/delete.html new file mode 100644 index 00000000..94afec91 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/delete.html @@ -0,0 +1,12 @@ +
+
+ +

+ Are you sure you want to delete {{currentNode.name}} ? +

+ + + + +
+
diff --git a/OurUmbraco.Site/umbraco/Views/content/edit.html b/OurUmbraco.Site/umbraco/Views/content/edit.html new file mode 100644 index 00000000..e3c07923 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/edit.html @@ -0,0 +1,83 @@ +
+ + + + +
+ +
+ +
+
+
+ +
+ + + + +
+
+
+ + + + + + + + + + +
+
diff --git a/OurUmbraco.Site/umbraco/Views/content/emptyrecyclebin.html b/OurUmbraco.Site/umbraco/Views/content/emptyrecyclebin.html new file mode 100644 index 00000000..2e40482e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/emptyrecyclebin.html @@ -0,0 +1,8 @@ +
+
+ + + + +
+
diff --git a/OurUmbraco.Site/umbraco/Views/content/move.html b/OurUmbraco.Site/umbraco/Views/content/move.html new file mode 100644 index 00000000..8230ee21 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/move.html @@ -0,0 +1,38 @@ +
+
+
+ +

+ Choose where to move {{currentNode.name}} to in the tree structure below +

+ +
+

{{error.errorMsg}}

+

{{error.data.Message}}

+
+ +
+

{{currentNode.name}} was moved underneath + {{target.name}}

+ + +
+ +
+ + +
+
+
+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/content/recyclebin.html b/OurUmbraco.Site/umbraco/Views/content/recyclebin.html new file mode 100644 index 00000000..dc247a1e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/recyclebin.html @@ -0,0 +1,14 @@ + + +
+

Recycle Bin

+
+
+ + + +
+
+
+
+
diff --git a/OurUmbraco.Site/umbraco/Views/content/umbpreview.html b/OurUmbraco.Site/umbraco/Views/content/umbpreview.html new file mode 100644 index 00000000..3cdf1450 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/content/umbpreview.html @@ -0,0 +1,9 @@ + + + + Loading + + + + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/contenttype/edit.html b/OurUmbraco.Site/umbraco/Views/contenttype/edit.html new file mode 100644 index 00000000..82a4d706 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/contenttype/edit.html @@ -0,0 +1,74 @@ +
+ + + +
+ + +
+ +
+
+ +
+ +
+
+
+
+ + + +
+
+ +
+
    +
  • +
    {{tab.name}}
    + +
      +
    • + {{property.name}} +
    • +
    + +
  • +
+ + {{page.datatypes | json}} +
+ +
+ +
+
+
+
+ + +
+ + + +
+
+
+
+
diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/ChangePassword.html b/OurUmbraco.Site/umbraco/Views/dashboard/ChangePassword.html new file mode 100644 index 00000000..9d560759 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/ChangePassword.html @@ -0,0 +1,18 @@ +
+ +

Change password

+

Enter your current password, then repeat your new password to change it

+ + + + + + + + + + +
diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardIntro.html b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardIntro.html new file mode 100644 index 00000000..e0c476ad --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardIntro.html @@ -0,0 +1,49 @@ + +
+

Welcome to The Friendly CMS

+

Thank you for choosing Umbraco - we think this could be the beginning of something beautiful. While it may feel overwhelming at first, we've done a lot to make the learning curve as smooth and fast as possible:

+ + + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardKits.html b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardKits.html new file mode 100644 index 00000000..726dd8d8 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardKits.html @@ -0,0 +1,15 @@ +

Install a Starter Site and Skin

+

If you haven't already installed one of our Starter Kits, we think you should do that now. This is one of the best ways to start working with Umbraco. After you install a Starter Kit, you can select a skin to make it look great and customize the kit to your liking.

+

Starter Kits:

+
+
+
+ +
+
+
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardLastEdits.html b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardLastEdits.html new file mode 100644 index 00000000..e69de29b diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardVideos.html b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardVideos.html new file mode 100644 index 00000000..2135c378 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/default/StartupDashboardVideos.html @@ -0,0 +1,18 @@ +

Hours of Umbraco training videos are only a click away

+

Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

+ +

To get you started:

+
+ + +
\ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/ourumbraco.png b/OurUmbraco.Site/umbraco/Views/dashboard/default/ourumbraco.png new file mode 100644 index 0000000000000000000000000000000000000000..3795b272287630bc955d559e6ce33ee6b00de533 GIT binary patch literal 75730 zcmaHR18`V_xSXyuRS*zR%fIR~Y~y ze+lf(-Hb`R?Cl&}dA$V4{>97tH~&vHGa1RhMBHoz$o|79Z3Sf#F-I435)LMIMpG76 zRuWE5CRP9kCnqZd2^$M58#Bw_my?kdz{|nO%f?0WpAXqzZ7yaOysF}o|EcS5Nr24C z&CQ9Inc36RlgX2v$HpagajIQ1eZpL1W4zA??W)L@bHFdFeaG@O@QpLrT@_cd#C@Rb#VPpH~n=OvzM_GGb^l!&mkpH8~iC4_U+}O?0McvWS?%!TiwsLfHbhUDH zA`w&LB%x6-Hnn#6r-Jrh2n7XR83$K4V+T`n8F2x!zZ^`~)@Hoi05)+p2@Y<6h=>>~ zs{}hYtEi}$gcv8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GACR>u3O2Vk^`<#GF__Gz7jJ&IuH&O>N^8}He97q==_J$8 zv@ignYqJUR{{4e&VN7A%u8kFPMUKbv#nSG^Qqu;l@&?H$A9?*vxB}m(kv`*;w0iR%40(at0KAfg-Q}@&~%`kn1@{2=_ zC_biuW+}(<;+8}lYc?9Zq+q^7knzGnPd8XzaBPFX8Bt{6v7zm|1m|^KuU4y~C_dN_ z6rDFs)3$9B1d-3@e_WN{0FI2s_dbv&o1MX4-Dk=X7|FJhRnBHL;kG|MD-yxnfK zTOHT)CT8Xsk~H)V84qu|U2BG(lOG--am))NH0EI#pnC)(fMhd*Zz8V#!I6|}*4vUS z8NHsAQqX5G!Wo8!$DP7&T49o8VB4LJmdfQAn(CuQKi0rYJG&xC05CxvV1MRgt<|lu5VJJiX%|9$VfdAC9*)PAaKJmolV}sW6 z%I0=?iW{oMoLz<>xV%`mTfyI vPM#Voo@hjVbkyh%zJBzhA8$YYOMn3YcneSjfJm_b00000NkvXXu0mjfjyv&+ literal 0 HcmV?d00001 diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/default/umbracotv.png b/OurUmbraco.Site/umbraco/Views/dashboard/default/umbracotv.png new file mode 100644 index 0000000000000000000000000000000000000000..a425cfa2ecb7b57ce7204724d56c93a69032061d GIT binary patch literal 106574 zcmaI6W0WRAvo6}kv~AmZ+qP}nwrz9Twr$%sra5ifxby9E_Br>*-M3b)s;pcQPef)! zW<{=uNCi1@xL?@6fPjGDBqcj^fv;?^Sy|7$FHC&YK&0O3KolJoQ zP3((vFw-rmK&b(9(pLSe;dtQPx4&)WTB2%gI#POHReu%i5UJgqWX?kjI1T zAAqf?iy@(ht&N>Cmj^HLf8lcdYyYR4ftc{WNL;LWiT{^U8nOz6!uC$4gsk)|bjFNK zOoVJ~^h^L&HZ~?&LS{xLW(LN8Hya%jfQyxlig3j5~&c)D!&d!cUI>Pt*T31Y3vy18e8}zo+TngfVy+IxsNNGyZ2t|4k?>`~OdBYx{qw zon4en|F6FPpTN#4o(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braco.Site/umbraco/Views/dashboard/developer/developerdashboardintro.html b/OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardintro.html new file mode 100644 index 00000000..5ea8a141 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardintro.html @@ -0,0 +1,14 @@ +

    Start here

    +

    This section contains the tools to add advanced features to your Umbraco site

    +

    From here you can explore and install packages, create macros, add data types, and much more. Start by exploring the below links or videos.

    + +

    Find out more:

    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardvideos.html b/OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardvideos.html new file mode 100644 index 00000000..54caeccc --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/developer/developerdashboardvideos.html @@ -0,0 +1,21 @@ +

    Hours of Umbraco training videos are only a click away

    +

    Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

    + +

    To get you started:

    +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/media/desktopmediauploader.html b/OurUmbraco.Site/umbraco/Views/dashboard/media/desktopmediauploader.html new file mode 100644 index 00000000..00ff5db3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/media/desktopmediauploader.html @@ -0,0 +1,38 @@ +

    Desktop Media Uploader

    + +

    Desktop Media Uploader is a small desktop application that you can install on your computer which allows you to easily upload media items directly to the media section.

    +

    The badge below will auto configure itself based upon whether you already have Desktop Media Uploader installed or not.

    +

    Just click the Install Now / Upgrade Now / Launch Now link to perform that action.

    + +

    +

    +

    Download Desktop Media Uploader now.

    + + This application requires Adobe® AIR™ to be installed for Mac OS or Windows. + +
    +

    + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardintro.html b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardintro.html new file mode 100644 index 00000000..d97b77ca --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardintro.html @@ -0,0 +1,14 @@ +

    Start here

    +

    Get started with Media right now

    +

    Use the tool below to upload your images or documents to a media folder.

    + +

    Follow these steps:

    +
      +
    • Click Install and follow the on screen instructions to install the Desktop Media Uploader
    • +
    • Enter your login details for the site and click Sign In
    • +
    • Choose a media folder to upload files to from the Upload files to... dropdown list
    • +
    • Drag the files and folders you wish to upload directly into the Desktop Media Uploader application
    • +
    • Click Upload to start uploading
    • +
    +

    For a more thorough guide on how to use the Desktop Media Uploader, checkout this video.

    + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardvideos.html b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardvideos.html new file mode 100644 index 00000000..2135c378 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediadashboardvideos.html @@ -0,0 +1,18 @@ +

    Hours of Umbraco training videos are only a click away

    +

    Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

    + +

    To get you started:

    +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/media/mediafolderbrowser.html b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediafolderbrowser.html new file mode 100644 index 00000000..49803e4f --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/media/mediafolderbrowser.html @@ -0,0 +1,26 @@ +
    + + + + +

    Click to upload

    + +
    + + + + + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardintro.html b/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardintro.html new file mode 100644 index 00000000..98d15dd4 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardintro.html @@ -0,0 +1,10 @@ +

    Start here

    + +

    Get started with Members right now

    +

    Use the tool below to search for an existing member.

    + +

    More about members

    + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardvideos.html b/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardvideos.html new file mode 100644 index 00000000..08e7fb3c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/members/membersdashboardvideos.html @@ -0,0 +1,18 @@ +

    Hours of Umbraco training videos are only a click away

    +

    Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

    + +

    To get you started:

    +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardintro.html b/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardintro.html new file mode 100644 index 00000000..a425ed67 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardintro.html @@ -0,0 +1,14 @@ +

    Start here

    +

    This section contains the building blocks for your Umbraco site

    +

    Follow the below links to find out more about working with the items in the Setings section:

    + +

    Find out more:

    + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardvideos.html b/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardvideos.html new file mode 100644 index 00000000..2135c378 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/dashboard/settings/settingsdashboardvideos.html @@ -0,0 +1,18 @@ +

    Hours of Umbraco training videos are only a click away

    +

    Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco. And visit umbraco.tv for even more Umbraco videos

    + +

    To get you started:

    +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/datatype/delete.html b/OurUmbraco.Site/umbraco/Views/datatype/delete.html new file mode 100644 index 00000000..cddc1b34 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/datatype/delete.html @@ -0,0 +1,12 @@ +
    +
    + +

    + Are you sure you want to delete {{currentNode.name}} ? +

    + + + + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/datatype/edit.html b/OurUmbraco.Site/umbraco/Views/datatype/edit.html new file mode 100644 index 00000000..c7661355 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/datatype/edit.html @@ -0,0 +1,67 @@ +
    + + + + +
    + +
    + +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    + + Required +
    + +
    + + +
    {{content.selectedEditor}}
    +
    + + + + + + + + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/button-group.html b/OurUmbraco.Site/umbraco/Views/directives/button-group.html new file mode 100644 index 00000000..83ee6473 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/button-group.html @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/html/umb-control-group.html b/OurUmbraco.Site/umbraco/Views/directives/html/umb-control-group.html new file mode 100644 index 00000000..ce8028d7 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/html/umb-control-group.html @@ -0,0 +1,13 @@ +
    +
    +
    + + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/html/umb-pane.html b/OurUmbraco.Site/umbraco/Views/directives/html/umb-pane.html new file mode 100644 index 00000000..7c94769d --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/html/umb-pane.html @@ -0,0 +1,3 @@ +
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/html/umb-panel.html b/OurUmbraco.Site/umbraco/Views/directives/html/umb-panel.html new file mode 100644 index 00000000..a963eff3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/html/umb-panel.html @@ -0,0 +1,3 @@ +
    + +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/html/umb-photo-folder.html b/OurUmbraco.Site/umbraco/Views/directives/html/umb-photo-folder.html new file mode 100644 index 00000000..8b0ced6e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/html/umb-photo-folder.html @@ -0,0 +1,26 @@ + diff --git a/OurUmbraco.Site/umbraco/Views/directives/html/umb-upload-dropzone.html b/OurUmbraco.Site/umbraco/Views/directives/html/umb-upload-dropzone.html new file mode 100644 index 00000000..47418eb9 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/html/umb-upload-dropzone.html @@ -0,0 +1,13 @@ +
    +
    + +

    + Drop your files here... +

    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-crop.html b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-crop.html new file mode 100644 index 00000000..4f431ded --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-crop.html @@ -0,0 +1,19 @@ +
    +
    +
    + +
    +
    +
    + +
    + + + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-gravity.html b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-gravity.html new file mode 100644 index 00000000..c878bf81 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-gravity.html @@ -0,0 +1,12 @@ +
    +
    +
    + + +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-thumbnail.html b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-thumbnail.html new file mode 100644 index 00000000..424f00cc --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/imaging/umb-image-thumbnail.html @@ -0,0 +1,4 @@ +
    + {{}} +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-avatar.html b/OurUmbraco.Site/umbraco/Views/directives/umb-avatar.html new file mode 100644 index 00000000..48a4a776 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-avatar.html @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-confirm.html b/OurUmbraco.Site/umbraco/Views/directives/umb-confirm.html new file mode 100644 index 00000000..1460e383 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-confirm.html @@ -0,0 +1,10 @@ +
    +

    {{caption}}

    + +
    +
    + Cancel + Ok +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-content-name.html b/OurUmbraco.Site/umbraco/Views/directives/umb-content-name.html new file mode 100644 index 00000000..de3c4c35 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-content-name.html @@ -0,0 +1,19 @@ + +
    + + + + Required + {{contentNameForm.name.errorMsg}} + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-contextmenu.html b/OurUmbraco.Site/umbraco/Views/directives/umb-contextmenu.html new file mode 100644 index 00000000..de7e30af --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-contextmenu.html @@ -0,0 +1,17 @@ +
    +
    +

    {{menuDialogTitle}}

    +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-editor.html b/OurUmbraco.Site/umbraco/Views/directives/umb-editor.html new file mode 100644 index 00000000..ca0baa17 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-editor.html @@ -0,0 +1,3 @@ +
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-header.html b/OurUmbraco.Site/umbraco/Views/directives/umb-header.html new file mode 100644 index 00000000..241a1184 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-header.html @@ -0,0 +1,14 @@ +
    +
    + +
    + + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-item-sorter.html b/OurUmbraco.Site/umbraco/Views/directives/umb-item-sorter.html new file mode 100644 index 00000000..569a678d --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-item-sorter.html @@ -0,0 +1,38 @@ +
    + +
    +
    +

    Sort children of {{viewModel.name}}

    + + + + + + + + + + + + + + + +
    NameLast UpdateIndex
    {{item.column1}}{{item.column2}}{{item.column3}}
    + +
    +
    + + +
    +
    +
    +
    + {{model.successMsg}} +
    + +
    + +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-login.html b/OurUmbraco.Site/umbraco/Views/directives/umb-login.html new file mode 100644 index 00000000..3bf8332a --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-login.html @@ -0,0 +1,12 @@ +
    +
    +

    Happy {{today}}!, log in below

    +
    + +
    +
    + +
    + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-navigation.html b/OurUmbraco.Site/umbraco/Views/directives/umb-navigation.html new file mode 100644 index 00000000..e8369139 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-navigation.html @@ -0,0 +1,100 @@ +
    + + + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-notifications.html b/OurUmbraco.Site/umbraco/Views/directives/umb-notifications.html new file mode 100644 index 00000000..67c71dec --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-notifications.html @@ -0,0 +1,18 @@ +
    + +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-optionsmenu.html b/OurUmbraco.Site/umbraco/Views/directives/umb-optionsmenu.html new file mode 100644 index 00000000..a46421b5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-optionsmenu.html @@ -0,0 +1,21 @@ + diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-property.html b/OurUmbraco.Site/umbraco/Views/directives/umb-property.html new file mode 100644 index 00000000..481e0de8 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-property.html @@ -0,0 +1,18 @@ +
    + +
    + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-sections.html b/OurUmbraco.Site/umbraco/Views/directives/umb-sections.html new file mode 100644 index 00000000..367b0e2b --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-sections.html @@ -0,0 +1,47 @@ +
    +
    + +
    + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-tab-view.html b/OurUmbraco.Site/umbraco/Views/directives/umb-tab-view.html new file mode 100644 index 00000000..c545d19c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-tab-view.html @@ -0,0 +1,5 @@ +
    +
    + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/directives/umb-tab.html b/OurUmbraco.Site/umbraco/Views/directives/umb-tab.html new file mode 100644 index 00000000..8ee6fb4c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/directives/umb-tab.html @@ -0,0 +1,5 @@ +
    +
    +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/continueinstall.html b/OurUmbraco.Site/umbraco/Views/install/continueinstall.html new file mode 100644 index 00000000..28fa1d3f --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/continueinstall.html @@ -0,0 +1,13 @@ +
    +

    Continue Umbraco Installation

    +

    + You see this screen because your Umbraco installation did not complete correctly. +

    +

    + Simply click continue below to be guided through the rest of the installation process. +

    + +

    + +

    +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/database.html b/OurUmbraco.Site/umbraco/Views/install/database.html new file mode 100644 index 00000000..0e9ebc75 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/database.html @@ -0,0 +1,123 @@ +
    + +

    Configure your database

    +

    + Enter connection and authentication details for the database you want to install Umbraco on +

    + +
    +
    + What type of database do you use? + +
    + +
    +
    + +
    +

    Great!, no need to configure anything then, you simply click the continue button below to continue to the next step

    +
    + + + +
    + + What is the exact connectionstring we should use? +
    + +
    + + + Enter a valid database connection string. +
    +
    +
    + +
    +
    + Where do we find your database? +
    +
    + +
    + + Enter server domain or IP +
    +
    +
    + +
    +
    + +
    + + Enter the name of the database +
    +
    +
    +
    + + +
    + What credentials are used to access the database? +
    +
    + +
    + + Enter the database user name +
    +
    +
    + +
    +
    + +
    + + Enter the database password +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + + Validating your database connection... + + + + Could not connect to database + +
    +
    +
    + + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/error.html b/OurUmbraco.Site/umbraco/Views/install/error.html new file mode 100644 index 00000000..4fb5823a --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/error.html @@ -0,0 +1,9 @@ +
    +

    Error during installation

    + +

    {{installer.current.model.message}}

    + +

    See the log for full details (logs can typically be found in the App_Data\Logs folder).

    + + +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/permissionsreport.html b/OurUmbraco.Site/umbraco/Views/install/permissionsreport.html new file mode 100644 index 00000000..3ced6ed6 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/permissionsreport.html @@ -0,0 +1,26 @@ +
    +

    Your permission settings are not ready for umbraco

    +

    + In order to run umbraco, you'll need to update your permission settings. + Detailed information about the correct file & folder permissions for Umbraco can be found + here. +

    +

    + The following report list the permissions that are currently failing. Once the permissions are fixed press the 'Go back' button to restart the installation. +

    + +
      +
    • +

      {{category}}

      +
        +
      • + {{item}} +
      • +
      +
    • +
    + +

    + +

    +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/starterkit.html b/OurUmbraco.Site/umbraco/Views/install/starterkit.html new file mode 100644 index 00000000..1868798b --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/starterkit.html @@ -0,0 +1,20 @@ +
    +

    Install a starter website

    + +

    + Installing a starter website helps you learn how Umbraco works, and gives you a solid + and simple foundation to build on top of. +

    + + + + + No thanks, I do not want to install a starter website + +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/upgrade.html b/OurUmbraco.Site/umbraco/Views/install/upgrade.html new file mode 100644 index 00000000..37477245 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/upgrade.html @@ -0,0 +1,13 @@ +
    +

    Upgrading Umbraco

    +

    + Welcome to the Umbraco installer. You see this screen because your Umbraco installation needs a quick upgrade of its database and files, which will ensure your website is kept as fast, secure and up to date as possible. +

    +

    + Simply click continue below to be guided through the rest of the upgrade +

    + +

    + +

    +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/user.html b/OurUmbraco.Site/umbraco/Views/install/user.html new file mode 100644 index 00000000..9e6b5c22 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/user.html @@ -0,0 +1,68 @@ +
    +

    Install Umbraco 7

    + +

    Enter your name, email and password to install Umbraco 7 with its default settings, alternatively you can customize your installation

    + +
    + +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + + Your email will be used as your login +
    +
    + +
    + +
    + + + At least {{installer.current.model.minCharLength}} characters long + + + At least {{installer.current.model.minNonAlphaNumericLength}} symbol{{installer.current.model.minNonAlphaNumericLength > 1 ? 's' : ''}} + +
    +
    + + +
    +
    + +
    +
    + +
    +
    + + + + Customize +
    +
    + +
    +
    +
    +
    + +
    diff --git a/OurUmbraco.Site/umbraco/Views/install/version7upgradereport.html b/OurUmbraco.Site/umbraco/Views/install/version7upgradereport.html new file mode 100644 index 00000000..df1e58d7 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/install/version7upgradereport.html @@ -0,0 +1,22 @@ +
    +

    Major version upgrade from {{installer.current.model.currentVersion}} to {{installer.current.model.newVersion}}

    +

    There were {{installer.current.model.errors.length}} issues detected

    +

    + The following compatibility issues were found. If you continue all non-compatible property editors will be converted to a Readonly/Label. + You will be able to change the property editor to a compatible type manually by editing the data type after installation. +

    +

    + Otherwise if you choose not to proceed you will need to fix the errors listed below. + Refer to v{{installer.current.model.newVersion}} upgrade instructions for full details. +

    + +
      +
    • + {{item}} +
    • +
    + +

    + +

    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/media/create.html b/OurUmbraco.Site/umbraco/Views/media/create.html new file mode 100644 index 00000000..db1810fa --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/create.html @@ -0,0 +1,50 @@ + + + + diff --git a/OurUmbraco.Site/umbraco/Views/media/delete.html b/OurUmbraco.Site/umbraco/Views/media/delete.html new file mode 100644 index 00000000..dcbedf8e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/delete.html @@ -0,0 +1,10 @@ +
    +
    + +

    + Are you sure you want to delete {{currentNode.name}} ? +

    + + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/media/edit.html b/OurUmbraco.Site/umbraco/Views/media/edit.html new file mode 100644 index 00000000..e07da48d --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/edit.html @@ -0,0 +1,59 @@ +
    + + + +
    + +
    + +
    +
    +
    + +
    + + + +
    +
    +
    + + + + +
    + + + + + +
    +
    + +
    +
    +
    + +
    +
    + + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/media/emptyrecyclebin.html b/OurUmbraco.Site/umbraco/Views/media/emptyrecyclebin.html new file mode 100644 index 00000000..5a05e9ca --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/emptyrecyclebin.html @@ -0,0 +1,8 @@ +
    +
    + + + + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/media/move.html b/OurUmbraco.Site/umbraco/Views/media/move.html new file mode 100644 index 00000000..154ed108 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/move.html @@ -0,0 +1,37 @@ +
    +
    +
    + +

    + Choose where to move {{currentNode.name}} to in the tree structure below +

    + +
    +

    {{error.errorMsg}}

    +

    {{error.data.Message}}

    +
    + +
    +

    {{currentNode.name}} was moved underneath + {{target.name}}

    + + +
    + +
    + + +
    +
    +
    + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/media/recyclebin.html b/OurUmbraco.Site/umbraco/Views/media/recyclebin.html new file mode 100644 index 00000000..dc247a1e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/media/recyclebin.html @@ -0,0 +1,14 @@ + + +
    +

    Recycle Bin

    +
    +
    + + + +
    +
    +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/member/create.html b/OurUmbraco.Site/umbraco/Views/member/create.html new file mode 100644 index 00000000..a44369da --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/member/create.html @@ -0,0 +1,25 @@ + + + + diff --git a/OurUmbraco.Site/umbraco/Views/member/delete.html b/OurUmbraco.Site/umbraco/Views/member/delete.html new file mode 100644 index 00000000..c4d931b5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/member/delete.html @@ -0,0 +1,12 @@ +
    +
    + +

    + Are you sure you want to delete {{currentNode.name}} ? +

    + + + + +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/member/edit.html b/OurUmbraco.Site/umbraco/Views/member/edit.html new file mode 100644 index 00000000..b6ccb0c6 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/member/edit.html @@ -0,0 +1,52 @@ +
    + + + +
    + +
    + +
    +
    +
    + +
    + + + + +
    +
    +
    + + + +
    + + + + + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/boolean.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/boolean.html new file mode 100644 index 00000000..8af17a18 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/boolean.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/hidden.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/hidden.html new file mode 100644 index 00000000..d0ebd994 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/hidden.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/mediapicker.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/mediapicker.html new file mode 100644 index 00000000..cd4f6b20 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/mediapicker.html @@ -0,0 +1,22 @@ +
    + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/multivalues.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/multivalues.html new file mode 100644 index 00000000..cc7e9d03 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/multivalues.html @@ -0,0 +1,13 @@ +
    +
    + + +
    +
    +
    + + + +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/nodetype.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/nodetype.html new file mode 100644 index 00000000..d5dcbf92 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/nodetype.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/number.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/number.html new file mode 100644 index 00000000..2d3a25e9 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/number.html @@ -0,0 +1,11 @@ +
    + + + Not a number + {{propertyForm.requiredField.errorMsg}} + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/readonlykeyvalues.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/readonlykeyvalues.html new file mode 100644 index 00000000..a9a55588 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/readonlykeyvalues.html @@ -0,0 +1,7 @@ +
    +
      +
    • + {{preVal.Key}} : {{preVal.Value}} +
    • +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/requiredfield.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/requiredfield.html new file mode 100644 index 00000000..2d24c355 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/requiredfield.html @@ -0,0 +1,9 @@ +
    + + + Required + {{propertyForm.requiredField.errorMsg}} +
    diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/textarea.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/textarea.html new file mode 100644 index 00000000..e489a6db --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/textarea.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/textstring.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/textstring.html new file mode 100644 index 00000000..8fcfc8b5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/textstring.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/treepicker.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/treepicker.html new file mode 100644 index 00000000..47270dda --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/treepicker.html @@ -0,0 +1,22 @@ +
    + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/prevalueeditors/treesource.html b/OurUmbraco.Site/umbraco/Views/prevalueeditors/treesource.html new file mode 100644 index 00000000..8811b549 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/prevalueeditors/treesource.html @@ -0,0 +1,77 @@ +
    + + + + + +
    + + + + + + + + +
      +
    • + + + Show xpath query help + + + +

      + Use Xpath query to set a root node on the tree, either based on a search from the root of the content tree, or by using a context-aware placeholder. +

      + +

      + Placeholders finds the nearest published ID and runs its query from there. so for instance: + +

      $parent/newsArticle
      + + Will try to get the parent if available, but will then fall back to the nearest ancestor and query for all news articles there. +

      + +

      + Available placeholders:
      + $current: current page or closest found ancestor
      + $parent: parent page or closest found ancestor
      + $root: root of the content tree
      + $site: Ancestor node at level 1
      +

      +
      +
    • +
    • + + Cancel and clear query +
    • +
    +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/boolean/boolean.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/boolean/boolean.html new file mode 100644 index 00000000..fd7d04f4 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/boolean/boolean.html @@ -0,0 +1,3 @@ +
    + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/changepassword/changepassword.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/changepassword/changepassword.html new file mode 100644 index 00000000..c9bc96cd --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/changepassword/changepassword.html @@ -0,0 +1,53 @@ +
    +
    + Password has been reset to: +
    + {{model.value.generatedPassword}} +
    +
    + +
    + + + + + + + + + + Required + + + + + + Required + Minimum {{$parent.model.config.minPasswordLength}} characters + + + + + + + Passwords must match + + + Cancel +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/checkboxlist/checkboxlist.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/checkboxlist/checkboxlist.html new file mode 100644 index 00000000..e6407bd5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/checkboxlist/checkboxlist.html @@ -0,0 +1,14 @@ +
    + +
      +
    • + +
    • +
    + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.html new file mode 100644 index 00000000..924dcb3a --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.html @@ -0,0 +1,15 @@ +
    + +
    + You haven't defined any colors +
    + + + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.prevalues.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.prevalues.html new file mode 100644 index 00000000..82236c96 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/colorpicker/colorpicker.prevalues.html @@ -0,0 +1,12 @@ +
    +
    + + + +
    +
    +
    +
    {{item.value}}
    + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/contentpicker/contentpicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/contentpicker/contentpicker.html new file mode 100644 index 00000000..3f2a39bf --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/contentpicker/contentpicker.html @@ -0,0 +1,44 @@ +
    + + + + + + + + + + + +
    + You need to add at least {{model.config.minNumber-renderModel.length}} items +
    + +
    + You can only have {{model.config.maxNumber}} items selected +
    + + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/datepicker/datepicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/datepicker/datepicker.html new file mode 100644 index 00000000..cae6000c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/datepicker/datepicker.html @@ -0,0 +1,14 @@ +
    +
    + + + + +
    + + Required + {{propertyForm.datepicker.errorMsg}} +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/dropdown/dropdown.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/dropdown/dropdown.html new file mode 100644 index 00000000..abb0bcf2 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/dropdown/dropdown.html @@ -0,0 +1,19 @@ +
    + + + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/email/email.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/email/email.html new file mode 100644 index 00000000..635717be --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/email/email.html @@ -0,0 +1,13 @@ +
    + + + + Required + Invalid email + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/entitypicker/entitypicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/entitypicker/entitypicker.html new file mode 100644 index 00000000..274710b1 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/entitypicker/entitypicker.html @@ -0,0 +1,19 @@ +
    + + + + + + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/fileupload/fileupload.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/fileupload/fileupload.html new file mode 100644 index 00000000..6dd1c0d4 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/fileupload/fileupload.html @@ -0,0 +1,28 @@ +
    + +
    + + + + +
    +
    + +
    +
    + +
    +
      +
    • {{file.file.name}}
    • +
    +
    +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/folderbrowser/folderbrowser.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/folderbrowser/folderbrowser.html new file mode 100644 index 00000000..4c13d865 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/folderbrowser/folderbrowser.html @@ -0,0 +1,29 @@ +
    + + + +

    Click to upload

    + +
    + + + + + + + + diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/googlemaps/googlemaps.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/googlemaps/googlemaps.html new file mode 100644 index 00000000..7fa8ef8c --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/googlemaps/googlemaps.html @@ -0,0 +1,3 @@ +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/css/iframe.css b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/css/iframe.css new file mode 100644 index 00000000..59d0b094 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/css/iframe.css @@ -0,0 +1,13 @@ +/* + +body{ + background: white; +} + +.editor{padding: 20px; margin: 20px; border: 3px dashed black; } +.editor:hover{border-color: red;} + +*/ + + + diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/grid.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/grid.html new file mode 100644 index 00000000..1314b6d0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/grid.html @@ -0,0 +1,3 @@ +
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/iframe.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/iframe.html new file mode 100644 index 00000000..341e10db --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/iframe.html @@ -0,0 +1,69 @@ + + + + + + + + + +
    +
    + + + + Headline +
    +
    +
    +
    + Rich Text editor +
    +
    + + + + Insert macro +
    +
    +
    +
    + + + + Insert Macro +
    +
    + + + + Insert image +
    +
    + + + + Insert image +
    +
    +
    +
    + + + + Rich Text editor +
    +
    +
    +
    + + + + Footer +
    +
    + + + + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/js/iframe.js b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/js/iframe.js new file mode 100644 index 00000000..4dc76c17 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/grid/js/iframe.js @@ -0,0 +1,19 @@ +$(function(){ + var editors = $('[data-editor]'); + var p = parent.$(parent.document); + + + editors.addClass("editor"); + + editors.on("click", function (event) { + event.preventDefault(); + + // parent.document.fire("umbraco.grid.click"); + var el = this; + var e = jQuery.Event("umbraco.grid.click", {editor: $(el).data("editor"), element: el}); + p.trigger( e ); + }); +}); + + + diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.html new file mode 100644 index 00000000..d5a8fe38 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.html @@ -0,0 +1,63 @@ +
    + + + + +

    Click to upload

    + +
    + + +
    +
    +
    + + + +
    + +
    + + + Reset + +
    +
    + +
    +
    + +
    + +
    + + + + Remove file +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.prevalues.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.prevalues.html new file mode 100644 index 00000000..69d54244 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/imagecropper/imagecropper.prevalues.html @@ -0,0 +1,49 @@ +
    + + +
    +
      +
    • + + + + {{node.alias}} +
      {{node.width}}px × {{node.height}}px +
    • +
    +
    + +
    +

    Define crop

    +

    + Give the crop an alias and it's default width and height. +

    + +
    + + +
    + +
    + + + × + +
    + +
    + + Cancel +
    +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/integer/integer.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/integer/integer.html new file mode 100644 index 00000000..f1320f5b --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/integer/integer.html @@ -0,0 +1,10 @@ +
    + + + Not a number + {{propertyForm.requiredField.errorMsg}} + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/listview/listview.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/listview/listview.html new file mode 100644 index 00000000..025a66cb --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/listview/listview.html @@ -0,0 +1,130 @@ +
    + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + Name + + Last edited + + Updated by + +
    + + +
    +
    +

    There are no items show in the list.

    +
    + + + + + {{result.name}} + + {{result.updateDate|date:'medium'}} + + + {{result.owner.name}} + +
    +
    +
    + + +
    +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/macrocontainer/macrocontainer.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/macrocontainer/macrocontainer.html new file mode 100644 index 00000000..13adc946 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/macrocontainer/macrocontainer.html @@ -0,0 +1,28 @@ +
    + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/markdowneditor/markdowneditor.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/markdowneditor/markdowneditor.html new file mode 100644 index 00000000..f5aff863 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/markdowneditor/markdowneditor.html @@ -0,0 +1,7 @@ +
    +
    + +
    + +
    + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/mediapicker/mediapicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/mediapicker/mediapicker.html new file mode 100644 index 00000000..1fb4b7f7 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/mediapicker/mediapicker.html @@ -0,0 +1,24 @@ +
    + +
      +
    • + + + + + {{image.name}} + + + +
    • +
    + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/membergrouppicker/membergrouppicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/membergrouppicker/membergrouppicker.html new file mode 100644 index 00000000..ecb514cc --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/membergrouppicker/membergrouppicker.html @@ -0,0 +1,25 @@ +
    + + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/membergroups/membergroups.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/membergroups/membergroups.html new file mode 100644 index 00000000..3448f1b3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/membergroups/membergroups.html @@ -0,0 +1,18 @@ +
    +
    +
    Not a member of group(s)
    + +
    +
    +
    Member of group(s)
    + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/memberpicker/memberpicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/memberpicker/memberpicker.html new file mode 100644 index 00000000..dcfa7eaf --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/memberpicker/memberpicker.html @@ -0,0 +1,26 @@ +
    + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/multipletextbox/multipletextbox.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/multipletextbox/multipletextbox.html new file mode 100644 index 00000000..5c0a73d0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/multipletextbox/multipletextbox.html @@ -0,0 +1,17 @@ +
    + +
    + + + + +
    + + + + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/radiobuttons/radiobuttons.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/radiobuttons/radiobuttons.html new file mode 100644 index 00000000..2e5ce96e --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/radiobuttons/radiobuttons.html @@ -0,0 +1,12 @@ +
    +
      +
    • + +
    • +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/readonlyvalue/readonlyvalue.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/readonlyvalue/readonlyvalue.html new file mode 100644 index 00000000..2fe6aca3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/readonlyvalue/readonlyvalue.html @@ -0,0 +1,3 @@ +
    + {{displayvalue}} +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/relatedlinks/relatedlinks.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/relatedlinks/relatedlinks.html new file mode 100644 index 00000000..27473329 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/relatedlinks/relatedlinks.html @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.html new file mode 100644 index 00000000..8ff11f79 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.html @@ -0,0 +1,5 @@ +
    +
    Loading...
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.prevalues.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.prevalues.html new file mode 100644 index 00000000..df5e2596 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/rte/rte.prevalues.html @@ -0,0 +1,36 @@ +
    + + +
    + + + + + {{cmd.frontEndCommand}} +
    +
    + + +
    + + {{css.name}} +
    +
    + + + × + Pixels + + + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/orientation.prevalues.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/orientation.prevalues.html new file mode 100644 index 00000000..67bcdbc3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/orientation.prevalues.html @@ -0,0 +1,8 @@ +
    + + + Required +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/slider.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/slider.html new file mode 100644 index 00000000..e7d9a06a --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/slider/slider.html @@ -0,0 +1,5 @@ +
    + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.html new file mode 100644 index 00000000..0c25d0d0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.html @@ -0,0 +1,19 @@ +
    + +
    + Loading... +
    + +
    + + + + + + +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.prevalues.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.prevalues.html new file mode 100644 index 00000000..2eb9aecf --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/tags/tags.prevalues.html @@ -0,0 +1,10 @@ +
    + + + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/templatepicker/templatepicker.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/templatepicker/templatepicker.html new file mode 100644 index 00000000..6dad6372 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/templatepicker/templatepicker.html @@ -0,0 +1,3 @@ +
    +
    {{model.value | json}}
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/test/test.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/test/test.html new file mode 100644 index 00000000..19b09721 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/test/test.html @@ -0,0 +1,18 @@ +
    +
      +
    • + {{item[0].value}}... +
    • +
    + +
    + + +
    + + + +
    + json: {{model.value|json}} +
    +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/textarea/textarea.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/textarea/textarea.html new file mode 100644 index 00000000..7d110df7 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/textarea/textarea.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/textbox/textbox.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/textbox/textbox.html new file mode 100644 index 00000000..aa5751c8 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/textbox/textbox.html @@ -0,0 +1,9 @@ +
    + + + Required + +
    diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/ultrasimple/ultrasimple.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/ultrasimple/ultrasimple.html new file mode 100644 index 00000000..76e31eca --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/ultrasimple/ultrasimple.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/urllist/urllist.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/urllist/urllist.html new file mode 100644 index 00000000..d318b89a --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/urllist/urllist.html @@ -0,0 +1,7 @@ +
    + +
    \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/Views/propertyeditors/validationtest/validationtest.html b/OurUmbraco.Site/umbraco/Views/propertyeditors/validationtest/validationtest.html new file mode 100644 index 00000000..4716a639 --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/propertyeditors/validationtest/validationtest.html @@ -0,0 +1,12 @@ +
    +

    Enter a numeric value

    + + + + Required! + The value entered is not a number + A server error occurred +
    diff --git a/OurUmbraco.Site/umbraco/Views/templates/edit.html b/OurUmbraco.Site/umbraco/Views/templates/edit.html new file mode 100644 index 00000000..3827df0d --- /dev/null +++ b/OurUmbraco.Site/umbraco/Views/templates/edit.html @@ -0,0 +1,19 @@ +
    + + +

    woop

    +
    + +
    +
    +
    + +
    +
    +
    + + + + */ +angular.module("umbraco.directives") + .directive('resizeToContent', function ($window, $timeout) { + return function (scope, el, attrs) { + var iframe = el[0]; + var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow; + if (iframeWin.document.body) { + + $timeout(function(){ + var height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight; + el.height(height); + }, 3000); + } + }; + }); + +angular.module("umbraco.directives") + .directive('selectOnFocus', function () { + return function (scope, el, attrs) { + $(el).bind("click", function () { + var editmode = $(el).data("editmode"); + //If editmode is true a click is handled like a normal click + if (!editmode) { + //Initial click, select entire text + this.select(); + //Set the edit mode so subsequent clicks work normally + $(el).data("editmode", true); + } + }). + bind("blur", function () { + //Reset on focus lost + $(el).data("editmode", false); + }); + }; + }); + +/** +* @ngdoc directive +* @name umbraco.directives.directive:noDirtyCheck +* @restrict A +* @description Can be attached to form inputs to prevent them from setting the form as dirty (http://stackoverflow.com/questions/17089090/prevent-input-from-setting-form-dirty-angularjs) +**/ +function noDirtyCheck() { + return { + restrict: 'A', + require: 'ngModel', + link: function (scope, elm, attrs, ctrl) { + elm.focus(function () { + ctrl.$pristine = false; + }); + } + }; +} +angular.module('umbraco.directives').directive("noDirtyCheck", noDirtyCheck); +/** + * General-purpose validator for ngModel. + * angular.js comes with several built-in validation mechanism for input fields (ngRequired, ngPattern etc.) but using + * an arbitrary validation function requires creation of a custom formatters and / or parsers. + * The ui-validate directive makes it easy to use any function(s) defined in scope as a validator function(s). + * A validator function will trigger validation on both model and input changes. + * + * @example + * @example + * @example + * @example + * + * @param val-custom {string|object literal} If strings is passed it should be a scope's function to be used as a validator. + * If an object literal is passed a key denotes a validation error key while a value should be a validator function. + * In both cases validator function should take a value to validate as its argument and should return true/false indicating a validation result. + */ + + /* + This code comes from the angular UI project, we had to change the directive name and module + but other then that its unmodified + */ +angular.module('umbraco.directives.validation') +.directive('valCustom', function () { + + return { + restrict: 'A', + require: 'ngModel', + link: function (scope, elm, attrs, ctrl) { + var validateFn, watch, validators = {}, + validateExpr = scope.$eval(attrs.valCustom); + + if (!validateExpr){ return;} + + if (angular.isString(validateExpr)) { + validateExpr = { validator: validateExpr }; + } + + angular.forEach(validateExpr, function (exprssn, key) { + validateFn = function (valueToValidate) { + var expression = scope.$eval(exprssn, { '$value' : valueToValidate }); + if (angular.isObject(expression) && angular.isFunction(expression.then)) { + // expression is a promise + expression.then(function(){ + ctrl.$setValidity(key, true); + }, function(){ + ctrl.$setValidity(key, false); + }); + return valueToValidate; + } else if (expression) { + // expression is true + ctrl.$setValidity(key, true); + return valueToValidate; + } else { + // expression is false + ctrl.$setValidity(key, false); + return undefined; + } + }; + validators[key] = validateFn; + ctrl.$formatters.push(validateFn); + ctrl.$parsers.push(validateFn); + }); + + function apply_watch(watch) + { + //string - update all validators on expression change + if (angular.isString(watch)) + { + scope.$watch(watch, function(){ + angular.forEach(validators, function(validatorFn){ + validatorFn(ctrl.$modelValue); + }); + }); + return; + } + + //array - update all validators on change of any expression + if (angular.isArray(watch)) + { + angular.forEach(watch, function(expression){ + scope.$watch(expression, function() + { + angular.forEach(validators, function(validatorFn){ + validatorFn(ctrl.$modelValue); + }); + }); + }); + return; + } + + //object - update appropriate validator + if (angular.isObject(watch)) + { + angular.forEach(watch, function(expression, validatorKey) + { + //value is string - look after one expression + if (angular.isString(expression)) + { + scope.$watch(expression, function(){ + validators[validatorKey](ctrl.$modelValue); + }); + } + + //value is array - look after all expressions in array + if (angular.isArray(expression)) + { + angular.forEach(expression, function(intExpression) + { + scope.$watch(intExpression, function(){ + validators[validatorKey](ctrl.$modelValue); + }); + }); + } + }); + } + } + // Support for val-custom-watch + if (attrs.valCustomWatch){ + apply_watch( scope.$eval(attrs.valCustomWatch) ); + } + } + }; +}); +/** +* @ngdoc directive +* @name umbraco.directives.directive:valHighlight +* @restrict A +* @description Used on input fields when you want to signal that they are in error, this will highlight the item for 1 second +**/ +function valHighlight($timeout) { + return { + restrict: "A", + link: function (scope, element, attrs, ctrl) { + + scope.$watch(function() { + return scope.$eval(attrs.valHighlight); + }, function(newVal, oldVal) { + if (newVal === true) { + element.addClass("highlight-error"); + $timeout(function () { + //set the bound scope property to false + scope[attrs.valHighlight] = false; + }, 1000); + } + else { + element.removeClass("highlight-error"); + } + }); + + } + }; +} +angular.module('umbraco.directives').directive("valHighlight", valHighlight); +angular.module('umbraco.directives.validation') + .directive('valCompare',function () { + return { + require: "ngModel", + link: function (scope, elem, attrs, ctrl) { + + //TODO: Pretty sure this should be done using a requires ^form in the directive declaration + var otherInput = elem.inheritedData("$formController")[attrs.valCompare]; + + ctrl.$parsers.push(function(value) { + if(value === otherInput.$viewValue) { + ctrl.$setValidity("valCompare", true); + return value; + } + ctrl.$setValidity("valCompare", false); + }); + + otherInput.$parsers.push(function(value) { + ctrl.$setValidity("valCompare", value === ctrl.$viewValue); + return value; + }); + } + }; +}); +/** +* @ngdoc directive +* @name umbraco.directives.directive:valFormManager +* @restrict A +* @require formController +* @description Used to broadcast an event to all elements inside this one to notify that form validation has +* changed. If we don't use this that means you have to put a watch for each directive on a form's validation +* changing which would result in much higher processing. We need to actually watch the whole $error collection of a form +* because just watching $valid or $invalid doesn't acurrately trigger form validation changing. +* This also sets the show-validation (or a custom) css class on the element when the form is invalid - this lets +* us css target elements to be displayed when the form is submitting/submitted. +* Another thing this directive does is to ensure that any .control-group that contains form elements that are invalid will +* be marked with the 'error' css class. This ensures that labels included in that control group are styled correctly. +**/ +function valFormManager(serverValidationManager, $rootScope, $log, $timeout, notificationsService, eventsService, $routeParams) { + return { + require: "form", + restrict: "A", + link: function (scope, element, attr, formCtrl) { + + scope.$watch(function () { + return formCtrl.$error; + }, function (e) { + scope.$broadcast("valStatusChanged", { form: formCtrl }); + + //find all invalid elements' .control-group's and apply the error class + var inError = element.find(".control-group .ng-invalid").closest(".control-group"); + inError.addClass("error"); + + //find all control group's that have no error and ensure the class is removed + var noInError = element.find(".control-group .ng-valid").closest(".control-group").not(inError); + noInError.removeClass("error"); + + }, true); + + var className = attr.valShowValidation ? attr.valShowValidation : "show-validation"; + var savingEventName = attr.savingEvent ? attr.savingEvent : "formSubmitting"; + var savedEvent = attr.savedEvent ? attr.savingEvent : "formSubmitted"; + + //This tracks if the user is currently saving a new item, we use this to determine + // if we should display the warning dialog that they are leaving the page - if a new item + // is being saved we never want to display that dialog, this will also cause problems when there + // are server side validation issues. + var isSavingNewItem = false; + + //we should show validation if there are any msgs in the server validation collection + if (serverValidationManager.items.length > 0) { + element.addClass(className); + } + + //listen for the forms saving event + scope.$on(savingEventName, function (ev, args) { + element.addClass(className); + + //set the flag so we can check to see if we should display the error. + isSavingNewItem = $routeParams.create; + }); + + //listen for the forms saved event + scope.$on(savedEvent, function (ev, args) { + //remove validation class + element.removeClass(className); + + //clear form state as at this point we retrieve new data from the server + //and all validation will have cleared at this point + formCtrl.$setPristine(); + }); + + //This handles the 'unsaved changes' dialog which is triggered when a route is attempting to be changed but + // the form has pending changes + var locationEvent = $rootScope.$on('$locationChangeStart', function(event, nextLocation, currentLocation) { + if (!formCtrl.$dirty || isSavingNewItem) { + return; + } + + var path = nextLocation.split("#")[1]; + if (path) { + if (path.indexOf("%253") || path.indexOf("%252")) { + path = decodeURIComponent(path); + } + + if (!notificationsService.hasView()) { + var msg = { view: "confirmroutechange", args: { path: path, listener: locationEvent } }; + notificationsService.add(msg); + } + + //prevent the route! + event.preventDefault(); + + //raise an event + eventsService.emit("valFormManager.pendingChanges", true); + } + + }); + //Ensure to remove the event handler when this instance is destroyted + scope.$on('$destroy', function() { + if(locationEvent){ + locationEvent(); + } + }); + + $timeout(function(){ + formCtrl.$setPristine(); + }, 1000); + } + }; +} +angular.module('umbraco.directives').directive("valFormManager", valFormManager); +/** +* @ngdoc directive +* @name umbraco.directives.directive:valPropertyMsg +* @restrict A +* @element textarea +* @requires formController +* @description This directive is used to control the display of the property level validation message. +* We will listen for server side validation changes +* and when an error is detected for this property we'll show the error message. +* In order for this directive to work, the valStatusChanged directive must be placed on the containing form. +**/ +function valPropertyMsg(serverValidationManager) { + return { + scope: { + property: "=property" + }, + require: "^form", //require that this directive is contained within an ngForm + replace: true, //replace the element with the template + restrict: "E", //restrict to element + template: "
    {{errorMsg}}
    ", + + /** + Our directive requries a reference to a form controller + which gets passed in to this parameter + */ + link: function (scope, element, attrs, formCtrl) { + + //if there's any remaining errors in the server validation service then we should show them. + var showValidation = serverValidationManager.items.length > 0; + var hasError = false; + + //create properties on our custom scope so we can use it in our template + scope.errorMsg = ""; + + //listen for form error changes + scope.$on("valStatusChanged", function(evt, args) { + if (args.form.$invalid) { + + //first we need to check if the valPropertyMsg validity is invalid + if (formCtrl.$error.valPropertyMsg && formCtrl.$error.valPropertyMsg.length > 0) { + //since we already have an error we'll just return since this means we've already set the + // hasError and errorMsg properties which occurs below in the serverValidationManager.subscribe + return; + } + else if (element.closest(".umb-control-group").find(".ng-invalid").length > 0) { + //check if it's one of the properties that is invalid in the current content property + hasError = true; + //update the validation message if we don't already have one assigned. + if (showValidation && scope.errorMsg === "") { + var err; + //this can be null if no property was assigned + if (scope.property) { + err = serverValidationManager.getPropertyError(scope.property.alias, ""); + } + scope.errorMsg = err ? err.errorMsg : "Property has errors"; + } + } + else { + hasError = false; + scope.errorMsg = ""; + } + } + else { + hasError = false; + scope.errorMsg = ""; + } + }, true); + + //listen for the forms saving event + scope.$on("formSubmitting", function (ev, args) { + showValidation = true; + if (hasError && scope.errorMsg === "") { + var err; + //this can be null if no property was assigned + if (scope.property) { + err = serverValidationManager.getPropertyError(scope.property.alias, ""); + } + scope.errorMsg = err ? err.errorMsg : "Property has errors"; + } + else if (!hasError) { + scope.errorMsg = ""; + } + }); + + //listen for the forms saved event + scope.$on("formSubmitted", function (ev, args) { + showValidation = false; + scope.errorMsg = ""; + formCtrl.$setValidity('valPropertyMsg', true); + }); + + //We need to subscribe to any changes to our model (based on user input) + // This is required because when we have a server error we actually invalidate + // the form which means it cannot be resubmitted. + // So once a field is changed that has a server error assigned to it + // we need to re-validate it for the server side validator so the user can resubmit + // the form. Of course normal client-side validators will continue to execute. + scope.$watch("property.value", function(newValue) { + //we are explicitly checking for valServer errors here, since we shouldn't auto clear + // based on other errors. We'll also check if there's no other validation errors apart from valPropertyMsg, if valPropertyMsg + // is the only one, then we'll clear. + + if (!newValue) { + return; + } + + var errCount = 0; + for (var e in formCtrl.$error) { + if (angular.isArray(formCtrl.$error[e])) { + errCount++; + } + } + + if ((errCount === 1 && angular.isArray(formCtrl.$error.valPropertyMsg)) || (formCtrl.$invalid && angular.isArray(formCtrl.$error.valServer))) { + scope.errorMsg = ""; + formCtrl.$setValidity('valPropertyMsg', true); + } + }, true); + + //listen for server validation changes + // NOTE: we pass in "" in order to listen for all validation changes to the content property, not for + // validation changes to fields in the property this is because some server side validators may not + // return the field name for which the error belongs too, just the property for which it belongs. + // It's important to note that we need to subscribe to server validation changes here because we always must + // indicate that a content property is invalid at the property level since developers may not actually implement + // the correct field validation in their property editors. + + if (scope.property) { //this can be null if no property was assigned + serverValidationManager.subscribe(scope.property.alias, "", function(isValid, propertyErrors, allErrors) { + hasError = !isValid; + if (hasError) { + //set the error message to the server message + scope.errorMsg = propertyErrors[0].errorMsg; + //flag that the current validator is invalid + formCtrl.$setValidity('valPropertyMsg', false); + } + else { + scope.errorMsg = ""; + //flag that the current validator is valid + formCtrl.$setValidity('valPropertyMsg', true); + } + }); + + //when the element is disposed we need to unsubscribe! + // NOTE: this is very important otherwise when this controller re-binds the previous subscriptsion will remain + // but they are a different callback instance than the above. + element.bind('$destroy', function() { + serverValidationManager.unsubscribe(scope.property.alias, ""); + }); + } + } + }; +} +angular.module('umbraco.directives').directive("valPropertyMsg", valPropertyMsg); +/** + * @ngdoc directive + * @name umbraco.directives.directive:valRegex + * @restrict A + * @description A custom directive to allow for matching a value against a regex string. + * NOTE: there's already an ng-pattern but this requires that a regex expression is set, not a regex string + **/ +function valRegex() { + + return { + require: 'ngModel', + restrict: "A", + link: function (scope, elm, attrs, ctrl) { + + var flags = ""; + if (attrs.valRegexFlags) { + try { + flags = scope.$eval(attrs.valRegexFlags); + if (!flags) { + flags = attrs.valRegexFlags; + } + } + catch (e) { + flags = attrs.valRegexFlags; + } + } + var regex; + try { + var resolved = scope.$eval(attrs.valRegex); + if (resolved) { + regex = new RegExp(resolved, flags); + } + else { + regex = new RegExp(attrs.valRegex, flags); + } + } + catch(e) { + regex = new RegExp(attrs.valRegex, flags); + } + + var patternValidator = function (viewValue) { + //NOTE: we don't validate on empty values, use required validator for that + if (!viewValue || regex.test(viewValue)) { + // it is valid + ctrl.$setValidity('valRegex', true); + //assign a message to the validator + ctrl.errorMsg = ""; + return viewValue; + } + else { + // it is invalid, return undefined (no model update) + ctrl.$setValidity('valRegex', false); + //assign a message to the validator + ctrl.errorMsg = "Value is invalid, it does not match the correct pattern"; + return undefined; + } + }; + + ctrl.$formatters.push(patternValidator); + ctrl.$parsers.push(patternValidator); + } + }; +} +angular.module('umbraco.directives').directive("valRegex", valRegex); +/** + * @ngdoc directive + * @name umbraco.directives.directive:valServer + * @restrict A + * @description This directive is used to associate a content property with a server-side validation response + * so that the validators in angular are updated based on server-side feedback. + **/ +function valServer(serverValidationManager) { + return { + require: 'ngModel', + restrict: "A", + link: function (scope, element, attr, ctrl) { + + if (!scope.model || !scope.model.alias){ + throw "valServer can only be used in the scope of a content property object"; + } + var currentProperty = scope.model; + + //default to 'value' if nothing is set + var fieldName = "value"; + if (attr.valServer) { + fieldName = scope.$eval(attr.valServer); + if (!fieldName) { + //eval returned nothing so just use the string + fieldName = attr.valServer; + } + } + + //Need to watch the value model for it to change, previously we had subscribed to + //ctrl.$viewChangeListeners but this is not good enough if you have an editor that + // doesn't specifically have a 2 way ng binding. This is required because when we + // have a server error we actually invalidate the form which means it cannot be + // resubmitted. So once a field is changed that has a server error assigned to it + // we need to re-validate it for the server side validator so the user can resubmit + // the form. Of course normal client-side validators will continue to execute. + scope.$watch(function() { + return ctrl.$modelValue; + }, function (newValue) { + if (ctrl.$invalid) { + ctrl.$setValidity('valServer', true); + } + }); + + //subscribe to the server validation changes + serverValidationManager.subscribe(currentProperty.alias, fieldName, function (isValid, propertyErrors, allErrors) { + if (!isValid) { + ctrl.$setValidity('valServer', false); + //assign an error msg property to the current validator + ctrl.errorMsg = propertyErrors[0].errorMsg; + } + else { + ctrl.$setValidity('valServer', true); + //reset the error message + ctrl.errorMsg = ""; + } + }); + + //when the element is disposed we need to unsubscribe! + // NOTE: this is very important otherwise when this controller re-binds the previous subscriptsion will remain + // but they are a different callback instance than the above. + element.bind('$destroy', function () { + serverValidationManager.unsubscribe(currentProperty.alias, fieldName); + }); + } + }; +} +angular.module('umbraco.directives').directive("valServer", valServer); +/** + * @ngdoc directive + * @name umbraco.directives.directive:valServerField + * @restrict A + * @description This directive is used to associate a content field (not user defined) with a server-side validation response + * so that the validators in angular are updated based on server-side feedback. + **/ +function valServerField(serverValidationManager) { + return { + require: 'ngModel', + restrict: "A", + link: function (scope, element, attr, ctrl) { + + if (!attr.valServerField) { + throw "valServerField must have a field name for referencing server errors"; + } + + var fieldName = attr.valServerField; + + //subscribe to the changed event of the view model. This is required because when we + // have a server error we actually invalidate the form which means it cannot be + // resubmitted. So once a field is changed that has a server error assigned to it + // we need to re-validate it for the server side validator so the user can resubmit + // the form. Of course normal client-side validators will continue to execute. + ctrl.$viewChangeListeners.push(function () { + if (ctrl.$invalid) { + ctrl.$setValidity('valServerField', true); + } + }); + + //subscribe to the server validation changes + serverValidationManager.subscribe(null, fieldName, function (isValid, fieldErrors, allErrors) { + if (!isValid) { + ctrl.$setValidity('valServerField', false); + //assign an error msg property to the current validator + ctrl.errorMsg = fieldErrors[0].errorMsg; + } + else { + ctrl.$setValidity('valServerField', true); + //reset the error message + ctrl.errorMsg = ""; + } + }); + + //when the element is disposed we need to unsubscribe! + // NOTE: this is very important otherwise when this controller re-binds the previous subscriptsion will remain + // but they are a different callback instance than the above. + element.bind('$destroy', function () { + serverValidationManager.unsubscribe(null, fieldName); + }); + } + }; +} +angular.module('umbraco.directives').directive("valServerField", valServerField); + +/** +* @ngdoc directive +* @name umbraco.directives.directive:valTab +* @restrict A +* @description Used to show validation warnings for a tab to indicate that the tab content has validations errors in its data. +* In order for this directive to work, the valFormManager directive must be placed on the containing form. +**/ +function valTab() { + return { + require: "^form", + restrict: "A", + link: function (scope, element, attr, formCtrl) { + + var tabId = "tab" + scope.tab.id; + + scope.tabHasError = false; + + //listen for form validation changes + scope.$on("valStatusChanged", function(evt, args) { + if (!args.form.$valid) { + var tabContent = element.closest(".umb-panel").find("#" + tabId); + //check if the validation messages are contained inside of this tabs + if (tabContent.find(".ng-invalid").length > 0) { + scope.tabHasError = true; + } else { + scope.tabHasError = false; + } + } + else { + scope.tabHasError = false; + } + }); + + } + }; +} +angular.module('umbraco.directives').directive("valTab", valTab); +function valToggleMsg(serverValidationManager) { + return { + require: "^form", + restrict: "A", + + /** + Our directive requries a reference to a form controller which gets passed in to this parameter + */ + link: function (scope, element, attr, formCtrl) { + + if (!attr.valToggleMsg){ + throw "valToggleMsg requires that a reference to a validator is specified"; + } + if (!attr.valMsgFor){ + throw "valToggleMsg requires that the attribute valMsgFor exists on the element"; + } + if (!formCtrl[attr.valMsgFor]) { + throw "valToggleMsg cannot find field " + attr.valMsgFor + " on form " + formCtrl.$name; + } + + //if there's any remaining errors in the server validation service then we should show them. + var showValidation = serverValidationManager.items.length > 0; + var hasCustomMsg = element.contents().length > 0; + + //add a watch to the validator for the value (i.e. myForm.value.$error.required ) + scope.$watch(function () { + //sometimes if a dialog closes in the middle of digest we can get null references here + + return (formCtrl && formCtrl[attr.valMsgFor]) ? formCtrl[attr.valMsgFor].$error[attr.valToggleMsg] : null; + }, function () { + //sometimes if a dialog closes in the middle of digest we can get null references here + if ((formCtrl && formCtrl[attr.valMsgFor])) { + if (formCtrl[attr.valMsgFor].$error[attr.valToggleMsg] && showValidation) { + element.show(); + //display the error message if this element has no contents + if (!hasCustomMsg) { + element.html(formCtrl[attr.valMsgFor].errorMsg); + } + } + else { + element.hide(); + } + } + }); + + //listen for the saving event (the result is a callback method which is called to unsubscribe) + var unsubscribeSaving = scope.$on("formSubmitting", function (ev, args) { + showValidation = true; + if (formCtrl[attr.valMsgFor].$error[attr.valToggleMsg]) { + element.show(); + //display the error message if this element has no contents + if (!hasCustomMsg) { + element.html(formCtrl[attr.valMsgFor].errorMsg); + } + } + else { + element.hide(); + } + }); + + //listen for the saved event (the result is a callback method which is called to unsubscribe) + var unsubscribeSaved = scope.$on("formSubmitted", function (ev, args) { + showValidation = false; + element.hide(); + }); + + //when the element is disposed we need to unsubscribe! + // NOTE: this is very important otherwise if this directive is part of a modal, the listener still exists because the dom + // element might still be there even after the modal has been hidden. + element.bind('$destroy', function () { + unsubscribeSaving(); + unsubscribeSaved(); + }); + + } + }; +} + +/** +* @ngdoc directive +* @name umbraco.directives.directive:valToggleMsg +* @restrict A +* @element input +* @requires formController +* @description This directive will show/hide an error based on: is the value + the given validator invalid? AND, has the form been submitted ? +**/ +angular.module('umbraco.directives').directive("valToggleMsg", valToggleMsg); +angular.module('umbraco.directives.validation') +.directive('valTriggerChange', function($sniffer) { + return { + link : function(scope, elem, attrs) { + elem.bind('click', function(){ + $(attrs.valTriggerChange).trigger($sniffer.hasEvent('input') ? 'input' : 'change'); + }); + }, + priority : 1 + }; +}); + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.filters.js b/OurUmbraco.Site/umbraco/js/umbraco.filters.js new file mode 100644 index 00000000..9e705ce5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.filters.js @@ -0,0 +1,26 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + +angular.module('umbraco.filters', []); +angular.module("umbraco.filters").filter('timespan', function() { + return function(input) { + var sec_num = parseInt(input, 10); + var hours = Math.floor(sec_num / 3600); + var minutes = Math.floor((sec_num - (hours * 3600)) / 60); + var seconds = sec_num - (hours * 3600) - (minutes * 60); + + if (hours < 10) {hours = "0"+hours;} + if (minutes < 10) {minutes = "0"+minutes;} + if (seconds < 10) {seconds = "0"+seconds;} + var time = hours+':'+minutes+':'+seconds; + return time; + }; + }); + + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.httpbackend.js b/OurUmbraco.Site/umbraco/js/umbraco.httpbackend.js new file mode 100644 index 00000000..f39f6545 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.httpbackend.js @@ -0,0 +1,30 @@ +var umbracoAppDev = angular.module('umbraco.httpbackend', ['umbraco', 'ngMockE2E', 'umbraco.mocks']); + + +function initBackEnd($httpBackend, contentMocks, mediaMocks, treeMocks, userMocks, contentTypeMocks, sectionMocks, entityMocks, dataTypeMocks, dashboardMocks, macroMocks, utilMocks, localizationMocks, prevaluesMocks) { + + console.log("httpBackend inited"); + + //Register mocked http responses + contentMocks.register(); + mediaMocks.register(); + sectionMocks.register(); + treeMocks.register(); + dataTypeMocks.register(); + dashboardMocks.register(); + userMocks.register(); + macroMocks.register(); + contentTypeMocks.register(); + utilMocks.register(); + localizationMocks.register(); + prevaluesMocks.register(); + entityMocks.register(); + + $httpBackend.whenGET(/^views\//).passThrough(); + $httpBackend.whenGET(/^js\//).passThrough(); + $httpBackend.whenGET(/^lib\//).passThrough(); + $httpBackend.whenGET(/^assets\//).passThrough(); +} + + +umbracoAppDev.run(initBackEnd); diff --git a/OurUmbraco.Site/umbraco/js/umbraco.installer.js b/OurUmbraco.Site/umbraco/js/umbraco.installer.js new file mode 100644 index 00000000..03a85051 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.installer.js @@ -0,0 +1,465 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + + angular.module('umbraco.install', []); +angular.module("umbraco.install").controller("Umbraco.InstallerController", + function ($scope, installerService) { + + //TODO: Decouple the service from the controller - the controller should be responsible + // for the model (state) and the service should be responsible for helping the controller, + // the controller should be passing the model into it's methods for manipulation and not hold + // state. We should not be assigning properties from a service to a controller's scope. + // see: https://github.com/umbraco/Umbraco-CMS/commit/b86ef0d7ac83f699aee35d807f7f7ebb6dd0ed2c#commitcomment-5721204 + + $scope.stepIndex = 0; + //comment this out if you just want to see tips + installerService.init(); + + //uncomment this to see tips + //installerService.switchToFeedback(); + + $scope.installer = installerService.status; + + $scope.forward = function () { + installerService.forward(); + }; + + $scope.backward = function () { + installerService.backward(); + }; + + $scope.install = function () { + installerService.install(); + }; + + $scope.gotoStep = function (step) { + installerService.gotoNamedStep(step); + }; + + $scope.restart = function () { + installerService.gotoStep(0); + }; + }); + +//this ensure that we start with a clean slate on every install and upgrade +angular.module("umbraco.install").run(function ($templateCache) { + $templateCache.removeAll(); +}); +angular.module("umbraco.install").factory('installerService', function($rootScope, $q, $timeout, $http, $location, $log){ + + var _status = { + index: 0, + current: undefined, + steps: undefined, + loading: true, + progress: "100%" + }; + + var factTimer = undefined; + var _installerModel = { + installId: undefined, + instructions: { + } + }; + + //add to umbraco installer facts here + var facts = ['Umbraco helped millions of people watch a man jump from the edge of space', + 'Over 250.000 websites are currently powered by Umbraco', + 'On an average day, more than 1.000 people download Umbraco', + 'umbraco.tv is the premier source of Umbraco video tutorials to get you started', + 'You can find the world\'s friendliest CMS community at our.umbraco.org', + 'You can become a certified Umbraco developer by attending one of the official courses', + 'Umbraco works really well on tablets', + 'You have 100% control over your markup and design when crafting a website in Umbraco', + 'Umbraco is the best of both worlds: 100% free and open source, and backed by a professional and profitable company', + "There's a pretty big chance, you've visited a website powered by Umbraco today", + "'Umbraco-spotting' is the game of spotting big brands running Umbraco", + "At least 2 people have the Umbraco logo tattooed on them", + "'Umbraco' is the danish name for an allen key", + "Umbraco has been around since 2005, that's a looong time in IT", + "More than 400 people from all over the world meet each year in Denmark in June for our annual conference CodeGarden", + "While you are installing Umbraco someone else on the other side of the planet is probably doing it too", + "You can extend Umbraco without modifying the source code and using either JavaScript or C#" + ]; + + /** + Returns the description for the step at a given index based on the order of the serverOrder of steps + Since they don't execute on the server in the order that they are displayed in the UI. + */ + function getDescriptionForStepAtIndex(steps, index) { + var sorted = _.sortBy(steps, "serverOrder"); + if (sorted[index]) { + return sorted[index].description; + } + return null; + } + /* Returns the description for the given step name */ + function getDescriptionForStepName(steps, name) { + var found = _.find(steps, function(i) { + return i.name == name; + }); + return (found) ? found.description : null; + } + + //calculates the offset of the progressbar on the installaer + function calculateProgress(steps, next) { + var sorted = _.sortBy(steps, "serverOrder"); + + var pct = "100%"; + for (var i = sorted.length - 1; i >= 0; i--) { + if(sorted[i].name == next){ + pct = Math.floor((i+1) / steps.length * 100) + "%"; + break; + } + } + return pct; + } + + //helpful defaults for the view loading + function resolveView(view){ + + if(view.indexOf(".html") < 0){ + view = view + ".html"; + } + if(view.indexOf("/") < 0){ + view = "views/install/" + view; + } + + return view; + } + + /** Have put this here because we are not referencing our other modules */ + function safeApply (scope, fn) { + if (scope.$$phase || scope.$root.$$phase) { + if (angular.isFunction(fn)) { + fn(); + } + } + else { + if (angular.isFunction(fn)) { + scope.$apply(fn); + } + else { + scope.$apply(); + } + } + } + + var service = { + + status : _status, + //loads the needed steps and sets the intial state + init : function(){ + service.status.loading = true; + if(!_status.all){ + service.getSteps().then(function(response){ + service.status.steps = response.data.steps; + service.status.index = 0; + _installerModel.installId = response.data.installId; + service.findNextStep(); + + $timeout(function(){ + service.status.loading = false; + service.status.configuring = true; + }, 2000); + }); + } + }, + + //loads available packages from our.umbraco.org + getPackages : function(){ + return $http.get(Umbraco.Sys.ServerVariables.installApiBaseUrl + "GetPackages"); + }, + + getSteps : function(){ + return $http.get(Umbraco.Sys.ServerVariables.installApiBaseUrl + "GetSetup"); + }, + + gotoStep : function(index){ + var step = service.status.steps[index]; + step.view = resolveView(step.view); + + if(!step.model){ + step.model = {}; + } + + service.status.index = index; + service.status.current = step; + service.retrieveCurrentStep(); + }, + + gotoNamedStep : function(stepName){ + var step = _.find(service.status.steps, function(s, index){ + if (s.view && s.name === stepName) { + service.status.index = index; + return true; + } + return false; + }); + + step.view = resolveView(step.view); + if(!step.model){ + step.model = {}; + } + service.retrieveCurrentStep(); + service.status.current = step; + }, + + /** + Finds the next step containing a view. If one is found it stores it as the current step + and retreives the step information and returns it, otherwise returns null . + */ + findNextStep : function(){ + var step = _.find(service.status.steps, function(s, index){ + if(s.view && index >= service.status.index){ + service.status.index = index; + return true; + } + return false; + }); + + if (step) { + if (step.view.indexOf(".html") < 0) { + step.view = step.view + ".html"; + } + + if (step.view.indexOf("/") < 0) { + step.view = "views/install/" + step.view; + } + + if (!step.model) { + step.model = {}; + } + + service.status.current = step; + service.retrieveCurrentStep(); + + //returns the next found step + return step; + } + else { + //there are no more steps found containing a view so return null + return null; + } + }, + + storeCurrentStep : function(){ + _installerModel.instructions[service.status.current.name] = service.status.current.model; + }, + + retrieveCurrentStep : function(){ + if(_installerModel.instructions[service.status.current.name]){ + service.status.current.model = _installerModel.instructions[service.status.current.name]; + } + }, + + /** Moves the installer forward to the next view, if there are not more views than the installation will commence */ + forward : function(){ + service.storeCurrentStep(); + service.status.index++; + var found = service.findNextStep(); + if (!found) { + //no more steps were found so start the installation process + service.install(); + } + }, + + backwards : function(){ + service.storeCurrentStep(); + service.gotoStep(service.status.index--); + }, + + install : function(){ + service.storeCurrentStep(); + service.switchToFeedback(); + + service.status.feedback = getDescriptionForStepAtIndex(service.status.steps, 0); + service.status.progress = 0; + + function processInstallStep() { + + $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostPerformInstall", _installerModel) + .success(function(data, status, headers, config) { + if (!data.complete) { + + //progress feedback + service.status.progress = calculateProgress(service.status.steps, data.nextStep); + + if (data.view) { + //set the current view and model to whatever the process returns, the view is responsible for retriggering install(); + var v = resolveView(data.view); + service.status.current = { view: v, model: data.model }; + + //turn off loading bar and feedback + service.switchToConfiguration(); + } + else { + var desc = getDescriptionForStepName(service.status.steps, data.nextStep); + if (desc) { + service.status.feedback = desc; + } + processInstallStep(); + } + } + else { + service.complete(); + } + }).error(function(data, status, headers, config) { + //need to handle 500's separately, this will happen if something goes wrong outside + // of the installer (like app startup events or something) and these will get returned as text/html + // not as json. If this happens we can't actually load in external views since they will YSOD as well! + // so we need to display this in our own internal way + + if (status >= 500 && status < 600) { + service.status.current = { view: "ysod", model: null }; + var ysod = data; + //we need to manually write the html to the iframe - the html contains full html markup + $timeout(function () { + document.getElementById('ysod').contentDocument.write(ysod); + }, 500); + } + else { + //this is where we handle installer error + var v = data.view ? resolveView(data.view) : resolveView("error"); + var model = data.model ? data.model : data; + service.status.current = { view: v, model: model }; + } + + service.switchToConfiguration(); + + }); + } + processInstallStep(); + }, + + randomFact: function () { + safeApply($rootScope, function() { + service.status.fact = facts[_.random(facts.length - 1)]; + }); + }, + + switchToFeedback : function(){ + service.status.current = undefined; + service.status.loading = true; + service.status.configuring = false; + + //initial fact + service.randomFact(); + + //timed facts + factTimer = window.setInterval(function(){ + service.randomFact(); + },6000); + }, + + switchToConfiguration : function(){ + service.status.loading = false; + service.status.configuring = true; + service.status.feedback = undefined; + service.status.fact = undefined; + + if(factTimer){ + clearInterval(factTimer); + } + }, + + complete : function(){ + + service.status.progress = "100%"; + service.status.done = true; + service.status.feedback = "Redirecting you to Umbraco, please wait"; + service.status.loading = false; + + if(factTimer){ + clearInterval(factTimer); + } + + $timeout(function(){ + window.location.href = Umbraco.Sys.ServerVariables.umbracoBaseUrl; + }, 1500); + } + }; + + return service; +}); +angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseController", function($scope, $http, installerService){ + + $scope.checking = false; + $scope.dbs = [ + {name: 'Microsoft SQL Server Compact (SQL CE)', id: 0}, + {name: 'Microsoft SQL Server', id: 1}, + { name: 'Microsoft SQL Azure', id: 3 }, + { name: 'MySQL', id: 2 }, + {name: 'Custom connection string', id: -1}]; + + if(installerService.status.current.model.dbType === undefined){ + installerService.status.current.model.dbType = 0; + } + + $scope.validateAndForward = function(){ + if(!$scope.checking && this.myForm.$valid){ + $scope.checking = true; + var model = installerService.status.current.model; + + $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostValidateDatabaseConnection", + model).then(function(response){ + + if(response.data === "true"){ + installerService.forward(); + }else{ + $scope.invalidDbDns = true; + } + + $scope.checking = false; + }, function(){ + $scope.invalidDbDns = true; + $scope.checking = false; + }); + } + }; +}); +angular.module("umbraco.install").controller("Umbraco.Installer.PackagesController", function ($scope, installerService) { + + installerService.getPackages().then(function (response) { + $scope.packages = response.data; + }); + + $scope.setPackageAndContinue = function (pckId) { + installerService.status.current.model = pckId; + installerService.forward(); + }; + +}); +angular.module("umbraco.install").controller("Umbraco.Install.UserController", function($scope, installerService) { + + $scope.passwordPattern = /.*/; + $scope.installer.current.model.subscribeToNewsLetter = true; + + if ($scope.installer.current.model.minNonAlphaNumericLength > 0) { + var exp = ""; + for (var i = 0; i < $scope.installer.current.model.minNonAlphaNumericLength; i++) { + exp += ".*[\\W].*"; + } + //replace duplicates + exp = exp.replace(".*.*", ".*"); + $scope.passwordPattern = new RegExp(exp); + } + + $scope.validateAndInstall = function(){ + installerService.install(); + }; + + $scope.validateAndForward = function(){ + if(this.myForm.$valid){ + installerService.forward(); + } + }; + +}); + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.resources.js b/OurUmbraco.Site/umbraco/js/umbraco.resources.js new file mode 100644 index 00000000..08f93cbd --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.resources.js @@ -0,0 +1,2517 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + +angular.module("umbraco.resources", []); +/** + * @ngdoc service + * @name umbraco.resources.authResource + * @description Loads in data for authentication +**/ +function authResource($q, $http, umbRequestHelper, angularHelper) { + + return { + //currentUser: currentUser, + + /** Logs the user in if the credentials are good */ + performLogin: function (username, password) { + + if (!username || !password) { + return angularHelper.rejectedPromise({ + errorMsg: 'Username or password cannot be empty' + }); + } + + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "authenticationApiBaseUrl", + "PostLogin"), { + username: username, + password: password + }), + 'Login failed for user ' + username); + }, + + performLogout: function() { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "authenticationApiBaseUrl", + "PostLogout"))); + }, + + /** Sends a request to the server to get the current user details, will return a 401 if the user is not logged in */ + getCurrentUser: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "authenticationApiBaseUrl", + "GetCurrentUser")), + 'Server call failed for getting current user'); + }, + + /** Checks if the user is logged in or not - does not return 401 or 403 */ + isAuthenticated: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "authenticationApiBaseUrl", + "IsAuthenticated")), + { + success: function (data, status, headers, config) { + //if the response is false, they are not logged in so return a rejection + if (data === false || data === "false") { + return $q.reject('User is not logged in'); + } + return data; + }, + error: function (data, status, headers, config) { + return { + errorMsg: 'Server call failed for checking authentication', + data: data, + status: status + }; + } + }); + }, + + /** Gets the user's remaining seconds before their login times out */ + getRemainingTimeoutSeconds: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "authenticationApiBaseUrl", + "GetRemainingTimeoutSeconds")), + 'Server call failed for checking remaining seconds'); + } + + }; +} + +angular.module('umbraco.resources').factory('authResource', authResource); + +/** + * @ngdoc service + * @name umbraco.resources.contentResource + * @description Handles all transactions of content data + * from the angular application to the Umbraco database, using the Content WebApi controller + * + * all methods returns a resource promise async, so all operations won't complete untill .then() is completed. + * + * @requires $q + * @requires $http + * @requires umbDataFormatter + * @requires umbRequestHelper + * + * ##usage + * To use, simply inject the contentResource into any controller or service that needs it, and make + * sure the umbraco.resources module is accesible - which it should be by default. + * + *
    +  *    contentResource.getById(1234)
    +  *          .then(function(data) {
    +  *              $scope.content = data;
    +  *          });    
    +  * 
    + **/ + +function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { + + /** internal method process the saving of data and post processing the result */ + function saveContentItem(content, action, files) { + return umbRequestHelper.postSaveContent({ + restApiUrl: umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "PostSave"), + content: content, + action: action, + files: files, + dataFormatter: function (c, a) { + return umbDataFormatter.formatContentPostData(c, a); + } + }); + } + + return { + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#sort + * @methodOf umbraco.resources.contentResource + * + * @description + * Sorts all children below a given parent node id, based on a collection of node-ids + * + * ##usage + *
    +         * var ids = [123,34533,2334,23434];
    +         * contentResource.sort({ parentId: 1244, sortedIds: ids })
    +         *    .then(function() {
    +         *        $scope.complete = true;
    +         *    });
    +         * 
    + * @param {Object} args arguments object + * @param {Int} args.parentId the ID of the parent node + * @param {Array} options.sortedIds array of node IDs as they should be sorted + * @returns {Promise} resourcePromise object. + * + */ + sort: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.parentId) { + throw "args.parentId cannot be null"; + } + if (!args.sortedIds) { + throw "args.sortedIds cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostSort"), + { + parentId: args.parentId, + idSortOrder: args.sortedIds + }), + 'Failed to sort content'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#move + * @methodOf umbraco.resources.contentResource + * + * @description + * Moves a node underneath a new parentId + * + * ##usage + *
    +         * contentResource.move({ parentId: 1244, id: 123 })
    +         *    .then(function() {
    +         *        alert("node was moved");
    +         *    }, function(err){
    +         *      alert("node didnt move:" + err.data.Message); 
    +         *    });
    +         * 
    + * @param {Object} args arguments object + * @param {Int} args.idd the ID of the node to move + * @param {Int} args.parentId the ID of the parent node to move to + * @returns {Promise} resourcePromise object. + * + */ + move: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.parentId) { + throw "args.parentId cannot be null"; + } + if (!args.id) { + throw "args.id cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostMove"), + { + parentId: args.parentId, + id: args.id + }), + 'Failed to move content'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#copy + * @methodOf umbraco.resources.contentResource + * + * @description + * Copies a node underneath a new parentId + * + * ##usage + *
    +         * contentResource.copy({ parentId: 1244, id: 123 })
    +         *    .then(function() {
    +         *        alert("node was copied");
    +         *    }, function(err){
    +         *      alert("node wasnt copy:" + err.data.Message); 
    +         *    });
    +         * 
    + * @param {Object} args arguments object + * @param {Int} args.id the ID of the node to copy + * @param {Int} args.parentId the ID of the parent node to copy to + * @param {Boolean} args.relateToOriginal if true, relates the copy to the original through the relation api + * @returns {Promise} resourcePromise object. + * + */ + copy: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.parentId) { + throw "args.parentId cannot be null"; + } + if (!args.id) { + throw "args.id cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostCopy"), + args), + 'Failed to copy content'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#unPublish + * @methodOf umbraco.resources.contentResource + * + * @description + * Unpublishes a content item with a given Id + * + * ##usage + *
    +         * contentResource.unPublish(1234)
    +         *    .then(function() {
    +         *        alert("node was unpulished");
    +         *    }, function(err){
    +         *      alert("node wasnt unpublished:" + err.data.Message); 
    +         *    });
    +         * 
    + * @param {Int} id the ID of the node to unpublish + * @returns {Promise} resourcePromise object. + * + */ + unPublish: function (id) { + if (!id) { + throw "id cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "PostUnPublish", + [{ id: id }])), + 'Failed to publish content with id ' + id); + }, + /** + * @ngdoc method + * @name umbraco.resources.contentResource#emptyRecycleBin + * @methodOf umbraco.resources.contentResource + * + * @description + * Empties the content recycle bin + * + * ##usage + *
    +         * contentResource.emptyRecycleBin()
    +         *    .then(function() {
    +         *        alert('its empty!');
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object. + * + */ + emptyRecycleBin: function() { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "EmptyRecycleBin")), + 'Failed to empty the recycle bin'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#deleteById + * @methodOf umbraco.resources.contentResource + * + * @description + * Deletes a content item with a given id + * + * ##usage + *
    +         * contentResource.deleteById(1234)
    +         *    .then(function() {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of content item to delete + * @returns {Promise} resourcePromise object. + * + */ + deleteById: function(id) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "DeleteById", + [{ id: id }])), + 'Failed to delete item ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getById + * @methodOf umbraco.resources.contentResource + * + * @description + * Gets a content item with a given id + * + * ##usage + *
    +         * contentResource.getById(1234)
    +         *    .then(function(content) {
    +         *        var myDoc = content; 
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of content item to return + * @returns {Promise} resourcePromise object containing the content item. + * + */ + getById: function (id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetById", + [{ id: id }])), + 'Failed to retrieve data for content id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getByIds + * @methodOf umbraco.resources.contentResource + * + * @description + * Gets an array of content items, given a collection of ids + * + * ##usage + *
    +         * contentResource.getByIds( [1234,2526,28262])
    +         *    .then(function(contentArray) {
    +         *        var myDoc = contentArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {Array} ids ids of content items to return as an array + * @returns {Promise} resourcePromise object containing the content items array. + * + */ + getByIds: function (ids) { + + var idQuery = ""; + _.each(ids, function(item) { + idQuery += "ids=" + item + "&"; + }); + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetByIds", + idQuery)), + 'Failed to retrieve data for content with multiple ids'); + }, + + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getScaffold + * @methodOf umbraco.resources.contentResource + * + * @description + * Returns a scaffold of an empty content item, given the id of the content item to place it underneath and the content type alias. + * + * - Parent Id must be provided so umbraco knows where to store the content + * - Content Type alias must be provided so umbraco knows which properties to put on the content scaffold + * + * The scaffold is used to build editors for content that has not yet been populated with data. + * + * ##usage + *
    +         * contentResource.getScaffold(1234, 'homepage')
    +         *    .then(function(scaffold) {
    +         *        var myDoc = scaffold;
    +         *        myDoc.name = "My new document"; 
    +         *
    +         *        contentResource.publish(myDoc, true)
    +         *            .then(function(content){
    +         *                alert("Retrieved, updated and published again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Int} parentId id of content item to return + * @param {String} alias contenttype alias to base the scaffold on + * @returns {Promise} resourcePromise object containing the content scaffold. + * + */ + getScaffold: function (parentId, alias) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetEmpty", + [{ contentTypeAlias: alias }, { parentId: parentId }])), + 'Failed to retrieve data for empty content item type ' + alias); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getNiceUrl + * @methodOf umbraco.resources.contentResource + * + * @description + * Returns a url, given a node ID + * + * ##usage + *
    +         * contentResource.getNiceUrl(id)
    +         *    .then(function(url) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id Id of node to return the public url to + * @returns {Promise} resourcePromise object containing the url. + * + */ + getNiceUrl: function (id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetNiceUrl",[{id: id}])), + 'Failed to retrieve url for id:' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getChildren + * @methodOf umbraco.resources.contentResource + * + * @description + * Gets children of a content item with a given id + * + * ##usage + *
    +         * contentResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
    +         *    .then(function(contentArray) {
    +         *        var children = contentArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {Int} parentid id of content item to return children of + * @param {Object} options optional options object + * @param {Int} options.pageSize if paging data, number of nodes per page, default = 0 + * @param {Int} options.pageNumber if paging data, current page index, default = 0 + * @param {String} options.filter if provided, query will only return those with names matching the filter + * @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Ascending` + * @param {String} options.orderBy property to order items by, default: `SortOrder` + * @returns {Promise} resourcePromise object containing an array of content items. + * + */ + getChildren: function (parentId, options) { + + var defaults = { + pageSize: 0, + pageNumber: 0, + filter: '', + orderDirection: "Ascending", + orderBy: "SortOrder" + }; + if (options === undefined) { + options = {}; + } + //overwrite the defaults if there are any specified + angular.extend(defaults, options); + //now copy back to the options we will use + options = defaults; + //change asc/desct + if (options.orderDirection === "asc") { + options.orderDirection = "Ascending"; + } + else if (options.orderDirection === "desc") { + options.orderDirection = "Descending"; + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetChildren", + [ + { id: parentId }, + { pageNumber: options.pageNumber }, + { pageSize: options.pageSize }, + { orderBy: options.orderBy }, + { orderDirection: options.orderDirection }, + { filter: options.filter } + ])), + 'Failed to retrieve children for content item ' + parentId); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#hasPermission + * @methodOf umbraco.resources.contentResource + * + * @description + * Returns true/false given a permission char to check against a nodeID + * for the current user + * + * ##usage + *
    +         * contentResource.hasPermission('p',1234)
    +         *    .then(function() {
    +         *        alert('You are allowed to publish this item');
    +         *    });
    +         * 
    + * + * @param {String} permission char representing the permission to check + * @param {Int} id id of content item to delete + * @returns {Promise} resourcePromise object. + * + */ + checkPermission: function(permission, id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetHasPermission", + [{ permissionToCheck: permission },{ nodeId: id }])), + 'Failed to check permission for item ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#save + * @methodOf umbraco.resources.contentResource + * + * @description + * Saves changes made to a content item to its current version, if the content item is new, the isNew paramater must be passed to force creation + * if the content item needs to have files attached, they must be provided as the files param and passed seperately + * + * + * ##usage + *
    +         * contentResource.getById(1234)
    +         *    .then(function(content) {
    +         *          content.name = "I want a new name!";
    +         *          contentResource.save(content, false)
    +         *            .then(function(content){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Object} content The content item object with changes applied + * @param {Bool} isNew set to true to create a new item or to update an existing + * @param {Array} files collection of files for the document + * @returns {Promise} resourcePromise object containing the saved content item. + * + */ + save: function (content, isNew, files) { + return saveContentItem(content, "save" + (isNew ? "New" : ""), files); + }, + + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#publish + * @methodOf umbraco.resources.contentResource + * + * @description + * Saves and publishes changes made to a content item to a new version, if the content item is new, the isNew paramater must be passed to force creation + * if the content item needs to have files attached, they must be provided as the files param and passed seperately + * + * + * ##usage + *
    +         * contentResource.getById(1234)
    +         *    .then(function(content) {
    +         *          content.name = "I want a new name, and be published!";
    +         *          contentResource.publish(content, false)
    +         *            .then(function(content){
    +         *                alert("Retrieved, updated and published again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Object} content The content item object with changes applied + * @param {Bool} isNew set to true to create a new item or to update an existing + * @param {Array} files collection of files for the document + * @returns {Promise} resourcePromise object containing the saved content item. + * + */ + publish: function (content, isNew, files) { + return saveContentItem(content, "publish" + (isNew ? "New" : ""), files); + }, + + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#sendToPublish + * @methodOf umbraco.resources.contentResource + * + * @description + * Saves changes made to a content item, and notifies any subscribers about a pending publication + * + * ##usage + *
    +         * contentResource.getById(1234)
    +         *    .then(function(content) {
    +         *          content.name = "I want a new name, and be published!";
    +         *          contentResource.sendToPublish(content, false)
    +         *            .then(function(content){
    +         *                alert("Retrieved, updated and notication send off");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Object} content The content item object with changes applied + * @param {Bool} isNew set to true to create a new item or to update an existing + * @param {Array} files collection of files for the document + * @returns {Promise} resourcePromise object containing the saved content item. + * + */ + sendToPublish: function (content, isNew, files) { + return saveContentItem(content, "sendPublish" + (isNew ? "New" : ""), files); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#publishByid + * @methodOf umbraco.resources.contentResource + * + * @description + * Publishes a content item with a given ID + * + * ##usage + *
    +         * contentResource.publishById(1234)
    +         *    .then(function(content) {
    +         *        alert("published");
    +         *    });
    +         * 
    + * + * @param {Int} id The ID of the conten to publish + * @returns {Promise} resourcePromise object containing the published content item. + * + */ + publishById: function(id){ + + if (!id) { + throw "id cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "PostPublishById", + [{ id: id }])), + 'Failed to publish content with id ' + id); + + } + + + }; +} + +angular.module('umbraco.resources').factory('contentResource', contentResource); + +/** + * @ngdoc service + * @name umbraco.resources.contentTypeResource + * @description Loads in data for content types + **/ +function contentTypeResource($q, $http, umbRequestHelper) { + + return { + + /** + * @ngdoc method + * @name umbraco.resources.contentTypeResource#getContentType + * @methodOf umbraco.resources.contentTypeResource + * + * @description + * Returns a content type with a given ID + * + * ##usage + *
    +         * contentTypeResource.getContentType(1234)
    +         *    .then(function(type) {
    +         *        $scope.type = type;
    +         *    });
    +         * 
    + * @param {Int} id id of the content type to retrieve + * @returns {Promise} resourcePromise object. + * + */ + getContentType: function (id) { + + var deferred = $q.defer(); + var data = { + name: "News Article", + alias: "newsArticle", + id: id, + tabs: [] + }; + + deferred.resolve(data); + return deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentTypeResource#getAllowedTypes + * @methodOf umbraco.resources.contentTypeResource + * + * @description + * Returns a list of allowed content types underneath a content item with a given ID + * + * ##usage + *
    +         * contentTypeResource.getAllowedTypes(1234)
    +         *    .then(function(array) {
    +         *        $scope.type = type;
    +         *    });
    +         * 
    + * @param {Int} contentId id of the content item to retrive allowed child types for + * @returns {Promise} resourcePromise object. + * + */ + getAllowedTypes: function (contentId) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAllowedChildren", + [{ contentId: contentId }])), + 'Failed to retrieve data for content id ' + contentId); + } + + }; +} +angular.module('umbraco.resources').factory('contentTypeResource', contentTypeResource); + +/** + * @ngdoc service + * @name umbraco.resources.currentUserResource + * @description Used for read/updates for the currently logged in user + * + * + **/ +function currentUserResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.currentUserResource#changePassword + * @methodOf umbraco.resources.currentUserResource + * + * @description + * Changes the current users password + * + * @returns {Promise} resourcePromise object containing the user array. + * + */ + changePassword: function (changePasswordArgs) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "currentUserApiBaseUrl", + "PostChangePassword"), + changePasswordArgs), + 'Failed to change password'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.currentUserResource#getMembershipProviderConfig + * @methodOf umbraco.resources.currentUserResource + * + * @description + * Gets the configuration of the user membership provider which is used to configure the change password form + */ + getMembershipProviderConfig: function () { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "currentUserApiBaseUrl", + "GetMembershipProviderConfig")), + 'Failed to retrieve membership provider config'); + }, + }; +} + +angular.module('umbraco.resources').factory('currentUserResource', currentUserResource); + +/** + * @ngdoc service + * @name umbraco.resources.dashboardResource + * @description Handles loading the dashboard manifest + **/ +function dashboardResource($q, $http, umbRequestHelper) { + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.dashboardResource#getDashboard + * @methodOf umbraco.resources.dashboardResource + * + * @description + * Retrieves the dashboard configuration for a given section + * + * @param {string} section Alias of section to retrieve dashboard configuraton for + * @returns {Promise} resourcePromise object containing the user array. + * + */ + getDashboard: function (section) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "dashboardApiBaseUrl", + "GetDashboard", + [{ section: section }])), + 'Failed to get dashboard ' + section); + } + }; +} + +angular.module('umbraco.resources').factory('dashboardResource', dashboardResource); +/** + * @ngdoc service + * @name umbraco.resources.dataTypeResource + * @description Loads in data for data types + **/ +function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) { + + return { + + /** + * @ngdoc method + * @name umbraco.resources.dataTypeResource#getPreValues + * @methodOf umbraco.resources.dataTypeResource + * + * @description + * Retrieves available prevalues for a given data type + editor + * + * ##usage + *
    +         * dataTypeResource.getPrevalyes("Umbraco.MediaPicker", 1234)
    +         *    .then(function(prevalues) {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {String} editorAlias string alias of editor type to retrive prevalues configuration for + * @param {Int} id id of datatype to retrieve prevalues for + * @returns {Promise} resourcePromise object. + * + */ + getPreValues: function (editorAlias, dataTypeId) { + + if (!dataTypeId) { + dataTypeId = -1; + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "dataTypeApiBaseUrl", + "GetPreValues", + [{ editorAlias: editorAlias }, { dataTypeId: dataTypeId }])), + 'Failed to retrieve pre values for editor alias ' + editorAlias); + }, + + /** + * @ngdoc method + * @name umbraco.resources.dataTypeResource#getById + * @methodOf umbraco.resources.dataTypeResource + * + * @description + * Gets a data type item with a given id + * + * ##usage + *
    +         * dataTypeResource.getById(1234)
    +         *    .then(function() {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of data type to retrieve + * @returns {Promise} resourcePromise object. + * + */ + getById: function (id) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "dataTypeApiBaseUrl", + "GetById", + [{ id: id }])), + 'Failed to retrieve data for data type id ' + id); + }, + + getAll: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "dataTypeApiBaseUrl", + "GetAll")), + 'Failed to retrieve data'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.contentResource#getScaffold + * @methodOf umbraco.resources.contentResource + * + * @description + * Returns a scaffold of an empty data type item + * + * The scaffold is used to build editors for data types that has not yet been populated with data. + * + * ##usage + *
    +         * dataTypeResource.getScaffold()
    +         *    .then(function(scaffold) {
    +         *        var myType = scaffold;
    +         *        myType.name = "My new data type"; 
    +         *
    +         *        dataTypeResource.save(myType, myType.preValues, true)
    +         *            .then(function(type){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object containing the data type scaffold. + * + */ + getScaffold: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "dataTypeApiBaseUrl", + "GetEmpty")), + 'Failed to retrieve data for empty datatype'); + }, + /** + * @ngdoc method + * @name umbraco.resources.dataTypeResource#deleteById + * @methodOf umbraco.resources.dataTypeResource + * + * @description + * Deletes a data type with a given id + * + * ##usage + *
    +         * dataTypeResource.deleteById(1234)
    +         *    .then(function() {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of content item to delete + * @returns {Promise} resourcePromise object. + * + */ + deleteById: function(id) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "dataTypeApiBaseUrl", + "DeleteById", + [{ id: id }])), + 'Failed to delete item ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.dataTypeResource#deleteById + * @methodOf umbraco.resources.dataTypeResource + * + * @description + * Saves or update a data typw + * + * ##usage + *
    +         * dataTypeResource.getById(1234)
    +         *    .then(function(type) {
    +         *        type.name ="hibba";
    +         *  
    +         *        dataTypeResource.save(type, type.preValues, false).then(function(type){
    +         *          alert('its done!');
    +         *        }): 
    +         *    });
    +         * 
    + * + * @param {Object} dataType data type object to create/update + * @param {Array} preValues collection of prevalues on the datatype + * @param {Bool} isNew set to true if type should be create instead of updated + * @returns {Promise} resourcePromise object. + * + */ + save: function (dataType, preValues, isNew) { + + var saveModel = umbDataFormatter.formatDataTypePostData(dataType, preValues, "save" + (isNew ? "New" : "")); + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("dataTypeApiBaseUrl", "PostSave"), saveModel), + 'Failed to save data for data type id ' + dataType.id); + } + }; +} + +angular.module('umbraco.resources').factory('dataTypeResource', dataTypeResource); + +/** + * @ngdoc service + * @name umbraco.resources.entityResource + * @description Loads in basic data for all entities + * + * ##What is an entity? + * An entity is a basic **read-only** representation of an Umbraco node. It contains only the most + * basic properties used to display the item in trees, lists and navigation. + * + * ##What is the difference between entity and content/media/etc...? + * the entity only contains the basic node data, name, id and guid, whereas content + * nodes fetched through the content service also contains additional all of the content property data, etc.. + * This is the same principal for all entity types. Any user that is logged in to the back office will have access + * to view the basic entity information for all entities since the basic entity information does not contain sensitive information. + * + * ##Entity object types? + * You need to specify the type of object you want returned. + * + * The core object types are: + * + * - Document + * - Media + * - Member + * - Template + * - DocumentType + * - MediaType + * - MemberType + * - Macro + * - User + * - Language + * - Domain + **/ +function entityResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getPath + * @methodOf umbraco.resources.entityResource + * + * @description + * Returns a path, given a node ID and type + * + * ##usage + *
    +         * entityResource.getPath(id)
    +         *    .then(function(pathArray) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id Id of node to return the public url to + * @param {string} type Object type name + * @returns {Promise} resourcePromise object containing the url. + * + */ + getPath: function (id, type) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetPath", + [{ id: id }, {type: type }])), + 'Failed to retrieve path for id:' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getById + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets an entity with a given id + * + * ##usage + *
    +         * //get media by id
    +         * entityResource.getEntityById(0, "Media")
    +         *    .then(function(ent) {
    +         *        var myDoc = ent; 
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of entity to return + * @param {string} type Object type name + * @returns {Promise} resourcePromise object containing the entity. + * + */ + getById: function (id, type) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetById", + [{ id: id}, {type: type }])), + 'Failed to retrieve entity data for id ' + id); + }, + + getByQuery: function (query, nodeContextId, type) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetByQuery", + [{query: query},{ nodeContextId: nodeContextId}, {type: type }])), + 'Failed to retrieve entity data for query ' + query); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getByIds + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets an array of entities, given a collection of ids + * + * ##usage + *
    +         * //Get templates for ids
    +         * entityResource.getEntitiesByIds( [1234,2526,28262], "Template")
    +         *    .then(function(templateArray) {
    +         *        var myDoc = contentArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {Array} ids ids of entities to return as an array + * @param {string} type type name + * @returns {Promise} resourcePromise object containing the entity array. + * + */ + getByIds: function (ids, type) { + + var query = ""; + _.each(ids, function(item) { + query += "ids=" + item + "&"; + }); + query += "type=" + type; + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetByIds", + query)), + 'Failed to retrieve entity data for ids ' + ids); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getEntityById + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets an entity with a given id + * + * ##usage + *
    +         *
    +         * //Only return media
    +         * entityResource.getAll("Media")
    +         *    .then(function(ent) {
    +         *        var myDoc = ent; 
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {string} type Object type name + * @param {string} postFilter optional filter expression which will execute a dynamic where clause on the server + * @param {string} postFilterParams optional parameters for the postFilter expression + * @returns {Promise} resourcePromise object containing the entity. + * + */ + getAll: function (type, postFilter, postFilterParams) { + + //need to build the query string manually + var query = "type=" + type + "&postFilter=" + (postFilter ? postFilter : ""); + if (postFilter && postFilterParams) { + var counter = 0; + _.each(postFilterParams, function(val, key) { + query += "&postFilterParams[" + counter + "].key=" + key + "&postFilterParams[" + counter + "].value=" + val; + counter++; + }); + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetAll", + query)), + 'Failed to retrieve entity data for type ' + type); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getAncestors + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets ancestor entities for a given item + * + * + * @param {string} type Object type name + * @returns {Promise} resourcePromise object containing the entity. + * + */ + getAncestors: function (id, type) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetAncestors", + [{id: id}, {type: type}])), + 'Failed to retrieve ancestor data for id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#getAncestors + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets children entities for a given item + * + * + * @param {string} type Object type name + * @returns {Promise} resourcePromise object containing the entity. + * + */ + getChildren: function (id, type) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "GetChildren", + [{ id: id }, { type: type }])), + 'Failed to retrieve child data for id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#searchMedia + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets an array of entities, given a lucene query and a type + * + * ##usage + *
    +         * entityResource.search("news", "Media")
    +         *    .then(function(mediaArray) {
    +         *        var myDoc = mediaArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {String} Query search query + * @param {String} Type type of conten to search + * @returns {Promise} resourcePromise object containing the entity array. + * + */ + search: function (query, type) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "Search", + [{ query: query }, {type: type}])), + 'Failed to retrieve entity data for query ' + query); + }, + + + /** + * @ngdoc method + * @name umbraco.resources.entityResource#searchAll + * @methodOf umbraco.resources.entityResource + * + * @description + * Gets an array of entities from all available search indexes, given a lucene query + * + * ##usage + *
    +         * entityResource.searchAll("bob")
    +         *    .then(function(array) {
    +         *        var myDoc = array; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {String} Query search query + * @returns {Promise} resourcePromise object containing the entity array. + * + */ + searchAll: function (query) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "entityApiBaseUrl", + "SearchAll", + [{ query: query }])), + 'Failed to retrieve entity data for query ' + query); + } + + }; +} + +angular.module('umbraco.resources').factory('entityResource', entityResource); + +/** + * @ngdoc service + * @name umbraco.resources.legacyResource + * @description Handles legacy dialog requests + **/ +function legacyResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + /** Loads in the data to display the section list */ + deleteItem: function (args) { + + if (!args.nodeId || !args.nodeType || !args.alias) { + throw "The args parameter is not formatted correct, it requires properties: nodeId, nodeType, alias"; + } + + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "legacyApiBaseUrl", + "DeleteLegacyItem", + [{ nodeId: args.nodeId }, { nodeType: args.nodeType }, { alias: args.alias }])), + 'Failed to delete item ' + args.nodeId); + + } + }; +} + +angular.module('umbraco.resources').factory('legacyResource', legacyResource); +/** + * @ngdoc service + * @name umbraco.resources.logResource + * @description Retrives log history from umbraco + * + * + **/ +function logResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.logResource#getEntityLog + * @methodOf umbraco.resources.logResource + * + * @description + * Gets the log history for a give entity id + * + * ##usage + *
    +         * logResource.getEntityLog(1234)
    +         *    .then(function(log) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of entity to return log history + * @returns {Promise} resourcePromise object containing the log. + * + */ + getEntityLog: function (id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "logApiBaseUrl", + "GetEntityLog", + [{ id: id }])), + 'Failed to retrieve user data for id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.logResource#getUserLog + * @methodOf umbraco.resources.logResource + * + * @description + * Gets the current users' log history for a given type of log entry + * + * ##usage + *
    +         * logResource.getUserLog("save", new Date())
    +         *    .then(function(log) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {String} type logtype to query for + * @param {DateTime} since query the log back to this date, by defalt 7 days ago + * @returns {Promise} resourcePromise object containing the log. + * + */ + getUserLog: function (type, since) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "logApiBaseUrl", + "GetCurrentUserLog", + [{ logtype: type, sinceDate: since }])), + 'Failed to retrieve user data for id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.logResource#getLog + * @methodOf umbraco.resources.logResource + * + * @description + * Gets the log history for a given type of log entry + * + * ##usage + *
    +         * logResource.getLog("save", new Date())
    +         *    .then(function(log) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {String} type logtype to query for + * @param {DateTime} since query the log back to this date, by defalt 7 days ago + * @returns {Promise} resourcePromise object containing the log. + * + */ + getLog: function (type, since) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "logApiBaseUrl", + "GetLog", + [{ logtype: type, sinceDate: since }])), + 'Failed to retrieve user data for id ' + id); + } + }; +} + +angular.module('umbraco.resources').factory('logResource', logResource); + +/** + * @ngdoc service + * @name umbraco.resources.macroResource + * @description Deals with data for macros + * + **/ +function macroResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.macroResource#getMacroParameters + * @methodOf umbraco.resources.macroResource + * + * @description + * Gets the editable macro parameters for the specified macro alias + * + * @param {int} macroId The macro id to get parameters for + * + */ + getMacroParameters: function (macroId) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "macroApiBaseUrl", + "GetMacroParameters", + [{ macroId: macroId }])), + 'Failed to retrieve macro parameters for macro with id ' + macroId); + }, + + /** + * @ngdoc method + * @name umbraco.resources.macroResource#getMacroResult + * @methodOf umbraco.resources.macroResource + * + * @description + * Gets the result of a macro as html to display in the rich text editor + * + * @param {int} macroId The macro id to get parameters for + * @param {int} pageId The current page id + * @param {Array} macroParamDictionary A dictionary of macro parameters + * + */ + getMacroResultAsHtmlForEditor: function (macroAlias, pageId, macroParamDictionary) { + + //need to format the query string for the custom dictionary + var query = "macroAlias=" + macroAlias + "&pageId=" + pageId; + if (macroParamDictionary) { + var counter = 0; + _.each(macroParamDictionary, function (val, key) { + //check for null + val = val ? val : ""; + //need to detect if the val is a string or an object + if (!angular.isString(val)) { + //if it's not a string we'll send it through the json serializer + var json = angular.toJson(val); + //then we need to url encode it so that it's safe + val = encodeURIComponent(json); + } + else { + //we still need to encode the string, it could contain line breaks, etc... + val = encodeURIComponent(val); + } + + query += "¯oParams[" + counter + "].key=" + key + "¯oParams[" + counter + "].value=" + val; + counter++; + }); + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "macroApiBaseUrl", + "GetMacroResultAsHtmlForEditor", + query)), + 'Failed to retrieve macro result for macro with alias ' + macroAlias); + } + + }; +} + +angular.module('umbraco.resources').factory('macroResource', macroResource); + +/** + * @ngdoc service + * @name umbraco.resources.mediaResource + * @description Loads in data for media + **/ +function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) { + + /** internal method process the saving of data and post processing the result */ + function saveMediaItem(content, action, files) { + return umbRequestHelper.postSaveContent({ + restApiUrl: umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "PostSave"), + content: content, + action: action, + files: files, + dataFormatter: function (c, a) { + return umbDataFormatter.formatMediaPostData(c, a); + } + }); + } + + return { + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#sort + * @methodOf umbraco.resources.mediaResource + * + * @description + * Sorts all children below a given parent node id, based on a collection of node-ids + * + * ##usage + *
    +         * var ids = [123,34533,2334,23434];
    +         * mediaResource.sort({ sortedIds: ids })
    +         *    .then(function() {
    +         *        $scope.complete = true;
    +         *    });
    +         * 
    + * @param {Object} args arguments object + * @param {Int} args.parentId the ID of the parent node + * @param {Array} options.sortedIds array of node IDs as they should be sorted + * @returns {Promise} resourcePromise object. + * + */ + sort: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.parentId) { + throw "args.parentId cannot be null"; + } + if (!args.sortedIds) { + throw "args.sortedIds cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostSort"), + { + parentId: args.parentId, + idSortOrder: args.sortedIds + }), + 'Failed to sort media'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#move + * @methodOf umbraco.resources.mediaResource + * + * @description + * Moves a node underneath a new parentId + * + * ##usage + *
    +         * mediaResource.move({ parentId: 1244, id: 123 })
    +         *    .then(function() {
    +         *        alert("node was moved");
    +         *    }, function(err){
    +         *      alert("node didnt move:" + err.data.Message); 
    +         *    });
    +         * 
    + * @param {Object} args arguments object + * @param {Int} args.idd the ID of the node to move + * @param {Int} args.parentId the ID of the parent node to move to + * @returns {Promise} resourcePromise object. + * + */ + move: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.parentId) { + throw "args.parentId cannot be null"; + } + if (!args.id) { + throw "args.id cannot be null"; + } + + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostMove"), + { + parentId: args.parentId, + id: args.id + }), + 'Failed to move media'); + }, + + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#getById + * @methodOf umbraco.resources.mediaResource + * + * @description + * Gets a media item with a given id + * + * ##usage + *
    +         * mediaResource.getById(1234)
    +         *    .then(function(media) {
    +         *        var myMedia = media; 
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of media item to return + * @returns {Promise} resourcePromise object containing the media item. + * + */ + getById: function (id) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "GetById", + [{ id: id }])), + 'Failed to retrieve data for media id ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#deleteById + * @methodOf umbraco.resources.mediaResource + * + * @description + * Deletes a media item with a given id + * + * ##usage + *
    +         * mediaResource.deleteById(1234)
    +         *    .then(function() {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {Int} id id of media item to delete + * @returns {Promise} resourcePromise object. + * + */ + deleteById: function(id) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "DeleteById", + [{ id: id }])), + 'Failed to delete item ' + id); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#getByIds + * @methodOf umbraco.resources.mediaResource + * + * @description + * Gets an array of media items, given a collection of ids + * + * ##usage + *
    +         * mediaResource.getByIds( [1234,2526,28262])
    +         *    .then(function(mediaArray) {
    +         *        var myDoc = contentArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {Array} ids ids of media items to return as an array + * @returns {Promise} resourcePromise object containing the media items array. + * + */ + getByIds: function (ids) { + + var idQuery = ""; + _.each(ids, function(item) { + idQuery += "ids=" + item + "&"; + }); + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "GetByIds", + idQuery)), + 'Failed to retrieve data for media ids ' + ids); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#getScaffold + * @methodOf umbraco.resources.mediaResource + * + * @description + * Returns a scaffold of an empty media item, given the id of the media item to place it underneath and the media type alias. + * + * - Parent Id must be provided so umbraco knows where to store the media + * - Media Type alias must be provided so umbraco knows which properties to put on the media scaffold + * + * The scaffold is used to build editors for media that has not yet been populated with data. + * + * ##usage + *
    +         * mediaResource.getScaffold(1234, 'folder')
    +         *    .then(function(scaffold) {
    +         *        var myDoc = scaffold;
    +         *        myDoc.name = "My new media item"; 
    +         *
    +         *        mediaResource.save(myDoc, true)
    +         *            .then(function(media){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Int} parentId id of media item to return + * @param {String} alias mediatype alias to base the scaffold on + * @returns {Promise} resourcePromise object containing the media scaffold. + * + */ + getScaffold: function (parentId, alias) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "GetEmpty", + [{ contentTypeAlias: alias }, { parentId: parentId }])), + 'Failed to retrieve data for empty media item type ' + alias); + + }, + + rootMedia: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "GetRootMedia")), + 'Failed to retrieve data for root media'); + + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#getChildren + * @methodOf umbraco.resources.mediaResource + * + * @description + * Gets children of a media item with a given id + * + * ##usage + *
    +         * mediaResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
    +         *    .then(function(contentArray) {
    +         *        var children = contentArray; 
    +         *        alert('they are here!');
    +         *    });
    +         * 
    + * + * @param {Int} parentid id of content item to return children of + * @param {Object} options optional options object + * @param {Int} options.pageSize if paging data, number of nodes per page, default = 0 + * @param {Int} options.pageNumber if paging data, current page index, default = 0 + * @param {String} options.filter if provided, query will only return those with names matching the filter + * @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Ascending` + * @param {String} options.orderBy property to order items by, default: `SortOrder` + * @returns {Promise} resourcePromise object containing an array of content items. + * + */ + getChildren: function (parentId, options) { + + var defaults = { + pageSize: 0, + pageNumber: 0, + filter: '', + orderDirection: "Ascending", + orderBy: "SortOrder" + }; + if (options === undefined) { + options = {}; + } + //overwrite the defaults if there are any specified + angular.extend(defaults, options); + //now copy back to the options we will use + options = defaults; + //change asc/desct + if (options.orderDirection === "asc") { + options.orderDirection = "Ascending"; + } + else if (options.orderDirection === "desc") { + options.orderDirection = "Descending"; + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "GetChildren", + [ + { id: parentId }, + { pageNumber: options.pageNumber }, + { pageSize: options.pageSize }, + { orderBy: options.orderBy }, + { orderDirection: options.orderDirection }, + { filter: options.filter } + ])), + 'Failed to retrieve children for media item ' + parentId); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#save + * @methodOf umbraco.resources.mediaResource + * + * @description + * Saves changes made to a media item, if the media item is new, the isNew paramater must be passed to force creation + * if the media item needs to have files attached, they must be provided as the files param and passed seperately + * + * + * ##usage + *
    +         * mediaResource.getById(1234)
    +         *    .then(function(media) {
    +         *          media.name = "I want a new name!";
    +         *          mediaResource.save(media, false)
    +         *            .then(function(media){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Object} media The media item object with changes applied + * @param {Bool} isNew set to true to create a new item or to update an existing + * @param {Array} files collection of files for the media item + * @returns {Promise} resourcePromise object containing the saved media item. + * + */ + save: function (media, isNew, files) { + return saveMediaItem(media, "save" + (isNew ? "New" : ""), files); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#addFolder + * @methodOf umbraco.resources.mediaResource + * + * @description + * Shorthand for adding a media item of the type "Folder" under a given parent ID + * + * ##usage + *
    +         * mediaResource.addFolder("My gallery", 1234)
    +         *    .then(function(folder) {
    +         *        alert('New folder');
    +         *    });
    +         * 
    + * + * @param {string} name Name of the folder to create + * @param {int} parentId Id of the media item to create the folder underneath + * @returns {Promise} resourcePromise object. + * + */ + addFolder: function(name, parentId){ + return umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper + .getApiUrl("mediaApiBaseUrl", "PostAddFolder"), + { + name: name, + parentId: parentId + }), + 'Failed to add folder'); + }, + + /** + * @ngdoc method + * @name umbraco.resources.mediaResource#emptyRecycleBin + * @methodOf umbraco.resources.mediaResource + * + * @description + * Empties the media recycle bin + * + * ##usage + *
    +         * mediaResource.emptyRecycleBin()
    +         *    .then(function() {
    +         *        alert('its empty!');
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object. + * + */ + emptyRecycleBin: function() { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "mediaApiBaseUrl", + "EmptyRecycleBin")), + 'Failed to empty the recycle bin'); + } + }; +} + +angular.module('umbraco.resources').factory('mediaResource', mediaResource); + +/** + * @ngdoc service + * @name umbraco.resources.mediaTypeResource + * @description Loads in data for media types + **/ +function mediaTypeResource($q, $http, umbRequestHelper) { + + return { + + /** + * @ngdoc method + * @name umbraco.resources.mediaTypeResource#getAllowedTypes + * @methodOf umbraco.resources.mediaTypeResource + * + * @description + * Returns a list of allowed media types underneath a media item with a given ID + * + * ##usage + *
    +         * mediaTypeResource.getAllowedTypes(1234)
    +         *    .then(function(array) {
    +         *        $scope.type = type;
    +         *    });
    +         * 
    + * @param {Int} mediaId id of the media item to retrive allowed child types for + * @returns {Promise} resourcePromise object. + * + */ + getAllowedTypes: function (mediaId) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "mediaTypeApiBaseUrl", + "GetAllowedChildren", + [{ contentId: mediaId }])), + 'Failed to retrieve allowed types for media id ' + mediaId); + } + + }; +} +angular.module('umbraco.resources').factory('mediaTypeResource', mediaTypeResource); + +/** + * @ngdoc service + * @name umbraco.resources.memberResource + * @description Loads in data for members + **/ +function memberResource($q, $http, umbDataFormatter, umbRequestHelper) { + + /** internal method process the saving of data and post processing the result */ + function saveMember(content, action, files) { + + return umbRequestHelper.postSaveContent({ + restApiUrl: umbRequestHelper.getApiUrl( + "memberApiBaseUrl", + "PostSave"), + content: content, + action: action, + files: files, + dataFormatter: function(c, a) { + return umbDataFormatter.formatMemberPostData(c, a); + } + }); + } + + return { + + + /** + * @ngdoc method + * @name umbraco.resources.memberResource#getByKey + * @methodOf umbraco.resources.memberResource + * + * @description + * Gets a member item with a given key + * + * ##usage + *
    +         * memberResource.getByKey("0000-0000-000-00000-000")
    +         *    .then(function(member) {
    +         *        var mymember = member; 
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @param {Guid} key key of member item to return + * @returns {Promise} resourcePromise object containing the member item. + * + */ + getByKey: function (key) { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "memberApiBaseUrl", + "GetByKey", + [{ key: key }])), + 'Failed to retrieve data for member id ' + key); + }, + + /** + * @ngdoc method + * @name umbraco.resources.memberResource#deleteByKey + * @methodOf umbraco.resources.memberResource + * + * @description + * Deletes a member item with a given key + * + * ##usage + *
    +         * memberResource.deleteByKey("0000-0000-000-00000-000")
    +         *    .then(function() {
    +         *        alert('its gone!');
    +         *    });
    +         * 
    + * + * @param {Guid} key id of member item to delete + * @returns {Promise} resourcePromise object. + * + */ + deleteByKey: function (key) { + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "memberApiBaseUrl", + "DeleteByKey", + [{ key: key }])), + 'Failed to delete item ' + key); + }, + + /** + * @ngdoc method + * @name umbraco.resources.memberResource#getScaffold + * @methodOf umbraco.resources.memberResource + * + * @description + * Returns a scaffold of an empty member item, given the id of the member item to place it underneath and the member type alias. + * + * - Member Type alias must be provided so umbraco knows which properties to put on the member scaffold + * + * The scaffold is used to build editors for member that has not yet been populated with data. + * + * ##usage + *
    +         * memberResource.getScaffold('client')
    +         *    .then(function(scaffold) {
    +         *        var myDoc = scaffold;
    +         *        myDoc.name = "My new member item"; 
    +         *
    +         *        memberResource.save(myDoc, true)
    +         *            .then(function(member){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {String} alias membertype alias to base the scaffold on + * @returns {Promise} resourcePromise object containing the member scaffold. + * + */ + getScaffold: function (alias) { + + if (alias) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "memberApiBaseUrl", + "GetEmpty", + [{ contentTypeAlias: alias }])), + 'Failed to retrieve data for empty member item type ' + alias); + } + else { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "memberApiBaseUrl", + "GetEmpty")), + 'Failed to retrieve data for empty member item type ' + alias); + } + + }, + + /** + * @ngdoc method + * @name umbraco.resources.memberResource#save + * @methodOf umbraco.resources.memberResource + * + * @description + * Saves changes made to a member, if the member is new, the isNew paramater must be passed to force creation + * if the member needs to have files attached, they must be provided as the files param and passed seperately + * + * + * ##usage + *
    +         * memberResource.getBykey("23234-sd8djsd-3h8d3j-sdh8d")
    +         *    .then(function(member) {
    +         *          member.name = "Bob";
    +         *          memberResource.save(member, false)
    +         *            .then(function(member){
    +         *                alert("Retrieved, updated and saved again");
    +         *            });
    +         *    });
    +         * 
    + * + * @param {Object} media The member item object with changes applied + * @param {Bool} isNew set to true to create a new item or to update an existing + * @param {Array} files collection of files for the media item + * @returns {Promise} resourcePromise object containing the saved media item. + * + */ + save: function (member, isNew, files) { + return saveMember(member, "save" + (isNew ? "New" : ""), files); + } + }; +} + +angular.module('umbraco.resources').factory('memberResource', memberResource); + +/** + * @ngdoc service + * @name umbraco.resources.memberTypeResource + * @description Loads in data for member types + **/ +function memberTypeResource($q, $http, umbRequestHelper) { + + return { + + //return all member types + getTypes: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "memberTypeApiBaseUrl", + "GetAllTypes")), + 'Failed to retrieve data for member types id'); + } + + }; +} +angular.module('umbraco.resources').factory('memberTypeResource', memberTypeResource); + +/** + * @ngdoc service + * @name umbraco.resources.sectionResource + * @description Loads in data for section + **/ +function sectionResource($q, $http, umbRequestHelper) { + + /** internal method to get the tree app url */ + function getSectionsUrl(section) { + return Umbraco.Sys.ServerVariables.sectionApiBaseUrl + "GetSections"; + } + + //the factory object returned + return { + /** Loads in the data to display the section list */ + getSections: function () { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "sectionApiBaseUrl", + "GetSections")), + 'Failed to retrieve data for sections'); + + } + }; +} + +angular.module('umbraco.resources').factory('sectionResource', sectionResource); + +/** + * @ngdoc service + * @name umbraco.resources.stylesheetResource + * @description service to retrieve available stylesheets + * + * + **/ +function stylesheetResource($q, $http, umbRequestHelper) { + + //the factory object returned + return { + + /** + * @ngdoc method + * @name umbraco.resources.stylesheetResource#getAll + * @methodOf umbraco.resources.stylesheetResource + * + * @description + * Gets all registered stylesheets + * + * ##usage + *
    +         * stylesheetResource.getAll()
    +         *    .then(function(stylesheets) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object containing the stylesheets. + * + */ + getAll: function () { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "stylesheetApiBaseUrl", + "GetAll")), + 'Failed to retrieve stylesheets '); + }, + + /** + * @ngdoc method + * @name umbraco.resources.stylesheetResource#getRules + * @methodOf umbraco.resources.stylesheetResource + * + * @description + * Returns all defined child rules for a stylesheet with a given ID + * + * ##usage + *
    +         * stylesheetResource.getRules(2345)
    +         *    .then(function(rules) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object containing the rules. + * + */ + getRules: function (id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "stylesheetApiBaseUrl", + "GetRules", + [{ id: id }])), + 'Failed to retrieve stylesheets '); + }, + + /** + * @ngdoc method + * @name umbraco.resources.stylesheetResource#getRulesByName + * @methodOf umbraco.resources.stylesheetResource + * + * @description + * Returns all defined child rules for a stylesheet with a given name + * + * ##usage + *
    +         * stylesheetResource.getRulesByName("ie7stylesheet")
    +         *    .then(function(rules) {
    +         *        alert('its here!');
    +         *    });
    +         * 
    + * + * @returns {Promise} resourcePromise object containing the rules. + * + */ + getRulesByName: function (name) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "stylesheetApiBaseUrl", + "GetRulesByName", + [{ name: name }])), + 'Failed to retrieve stylesheets '); + } + }; +} + +angular.module('umbraco.resources').factory('stylesheetResource', stylesheetResource); + +/** + * @ngdoc service + * @name umbraco.resources.treeResource + * @description Loads in data for trees + **/ +function treeResource($q, $http, umbRequestHelper) { + + /** internal method to get the tree node's children url */ + function getTreeNodesUrl(node) { + if (!node.childNodesUrl) { + throw "No childNodesUrl property found on the tree node, cannot load child nodes"; + } + return node.childNodesUrl; + } + + /** internal method to get the tree menu url */ + function getTreeMenuUrl(node) { + if (!node.menuUrl) { + throw "No menuUrl property found on the tree node, cannot load menu"; + } + return node.menuUrl; + } + + //the factory object returned + return { + + /** Loads in the data to display the nodes menu */ + loadMenu: function (node) { + + return umbRequestHelper.resourcePromise( + $http.get(getTreeMenuUrl(node)), + "Failed to retrieve data for a node's menu " + node.id); + }, + + /** Loads in the data to display the nodes for an application */ + loadApplication: function (options) { + + if (!options || !options.section) { + throw "The object specified for does not contain a 'section' property"; + } + + if(!options.tree){ + options.tree = ""; + } + if (!options.isDialog) { + options.isDialog = false; + } + + //create the query string for the tree request, these are the mandatory options: + var query = "application=" + options.section + "&tree=" + options.tree + "&isDialog=" + options.isDialog; + + //the options can contain extra query string parameters + if (options.queryString) { + query += "&" + options.queryString; + } + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "treeApplicationApiBaseUrl", + "GetApplicationTrees", + query)), + 'Failed to retrieve data for application tree ' + options.section); + }, + + /** Loads in the data to display the child nodes for a given node */ + loadNodes: function (options) { + + if (!options || !options.node) { + throw "The options parameter object does not contain the required properties: 'node'"; + } + + return umbRequestHelper.resourcePromise( + $http.get(getTreeNodesUrl(options.node)), + 'Failed to retrieve data for child nodes ' + options.node.nodeId); + } + }; +} + +angular.module('umbraco.resources').factory('treeResource', treeResource); + + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.security.js b/OurUmbraco.Site/umbraco/js/umbraco.security.js new file mode 100644 index 00000000..c2fcc8ec --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.security.js @@ -0,0 +1,161 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + +// Based loosely around work by Witold Szczerba - https://github.com/witoldsz/angular-http-auth +angular.module('umbraco.security', [ + 'umbraco.security.retryQueue', + 'umbraco.security.interceptor']); +angular.module('umbraco.security.interceptor', ['umbraco.security.retryQueue']) + // This http interceptor listens for authentication successes and failures + .factory('securityInterceptor', ['$injector', 'securityRetryQueue', 'notificationsService', function ($injector, queue, notifications) { + return function(promise) { + + return promise.then( + function(originalResponse) { + // Intercept successful requests + + //Here we'll check if our custom header is in the response which indicates how many seconds the user's session has before it + //expires. Then we'll update the user in the user service accordingly. + var headers = originalResponse.headers(); + if (headers["x-umb-user-seconds"]) { + // We must use $injector to get the $http service to prevent circular dependency + var userService = $injector.get('userService'); + userService.setUserTimeout(headers["x-umb-user-seconds"]); + } + + return promise; + }, function(originalResponse) { + // Intercept failed requests + + //A 401 means that the user is not logged in + if (originalResponse.status === 401) { + + // The request bounced because it was not authorized - add a new request to the retry queue + promise = queue.pushRetryFn('unauthorized-server', function retryRequest() { + // We must use $injector to get the $http service to prevent circular dependency + return $injector.get('$http')(originalResponse.config); + }); + } + else if (originalResponse.status === 404) { + + //a 404 indicates that the request was not found - this could be due to a non existing url, or it could + //be due to accessing a url with a parameter that doesn't exist, either way we should notifiy the user about it + + var errMsg = "The URL returned a 404 (not found):
    " + originalResponse.config.url.split('?')[0] + ""; + if (originalResponse.data && originalResponse.data.ExceptionMessage) { + errMsg += "
    with error:
    " + originalResponse.data.ExceptionMessage + ""; + } + if (originalResponse.config.data) { + errMsg += "
    with data:
    " + angular.toJson(originalResponse.config.data) + "
    Contact your administrator for information."; + } + + notifications.error( + "Request error", + errMsg); + + } + else if (originalResponse.status === 403) { + //if the status was a 403 it means the user didn't have permission to do what the request was trying to do. + //How do we deal with this now, need to tell the user somehow that they don't have permission to do the thing that was + //requested. We can either deal with this globally here, or we can deal with it globally for individual requests on the umbRequestHelper, + // or completely custom for services calling resources. + + //http://issues.umbraco.org/issue/U4-2749 + + //It was decided to just put these messages into the normal status messages. + + var msg = "Unauthorized access to URL:
    " + originalResponse.config.url.split('?')[0] + ""; + if (originalResponse.config.data) { + msg += "
    with data:
    " + angular.toJson(originalResponse.config.data) + "
    Contact your administrator for information."; + } + + notifications.error( + "Authorization error", + msg); + } + + return promise; + }); + }; + }]) + + // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. + .config(['$httpProvider', function ($httpProvider) { + $httpProvider.responseInterceptors.push('securityInterceptor'); + }]); +angular.module('umbraco.security.retryQueue', []) + +// This is a generic retry queue for security failures. Each item is expected to expose two functions: retry and cancel. +.factory('securityRetryQueue', ['$q', '$log', function ($q, $log) { + + var retryQueue = []; + var service = { + // The security service puts its own handler in here! + onItemAddedCallbacks: [], + + hasMore: function() { + return retryQueue.length > 0; + }, + push: function(retryItem) { + retryQueue.push(retryItem); + // Call all the onItemAdded callbacks + angular.forEach(service.onItemAddedCallbacks, function(cb) { + try { + cb(retryItem); + } catch(e) { + $log.error('securityRetryQueue.push(retryItem): callback threw an error' + e); + } + }); + }, + pushRetryFn: function(reason, retryFn) { + // The reason parameter is optional + if ( arguments.length === 1) { + retryFn = reason; + reason = undefined; + } + + // The deferred object that will be resolved or rejected by calling retry or cancel + var deferred = $q.defer(); + var retryItem = { + reason: reason, + retry: function() { + // Wrap the result of the retryFn into a promise if it is not already + $q.when(retryFn()).then(function(value) { + // If it was successful then resolve our deferred + deferred.resolve(value); + }, function(value) { + // Othewise reject it + deferred.reject(value); + }); + }, + cancel: function() { + // Give up on retrying and reject our deferred + deferred.reject(); + } + }; + service.push(retryItem); + return deferred.promise; + }, + retryReason: function() { + return service.hasMore() && retryQueue[0].reason; + }, + cancelAll: function() { + while(service.hasMore()) { + retryQueue.shift().cancel(); + } + }, + retryAll: function() { + while(service.hasMore()) { + retryQueue.shift().retry(); + } + } + }; + return service; +}]); + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.servervariables.js b/OurUmbraco.Site/umbraco/js/umbraco.servervariables.js new file mode 100644 index 00000000..03901d03 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.servervariables.js @@ -0,0 +1,45 @@ +//create the namespace (NOTE: This loads before any dependencies so we don't have a namespace mgr so we just create it manually) +var Umbraco = {}; +Umbraco.Sys = {}; +//define a global static object +Umbraco.Sys.ServerVariables = { + umbracoUrls: { + "contentApiBaseUrl": "/umbraco/UmbracoApi/Content/", + "mediaApiBaseUrl": "/umbraco/UmbracoApi/Media/", + "dataTypeApiBaseUrl": "/umbraco/UmbracoApi/DataType/", + "sectionApiBaseUrl": "/umbraco/UmbracoApi/Section/", + "treeApplicationApiBaseUrl": "/umbraco/UmbracoTrees/ApplicationTreeApi/", + "contentTypeApiBaseUrl": "/umbraco/Api/ContentType/", + "mediaTypeApiBaseUrl": "/umbraco/Api/MediaType/", + "macroApiBaseUrl": "/umbraco/Api/Macro/", + "authenticationApiBaseUrl": "/umbraco/UmbracoApi/Authentication/", + //For this we'll just provide a file that exists during the mock session since we don't really have legay js tree stuff + "legacyTreeJs": "/belle/lib/lazyload/empty.js", + "serverVarsJs": "/belle/lib/lazyload/empty.js", + "imagesApiBaseUrl": "/umbraco/UmbracoApi/Images/", + "entityApiBaseUrl": "/umbraco/UmbracoApi/Entity/", + "dashboardApiBaseUrl": "/umbraco/UmbracoApi/Dashboard/", + "updateCheckApiBaseUrl": "/umbraco/Api/UpdateCheck/", + "rteApiBaseUrl": "/umbraco/UmbracoApi/RichTextPreValue/" + }, + umbracoSettings: { + "umbracoPath": "/umbraco", + "appPluginsPath" : "/App_Plugins", + "imageFileTypes": "jpeg,jpg,gif,bmp,png,tiff,tif", + "keepUserLoggedIn": true + }, + umbracoPlugins: { + trees: [ + { alias: "myTree", packageFolder: "MyPackage" } + ] + }, + security : { + startContentId: -1, + startMediaId: -1 + }, + isDebuggingEnabled: true, + application: { + assemblyVersion: "1", + version: "7" + } +}; \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.services.js b/OurUmbraco.Site/umbraco/js/umbraco.services.js new file mode 100644 index 00000000..8cd69933 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.services.js @@ -0,0 +1,7958 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + +angular.module("umbraco.services", ["umbraco.security", "umbraco.resources"]); + +/** + * @ngdoc service + * @name umbraco.services.angularHelper + * @function + * + * @description + * Some angular helper/extension methods + */ +function angularHelper($log, $q) { + return { + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#rejectedPromise + * @methodOf umbraco.services.angularHelper + * @function + * + * @description + * In some situations we need to return a promise as a rejection, normally based on invalid data. This + * is a wrapper to do that so we can save on writing a bit of code. + * + * @param {object} objReject The object to send back with the promise rejection + */ + rejectedPromise: function (objReject) { + var deferred = $q.defer(); + //return an error object including the error message for UI + deferred.reject(objReject); + return deferred.promise; + }, + + /** + * @ngdoc function + * @name safeApply + * @methodOf umbraco.services.angularHelper + * @function + * + * @description + * This checks if a digest/apply is already occuring, if not it will force an apply call + */ + safeApply: function (scope, fn) { + if (scope.$$phase || scope.$root.$$phase) { + if (angular.isFunction(fn)) { + fn(); + } + } + else { + if (angular.isFunction(fn)) { + scope.$apply(fn); + } + else { + scope.$apply(); + } + } + }, + + /** + * @ngdoc function + * @name getCurrentForm + * @methodOf umbraco.services.angularHelper + * @function + * + * @description + * Returns the current form object applied to the scope or null if one is not found + */ + getCurrentForm: function (scope) { + + //NOTE: There isn't a way in angular to get a reference to the current form object since the form object + // is just defined as a property of the scope when it is named but you'll always need to know the name which + // isn't very convenient. If we want to watch for validation changes we need to get a form reference. + // The way that we detect the form object is a bit hackerific in that we detect all of the required properties + // that exist on a form object. + // + //The other way to do it in a directive is to require "^form", but in a controller the only other way to do it + // is to inject the $element object and use: $element.inheritedData('$formController'); + + var form = null; + //var requiredFormProps = ["$error", "$name", "$dirty", "$pristine", "$valid", "$invalid", "$addControl", "$removeControl", "$setValidity", "$setDirty"]; + var requiredFormProps = ["$addControl", "$removeControl", "$setValidity", "$setDirty", "$setPristine"]; + + // a method to check that the collection of object prop names contains the property name expected + function propertyExists(objectPropNames) { + //ensure that every required property name exists on the current scope property + return _.every(requiredFormProps, function (item) { + + return _.contains(objectPropNames, item); + }); + } + + for (var p in scope) { + + if (_.isObject(scope[p]) && p !== "this" && p.substr(0, 1) !== "$") { + //get the keys of the property names for the current property + var props = _.keys(scope[p]); + //if the length isn't correct, try the next prop + if (props.length < requiredFormProps.length) { + continue; + } + + //ensure that every required property name exists on the current scope property + var containProperty = propertyExists(props); + + if (containProperty) { + form = scope[p]; + break; + } + } + } + + return form; + }, + + /** + * @ngdoc function + * @name validateHasForm + * @methodOf umbraco.services.angularHelper + * @function + * + * @description + * This will validate that the current scope has an assigned form object, if it doesn't an exception is thrown, if + * it does we return the form object. + */ + getRequiredCurrentForm: function (scope) { + var currentForm = this.getCurrentForm(scope); + if (!currentForm || !currentForm.$name) { + throw "The current scope requires a current form object (or ng-form) with a name assigned to it"; + } + return currentForm; + }, + + /** + * @ngdoc function + * @name getNullForm + * @methodOf umbraco.services.angularHelper + * @function + * + * @description + * Returns a null angular FormController, mostly for use in unit tests + * NOTE: This is actually the same construct as angular uses internally for creating a null form but they don't expose + * any of this publicly to us, so we need to create our own. + * + * @param {string} formName The form name to assign + */ + getNullForm: function (formName) { + return { + $addControl: angular.noop, + $removeControl: angular.noop, + $setValidity: angular.noop, + $setDirty: angular.noop, + $setPristine: angular.noop, + $name: formName + //NOTE: we don't include the 'properties', just the methods. + }; + } + }; +} +angular.module('umbraco.services').factory('angularHelper', angularHelper); +/** + * @ngdoc service + * @name umbraco.services.appState + * @function + * + * @description + * Tracks the various application state variables when working in the back office, raises events when state changes. + * + * ##Samples + * + * ####Subscribe to global state changes: + * + *
    +  *    scope.showTree = appState.getGlobalState("showNavigation");
    +  *
    +  *    eventsService.on("appState.globalState.changed", function (e, args) {
    +  *               if (args.key === "showNavigation") {
    +  *                   scope.showTree = args.value;
    +  *               }
    +  *           });  
    +  * 
    + * + * ####Subscribe to section-state changes + * + *
    + *    scope.currentSection = appState.getSectionState("currentSection");
    + *
    + *    eventsService.on("appState.sectionState.changed", function (e, args) {
    + *               if (args.key === "currentSection") {
    + *                   scope.currentSection = args.value;
    + *               }
    + *           });  
    + * 
    + */ +function appState(eventsService) { + + //Define all variables here - we are never returning this objects so they cannot be publicly mutable + // changed, we only expose methods to interact with the values. + + var globalState = { + showNavigation: null, + touchDevice: null, + showTray: null, + stickyNavigation: null, + navMode: null, + isReady: null + }; + + var sectionState = { + //The currently active section + currentSection: null, + showSearchResults: null + }; + + var treeState = { + //The currently selected node + selectedNode: null, + //The currently loaded root node reference - depending on the section loaded this could be a section root or a normal root. + //We keep this reference so we can lookup nodes to interact with in the UI via the tree service + currentRootNode: null + }; + + var menuState = { + //this list of menu items to display + menuActions: null, + //the title to display in the context menu dialog + dialogTitle: null, + //The tree node that the ctx menu is launched for + currentNode: null, + //Whether the menu's dialog is being shown or not + showMenuDialog: null, + //Whether the context menu is being shown or not + showMenu: null + }; + + /** function to validate and set the state on a state object */ + function setState(stateObj, key, value, stateObjName) { + if (!_.has(stateObj, key)) { + throw "The variable " + key + " does not exist in " + stateObjName; + } + var changed = stateObj[key] !== value; + stateObj[key] = value; + if (changed) { + eventsService.emit("appState." + stateObjName + ".changed", { key: key, value: value }); + } + } + + /** function to validate and set the state on a state object */ + function getState(stateObj, key, stateObjName) { + if (!_.has(stateObj, key)) { + throw "The variable " + key + " does not exist in " + stateObjName; + } + return stateObj[key]; + } + + return { + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#getGlobalState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Returns the current global state value by key - we do not return an object reference here - we do NOT want this + * to be publicly mutable and allow setting arbitrary values + * + */ + getGlobalState: function (key) { + return getState(globalState, key, "globalState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#setGlobalState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Sets a global state value by key + * + */ + setGlobalState: function (key, value) { + setState(globalState, key, value, "globalState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#getSectionState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Returns the current section state value by key - we do not return an object here - we do NOT want this + * to be publicly mutable and allow setting arbitrary values + * + */ + getSectionState: function (key) { + return getState(sectionState, key, "sectionState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#setSectionState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Sets a section state value by key + * + */ + setSectionState: function(key, value) { + setState(sectionState, key, value, "sectionState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#getTreeState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Returns the current tree state value by key - we do not return an object here - we do NOT want this + * to be publicly mutable and allow setting arbitrary values + * + */ + getTreeState: function (key) { + return getState(treeState, key, "treeState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#setTreeState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Sets a section state value by key + * + */ + setTreeState: function (key, value) { + setState(treeState, key, value, "treeState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#getMenuState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Returns the current menu state value by key - we do not return an object here - we do NOT want this + * to be publicly mutable and allow setting arbitrary values + * + */ + getMenuState: function (key) { + return getState(menuState, key, "menuState"); + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#setMenuState + * @methodOf umbraco.services.appState + * @function + * + * @description + * Sets a section state value by key + * + */ + setMenuState: function (key, value) { + setState(menuState, key, value, "menuState"); + }, + + }; +} +angular.module('umbraco.services').factory('appState', appState); + +/** + * @ngdoc service + * @name umbraco.services.editorState + * @function + * + * @description + * Tracks the parent object for complex editors by exposing it as + * an object reference via editorState.current.entity + * + * it is possible to modify this object, so should be used with care + */ +angular.module('umbraco.services').factory("editorState", function() { + + var current = null; + var state = { + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#set + * @methodOf umbraco.services.editorState + * @function + * + * @description + * Sets the current entity object for the currently active editor + * This is only used when implementing an editor with a complex model + * like the content editor, where the model is modified by several + * child controllers. + */ + set: function (entity) { + current = entity; + }, + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#reset + * @methodOf umbraco.services.editorState + * @function + * + * @description + * Since the editorstate entity is read-only, you cannot set it to null + * only through the reset() method + */ + reset: function() { + current = null; + } + + /** + * @ngdoc function + * @name umbraco.services.angularHelper#current + * @methodOf umbraco.services.editorState + * @function + * + * @description + * Returns an object reference to the current editor entity. + * the entity is the root object of the editor. + * EditorState is used by property/parameter editors that need + * access to the entire entity being edited, not just the property/parameter + * + * editorState.current can not be overwritten, you should only read values from it + * since modifying individual properties should be handled by the property editors + */ + }; + + //create a get/set property but don't allow setting + Object.defineProperty(state, "current", { + get: function () { + return current; + }, + set: function (value) { + throw "Use editorState.set to set the value of the current entity"; + }, + }); + + return state; +}); +/** + * @ngdoc service + * @name umbraco.services.assetsService + * + * @requires $q + * @requires angularHelper + * + * @description + * Promise-based utillity service to lazy-load client-side dependencies inside angular controllers. + * + * ##usage + * To use, simply inject the assetsService into any controller that needs it, and make + * sure the umbraco.services module is accesible - which it should be by default. + * + *
    + *      angular.module("umbraco").controller("my.controller". function(assetsService){
    + *          assetsService.load(["script.js", "styles.css"], $scope).then(function(){
    + *                 //this code executes when the dependencies are done loading
    + *          });
    + *      });
    + * 
    + * + * You can also load individual files, which gives you greater control over what attibutes are passed to the file, as well as timeout + * + *
    + *      angular.module("umbraco").controller("my.controller". function(assetsService){
    + *          assetsService.loadJs("script.js", $scope, {charset: 'utf-8'}, 10000 }).then(function(){
    + *                 //this code executes when the script is done loading
    + *          });
    + *      });
    + * 
    + * + * For these cases, there are 2 individual methods, one for javascript, and one for stylesheets: + * + *
    + *      angular.module("umbraco").controller("my.controller". function(assetsService){
    + *          assetsService.loadCss("stye.css", $scope, {media: 'print'}, 10000 }).then(function(){
    + *                 //loadcss cannot determine when the css is done loading, so this will trigger instantly
    + *          });
    + *      });
    + * 
    + */ +angular.module('umbraco.services') +.factory('assetsService', function ($q, $log, angularHelper, umbRequestHelper, $rootScope, $http) { + + var initAssetsLoaded = false; + var appendRnd = function(url){ + //if we don't have a global umbraco obj yet, the app is bootstrapping + if(!Umbraco.Sys.ServerVariables.application){ + return url; + } + + var rnd = Umbraco.Sys.ServerVariables.application.version +"."+Umbraco.Sys.ServerVariables.application.cdf; + var _op = (url.indexOf("?")>0) ? "&" : "?"; + url = url + _op + "umb__rnd=" + rnd; + return url; + }; + + var service = { + loadedAssets:{}, + + _getAssetPromise : function(path){ + if(this.loadedAssets[path]){ + return this.loadedAssets[path]; + }else{ + var deferred = $q.defer(); + this.loadedAssets[path] = {deferred: deferred, state: "new", path: path}; + return this.loadedAssets[path]; + } + }, + /** + Internal method. This is called when the application is loading and the user is already authenticated, or once the user is authenticated. + There's a few assets the need to be loaded for the application to function but these assets require authentication to load. + */ + _loadInitAssets: function () { + var deferred = $q.defer(); + //here we need to ensure the required application assets are loaded + if (initAssetsLoaded === false) { + var self = this; + self.loadJs(umbRequestHelper.getApiUrl("serverVarsJs", "", ""), $rootScope).then(function() { + initAssetsLoaded = true; + + //now we need to go get the legacyTreeJs - but this can be done async without waiting. + self.loadJs(umbRequestHelper.getApiUrl("legacyTreeJs", "", ""), $rootScope); + + deferred.resolve(); + }); + } + else { + deferred.resolve(); + } + return deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.assetsService#loadCss + * @methodOf umbraco.services.assetsService + * + * @description + * Injects a file as a stylesheet into the document head + * + * @param {String} path path to the css file to load + * @param {Scope} scope optional scope to pass into the loader + * @param {Object} keyvalue collection of attributes to pass to the stylesheet element + * @param {Number} timeout in milliseconds + * @returns {Promise} Promise object which resolves when the file has loaded + */ + loadCss : function(path, scope, attributes, timeout){ + var asset = this._getAssetPromise(path); // $q.defer(); + var t = timeout || 5000; + var a = attributes || undefined; + + if(asset.state === "new"){ + asset.state = "loading"; + LazyLoad.css(appendRnd(path), function () { + if (!scope) { + asset.state = "loaded"; + asset.deferred.resolve(true); + }else{ + asset.state = "loaded"; + angularHelper.safeApply(scope, function () { + asset.deferred.resolve(true); + }); + } + }); + }else if(asset.state === "loaded"){ + asset.deferred.resolve(true); + } + return asset.deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.assetsService#loadJs + * @methodOf umbraco.services.assetsService + * + * @description + * Injects a file as a javascript into the document + * + * @param {String} path path to the js file to load + * @param {Scope} scope optional scope to pass into the loader + * @param {Object} keyvalue collection of attributes to pass to the script element + * @param {Number} timeout in milliseconds + * @returns {Promise} Promise object which resolves when the file has loaded + */ + loadJs : function(path, scope, attributes, timeout){ + + var asset = this._getAssetPromise(path); // $q.defer(); + var t = timeout || 5000; + var a = attributes || undefined; + + if(asset.state === "new"){ + asset.state = "loading"; + + LazyLoad.js(appendRnd(path), function () { + if (!scope) { + asset.state = "loaded"; + asset.deferred.resolve(true); + }else{ + asset.state = "loaded"; + angularHelper.safeApply(scope, function () { + asset.deferred.resolve(true); + }); + } + }); + + }else if(asset.state === "loaded"){ + asset.deferred.resolve(true); + } + + return asset.deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.assetsService#load + * @methodOf umbraco.services.assetsService + * + * @description + * Injects a collection of files, this can be ONLY js files + * + * + * @param {Array} pathArray string array of paths to the files to load + * @param {Scope} scope optional scope to pass into the loader + * @returns {Promise} Promise object which resolves when all the files has loaded + */ + load: function (pathArray, scope) { + var promise; + + if (!angular.isArray(pathArray)) { + throw "pathArray must be an array"; + } + + var nonEmpty = _.reject(pathArray, function(item) { + return item === undefined || item === ""; + }); + + + //don't load anything if there's nothing to load + if (nonEmpty.length > 0) { + var promises = []; + var assets = []; + + //compile a list of promises + //blocking + _.each(nonEmpty, function(path){ + var asset = service._getAssetPromise(path); + //if not previously loaded, add to list of promises + if(asset.state !== "loaded") + { + if(asset.state === "new"){ + asset.state = "loading"; + assets.push(asset); + } + + //we need to always push to the promises collection to monitor correct + //execution + promises.push(asset.deferred.promise); + } + }); + + + //gives a central monitoring of all assets to load + promise = $q.all(promises); + + _.each(assets, function(asset){ + LazyLoad.js(appendRnd(asset.path), function () { + if (!scope) { + asset.state = "loaded"; + asset.deferred.resolve(true); + }else{ + asset.state = "loaded"; + angularHelper.safeApply(scope, function () { + asset.deferred.resolve(true); + }); + } + }); + }); + }else{ + //return and resolve + var deferred = $q.defer(); + promise = deferred.promise; + deferred.resolve(true); + } + + + return promise; + } + }; + + return service; +}); + +/** +* @ngdoc service +* @name umbraco.services.contentEditingHelper +* @description A helper service for most editors, some methods are specific to content/media/member model types but most are used by +* all editors to share logic and reduce the amount of replicated code among editors. +**/ +function contentEditingHelper($location, $routeParams, notificationsService, serverValidationManager, dialogService, formHelper, appState) { + + return { + + + /** + * @ngdoc method + * @name umbraco.services.contentEditingHelper#getAllProps + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * Returns all propertes contained for the content item (since the normal model has properties contained inside of tabs) + */ + getAllProps: function (content) { + var allProps = []; + + for (var i = 0; i < content.tabs.length; i++) { + for (var p = 0; p < content.tabs[i].properties.length; p++) { + allProps.push(content.tabs[i].properties[p]); + } + } + + return allProps; + }, + + + /** + * @ngdoc method + * @name umbraco.services.contentEditingHelper#configureButtons + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * Returns a letter array for buttons, with the primary one first based on content model, permissions and editor state + */ + getAllowedActions : function(content, creating){ + + //This is the ideal button order but depends on circumstance, we'll use this array to create the button list + // Publish, SendToPublish, Save + var actionOrder = ["U", "H", "A"]; + var defaultActions; + var actions = []; + + //Create the first button (primary button) + //We cannot have the Save or SaveAndPublish buttons if they don't have create permissions when we are creating a new item. + if (!creating || _.contains(content.allowedActions, "C")) { + for (var b in actionOrder) { + if (_.contains(content.allowedActions, actionOrder[b])) { + defaultAction = actionOrder[b]; + break; + } + } + } + + actions.push(defaultAction); + + //Now we need to make the drop down button list, this is also slightly tricky because: + //We cannot have any buttons if there's no default button above. + //We cannot have the unpublish button (Z) when there's no publish permission. + //We cannot have the unpublish button (Z) when the item is not published. + if (defaultAction) { + //get the last index of the button order + var lastIndex = _.indexOf(actionOrder, defaultAction); + + //add the remaining + for (var i = lastIndex + 1; i < actionOrder.length; i++) { + if (_.contains(content.allowedActions, actionOrder[i])) { + actions.push(actionOrder[i]); + } + } + + //if we are not creating, then we should add unpublish too, + // so long as it's already published and if the user has access to publish + if (!creating) { + if (content.publishDate && _.contains(content.allowedActions,"U")) { + actions.push("Z"); + } + } + } + + return actions; + }, + + /** + * @ngdoc method + * @name umbraco.services.contentEditingHelper#getButtonFromAction + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * Returns a button object to render a button for the tabbed editor + * currently only returns built in system buttons for content and media actions + * returns label, alias, action char and hot-key + */ + getButtonFromAction : function(ch){ + switch (ch) { + case "U": + return { + letter: ch, + labelKey: "buttons_saveAndPublish", + handler: "saveAndPublish", + hotKey: "ctrl+p" + }; + case "H": + //send to publish + return { + letter: ch, + labelKey: "buttons_saveToPublish", + handler: "sendToPublish", + hotKey: "ctrl+p" + }; + case "A": + return { + letter: ch, + labelKey: "buttons_save", + handler: "save", + hotKey: "ctrl+s" + }; + case "Z": + return { + letter: ch, + labelKey: "content_unPublish", + handler: "unPublish" + }; + + default: + return null; + } + + }, + /** + * @ngdoc method + * @name umbraco.services.contentEditingHelper#reBindChangedProperties + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * re-binds all changed property values to the origContent object from the savedContent object and returns an array of changed properties. + */ + reBindChangedProperties: function (origContent, savedContent) { + + var changed = []; + + //get a list of properties since they are contained in tabs + var allOrigProps = this.getAllProps(origContent); + var allNewProps = this.getAllProps(savedContent); + + function getNewProp(alias) { + return _.find(allNewProps, function (item) { + return item.alias === alias; + }); + } + + //a method to ignore built-in prop changes + var shouldIgnore = function(propName) { + return _.some(["tabs", "notifications", "ModelState", "tabs", "properties"], function(i) { + return i === propName; + }); + }; + //check for changed built-in properties of the content + for (var o in origContent) { + + //ignore the ones listed in the array + if (shouldIgnore(o)) { + continue; + } + + if (!_.isEqual(origContent[o], savedContent[o])) { + origContent[o] = savedContent[o]; + } + } + + //check for changed properties of the content + for (var p in allOrigProps) { + var newProp = getNewProp(allOrigProps[p].alias); + if (newProp && !_.isEqual(allOrigProps[p].value, newProp.value)) { + + //they have changed so set the origContent prop to the new one + var origVal = allOrigProps[p].value; + allOrigProps[p].value = newProp.value; + + //instead of having a property editor $watch their expression to check if it has + // been updated, instead we'll check for the existence of a special method on their model + // and just call it. + if (angular.isFunction(allOrigProps[p].onValueChanged)) { + //send the newVal + oldVal + allOrigProps[p].onValueChanged(allOrigProps[p].value, origVal); + } + + changed.push(allOrigProps[p]); + } + } + + return changed; + }, + + /** + * @ngdoc function + * @name umbraco.services.contentEditingHelper#handleSaveError + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * A function to handle what happens when we have validation issues from the server side + */ + handleSaveError: function (args) { + + if (!args.err) { + throw "args.err cannot be null"; + } + if (args.redirectOnFailure === undefined || args.redirectOnFailure === null) { + throw "args.redirectOnFailure must be set to true or false"; + } + + //When the status is a 400 status with a custom header: X-Status-Reason: Validation failed, we have validation errors. + //Otherwise the error is probably due to invalid data (i.e. someone mucking around with the ids or something). + //Or, some strange server error + if (args.err.status === 400) { + //now we need to look through all the validation errors + if (args.err.data && (args.err.data.ModelState)) { + + //wire up the server validation errs + formHelper.handleServerValidation(args.err.data.ModelState); + + if (!args.redirectOnFailure || !this.redirectToCreatedContent(args.err.data.id, args.err.data.ModelState)) { + //we are not redirecting because this is not new content, it is existing content. In this case + // we need to detect what properties have changed and re-bind them with the server data. Then we need + // to re-bind any server validation errors after the digest takes place. + + if (args.rebindCallback && angular.isFunction(args.rebindCallback)) { + args.rebindCallback(); + } + + serverValidationManager.executeAndClearAllSubscriptions(); + } + + //indicates we've handled the server result + return true; + } + else { + dialogService.ysodDialog(args.err); + } + } + else { + dialogService.ysodDialog(args.err); + } + + return false; + }, + + /** + * @ngdoc function + * @name umbraco.services.contentEditingHelper#handleSuccessfulSave + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * A function to handle when saving a content item is successful. This will rebind the values of the model that have changed + * ensure the notifications are displayed and that the appropriate events are fired. This will also check if we need to redirect + * when we're creating new content. + */ + handleSuccessfulSave: function (args) { + + if (!args) { + throw "args cannot be null"; + } + if (!args.savedContent) { + throw "args.savedContent cannot be null"; + } + + if (!this.redirectToCreatedContent(args.redirectId ? args.redirectId : args.savedContent.id)) { + + //we are not redirecting because this is not new content, it is existing content. In this case + // we need to detect what properties have changed and re-bind them with the server data. + //call the callback + if (args.rebindCallback && angular.isFunction(args.rebindCallback)) { + args.rebindCallback(); + } + } + }, + + /** + * @ngdoc function + * @name umbraco.services.contentEditingHelper#redirectToCreatedContent + * @methodOf umbraco.services.contentEditingHelper + * @function + * + * @description + * Changes the location to be editing the newly created content after create was successful. + * We need to decide if we need to redirect to edito mode or if we will remain in create mode. + * We will only need to maintain create mode if we have not fulfilled the basic requirements for creating an entity which is at least having a name. + */ + redirectToCreatedContent: function (id, modelState) { + + //only continue if we are currently in create mode and if there is no 'Name' modelstate errors + // since we need at least a name to create content. + if ($routeParams.create && (!modelState || !modelState["Name"])) { + + //need to change the location to not be in 'create' mode. Currently the route will be something like: + // /belle/#/content/edit/1234?doctype=newsArticle&create=true + // but we need to remove everything after the query so that it is just: + // /belle/#/content/edit/9876 (where 9876 is the new id) + + //clear the query strings + $location.search(""); + + //change to new path + $location.path("/" + $routeParams.section + "/" + $routeParams.tree + "/" + $routeParams.method + "/" + id); + //don't add a browser history for this + $location.replace(); + return true; + } + return false; + } + }; +} +angular.module('umbraco.services').factory('contentEditingHelper', contentEditingHelper); +/** +* @ngdoc service +* @name umbraco.services.cropperHelper +* @description A helper object used for dealing with image cropper data +**/ +function cropperHelper(umbRequestHelper, $http) { + var service = { + + /** + * @ngdoc method + * @name umbraco.services.cropperHelper#configuration + * @methodOf umbraco.services.cropperHelper + * + * @description + * Returns a collection of plugins available to the tinyMCE editor + * + */ + configuration: function (mediaTypeAlias) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "imageCropperApiBaseUrl", + "GetConfiguration", + [{ mediaTypeAlias: mediaTypeAlias}])), + 'Failed to retrieve tinymce configuration'); + }, + + + //utill for getting either min/max aspect ratio to scale image after + calculateAspectRatioFit : function(srcWidth, srcHeight, maxWidth, maxHeight, maximize) { + var ratio = [maxWidth / srcWidth, maxHeight / srcHeight ]; + + if(maximize){ + ratio = Math.max(ratio[0], ratio[1]); + }else{ + ratio = Math.min(ratio[0], ratio[1]); + } + + return { width:srcWidth*ratio, height:srcHeight*ratio, ratio: ratio}; + }, + + //utill for scaling width / height given a ratio + calculateSizeToRatio : function(srcWidth, srcHeight, ratio) { + return { width:srcWidth*ratio, height:srcHeight*ratio, ratio: ratio}; + }, + + scaleToMaxSize : function(srcWidth, srcHeight, maxSize) { + + var retVal = {height: srcHeight, width: srcWidth}; + + if(srcWidth > maxSize ||srcHeight > maxSize){ + var ratio = [maxSize / srcWidth, maxSize / srcHeight ]; + ratio = Math.min(ratio[0], ratio[1]); + + retVal.height = srcHeight * ratio; + retVal.width = srcWidth * ratio; + } + + return retVal; + }, + + //returns a ng-style object with top,left,width,height pixel measurements + //expects {left,right,top,bottom} - {width,height}, {width,height}, int + //offset is just to push the image position a number of pixels from top,left + convertToStyle : function(coordinates, originalSize, viewPort, offset){ + + var coordinates_px = service.coordinatesToPixels(coordinates, originalSize, offset); + var _offset = offset || 0; + + var x = 1 - (coordinates.x1 + Math.abs(coordinates.x2)); + var left_of_x = originalSize.width * x; + var ratio = viewPort.width / left_of_x; + + var style = { + position: "absolute", + top: -(coordinates_px.y1*ratio)+ _offset, + left: -(coordinates_px.x1* ratio)+ _offset, + width: Math.floor(originalSize.width * ratio), + height: Math.floor(originalSize.height * ratio), + originalWidth: originalSize.width, + originalHeight: originalSize.height, + ratio: ratio + }; + + return style; + }, + + + coordinatesToPixels : function(coordinates, originalSize, offset){ + + var coordinates_px = { + x1: Math.floor(coordinates.x1 * originalSize.width), + y1: Math.floor(coordinates.y1 * originalSize.height), + x2: Math.floor(coordinates.x2 * originalSize.width), + y2: Math.floor(coordinates.y2 * originalSize.height) + }; + + return coordinates_px; + }, + + pixelsToCoordinates : function(image, width, height, offset){ + + var x1_px = Math.abs(image.left-offset); + var y1_px = Math.abs(image.top-offset); + + var x2_px = image.width - (x1_px + width); + var y2_px = image.height - (y1_px + height); + + + //crop coordinates in % + var crop = {}; + crop.x1 = x1_px / image.width; + crop.y1 = y1_px / image.height; + crop.x2 = x2_px / image.width; + crop.y2 = y2_px / image.height; + + for(var coord in crop){ + if(crop[coord] < 0){ + crop[coord] = 0; + } + } + + return crop; + }, + + centerInsideViewPort : function(img, viewport){ + var left = viewport.width/ 2 - img.width / 2, + top = viewport.height / 2 - img.height / 2; + + return {left: left, top: top}; + }, + + alignToCoordinates : function(image, center, viewport){ + + var min_left = (image.width) - (viewport.width); + var min_top = (image.height) - (viewport.height); + + var c_top = -(center.top * image.height) + (viewport.height / 2); + var c_left = -(center.left * image.width) + (viewport.width / 2); + + if(c_top < -min_top){ + c_top = -min_top; + } + if(c_top > 0){ + c_top = 0; + } + if(c_left < -min_left){ + c_left = -min_left; + } + if(c_left > 0){ + c_left = 0; + } + return {left: c_left, top: c_top}; + }, + + + syncElements : function(source, target){ + target.height(source.height()); + target.width(source.width()); + + target.css({ + "top": source[0].offsetTop, + "left": source[0].offsetLeft + }); + } + }; + + return service; +} + +angular.module('umbraco.services').factory('cropperHelper', cropperHelper); + +/** + * @ngdoc service + * @name umbraco.services.dialogService + * + * @requires $rootScope + * @requires $compile + * @requires $http + * @requires $log + * @requires $q + * @requires $templateCache + * + * @description + * Application-wide service for handling modals, overlays and dialogs + * By default it injects the passed template url into a div to body of the document + * And renders it, but does also support rendering items in an iframe, incase + * serverside processing is needed, or its a non-angular page + * + * ##usage + * To use, simply inject the dialogService into any controller that needs it, and make + * sure the umbraco.services module is accesible - which it should be by default. + * + *
    + *    var dialog = dialogService.open({template: 'path/to/page.html', show: true, callback: done});
    + *    functon done(data){
    + *      //The dialog has been submitted 
    + *      //data contains whatever the dialog has selected / attached
    + *    }     
    + * 
    + */ + +angular.module('umbraco.services') +.factory('dialogService', function ($rootScope, $compile, $http, $timeout, $q, $templateCache, appState, eventsService) { + + var dialogs = []; + + /** Internal method that removes all dialogs */ + function removeAllDialogs(args) { + for (var i = 0; i < dialogs.length; i++) { + var dialog = dialogs[i]; + + //very special flag which means that global events cannot close this dialog - currently only used on the login + // dialog since it's special and cannot be closed without logging in. + if (!dialog.manualClose) { + dialog.close(args); + } + + } + } + + /** Internal method that closes the dialog properly and cleans up resources */ + function closeDialog(dialog) { + + if (dialog.element) { + dialog.element.modal('hide'); + + //this is not entirely enough since the damn webforms scriploader still complains + if (dialog.iframe) { + dialog.element.find("iframe").attr("src", "about:blank"); + $timeout(function () { + //we need to do more than just remove the element, this will not destroy the + // scope in angular 1.1x, in angular 1.2x this is taken care of but if we dont + // take care of this ourselves we have memory leaks. + dialog.element.remove(); + //SD: No idea why this is required but was there before - pretty sure it's not required + $("#" + dialog.element.attr("id")).remove(); + dialog.scope.$destroy(); + }, 1000); + } else { + //we need to do more than just remove the element, this will not destroy the + // scope in angular 1.1x, in angular 1.2x this is taken care of but if we dont + // take care of this ourselves we have memory leaks. + dialog.element.remove(); + //SD: No idea why this is required but was there before - pretty sure it's not required + $("#" + dialog.element.attr("id")).remove(); + dialog.scope.$destroy(); + } + } + + //remove 'this' dialog from the dialogs array + dialogs = _.reject(dialogs, function (i) { return i === dialog; }); + } + + /** Internal method that handles opening all dialogs */ + function openDialog(options) { + var defaults = { + container: $("body"), + animation: "fade", + modalClass: "umb-modal", + width: "100%", + inline: false, + iframe: false, + show: true, + template: "views/common/notfound.html", + callback: undefined, + closeCallback: undefined, + element: undefined, + // It will set this value as a property on the dialog controller's scope as dialogData, + // used to pass in custom data to the dialog controller's $scope. Though this is near identical to + // the dialogOptions property that is also set the the dialog controller's $scope object. + // So there's basically 2 ways of doing the same thing which we're now stuck with and in fact + // dialogData has another specially attached property called .selection which gets used. + dialogData: undefined + }; + + var dialog = angular.extend(defaults, options); + + //NOTE: People should NOT pass in a scope object that is legacy functoinality and causes problems. We will ALWAYS + // destroy the scope when the dialog is closed regardless if it is in use elsewhere which is why it shouldn't be done. + var scope = options.scope || $rootScope.$new(); + + //Modal dom obj and unique id + dialog.element = $('
    '); + var id = dialog.template.replace('.html', '').replace('.aspx', '').replace(/[\/|\.|:\&\?\=]/g, "-") + '-' + scope.$id; + + if (options.inline) { + dialog.animation = ""; + } + else { + dialog.element.addClass("modal"); + dialog.element.addClass("hide"); + } + + //set the id and add classes + dialog.element + .attr('id', id) + .addClass(dialog.animation) + .addClass(dialog.modalClass); + + //push the modal into the global modal collection + //we halt the .push because a link click will trigger a closeAll right away + $timeout(function () { + dialogs.push(dialog); + }, 500); + + + dialog.close = function (data) { + if (dialog.closeCallback) { + dialog.closeCallback(data); + } + + closeDialog(dialog); + }; + + //if iframe is enabled, inject that instead of a template + if (dialog.iframe) { + var html = $(""); + dialog.element.html(html); + + //append to body or whatever element is passed in as options.containerElement + dialog.container.append(dialog.element); + + // Compile modal content + $timeout(function () { + $compile(dialog.element)(dialog.scope); + }); + + dialog.element.css("width", dialog.width); + + //Autoshow + if (dialog.show) { + dialog.element.modal('show'); + } + + dialog.scope = scope; + return dialog; + } + else { + + //We need to load the template with an httpget and once it's loaded we'll compile and assign the result to the container + // object. However since the result could be a promise or just data we need to use a $q.when. We still need to return the + // $modal object so we'll actually return the modal object synchronously without waiting for the promise. Otherwise this openDialog + // method will always need to return a promise which gets nasty because of promises in promises plus the result just needs a reference + // to the $modal object which will not change (only it's contents will change). + $q.when($templateCache.get(dialog.template) || $http.get(dialog.template, { cache: true }).then(function (res) { return res.data; })) + .then(function onSuccess(template) { + + // Build modal object + dialog.element.html(template); + + //append to body or other container element + dialog.container.append(dialog.element); + + // Compile modal content + $timeout(function () { + $compile(dialog.element)(scope); + }); + + scope.dialogOptions = dialog; + + //Scope to handle data from the modal form + scope.dialogData = dialog.dialogData ? dialog.dialogData : {}; + scope.dialogData.selection = []; + + // Provide scope display functions + //this passes the modal to the current scope + scope.$modal = function (name) { + dialog.element.modal(name); + }; + + scope.swipeHide = function (e) { + + if (appState.getGlobalState("touchDevice")) { + var selection = window.getSelection(); + if (selection.type !== "Range") { + scope.hide(); + } + } + }; + + //NOTE: Same as 'close' without the callbacks + scope.hide = function () { + closeDialog(dialog); + }; + + //basic events for submitting and closing + scope.submit = function (data) { + if (dialog.callback) { + dialog.callback(data); + } + + closeDialog(dialog); + }; + + scope.close = function (data) { + dialog.close(data); + }; + + //NOTE: This can ONLY ever be used to show the dialog if dialog.show is false (autoshow). + // You CANNOT call show() after you call hide(). hide = close, they are the same thing and once + // a dialog is closed it's resources are disposed of. + scope.show = function () { + if (dialog.manualClose === true) { + //show and configure that the keyboard events are not enabled on this modal + dialog.element.modal({ keyboard: false }); + } + else { + //just show normally + dialog.element.modal('show'); + } + + }; + + scope.select = function (item) { + var i = scope.dialogData.selection.indexOf(item); + if (i < 0) { + scope.dialogData.selection.push(item); + } else { + scope.dialogData.selection.splice(i, 1); + } + }; + + //NOTE: Same as 'close' without the callbacks + scope.dismiss = scope.hide; + + // Emit modal events + angular.forEach(['show', 'shown', 'hide', 'hidden'], function (name) { + dialog.element.on(name, function (ev) { + scope.$emit('modal-' + name, ev); + }); + }); + + // Support autofocus attribute + dialog.element.on('shown', function (event) { + $('input[autofocus]', dialog.element).first().trigger('focus'); + }); + + dialog.scope = scope; + + //Autoshow + if (dialog.show) { + scope.show(); + } + + }); + + //Return the modal object outside of the promise! + return dialog; + } + } + + /** Handles the closeDialogs event */ + eventsService.on("app.closeDialogs", function (evt, args) { + removeAllDialogs(args); + }); + + return { + /** + * @ngdoc method + * @name umbraco.services.dialogService#open + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a modal rendering a given template url. + * + * @param {Object} options rendering options + * @param {DomElement} options.container the DOM element to inject the modal into, by default set to body + * @param {Function} options.callback function called when the modal is submitted + * @param {String} options.template the url of the template + * @param {String} options.animation animation csss class, by default set to "fade" + * @param {String} options.modalClass modal css class, by default "umb-modal" + * @param {Bool} options.show show the modal instantly + * @param {Bool} options.iframe load template in an iframe, only needed for serverside templates + * @param {Int} options.width set a width on the modal, only needed for iframes + * @param {Bool} options.inline strips the modal from any animation and wrappers, used when you want to inject a dialog into an existing container + * @returns {Object} modal object + */ + open: function (options) { + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#close + * @methodOf umbraco.services.dialogService + * + * @description + * Closes a specific dialog + * @param {Object} dialog the dialog object to close + * @param {Object} args if specified this object will be sent to any callbacks registered on the dialogs. + */ + close: function (dialog, args) { + if (dialog) { + dialog.close(args); + } + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#closeAll + * @methodOf umbraco.services.dialogService + * + * @description + * Closes all dialogs + * @param {Object} args if specified this object will be sent to any callbacks registered on the dialogs. + */ + closeAll: function (args) { + removeAllDialogs(args); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#mediaPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a media picker in a modal, the callback returns an array of selected media items + * @param {Object} options mediapicker dialog options object + * @param {Boolean} options.onlyImages Only display files that have an image file-extension + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + mediaPicker: function (options) { + options.template = 'views/common/dialogs/mediaPicker.html'; + options.show = true; + return openDialog(options); + }, + + + /** + * @ngdoc method + * @name umbraco.services.dialogService#contentPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a content picker tree in a modal, the callback returns an array of selected documents + * @param {Object} options content picker dialog options object + * @param {Boolean} options.multipicker should the picker return one or multiple items + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + contentPicker: function (options) { + options.template = 'views/common/dialogs/contentPicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#linkPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a link picker tree in a modal, the callback returns a single link + * @param {Object} options content picker dialog options object + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + linkPicker: function (options) { + options.template = 'views/common/dialogs/linkPicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#macroPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a mcaro picker in a modal, the callback returns a object representing the macro and it's parameters + * @param {Object} options macropicker dialog options object + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + macroPicker: function (options) { + options.template = 'views/common/dialogs/insertmacro.html'; + options.show = true; + options.modalClass = "span7 umb-modal"; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#memberPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a member picker in a modal, the callback returns a object representing the selected member + * @param {Object} options member picker dialog options object + * @param {Boolean} options.multiPicker should the tree pick one or multiple members before returning + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + memberPicker: function (options) { + options.template = 'views/common/dialogs/memberPicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#memberGroupPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a member group picker in a modal, the callback returns a object representing the selected member + * @param {Object} options member group picker dialog options object + * @param {Boolean} options.multiPicker should the tree pick one or multiple members before returning + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + memberGroupPicker: function (options) { + options.template = 'views/common/dialogs/memberGroupPicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#iconPicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a icon picker in a modal, the callback returns a object representing the selected icon + * @param {Object} options iconpicker dialog options object + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + iconPicker: function (options) { + options.template = 'views/common/dialogs/iconPicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#treePicker + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a tree picker in a modal, the callback returns a object representing the selected tree item + * @param {Object} options iconpicker dialog options object + * @param {String} options.section tree section to display + * @param {String} options.treeAlias specific tree to display + * @param {Boolean} options.multiPicker should the tree pick one or multiple items before returning + * @param {Function} options.callback callback function + * @returns {Object} modal object + */ + treePicker: function (options) { + options.template = 'views/common/dialogs/treePicker.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#propertyDialog + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a dialog with a chosen property editor in, a value can be passed to the modal, and this value is returned in the callback + * @param {Object} options mediapicker dialog options object + * @param {Function} options.callback callback function + * @param {String} editor editor to use to edit a given value and return on callback + * @param {Object} value value sent to the property editor + * @returns {Object} modal object + */ + propertyDialog: function (options) { + options.template = 'views/common/dialogs/property.html'; + options.show = true; + return openDialog(options); + }, + + /** + * @ngdoc method + * @name umbraco.services.dialogService#ysodDialog + * @methodOf umbraco.services.dialogService + * @description + * Opens a dialog to an embed dialog + */ + embedDialog: function (options) { + options.template = 'views/common/dialogs/rteembed.html'; + options.show = true; + return openDialog(options); + }, + /** + * @ngdoc method + * @name umbraco.services.dialogService#ysodDialog + * @methodOf umbraco.services.dialogService + * + * @description + * Opens a dialog to show a custom YSOD + */ + ysodDialog: function (ysodError) { + + var newScope = $rootScope.$new(); + newScope.error = ysodError; + return openDialog({ + modalClass: "umb-modal wide", + scope: newScope, + //callback: options.callback, + template: 'views/common/dialogs/ysod.html', + show: true + }); + } + }; +}); +/** Used to broadcast and listen for global events and allow the ability to add async listeners to the callbacks */ + +/* + Core app events: + + app.ready + app.authenticated + app.notAuthenticated + app.closeDialogs +*/ + +function eventsService($q, $rootScope) { + + return { + + /** raise an event with a given name, returns an array of promises for each listener */ + emit: function (name, args) { + + //there are no listeners + if (!$rootScope.$$listeners[name]) { + return; + //return []; + } + + //send the event + $rootScope.$emit(name, args); + + + //PP: I've commented out the below, since we currently dont + // expose the eventsService as a documented api + // and think we need to figure out our usecases for this + // since the below modifies the return value of the then on() method + /* + //setup a deferred promise for each listener + var deferred = []; + for (var i = 0; i < $rootScope.$$listeners[name].length; i++) { + deferred.push($q.defer()); + }*/ + + //create a new event args object to pass to the + // $emit containing methods that will allow listeners + // to return data in an async if required + /* + var eventArgs = { + args: args, + reject: function (a) { + deferred.pop().reject(a); + }, + resolve: function (a) { + deferred.pop().resolve(a); + } + };*/ + + + + /* + //return an array of promises + var promises = _.map(deferred, function(p) { + return p.promise; + }); + return promises;*/ + }, + + /** subscribe to a method, or use scope.$on = same thing */ + on: function(name, callback) { + return $rootScope.$on(name, callback); + }, + + /** pass in the result of 'on' to this method, or just call the method returned from 'on' to unsubscribe */ + unsubscribe: function(handle) { + if (angular.isFunction(handle)) { + handle(); + } + } + }; +} + +angular.module('umbraco.services').factory('eventsService', eventsService); +/** + * @ngdoc service + * @name umbraco.services.fileManager + * @function + * + * @description + * Used by editors to manage any files that require uploading with the posted data, normally called by property editors + * that need to attach files. + * When a route changes successfully, we ensure that the collection is cleared. + */ +function fileManager() { + + var fileCollection = []; + + return { + /** + * @ngdoc function + * @name umbraco.services.fileManager#addFiles + * @methodOf umbraco.services.fileManager + * @function + * + * @description + * Attaches files to the current manager for the current editor for a particular property, if an empty array is set + * for the files collection that effectively clears the files for the specified editor. + */ + setFiles: function(propertyAlias, files) { + //this will clear the files for the current property and then add the new ones for the current property + fileCollection = _.reject(fileCollection, function (item) { + return item.alias === propertyAlias; + }); + for (var i = 0; i < files.length; i++) { + //save the file object to the files collection + fileCollection.push({ alias: propertyAlias, file: files[i] }); + } + }, + + /** + * @ngdoc function + * @name umbraco.services.fileManager#getFiles + * @methodOf umbraco.services.fileManager + * @function + * + * @description + * Returns all of the files attached to the file manager + */ + getFiles: function() { + return fileCollection; + }, + + /** + * @ngdoc function + * @name umbraco.services.fileManager#clearFiles + * @methodOf umbraco.services.fileManager + * @function + * + * @description + * Removes all files from the manager + */ + clearFiles: function () { + fileCollection = []; + } +}; +} + +angular.module('umbraco.services').factory('fileManager', fileManager); +/** + * @ngdoc service + * @name umbraco.services.formHelper + * @function + * + * @description + * A utility class used to streamline how forms are developed, to ensure that validation is check and displayed consistently and to ensure that the correct events + * fire when they need to. + */ +function formHelper(angularHelper, serverValidationManager, $timeout, notificationsService, dialogService) { + return { + + /** + * @ngdoc function + * @name umbraco.services.formHelper#submitForm + * @methodOf umbraco.services.formHelper + * @function + * + * @description + * Called by controllers when submitting a form - this ensures that all client validation is checked, + * server validation is cleared, that the correct events execute and status messages are displayed. + * This returns true if the form is valid, otherwise false if form submission cannot continue. + * + * @param {object} args An object containing arguments for form submission + */ + submitForm: function (args) { + + var currentForm; + + if (!args) { + throw "args cannot be null"; + } + if (!args.scope) { + throw "args.scope cannot be null"; + } + if (!args.formCtrl) { + //try to get the closest form controller + currentForm = angularHelper.getRequiredCurrentForm(args.scope); + } + else { + currentForm = args.formCtrl; + } + //if no statusPropertyName is set we'll default to formStatus. + if (!args.statusPropertyName) { + args.statusPropertyName = "formStatus"; + } + //if no statusTimeout is set, we'll default to 2500 ms + if (!args.statusTimeout) { + args.statusTimeout = 2500; + } + + //the first thing any form must do is broadcast the formSubmitting event + args.scope.$broadcast("formSubmitting", { scope: args.scope }); + + //then check if the form is valid + if (!args.skipValidation) { + if (currentForm.$invalid) { + return false; + } + } + + //reset the server validations + serverValidationManager.reset(); + + //check if a form status should be set on the scope + if (args.statusMessage) { + args.scope[args.statusPropertyName] = args.statusMessage; + + //clear the message after the timeout + $timeout(function () { + args.scope[args.statusPropertyName] = undefined; + }, args.statusTimeout); + } + + return true; + }, + + /** + * @ngdoc function + * @name umbraco.services.formHelper#submitForm + * @methodOf umbraco.services.formHelper + * @function + * + * @description + * Called by controllers when a form has been successfully submitted. the correct events execute + * and that the notifications are displayed if there are any. + * + * @param {object} args An object containing arguments for form submission + */ + resetForm: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.scope) { + throw "args.scope cannot be null"; + } + + //if no statusPropertyName is set we'll default to formStatus. + if (!args.statusPropertyName) { + args.statusPropertyName = "formStatus"; + } + //clear the status + args.scope[args.statusPropertyName] = null; + + if (angular.isArray(args.notifications)) { + for (var i = 0; i < args.notifications.length; i++) { + notificationsService.showNotification(args.notifications[i]); + } + } + + args.scope.$broadcast("formSubmitted", { scope: args.scope }); + }, + + /** + * @ngdoc function + * @name umbraco.services.formHelper#handleError + * @methodOf umbraco.services.formHelper + * @function + * + * @description + * Needs to be called when a form submission fails, this will wire up all server validation errors in ModelState and + * add the correct messages to the notifications. If a server error has occurred this will show a ysod. + * + * @param {object} err The error object returned from the http promise + */ + handleError: function (err) { + //When the status is a 400 status with a custom header: X-Status-Reason: Validation failed, we have validation errors. + //Otherwise the error is probably due to invalid data (i.e. someone mucking around with the ids or something). + //Or, some strange server error + if (err.status === 400) { + //now we need to look through all the validation errors + if (err.data && (err.data.ModelState)) { + + //wire up the server validation errs + this.handleServerValidation(err.data.ModelState); + + //execute all server validation events and subscribers + serverValidationManager.executeAndClearAllSubscriptions(); + } + else { + dialogService.ysodDialog(err); + } + } + else { + dialogService.ysodDialog(err); + } + }, + + /** + * @ngdoc function + * @name umbraco.services.formHelper#handleServerValidation + * @methodOf umbraco.services.formHelper + * @function + * + * @description + * This wires up all of the server validation model state so that valServer and valServerField directives work + * + * @param {object} err The error object returned from the http promise + */ + handleServerValidation: function(modelState) { + for (var e in modelState) { + + //the alias in model state can be in dot notation which indicates + // * the first part is the content property alias + // * the second part is the field to which the valiation msg is associated with + //There will always be at least 2 parts for properties since all model errors for properties are prefixed with "Properties" + //If it is not prefixed with "Properties" that means the error is for a field of the object directly. + + var parts = e.split("."); + if (parts.length > 1) { + var propertyAlias = parts[1]; + + //if it contains 2 '.' then we will wire it up to a property's field + if (parts.length > 2) { + //add an error with a reference to the field for which the validation belongs too + serverValidationManager.addPropertyError(propertyAlias, parts[2], modelState[e][0]); + } + else { + //add a generic error for the property, no reference to a specific field + serverValidationManager.addPropertyError(propertyAlias, "", modelState[e][0]); + } + + } + else { + //the parts are only 1, this means its not a property but a native content property + serverValidationManager.addFieldError(parts[0], modelState[e][0]); + } + + //add to notifications + notificationsService.error("Validation", modelState[e][0]); + } + } + }; +} +angular.module('umbraco.services').factory('formHelper', formHelper); +angular.module('umbraco.services') + .factory('helpService', function ($http, $q){ + var helpTopics = {}; + + var defaultUrl = "http://our.umbraco.org/rss/help"; + var tvUrl = "http://umbraco.tv/feeds/help"; + + function getCachedHelp(url){ + if(helpTopics[url]){ + return helpTopics[cacheKey]; + }else{ + return null; + } + } + + function setCachedHelp(url, data){ + helpTopics[url] = data; + } + + function fetchUrl(url){ + var deferred = $q.defer(); + var found = getCachedHelp(url); + + if(found){ + deferred.resolve(found); + }else{ + + var proxyUrl = "dashboard/feedproxy.aspx?url=" + url; + $http.get(proxyUrl).then(function(data){ + var feed = $(data.data); + var topics = []; + + $('item', feed).each(function (i, item) { + var topic = {}; + topic.thumbnail = $(item).find('thumbnail').attr('url'); + topic.title = $("title", item).text(); + topic.link = $("guid", item).text(); + topic.description = $("description", item).text(); + topics.push(topic); + }); + + setCachedHelp(topics); + deferred.resolve(topics); + }); + } + + return deferred.promise; + } + + + + var service = { + findHelp: function (args) { + var url = service.getUrl(defaultUrl, args); + return fetchUrl(url); + }, + + findVideos: function (args) { + var url = service.getUrl(tvUrl, args); + return fetchUrl(url); + }, + + getUrl: function(url, args){ + return url + "?" + $.param(args); + } + }; + + return service; + + }); +/** + * @ngdoc service + * @name umbraco.services.historyService + * + * @requires $rootScope + * @requires $timeout + * @requires angularHelper + * + * @description + * Service to handle the main application navigation history. Responsible for keeping track + * of where a user navigates to, stores an icon, url and name in a collection, to make it easy + * for the user to go back to a previous editor / action + * + * **Note:** only works with new angular-based editors, not legacy ones + * + * ##usage + * To use, simply inject the historyService into any controller that needs it, and make + * sure the umbraco.services module is accesible - which it should be by default. + * + *
    + *      angular.module("umbraco").controller("my.controller". function(historyService){
    + *         historyService.add({
    + *								icon: "icon-class",
    + *								name: "Editing 'articles',
    + *								link: "/content/edit/1234"}
    + *							);
    + *      }); 
    + * 
    + */ +angular.module('umbraco.services') +.factory('historyService', function ($rootScope, $timeout, angularHelper, eventsService) { + + var nArray = []; + + function add(item) { + + if (!item) { + return null; + } + + var listWithoutThisItem = _.reject(nArray, function(i) { + return i.link === item.link; + }); + + //put it at the top and reassign + listWithoutThisItem.splice(0, 0, item); + nArray = listWithoutThisItem; + return nArray[0]; + + } + + return { + /** + * @ngdoc method + * @name umbraco.services.historyService#add + * @methodOf umbraco.services.historyService + * + * @description + * Adds a given history item to the users history collection. + * + * @param {Object} item the history item + * @param {String} item.icon icon css class for the list, ex: "icon-image", "icon-doc" + * @param {String} item.link route to the editor, ex: "/content/edit/1234" + * @param {String} item.name friendly name for the history listing + * @returns {Object} history item object + */ + add: function (item) { + var icon = item.icon || "icon-file"; + angularHelper.safeApply($rootScope, function () { + var result = add({ name: item.name, icon: icon, link: item.link, time: new Date() }); + eventsService.emit("historyService.add", {added: result, all: nArray}); + return result; + }); + }, + /** + * @ngdoc method + * @name umbraco.services.historyService#remove + * @methodOf umbraco.services.historyService + * + * @description + * Removes a history item from the users history collection, given an index to remove from. + * + * @param {Int} index index to remove item from + */ + remove: function (index) { + angularHelper.safeApply($rootScope, function() { + var result = nArray.splice(index, 1); + eventsService.emit("historyService.remove", { removed: result, all: nArray }); + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.historyService#removeAll + * @methodOf umbraco.services.historyService + * + * @description + * Removes all history items from the users history collection + */ + removeAll: function () { + angularHelper.safeApply($rootScope, function() { + nArray = []; + eventsService.emit("historyService.removeAll"); + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.historyService#getCurrent + * @methodOf umbraco.services.historyService + * + * @description + * Method to return the current history collection. + * + */ + getCurrent: function(){ + return nArray; + } + }; +}); +/** +* @ngdoc service +* @name umbraco.services.iconHelper +* @description A helper service for dealing with icons, mostly dealing with legacy tree icons +**/ +function iconHelper($q, $timeout) { + + var converter = [ + { oldIcon: ".sprNew", newIcon: "add" }, + { oldIcon: ".sprDelete", newIcon: "remove" }, + { oldIcon: ".sprMove", newIcon: "enter" }, + { oldIcon: ".sprCopy", newIcon: "documents" }, + { oldIcon: ".sprSort", newIcon: "navigation-vertical" }, + { oldIcon: ".sprPublish", newIcon: "globe" }, + { oldIcon: ".sprRollback", newIcon: "undo" }, + { oldIcon: ".sprProtect", newIcon: "lock" }, + { oldIcon: ".sprAudit", newIcon: "time" }, + { oldIcon: ".sprNotify", newIcon: "envelope" }, + { oldIcon: ".sprDomain", newIcon: "home" }, + { oldIcon: ".sprPermission", newIcon: "lock" }, + { oldIcon: ".sprRefresh", newIcon: "refresh" }, + { oldIcon: ".sprBinEmpty", newIcon: "trash" }, + { oldIcon: ".sprExportDocumentType", newIcon: "download-alt" }, + { oldIcon: ".sprImportDocumentType", newIcon: "page-up" }, + { oldIcon: ".sprLiveEdit", newIcon: "edit" }, + { oldIcon: ".sprCreateFolder", newIcon: "add" }, + { oldIcon: ".sprPackage2", newIcon: "box" }, + { oldIcon: ".sprLogout", newIcon: "logout" }, + { oldIcon: ".sprSave", newIcon: "save" }, + { oldIcon: ".sprSendToTranslate", newIcon: "envelope-alt" }, + { oldIcon: ".sprToPublish", newIcon: "mail-forward" }, + { oldIcon: ".sprTranslate", newIcon: "comments" }, + { oldIcon: ".sprUpdate", newIcon: "save" }, + + { oldIcon: ".sprTreeSettingDomain", newIcon: "icon-home" }, + { oldIcon: ".sprTreeDoc", newIcon: "icon-document" }, + { oldIcon: ".sprTreeDoc2", newIcon: "icon-diploma-alt" }, + { oldIcon: ".sprTreeDoc3", newIcon: "icon-notepad" }, + { oldIcon: ".sprTreeDoc4", newIcon: "icon-newspaper-alt" }, + { oldIcon: ".sprTreeDoc5", newIcon: "icon-notepad-alt" }, + + { oldIcon: ".sprTreeDocPic", newIcon: "icon-picture" }, + { oldIcon: ".sprTreeFolder", newIcon: "icon-folder" }, + { oldIcon: ".sprTreeFolder_o", newIcon: "icon-folder" }, + { oldIcon: ".sprTreeMediaFile", newIcon: "icon-music" }, + { oldIcon: ".sprTreeMediaMovie", newIcon: "icon-movie" }, + { oldIcon: ".sprTreeMediaPhoto", newIcon: "icon-picture" }, + + { oldIcon: ".sprTreeMember", newIcon: "icon-user" }, + { oldIcon: ".sprTreeMemberGroup", newIcon: "icon-users" }, + { oldIcon: ".sprTreeMemberType", newIcon: "icon-users" }, + + { oldIcon: ".sprTreeNewsletter", newIcon: "icon-file-text-alt" }, + { oldIcon: ".sprTreePackage", newIcon: "icon-box" }, + { oldIcon: ".sprTreeRepository", newIcon: "icon-server-alt" }, + + { oldIcon: ".sprTreeSettingDataType", newIcon: "icon-autofill" }, + + //TODO: + /* + { oldIcon: ".sprTreeSettingAgent", newIcon: "" }, + { oldIcon: ".sprTreeSettingCss", newIcon: "" }, + { oldIcon: ".sprTreeSettingCssItem", newIcon: "" }, + + { oldIcon: ".sprTreeSettingDataTypeChild", newIcon: "" }, + { oldIcon: ".sprTreeSettingDomain", newIcon: "" }, + { oldIcon: ".sprTreeSettingLanguage", newIcon: "" }, + { oldIcon: ".sprTreeSettingScript", newIcon: "" }, + { oldIcon: ".sprTreeSettingTemplate", newIcon: "" }, + { oldIcon: ".sprTreeSettingXml", newIcon: "" }, + { oldIcon: ".sprTreeStatistik", newIcon: "" }, + { oldIcon: ".sprTreeUser", newIcon: "" }, + { oldIcon: ".sprTreeUserGroup", newIcon: "" }, + { oldIcon: ".sprTreeUserType", newIcon: "" }, + */ + + { oldIcon: "folder.png", newIcon: "icon-folder" }, + { oldIcon: "mediaphoto.gif", newIcon: "icon-picture" }, + { oldIcon: "mediafile.gif", newIcon: "icon-document" }, + + { oldIcon: ".sprTreeDeveloperCacheItem", newIcon: "icon-box" }, + { oldIcon: ".sprTreeDeveloperCacheTypes", newIcon: "icon-box" }, + { oldIcon: ".sprTreeDeveloperMacro", newIcon: "icon-cogs" }, + { oldIcon: ".sprTreeDeveloperRegistry", newIcon: "icon-windows" }, + { oldIcon: ".sprTreeDeveloperPython", newIcon: "icon-linux" } + ]; + + var imageConverter = [ + {oldImage: "contour.png", newIcon: "icon-umb-contour"} + ]; + + var collectedIcons; + + return { + + /** Used by the create dialogs for content/media types to format the data so that the thumbnails are styled properly */ + formatContentTypeThumbnails: function (contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + + if (contentTypes[i].thumbnailIsClass === undefined || contentTypes[i].thumbnailIsClass) { + contentTypes[i].cssClass = this.convertFromLegacyIcon(contentTypes[i].thumbnail); + }else { + contentTypes[i].style = "background-image: url('" + contentTypes[i].thumbnailFilePath + "');height:36px; background-position:4px 0px; background-repeat: no-repeat;background-size: 35px 35px;"; + //we need an 'icon-' class in there for certain styles to work so if it is image based we'll add this + contentTypes[i].cssClass = "custom-file"; + } + } + return contentTypes; + }, + formatContentTypeIcons: function (contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + contentTypes[i].icon = this.convertFromLegacyIcon(contentTypes[i].icon); + + //couldnt find replacement + if(contentTypes[i].icon.indexOf(".") > 0){ + contentTypes[i].icon = "icon-document-dashed-line"; + } + } + return contentTypes; + }, + /** If the icon is file based (i.e. it has a file path) */ + isFileBasedIcon: function (icon) { + //if it doesn't start with a '.' but contains one then we'll assume it's file based + if (icon.startsWith('..') || (!icon.startsWith('.') && icon.indexOf('.') > 1)) { + return true; + } + return false; + }, + /** If the icon is legacy */ + isLegacyIcon: function (icon) { + if(icon.startsWith('..')){ + return false; + } + + if (icon.startsWith('.')) { + return true; + } + return false; + }, + /** If the tree node has a legacy icon */ + isLegacyTreeNodeIcon: function(treeNode){ + if (treeNode.iconIsClass) { + return this.isLegacyIcon(treeNode.icon); + } + return false; + }, + + /** Return a list of icons, optionally filter them */ + /** It fetches them directly from the active stylesheets in the browser */ + getIcons: function(){ + var deferred = $q.defer(); + $timeout(function(){ + if(collectedIcons){ + deferred.resolve(collectedIcons); + }else{ + collectedIcons = []; + var c = ".icon-"; + + for (var i = document.styleSheets.length - 1; i >= 0; i--) { + var classes = document.styleSheets[i].rules || document.styleSheets[i].cssRules; + + if (classes !== null) { + for(var x=0;x0){ + s = s.substring(0, hasSpace); + } + var hasPseudo = s.indexOf(":"); + if(hasPseudo>0){ + s = s.substring(0, hasPseudo); + } + + if(collectedIcons.indexOf(s) < 0){ + collectedIcons.push(s); + } + } + } + } + } + deferred.resolve(collectedIcons); + } + }, 100); + + return deferred.promise; + }, + + /** Converts the icon from legacy to a new one if an old one is detected */ + convertFromLegacyIcon: function (icon) { + if (this.isLegacyIcon(icon)) { + //its legacy so convert it if we can + var found = _.find(converter, function (item) { + return item.oldIcon.toLowerCase() === icon.toLowerCase(); + }); + return (found ? found.newIcon : icon); + } + return icon; + }, + + convertFromLegacyImage: function (icon) { + var found = _.find(imageConverter, function (item) { + return item.oldImage.toLowerCase() === icon.toLowerCase(); + }); + return (found ? found.newIcon : undefined); + }, + + /** If we detect that the tree node has legacy icons that can be converted, this will convert them */ + convertFromLegacyTreeNodeIcon: function (treeNode) { + if (this.isLegacyTreeNodeIcon(treeNode)) { + return this.convertFromLegacyIcon(treeNode.icon); + } + return treeNode.icon; + } + }; +} +angular.module('umbraco.services').factory('iconHelper', iconHelper); +/** +* @ngdoc service +* @name umbraco.services.imageHelper +* @deprecated +**/ +function imageHelper(umbRequestHelper, mediaHelper) { + return { + /** + * @ngdoc function + * @name umbraco.services.imageHelper#getImagePropertyValue + * @methodOf umbraco.services.imageHelper + * @function + * + * @deprecated + */ + getImagePropertyValue: function (options) { + return mediaHelper.getImagePropertyValue(options); + }, + /** + * @ngdoc function + * @name umbraco.services.imageHelper#getThumbnail + * @methodOf umbraco.services.imageHelper + * @function + * + * @deprecated + */ + getThumbnail: function (options) { + return mediaHelper.getThumbnail(options); + }, + + /** + * @ngdoc function + * @name umbraco.services.imageHelper#scaleToMaxSize + * @methodOf umbraco.services.imageHelper + * @function + * + * @deprecated + */ + scaleToMaxSize: function (maxSize, width, height) { + return mediaHelper.scaleToMaxSize(maxSize, width, height); + }, + + /** + * @ngdoc function + * @name umbraco.services.imageHelper#getThumbnailFromPath + * @methodOf umbraco.services.imageHelper + * @function + * + * @deprecated + */ + getThumbnailFromPath: function (imagePath) { + return mediaHelper.getThumbnailFromPath(imagePath); + }, + + /** + * @ngdoc function + * @name umbraco.services.imageHelper#detectIfImageByExtension + * @methodOf umbraco.services.imageHelper + * @function + * + * @deprecated + */ + detectIfImageByExtension: function (imagePath) { + return mediaHelper.detectIfImageByExtension(imagePath); + } + }; +} +angular.module('umbraco.services').factory('imageHelper', imageHelper); +// This service was based on OpenJS library available in BSD License +// http://www.openjs.com/scripts/events/keyboard_shortcuts/index.php +angular.module('umbraco.services') +.factory('keyboardService', ['$window', '$timeout', function ($window, $timeout) { + var keyboardManagerService = {}; + var defaultOpt = { + 'type': 'keydown', + 'propagate': false, + 'inputDisabled': false, + 'target': $window.document, + 'keyCode': false + }; + + var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; + + // Store all keyboard combination shortcuts + keyboardManagerService.keyboardEvent = {}; + + + // Add a new keyboard combination shortcut + keyboardManagerService.bind = function (label, callback, opt) { + + //replace ctrl key with meta key + if(isMac && label !== "ctrl+space"){ + label = label.replace("ctrl","meta"); + } + + //always try to unbind first, so we dont have multiple actions on the same key + keyboardManagerService.unbind(label); + + var fct, elt, code, k; + // Initialize opt object + opt = angular.extend({}, defaultOpt, opt); + label = label.toLowerCase(); + elt = opt.target; + if(typeof opt.target === 'string'){ + elt = document.getElementById(opt.target); + } + + + fct = function (e) { + e = e || $window.event; + + // Disable event handler when focus input and textarea + if (opt['inputDisabled']) { + var elt; + if (e.target){ + elt = e.target; + }else if (e.srcElement){ + elt = e.srcElement; + } + + if (elt.nodeType === 3){elt = elt.parentNode;} + if (elt.tagName === 'INPUT' || elt.tagName === 'TEXTAREA'){return;} + } + + // Find out which key is pressed + if (e.keyCode){ + code = e.keyCode; + }else if (e.which){ + code = e.which; + } + + var character = String.fromCharCode(code).toLowerCase(); + + if (code === 188){character = ",";} // If the user presses , when the type is onkeydown + if (code === 190){character = ".";} // If the user presses , when the type is onkeydown + + var keys = label.split("+"); + // Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked + var kp = 0; + // Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken + var shift_nums = { + "`":"~", + "1":"!", + "2":"@", + "3":"#", + "4":"$", + "5":"%", + "6":"^", + "7":"&", + "8":"*", + "9":"(", + "0":")", + "-":"_", + "=":"+", + ";":":", + "'":"\"", + ",":"<", + ".":">", + "/":"?", + "\\":"|" + }; + // Special Keys - and their codes + var special_keys = { + 'esc':27, + 'escape':27, + 'tab':9, + 'space':32, + 'return':13, + 'enter':13, + 'backspace':8, + + 'scrolllock':145, + 'scroll_lock':145, + 'scroll':145, + 'capslock':20, + 'caps_lock':20, + 'caps':20, + 'numlock':144, + 'num_lock':144, + 'num':144, + + 'pause':19, + 'break':19, + + 'insert':45, + 'home':36, + 'delete':46, + 'end':35, + + 'pageup':33, + 'page_up':33, + 'pu':33, + + 'pagedown':34, + 'page_down':34, + 'pd':34, + + 'left':37, + 'up':38, + 'right':39, + 'down':40, + + 'f1':112, + 'f2':113, + 'f3':114, + 'f4':115, + 'f5':116, + 'f6':117, + 'f7':118, + 'f8':119, + 'f9':120, + 'f10':121, + 'f11':122, + 'f12':123 + }; + // Some modifiers key + var modifiers = { + shift: { + wanted: false, + pressed: e.shiftKey ? true : false + }, + ctrl : { + wanted: false, + pressed: e.ctrlKey ? true : false + }, + alt : { + wanted: false, + pressed: e.altKey ? true : false + }, + meta : { //Meta is Mac specific + wanted: false, + pressed: e.metaKey ? true : false + } + }; + // Foreach keys in label (split on +) + var l = keys.length; + for (var i = 0; i < l; i++) { + + var k=keys[i]; + switch (k) { + case 'ctrl': + case 'control': + kp++; + modifiers.ctrl.wanted = true; + break; + case 'shift': + case 'alt': + case 'meta': + kp++; + modifiers[k].wanted = true; + break; + } + + if (k.length > 1) { // If it is a special key + if(special_keys[k] === code){ + kp++; + } + + } else if (opt['keyCode']) { // If a specific key is set into the config + if (opt['keyCode'] === code) { + kp++; + } + + } else { // The special keys did not match + if(character === k) { + kp++; + }else { + if(shift_nums[character] && e.shiftKey) { // Stupid Shift key bug created by using lowercase + character = shift_nums[character]; + if(character === k){ + kp++; + } + } + } + } + + } //for end + + if(kp === keys.length && + modifiers.ctrl.pressed === modifiers.ctrl.wanted && + modifiers.shift.pressed === modifiers.shift.wanted && + modifiers.alt.pressed === modifiers.alt.wanted && + modifiers.meta.pressed === modifiers.meta.wanted) { + $timeout(function() { + callback(e); + }, 1); + + if(!opt['propagate']) { // Stop the event + // e.cancelBubble is supported by IE - this will kill the bubbling process. + e.cancelBubble = true; + e.returnValue = false; + + // e.stopPropagation works in Firefox. + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + return false; + } + } + }; + // Store shortcut + keyboardManagerService.keyboardEvent[label] = { + 'callback': fct, + 'target': elt, + 'event': opt['type'] + }; + + //Attach the function with the event + if(elt.addEventListener){ + elt.addEventListener(opt['type'], fct, false); + }else if(elt.attachEvent){ + elt.attachEvent('on' + opt['type'], fct); + }else{ + elt['on' + opt['type']] = fct; + } + }; + // Remove the shortcut - just specify the shortcut and I will remove the binding + keyboardManagerService.unbind = function (label) { + label = label.toLowerCase(); + var binding = keyboardManagerService.keyboardEvent[label]; + delete(keyboardManagerService.keyboardEvent[label]); + + if(!binding){return;} + + var type = binding['event'], + elt = binding['target'], + callback = binding['callback']; + + if(elt.detachEvent){ + elt.detachEvent('on' + type, callback); + }else if(elt.removeEventListener){ + elt.removeEventListener(type, callback, false); + }else{ + elt['on'+type] = false; + } + }; + // + + return keyboardManagerService; +}]); +angular.module('umbraco.services') +.factory('localizationService', function ($http, $q, eventsService, $window, $filter, userService) { + var service = { + // array to hold the localized resource string entries + dictionary:[], + // location of the resource file + url: "js/language.aspx", + // flag to indicate if the service hs loaded the resource file + resourceFileLoaded:false, + + // success handler for all server communication + successCallback:function (data) { + // store the returned array in the dictionary + service.dictionary = data; + // set the flag that the resource are loaded + service.resourceFileLoaded = true; + // broadcast that the file has been loaded + eventsService.emit("localizationService.updated", data); + }, + + // allows setting of language on the fly + setLanguage: function(value) { + service.initLocalizedResources(); + }, + + // allows setting of resource url on the fly + setUrl: function(value) { + service.url = value; + service.initLocalizedResources(); + }, + + // loads the language resource file from the server + initLocalizedResources:function () { + var deferred = $q.defer(); + // build the url to retrieve the localized resource file + $http({ method:"GET", url:service.url, cache:false }) + .then(function(response){ + service.resourceFileLoaded = true; + service.dictionary = response.data; + + eventsService.emit("localizationService.updated", service.dictionary); + + return deferred.resolve(service.dictionary); + }, function(err){ + return deferred.reject("Something broke"); + }); + return deferred.promise; + }, + + //helper to tokenize and compile a localization string + tokenize: function(value,scope) { + if(value){ + var localizer = value.split(':'); + var retval = {tokens: undefined, key: localizer[0].substring(0)}; + if(localizer.length > 1){ + retval.tokens = localizer[1].split(','); + for (var x = 0; x < retval.tokens.length; x++) { + retval.tokens[x] = scope.$eval(retval.tokens[x]); + } + } + + return retval; + } + }, + + // checks the dictionary for a localized resource string + localize: function(value,tokens) { + var deferred = $q.defer(); + + if(service.resourceFileLoaded){ + var val = service._lookup(value,tokens); + deferred.resolve(val); + }else{ + service.initLocalizedResources().then(function(dic){ + var val = service._lookup(value,tokens); + deferred.resolve(val); + }); + } + + return deferred.promise; + }, + _lookup: function(value,tokens){ + + //strip the key identifier if its there + if(value && value[0] === "@"){ + value = value.substring(1); + } + + //if no area specified, add general_ + if(value && value.indexOf("_") < 0){ + value = "general_" + value; + } + + var entry = service.dictionary[value]; + if(entry){ + if(tokens){ + for (var i = 0; i < tokens.length; i++) { + entry = entry.replace("%"+i+"%", tokens[i]); + } + } + return entry; + } + return "[" + value + "]"; + } + }; + + // force the load of the resource file + service.initLocalizedResources(); + + //This happens after login / auth and assets loading + eventsService.on("app.authenticated", function(){ + service.resourceFileLoaded = false; + }); + + // return the local instance when called + return service; + }); +/** + * @ngdoc service + * @name umbraco.services.macroService + * + * + * @description + * A service to return macro information such as generating syntax to insert a macro into an editor + */ +function macroService() { + + return { + + /** parses the special macro syntax like and returns an object with the macro alias and it's parameters */ + parseMacroSyntax: function (syntax) { + + var expression = /(<\?UMBRACO_MACRO macroAlias=["']([\w\.]+?)["'][\s\S]+?)(\/>|>.*?<\/\?UMBRACO_MACRO>)/i; + var match = expression.exec(syntax); + if (!match || match.length < 3) { + return null; + } + var alias = match[2]; + + //this will leave us with just the parameters + var paramsChunk = match[1].trim().replace(new RegExp("UMBRACO_MACRO macroAlias=[\"']" + alias + "[\"']"), "").trim(); + + var paramExpression = /(\w+?)=['\"]([\s\S]*?)['\"]/g; + + var paramMatch; + var returnVal = { + macroAlias: alias, + macroParamsDictionary: {} + }; + while (paramMatch = paramExpression.exec(paramsChunk)) { + returnVal.macroParamsDictionary[paramMatch[1]] = paramMatch[2]; + } + return returnVal; + }, + + /** + * @ngdoc function + * @name umbraco.services.macroService#generateWebFormsSyntax + * @methodOf umbraco.services.macroService + * @function + * + * @description + * generates the syntax for inserting a macro into a rich text editor - this is the very old umbraco style syntax + * + * @param {object} args an object containing the macro alias and it's parameter values + */ + generateMacroSyntax: function (args) { + + // + + var macroString = '"; + + return macroString; + }, + + /** + * @ngdoc function + * @name umbraco.services.macroService#generateWebFormsSyntax + * @methodOf umbraco.services.macroService + * @function + * + * @description + * generates the syntax for inserting a macro into a webforms templates + * + * @param {object} args an object containing the macro alias and it's parameter values + */ + generateWebFormsSyntax: function(args) { + + var macroString = '"; + + return macroString; + }, + + /** + * @ngdoc function + * @name umbraco.services.macroService#generateMvcSyntax + * @methodOf umbraco.services.macroService + * @function + * + * @description + * generates the syntax for inserting a macro into an mvc template + * + * @param {object} args an object containing the macro alias and it's parameter values + */ + generateMvcSyntax: function (args) { + + var macroString = "@Umbraco.RenderMacro(\"" + args.macroAlias + "\""; + + var hasParams = false; + var paramString; + if (args.macroParamsDictionary) { + + paramString = ", new {"; + + _.each(args.macroParamsDictionary, function(val, key) { + + hasParams = true; + + var keyVal = key + "=\"" + (val ? val : "") + "\", "; + + paramString += keyVal; + }); + + //remove the last , + paramString = paramString.trimEnd(", "); + + paramString += "}"; + } + if (hasParams) { + macroString += paramString; + } + + macroString += ")"; + return macroString; + } + + }; + +} + +angular.module('umbraco.services').factory('macroService', macroService); +/** +* @ngdoc service +* @name umbraco.services.mediaHelper +* @description A helper object used for dealing with media items +**/ +function mediaHelper(umbRequestHelper) { + + //container of fileresolvers + var _mediaFileResolvers = {}; + + return { + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getImagePropertyValue + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the file path associated with the media property if there is one + * + * @param {object} options Options object + * @param {object} options.mediaModel The media object to retrieve the image path from + * @param {object} options.imageOnly Optional, if true then will only return a path if the media item is an image + */ + getMediaPropertyValue: function (options) { + if (!options || !options.mediaModel) { + throw "The options objet does not contain the required parameters: mediaModel"; + } + + //combine all props, TODO: we really need a better way then this + var props = []; + if (options.mediaModel.properties) { + props = options.mediaModel.properties; + } else { + $(options.mediaModel.tabs).each(function (i, tab) { + props = props.concat(tab.properties); + }); + } + + var mediaRoot = Umbraco.Sys.ServerVariables.umbracoSettings.mediaPath; + var imageProp = _.find(props, function (item) { + if (item.alias === "umbracoFile") { + return true; + } + + //this performs a simple check to see if we have a media file as value + //it doesnt catch everything, but better then nothing + if (angular.isString(item.value) && item.value.indexOf(mediaRoot) === 0) { + return true; + } + + return false; + }); + + if (!imageProp) { + return ""; + } + + var mediaVal; + + //our default images might store one or many images (as csv) + var split = imageProp.value.split(','); + var self = this; + mediaVal = _.map(split, function (item) { + return { file: item, isImage: self.detectIfImageByExtension(item) }; + }); + + //for now we'll just return the first image in the collection. + //TODO: we should enable returning many to be displayed in the picker if the uploader supports many. + if (mediaVal.length && mediaVal.length > 0) { + if (!options.imageOnly || (options.imageOnly === true && mediaVal[0].isImage)) { + return mediaVal[0].file; + } + } + + return ""; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getImagePropertyValue + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the actual image path associated with the image property if there is one + * + * @param {object} options Options object + * @param {object} options.imageModel The media object to retrieve the image path from + */ + getImagePropertyValue: function (options) { + if (!options || (!options.imageModel && !options.mediaModel)) { + throw "The options objet does not contain the required parameters: imageModel"; + } + + //required to support backwards compatibility. + options.mediaModel = options.imageModel ? options.imageModel : options.mediaModel; + + options.imageOnly = true; + + return this.getMediaPropertyValue(options); + }, + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getThumbnail + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * formats the display model used to display the content to the model used to save the content + * + * @param {object} options Options object + * @param {object} options.imageModel The media object to retrieve the image path from + */ + getThumbnail: function (options) { + + if (!options || !options.imageModel) { + throw "The options objet does not contain the required parameters: imageModel"; + } + + var imagePropVal = this.getImagePropertyValue(options); + if (imagePropVal !== "") { + return this.getThumbnailFromPath(imagePropVal); + } + return ""; + }, + + registerFileResolver: function(propertyEditorAlias, func){ + _mediaFileResolvers[propertyEditorAlias] = func; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#resolveFileFromEntity + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Gets the media file url for a media entity returned with the entityResource + * + * @param {object} mediaEntity A media Entity returned from the entityResource + * @param {boolean} thumbnail Whether to return the thumbnail url or normal url + */ + resolveFileFromEntity : function(mediaEntity, thumbnail) { + + if (!angular.isObject(mediaEntity.metaData)) { + throw "Cannot resolve the file url from the mediaEntity, it does not contain the required metaData"; + } + + var values = _.values(mediaEntity.metaData); + for (var i = 0; i < values.length; i++) { + var val = values[i]; + if (angular.isObject(val) && val.PropertyEditorAlias) { + for (var resolver in _mediaFileResolvers) { + if (val.PropertyEditorAlias === resolver) { + //we need to format a property variable that coincides with how the property would be structured + // if it came from the mediaResource just to keep things slightly easier for the file resolvers. + var property = { value: val.Value }; + + return _mediaFileResolvers[resolver](property, mediaEntity, thumbnail); + } + } + } + } + + return ""; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#resolveFile + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Gets the media file url for a media object returned with the mediaResource + * + * @param {object} mediaEntity A media Entity returned from the entityResource + * @param {boolean} thumbnail Whether to return the thumbnail url or normal url + */ + /*jshint loopfunc: true */ + resolveFile : function(mediaItem, thumbnail){ + + function iterateProps(props){ + var res = null; + for(var resolver in _mediaFileResolvers) { + var property = _.find(props, function(prop){ return prop.editor === resolver; }); + if(property){ + res = _mediaFileResolvers[resolver](property, mediaItem, thumbnail); + break; + } + } + + return res; + } + + //we either have properties raw on the object, or spread out on tabs + var result = ""; + if(mediaItem.properties){ + result = iterateProps(mediaItem.properties); + }else if(mediaItem.tabs){ + for(var tab in mediaItem.tabs) { + if(mediaItem.tabs[tab].properties){ + result = iterateProps(mediaItem.tabs[tab].properties); + if(result){ + break; + } + } + } + } + return result; + }, + + /*jshint loopfunc: true */ + hasFilePropertyType : function(mediaItem){ + function iterateProps(props){ + var res = false; + for(var resolver in _mediaFileResolvers) { + var property = _.find(props, function(prop){ return prop.editor === resolver; }); + if(property){ + res = true; + break; + } + } + return res; + } + + //we either have properties raw on the object, or spread out on tabs + var result = false; + if(mediaItem.properties){ + result = iterateProps(mediaItem.properties); + }else if(mediaItem.tabs){ + for(var tab in mediaItem.tabs) { + if(mediaItem.tabs[tab].properties){ + result = iterateProps(mediaItem.tabs[tab].properties); + if(result){ + break; + } + } + } + } + return result; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#scaleToMaxSize + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Finds the corrct max width and max height, given maximum dimensions and keeping aspect ratios + * + * @param {number} maxSize Maximum width & height + * @param {number} width Current width + * @param {number} height Current height + */ + scaleToMaxSize: function (maxSize, width, height) { + var retval = { width: width, height: height }; + + var maxWidth = maxSize; // Max width for the image + var maxHeight = maxSize; // Max height for the image + var ratio = 0; // Used for aspect ratio + + // Check if the current width is larger than the max + if (width > maxWidth) { + ratio = maxWidth / width; // get ratio for scaling image + + retval.width = maxWidth; + retval.height = height * ratio; + + height = height * ratio; // Reset height to match scaled image + width = width * ratio; // Reset width to match scaled image + } + + // Check if current height is larger than max + if (height > maxHeight) { + ratio = maxHeight / height; // get ratio for scaling image + + retval.height = maxHeight; + retval.width = width * ratio; + width = width * ratio; // Reset width to match scaled image + } + + return retval; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getThumbnailFromPath + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the path to the thumbnail version of a given media library image path + * + * @param {string} imagePath Image path, ex: /media/1234/my-image.jpg + */ + getThumbnailFromPath: function (imagePath) { + + //If the path is not an image we cannot get a thumb + if (!this.detectIfImageByExtension(imagePath)) { + return null; + } + + //get the proxy url for big thumbnails (this ensures one is always generated) + var thumbnailUrl = umbRequestHelper.getApiUrl( + "imagesApiBaseUrl", + "GetBigThumbnail", + [{ originalImagePath: imagePath }]); + + //var ext = imagePath.substr(imagePath.lastIndexOf('.')); + //return imagePath.substr(0, imagePath.lastIndexOf('.')) + "_big-thumb" + ".jpg"; + + return thumbnailUrl; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#detectIfImageByExtension + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns true/false, indicating if the given path has an allowed image extension + * + * @param {string} imagePath Image path, ex: /media/1234/my-image.jpg + */ + detectIfImageByExtension: function (imagePath) { + var lowered = imagePath.toLowerCase(); + var ext = lowered.substr(lowered.lastIndexOf(".") + 1); + return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1; + } + + }; +} +angular.module('umbraco.services').factory('mediaHelper', mediaHelper); +/** + * @ngdoc service + * @name umbraco.services.umbracoMenuActions + * + * @requires q + * @requires treeService + * + * @description + * Defines the methods that are called when menu items declare only an action to execute + */ +function umbracoMenuActions($q, treeService, $location, navigationService, appState) { + + return { + + /** + * @ngdoc method + * @name umbraco.services.umbracoMenuActions#RefreshNode + * @methodOf umbraco.services.umbracoMenuActions + * @function + * + * @description + * Clears all node children and then gets it's up-to-date children from the server and re-assigns them + * @param {object} args An arguments object + * @param {object} args.entity The basic entity being acted upon + * @param {object} args.treeAlias The tree alias associated with this entity + * @param {object} args.section The current section + */ + "RefreshNode": function (args) { + + ////just in case clear any tree cache for this node/section + //treeService.clearCache({ + // cacheKey: "__" + args.section, //each item in the tree cache is cached by the section name + // childrenOf: args.entity.parentId //clear the children of the parent + //}); + + //since we're dealing with an entity, we need to attempt to find it's tree node, in the main tree + // this action is purely a UI thing so if for whatever reason there is no loaded tree node in the UI + // we can safely ignore this process. + + //to find a visible tree node, we'll go get the currently loaded root node from appState + var treeRoot = appState.getTreeState("currentRootNode"); + if (treeRoot && treeRoot.root) { + var treeNode = treeService.getDescendantNode(treeRoot.root, args.entity.id, args.treeAlias); + if (treeNode) { + treeService.loadNodeChildren({ node: treeNode, section: args.section }); + } + } + + + }, + + /** + * @ngdoc method + * @name umbraco.services.umbracoMenuActions#CreateChildEntity + * @methodOf umbraco.services.umbracoMenuActions + * @function + * + * @description + * This will re-route to a route for creating a new entity as a child of the current node + * @param {object} args An arguments object + * @param {object} args.entity The basic entity being acted upon + * @param {object} args.treeAlias The tree alias associated with this entity + * @param {object} args.section The current section + */ + "CreateChildEntity": function (args) { + + navigationService.hideNavigation(); + + var route = "/" + args.section + "/" + args.treeAlias + "/edit/" + args.entity.id; + //change to new path + $location.path(route).search({ create: true }); + + } + }; +} + +angular.module('umbraco.services').factory('umbracoMenuActions', umbracoMenuActions); +/** + * @ngdoc service + * @name umbraco.services.navigationService + * + * @requires $rootScope + * @requires $routeParams + * @requires $log + * @requires $location + * @requires dialogService + * @requires treeService + * @requires sectionResource + * + * @description + * Service to handle the main application navigation. Responsible for invoking the tree + * Section navigation and search, and maintain their state for the entire application lifetime + * + */ +function navigationService($rootScope, $routeParams, $log, $location, $q, $timeout, $injector, dialogService, umbModelMapper, treeService, notificationsService, historyService, appState, angularHelper) { + + var minScreenSize = 1100; + //used to track the current dialog object + var currentDialog = null; + //tracks the screen size as a tablet + var isTablet = false; + //the main tree event handler, which gets assigned via the setupTreeEvents method + var mainTreeEventHandler = null; + //tracks the user profile dialog + var userDialog = null; + + function setTreeMode() { + isTablet = ($(window).width() <= minScreenSize); + appState.setGlobalState("showNavigation", !isTablet); + } + + function setMode(mode) { + switch (mode) { + case 'tree': + appState.setGlobalState("navMode", "tree"); + appState.setGlobalState("showNavigation", true); + appState.setMenuState("showMenu", false); + appState.setMenuState("showMenuDialog", false); + appState.setGlobalState("stickyNavigation", false); + appState.setGlobalState("showTray", false); + + //$("#search-form input").focus(); + break; + case 'menu': + appState.setGlobalState("navMode", "menu"); + appState.setGlobalState("showNavigation", true); + appState.setMenuState("showMenu", true); + appState.setMenuState("showMenuDialog", false); + appState.setGlobalState("stickyNavigation", true); + break; + case 'dialog': + appState.setGlobalState("navMode", "dialog"); + appState.setGlobalState("stickyNavigation", true); + appState.setGlobalState("showNavigation", true); + appState.setMenuState("showMenu", false); + appState.setMenuState("showMenuDialog", true); + break; + case 'search': + appState.setGlobalState("navMode", "search"); + appState.setGlobalState("stickyNavigation", false); + appState.setGlobalState("showNavigation", true); + appState.setMenuState("showMenu", false); + appState.setSectionState("showSearchResults", true); + appState.setMenuState("showMenuDialog", false); + + //TODO: This would be much better off in the search field controller listening to appState changes + $timeout(function() { + $("#search-field").focus(); + }); + + break; + default: + appState.setGlobalState("navMode", "default"); + appState.setMenuState("showMenu", false); + appState.setMenuState("showMenuDialog", false); + appState.setSectionState("showSearchResults", false); + appState.setGlobalState("stickyNavigation", false); + appState.setGlobalState("showTray", false); + + if (isTablet) { + appState.setGlobalState("showNavigation", false); + } + + break; + } + } + + var service = { + + /** initializes the navigation service */ + init: function() { + + setTreeMode(); + + //keep track of the current section - initially this will always be undefined so + // no point in setting it now until it changes. + $rootScope.$watch(function () { + return $routeParams.section; + }, function (newVal, oldVal) { + appState.setSectionState("currentSection", newVal); + }); + + //TODO: This does not belong here - would be much better off in a directive + $(window).bind("resize", function() { + setTreeMode(); + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#load + * @methodOf umbraco.services.navigationService + * + * @description + * Shows the legacy iframe and loads in the content based on the source url + * @param {String} source The URL to load into the iframe + */ + loadLegacyIFrame: function (source) { + $location.path("/" + appState.getSectionState("currentSection") + "/framed/" + encodeURIComponent(source)); + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#changeSection + * @methodOf umbraco.services.navigationService + * + * @description + * Changes the active section to a given section alias + * If the navigation is 'sticky' this will load the associated tree + * and load the dashboard related to the section + * @param {string} sectionAlias The alias of the section + */ + changeSection: function(sectionAlias, force) { + setMode("default-opensection"); + + if (force && appState.getSectionState("currentSection") === sectionAlias) { + appState.setSectionState("currentSection", ""); + } + + appState.setSectionState("currentSection", sectionAlias); + this.showTree(sectionAlias); + + $location.path(sectionAlias); + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#showTree + * @methodOf umbraco.services.navigationService + * + * @description + * Displays the tree for a given section alias but turning on the containing dom element + * only changes if the section is different from the current one + * @param {string} sectionAlias The alias of the section to load + * @param {Object} syncArgs Optional object of arguments for syncing the tree for the section being shown + */ + showTree: function (sectionAlias, syncArgs) { + if (sectionAlias !== appState.getSectionState("currentSection")) { + appState.setSectionState("currentSection", sectionAlias); + + if (syncArgs) { + this.syncTree(syncArgs); + } + } + setMode("tree"); + }, + + showTray: function () { + appState.setGlobalState("showTray", true); + }, + + hideTray: function () { + appState.setGlobalState("showTray", false); + }, + + /** + Called to assign the main tree event handler - this is called by the navigation controller. + TODO: Potentially another dev could call this which would kind of mung the whole app so potentially there's a better way. + */ + setupTreeEvents: function(treeEventHandler) { + mainTreeEventHandler = treeEventHandler; + + //when a tree is loaded into a section, we need to put it into appState + mainTreeEventHandler.bind("treeLoaded", function(ev, args) { + appState.setTreeState("currentRootNode", args.tree); + }); + + //when a tree node is synced this event will fire, this allows us to set the currentNode + mainTreeEventHandler.bind("treeSynced", function (ev, args) { + + if (args.activate === undefined || args.activate === true) { + //set the current selected node + appState.setTreeState("selectedNode", args.node); + //when a node is activated, this is the same as clicking it and we need to set the + //current menu item to be this node as well. + appState.setMenuState("currentNode", args.node); + } + }); + + //this reacts to the options item in the tree + mainTreeEventHandler.bind("treeOptionsClick", function(ev, args) { + ev.stopPropagation(); + ev.preventDefault(); + + //Set the current action node (this is not the same as the current selected node!) + appState.setMenuState("currentNode", args.node); + + if (args.event && args.event.altKey) { + args.skipDefault = true; + } + + service.showMenu(ev, args); + }); + + mainTreeEventHandler.bind("treeNodeAltSelect", function(ev, args) { + ev.stopPropagation(); + ev.preventDefault(); + + args.skipDefault = true; + service.showMenu(ev, args); + }); + + //this reacts to tree items themselves being clicked + //the tree directive should not contain any handling, simply just bubble events + mainTreeEventHandler.bind("treeNodeSelect", function(ev, args) { + var n = args.node; + ev.stopPropagation(); + ev.preventDefault(); + + if (n.metaData && n.metaData["jsClickCallback"] && angular.isString(n.metaData["jsClickCallback"]) && n.metaData["jsClickCallback"] !== "") { + //this is a legacy tree node! + var jsPrefix = "javascript:"; + var js; + if (n.metaData["jsClickCallback"].startsWith(jsPrefix)) { + js = n.metaData["jsClickCallback"].substr(jsPrefix.length); + } + else { + js = n.metaData["jsClickCallback"]; + } + try { + var func = eval(js); + //this is normally not necessary since the eval above should execute the method and will return nothing. + if (func != null && (typeof func === "function")) { + func.call(); + } + } + catch(ex) { + $log.error("Error evaluating js callback from legacy tree node: " + ex); + } + } + else if (n.routePath) { + //add action to the history service + historyService.add({ name: n.name, link: n.routePath, icon: n.icon }); + + //put this node into the tree state + appState.setTreeState("selectedNode", args.node); + //when a node is clicked we also need to set the active menu node to this node + appState.setMenuState("currentNode", args.node); + + //not legacy, lets just set the route value and clear the query string if there is one. + $location.path(n.routePath).search(""); + } + else if (args.element.section) { + $location.path(args.element.section).search(""); + } + + service.hideNavigation(); + }); + }, + /** + * @ngdoc method + * @name umbraco.services.navigationService#syncTree + * @methodOf umbraco.services.navigationService + * + * @description + * Syncs a tree with a given path, returns a promise + * The path format is: ["itemId","itemId"], and so on + * so to sync to a specific document type node do: + *
    +         * navigationService.syncTree({tree: 'content', path: ["-1","123d"], forceReload: true});  
    +         * 
    + * @param {Object} args arguments passed to the function + * @param {String} args.tree the tree alias to sync to + * @param {Array} args.path the path to sync the tree to + * @param {Boolean} args.forceReload optional, specifies whether to force reload the node data from the server even if it already exists in the tree currently + * @param {Boolean} args.activate optional, specifies whether to set the synced node to be the active node, this will default to true if not specified + */ + syncTree: function (args) { + if (!args) { + throw "args cannot be null"; + } + if (!args.path) { + throw "args.path cannot be null"; + } + if (!args.tree) { + throw "args.tree cannot be null"; + } + + if (mainTreeEventHandler) { + //returns a promise + return mainTreeEventHandler.syncTree(args); + } + + //couldn't sync + return angularHelper.rejectedPromise(); + }, + + /** + Internal method that should ONLY be used by the legacy API wrapper, the legacy API used to + have to set an active tree and then sync, the new API does this in one method by using syncTree + */ + _syncPath: function(path, forceReload) { + if (mainTreeEventHandler) { + mainTreeEventHandler.syncTree({ path: path, forceReload: forceReload }); + } + }, + + //TODO: This should return a promise + reloadNode: function(node) { + if (mainTreeEventHandler) { + mainTreeEventHandler.reloadNode(node); + } + }, + + //TODO: This should return a promise + reloadSection: function(sectionAlias) { + if (mainTreeEventHandler) { + mainTreeEventHandler.clearCache({ section: sectionAlias }); + mainTreeEventHandler.load(sectionAlias); + } + }, + + /** + Internal method that should ONLY be used by the legacy API wrapper, the legacy API used to + have to set an active tree and then sync, the new API does this in one method by using syncTreePath + */ + _setActiveTreeType: function (treeAlias, loadChildren) { + if (mainTreeEventHandler) { + mainTreeEventHandler._setActiveTreeType(treeAlias, loadChildren); + } + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#hideTree + * @methodOf umbraco.services.navigationService + * + * @description + * Hides the tree by hiding the containing dom element + */ + hideTree: function() { + + if (isTablet && !appState.getGlobalState("stickyNavigation")) { + //reset it to whatever is in the url + appState.setSectionState("currentSection", $routeParams.section); + setMode("default-hidesectiontree"); + } + + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#showMenu + * @methodOf umbraco.services.navigationService + * + * @description + * Hides the tree by hiding the containing dom element. + * This always returns a promise! + * + * @param {Event} event the click event triggering the method, passed from the DOM element + */ + showMenu: function(event, args) { + + var deferred = $q.defer(); + var self = this; + + treeService.getMenu({ treeNode: args.node }) + .then(function(data) { + + //check for a default + //NOTE: event will be undefined when a call to hideDialog is made so it won't re-load the default again. + // but perhaps there's a better way to deal with with an additional parameter in the args ? it works though. + if (data.defaultAlias && !args.skipDefault) { + + var found = _.find(data.menuItems, function(item) { + return item.alias = data.defaultAlias; + }); + + if (found) { + + //NOTE: This is assigning the current action node - this is not the same as the currently selected node! + appState.setMenuState("currentNode", args.node); + + //ensure the current dialog is cleared before creating another! + if (currentDialog) { + dialogService.close(currentDialog); + } + + var dialog = self.showDialog({ + node: args.node, + action: found, + section: appState.getSectionState("currentSection") + }); + + //return the dialog this is opening. + deferred.resolve(dialog); + return; + } + } + + //there is no default or we couldn't find one so just continue showing the menu + + setMode("menu"); + + appState.setMenuState("currentNode", args.node); + appState.setMenuState("menuActions", data.menuItems); + appState.setMenuState("dialogTitle", args.node.name); + + //we're not opening a dialog, return null. + deferred.resolve(null); + }); + + return deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#hideMenu + * @methodOf umbraco.services.navigationService + * + * @description + * Hides the menu by hiding the containing dom element + */ + hideMenu: function() { + //SD: Would we ever want to access the last action'd node instead of clearing it here? + appState.setMenuState("currentNode", null); + appState.setMenuState("menuActions", []); + setMode("tree"); + }, + + /** Executes a given menu action */ + executeMenuAction: function (action, node, section) { + + if (!action) { + throw "action cannot be null"; + } + if (!node) { + throw "node cannot be null"; + } + if (!section) { + throw "section cannot be null"; + } + + if (action.metaData && action.metaData["actionRoute"] && angular.isString(action.metaData["actionRoute"])) { + //first check if the menu item simply navigates to a route + var parts = action.metaData["actionRoute"].split("?"); + $location.path(parts[0]).search(parts.length > 1 ? parts[1] : ""); + this.hideNavigation(); + return; + } + else if (action.metaData && action.metaData["jsAction"] && angular.isString(action.metaData["jsAction"])) { + + //we'll try to get the jsAction from the injector + var menuAction = action.metaData["jsAction"].split('.'); + if (menuAction.length !== 2) { + + //if it is not two parts long then this most likely means that it's a legacy action + var js = action.metaData["jsAction"].replace("javascript:", ""); + //there's not really a different way to acheive this except for eval + eval(js); + } + else { + var menuActionService = $injector.get(menuAction[0]); + if (!menuActionService) { + throw "The angular service " + menuAction[0] + " could not be found"; + } + + var method = menuActionService[menuAction[1]]; + + if (!method) { + throw "The method " + menuAction[1] + " on the angular service " + menuAction[0] + " could not be found"; + } + + method.apply(this, [{ + //map our content object to a basic entity to pass in to the menu handlers, + //this is required for consistency since a menu item needs to be decoupled from a tree node since the menu can + //exist standalone in the editor for which it can only pass in an entity (not tree node). + entity: umbModelMapper.convertToEntityBasic(node), + action: action, + section: section, + treeAlias: treeService.getTreeAlias(node) + }]); + } + } + else { + service.showDialog({ + node: node, + action: action, + section: section + }); + } + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#showUserDialog + * @methodOf umbraco.services.navigationService + * + * @description + * Opens the user dialog, next to the sections navigation + * template is located in views/common/dialogs/user.html + */ + showUserDialog: function() { + + if(userDialog){ + userDialog.close(); + userDialog = null; + } + + userDialog = dialogService.open( + { + template: "views/common/dialogs/user.html", + modalClass: "umb-modal-left", + show: true + }); + + + + return userDialog; + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#showUserDialog + * @methodOf umbraco.services.navigationService + * + * @description + * Opens the user dialog, next to the sections navigation + * template is located in views/common/dialogs/user.html + */ + showHelpDialog: function() { + if(service.helpDialog){ + service.helpDialog.close(); + service.helpDialog = undefined; + } + + service.helpDialog = dialogService.open( + { + template: "views/common/dialogs/help.html", + modalClass: "umb-modal-left", + show: true + }); + + return service.helpDialog; + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#showDialog + * @methodOf umbraco.services.navigationService + * + * @description + * Opens a dialog, for a given action on a given tree node + * uses the dialogService to inject the selected action dialog + * into #dialog div.umb-panel-body + * the path to the dialog view is determined by: + * "views/" + current tree + "/" + action alias + ".html" + * The dialog controller will get passed a scope object that is created here with the properties: + * scope.currentNode = the selected tree node + * scope.currentAction = the selected menu item + * so that the dialog controllers can use these properties + * + * @param {Object} args arguments passed to the function + * @param {Scope} args.scope current scope passed to the dialog + * @param {Object} args.action the clicked action containing `name` and `alias` + */ + showDialog: function(args) { + + if (!args) { + throw "showDialog is missing the args parameter"; + } + if (!args.action) { + throw "The args parameter must have an 'action' property as the clicked menu action object"; + } + if (!args.node) { + throw "The args parameter must have a 'node' as the active tree node"; + } + + //ensure the current dialog is cleared before creating another! + if (currentDialog) { + dialogService.close(currentDialog); + } + + setMode("dialog"); + + //NOTE: Set up the scope object and assign properties, this is legacy functionality but we have to live with it now. + // we should be passing in currentNode and currentAction using 'dialogData' for the dialog, not attaching it to a scope. + // This scope instance will be destroyed by the dialog so it cannot be a scope that exists outside of the dialog. + // If a scope instance has been passed in, we'll have to create a child scope of it, otherwise a new root scope. + var dialogScope = args.scope ? args.scope.$new() : $rootScope.$new(); + dialogScope.currentNode = args.node; + dialogScope.currentAction = args.action; + + //the title might be in the meta data, check there first + if (args.action.metaData["dialogTitle"]) { + appState.setMenuState("dialogTitle", args.action.metaData["dialogTitle"]); + } + else { + appState.setMenuState("dialogTitle", args.action.name); + } + + var templateUrl; + var iframe; + + if (args.action.metaData["actionUrl"]) { + templateUrl = args.action.metaData["actionUrl"]; + iframe = true; + } + else if (args.action.metaData["actionView"]) { + templateUrl = args.action.metaData["actionView"]; + iframe = false; + } + else { + + //by convention we will look into the /views/{treetype}/{action}.html + // for example: /views/content/create.html + + //we will also check for a 'packageName' for the current tree, if it exists then the convention will be: + // for example: /App_Plugins/{mypackage}/backoffice/{treetype}/create.html + + var treeAlias = treeService.getTreeAlias(args.node); + var packageTreeFolder = treeService.getTreePackageFolder(treeAlias); + + if (!treeAlias) { + throw "Could not get tree alias for node " + args.node.id; + } + + if (packageTreeFolder) { + templateUrl = Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath + + "/" + packageTreeFolder + + "/backoffice/" + treeAlias + "/" + args.action.alias + ".html"; + } + else { + templateUrl = "views/" + treeAlias + "/" + args.action.alias + ".html"; + } + + iframe = false; + } + + //TODO: some action's want to launch a new window like live editing, we support this in the menu item's metadata with + // a key called: "actionUrlMethod" which can be set to either: Dialog, BlankWindow. Normally this is always set to Dialog + // if a URL is specified in the "actionUrl" metadata. For now I'm not going to implement launching in a blank window, + // though would be v-easy, just not sure we want to ever support that? + + var dialog = dialogService.open( + { + container: $("#dialog div.umb-modalcolumn-body"), + //The ONLY reason we're passing in scope to the dialogService (which is legacy functionality) is + // for backwards compatibility since many dialogs require $scope.currentNode or $scope.currentAction + // to exist + scope: dialogScope, + inline: true, + show: true, + iframe: iframe, + modalClass: "umb-dialog", + template: templateUrl, + + //These will show up on the dialog controller's $scope under dialogOptions + currentNode: args.node, + currentAction: args.action, + }); + + //save the currently assigned dialog so it can be removed before a new one is created + currentDialog = dialog; + return dialog; + }, + + /** + * @ngdoc method + * @name umbraco.services.navigationService#hideDialog + * @methodOf umbraco.services.navigationService + * + * @description + * hides the currently open dialog + */ + hideDialog: function (showMenu) { + + setMode("default"); + + if(showMenu){ + this.showMenu(undefined, { skipDefault: true, node: appState.getMenuState("currentNode") }); + } + }, + /** + * @ngdoc method + * @name umbraco.services.navigationService#showSearch + * @methodOf umbraco.services.navigationService + * + * @description + * shows the search pane + */ + showSearch: function() { + setMode("search"); + }, + /** + * @ngdoc method + * @name umbraco.services.navigationService#hideSearch + * @methodOf umbraco.services.navigationService + * + * @description + * hides the search pane + */ + hideSearch: function() { + setMode("default-hidesearch"); + }, + /** + * @ngdoc method + * @name umbraco.services.navigationService#hideNavigation + * @methodOf umbraco.services.navigationService + * + * @description + * hides any open navigation panes and resets the tree, actions and the currently selected node + */ + hideNavigation: function() { + appState.setMenuState("menuActions", []); + setMode("default"); + } + }; + + return service; +} + +angular.module('umbraco.services').factory('navigationService', navigationService); + +/** + * @ngdoc service + * @name umbraco.services.notificationsService + * + * @requires $rootScope + * @requires $timeout + * @requires angularHelper + * + * @description + * Application-wide service for handling notifications, the umbraco application + * maintains a single collection of notications, which the UI watches for changes. + * By default when a notication is added, it is automaticly removed 7 seconds after + * This can be changed on add() + * + * ##usage + * To use, simply inject the notificationsService into any controller that needs it, and make + * sure the umbraco.services module is accesible - which it should be by default. + * + *
    + *		notificationsService.success("Document Published", "hooraaaay for you!");
    + *      notificationsService.error("Document Failed", "booooh");
    + * 
    + */ +angular.module('umbraco.services') +.factory('notificationsService', function ($rootScope, $timeout, angularHelper) { + + var nArray = []; + function setViewPath(view){ + if(view.indexOf('/') < 0) + { + view = "views/common/notifications/" + view; + } + + if(view.indexOf('.html') < 0) + { + view = view + ".html"; + } + return view; + } + + var service = { + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#add + * @methodOf umbraco.services.notificationsService + * + * @description + * Lower level api for adding notifcations, support more advanced options + * @param {Object} item The notification item + * @param {String} item.headline Short headline + * @param {String} item.message longer text for the notication, trimmed after 200 characters, which can then be exanded + * @param {String} item.type Notification type, can be: "success","warning","error" or "info" + * @param {String} item.url url to open when notification is clicked + * @param {String} item.view path to custom view to load into the notification box + * @param {Array} item.actions Collection of button actions to append (label, func, cssClass) + * @param {Boolean} item.sticky if set to true, the notification will not auto-close + * @returns {Object} args notification object + */ + + add: function(item) { + angularHelper.safeApply($rootScope, function () { + + if(item.view){ + item.view = setViewPath(item.view); + item.sticky = true; + item.type = "form"; + item.headline = null; + } + + + //add a colon after the headline if there is a message as well + if (item.message) { + item.headline += ": "; + if(item.message.length > 200) { + item.sticky = true; + } + } + + //we need to ID the item, going by index isn't good enough because people can remove at different indexes + // whenever they want. Plus once we remove one, then the next index will be different. The only way to + // effectively remove an item is by an Id. + item.id = String.CreateGuid(); + + nArray.push(item); + + if(!item.sticky) { + $timeout(function() { + var found = _.find(nArray, function(i) { + return i.id === item.id; + }); + + if (found) { + var index = nArray.indexOf(found); + nArray.splice(index, 1); + } + + }, 7000); + } + + return item; + }); + + }, + + hasView : function(view){ + if(!view){ + return _.find(nArray, function(notification){ return notification.view;}); + }else{ + view = setViewPath(view).toLowerCase(); + return _.find(nArray, function(notification){ return notification.view.toLowerCase() === view;}); + } + }, + addView: function(view, args){ + var item = { + args: args, + view: view + }; + + service.add(item); + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#showNotification + * @methodOf umbraco.services.notificationsService + * + * @description + * Shows a notification based on the object passed in, normally used to render notifications sent back from the server + * + * @returns {Object} args notification object + */ + showNotification: function(args) { + if (!args) { + throw "args cannot be null"; + } + if (args.type === undefined || args.type === null) { + throw "args.type cannot be null"; + } + if (!args.header) { + throw "args.header cannot be null"; + } + + switch(args.type) { + case 0: + //save + this.success(args.header, args.message); + break; + case 1: + //info + this.success(args.header, args.message); + break; + case 2: + //error + this.error(args.header, args.message); + break; + case 3: + //success + this.success(args.header, args.message); + break; + case 4: + //warning + this.warning(args.header, args.message); + break; + } + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#success + * @methodOf umbraco.services.notificationsService + * + * @description + * Adds a green success notication to the notications collection + * This should be used when an operations *completes* without errors + * + * @param {String} headline Headline of the notification + * @param {String} message longer text for the notication, trimmed after 200 characters, which can then be exanded + * @returns {Object} notification object + */ + success: function (headline, message) { + return service.add({ headline: headline, message: message, type: 'success', time: new Date() }); + }, + /** + * @ngdoc method + * @name umbraco.services.notificationsService#error + * @methodOf umbraco.services.notificationsService + * + * @description + * Adds a red error notication to the notications collection + * This should be used when an operations *fails* and could not complete + * + * @param {String} headline Headline of the notification + * @param {String} message longer text for the notication, trimmed after 200 characters, which can then be exanded + * @returns {Object} notification object + */ + error: function (headline, message) { + return service.add({ headline: headline, message: message, type: 'error', time: new Date() }); + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#warning + * @methodOf umbraco.services.notificationsService + * + * @description + * Adds a yellow warning notication to the notications collection + * This should be used when an operations *completes* but something was not as expected + * + * + * @param {String} headline Headline of the notification + * @param {String} message longer text for the notication, trimmed after 200 characters, which can then be exanded + * @returns {Object} notification object + */ + warning: function (headline, message) { + return service.add({ headline: headline, message: message, type: 'warning', time: new Date() }); + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#warning + * @methodOf umbraco.services.notificationsService + * + * @description + * Adds a yellow warning notication to the notications collection + * This should be used when an operations *completes* but something was not as expected + * + * + * @param {String} headline Headline of the notification + * @param {String} message longer text for the notication, trimmed after 200 characters, which can then be exanded + * @returns {Object} notification object + */ + info: function (headline, message) { + return service.add({ headline: headline, message: message, type: 'info', time: new Date() }); + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#remove + * @methodOf umbraco.services.notificationsService + * + * @description + * Removes a notification from the notifcations collection at a given index + * + * @param {Int} index index where the notication should be removed from + */ + remove: function (index) { + if(angular.isObject(index)){ + var i = nArray.indexOf(index); + angularHelper.safeApply($rootScope, function() { + nArray.splice(i, 1); + }); + }else{ + angularHelper.safeApply($rootScope, function() { + nArray.splice(index, 1); + }); + } + }, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#removeAll + * @methodOf umbraco.services.notificationsService + * + * @description + * Removes all notifications from the notifcations collection + */ + removeAll: function () { + angularHelper.safeApply($rootScope, function() { + nArray = []; + }); + }, + + /** + * @ngdoc property + * @name umbraco.services.notificationsService#current + * @propertyOf umbraco.services.notificationsService + * + * @description + * Returns an array of current notifications to display + * + * @returns {string} returns an array + */ + current: nArray, + + /** + * @ngdoc method + * @name umbraco.services.notificationsService#getCurrent + * @methodOf umbraco.services.notificationsService + * + * @description + * Method to return all notifications from the notifcations collection + */ + getCurrent: function(){ + return nArray; + } + }; + + return service; +}); +/** + * @ngdoc service + * @name umbraco.services.searchService + * + * + * @description + * Service for handling the main application search, can currently search content, media and members + * + * ##usage + * To use, simply inject the searchService into any controller that needs it, and make + * sure the umbraco.services module is accesible - which it should be by default. + * + *
    + *      searchService.searchMembers({term: 'bob'}).then(function(results){
    + *          angular.forEach(results, function(result){
    + *                  //returns:
    + *                  {name: "name", id: 1234, menuUrl: "url", editorPath: "url", metaData: {}, subtitle: "/path/etc" }
    + *           })          
    + *           var result = 
    + *       }) 
    + * 
    + */ +angular.module('umbraco.services') +.factory('searchService', function ($q, $log, entityResource, contentResource, umbRequestHelper) { + + function configureMemberResult(member) { + member.menuUrl = umbRequestHelper.getApiUrl("memberTreeBaseUrl", "GetMenu", [{ id: member.id }, { application: 'member' }]); + member.editorPath = "member/member/edit/" + (member.key ? member.key : member.id); + member.metaData = { treeAlias: "member" }; + member.subTitle = member.metaData.Email; + } + + function configureMediaResult(media) + { + media.menuUrl = umbRequestHelper.getApiUrl("mediaTreeBaseUrl", "GetMenu", [{ id: media.id }, { application: 'media' }]); + media.editorPath = "media/media/edit/" + media.id; + media.metaData = { treeAlias: "media" }; + } + + function configureContentResult(content) { + content.menuUrl = umbRequestHelper.getApiUrl("contentTreeBaseUrl", "GetMenu", [{ id: content.id }, { application: 'content' }]); + content.editorPath = "content/content/edit/" + content.id; + content.metaData = { treeAlias: "content" }; + content.subTitle = content.metaData.Url; + } + + return { + + /** + * @ngdoc method + * @name umbraco.services.searchService#searchMembers + * @methodOf umbraco.services.searchService + * + * @description + * Searches the default member search index + * @param {Object} args argument object + * @param {String} args.term seach term + * @returns {Promise} returns promise containing all matching members + */ + searchMembers: function(args) { + + if (!args.term) { + throw "args.term is required"; + } + + return entityResource.search(args.term, "Member").then(function (data) { + _.each(data, function(item) { + configureMemberResult(item); + }); + return data; + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.searchService#searchContent + * @methodOf umbraco.services.searchService + * + * @description + * Searches the default internal content search index + * @param {Object} args argument object + * @param {String} args.term seach term + * @returns {Promise} returns promise containing all matching content items + */ + searchContent: function(args) { + + if (!args.term) { + throw "args.term is required"; + } + + return entityResource.search(args.term, "Document").then(function (data) { + _.each(data, function (item) { + configureContentResult(item); + }); + return data; + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.searchService#searchMedia + * @methodOf umbraco.services.searchService + * + * @description + * Searches the default media search index + * @param {Object} args argument object + * @param {String} args.term seach term + * @returns {Promise} returns promise containing all matching media items + */ + searchMedia: function(args) { + + if (!args.term) { + throw "args.term is required"; + } + + return entityResource.search(args.term, "Media").then(function (data) { + _.each(data, function (item) { + configureMediaResult(item); + }); + return data; + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.searchService#searchAll + * @methodOf umbraco.services.searchService + * + * @description + * Searches all available indexes and returns all results in one collection + * @param {Object} args argument object + * @param {String} args.term seach term + * @returns {Promise} returns promise containing all matching items + */ + searchAll: function (args) { + + if (!args.term) { + throw "args.term is required"; + } + + return entityResource.searchAll(args.term).then(function (data) { + + _.each(data, function(resultByType) { + switch(resultByType.type) { + case "Document": + _.each(resultByType.results, function (item) { + configureContentResult(item); + }); + break; + case "Media": + _.each(resultByType.results, function (item) { + configureMediaResult(item); + }); + break; + case "Member": + _.each(resultByType.results, function (item) { + configureMemberResult(item); + }); + break; + } + }); + + return data; + }); + + }, + + setCurrent: function(sectionAlias) { + currentSection = sectionAlias; + } + }; +}); +/** + * @ngdoc service + * @name umbraco.services.serverValidationManager + * @function + * + * @description + * Used to handle server side validation and wires up the UI with the messages. There are 2 types of validation messages, one + * is for user defined properties (called Properties) and the other is for field properties which are attached to the native + * model objects (not user defined). The methods below are named according to these rules: Properties vs Fields. + */ +function serverValidationManager($timeout) { + + var callbacks = []; + + /** calls the callback specified with the errors specified, used internally */ + function executeCallback(self, errorsForCallback, callback) { + + callback.apply(self, [ + false, //pass in a value indicating it is invalid + errorsForCallback, //pass in the errors for this item + self.items]); //pass in all errors in total + } + + function getFieldErrors(self, fieldName) { + if (!angular.isString(fieldName)) { + throw "fieldName must be a string"; + } + + //find errors for this field name + return _.filter(self.items, function (item) { + return (item.propertyAlias === null && item.fieldName === fieldName); + }); + } + + function getPropertyErrors(self, propertyAlias, fieldName) { + if (!angular.isString(propertyAlias)) { + throw "propertyAlias must be a string"; + } + if (fieldName && !angular.isString(fieldName)) { + throw "fieldName must be a string"; + } + + //find all errors for this property + return _.filter(self.items, function (item) { + return (item.propertyAlias === propertyAlias && (item.fieldName === fieldName || (fieldName === undefined || fieldName === ""))); + }); + } + + return { + + /** + * @ngdoc function + * @name umbraco.services.serverValidationManager#subscribe + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * This method needs to be called once all field and property errors are wired up. + * + * In some scenarios where the error collection needs to be persisted over a route change + * (i.e. when a content item (or any item) is created and the route redirects to the editor) + * the controller should call this method once the data is bound to the scope + * so that any persisted validation errors are re-bound to their controls. Once they are re-binded this then clears the validation + * colleciton so that if another route change occurs, the previously persisted validation errors are not re-bound to the new item. + */ + executeAndClearAllSubscriptions: function() { + + var self = this; + + $timeout(function () { + + for (var cb in callbacks) { + if (callbacks[cb].propertyAlias === null) { + //its a field error callback + var fieldErrors = getFieldErrors(self, callbacks[cb].fieldName); + if (fieldErrors.length > 0) { + executeCallback(self, fieldErrors, callbacks[cb].callback); + } + } + else { + //its a property error + var propErrors = getPropertyErrors(self, callbacks[cb].propertyAlias, callbacks[cb].fieldName); + if (propErrors.length > 0) { + executeCallback(self, propErrors, callbacks[cb].callback); + } + } + } + //now that they are all executed, we're gonna clear all of the errors we have + self.clear(); + }); + }, + + /** + * @ngdoc function + * @name umbraco.services.serverValidationManager#subscribe + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Adds a callback method that is executed whenever validation changes for the field name + property specified. + * This is generally used for server side validation in order to match up a server side validation error with + * a particular field, otherwise we can only pinpoint that there is an error for a content property, not the + * property's specific field. This is used with the val-server directive in which the directive specifies the + * field alias to listen for. + * If propertyAlias is null, then this subscription is for a field property (not a user defined property). + */ + subscribe: function (propertyAlias, fieldName, callback) { + if (!callback) { + return; + } + + if (propertyAlias === null) { + //don't add it if it already exists + var exists1 = _.find(callbacks, function (item) { + return item.propertyAlias === null && item.fieldName === fieldName; + }); + if (!exists1) { + callbacks.push({ propertyAlias: null, fieldName: fieldName, callback: callback }); + } + } + else if (propertyAlias !== undefined) { + //don't add it if it already exists + var exists2 = _.find(callbacks, function (item) { + return item.propertyAlias === propertyAlias && item.fieldName === fieldName; + }); + if (!exists2) { + callbacks.push({ propertyAlias: propertyAlias, fieldName: fieldName, callback: callback }); + } + } + }, + + unsubscribe: function (propertyAlias, fieldName) { + + if (propertyAlias === null) { + + //remove all callbacks for the content field + callbacks = _.reject(callbacks, function (item) { + return item.propertyAlias === null && item.fieldName === fieldName; + }); + + } + else if (propertyAlias !== undefined) { + + //remove all callbacks for the content property + callbacks = _.reject(callbacks, function (item) { + return item.propertyAlias === propertyAlias && + (item.fieldName === fieldName || + ((item.fieldName === undefined || item.fieldName === "") && (fieldName === undefined || fieldName === ""))); + }); + } + + + }, + + + /** + * @ngdoc function + * @name getPropertyCallbacks + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Gets all callbacks that has been registered using the subscribe method for the propertyAlias + fieldName combo. + * This will always return any callbacks registered for just the property (i.e. field name is empty) and for ones with an + * explicit field name set. + */ + getPropertyCallbacks: function (propertyAlias, fieldName) { + var found = _.filter(callbacks, function (item) { + //returns any callback that have been registered directly against the field and for only the property + return (item.propertyAlias === propertyAlias && (item.fieldName === fieldName || (item.fieldName === undefined || item.fieldName === ""))); + }); + return found; + }, + + /** + * @ngdoc function + * @name getFieldCallbacks + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Gets all callbacks that has been registered using the subscribe method for the field. + */ + getFieldCallbacks: function (fieldName) { + var found = _.filter(callbacks, function (item) { + //returns any callback that have been registered directly against the field + return (item.propertyAlias === null && item.fieldName === fieldName); + }); + return found; + }, + + /** + * @ngdoc function + * @name addFieldError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Adds an error message for a native content item field (not a user defined property, for Example, 'Name') + */ + addFieldError: function(fieldName, errorMsg) { + if (!fieldName) { + return; + } + + //only add the item if it doesn't exist + if (!this.hasFieldError(fieldName)) { + this.items.push({ + propertyAlias: null, + fieldName: fieldName, + errorMsg: errorMsg + }); + } + + //find all errors for this item + var errorsForCallback = getFieldErrors(this, fieldName); + //we should now call all of the call backs registered for this error + var cbs = this.getFieldCallbacks(fieldName); + //call each callback for this error + for (var cb in cbs) { + executeCallback(this, errorsForCallback, cbs[cb].callback); + } + }, + + /** + * @ngdoc function + * @name addPropertyError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Adds an error message for the content property + */ + addPropertyError: function (propertyAlias, fieldName, errorMsg) { + if (!propertyAlias) { + return; + } + + //only add the item if it doesn't exist + if (!this.hasPropertyError(propertyAlias, fieldName)) { + this.items.push({ + propertyAlias: propertyAlias, + fieldName: fieldName, + errorMsg: errorMsg + }); + } + + //find all errors for this item + var errorsForCallback = getPropertyErrors(this, propertyAlias, fieldName); + //we should now call all of the call backs registered for this error + var cbs = this.getPropertyCallbacks(propertyAlias, fieldName); + //call each callback for this error + for (var cb in cbs) { + executeCallback(this, errorsForCallback, cbs[cb].callback); + } + }, + + /** + * @ngdoc function + * @name removePropertyError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Removes an error message for the content property + */ + removePropertyError: function (propertyAlias, fieldName) { + + if (!propertyAlias) { + return; + } + //remove the item + this.items = _.reject(this.items, function (item) { + return (item.propertyAlias === propertyAlias && (item.fieldName === fieldName || (fieldName === undefined || fieldName === ""))); + }); + }, + + /** + * @ngdoc function + * @name reset + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Clears all errors and notifies all callbacks that all server errros are now valid - used when submitting a form + */ + reset: function () { + this.clear(); + for (var cb in callbacks) { + callbacks[cb].callback.apply(this, [ + true, //pass in a value indicating it is VALID + [], //pass in empty collection + []]); //pass in empty collection + } + }, + + /** + * @ngdoc function + * @name clear + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Clears all errors + */ + clear: function() { + this.items = []; + }, + + /** + * @ngdoc function + * @name getPropertyError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Gets the error message for the content property + */ + getPropertyError: function (propertyAlias, fieldName) { + var err = _.find(this.items, function (item) { + //return true if the property alias matches and if an empty field name is specified or the field name matches + return (item.propertyAlias === propertyAlias && (item.fieldName === fieldName || (fieldName === undefined || fieldName === ""))); + }); + return err; + }, + + /** + * @ngdoc function + * @name getFieldError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Gets the error message for a content field + */ + getFieldError: function (fieldName) { + var err = _.find(this.items, function (item) { + //return true if the property alias matches and if an empty field name is specified or the field name matches + return (item.propertyAlias === null && item.fieldName === fieldName); + }); + return err; + }, + + /** + * @ngdoc function + * @name hasPropertyError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Checks if the content property + field name combo has an error + */ + hasPropertyError: function (propertyAlias, fieldName) { + var err = _.find(this.items, function (item) { + //return true if the property alias matches and if an empty field name is specified or the field name matches + return (item.propertyAlias === propertyAlias && (item.fieldName === fieldName || (fieldName === undefined || fieldName === ""))); + }); + return err ? true : false; + }, + + /** + * @ngdoc function + * @name hasFieldError + * @methodOf umbraco.services.serverValidationManager + * @function + * + * @description + * Checks if a content field has an error + */ + hasFieldError: function (fieldName) { + var err = _.find(this.items, function (item) { + //return true if the property alias matches and if an empty field name is specified or the field name matches + return (item.propertyAlias === null && item.fieldName === fieldName); + }); + return err ? true : false; + }, + + /** The array of error messages */ + items: [] + }; +} + +angular.module('umbraco.services').factory('serverValidationManager', serverValidationManager); +/** + * @ngdoc service + * @name umbraco.services.tinyMceService + * + * + * @description + * A service containing all logic for all of the Umbraco TinyMCE plugins + */ +function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macroResource, macroService, $routeParams, umbRequestHelper, angularHelper) { + return { + + /** + * @ngdoc method + * @name umbraco.services.tinyMceService#configuration + * @methodOf umbraco.services.tinyMceService + * + * @description + * Returns a collection of plugins available to the tinyMCE editor + * + */ + configuration: function () { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "rteApiBaseUrl", + "GetConfiguration"), { cache: true }), + 'Failed to retrieve tinymce configuration'); + }, + + /** + * @ngdoc method + * @name umbraco.services.tinyMceService#defaultPrevalues + * @methodOf umbraco.services.tinyMceService + * + * @description + * Returns a default configration to fallback on in case none is provided + * + */ + defaultPrevalues: function () { + var cfg = {}; + cfg.toolbar = ["code", "bold", "italic", "styleselect","alignleft", "aligncenter", "alignright", "bullist","numlist", "outdent", "indent", "link", "image", "umbmediapicker", "umbembeddialog", "umbmacro"]; + cfg.stylesheets = []; + cfg.dimensions = { height: 500 }; + cfg.maxImageSize = 500; + return cfg; + }, + + /** + * @ngdoc method + * @name umbraco.services.tinyMceService#createInsertEmbeddedMedia + * @methodOf umbraco.services.tinyMceService + * + * @description + * Creates the umbrco insert embedded media tinymce plugin + * + * @param {Object} editor the TinyMCE editor instance + * @param {Object} $scope the current controller scope + */ + createInsertEmbeddedMedia: function (editor, $scope) { + editor.addButton('umbembeddialog', { + icon: 'custom icon-tv', + tooltip: 'Embed', + onclick: function () { + dialogService.embedDialog({ + callback: function (data) { + editor.insertContent(data); + } + }); + } + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.tinyMceService#createMediaPicker + * @methodOf umbraco.services.tinyMceService + * + * @description + * Creates the umbrco insert media tinymce plugin + * + * @param {Object} editor the TinyMCE editor instance + * @param {Object} $scope the current controller scope + */ + createMediaPicker: function (editor) { + editor.addButton('umbmediapicker', { + icon: 'custom icon-picture', + tooltip: 'Media Picker', + onclick: function () { + + var selectedElm = editor.selection.getNode(), + currentTarget; + + + if(selectedElm.nodeName === 'IMG'){ + var img = $(selectedElm); + currentTarget = { + altText: img.attr("alt"), + url: img.attr("src"), + id: img.attr("rel") + }; + } + + dialogService.mediaPicker({ + currentTarget: currentTarget, + onlyImages: true, + showDetails: true, + callback: function (img) { + + if (img) { + + var data = { + alt: img.altText, + src: (img.url) ? img.url : "nothing.jpg", + rel: img.id, + id: '__mcenew' + }; + + editor.insertContent(editor.dom.createHTML('img', data)); + + $timeout(function () { + var imgElm = editor.dom.get('__mcenew'); + var size = editor.dom.getSize(imgElm); + + if (editor.settings.maxImageSize && editor.settings.maxImageSize !== 0) { + var newSize = imageHelper.scaleToMaxSize(editor.settings.maxImageSize, size.w, size.h); + + var s = "width: " + newSize.width + "px; height:" + newSize.height + "px;"; + editor.dom.setAttrib(imgElm, 'style', s); + editor.dom.setAttrib(imgElm, 'id', null); + + if (img.url) { + var src = img.url + "?width=" + newSize.width + "&height=" + newSize.height; + editor.dom.setAttrib(imgElm, 'data-mce-src', src); + } + } + }, 500); + } + } + }); + } + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.tinyMceService#createUmbracoMacro + * @methodOf umbraco.services.tinyMceService + * + * @description + * Creates the insert umbrco macro tinymce plugin + * + * @param {Object} editor the TinyMCE editor instance + * @param {Object} $scope the current controller scope + */ + createInsertMacro: function (editor, $scope) { + + /** Adds custom rules for the macro plugin and custom serialization */ + editor.on('preInit', function (args) { + //this is requires so that we tell the serializer that a 'div' is actually allowed in the root, otherwise the cleanup will strip it out + editor.serializer.addRules('div'); + + /** This checks if the div is a macro container, if so, checks if its wrapped in a p tag and then unwraps it (removes p tag) */ + editor.serializer.addNodeFilter('div', function (nodes, name) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].attr("class") === "umb-macro-holder" && nodes[i].parent && nodes[i].parent.name.toUpperCase() === "P") { + nodes[i].parent.unwrap(); + } + } + }); + + }); + + /** + * Because the macro gets wrapped in a P tag because of the way 'enter' works, this + * method will return the macro element if not wrapped in a p, or the p if the macro + * element is the only one inside of it even if we are deep inside an element inside the macro + */ + function getRealMacroElem(element) { + var e = $(element).closest(".umb-macro-holder"); + if (e.length > 0) { + if (e.get(0).parentNode.nodeName === "P") { + //now check if we're the only element + if (element.parentNode.childNodes.length === 1) { + return e.get(0).parentNode; + } + } + return e.get(0); + } + return null; + } + + /** loads in the macro content async from the server */ + function loadMacroContent($macroDiv, macroData) { + + //if we don't have the macroData, then we'll need to parse it from the macro div + if (!macroData) { + var contents = $macroDiv.contents(); + var comment = _.find(contents, function (item) { + return item.nodeType === 8; + }); + if (!comment) { + throw "Cannot parse the current macro, the syntax in the editor is invalid"; + } + var syntax = comment.textContent.trim(); + var parsed = macroService.parseMacroSyntax(syntax); + macroData = parsed; + } + + var $ins = $macroDiv.find("ins"); + + //show the throbber + $macroDiv.addClass("loading"); + + var contentId = $routeParams.id; + + //need to wrap in safe apply since this might be occuring outside of angular + angularHelper.safeApply($scope, function() { + macroResource.getMacroResultAsHtmlForEditor(macroData.macroAlias, contentId, macroData.macroParamsDictionary) + .then(function (htmlResult) { + + $macroDiv.removeClass("loading"); + htmlResult = htmlResult.trim(); + if (htmlResult !== "") { + $ins.html(htmlResult); + } + }); + }); + + } + + /** Adds the button instance */ + editor.addButton('umbmacro', { + icon: 'custom icon-settings-alt', + tooltip: 'Insert macro', + onPostRender: function () { + + var ctrl = this; + var isOnMacroElement = false; + + /** + if the selection comes from a different element that is not the macro's + we need to check if the selection includes part of the macro, if so we'll force the selection + to clear to the next element since if people can select part of the macro markup they can then modify it. + */ + function handleSelectionChange() { + + if (!editor.selection.isCollapsed()) { + var endSelection = tinymce.activeEditor.selection.getEnd(); + var startSelection = tinymce.activeEditor.selection.getStart(); + //don't proceed if it's an entire element selected + if (endSelection !== startSelection) { + + //if the end selection is a macro then move the cursor + //NOTE: we don't have to handle when the selection comes from a previous parent because + // that is automatically taken care of with the normal onNodeChanged logic since the + // evt.element will be the macro once it becomes part of the selection. + var $testForMacro = $(endSelection).closest(".umb-macro-holder"); + if ($testForMacro.length > 0) { + + //it came from before so move after, if there is no after then select ourselves + var next = $testForMacro.next(); + if (next.length > 0) { + editor.selection.setCursorLocation($testForMacro.next().get(0)); + } + else { + selectMacroElement($testForMacro.get(0)); + } + + } + } + } + } + + /** helper method to select the macro element */ + function selectMacroElement(macroElement) { + + // move selection to top element to ensure we can't edit this + editor.selection.select(macroElement); + + // check if the current selection *is* the element (ie bug) + var currentSelection = editor.selection.getStart(); + if (tinymce.isIE) { + if (!editor.dom.hasClass(currentSelection, 'umb-macro-holder')) { + while (!editor.dom.hasClass(currentSelection, 'umb-macro-holder') && currentSelection.parentNode) { + currentSelection = currentSelection.parentNode; + } + editor.selection.select(currentSelection); + } + } + } + + /** + * Add a node change handler, test if we're editing a macro and select the whole thing, then set our isOnMacroElement flag. + * If we change the selection inside this method, then we end up in an infinite loop, so we have to remove ourselves + * from the event listener before changing selection, however, it seems that putting a break point in this method + * will always cause an 'infinite' loop as the caret keeps changing. + */ + function onNodeChanged(evt) { + + //set our macro button active when on a node of class umb-macro-holder + var $macroElement = $(evt.element).closest(".umb-macro-holder"); + + handleSelectionChange(); + + //set the button active + ctrl.active($macroElement.length !== 0); + + if ($macroElement.length > 0) { + var macroElement = $macroElement.get(0); + + //remove the event listener before re-selecting + editor.off('NodeChange', onNodeChanged); + + selectMacroElement(macroElement); + + //set the flag + isOnMacroElement = true; + + //re-add the event listener + editor.on('NodeChange', onNodeChanged); + } + else { + isOnMacroElement = false; + } + + } + + /** when the contents load we need to find any macros declared and load in their content */ + editor.on("LoadContent", function (o) { + + //get all macro divs and load their content + $(editor.dom.select(".umb-macro-holder.mceNonEditable")).each(function() { + loadMacroContent($(this)); + }); + + }); + + /** This prevents any other commands from executing when the current element is the macro so the content cannot be edited */ + editor.on('BeforeExecCommand', function (o) { + if (isOnMacroElement) { + if (o.preventDefault) { + o.preventDefault(); + } + if (o.stopImmediatePropagation) { + o.stopImmediatePropagation(); + } + return; + } + }); + + /** This double checks and ensures you can't paste content into the rendered macro */ + editor.on("Paste", function (o) { + if (isOnMacroElement) { + if (o.preventDefault) { + o.preventDefault(); + } + if (o.stopImmediatePropagation) { + o.stopImmediatePropagation(); + } + return; + } + }); + + //set onNodeChanged event listener + editor.on('NodeChange', onNodeChanged); + + /** + * Listen for the keydown in the editor, we'll check if we are currently on a macro element, if so + * we'll check if the key down is a supported key which requires an action, otherwise we ignore the request + * so the macro cannot be edited. + */ + editor.on('KeyDown', function (e) { + if (isOnMacroElement) { + var macroElement = editor.selection.getNode(); + + //get the 'real' element (either p or the real one) + macroElement = getRealMacroElem(macroElement); + + //prevent editing + e.preventDefault(); + e.stopPropagation(); + + var moveSibling = function (element, isNext) { + var $e = $(element); + var $sibling = isNext ? $e.next() : $e.prev(); + if ($sibling.length > 0) { + editor.selection.select($sibling.get(0)); + editor.selection.collapse(true); + } + else { + //if we're moving previous and there is no sibling, then lets recurse and just select the next one + if (!isNext) { + moveSibling(element, true); + return; + } + + //if there is no sibling we'll generate a new p at the end and select it + editor.setContent(editor.getContent() + "

     

    "); + editor.selection.select($(editor.dom.getRoot()).children().last().get(0)); + editor.selection.collapse(true); + + } + }; + + //supported keys to move to the next or prev element (13-enter, 27-esc, 38-up, 40-down, 39-right, 37-left) + //supported keys to remove the macro (8-backspace, 46-delete) + //TODO: Should we make the enter key insert a line break before or leave it as moving to the next element? + if ($.inArray(e.keyCode, [13, 40, 39]) !== -1) { + //move to next element + moveSibling(macroElement, true); + } + else if ($.inArray(e.keyCode, [27, 38, 37]) !== -1) { + //move to prev element + moveSibling(macroElement, false); + } + else if ($.inArray(e.keyCode, [8, 46]) !== -1) { + //delete macro element + + //move first, then delete + moveSibling(macroElement, false); + editor.dom.remove(macroElement); + } + return ; + } + }); + + }, + + /** The insert macro button click event handler */ + onclick: function () { + + var dialogData = { + //flag for use in rte so we only show macros flagged for the editor + richTextEditor: true + }; + + //when we click we could have a macro already selected and in that case we'll want to edit the current parameters + //so we'll need to extract them and submit them to the dialog. + var macroElement = editor.selection.getNode(); + macroElement = getRealMacroElem(macroElement); + if (macroElement) { + //we have a macro selected so we'll need to parse it's alias and parameters + var contents = $(macroElement).contents(); + var comment = _.find(contents, function(item) { + return item.nodeType === 8; + }); + if (!comment) { + throw "Cannot parse the current macro, the syntax in the editor is invalid"; + } + var syntax = comment.textContent.trim(); + var parsed = macroService.parseMacroSyntax(syntax); + dialogData = { + macroData: parsed + }; + } + + dialogService.macroPicker({ + dialogData : dialogData, + callback: function(data) { + + //put the macro syntax in comments, we will parse this out on the server side to be used + //for persisting. + var macroSyntaxComment = ""; + //create an id class for this element so we can re-select it after inserting + var uniqueId = "umb-macro-" + editor.dom.uniqueId(); + var macroDiv = editor.dom.create('div', + { + 'class': 'umb-macro-holder ' + data.macroAlias + ' mceNonEditable ' + uniqueId + }, + macroSyntaxComment + 'Macro alias: ' + data.macroAlias + ''); + + editor.selection.setNode(macroDiv); + + var $macroDiv = $(editor.dom.select("div.umb-macro-holder." + uniqueId)); + + //async load the macro content + loadMacroContent($macroDiv, data); + } + }); + + } + }); + } + }; +} + +angular.module('umbraco.services').factory('tinyMceService', tinyMceService); + + +/** + * @ngdoc service + * @name umbraco.services.treeService + * @function + * + * @description + * The tree service factory, used internally by the umbTree and umbTreeItem directives + */ +function treeService($q, treeResource, iconHelper, notificationsService, eventsService) { + + //SD: Have looked at putting this in sessionStorage (not localStorage since that means you wouldn't be able to work + // in multiple tabs) - however our tree structure is cyclical, meaning a node has a reference to it's parent and it's children + // which you cannot serialize to sessionStorage. There's really no benefit of session storage except that you could refresh + // a tab and have the trees where they used to be - supposed that is kind of nice but would mean we'd have to store the parent + // as a nodeid reference instead of a variable with a getParent() method. + var treeCache = {}; + + var standardCssClass = 'icon umb-tree-icon sprTree'; + + function getCacheKey(args) { + //if there is no cache key they return null - it won't be cached. + if (!args || !args.cacheKey) { + return null; + } + + var cacheKey = args.cacheKey; + cacheKey += "_" + args.section; + return cacheKey; + } + + return { + + /** Internal method to return the tree cache */ + _getTreeCache: function() { + return treeCache; + }, + + /** Internal method that ensures there's a routePath, parent and level property on each tree node and adds some icon specific properties so that the nodes display properly */ + _formatNodeDataForUseInUI: function (parentNode, treeNodes, section, level) { + //if no level is set, then we make it 1 + var childLevel = (level ? level : 1); + //set the section if it's not already set + if (!parentNode.section) { + parentNode.section = section; + } + //create a method outside of the loop to return the parent - otherwise jshint blows up + var funcParent = function() { + return parentNode; + }; + for (var i = 0; i < treeNodes.length; i++) { + + treeNodes[i].level = childLevel; + + //create a function to get the parent node, we could assign the parent node but + // then we cannot serialize this entity because we have a cyclical reference. + // Instead we just make a function to return the parentNode. + treeNodes[i].parent = funcParent; + + //set the section for each tree node - this allows us to reference this easily when accessing tree nodes + treeNodes[i].section = section; + + //if there is not route path specified, then set it automatically, + //if this is a tree root node then we want to route to the section's dashboard + if (!treeNodes[i].routePath) { + + if (treeNodes[i].metaData && treeNodes[i].metaData["treeAlias"]) { + //this is a root node + treeNodes[i].routePath = section; + } + else { + var treeAlias = this.getTreeAlias(treeNodes[i]); + treeNodes[i].routePath = section + "/" + treeAlias + "/edit/" + treeNodes[i].id; + } + } + + //now, format the icon data + if (treeNodes[i].iconIsClass === undefined || treeNodes[i].iconIsClass) { + var converted = iconHelper.convertFromLegacyTreeNodeIcon(treeNodes[i]); + treeNodes[i].cssClass = standardCssClass + " " + converted; + if (converted.startsWith('.')) { + //its legacy so add some width/height + treeNodes[i].style = "height:16px;width:16px;"; + } + else { + treeNodes[i].style = ""; + } + } + else { + treeNodes[i].style = "background-image: url('" + treeNodes[i].iconFilePath + "');"; + //we need an 'icon-' class in there for certain styles to work so if it is image based we'll add this + treeNodes[i].cssClass = standardCssClass + " legacy-custom-file"; + } + } + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getTreePackageFolder + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Determines if the current tree is a plugin tree and if so returns the package folder it has declared + * so we know where to find it's views, otherwise it will just return undefined. + * + * @param {String} treeAlias The tree alias to check + */ + getTreePackageFolder: function(treeAlias) { + //we determine this based on the server variables + if (Umbraco.Sys.ServerVariables.umbracoPlugins && + Umbraco.Sys.ServerVariables.umbracoPlugins.trees && + angular.isArray(Umbraco.Sys.ServerVariables.umbracoPlugins.trees)) { + + var found = _.find(Umbraco.Sys.ServerVariables.umbracoPlugins.trees, function(item) { + return item.alias === treeAlias; + }); + + return found ? found.packageFolder : undefined; + } + return undefined; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#clearCache + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Clears the tree cache - with optional cacheKey, optional section or optional filter. + * + * @param {Object} args arguments + * @param {String} args.cacheKey optional cachekey - this is used to clear specific trees in dialogs + * @param {String} args.section optional section alias - clear tree for a given section + * @param {String} args.childrenOf optional parent ID - only clear the cache below a specific node + */ + clearCache: function (args) { + //clear all if not specified + if (!args) { + treeCache = {}; + } + else { + //if section and cache key specified just clear that cache + if (args.section && args.cacheKey) { + var cacheKey = getCacheKey(args); + if (cacheKey && treeCache && treeCache[cacheKey] != null) { + treeCache = _.omit(treeCache, cacheKey); + } + } + else if (args.childrenOf) { + //if childrenOf is supplied a cacheKey must be supplied as well + if (!args.cacheKey) { + throw "args.cacheKey is required if args.childrenOf is supplied"; + } + //this will clear out all children for the parentId passed in to this parameter, we'll + // do this by recursing and specifying a filter + var self = this; + this.clearCache({ + cacheKey: args.cacheKey, + filter: function(cc) { + //get the new parent node from the tree cache + var parent = self.getDescendantNode(cc.root, args.childrenOf); + if (parent) { + //clear it's children and set to not expanded + parent.children = null; + parent.expanded = false; + } + //return the cache to be saved + return cc; + } + }); + } + else if (args.filter && angular.isFunction(args.filter)) { + //if a filter is supplied a cacheKey must be supplied as well + if (!args.cacheKey) { + throw "args.cacheKey is required if args.filter is supplied"; + } + + //if a filter is supplied the function needs to return the data to keep + var byKey = treeCache[args.cacheKey]; + if (byKey) { + var result = args.filter(byKey); + + if (result) { + //set the result to the filtered data + treeCache[args.cacheKey] = result; + } + else { + //remove the cache + treeCache = _.omit(treeCache, args.cacheKey); + } + + } + + } + else if (args.cacheKey) { + //if only the cache key is specified, then clear all cache starting with that key + var allKeys1 = _.keys(treeCache); + var toRemove1 = _.filter(allKeys1, function (k) { + return k.startsWith(args.cacheKey + "_"); + }); + treeCache = _.omit(treeCache, toRemove1); + } + else if (args.section) { + //if only the section is specified then clear all cache regardless of cache key by that section + var allKeys2 = _.keys(treeCache); + var toRemove2 = _.filter(allKeys2, function (k) { + return k.endsWith("_" + args.section); + }); + treeCache = _.omit(treeCache, toRemove2); + } + } + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#loadNodeChildren + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Clears all node children, gets it's up-to-date children from the server and re-assigns them and then + * returns them in a promise. + * @param {object} args An arguments object + * @param {object} args.node The tree node + * @param {object} args.section The current section + */ + loadNodeChildren: function(args) { + if (!args) { + throw "No args object defined for loadNodeChildren"; + } + if (!args.node) { + throw "No node defined on args object for loadNodeChildren"; + } + + this.removeChildNodes(args.node); + args.node.loading = true; + + return this.getChildren(args) + .then(function(data) { + + //set state to done and expand (only if there actually are children!) + args.node.loading = false; + args.node.children = data; + if (args.node.children && args.node.children.length > 0) { + args.node.expanded = true; + args.node.hasChildren = true; + } + return data; + + }, function(reason) { + + //in case of error, emit event + eventsService.emit("treeService.treeNodeLoadError", {error: reason } ); + + //stop show the loading indicator + node.loading = false; + + //tell notications about the error + notificationsService.error(reason); + + return reason; + }); + + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#removeNode + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Removes a given node from the tree + * @param {object} treeNode the node to remove + */ + removeNode: function(treeNode) { + if (treeNode.parent() == null) { + throw "Cannot remove a node that doesn't have a parent"; + } + //remove the current item from it's siblings + treeNode.parent().children.splice(treeNode.parent().children.indexOf(treeNode), 1); + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#removeChildNodes + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Removes all child nodes from a given tree node + * @param {object} treeNode the node to remove children from + */ + removeChildNodes : function(treeNode) { + treeNode.expanded = false; + treeNode.children = []; + treeNode.hasChildren = false; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getChildNode + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Gets a child node with a given ID, from a specific treeNode + * @param {object} treeNode to retrive child node from + * @param {int} id id of child node + */ + getChildNode: function (treeNode, id) { + if (!treeNode.children) { + return null; + } + var found = _.find(treeNode.children, function (child) { + return String(child.id) === String(id); + }); + return found === undefined ? null : found; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getDescendantNode + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Gets a descendant node by id + * @param {object} treeNode to retrive descendant node from + * @param {int} id id of descendant node + * @param {string} treeAlias - optional tree alias, if fetching descendant node from a child of a listview document + */ + getDescendantNode: function(treeNode, id, treeAlias) { + + //validate if it is a section container since we'll need a treeAlias if it is one + if (treeNode.isContainer === true && !treeAlias) { + throw "Cannot get a descendant node from a section container node without a treeAlias specified"; + } + + //if it is a section container, we need to find the tree to be searched + if (treeNode.isContainer) { + var foundRoot = null; + for (var c = 0; c < treeNode.children.length; c++) { + if (this.getTreeAlias(treeNode.children[c]) === treeAlias) { + foundRoot = treeNode.children[c]; + break; + } + } + if (!foundRoot) { + throw "Could not find a tree in the current section with alias " + treeAlias; + } + treeNode = foundRoot; + } + + //check this node + if (treeNode.id === id) { + return treeNode; + } + + //check the first level + var found = this.getChildNode(treeNode, id); + if (found) { + return found; + } + + //check each child of this node + if (!treeNode.children) { + return null; + } + + for (var i = 0; i < treeNode.children.length; i++) { + if (treeNode.children[i].children && angular.isArray(treeNode.children[i].children) && treeNode.children[i].children.length > 0) { + //recurse + found = this.getDescendantNode(treeNode.children[i], id); + if (found) { + return found; + } + } + } + + //not found + return found === undefined ? null : found; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getTreeRoot + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Gets the root node of the current tree type for a given tree node + * @param {object} treeNode to retrive tree root node from + */ + getTreeRoot: function (treeNode) { + if (!treeNode) { + throw "treeNode cannot be null"; + } + + //all root nodes have metadata key 'treeAlias' + var root = null; + var current = treeNode; + while (root === null && current) { + + if (current.metaData && current.metaData["treeAlias"]) { + root = current; + } + else if (angular.isFunction(current.parent)) { + //we can only continue if there is a parent() method which means this + // tree node was loaded in as part of a real tree, not just as a single tree + // node from the server. + current = current.parent(); + } + else { + current = null; + } + } + return root; + }, + + /** Gets the node's tree alias, this is done by looking up the meta-data of the current node's root node */ + /** + * @ngdoc method + * @name umbraco.services.treeService#getTreeAlias + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Gets the node's tree alias, this is done by looking up the meta-data of the current node's root node + * @param {object} treeNode to retrive tree alias from + */ + getTreeAlias : function(treeNode) { + var root = this.getTreeRoot(treeNode); + if (root) { + return root.metaData["treeAlias"]; + } + return ""; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getTree + * @methodOf umbraco.services.treeService + * @function + * + * @description + * gets the tree, returns a promise + * @param {object} args Arguments + * @param {string} args.section Section alias + * @param {string} args.cacheKey Optional cachekey + */ + getTree: function (args) { + + var deferred = $q.defer(); + + //set defaults + if (!args) { + args = { section: 'content', cacheKey: null }; + } + else if (!args.section) { + args.section = 'content'; + } + + var cacheKey = getCacheKey(args); + + //return the cache if it exists + if (cacheKey && treeCache[cacheKey] !== undefined) { + deferred.resolve(treeCache[cacheKey]); + return deferred.promise; + } + + var self = this; + treeResource.loadApplication(args) + .then(function(data) { + //this will be called once the tree app data has loaded + var result = { + name: data.name, + alias: args.section, + root: data + }; + //we need to format/modify some of the node data to be used in our app. + self._formatNodeDataForUseInUI(result.root, result.root.children, args.section); + + //cache this result if a cache key is specified - generally a cache key should ONLY + // be specified for application trees, dialog trees should not be cached. + if (cacheKey) { + treeCache[cacheKey] = result; + deferred.resolve(treeCache[cacheKey]); + } + + //return un-cached + deferred.resolve(result); + }); + + return deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getMenu + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Returns available menu actions for a given tree node + * @param {object} args Arguments + * @param {string} args.treeNode tree node object to retrieve the menu for + */ + getMenu: function (args) { + + if (!args) { + throw "args cannot be null"; + } + if (!args.treeNode) { + throw "args.treeNode cannot be null"; + } + + return treeResource.loadMenu(args.treeNode) + .then(function(data) { + //need to convert the icons to new ones + for (var i = 0; i < data.length; i++) { + data[i].cssclass = iconHelper.convertFromLegacyIcon(data[i].cssclass); + } + return data; + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getChildren + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Gets the children from the server for a given node + * @param {object} args Arguments + * @param {object} args.node tree node object to retrieve the children for + * @param {string} args.section current section alias + */ + getChildren: function (args) { + + if (!args) { + throw "No args object defined for getChildren"; + } + if (!args.node) { + throw "No node defined on args object for getChildren"; + } + + var section = args.section || 'content'; + var treeItem = args.node; + + var self = this; + + return treeResource.loadNodes({ node: treeItem }) + .then(function (data) { + //now that we have the data, we need to add the level property to each item and the view + self._formatNodeDataForUseInUI(treeItem, data, section, treeItem.level + 1); + return data; + }); + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#reloadNode + * @methodOf umbraco.services.treeService + * @function + * + * @description + * Re-loads the single node from the server + * @param {object} node Tree node to reload + */ + reloadNode: function(node) { + if (!node) { + throw "node cannot be null"; + } + if (!node.parent()) { + throw "cannot reload a single node without a parent"; + } + if (!node.section) { + throw "cannot reload a single node without an assigned node.section"; + } + + var deferred = $q.defer(); + + //set the node to loading + node.loading = true; + + this.getChildren({ node: node.parent(), section: node.section }).then(function(data) { + + //ok, now that we have the children, find the node we're reloading + var found = _.find(data, function(item) { + return item.id === node.id; + }); + if (found) { + //now we need to find the node in the parent.children collection to replace + var index = _.indexOf(node.parent().children, node); + //the trick here is to not actually replace the node - this would cause the delete animations + //to fire, instead we're just going to replace all the properties of this node. + + //there should always be a method assigned but we'll check anyways + if (angular.isFunction(node.parent().children[index].updateNodeData)) { + node.parent().children[index].updateNodeData(found); + } + else { + //just update as per normal - this means styles, etc.. won't be applied + _.extend(node.parent().children[index], found); + } + + //set the node loading + node.parent().children[index].loading = false; + //return + deferred.resolve(node.parent().children[index]); + } + else { + deferred.reject(); + } + }, function() { + deferred.reject(); + }); + + return deferred.promise; + }, + + /** + * @ngdoc method + * @name umbraco.services.treeService#getPath + * @methodOf umbraco.services.treeService + * @function + * + * @description + * This will return the current node's path by walking up the tree + * @param {object} node Tree node to retrieve path for + */ + getPath: function(node) { + if (!node) { + throw "node cannot be null"; + } + if (!angular.isFunction(node.parent)) { + throw "node.parent is not a function, the path cannot be resolved"; + } + //all root nodes have metadata key 'treeAlias' + var reversePath = []; + var current = node; + while (current != null) { + reversePath.push(current.id); + if (current.metaData && current.metaData["treeAlias"]) { + current = null; + } + else { + current = current.parent(); + } + } + return reversePath.reverse(); + }, + + syncTree: function(args) { + + if (!args) { + throw "No args object defined for syncTree"; + } + if (!args.node) { + throw "No node defined on args object for syncTree"; + } + if (!args.path) { + throw "No path defined on args object for syncTree"; + } + if (!angular.isArray(args.path)) { + throw "Path must be an array"; + } + if (args.path.length < 1) { + throw "args.path must contain at least one id"; + } + + var deferred = $q.defer(); + + //get the rootNode for the current node, we'll sync based on that + var root = this.getTreeRoot(args.node); + if (!root) { + throw "Could not get the root tree node based on the node passed in"; + } + + //now we want to loop through the ids in the path, first we'll check if the first part + //of the path is the root node, otherwise we'll search it's children. + var currPathIndex = 0; + //if the first id is the root node and there's only one... then consider it synced + if (String(args.path[currPathIndex]) === String(args.node.id)) { + if (args.path.length === 1) { + //return the root + deferred.resolve(root); + return deferred.promise; + } + else { + //move to the next path part and continue + currPathIndex = 1; + } + } + + //now that we have the first id to lookup, we can start the process + + var self = this; + var node = args.node; + + var doSync = function () { + //check if it exists in the already loaded children + var child = self.getChildNode(node, args.path[currPathIndex]); + if (child) { + if (args.path.length === (currPathIndex + 1)) { + //woot! synced the node + if (!args.forceReload) { + deferred.resolve(child); + } + else { + //even though we've found the node if forceReload is specified + //we want to go update this single node from the server + self.reloadNode(child).then(function (reloaded) { + deferred.resolve(reloaded); + }, function () { + deferred.reject(); + }); + } + } + else { + //now we need to recurse with the updated node/currPathIndex + currPathIndex++; + node = child; + //recurse + doSync(); + } + } + else { + //couldn't find it in the + self.loadNodeChildren({ node: node, section: node.section }).then(function () { + //ok, got the children, let's find it + var found = self.getChildNode(node, args.path[currPathIndex]); + if (found) { + if (args.path.length === (currPathIndex + 1)) { + //woot! synced the node + deferred.resolve(found); + } + else { + //now we need to recurse with the updated node/currPathIndex + currPathIndex++; + node = found; + //recurse + doSync(); + } + } + else { + //fail! + deferred.reject(); + } + }, function () { + //fail! + deferred.reject(); + }); + } + }; + + //start + doSync(); + + return deferred.promise; + + } + + }; +} + +angular.module('umbraco.services').factory('treeService', treeService); +/** +* @ngdoc service +* @name umbraco.services.umbRequestHelper +* @description A helper object used for sending requests to the server +**/ +function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogService, notificationsService) { + return { + + /** + * @ngdoc method + * @name umbraco.services.umbRequestHelper#dictionaryToQueryString + * @methodOf umbraco.services.umbRequestHelper + * @function + * + * @description + * This will turn an array of key/value pairs into a query string + * + * @param {Array} queryStrings An array of key/value pairs + */ + dictionaryToQueryString: function (queryStrings) { + + + if (angular.isArray(queryStrings)) { + return _.map(queryStrings, function (item) { + var key = null; + var val = null; + for (var k in item) { + key = k; + val = item[k]; + break; + } + if (key === null || val === null) { + throw "The object in the array was not formatted as a key/value pair"; + } + return encodeURIComponent(key) + "=" + encodeURIComponent(val); + }).join("&"); + } + + /* + //if we have a simple object, we can simply map with $.param + //but with the current structure we cant since an array is an object and an object is an array + if(angular.isObject(queryStrings)){ + return decodeURIComponent($.param(queryStrings)); + }*/ + + throw "The queryString parameter is not an array of key value pairs"; + }, + + /** + * @ngdoc method + * @name umbraco.services.umbRequestHelper#getApiUrl + * @methodOf umbraco.services.umbRequestHelper + * @function + * + * @description + * This will return the webapi Url for the requested key based on the servervariables collection + * + * @param {string} apiName The webapi name that is found in the servervariables["umbracoUrls"] dictionary + * @param {string} actionName The webapi action name + * @param {object} queryStrings Can be either a string or an array containing key/value pairs + */ + getApiUrl: function (apiName, actionName, queryStrings) { + if (!Umbraco || !Umbraco.Sys || !Umbraco.Sys.ServerVariables || !Umbraco.Sys.ServerVariables["umbracoUrls"]) { + throw "No server variables defined!"; + } + + if (!Umbraco.Sys.ServerVariables["umbracoUrls"][apiName]) { + throw "No url found for api name " + apiName; + } + + return Umbraco.Sys.ServerVariables["umbracoUrls"][apiName] + actionName + + (!queryStrings ? "" : "?" + (angular.isString(queryStrings) ? queryStrings : this.dictionaryToQueryString(queryStrings))); + + }, + + /** + * @ngdoc function + * @name umbraco.services.umbRequestHelper#resourcePromise + * @methodOf umbraco.services.umbRequestHelper + * @function + * + * @description + * This returns a promise with an underlying http call, it is a helper method to reduce + * the amount of duplicate code needed to query http resources and automatically handle any + * Http errors. See /docs/source/using-promises-resources.md + * + * @param {object} opts A mixed object which can either be a string representing the error message to be + * returned OR an object containing either: + * { success: successCallback, errorMsg: errorMessage } + * OR + * { success: successCallback, error: errorCallback } + * In both of the above, the successCallback must accept these parameters: data, status, headers, config + * If using the errorCallback it must accept these parameters: data, status, headers, config + * The success callback must return the data which will be resolved by the deferred object. + * The error callback must return an object containing: {errorMsg: errorMessage, data: originalData, status: status } + */ + resourcePromise: function (httpPromise, opts) { + var deferred = $q.defer(); + + /** The default success callback used if one is not supplied in the opts */ + function defaultSuccess(data, status, headers, config) { + //when it's successful, just return the data + return data; + } + + /** The default error callback used if one is not supplied in the opts */ + function defaultError(data, status, headers, config) { + return { + //NOTE: the default error message here should never be used based on the above docs! + errorMsg: (angular.isString(opts) ? opts : 'An error occurred!'), + data: data, + status: status + }; + } + + //create the callbacs based on whats been passed in. + var callbacks = { + success: ((!opts || !opts.success) ? defaultSuccess : opts.success), + error: ((!opts || !opts.error) ? defaultError : opts.error) + }; + + httpPromise.success(function (data, status, headers, config) { + + //invoke the callback + var result = callbacks.success.apply(this, [data, status, headers, config]); + + //when it's successful, just return the data + deferred.resolve(result); + + }).error(function (data, status, headers, config) { + + //invoke the callback + var result = callbacks.error.apply(this, [data, status, headers, config]); + + //when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled. + if (status >= 500 && status < 600) { + + //show a ysod dialog + if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) { + dialogService.ysodDialog({ + errorMsg: result.errorMsg, + data: result.data + }); + } + else { + //show a simple error notification + notificationsService.error("Server error", "Contact administrator, see log for full details.
    " + result.errorMsg + ""); + } + + } + else { + + //return an error object including the error message for UI + deferred.reject({ + errorMsg: result.errorMsg, + data: result.data, + status: result.status + }); + + } + + }); + + return deferred.promise; + + }, + + /** Used for saving media/content specifically */ + postSaveContent: function (args) { + + if (!args.restApiUrl) { + throw "args.restApiUrl is a required argument"; + } + if (!args.content) { + throw "args.content is a required argument"; + } + if (!args.action) { + throw "args.action is a required argument"; + } + if (!args.files) { + throw "args.files is a required argument"; + } + if (!args.dataFormatter) { + throw "args.dataFormatter is a required argument"; + } + + + var deferred = $q.defer(); + + //save the active tab id so we can set it when the data is returned. + var activeTab = _.find(args.content.tabs, function (item) { + return item.active; + }); + var activeTabIndex = (activeTab === undefined ? 0 : _.indexOf(args.content.tabs, activeTab)); + + //save the data + this.postMultiPartRequest( + args.restApiUrl, + { key: "contentItem", value: args.dataFormatter(args.content, args.action) }, + function (data, formData) { + //now add all of the assigned files + for (var f in args.files) { + //each item has a property alias and the file object, we'll ensure that the alias is suffixed to the key + // so we know which property it belongs to on the server side + formData.append("file_" + args.files[f].alias, args.files[f].file); + } + + }, + function (data, status, headers, config) { + //success callback + + //reset the tabs and set the active one + _.each(data.tabs, function (item) { + item.active = false; + }); + data.tabs[activeTabIndex].active = true; + + //the data returned is the up-to-date data so the UI will refresh + deferred.resolve(data); + }, + function (data, status, headers, config) { + //failure callback + + //when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled. + if (status >= 500 && status < 600) { + + //show a ysod dialog + if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) { + dialogService.ysodDialog({ + errorMsg: 'An error occurred', + data: data + }); + } + else { + //show a simple error notification + notificationsService.error("Server error", "Contact administrator, see log for full details.
    " + data.ExceptionMessage + ""); + } + + } + else { + + //return an error object including the error message for UI + deferred.reject({ + errorMsg: 'An error occurred', + data: data, + status: status + }); + } + + }); + + return deferred.promise; + }, + + /** Posts a multi-part mime request to the server */ + postMultiPartRequest: function (url, jsonData, transformCallback, successCallback, failureCallback) { + + //validate input, jsonData can be an array of key/value pairs or just one key/value pair. + if (!jsonData) { throw "jsonData cannot be null"; } + + if (angular.isArray(jsonData)) { + _.each(jsonData, function (item) { + if (!item.key || !item.value) { throw "jsonData array item must have both a key and a value property"; } + }); + } + else if (!jsonData.key || !jsonData.value) { throw "jsonData object must have both a key and a value property"; } + + + $http({ + method: 'POST', + url: url, + //IMPORTANT!!! You might think this should be set to 'multipart/form-data' but this is not true because when we are sending up files + // the request needs to include a 'boundary' parameter which identifies the boundary name between parts in this multi-part request + // and setting the Content-type manually will not set this boundary parameter. For whatever reason, setting the Content-type to 'false' + // will force the request to automatically populate the headers properly including the boundary parameter. + headers: { 'Content-Type': false }, + transformRequest: function (data) { + var formData = new FormData(); + //add the json data + if (angular.isArray(data)) { + _.each(data, function (item) { + formData.append(item.key, !angular.isString(item.value) ? angular.toJson(item.value) : item.value); + }); + } + else { + formData.append(data.key, !angular.isString(data.value) ? angular.toJson(data.value) : data.value); + } + + //call the callback + if (transformCallback) { + transformCallback.apply(this, [data, formData]); + } + + return formData; + }, + data: jsonData + }). + success(function (data, status, headers, config) { + if (successCallback) { + successCallback.apply(this, [data, status, headers, config]); + } + }). + error(function (data, status, headers, config) { + if (failureCallback) { + failureCallback.apply(this, [data, status, headers, config]); + } + }); + } + }; +} +angular.module('umbraco.services').factory('umbRequestHelper', umbRequestHelper); +angular.module('umbraco.services') + .factory('userService', function ($rootScope, eventsService, $q, $location, $log, securityRetryQueue, authResource, dialogService, $timeout, angularHelper) { + + var currentUser = null; + var lastUserId = null; + var loginDialog = null; + //this tracks the last date/time that the user's remainingAuthSeconds was updated from the server + // this is used so that we know when to go and get the user's remaining seconds directly. + var lastServerTimeoutSet = null; + + function openLoginDialog(isTimedOut) { + if (!loginDialog) { + loginDialog = dialogService.open({ + + //very special flag which means that global events cannot close this dialog + manualClose: true, + + template: 'views/common/dialogs/login.html', + modalClass: "login-overlay", + animation: "slide", + show: true, + callback: onLoginDialogClose, + dialogData: { + isTimedOut: isTimedOut + } + }); + } + } + + function onLoginDialogClose(success) { + loginDialog = null; + + if (success) { + securityRetryQueue.retryAll(); + } + else { + securityRetryQueue.cancelAll(); + $location.path('/'); + } + } + + /** + This methods will set the current user when it is resolved and + will then start the counter to count in-memory how many seconds they have + remaining on the auth session + */ + function setCurrentUser(usr) { + if (!usr.remainingAuthSeconds) { + throw "The user object is invalid, the remainingAuthSeconds is required."; + } + currentUser = usr; + lastServerTimeoutSet = new Date(); + //start the timer + countdownUserTimeout(); + } + + /** + Method to count down the current user's timeout seconds, + this will continually count down their current remaining seconds every 2 seconds until + there are no more seconds remaining. + */ + function countdownUserTimeout() { + + $timeout(function () { + + if (currentUser) { + //countdown by 2 seconds since that is how long our timer is for. + currentUser.remainingAuthSeconds -= 2; + + //if there are more than 30 remaining seconds, recurse! + if (currentUser.remainingAuthSeconds > 30) { + + //we need to check when the last time the timeout was set from the server, if + // it has been more than 30 seconds then we'll manually go and retrieve it from the + // server - this helps to keep our local countdown in check with the true timeout. + if (lastServerTimeoutSet != null) { + var now = new Date(); + var seconds = (now.getTime() - lastServerTimeoutSet.getTime()) / 1000; + + if (seconds > 30) { + + //first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we + // wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait. + lastServerTimeoutSet = null; + + //now go get it from the server + //NOTE: the safeApply because our timeout is set to not run digests (performance reasons) + angularHelper.safeApply($rootScope, function () { + authResource.getRemainingTimeoutSeconds().then(function (result) { + setUserTimeoutInternal(result); + }); + }); + } + } + + //recurse the countdown! + countdownUserTimeout(); + } + else { + + //we are either timed out or very close to timing out so we need to show the login dialog. + if (Umbraco.Sys.ServerVariables.umbracoSettings.keepUserLoggedIn !== true) { + //NOTE: the safeApply because our timeout is set to not run digests (performance reasons) + angularHelper.safeApply($rootScope, function () { + userAuthExpired(); + }); + } + else { + //we've got less than 30 seconds remaining so let's check the server + + if (lastServerTimeoutSet != null) { + //first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we + // wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait. + lastServerTimeoutSet = null; + + //now go get it from the server + //NOTE: the safeApply because our timeout is set to not run digests (performance reasons) + angularHelper.safeApply($rootScope, function () { + authResource.getRemainingTimeoutSeconds().then(function (result) { + setUserTimeoutInternal(result); + }); + }); + } + + //recurse the countdown! + countdownUserTimeout(); + + } + } + } + }, 2000, //every 2 seconds + false); //false = do NOT execute a digest for every iteration + } + + /** Called to update the current user's timeout */ + function setUserTimeoutInternal(newTimeout) { + + + var asNumber = parseFloat(newTimeout); + if (!isNaN(asNumber) && currentUser && angular.isNumber(asNumber)) { + currentUser.remainingAuthSeconds = newTimeout; + lastServerTimeoutSet = new Date(); + } + } + + /** resets all user data, broadcasts the notAuthenticated event and shows the login dialog */ + function userAuthExpired(isLogout) { + //store the last user id and clear the user + if (currentUser && currentUser.id !== undefined) { + lastUserId = currentUser.id; + } + + if (currentUser) { + currentUser.remainingAuthSeconds = 0; + } + + lastServerTimeoutSet = null; + currentUser = null; + + //broadcast a global event that the user is no longer logged in + eventsService.emit("app.notAuthenticated"); + + openLoginDialog(isLogout === undefined ? true : !isLogout); + } + + // Register a handler for when an item is added to the retry queue + securityRetryQueue.onItemAddedCallbacks.push(function (retryItem) { + if (securityRetryQueue.hasMore()) { + userAuthExpired(); + } + }); + + return { + + /** Internal method to display the login dialog */ + _showLoginDialog: function () { + openLoginDialog(); + }, + + /** Returns a promise, sends a request to the server to check if the current cookie is authorized */ + isAuthenticated: function () { + //if we've got a current user then just return true + if (currentUser) { + var deferred = $q.defer(); + deferred.resolve(true); + return deferred.promise; + } + return authResource.isAuthenticated(); + }, + + /** Returns a promise, sends a request to the server to validate the credentials */ + authenticate: function (login, password) { + + return authResource.performLogin(login, password) + .then(function (data) { + + //when it's successful, return the user data + setCurrentUser(data); + + var result = { user: data, authenticated: true, lastUserId: lastUserId }; + + //broadcast a global event + eventsService.emit("app.authenticated", result); + return result; + }); + }, + + /** Logs the user out + */ + logout: function () { + + return authResource.performLogout() + .then(function(data) { + userAuthExpired(); + //done! + return null; + }); + }, + + /** Returns the current user object in a promise */ + getCurrentUser: function (args) { + var deferred = $q.defer(); + + if (!currentUser) { + authResource.getCurrentUser() + .then(function (data) { + + var result = { user: data, authenticated: true, lastUserId: lastUserId }; + + if (args && args.broadcastEvent) { + //broadcast a global event, will inform listening controllers to load in the user specific data + eventsService.emit("app.authenticated", result); + } + + setCurrentUser(data); + currentUser.avatar = 'http://www.gravatar.com/avatar/' + data.emailHash + '?s=40&d=404'; + deferred.resolve(currentUser); + }); + + } + else { + deferred.resolve(currentUser); + } + + return deferred.promise; + }, + + /** Called whenever a server request is made that contains a x-umb-user-seconds response header for which we can update the user's remaining timeout seconds */ + setUserTimeout: function (newTimeout) { + setUserTimeoutInternal(newTimeout); + } + }; + + }); +/*Contains multiple services for various helper tasks */ + +function packageHelper(assetsService, treeService, eventsService, $templateCache) { + + return { + + /** Called when a package is installed, this resets a bunch of data and ensures the new package assets are loaded in */ + packageInstalled: function () { + + //clears the tree + treeService.clearCache(); + + //clears the template cache + $templateCache.removeAll(); + + //emit event to notify anything else + eventsService.emit("app.reInitialize"); + } + + }; +} +angular.module('umbraco.services').factory('packageHelper', packageHelper); + +function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, mediaHelper, umbRequestHelper) { + return { + /** sets the image's url, thumbnail and if its a folder */ + setImageData: function(img) { + + img.isFolder = !mediaHelper.hasFilePropertyType(img); + + if(!img.isFolder){ + img.thumbnail = mediaHelper.resolveFile(img, true); + img.image = mediaHelper.resolveFile(img, false); + } + }, + + /** sets the images original size properties - will check if it is a folder and if so will just make it square */ + setOriginalSize: function(img, maxHeight) { + //set to a square by default + img.originalWidth = maxHeight; + img.originalHeight = maxHeight; + + var widthProp = _.find(img.properties, function(v) { return (v.alias === "umbracoWidth"); }); + if (widthProp && widthProp.value) { + img.originalWidth = parseInt(widthProp.value, 10); + if (isNaN(img.originalWidth)) { + img.originalWidth = maxHeight; + } + } + var heightProp = _.find(img.properties, function(v) { return (v.alias === "umbracoHeight"); }); + if (heightProp && heightProp.value) { + img.originalHeight = parseInt(heightProp.value, 10); + if (isNaN(img.originalHeight)) { + img.originalHeight = maxHeight; + } + } + }, + + /** sets the image style which get's used in the angular markup */ + setImageStyle: function(img, width, height, rightMargin, bottomMargin) { + img.style = { width: width + "px", height: height + "px", "margin-right": rightMargin + "px", "margin-bottom": bottomMargin + "px" }; + img.thumbStyle = { + "background-image": "url('" + img.thumbnail + "')", + "background-repeat": "no-repeat", + "background-position": "center", + "background-size": Math.min(width, img.originalWidth) + "px " + Math.min(height, img.originalHeight) + "px" + }; + }, + + /** gets the image's scaled wdith based on the max row height */ + getScaledWidth: function(img, maxHeight) { + var scaled = img.originalWidth * maxHeight / img.originalHeight; + return scaled; + //round down, we don't want it too big even by half a pixel otherwise it'll drop to the next row + //return Math.floor(scaled); + }, + + /** returns the target row width taking into account how many images will be in the row and removing what the margin is */ + getTargetWidth: function(imgsPerRow, maxRowWidth, margin) { + //take into account the margin, we will have 1 less margin item than we have total images + return (maxRowWidth - ((imgsPerRow - 1) * margin)); + }, + + /** + This will determine the row/image height for the next collection of images which takes into account the + ideal image count per row. It will check if a row can be filled with this ideal count and if not - if there + are additional images available to fill the row it will keep calculating until they fit. + + It will return the calculated height and the number of images for the row. + + targetHeight = optional; + */ + getRowHeightForImages: function(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow, margin, targetHeight) { + + var idealImages = imgs.slice(0, idealImgPerRow); + //get the target row width without margin + var targetRowWidth = this.getTargetWidth(idealImages.length, maxRowWidth, margin); + //this gets the image with the smallest height which equals the maximum we can scale up for this image block + var maxScaleableHeight = this.getMaxScaleableHeight(idealImages, maxRowHeight); + //if the max scale height is smaller than the min display height, we'll use the min display height + targetHeight = targetHeight !== undefined ? targetHeight : Math.max(maxScaleableHeight, minDisplayHeight); + + var attemptedRowHeight = this.performGetRowHeight(idealImages, targetRowWidth, minDisplayHeight, targetHeight); + + if (attemptedRowHeight != null) { + + //if this is smaller than the min display then we need to use the min display, + // which means we'll need to remove one from the row so we can scale up to fill the row + if (attemptedRowHeight < minDisplayHeight) { + + if (idealImages.length > 1) { + + //we'll generate a new targetHeight that is halfway between the max and the current and recurse, passing in a new targetHeight + targetHeight += Math.floor((maxRowHeight - targetHeight) / 2); + return this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow - 1, margin, targetHeight); + } + else { + //this will occur when we only have one image remaining in the row but it's still going to be too wide even when + // using the minimum display height specified. In this case we're going to have to just crop the image in it's center + // using the minimum display height and the full row width + return { height: minDisplayHeight, imgCount: 1 }; + } + } + else { + //success! + return { height: attemptedRowHeight, imgCount: idealImages.length }; + } + } + + //we know the width will fit in a row, but we now need to figure out if we can fill + // the entire row in the case that we have more images remaining than the idealImgPerRow. + + if (idealImages.length === imgs.length) { + //we have no more remaining images to fill the space, so we'll just use the calc height + return { height: targetHeight, imgCount: idealImages.length }; + } + else if (idealImages.length === 1) { + //this will occur when we only have one image remaining in the row to process but it's not really going to fit ideally + // in the row. + return { height: minDisplayHeight, imgCount: 1 }; + } + else if (idealImages.length === idealImgPerRow && targetHeight < maxRowHeight) { + + //if we're already dealing with the ideal images per row and it's not quite wide enough, we can scale up a little bit so + // long as the targetHeight is currently less than the maxRowHeight. The scale up will be half-way between our current + // target height and the maxRowHeight (we won't loop forever though - if there's a difference of 5 px we'll just quit) + + while (targetHeight < maxRowHeight && (maxRowHeight - targetHeight) > 5) { + targetHeight += Math.floor((maxRowHeight - targetHeight) / 2); + attemptedRowHeight = this.performGetRowHeight(idealImages, targetRowWidth, minDisplayHeight, targetHeight); + if (attemptedRowHeight != null) { + //success! + return { height: attemptedRowHeight, imgCount: idealImages.length }; + } + } + + //Ok, we couldn't actually scale it up with the ideal row count we'll just recurse with a lesser image count. + return this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow - 1, margin); + } + else if (targetHeight === maxRowHeight) { + + //This is going to happen when: + // * We can fit a list of images in a row, but they come up too short (based on minDisplayHeight) + // * Then we'll try to remove an image, but when we try to scale to fit, the width comes up too narrow but the images are already at their + // maximum height (maxRowHeight) + // * So we're stuck, we cannot precicely fit the current list of images, so we'll render a row that will be max height but won't be wide enough + // which is better than rendering a row that is shorter than the minimum since that could be quite small. + + return { height: targetHeight, imgCount: idealImages.length }; + } + else { + + //we have additional images so we'll recurse and add 1 to the idealImgPerRow until it fits + return this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow + 1, margin); + } + + }, + + performGetRowHeight: function(idealImages, targetRowWidth, minDisplayHeight, targetHeight) { + + var currRowWidth = 0; + + for (var i = 0; i < idealImages.length; i++) { + var scaledW = this.getScaledWidth(idealImages[i], targetHeight); + currRowWidth += scaledW; + } + + if (currRowWidth > targetRowWidth) { + //get the new scaled height to fit + var newHeight = targetRowWidth * targetHeight / currRowWidth; + + return newHeight; + } + else if (idealImages.length === 1 && (currRowWidth <= targetRowWidth) && !idealImages[0].isFolder) { + //if there is only one image, then return the target height + return targetHeight; + } + else { + //if it's not successful, return false + return null; + } + }, + + /** builds an image grid row */ + buildRow: function(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow, margin) { + var currRowWidth = 0; + var row = { images: [] }; + + var imageRowHeight = this.getRowHeightForImages(imgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow, margin); + var targetWidth = this.getTargetWidth(imageRowHeight.imgCount, maxRowWidth, margin); + + var sizes = []; + //loop through the images we know fit into the height + for (var i = 0; i < imageRowHeight.imgCount; i++) { + //get the lower width to ensure it always fits + var scaledWidth = Math.floor(this.getScaledWidth(imgs[i], imageRowHeight.height)); + + if (currRowWidth + scaledWidth <= targetWidth) { + currRowWidth += scaledWidth; + sizes.push({ + width:scaledWidth, + //ensure that the height is rounded + height: Math.round(imageRowHeight.height) + }); + row.images.push(imgs[i]); + } + else if (imageRowHeight.imgCount === 1 && row.images.length === 0) { + //the image is simply too wide, we'll crop/center it + sizes.push({ + width: maxRowWidth, + //ensure that the height is rounded + height: Math.round(imageRowHeight.height) + }); + row.images.push(imgs[i]); + } + else { + //the max width has been reached + break; + } + } + + //loop through the images for the row and apply the styles + for (var j = 0; j < row.images.length; j++) { + var bottomMargin = margin; + //make the margin 0 for the last one + if (j === (row.images.length - 1)) { + margin = 0; + } + this.setImageStyle(row.images[j], sizes[j].width, sizes[j].height, margin, bottomMargin); + } + + if (row.images.length === 1) { + //if there's only one image on the row, set the container to max width + row.images[0].style.width = maxRowWidth + "px"; + } + + + return row; + }, + + /** Returns the maximum image scaling height for the current image collection */ + getMaxScaleableHeight: function(imgs, maxRowHeight) { + + var smallestHeight = _.min(imgs, function(item) { return item.originalHeight; }).originalHeight; + + //adjust the smallestHeight if it is larger than the static max row height + if (smallestHeight > maxRowHeight) { + smallestHeight = maxRowHeight; + } + return smallestHeight; + }, + + /** Creates the image grid with calculated widths/heights for images to fill the grid nicely */ + buildGrid: function(images, maxRowWidth, maxRowHeight, startingIndex, minDisplayHeight, idealImgPerRow, margin,imagesOnly) { + + var rows = []; + var imagesProcessed = 0; + + //first fill in all of the original image sizes and URLs + for (var i = startingIndex; i < images.length; i++) { + var item = images[i]; + + this.setImageData(item); + this.setOriginalSize(item, maxRowHeight); + + if(imagesOnly && !item.isFolder && !item.thumbnail){ + images.splice(i, 1); + i--; + } + } + + while ((imagesProcessed + startingIndex) < images.length) { + //get the maxHeight for the current un-processed images + var currImgs = images.slice(imagesProcessed); + + //build the row + var row = this.buildRow(currImgs, maxRowHeight, minDisplayHeight, maxRowWidth, idealImgPerRow, margin); + if (row.images.length > 0) { + rows.push(row); + imagesProcessed += row.images.length; + } + else { + + if (currImgs.length > 0) { + throw "Could not fill grid with all images, images remaining: " + currImgs.length; + } + + //if there was nothing processed, exit + break; + } + } + + return rows; + } + }; +} + +angular.module("umbraco.services").factory("umbPhotoFolderHelper", umbPhotoFolderHelper); + +/** + * @ngdoc function + * @name umbraco.services.umbModelMapper + * @function + * + * @description + * Utility class to map/convert models + */ +function umbModelMapper() { + + return { + + + /** + * @ngdoc function + * @name umbraco.services.umbModelMapper#convertToEntityBasic + * @methodOf umbraco.services.umbModelMapper + * @function + * + * @description + * Converts the source model to a basic entity model, it will throw an exception if there isn't enough data to create the model. + * @param {Object} source The source model + * @param {Number} source.id The node id of the model + * @param {String} source.name The node name + * @param {String} source.icon The models icon as a css class (.icon-doc) + * @param {Number} source.parentId The parentID, if no parent, set to -1 + * @param {path} source.path comma-seperated string of ancestor IDs (-1,1234,1782,1234) + */ + + /** This converts the source model to a basic entity model, it will throw an exception if there isn't enough data to create the model */ + convertToEntityBasic: function (source) { + var required = ["id", "name", "icon", "parentId", "path"]; + _.each(required, function (k) { + if (!_.has(source, k)) { + throw "The source object does not contain the property " + k; + } + }); + var optional = ["metaData", "key", "alias"]; + //now get the basic object + var result = _.pick(source, required.concat(optional)); + return result; + } + + }; +} +angular.module('umbraco.services').factory('umbModelMapper', umbModelMapper); + +/** + * @ngdoc function + * @name umbraco.services.umbSessionStorage + * @function + * + * @description + * Used to get/set things in browser sessionStorage but always prefixes keys with "umb_" and converts json vals so there is no overlap + * with any sessionStorage created by a developer. + */ +function umbSessionStorage($window) { + + //gets the sessionStorage object if available, otherwise just uses a normal object + // - required for unit tests. + var storage = $window['sessionStorage'] ? $window['sessionStorage'] : {}; + + return { + + get: function (key) { + return angular.fromJson(storage["umb_" + key]); + }, + + set : function(key, value) { + storage["umb_" + key] = angular.toJson(value); + } + + }; +} +angular.module('umbraco.services').factory('umbSessionStorage', umbSessionStorage); + +/** + * @ngdoc function + * @name umbraco.services.updateChecker + * @function + * + * @description + * used to check for updates and display a notifcation + */ +function updateChecker($http, umbRequestHelper) { + return { + + /** + * @ngdoc function + * @name umbraco.services.updateChecker#check + * @methodOf umbraco.services.updateChecker + * @function + * + * @description + * Called to load in the legacy tree js which is required on startup if a user is logged in or + * after login, but cannot be called until they are authenticated which is why it needs to be lazy loaded. + */ + check: function() { + + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "updateCheckApiBaseUrl", + "GetCheck")), + 'Failed to retrieve update status'); + } + }; +} +angular.module('umbraco.services').factory('updateChecker', updateChecker); + +/** +* @ngdoc service +* @name umbraco.services.umbPropertyEditorHelper +* @description A helper object used for property editors +**/ +function umbPropEditorHelper() { + return { + /** + * @ngdoc function + * @name getImagePropertyValue + * @methodOf umbraco.services.umbPropertyEditorHelper + * @function + * + * @description + * Returns the correct view path for a property editor, it will detect if it is a full virtual path but if not then default to the internal umbraco one + * + * @param {string} input the view path currently stored for the property editor + */ + getViewPath: function(input, isPreValue) { + var path = String(input); + + if (path.startsWith('/')) { + + //This is an absolute path, so just leave it + return path; + } else { + + if (path.indexOf("/") >= 0) { + //This is a relative path, so just leave it + return path; + } else { + if (!isPreValue) { + //i.e. views/propertyeditors/fileupload/fileupload.html + return "views/propertyeditors/" + path + "/" + path + ".html"; + } else { + //i.e. views/prevalueeditors/requiredfield.html + return "views/prevalueeditors/" + path + ".html"; + } + } + + } + } + }; +} +angular.module('umbraco.services').factory('umbPropEditorHelper', umbPropEditorHelper); + + +/** +* @ngdoc service +* @name umbraco.services.umbDataFormatter +* @description A helper object used to format/transform JSON Umbraco data, mostly used for persisting data to the server +**/ +function umbDataFormatter() { + return { + + /** formats the display model used to display the data type to the model used to save the data type */ + formatDataTypePostData: function(displayModel, preValues, action) { + var saveModel = { + parentId: -1, + id: displayModel.id, + name: displayModel.name, + selectedEditor: displayModel.selectedEditor, + //set the action on the save model + action: action, + preValues: [] + }; + for (var i = 0; i < preValues.length; i++) { + + saveModel.preValues.push({ + key: preValues[i].alias, + value: preValues[i].value + }); + } + return saveModel; + }, + + /** formats the display model used to display the member to the model used to save the member */ + formatMemberPostData: function(displayModel, action) { + //this is basically the same as for media but we need to explicitly add the username,email, password to the save model + + var saveModel = this.formatMediaPostData(displayModel, action); + + saveModel.key = displayModel.key; + + var genericTab = _.find(displayModel.tabs, function (item) { + return item.id === 0; + }); + + //map the member login, email, password and groups + var propLogin = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_login"; + }); + var propEmail = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_email"; + }); + var propPass = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_password"; + }); + var propGroups = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_membergroup"; + }); + saveModel.email = propEmail.value; + saveModel.username = propLogin.value; + saveModel.password = propPass.value; + + var selectedGroups = []; + for (var n in propGroups.value) { + if (propGroups.value[n] === true) { + selectedGroups.push(n); + } + } + saveModel.memberGroups = selectedGroups; + + //turn the dictionary into an array of pairs + var memberProviderPropAliases = _.pairs(displayModel.fieldConfig); + _.each(displayModel.tabs, function (tab) { + _.each(tab.properties, function (prop) { + var foundAlias = _.find(memberProviderPropAliases, function(item) { + return prop.alias === item[1]; + }); + if (foundAlias) { + //we know the current property matches an alias, now we need to determine which membership provider property it was for + // by looking at the key + switch (foundAlias[0]) { + case "umbracoMemberLockedOut": + saveModel.isLockedOut = prop.value.toString() === "1" ? true : false; + break; + case "umbracoMemberApproved": + saveModel.isApproved = prop.value.toString() === "1" ? true : false; + break; + case "umbracoMemberComments": + saveModel.comments = prop.value; + break; + } + } + }); + }); + + + + return saveModel; + }, + + /** formats the display model used to display the media to the model used to save the media */ + formatMediaPostData: function(displayModel, action) { + //NOTE: the display model inherits from the save model so we can in theory just post up the display model but + // we don't want to post all of the data as it is unecessary. + var saveModel = { + id: displayModel.id, + properties: [], + name: displayModel.name, + contentTypeAlias: displayModel.contentTypeAlias, + parentId: displayModel.parentId, + //set the action on the save model + action: action + }; + + _.each(displayModel.tabs, function (tab) { + + _.each(tab.properties, function (prop) { + + //don't include the custom generic tab properties + if (!prop.alias.startsWith("_umb_")) { + saveModel.properties.push({ + id: prop.id, + alias: prop.alias, + value: prop.value + }); + } + + }); + }); + + return saveModel; + }, + + /** formats the display model used to display the content to the model used to save the content */ + formatContentPostData: function (displayModel, action) { + + //this is basically the same as for media but we need to explicitly add some extra properties + var saveModel = this.formatMediaPostData(displayModel, action); + + var genericTab = _.find(displayModel.tabs, function (item) { + return item.id === 0; + }); + + var propExpireDate = _.find(genericTab.properties, function(item) { + return item.alias === "_umb_expiredate"; + }); + var propReleaseDate = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_releasedate"; + }); + var propTemplate = _.find(genericTab.properties, function (item) { + return item.alias === "_umb_template"; + }); + saveModel.expireDate = propExpireDate.value; + saveModel.releaseDate = propReleaseDate.value; + saveModel.templateAlias = propTemplate.value; + + return saveModel; + } + }; +} +angular.module('umbraco.services').factory('umbDataFormatter', umbDataFormatter); + + + +/** + * @ngdoc service + * @name umbraco.services.xmlhelper + * @function + * + * @description + * Used to convert legacy xml data to json and back again + */ +function xmlhelper($http) { + /* + Copyright 2011 Abdulla Abdurakhmanov + Original sources are available at https://code.google.com/p/x2js/ + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + + function X2JS() { + var VERSION = "1.0.11"; + var escapeMode = false; + + var DOMNodeTypes = { + ELEMENT_NODE: 1, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + DOCUMENT_NODE: 9 + }; + + function getNodeLocalName(node) { + var nodeLocalName = node.localName; + if (nodeLocalName == null) { + nodeLocalName = node.baseName; + } // Yeah, this is IE!! + + if (nodeLocalName === null || nodeLocalName === "") { + nodeLocalName = node.nodeName; + } // =="" is IE too + + return nodeLocalName; + } + + function getNodePrefix(node) { + return node.prefix; + } + + function escapeXmlChars(str) { + if (typeof (str) === "string") { + return str.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/'); + } else { + return str; + } + } + + function unescapeXmlChars(str) { + return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'").replace(///g, '\/'); + } + + function parseDOMChildren(node) { + var result, child, childName; + + if (node.nodeType === DOMNodeTypes.DOCUMENT_NODE) { + result = {}; + child = node.firstChild; + childName = getNodeLocalName(child); + result[childName] = parseDOMChildren(child); + return result; + } + else { + + if (node.nodeType === DOMNodeTypes.ELEMENT_NODE) { + result = {}; + result.__cnt = 0; + var nodeChildren = node.childNodes; + + // Children nodes + for (var cidx = 0; cidx < nodeChildren.length; cidx++) { + child = nodeChildren.item(cidx); // nodeChildren[cidx]; + childName = getNodeLocalName(child); + + result.__cnt++; + if (result[childName] === null) { + result[childName] = parseDOMChildren(child); + result[childName + "_asArray"] = new Array(1); + result[childName + "_asArray"][0] = result[childName]; + } + else { + if (result[childName] !== null) { + if (!(result[childName] instanceof Array)) { + var tmpObj = result[childName]; + result[childName] = []; + result[childName][0] = tmpObj; + + result[childName + "_asArray"] = result[childName]; + } + } + var aridx = 0; + while (result[childName][aridx] !== null) { + aridx++; + } + + (result[childName])[aridx] = parseDOMChildren(child); + } + } + + // Attributes + for (var aidx = 0; aidx < node.attributes.length; aidx++) { + var attr = node.attributes.item(aidx); // [aidx]; + result.__cnt++; + result["_" + attr.name] = attr.value; + } + + // Node namespace prefix + var nodePrefix = getNodePrefix(node); + if (nodePrefix !== null && nodePrefix !== "") { + result.__cnt++; + result.__prefix = nodePrefix; + } + + if (result.__cnt === 1 && result["#text"] !== null) { + result = result["#text"]; + } + + if (result["#text"] !== null) { + result.__text = result["#text"]; + if (escapeMode) { + result.__text = unescapeXmlChars(result.__text); + } + + delete result["#text"]; + delete result["#text_asArray"]; + } + if (result["#cdata-section"] != null) { + result.__cdata = result["#cdata-section"]; + delete result["#cdata-section"]; + delete result["#cdata-section_asArray"]; + } + + if (result.__text != null || result.__cdata != null) { + result.toString = function () { + return (this.__text != null ? this.__text : '') + (this.__cdata != null ? this.__cdata : ''); + }; + } + return result; + } + else { + if (node.nodeType === DOMNodeTypes.TEXT_NODE || node.nodeType === DOMNodeTypes.CDATA_SECTION_NODE) { + return node.nodeValue; + } + } + } + } + + function startTag(jsonObj, element, attrList, closed) { + var resultStr = "<" + ((jsonObj != null && jsonObj.__prefix != null) ? (jsonObj.__prefix + ":") : "") + element; + if (attrList != null) { + for (var aidx = 0; aidx < attrList.length; aidx++) { + var attrName = attrList[aidx]; + var attrVal = jsonObj[attrName]; + resultStr += " " + attrName.substr(1) + "='" + attrVal + "'"; + } + } + if (!closed) { + resultStr += ">"; + } else { + resultStr += "/>"; + } + + return resultStr; + } + + function endTag(jsonObj, elementName) { + return ""; + } + + function endsWith(str, suffix) { + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + function jsonXmlSpecialElem(jsonObj, jsonObjField) { + if (endsWith(jsonObjField.toString(), ("_asArray")) || jsonObjField.toString().indexOf("_") === 0 || (jsonObj[jsonObjField] instanceof Function)) { + return true; + } else { + return false; + } + } + + function jsonXmlElemCount(jsonObj) { + var elementsCnt = 0; + if (jsonObj instanceof Object) { + for (var it in jsonObj) { + if (jsonXmlSpecialElem(jsonObj, it)) { + continue; + } + elementsCnt++; + } + } + return elementsCnt; + } + + function parseJSONAttributes(jsonObj) { + var attrList = []; + if (jsonObj instanceof Object) { + for (var ait in jsonObj) { + if (ait.toString().indexOf("__") === -1 && ait.toString().indexOf("_") === 0) { + attrList.push(ait); + } + } + } + + return attrList; + } + + function parseJSONTextAttrs(jsonTxtObj) { + var result = ""; + + if (jsonTxtObj.__cdata != null) { + result += ""; + } + + if (jsonTxtObj.__text != null) { + if (escapeMode) { + result += escapeXmlChars(jsonTxtObj.__text); + } else { + result += jsonTxtObj.__text; + } + } + return result; + } + + function parseJSONTextObject(jsonTxtObj) { + var result = ""; + + if (jsonTxtObj instanceof Object) { + result += parseJSONTextAttrs(jsonTxtObj); + } + else { + if (jsonTxtObj != null) { + if (escapeMode) { + result += escapeXmlChars(jsonTxtObj); + } else { + result += jsonTxtObj; + } + } + } + + + return result; + } + + function parseJSONArray(jsonArrRoot, jsonArrObj, attrList) { + var result = ""; + if (jsonArrRoot.length === 0) { + result += startTag(jsonArrRoot, jsonArrObj, attrList, true); + } + else { + for (var arIdx = 0; arIdx < jsonArrRoot.length; arIdx++) { + result += startTag(jsonArrRoot[arIdx], jsonArrObj, parseJSONAttributes(jsonArrRoot[arIdx]), false); + result += parseJSONObject(jsonArrRoot[arIdx]); + result += endTag(jsonArrRoot[arIdx], jsonArrObj); + } + } + return result; + } + + function parseJSONObject(jsonObj) { + var result = ""; + + var elementsCnt = jsonXmlElemCount(jsonObj); + + if (elementsCnt > 0) { + for (var it in jsonObj) { + if (jsonXmlSpecialElem(jsonObj, it)) { + continue; + } + + var subObj = jsonObj[it]; + var attrList = parseJSONAttributes(subObj); + + if (subObj === null || subObj === undefined) { + result += startTag(subObj, it, attrList, true); + } else { + if (subObj instanceof Object) { + + if (subObj instanceof Array) { + result += parseJSONArray(subObj, it, attrList); + } else { + var subObjElementsCnt = jsonXmlElemCount(subObj); + if (subObjElementsCnt > 0 || subObj.__text !== null || subObj.__cdata !== null) { + result += startTag(subObj, it, attrList, false); + result += parseJSONObject(subObj); + result += endTag(subObj, it); + } else { + result += startTag(subObj, it, attrList, true); + } + } + + } else { + result += startTag(subObj, it, attrList, false); + result += parseJSONTextObject(subObj); + result += endTag(subObj, it); + } + } + } + } + result += parseJSONTextObject(jsonObj); + + return result; + } + + this.parseXmlString = function (xmlDocStr) { + var xmlDoc; + if (window.DOMParser) { + var parser = new window.DOMParser(); + xmlDoc = parser.parseFromString(xmlDocStr, "text/xml"); + } + else { + // IE :( + if (xmlDocStr.indexOf("") + 2); + } + xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = "false"; + xmlDoc.loadXML(xmlDocStr); + } + return xmlDoc; + }; + + this.xml2json = function (xmlDoc) { + return parseDOMChildren(xmlDoc); + }; + + this.xml_str2json = function (xmlDocStr) { + var xmlDoc = this.parseXmlString(xmlDocStr); + return this.xml2json(xmlDoc); + }; + + this.json2xml_str = function (jsonObj) { + return parseJSONObject(jsonObj); + }; + + this.json2xml = function (jsonObj) { + var xmlDocStr = this.json2xml_str(jsonObj); + return this.parseXmlString(xmlDocStr); + }; + + this.getVersion = function () { + return VERSION; + }; + + this.escapeMode = function (enabled) { + escapeMode = enabled; + }; + } + + var x2js = new X2JS(); + return { + /** Called to load in the legacy tree js which is required on startup if a user is logged in or + after login, but cannot be called until they are authenticated which is why it needs to be lazy loaded. */ + toJson: function (xml) { + var json = x2js.xml_str2json(xml); + return json; + }, + fromJson: function (json) { + var xml = x2js.json2xml_str(json); + return xml; + }, + parseFeed: function (url) { + return $http.jsonp('//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&callback=JSON_CALLBACK&q=' + encodeURIComponent(url)); + } + }; +} +angular.module('umbraco.services').factory('xmlhelper', xmlhelper); + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbraco.testing.js b/OurUmbraco.Site/umbraco/js/umbraco.testing.js new file mode 100644 index 00000000..81498bc5 --- /dev/null +++ b/OurUmbraco.Site/umbraco/js/umbraco.testing.js @@ -0,0 +1,2151 @@ +/*! umbraco - v7.1.6 - 2014-08-25 + * https://github.com/umbraco/umbraco-cms/ + * Copyright (c) 2014 Umbraco HQ; + * Licensed MIT + */ + +(function() { + +angular.module("umbraco.mocks", ['ngCookies']); +angular.module("umbraco.mocks.services", []); +angular.module('umbraco.mocks'). + factory('prevaluesMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function getRichTextConfiguration(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, { "plugins": [{ "name": "code", "useOnFrontend": true }, { "name": "paste", "useOnFrontend": true }, { "name": "umbracolink", "useOnFrontend": true }], "commands": [{ "icon": "images/editor/code.gif", "command": "code", "alias": "code", "userInterface": "false", "frontEndCommand": "code", "value": "", "priority": 1, "isStylePicker": false }, { "icon": "images/editor/removeformat.gif", "command": "removeformat", "alias": "removeformat", "userInterface": "false", "frontEndCommand": "removeformat", "value": "", "priority": 2, "isStylePicker": false }, { "icon": "images/editor/undo.gif", "command": "undo", "alias": "undo", "userInterface": "false", "frontEndCommand": "undo", "value": "", "priority": 11, "isStylePicker": false }, { "icon": "images/editor/redo.gif", "command": "redo", "alias": "redo", "userInterface": "false", "frontEndCommand": "redo", "value": "", "priority": 12, "isStylePicker": false }, { "icon": "images/editor/cut.gif", "command": "cut", "alias": "cut", "userInterface": "false", "frontEndCommand": "cut", "value": "", "priority": 13, "isStylePicker": false }, { "icon": "images/editor/copy.gif", "command": "copy", "alias": "copy", "userInterface": "false", "frontEndCommand": "copy", "value": "", "priority": 14, "isStylePicker": false }, { "icon": "images/editor/showStyles.png", "command": "styleselect", "alias": "styleselect", "userInterface": "false", "frontEndCommand": "styleselect", "value": "", "priority": 20, "isStylePicker": false }, { "icon": "images/editor/bold.gif", "command": "bold", "alias": "bold", "userInterface": "false", "frontEndCommand": "bold", "value": "", "priority": 21, "isStylePicker": false }, { "icon": "images/editor/italic.gif", "command": "italic", "alias": "italic", "userInterface": "false", "frontEndCommand": "italic", "value": "", "priority": 22, "isStylePicker": false }, { "icon": "images/editor/underline.gif", "command": "underline", "alias": "underline", "userInterface": "false", "frontEndCommand": "underline", "value": "", "priority": 23, "isStylePicker": false }, { "icon": "images/editor/strikethrough.gif", "command": "strikethrough", "alias": "strikethrough", "userInterface": "false", "frontEndCommand": "strikethrough", "value": "", "priority": 24, "isStylePicker": false }, { "icon": "images/editor/justifyleft.gif", "command": "justifyleft", "alias": "justifyleft", "userInterface": "false", "frontEndCommand": "alignleft", "value": "", "priority": 31, "isStylePicker": false }, { "icon": "images/editor/justifycenter.gif", "command": "justifycenter", "alias": "justifycenter", "userInterface": "false", "frontEndCommand": "aligncenter", "value": "", "priority": 32, "isStylePicker": false }, { "icon": "images/editor/justifyright.gif", "command": "justifyright", "alias": "justifyright", "userInterface": "false", "frontEndCommand": "alignright", "value": "", "priority": 33, "isStylePicker": false }, { "icon": "images/editor/justifyfull.gif", "command": "justifyfull", "alias": "justifyfull", "userInterface": "false", "frontEndCommand": "alignfull", "value": "", "priority": 34, "isStylePicker": false }, { "icon": "images/editor/bullist.gif", "command": "bullist", "alias": "bullist", "userInterface": "false", "frontEndCommand": "bullist", "value": "", "priority": 41, "isStylePicker": false }, { "icon": "images/editor/numlist.gif", "command": "numlist", "alias": "numlist", "userInterface": "false", "frontEndCommand": "numlist", "value": "", "priority": 42, "isStylePicker": false }, { "icon": "images/editor/outdent.gif", "command": "outdent", "alias": "outdent", "userInterface": "false", "frontEndCommand": "outdent", "value": "", "priority": 43, "isStylePicker": false }, { "icon": "images/editor/indent.gif", "command": "indent", "alias": "indent", "userInterface": "false", "frontEndCommand": "indent", "value": "", "priority": 44, "isStylePicker": false }, { "icon": "images/editor/link.gif", "command": "link", "alias": "mcelink", "userInterface": "true", "frontEndCommand": "link", "value": "", "priority": 51, "isStylePicker": false }, { "icon": "images/editor/unLink.gif", "command": "unlink", "alias": "unlink", "userInterface": "false", "frontEndCommand": "unlink", "value": "", "priority": 52, "isStylePicker": false }, { "icon": "images/editor/anchor.gif", "command": "anchor", "alias": "mceinsertanchor", "userInterface": "false", "frontEndCommand": "anchor", "value": "", "priority": 53, "isStylePicker": false }, { "icon": "images/editor/image.gif", "command": "image", "alias": "mceimage", "userInterface": "true", "frontEndCommand": "umbmediapicker", "value": "", "priority": 61, "isStylePicker": false }, { "icon": "images/editor/insMacro.gif", "command": "umbracomacro", "alias": "umbracomacro", "userInterface": "true", "frontEndCommand": "umbmacro", "value": "", "priority": 62, "isStylePicker": false }, { "icon": "images/editor/table.gif", "command": "table", "alias": "mceinserttable", "userInterface": "true", "frontEndCommand": "table", "value": "", "priority": 63, "isStylePicker": false }, { "icon": "images/editor/media.gif", "command": "umbracoembed", "alias": "umbracoembed", "userInterface": "true", "frontEndCommand": "umbembeddialog", "value": "", "priority": 66, "isStylePicker": false }, { "icon": "images/editor/hr.gif", "command": "hr", "alias": "inserthorizontalrule", "userInterface": "false", "frontEndCommand": "hr", "value": "", "priority": 71, "isStylePicker": false }, { "icon": "images/editor/sub.gif", "command": "sub", "alias": "subscript", "userInterface": "false", "frontEndCommand": "sub", "value": "", "priority": 72, "isStylePicker": false }, { "icon": "images/editor/sup.gif", "command": "sup", "alias": "superscript", "userInterface": "false", "frontEndCommand": "sup", "value": "", "priority": 73, "isStylePicker": false }, { "icon": "images/editor/charmap.gif", "command": "charmap", "alias": "mcecharmap", "userInterface": "false", "frontEndCommand": "charmap", "value": "", "priority": 74, "isStylePicker": false }], "validElements": "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align],-h2[id|dir|class|align],-h3[id|dir|class|align],-h4[id|dir|class|align],-h5[id|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*]", "inValidElements": "font", "customConfig": { "entity_encoding": "raw", "spellchecker_rpc_url": "GoogleSpellChecker.ashx" } }, null]; + } + } + + return { + register: function() { + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/RichTextPreValue/GetConfiguration')) + .respond(getRichTextConfiguration); + } + }; + }]); +angular.module('umbraco.mocks'). + factory('mocksUtils', ['$cookieStore', function($cookieStore) { + 'use strict'; + + //by default we will perform authorization + var doAuth = true; + + return { + + getMockDataType: function(id, selectedId) { + var dataType = { + id: id, + name: "Simple editor " + id, + selectedEditor: selectedId, + availableEditors: [ + { name: "Simple editor 1", editorId: String.CreateGuid() }, + { name: "Simple editor 2", editorId: String.CreateGuid() }, + { name: "Simple editor " + id, editorId: selectedId }, + { name: "Simple editor 4", editorId: String.CreateGuid() }, + { name: "Simple editor 5", editorId: String.CreateGuid() }, + { name: "Simple editor 6", editorId: String.CreateGuid() } + ], + preValues: [ + { + label: "Custom pre value 1 for editor " + selectedId, + description: "Enter a value for this pre-value", + key: "myPreVal1", + view: "requiredfield" + }, + { + label: "Custom pre value 2 for editor " + selectedId, + description: "Enter a value for this pre-value", + key: "myPreVal2", + view: "requiredfield" + } + ] + + }; + return dataType; + }, + + /** Creats a mock content object */ + getMockContent: function(id) { + var node = { + name: "My content with id: " + id, + updateDate: new Date().toIsoDateTimeString(), + publishDate: new Date().toIsoDateTimeString(), + createDate: new Date().toIsoDateTimeString(), + id: id, + parentId: 1234, + icon: "icon-umb-content", + owner: { name: "Administrator", id: 0 }, + updater: { name: "Per Ploug Krogslund", id: 1 }, + path: "-1,1234,2455", + allowedActions: ["U", "H", "A"], + tabs: [ + { + label: "Child documents", + id: 1, + active: true, + properties: [ + { alias: "list", label: "List", view: "listview", value: "", hideLabel: true, config:{entityType: "content"} }, + ] + }, + { + label: "Content", + id: 2, + properties: [ + { alias: "valTest", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

    askjdkasj lasjd

    ", config: {} }, + { alias: "textarea", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "media", label: "Media picker", view: "mediapicker", value: "1234,23242,23232,23231", config: {multiPicker: 1} } + ] + }, + { + label: "Sample Editor", + id: 3, + properties: [ + { alias: "datepicker", label: "Datepicker", view: "datepicker", config: { pickTime: false, format: "yyyy-MM-dd" } }, + { alias: "tags", label: "Tags", view: "tags", value: "" } + ] + }, + { + label: "This", + id: 4, + properties: [ + { alias: "valTest4", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText4", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

    askjdkasj lasjd

    ", config: {} }, + { alias: "textarea4", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "content4", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Is", + id: 5, + properties: [ + { alias: "valTest5", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText5", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

    askjdkasj lasjd

    ", config: {} }, + { alias: "textarea5", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "content5", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Overflown", + id: 6, + properties: [ + { alias: "valTest6", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText6", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

    askjdkasj lasjd

    ", config: {} }, + { alias: "textarea6", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "content6", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Tab # 7", + id: 7, + properties: [ + { alias: "valTest7", label: "Validation test", view: "validationtest", value: "asdfasdf" }, + { alias: "bodyText7", label: "Body Text", description: "Here you enter the primary article contents", view: "rte", value: "

    askjdkasj lasjd

    ", config: {} }, + { alias: "textarea7", label: "textarea", view: "textarea", value: "ajsdka sdjkds", config: { rows: 4 } }, + { alias: "content7", label: "Content picker", view: "contentpicker", value: "1234,23242,23232,23231" } + ] + }, + { + label: "Grid", + id: 8, + properties: [ + { alias: "grid", label: "Grid", view: "grid", value: "test", hideLabel: true } + ] + }, { + label: "Generic Properties", + id: 0, + properties: [ + { + label: 'Id', + value: 1234, + view: "readonlyvalue", + alias: "_umb_id" + }, + { + label: 'Created by', + description: 'Original author', + value: "Administrator", + view: "readonlyvalue", + alias: "_umb_createdby" + }, + { + label: 'Created', + description: 'Date/time this document was created', + value: new Date().toIsoDateTimeString(), + view: "readonlyvalue", + alias: "_umb_createdate" + }, + { + label: 'Updated', + description: 'Date/time this document was created', + value: new Date().toIsoDateTimeString(), + view: "readonlyvalue", + alias: "_umb_updatedate" + }, + { + label: 'Document Type', + value: "Home page", + view: "readonlyvalue", + alias: "_umb_doctype" + }, + { + label: 'Publish at', + description: 'Date/time to publish this document', + value: new Date().toIsoDateTimeString(), + view: "datepicker", + alias: "_umb_releasedate" + }, + { + label: 'Unpublish at', + description: 'Date/time to un-publish this document', + value: new Date().toIsoDateTimeString(), + view: "datepicker", + alias: "_umb_expiredate" + }, + { + label: 'Template', + value: "myTemplate", + view: "dropdown", + alias: "_umb_template", + config: { + items: { + "" : "-- Choose template --", + "myTemplate" : "My Templates", + "home" : "Home Page", + "news" : "News Page" + } + } + }, + { + label: 'Link to document', + value: ["/testing" + id, "http://localhost/testing" + id, "http://mydomain.com/testing" + id].join(), + view: "urllist", + alias: "_umb_urllist" + }, + { + alias: "test", label: "Stuff", view: "test", value: "", + config: { + fields: [ + { alias: "embedded", label: "Embbeded", view: "textstring", value: "" }, + { alias: "embedded2", label: "Embbeded 2", view: "contentpicker", value: "" }, + { alias: "embedded3", label: "Embbeded 3", view: "textarea", value: "" }, + { alias: "embedded4", label: "Embbeded 4", view: "datepicker", value: "" } + ] + } + } + ] + } + ] + }; + + return node; + }, + + getMockEntity : function(id){ + return {name: "hello", id: id, icon: "icon-file"}; + }, + + /** generally used for unit tests, calling this will disable the auth check and always return true */ + disableAuth: function() { + doAuth = false; + }, + + /** generally used for unit tests, calling this will enabled the auth check */ + enabledAuth: function() { + doAuth = true; + }, + + /** Checks for our mock auth cookie, if it's not there, returns false */ + checkAuth: function () { + if (doAuth) { + var mockAuthCookie = $cookieStore.get("mockAuthCookie"); + if (!mockAuthCookie) { + return false; + } + return true; + } + else { + return true; + } + }, + + /** Creates/sets the auth cookie with a value indicating the user is now authenticated */ + setAuth: function() { + //set the cookie for loging + $cookieStore.put("mockAuthCookie", "Logged in!"); + }, + + /** removes the auth cookie */ + clearAuth: function() { + $cookieStore.remove("mockAuthCookie"); + }, + + urlRegex: function(url) { + url = url.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + return new RegExp("^" + url); + }, + + getParameterByName: function(url, name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(url); + + return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); + }, + + getParametersByName: function(url, name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + + var regex = new RegExp(name + "=([^&#]*)", "mg"), results = []; + var match; + + while ( ( match = regex.exec(url) ) !== null ) + { + results.push(decodeURIComponent(match[1].replace(/\+/g, " "))); + } + + return results; + } + }; + }]); + +angular.module('umbraco.mocks'). + factory('contentMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnChildren(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var pageNumber = Number(mocksUtils.getParameterByName(data, "pageNumber")); + var filter = mocksUtils.getParameterByName(data, "filter"); + var pageSize = Number(mocksUtils.getParameterByName(data, "pageSize")); + var parentId = Number(mocksUtils.getParameterByName(data, "id")); + + if (pageNumber === 0) { + pageNumber = 1; + } + var collection = { pageSize: pageSize, totalItems: 68, totalPages: 7, pageNumber: pageNumber, filter: filter }; + collection.totalItems = 56 - (filter.length); + if (pageSize > 0) { + collection.totalPages = Math.round(collection.totalItems / collection.pageSize); + } + else { + collection.totalPages = 1; + } + collection.items = []; + + if (collection.totalItems < pageSize || pageSize < 1) { + collection.pageSize = collection.totalItems; + } else { + collection.pageSize = pageSize; + } + + var id = 0; + for (var i = 0; i < collection.pageSize; i++) { + id = (parentId + i) * pageNumber; + var cnt = mocksUtils.getMockContent(id); + + //here we fake filtering + if (filter !== '') { + cnt.name = filter + cnt.name; + } + + //set a fake sortOrder + cnt.sortOrder = i + 1; + + collection.items.push(cnt); + } + + return [200, collection, null]; + } + + function returnDeletedNode(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + return [200, null, null]; + } + + function returnEmptyNode(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var response = returnNodebyId(200, "", null); + var node = response[1]; + var parentId = mocksUtils.getParameterByName(data, "parentId") || 1234; + + node.name = ""; + node.id = 0; + node.parentId = parentId; + + $(node.tabs).each(function(i,tab){ + $(tab.properties).each(function(i, property){ + property.value = ""; + }); + }); + + return response; + } + + function returnNodebyId(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var id = mocksUtils.getParameterByName(data, "id") || "1234"; + id = parseInt(id, 10); + + var node = mocksUtils.getMockContent(id); + + return [200, node, null]; + } + + function returnNodebyIds(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var ids = mocksUtils.getParameterByName(data, "ids") || [1234,23324,2323,23424]; + var nodes = []; + + $(ids).each(function(i, id){ + var _id = parseInt(id, 10); + nodes.push(mocksUtils.getMockContent(_id)); + }); + + return [200, nodes, null]; + } + + function returnSort(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + return [200, null, null]; + } + + function returnSave(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + return [200, null, null]; + } + + return { + register: function () { + + $httpBackend + .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/PostSave')) + .respond(returnSave); + + $httpBackend + .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/PostSort')) + .respond(returnSort); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/GetChildren')) + .respond(returnChildren); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/GetByIds')) + .respond(returnNodebyIds); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/GetById?')) + .respond(returnNodebyId); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/GetEmpty')) + .respond(returnEmptyNode); + + $httpBackend + .whenDELETE(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/DeleteById')) + .respond(returnDeletedNode); + + $httpBackend + .whenDELETE(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/EmptyRecycleBin')) + .respond(returnDeletedNode); + }, + + expectGetById: function() { + $httpBackend + .expectGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Content/GetById')); + } + }; + }]); +angular.module('umbraco.mocks'). + factory('contentTypeMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnAllowedChildren(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var types = [ + { name: "News Article", description: "Standard news article", alias: "newsArticle", id: 1234, icon: "icon-file", thumbnail: "icon-file" }, + { name: "News Area", description: "Area to hold all news articles, there should be only one", alias: "newsArea", id: 1234, icon: "icon-suitcase", thumbnail: "icon-suitcase" }, + { name: "Employee", description: "Employee profile information page", alias: "employee", id: 1234, icon: "icon-user", thumbnail: "icon-user" } + ]; + return [200, types, null]; + } + + return { + register: function() { + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/Api/ContentType/GetAllowedChildren')) + .respond(returnAllowedChildren); + + }, + expectAllowedChildren: function(){ + console.log("expecting get"); + $httpBackend.expectGET(mocksUtils.urlRegex('/umbraco/Api/ContentType/GetAllowedChildren')); + } + }; + }]); +angular.module('umbraco.mocks'). + factory('dashboardMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function getDashboard(status, data, headers) { + //check for existence of a cookie so we can do login/logout in the belle app (ignore for tests). + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + //TODO: return real mocked data + return [200, [], null]; + } + } + + return { + register: function() { + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Dashboard/GetDashboard')) + .respond(getDashboard); + } + }; + }]); +angular.module('umbraco.mocks'). + factory('dataTypeMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnById(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var id = mocksUtils.getParameterByName(data, "id") || 1234; + + var selectedId = String.CreateGuid(); + + var dataType = mocksUtils.getMockDataType(id, selectedId); + + return [200, dataType, null]; + } + + function returnEmpty(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var response = returnById(200, "", null); + var node = response[1]; + + node.name = ""; + node.selectedEditor = ""; + node.id = 0; + node.preValues = []; + + return response; + } + + function returnPreValues(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var editorId = mocksUtils.getParameterByName(data, "editorId") || "83E9AD36-51A7-4440-8C07-8A5623AC6979"; + + var preValues = [ + { + label: "Custom pre value 1 for editor " + editorId, + description: "Enter a value for this pre-value", + key: "myPreVal", + view: "requiredfield", + validation: [ + { + type: "Required" + } + ] + }, + { + label: "Custom pre value 2 for editor " + editorId, + description: "Enter a value for this pre-value", + key: "myPreVal", + view: "requiredfield", + validation: [ + { + type: "Required" + } + ] + } + ]; + return [200, preValues, null]; + } + + function returnSave(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var postedData = angular.fromJson(headers); + + var dataType = mocksUtils.getMockDataType(postedData.id, postedData.selectedEditor); + dataType.notifications = [{ + header: "Saved", + message: "Data type saved", + type: 0 + }]; + + return [200, dataType, null]; + } + + return { + register: function() { + + $httpBackend + .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/PostSave')) + .respond(returnSave); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById')) + .respond(returnById); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetEmpty')) + .respond(returnEmpty); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetPreValues')) + .respond(returnPreValues); + }, + expectGetById: function() { + $httpBackend + .expectGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/DataType/GetById')); + } + }; + }]); + +angular.module('umbraco.mocks'). + factory('entityMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnEntitybyId(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var id = mocksUtils.getParameterByName(data, "id") || "1234"; + id = parseInt(id, 10); + + var node = mocksUtils.getMockEntity(id); + + return [200, node, null]; + } + + function returnEntitybyIds(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var ids = mocksUtils.getParametersByName(data, "ids") || [1234, 23324, 2323, 23424]; + var nodes = []; + + $(ids).each(function (i, id) { + var _id = parseInt(id, 10); + nodes.push(mocksUtils.getMockEntity(_id)); + }); + + return [200, nodes, null]; + } + + + return { + register: function () { + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Entity/GetByIds')) + .respond(returnEntitybyIds); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Entity/GetAncestors')) + .respond(returnEntitybyIds); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Entity/GetById?')) + .respond(returnEntitybyId); + } + }; + }]); +angular.module('umbraco.mocks'). + factory('macroMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnParameters(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var nodes = [{ + alias: "parameter1", + name: "Parameter 1" + }, { + alias: "parameter2", + name: "Parameter 2" + }]; + + return [200, nodes, null]; + } + + + return { + register: function () { + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Macro/GetMacroParameters')) + .respond(returnParameters); + + } + }; + }]); +angular.module('umbraco.mocks'). + factory('mediaMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function returnNodeCollection(status, data, headers){ + var nodes = [{"properties":[{"id":348,"value":"/media/1045/windows95.jpg","alias":"umbracoFile"},{"id":349,"value":"640","alias":"umbracoWidth"},{"id":350,"value":"472","alias":"umbracoHeight"},{"id":351,"value":"53472","alias":"umbracoBytes"},{"id":352,"value":"jpg","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:08","createDate":"2013-08-27 15:50:08","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":0,"name":"windows95.jpg","id":1128,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":353,"value":"/media/1046/pete.png","alias":"umbracoFile"},{"id":354,"value":"240","alias":"umbracoWidth"},{"id":355,"value":"240","alias":"umbracoHeight"},{"id":356,"value":"87408","alias":"umbracoBytes"},{"id":357,"value":"png","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:08","createDate":"2013-08-27 15:50:08","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":1,"name":"pete.png","id":1129,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":358,"value":"/media/1047/unicorn.jpg","alias":"umbracoFile"},{"id":359,"value":"640","alias":"umbracoWidth"},{"id":360,"value":"640","alias":"umbracoHeight"},{"id":361,"value":"577380","alias":"umbracoBytes"},{"id":362,"value":"jpg","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:09","createDate":"2013-08-27 15:50:09","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":2,"name":"unicorn.jpg","id":1130,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":363,"value":"/media/1049/exploding-head.gif","alias":"umbracoFile"},{"id":364,"value":"500","alias":"umbracoWidth"},{"id":365,"value":"279","alias":"umbracoHeight"},{"id":366,"value":"451237","alias":"umbracoBytes"},{"id":367,"value":"gif","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:09","createDate":"2013-08-27 15:50:09","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":3,"name":"exploding head.gif","id":1131,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":368,"value":"/media/1048/bighead.jpg","alias":"umbracoFile"},{"id":369,"value":"1240","alias":"umbracoWidth"},{"id":370,"value":"1655","alias":"umbracoHeight"},{"id":371,"value":"836261","alias":"umbracoBytes"},{"id":372,"value":"jpg","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:09","createDate":"2013-08-27 15:50:09","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":4,"name":"bighead.jpg","id":1132,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":373,"value":"/media/1050/powerlines.jpg","alias":"umbracoFile"},{"id":374,"value":"636","alias":"umbracoWidth"},{"id":375,"value":"423","alias":"umbracoHeight"},{"id":376,"value":"79874","alias":"umbracoBytes"},{"id":377,"value":"jpg","alias":"umbracoExtension"}],"updateDate":"2013-08-27 15:50:09","createDate":"2013-08-27 15:50:09","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Image","sortOrder":5,"name":"powerlines.jpg","id":1133,"icon":"mediaPhoto.gif","parentId":1127},{"properties":[{"id":430,"value":"","alias":"contents"}],"updateDate":"2013-08-30 08:53:22","createDate":"2013-08-30 08:53:22","owner":{"id":0,"name":"admin"},"updator":null,"contentTypeAlias":"Folder","sortOrder":6,"name":"new folder","id":1146,"icon":"folder.gif","parentId":1127}]; + return [200, nodes, null]; + } + + function returnNodebyIds(status, data, headers) { + var ids = mocksUtils.getParameterByName(data, "ids") || "1234,1234,4234"; + var items = []; + + _.each(ids, function(id){ + items.push(_getNode( parseInt( id, 10 )) ); + }); + + return [200, items, null]; + } + + function returnNodebyId(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var id = mocksUtils.getParameterByName(data, "id") || 1234; + id = parseInt(id, 10); + + + + return [200, _getNode(id), null]; + } + + function _getNode(id){ + var node = { + name: "My media with id: " + id, + updateDate: new Date(), + publishDate: new Date(), + id: id, + parentId: 1234, + icon: "icon-file-alt", + owner: {name: "Administrator", id: 0}, + updater: {name: "Per Ploug Krogslund", id: 1}, + path: "-1,1234,2455", + tabs: [ + { + label: "Media", + alias: "tab0", + id: 0, + properties: [ + { alias: "umbracoFile", label: "File", description:"Some file", view: "rte", value: "/media/1234/random.jpg" } + ] + } + ] + }; + + return node; + } + + return { + register: function() { + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Media/GetById?')) + .respond(returnNodebyId); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Media/GetByIds?')) + .respond(returnNodebyIds); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Media/GetChildren')) + .respond(returnNodeCollection); + + }, + expectGetById: function() { + $httpBackend + .expectGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Media/GetById')); + } + }; + }]); + +/** +* @ngdoc service +* @name umbraco.mocks.sectionMocks +* @description +* Mocks data retrival for the sections +**/ +function sectionMocks($httpBackend, mocksUtils) { + + /** internal method to mock the sections to be returned */ + function getSections() { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var sections = [ + { name: "Content", cssclass: "icon-umb-content", alias: "content" }, + { name: "Media", cssclass: "icon-umb-media", alias: "media" }, + { name: "Settings", cssclass: "icon-umb-settings", alias: "settings" }, + { name: "Developer", cssclass: "icon-umb-developer", alias: "developer" }, + { name: "Users", cssclass: "icon-umb-users", alias: "users" }, + { name: "Developer", cssclass: "icon-umb-developer", alias: "developer" }, + { name: "Users", cssclass: "icon-umb-users", alias: "users" } + ]; + + return [200, sections, null]; + } + + return { + register: function () { + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Section/GetSections')) + .respond(getSections); + } + }; +} + +angular.module('umbraco.mocks').factory('sectionMocks', ['$httpBackend', 'mocksUtils', sectionMocks]); + +angular.module('umbraco.mocks'). + factory('treeMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function getMenuItems() { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var menu = [ + { name: "Create", cssclass: "plus", alias: "create", metaData: {} }, + + { seperator: true, name: "Delete", cssclass: "remove", alias: "delete", metaData: {} }, + { name: "Move", cssclass: "move", alias: "move", metaData: {} }, + { name: "Copy", cssclass: "copy", alias: "copy", metaData: {} }, + { name: "Sort", cssclass: "sort", alias: "sort", metaData: {} }, + + { seperator: true, name: "Publish", cssclass: "globe", alias: "publish", metaData: {} }, + { name: "Rollback", cssclass: "undo", alias: "rollback", metaData: {} }, + + { seperator: true, name: "Permissions", cssclass: "lock", alias: "permissions", metaData: {} }, + { name: "Audit Trail", cssclass: "time", alias: "audittrail", metaData: {} }, + { name: "Notifications", cssclass: "envelope", alias: "notifications", metaData: {} }, + + { seperator: true, name: "Hostnames", cssclass: "home", alias: "hostnames", metaData: {} }, + { name: "Public Access", cssclass: "group", alias: "publicaccess", metaData: {} }, + + { seperator: true, name: "Reload", cssclass: "refresh", alias: "users", metaData: {} }, + + { seperator: true, name: "Empty Recycle Bin", cssclass: "trash", alias: "emptyrecyclebin", metaData: {} } + ]; + + var result = { + menuItems: menu, + defaultAlias: "create" + }; + + return [200, result, null]; + } + + function returnChildren(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var id = mocksUtils.getParameterByName(data, "id"); + var section = mocksUtils.getParameterByName(data, "treeType"); + var level = mocksUtils.getParameterByName(data, "level")+1; + + var url = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren?treeType=" + section + "&id=1234&level=" + level; + var menuUrl = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetMenu?treeType=" + section + "&id=1234&parentId=456"; + + //hack to have create as default content action + var action; + if (section === "content") { + action = "create"; + } + + var children = [ + { name: "child-of-" + section, childNodesUrl: url, id: level + "" + 1234, icon: "icon-document", children: [], expanded: false, hasChildren: true, level: level, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: level + "" + 1235, icon: "icon-document", children: [], expanded: false, hasChildren: true, level: level, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: level + "" + 1236, icon: "icon-document", children: [], expanded: false, hasChildren: true, level: level, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: level + "" + 1237, icon: "icon-document", routePath: "common/legacy/1237?p=" + encodeURI("developer/contentType.aspx?idequal1234"), children: [], expanded: false, hasChildren: true, level: level, menuUrl: menuUrl } + ]; + + return [200, children, null]; + } + + function returnDataTypes(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var children = [ + { name: "Textstring", childNodesUrl: null, id: 10, icon: "icon-document", children: [], expanded: false, hasChildren: false, level: 1, menuUrl: null }, + { name: "Multiple textstring", childNodesUrl: null, id: 11, icon: "icon-document", children: [], expanded: false, hasChildren: false, level: 1, menuUrl: null }, + { name: "Yes/No", childNodesUrl: null, id: 12, icon: "icon-document", children: [], expanded: false, hasChildren: false, level: 1, menuUrl: null }, + { name: "Rich Text Editor", childNodesUrl: null, id: 13, icon: "icon-document", children: [], expanded: false, hasChildren: false, level: 1, menuUrl: null } + ]; + + return [200, children, null]; + } + + function returnDataTypeMenu(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var menu = [ + { + name: "Create", cssclass: "plus", alias: "create", metaData: { + jsAction: "umbracoMenuActions.CreateChildEntity" + } + }, + { seperator: true, name: "Reload", cssclass: "refresh", alias: "users", metaData: {} } + ]; + + return [200, menu, null]; + } + + function returnApplicationTrees(status, data, headers) { + + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + + var section = mocksUtils.getParameterByName(data, "application"); + var url = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren?treeType=" + section + "&id=1234&level=1"; + var menuUrl = "/umbraco/UmbracoTrees/ApplicationTreeApi/GetMenu?treeType=" + section + "&id=1234&parentId=456"; + var t; + switch (section) { + + case "content": + t = { + name: "content", + id: -1, + children: [ + { name: "My website", id: 1234, childNodesUrl: url, icon: "icon-home", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "Components", id: 1235, childNodesUrl: url, icon: "icon-document", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "Archieve", id: 1236, childNodesUrl: url, icon: "icon-document", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "Recycle Bin", id: -20, childNodesUrl: url, icon: "icon-trash", routePath: section + "/recyclebin", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl } + ], + expanded: true, + hasChildren: true, + level: 0, + menuUrl: menuUrl, + metaData: { treeAlias: "content" } + }; + + break; + case "media": + t = { + name: "media", + id: -1, + children: [ + { name: "random-name-" + section, childNodesUrl: url, id: 1234, icon: "icon-home", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1235, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1236, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1237, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl } + ], + expanded: true, + hasChildren: true, + level: 0, + menuUrl: menuUrl, + metaData: { treeAlias: "media" } + }; + + break; + case "developer": + + var dataTypeChildrenUrl = "/umbraco/UmbracoTrees/DataTypeTree/GetNodes?id=-1&application=developer"; + var dataTypeMenuUrl = "/umbraco/UmbracoTrees/DataTypeTree/GetMenu?id=-1&application=developer"; + + t = { + name: "developer", + id: -1, + children: [ + { name: "Data types", childNodesUrl: dataTypeChildrenUrl, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: dataTypeMenuUrl, metaData: { treeAlias: "datatype" } }, + { name: "Macros", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "macros" } }, + { name: "Packages", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "packager" } }, + { name: "XSLT Files", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "xslt" } }, + { name: "Partial View Macros", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "partialViewMacros" } } + ], + expanded: true, + hasChildren: true, + level: 0, + isContainer: true + }; + + break; + case "settings": + t = { + name: "settings", + id: -1, + children: [ + { name: "Stylesheets", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "stylesheets" } }, + { name: "Templates", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "templates" } }, + { name: "Dictionary", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "dictionary" } }, + { name: "Media types", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "mediaTypes" } }, + { name: "Document types", childNodesUrl: url, id: -1, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl, metaData: { treeAlias: "nodeTypes" } } + ], + expanded: true, + hasChildren: true, + level: 0, + isContainer: true + }; + + break; + default: + + t = { + name: "randomTree", + id: -1, + children: [ + { name: "random-name-" + section, childNodesUrl: url, id: 1234, icon: "icon-home", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1235, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1236, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl }, + { name: "random-name-" + section, childNodesUrl: url, id: 1237, icon: "icon-folder-close", children: [], expanded: false, hasChildren: true, level: 1, menuUrl: menuUrl } + ], + expanded: true, + hasChildren: true, + level: 0, + menuUrl: menuUrl, + metaData: { treeAlias: "randomTree" } + }; + + break; + } + + + return [200, t, null]; + } + + + return { + register: function() { + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoTrees/ApplicationTreeApi/GetApplicationTrees')) + .respond(returnApplicationTrees); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoTrees/ApplicationTreeApi/GetChildren')) + .respond(returnChildren); + + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoTrees/DataTypeTree/GetNodes')) + .respond(returnDataTypes); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoTrees/DataTypeTree/GetMenu')) + .respond(returnDataTypeMenu); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoTrees/ApplicationTreeApi/GetMenu')) + .respond(getMenuItems); + + } + }; + }]); +angular.module('umbraco.mocks'). + factory('userMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function generateMockedUser() { + // Ensure a new user object each call + return { + name: "Per Ploug", + email: "test@test.com", + emailHash: "f9879d71855b5ff21e4963273a886bfc", + id: 0, + locale: 'da-DK', + remainingAuthSeconds: 600 + }; + } + + function isAuthenticated() { + //check for existence of a cookie so we can do login/logout in the belle app (ignore for tests). + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, null, null]; + } + } + + function getCurrentUser(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, generateMockedUser(), null]; + } + } + + function getRemainingTimeoutSeconds(status, data, headers) { + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, 600, null]; + } + } + + function returnUser(status, data, headers) { + + //set the cookie for loging + mocksUtils.setAuth(); + + return [200, generateMockedUser(), null]; + } + + function logout() { + + mocksUtils.clearAuth(); + + return [200, null, null]; + + } + + return { + register: function() { + + $httpBackend + .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/Authentication/PostLogin')) + .respond(returnUser); + + $httpBackend + .whenPOST(mocksUtils.urlRegex('/umbraco/UmbracoApi/Authentication/PostLogout')) + .respond(logout); + + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/UmbracoApi/Authentication/IsAuthenticated')) + .respond(isAuthenticated); + + $httpBackend + .whenGET('/umbraco/UmbracoApi/Authentication/GetCurrentUser') + .respond(getCurrentUser); + + $httpBackend + .whenGET('/umbraco/UmbracoApi/Authentication/GetRemainingTimeoutSeconds') + .respond(getRemainingTimeoutSeconds); + + + } + }; + }]); +angular.module('umbraco.mocks.services') +.factory('assetsService', function ($q) { + + return { + loadCss : function(path, scope, attributes, timeout){ + var deferred = $q.defer(); + deferred.resolve(); + return deferred.promise; + }, + loadJs : function(path, scope, attributes, timeout){ + var deferred = $q.defer(); + + if(path[0] !== "/"){ + path = "/" + path; + } + + $.getScript( "base" + path, function( data, textStatus, jqxhr ) { + deferred.resolve(); + }); + + return deferred.promise; + } + }; +}); +angular.module('umbraco.mocks'). + factory('localizationMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function getLanguageResource(status, data, headers) { + //check for existence of a cookie so we can do login/logout in the belle app (ignore for tests). + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, { + "actions_assignDomain": "Culture and Hostnames", + "actions_auditTrail": "Audit Trail", + "actions_browse": "Browse Node", + "actions_changeDocType": "Change Document Type", + "actions_copy": "Copy", + "actions_create": "Create", + "actions_createPackage": "Create Package", + "actions_delete": "Delete", + "actions_disable": "Disable", + "actions_emptyTrashcan": "Empty recycle bin", + "actions_exportDocumentType": "Export Document Type", + "actions_importDocumentType": "Import Document Type", + "actions_importPackage": "Import Package", + "actions_liveEdit": "Edit in Canvas", + "actions_logout": "Exit", + "actions_move": "Move", + "actions_notify": "Notifications", + "actions_protect": "Public access", + "actions_publish": "Publish", + "actions_unpublish": "Unpublish", + "actions_refreshNode": "Reload nodes", + "actions_republish": "Republish entire site", + "actions_rights": "Permissions", + "actions_rollback": "Rollback", + "actions_sendtopublish": "Send To Publish", + "actions_sendToTranslate": "Send To Translation", + "actions_sort": "Sort", + "actions_toPublish": "Send to publication", + "actions_translate": "Translate", + "actions_update": "Update", + "actions_exportContourForm": "Export form", + "actions_importContourForm": "Import form", + "actions_archiveContourForm": "Archive form", + "actions_unarchiveContourForm": "Unarchive form", + "actions_defaultValue": "Default value", + "assignDomain_permissionDenied": "Permission denied.", + "assignDomain_addNew": "Add new Domain", + "assignDomain_remove": "remove", + "assignDomain_invalidNode": "Invalid node.", + "assignDomain_invalidDomain": "Invalid domain format.", + "assignDomain_duplicateDomain": "Domain has already been assigned.", + "assignDomain_domain": "Domain", + "assignDomain_language": "Language", + "assignDomain_domainCreated": "New domain '%0%' has been created", + "assignDomain_domainDeleted": "Domain '%0%' is deleted", + "assignDomain_domainExists": "Domain '%0%' has already been assigned", + "assignDomain_domainHelp": "Valid domain names are: 'example.com', 'www.example.com', 'example.com:8080' or 'https://www.example.com/'.

    One-level paths in domains are supported, eg. 'example.com/en'. However, they should be avoided. Better use the culture setting above.", + "assignDomain_domainUpdated": "Domain '%0%' has been updated", + "assignDomain_orEdit": "Edit Current Domains", + "assignDomain_inherit": "Inherit", + "assignDomain_setLanguage": "Culture", + "assignDomain_setLanguageHelp": "Set the culture for nodes below the current node,
    or inherit culture from parent nodes. Will also apply
    to the current node, unless a domain below applies too.", + "assignDomain_setDomains": "Domains", + "auditTrails_atViewingFor": "Viewing for", + "buttons_select": "Select", + "buttons_somethingElse": "Do something else", + "buttons_bold": "Bold", + "buttons_deindent": "Cancel Paragraph Indent", + "buttons_formFieldInsert": "Insert form field", + "buttons_graphicHeadline": "Insert graphic headline", + "buttons_htmlEdit": "Edit Html", + "buttons_indent": "Indent Paragraph", + "buttons_italic": "Italic", + "buttons_justifyCenter": "Center", + "buttons_justifyLeft": "Justify Left", + "buttons_justifyRight": "Justify Right", + "buttons_linkInsert": "Insert Link", + "buttons_linkLocal": "Insert local link (anchor)", + "buttons_listBullet": "Bullet List", + "buttons_listNumeric": "Numeric List", + "buttons_macroInsert": "Insert macro", + "buttons_pictureInsert": "Insert picture", + "buttons_relations": "Edit relations", + "buttons_save": "Save", + "buttons_saveAndPublish": "Save and publish", + "buttons_saveToPublish": "Save and send for approval", + "buttons_showPage": "Preview", + "buttons_showPageDisabled": "Preview is disabled because there's no template assigned", + "buttons_styleChoose": "Choose style", + "buttons_styleShow": "Show styles", + "buttons_tableInsert": "Insert table", + "changeDocType_changeDocTypeInstruction": "To change the document type for the selected content, first select from the list of valid types for this location.", + "changeDocType_changeDocTypeInstruction2": "Then confirm and/or amend the mapping of properties from the current type to the new, and click Save.", + "changeDocType_contentRepublished": "The content has been re-published.", + "changeDocType_currentProperty": "Current Property", + "changeDocType_currentType": "Current type", + "changeDocType_docTypeCannotBeChanged": "The document type cannot be changed, as there are no alternatives valid for this location.", + "changeDocType_docTypeChanged": "Document Type Changed", + "changeDocType_mapProperties": "Map Properties", + "changeDocType_mapToProperty": "Map to Property", + "changeDocType_newTemplate": "New Template", + "changeDocType_newType": "New Type", + "changeDocType_none": "none", + "changeDocType_selectedContent": "Content", + "changeDocType_selectNewDocType": "Select New Document Type", + "changeDocType_successMessage": "The document type of the selected content has been successfully changed to [new type] and the following properties mapped:", + "changeDocType_to": "to", + "changeDocType_validationErrorPropertyWithMoreThanOneMapping": "Could not complete property mapping as one or more properties have more than one mapping defined.", + "changeDocType_validDocTypesNote": "Only alternate types valid for the current location are displayed.", + "content_about": "About this page", + "content_alias": "Alias", + "content_alternativeTextHelp": "(how would you describe the picture over the phone)", + "content_alternativeUrls": "Alternative Links", + "content_clickToEdit": "Click to edit this item", + "content_createBy": "Created by", + "content_createByDesc": "Original autho", + "content_updatedBy": "Updated by", + "content_createDate": "Created", + "content_createDateDesc": "Date/time this document was created", + "content_documentType": "Document Type", + "content_editing": "Editing", + "content_expireDate": "Remove at", + "content_itemChanged": "This item has been changed after publication", + "content_itemNotPublished": "This item is not published", + "content_lastPublished": "Last published", + "content_listViewNoItems": "There are no items show in the list.", + "content_mediatype": "Media Type", + "content_mediaLinks": "Link to media item(s)", + "content_membergroup": "Member Group", + "content_memberrole": "Role", + "content_membertype": "Member Type", + "content_noDate": "No date chosen", + "content_nodeName": "Page Title", + "content_otherElements": "Properties", + "content_parentNotPublished": "This document is published but is not visible because the parent '%0%' is unpublished", + "content_parentNotPublishedAnomaly": "Oops: this document is published but is not in the cache (internal error)", + "content_publish": "Publish", + "content_publishStatus": "Publication Status", + "content_releaseDate": "Publish at", + "content_removeDate": "Clear Date", + "content_sortDone": "Sortorder is updated", + "content_sortHelp": "To sort the nodes, simply drag the nodes or click one of the column headers. You can select multiple nodes by holding the 'shift' or 'control' key while selecting", + "content_statistics": "Statistics", + "content_titleOptional": "Title (optional)", + "content_type": "Type", + "content_unPublish": "Unpublish", + "content_updateDate": "Last edited", + "content_updateDateDesc": "Date/time this document was created", + "content_uploadClear": "Remove file", + "content_urls": "Link to document", + "content_memberof": "Member of group(s)", + "content_notmemberof": "Not a member of group(s)", + "content_childItems": "Child items", + "create_chooseNode": "Where do you want to create the new %0%", + "create_createUnder": "Create a page under", + "create_updateData": "Choose a type and a title", + "create_noDocumentTypes": "There are no allowed document types available. You must enable these in the settings section under 'document types'.", + "create_noMediaTypes": "There are no allowed media types available. You must enable these in the settings section under 'media types'.", + "dashboard_browser": "Browse your website", + "dashboard_dontShowAgain": "- Hide", + "dashboard_nothinghappens": "If umbraco isn't opening, you might need to allow popups from this site", + "dashboard_openinnew": "has opened in a new window", + "dashboard_restart": "Restart", + "dashboard_visit": "Visit", + "dashboard_welcome": "Welcome", + "defaultdialogs_anchorInsert": "Name", + "defaultdialogs_assignDomain": "Manage hostnames", + "defaultdialogs_closeThisWindow": "Close this window", + "defaultdialogs_confirmdelete": "Are you sure you want to delete", + "defaultdialogs_confirmdisable": "Are you sure you want to disable", + "defaultdialogs_confirmEmptyTrashcan": "Please check this box to confirm deletion of %0% item(s)", + "defaultdialogs_confirmlogout": "Are you sure?", + "defaultdialogs_confirmSure": "Are you sure?", + "defaultdialogs_cut": "Cut", + "defaultdialogs_editdictionary": "Edit Dictionary Item", + "defaultdialogs_editlanguage": "Edit Language", + "defaultdialogs_insertAnchor": "Insert local link", + "defaultdialogs_insertCharacter": "Insert character", + "defaultdialogs_insertgraphicheadline": "Insert graphic headline", + "defaultdialogs_insertimage": "Insert picture", + "defaultdialogs_insertlink": "Insert link", + "defaultdialogs_insertMacro": "Click to add a Macro", + "defaultdialogs_inserttable": "Insert table", + "defaultdialogs_lastEdited": "Last Edited", + "defaultdialogs_link": "Link", + "defaultdialogs_linkinternal": "Internal link:", + "defaultdialogs_linklocaltip": "When using local links, insert '#' infront of link", + "defaultdialogs_linknewwindow": "Open in new window?", + "defaultdialogs_macroContainerSettings": "Macro Settings", + "defaultdialogs_macroDoesNotHaveProperties": "This macro does not contain any properties you can edit", + "defaultdialogs_paste": "Paste", + "defaultdialogs_permissionsEdit": "Edit Permissions for", + "defaultdialogs_recycleBinDeleting": "The items in the recycle bin are now being deleted. Please do not close this window while this operation takes place", + "defaultdialogs_recycleBinIsEmpty": "The recycle bin is now empty", + "defaultdialogs_recycleBinWarning": "When items are deleted from the recycle bin, they will be gone forever", + "defaultdialogs_regexSearchError": "regexlib.com's webservice is currently experiencing some problems, which we have no control over. We are very sorry for this inconvenience.", + "defaultdialogs_regexSearchHelp": "Search for a regular expression to add validation to a form field. Exemple: 'email, 'zip-code' 'url'", + "defaultdialogs_removeMacro": "Remove Macro", + "defaultdialogs_requiredField": "Required Field", + "defaultdialogs_sitereindexed": "Site is reindexed", + "defaultdialogs_siterepublished": "The website cache has been refreshed. All publish content is now uptodate. While all unpublished content is still unpublished", + "defaultdialogs_siterepublishHelp": "The website cache will be refreshed. All published content will be updated, while unpublished content will stay unpublished.", + "defaultdialogs_tableColumns": "Number of columns", + "defaultdialogs_tableRows": "Number of rows", + "defaultdialogs_templateContentAreaHelp": "Set a placeholder id by setting an ID on your placeholder you can inject content into this template from child templates, by refering this ID using a <asp:content /> element.", + "defaultdialogs_templateContentPlaceHolderHelp": "Select a placeholder id from the list below. You can only choose Id's from the current template's master.", + "defaultdialogs_thumbnailimageclickfororiginal": "Click on the image to see full size", + "defaultdialogs_treepicker": "Pick item", + "defaultdialogs_viewCacheItem": "View Cache Item", + "dictionaryItem_description": "Edit the different language versions for the dictionary item '%0%' below
    You can add additional languages under the 'languages' in the menu on the left ", + "dictionaryItem_displayName": "Culture Name", + "placeholders_username": "Enter your username", + "placeholders_password": "Enter your password", + "placeholders_entername": "Enter a name...", + "placeholders_nameentity": "Name the %0%...", + "placeholders_search": "Type to search...", + "placeholders_filter": "Type to filter...", + "editcontenttype_allowedchildnodetypes": "Allowed child nodetypes", + "editcontenttype_create": "Create", + "editcontenttype_deletetab": "Delete tab", + "editcontenttype_description": "Description", + "editcontenttype_newtab": "New tab", + "editcontenttype_tab": "Tab", + "editcontenttype_thumbnail": "Thumbnail", + "editcontenttype_iscontainercontenttype": "Use as container content type", + "editdatatype_addPrevalue": "Add prevalue", + "editdatatype_dataBaseDatatype": "Database datatype", + "editdatatype_guid": "Property editor GUID", + "editdatatype_renderControl": "Property editor", + "editdatatype_rteButtons": "Buttons", + "editdatatype_rteEnableAdvancedSettings": "Enable advanced settings for", + "editdatatype_rteEnableContextMenu": "Enable context menu", + "editdatatype_rteMaximumDefaultImgSize": "Maximum default size of inserted images", + "editdatatype_rteRelatedStylesheets": "Related stylesheets", + "editdatatype_rteShowLabel": "Show label", + "editdatatype_rteWidthAndHeight": "Width and height", + "errorHandling_errorButDataWasSaved": "Your data has been saved, but before you can publish this page there are some errors you need to fix first:", + "errorHandling_errorChangingProviderPassword": "The current MemberShip Provider does not support changing password (EnablePasswordRetrieval need to be true)", + "errorHandling_errorExistsWithoutTab": "%0% already exists", + "errorHandling_errorHeader": "There were errors:", + "errorHandling_errorHeaderWithoutTab": "There were errors:", + "errorHandling_errorInPasswordFormat": "The password should be a minimum of %0% characters long and contain at least %1% non-alpha numeric character(s)", + "errorHandling_errorIntegerWithoutTab": "%0% must be an integer", + "errorHandling_errorMandatory": "The %0% field in the %1% tab is mandatory", + "errorHandling_errorMandatoryWithoutTab": "%0% is a mandatory field", + "errorHandling_errorRegExp": "%0% at %1% is not in a correct format", + "errorHandling_errorRegExpWithoutTab": "%0% is not in a correct format", + "errors_dissallowedMediaType": "The specified file type has been dissallowed by the administrator", + "errors_codemirroriewarning": "NOTE! Even though CodeMirror is enabled by configuration, it is disabled in Internet Explorer because it's not stable enough.", + "errors_contentTypeAliasAndNameNotNull": "Please fill both alias and name on the new propertytype!", + "errors_filePermissionsError": "There is a problem with read/write access to a specific file or folder", + "errors_missingTitle": "Please enter a title", + "errors_missingType": "Please choose a type", + "errors_pictureResizeBiggerThanOrg": "You're about to make the picture larger than the original size. Are you sure that you want to proceed?", + "errors_pythonErrorHeader": "Error in python script", + "errors_pythonErrorText": "The python script has not been saved, because it contained error(s)", + "errors_startNodeDoesNotExists": "Startnode deleted, please contact your administrator", + "errors_stylesMustMarkBeforeSelect": "Please mark content before changing style", + "errors_stylesNoStylesOnPage": "No active styles available", + "errors_tableColMergeLeft": "Please place cursor at the left of the two cells you wish to merge", + "errors_tableSplitNotSplittable": "You cannot split a cell that hasn't been merged.", + "errors_xsltErrorHeader": "Error in XSLT source", + "errors_xsltErrorText": "The XSLT has not been saved, because it contained error(s)", + "general_about": "About", + "general_action": "Action", + "general_add": "Add", + "general_alias": "Alias", + "general_areyousure": "Are you sure?", + "general_border": "Border", + "general_by": "or", + "general_cancel": "Cancel", + "general_cellMargin": "Cell margin", + "general_choose": "Choose", + "general_close": "Close", + "general_closewindow": "Close Window", + "general_comment": "Comment", + "general_confirm": "Confirm", + "general_constrainProportions": "Constrain proportions", + "general_continue": "Continue", + "general_copy": "Copy", + "general_create": "Create", + "general_database": "Database", + "general_date": "Date", + "general_default": "Default", + "general_delete": "Delete", + "general_deleted": "Deleted", + "general_deleting": "Deleting...", + "general_design": "Design", + "general_dimensions": "Dimensions", + "general_down": "Down", + "general_download": "Download", + "general_edit": "Edit", + "general_edited": "Edited", + "general_elements": "Elements", + "general_email": "Email", + "general_error": "Error", + "general_findDocument": "Find", + "general_height": "Height", + "general_help": "Help", + "general_icon": "Icon", + "general_import": "Import", + "general_innerMargin": "Inner margin", + "general_insert": "Insert", + "general_install": "Install", + "general_justify": "Justify", + "general_language": "Language", + "general_layout": "Layout", + "general_loading": "Loading", + "general_locked": "Locked", + "general_login": "Login", + "general_logoff": "Log off", + "general_logout": "Logout", + "general_macro": "Macro", + "general_move": "Move", + "general_name": "Name", + "general_new": "New", + "general_next": "Next", + "general_no": "No", + "general_of": "of", + "general_ok": "OK", + "general_open": "Open", + "general_or": "or", + "general_password": "Password", + "general_path": "Path", + "general_placeHolderID": "Placeholder ID", + "general_pleasewait": "One moment please...", + "general_previous": "Previous", + "general_properties": "Properties", + "general_reciept": "Email to receive form data", + "general_recycleBin": "Recycle Bin", + "general_remaining": "Remaining", + "general_rename": "Rename", + "general_renew": "Renew", + "general_required": "Required", + "general_retry": "Retry", + "general_rights": "Permissions", + "general_search": "Search", + "general_server": "Server", + "general_show": "Show", + "general_showPageOnSend": "Show page on Send", + "general_size": "Size", + "general_sort": "Sort", + "general_type": "Type", + "general_typeToSearch": "Type to search...", + "general_up": "Up", + "general_update": "Update", + "general_upgrade": "Upgrade", + "general_upload": "Upload", + "general_url": "Url", + "general_user": "User", + "general_username": "Username", + "general_value": "Value", + "general_view": "View", + "general_welcome": "Welcome...", + "general_width": "Width", + "general_yes": "Yes", + "general_folder": "Folder", + "general_searchResults": "Search results", + "graphicheadline_backgroundcolor": "Background color", + "graphicheadline_bold": "Bold", + "graphicheadline_color": "Text color", + "graphicheadline_font": "Font", + "graphicheadline_text": "Text", + "headers_page": "Page", + "installer_databaseErrorCannotConnect": "The installer cannot connect to the database.", + "installer_databaseErrorWebConfig": "Could not save the web.config file. Please modify the connection string manually.", + "installer_databaseFound": "Your database has been found and is identified as", + "installer_databaseHeader": "Database configuration", + "installer_databaseInstall": " Press the install button to install the Umbraco %0% database ", + "installer_databaseInstallDone": "Umbraco %0% has now been copied to your database. Press Next to proceed.", + "installer_databaseNotFound": "

    Database not found! Please check that the information in the 'connection string' of the \"web.config\" file is correct.

    To proceed, please edit the 'web.config' file (using Visual Studio or your favourite text editor), scroll to the bottom, add the connection string for your database in the key named 'umbracoDbDSN' and save the file.

    Click the retry button when done.
    More information on editing web.config here.

    ", + "installer_databaseText": "To complete this step, you must know some information regarding your database server ('connection string').
    Please contact your ISP if necessary. If you're installing on a local machine or server you might need information from your system administrator.", + "installer_databaseUpgrade": "

    Press the upgrade button to upgrade your database to Umbraco %0%

    Don't worry - no content will be deleted and everything will continue working afterwards!

    ", + "installer_databaseUpgradeDone": "Your database has been upgraded to the final version %0%.
    Press Next to proceed. ", + "installer_databaseUpToDate": "Your current database is up-to-date!. Click next to continue the configuration wizard", + "installer_defaultUserChangePass": "The Default users' password needs to be changed!", + "installer_defaultUserDisabled": "The Default user has been disabled or has no access to umbraco!

    No further actions needs to be taken. Click Next to proceed.", + "installer_defaultUserPassChanged": "The Default user's password has been successfully changed since the installation!

    No further actions needs to be taken. Click Next to proceed.", + "installer_defaultUserPasswordChanged": "The password is changed!", + "installer_defaultUserText": "

    umbraco creates a default user with a login ('admin') and password ('default'). It's important that the password is changed to something unique.

    This step will check the default user's password and suggest if it needs to be changed.

    ", + "installer_greatStart": "Get a great start, watch our introduction videos", + "installer_licenseText": "By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this umbraco distribution consists of two different licenses, the open source MIT license for the framework and the umbraco freeware license that covers the UI.", + "installer_None": "Not installed yet.", + "installer_permissionsAffectedFolders": "Affected files and folders", + "installer_permissionsAffectedFoldersMoreInfo": "More information on setting up permissions for umbraco here", + "installer_permissionsAffectedFoldersText": "You need to grant ASP.NET modify permissions to the following files/folders", + "installer_permissionsAlmostPerfect": "Your permission settings are almost perfect!

    You can run umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of umbraco.", + "installer_permissionsHowtoResolve": "How to Resolve", + "installer_permissionsHowtoResolveLink": "Click here to read the text version", + "installer_permissionsHowtoResolveText": "Watch our video tutorial on setting up folder permissions for umbraco or read the text version.", + "installer_permissionsMaybeAnIssue": "Your permission settings might be an issue!

    You can run umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of umbraco.", + "installer_permissionsNotReady": "Your permission settings are not ready for umbraco!

    In order to run umbraco, you'll need to update your permission settings.", + "installer_permissionsPerfect": "Your permission settings are perfect!

    You are ready to run umbraco and install packages!", + "installer_permissionsResolveFolderIssues": "Resolving folder issue", + "installer_permissionsResolveFolderIssuesLink": "Follow this link for more information on problems with ASP.NET and creating folders", + "installer_permissionsSettingUpPermissions": "Setting up folder permissions", + "installer_permissionsText": " umbraco needs write/modify access to certain directories in order to store files like pictures and PDF's. It also stores temporary data (aka: cache) for enhancing the performance of your website. ", + "installer_runwayFromScratch": "I want to start from scratch", + "installer_runwayFromScratchText": " Your website is completely empty at the moment, so that's perfect if you want to start from scratch and create your own document types and templates. (learn how) You can still choose to install Runway later on. Please go to the Developer section and choose Packages. ", + "installer_runwayHeader": "You've just set up a clean Umbraco platform. What do you want to do next?", + "installer_runwayInstalled": "Runway is installed", + "installer_runwayInstalledText": " You have the foundation in place. Select what modules you wish to install on top of it.
    This is our list of recommended modules, check off the ones you would like to install, or view the full list of modules ", + "installer_runwayOnlyProUsers": "Only recommended for experienced users", + "installer_runwaySimpleSite": "I want to start with a simple website", + "installer_runwaySimpleSiteText": "

    'Runway' is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, but you can easily edit, extend or remove it. It's not necessary and you can perfectly use Umbraco without it. However, Runway offers an easy foundation based on best practices to get you started faster than ever. If you choose to install Runway, you can optionally select basic building blocks called Runway Modules to enhance your Runway pages.

    Included with Runway: Home page, Getting Started page, Installing Modules page.
    Optional Modules: Top Navigation, Sitemap, Contact, Gallery.
    ", + "installer_runwayWhatIsRunway": "What is Runway", + "installer_step1": "Step 1/5 Accept license", + "installer_step2": "Step 2/5: Database configuration", + "installer_step3": "Step 3/5: Validating File Permissions", + "installer_step4": "Step 4/5: Check umbraco security", + "installer_step5": "Step 5/5: Umbraco is ready to get you started", + "installer_thankYou": "Thank you for choosing umbraco", + "installer_theEndBrowseSite": "

    Browse your new site

    You installed Runway, so why not see how your new website looks.", + "installer_theEndFurtherHelp": "

    Further help and information

    Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the umbraco terminology", + "installer_theEndHeader": "Umbraco %0% is installed and ready for use", + "installer_theEndInstallFailed": "To finish the installation, you'll need to manually edit the /web.config file and update the AppSetting key umbracoConfigurationStatus in the bottom to the value of '%0%'.", + "installer_theEndInstallSuccess": "You can get started instantly by clicking the 'Launch Umbraco' button below.
    If you are new to umbraco, you can find plenty of resources on our getting started pages.", + "installer_theEndOpenUmbraco": "

    Launch Umbraco

    To manage your website, simply open the umbraco back office and start adding content, updating the templates and stylesheets or add new functionality", + "installer_Unavailable": "Connection to database failed.", + "installer_Version3": "Umbraco Version 3", + "installer_Version4": "Umbraco Version 4", + "installer_watch": "Watch", + "installer_welcomeIntro": "This wizard will guide you through the process of configuring umbraco %0% for a fresh install or upgrading from version 3.0.

    Press 'next' to start the wizard.", + "language_cultureCode": "Culture Code", + "language_displayName": "Culture Name", + "lockout_lockoutWillOccur": "You've been idle and logout will automatically occur in", + "lockout_renewSession": "Renew now to save your work", + "login_greeting1": "Happy super Sunday", + "login_greeting2": "Happy manic Monday ", + "login_greeting3": "Happy tremendous Tuesday", + "login_greeting4": "Happy wonderful Wednesday", + "login_greeting5": "Happy thunderous Thursday", + "login_greeting6": "Happy friendly Friday", + "login_greeting7": "Happy shiny Saturday", + "login_instruction": "Log in below:", + "login_bottomText": "

    © 2001 - %0%
    umbraco.org

    ", + "main_dashboard": "Dashboard", + "main_sections": "Sections", + "main_tree": "Content", + "moveOrCopy_choose": "Choose page above...", + "moveOrCopy_copyDone": "%0% has been copied to %1%", + "moveOrCopy_copyTo": "Select where the document %0% should be copied to below", + "moveOrCopy_moveDone": "%0% has been moved to %1%", + "moveOrCopy_moveTo": "Select where the document %0% should be moved to below", + "moveOrCopy_nodeSelected": "has been selected as the root of your new content, click 'ok' below.", + "moveOrCopy_noNodeSelected": "No node selected yet, please select a node in the list above before clicking 'ok'", + "moveOrCopy_notAllowedByContentType": "The current node is not allowed under the chosen node because of its type", + "moveOrCopy_notAllowedByPath": "The current node cannot be moved to one of its subpages", + "moveOrCopy_notAllowedAtRoot": "The current node cannot exist at the root", + "moveOrCopy_notValid": "The action isn't allowed since you have insufficient permissions on 1 or more child documents.", + "moveOrCopy_relateToOriginal": "Relate copied items to original", + "notifications_editNotifications": "Edit your notification for %0%", + "notifications_mailBody": " Hi %0% This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' by the user '%3%' Go to http://%4%/actions/editContent.aspx?id=%5% to edit. Have a nice day! Cheers from the umbraco robot ", + "notifications_mailBodyHtml": "

    Hi %0%

    This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' by the user '%3%'

    Update summary:

    %6%

    Have a nice day!

    Cheers from the umbraco robot

    ", + "notifications_mailSubject": "[%0%] Notification about %1% performed on %2%", + "notifications_notifications": "Notifications", + "packager_chooseLocalPackageText": " Choose Package from your machine, by clicking the Browse
    button and locating the package. umbraco packages usually have a '.umb' or '.zip' extension. ", + "packager_packageAuthor": "Author", + "packager_packageDemonstration": "Demonstration", + "packager_packageDocumentation": "Documentation", + "packager_packageMetaData": "Package meta data", + "packager_packageName": "Package name", + "packager_packageNoItemsHeader": "Package doesn't contain any items", + "packager_packageNoItemsText": "This package file doesn't contain any items to uninstall.

    You can safely remove this from the system by clicking 'uninstall package' below.", + "packager_packageNoUpgrades": "No upgrades available", + "packager_packageOptions": "Package options", + "packager_packageReadme": "Package readme", + "packager_packageRepository": "Package repository", + "packager_packageUninstallConfirm": "Confirm uninstall", + "packager_packageUninstalledHeader": "Package was uninstalled", + "packager_packageUninstalledText": "The package was successfully uninstalled", + "packager_packageUninstallHeader": "Uninstall package", + "packager_packageUninstallText": "You can unselect items you do not wish to remove, at this time, below. When you click 'confirm uninstall' all checked-off items will be removed.
    Notice: any documents, media etc depending on the items you remove, will stop working, and could lead to system instability, so uninstall with caution. If in doubt, contact the package author.", + "packager_packageUpgradeDownload": "Download update from the repository", + "packager_packageUpgradeHeader": "Upgrade package", + "packager_packageUpgradeInstructions": "Upgrade instructions", + "packager_packageUpgradeText": " There's an upgrade available for this package. You can download it directly from the umbraco package repository.", + "packager_packageVersion": "Package version", + "packager_packageVersionHistory": "Package version history", + "packager_viewPackageWebsite": "View package website", + "paste_doNothing": "Paste with full formatting (Not recommended)", + "paste_errorMessage": "The text you're trying to paste contains special characters or formatting. This could be caused by copying text from Microsoft Word. umbraco can remove special characters or formatting automatically, so the pasted content will be more suitable for the web.", + "paste_removeAll": "Paste as raw text without any formatting at all", + "paste_removeSpecialFormattering": "Paste, but remove formatting (Recommended)", + "publicAccess_paAdvanced": "Role based protection", + "publicAccess_paAdvancedHelp": "If you wish to control access to the page using role-based authentication,
    using umbraco's member groups.", + "publicAccess_paAdvancedNoGroups": "You need to create a membergroup before you can use
    role-based authentication.", + "publicAccess_paErrorPage": "Error Page", + "publicAccess_paErrorPageHelp": "Used when people are logged on, but do not have access", + "publicAccess_paHowWould": "Choose how to restict access to this page", + "publicAccess_paIsProtected": "%0% is now protected", + "publicAccess_paIsRemoved": "Protection removed from %0%", + "publicAccess_paLoginPage": "Login Page", + "publicAccess_paLoginPageHelp": "Choose the page that has the login formular", + "publicAccess_paRemoveProtection": "Remove Protection", + "publicAccess_paSelectPages": "Select the pages that contain login form and error messages", + "publicAccess_paSelectRoles": "Pick the roles who have access to this page", + "publicAccess_paSetLogin": "Set the login and password for this page", + "publicAccess_paSimple": "Single user protection", + "publicAccess_paSimpleHelp": "If you just want to setup simple protection using a single login and password", + "publish_contentPublishedFailedInvalid": " %0% could not be published because these properties: %1% did not pass validation rules. ", + "publish_contentPublishedFailedByEvent": " %0% could not be published, due to a 3rd party extension cancelling the action. ", + "publish_contentPublishedFailedByParent": " %0% can not be published, because a parent page is not published. ", + "publish_includeUnpublished": "Include unpublished child pages", + "publish_inProgress": "Publishing in progress - please wait...", + "publish_inProgressCounter": "%0% out of %1% pages have been published...", + "publish_nodePublish": "%0% has been published", + "publish_nodePublishAll": "%0% and subpages have been published", + "publish_publishAll": "Publish %0% and all its subpages", + "publish_publishHelp": "Click ok to publish %0% and thereby making it's content publicly available.

    You can publish this page and all it's sub-pages by checking publish all children below. ", + "relatedlinks_addExternal": "Add external link", + "relatedlinks_addInternal": "Add internal link", + "relatedlinks_addlink": "Add", + "relatedlinks_caption": "Caption", + "relatedlinks_internalPage": "Internal page", + "relatedlinks_linkurl": "URL", + "relatedlinks_modeDown": "Move Down", + "relatedlinks_modeUp": "Move Up", + "relatedlinks_newWindow": "Open in new window", + "relatedlinks_removeLink": "Remove link", + "rollback_currentVersion": "Current version", + "rollback_diffHelp": "This shows the differences between the current version and the selected version
    Red text will not be shown in the selected version. , green means added", + "rollback_documentRolledBack": "Document has been rolled back", + "rollback_htmlHelp": "This displays the selected version as html, if you wish to see the difference between 2 versions at the same time, use the diff view", + "rollback_rollbackTo": "Rollback to", + "rollback_selectVersion": "Select version", + "rollback_view": "View", + "scripts_editscript": "Edit script file", + "sections_concierge": "Concierge", + "sections_content": "Content", + "sections_courier": "Courier", + "sections_developer": "Developer", + "sections_installer": "Umbraco Configuration Wizard", + "sections_media": "Media", + "sections_member": "Members", + "sections_newsletters": "Newsletters", + "sections_settings": "Settings", + "sections_statistics": "Statistics", + "sections_translation": "Translation", + "sections_users": "Users", + "sections_contour": "Umbraco Contour", + "sections_help": "Help", + "settings_defaulttemplate": "Default template", + "settings_dictionary editor egenskab": "Dictionary Key", + "settings_importDocumentTypeHelp": "To import a document type, find the '.udt' file on your computer by clicking the 'Browse' button and click 'Import' (you'll be asked for confirmation on the next screen)", + "settings_newtabname": "New Tab Title", + "settings_nodetype": "Nodetype", + "settings_objecttype": "Type", + "settings_stylesheet": "Stylesheet", + "settings_stylesheet editor egenskab": "Stylesheet property", + "settings_tab": "Tab", + "settings_tabname": "Tab Title", + "settings_tabs": "Tabs", + "settings_contentTypeEnabled": "Master Content Type enabled", + "settings_contentTypeUses": "This Content Type uses", + "settings_asAContentMasterType": "as a Master Content Type. Tabs from Master Content Types are not shown and can only be edited on the Master Content Type itself", + "settings_noPropertiesDefinedOnTab": "No properties defined on this tab. Click on the 'add a new property' link at the top to create a new property.", + "sort_sortDone": "Sorting complete.", + "sort_sortHelp": "Drag the different items up or down below to set how they should be arranged. Or click the column headers to sort the entire collection of items", + "sort_sortPleaseWait": " Please wait. Items are being sorted, this can take a while.

    Do not close this window during sorting", + "speechBubbles_contentPublishedFailedByEvent": "Publishing was cancelled by a 3rd party add-in", + "speechBubbles_contentTypeDublicatePropertyType": "Property type already exists", + "speechBubbles_contentTypePropertyTypeCreated": "Property type created", + "speechBubbles_contentTypePropertyTypeCreatedText": "Name: %0%
    DataType: %1%", + "speechBubbles_contentTypePropertyTypeDeleted": "Propertytype deleted", + "speechBubbles_contentTypeSavedHeader": "Document Type saved", + "speechBubbles_contentTypeTabCreated": "Tab created", + "speechBubbles_contentTypeTabDeleted": "Tab deleted", + "speechBubbles_contentTypeTabDeletedText": "Tab with id: %0% deleted", + "speechBubbles_cssErrorHeader": "Stylesheet not saved", + "speechBubbles_cssSavedHeader": "Stylesheet saved", + "speechBubbles_cssSavedText": "Stylesheet saved without any errors", + "speechBubbles_dataTypeSaved": "Datatype saved", + "speechBubbles_dictionaryItemSaved": "Dictionary item saved", + "speechBubbles_editContentPublishedFailedByParent": "Publishing failed because the parent page isn't published", + "speechBubbles_editContentPublishedHeader": "Content published", + "speechBubbles_editContentPublishedText": "and visible at the website", + "speechBubbles_editContentSavedHeader": "Content saved", + "speechBubbles_editContentSavedText": "Remember to publish to make changes visible", + "speechBubbles_editContentSendToPublish": "Sent For Approval", + "speechBubbles_editContentSendToPublishText": "Changes have been sent for approval", + "speechBubbles_editMediaSaved": "Media saved", + "speechBubbles_editMediaSavedText": "Media saved without any errors", + "speechBubbles_editMemberSaved": "Member saved", + "speechBubbles_editStylesheetPropertySaved": "Stylesheet Property Saved", + "speechBubbles_editStylesheetSaved": "Stylesheet saved", + "speechBubbles_editTemplateSaved": "Template saved", + "speechBubbles_editUserError": "Error saving user (check log)", + "speechBubbles_editUserSaved": "User Saved", + "speechBubbles_editUserTypeSaved": "User type saved", + "speechBubbles_fileErrorHeader": "File not saved", + "speechBubbles_fileErrorText": "file could not be saved. Please check file permissions", + "speechBubbles_fileSavedHeader": "File saved", + "speechBubbles_fileSavedText": "File saved without any errors", + "speechBubbles_languageSaved": "Language saved", + "speechBubbles_pythonErrorHeader": "Python script not saved", + "speechBubbles_pythonErrorText": "Python script could not be saved due to error", + "speechBubbles_pythonSavedHeader": "Python script saved", + "speechBubbles_pythonSavedText": "No errors in python script", + "speechBubbles_templateErrorHeader": "Template not saved", + "speechBubbles_templateErrorText": "Please make sure that you do not have 2 templates with the same alias", + "speechBubbles_templateSavedHeader": "Template saved", + "speechBubbles_templateSavedText": "Template saved without any errors!", + "speechBubbles_xsltErrorHeader": "XSLT not saved", + "speechBubbles_xsltErrorText": "XSLT contained an error", + "speechBubbles_xsltPermissionErrorText": "XSLT could not be saved, check file permissions", + "speechBubbles_xsltSavedHeader": "XSLT saved", + "speechBubbles_xsltSavedText": "No errors in XSLT", + "speechBubbles_contentUnpublished": "Content unpublished", + "speechBubbles_partialViewSavedHeader": "Partial view saved", + "speechBubbles_partialViewSavedText": "Partial view saved without any errors!", + "speechBubbles_partialViewErrorHeader": "Partial view not saved", + "speechBubbles_partialViewErrorText": "An error occurred saving the file.", + "stylesheet_aliasHelp": "Uses CSS syntax ex: h1, .redHeader, .blueTex", + "stylesheet_editstylesheet": "Edit stylesheet", + "stylesheet_editstylesheetproperty": "Edit stylesheet property", + "stylesheet_nameHelp": "Name to identify the style property in the rich text editor ", + "stylesheet_preview": "Preview", + "stylesheet_styles": "Styles", + "template_edittemplate": "Edit template", + "template_insertContentArea": "Insert content area", + "template_insertContentAreaPlaceHolder": "Insert content area placeholder", + "template_insertDictionaryItem": "Insert dictionary item", + "template_insertMacro": "Insert Macro", + "template_insertPageField": "Insert umbraco page field", + "template_mastertemplate": "Master template", + "template_quickGuide": "Quick Guide to umbraco template tags", + "template_template": "Template", + "templateEditor_alternativeField": "Alternative field", + "templateEditor_alternativeText": "Alternative Text", + "templateEditor_casing": "Casing", + "templateEditor_encoding": "Encoding", + "templateEditor_chooseField": "Choose field", + "templateEditor_convertLineBreaks": "Convert Linebreaks", + "templateEditor_convertLineBreaksHelp": "Replaces linebreaks with html-tag <br>", + "templateEditor_customFields": "Custom Fields", + "templateEditor_dateOnly": "Yes, Date only", + "templateEditor_formatAsDate": "Format as date", + "templateEditor_htmlEncode": "HTML encode", + "templateEditor_htmlEncodeHelp": "Will replace special characters by their HTML equivalent.", + "templateEditor_insertedAfter": "Will be inserted after the field value", + "templateEditor_insertedBefore": "Will be inserted before the field value", + "templateEditor_lowercase": "Lowercase", + "templateEditor_none": "None", + "templateEditor_postContent": "Insert after field", + "templateEditor_preContent": "Insert before field", + "templateEditor_recursive": "Recursive", + "templateEditor_removeParagraph": "Remove Paragraph tags", + "templateEditor_removeParagraphHelp": "Will remove any <P> in the beginning and end of the text", + "templateEditor_standardFields": "Standard Fields", + "templateEditor_uppercase": "Uppercase", + "templateEditor_urlEncode": "URL encode", + "templateEditor_urlEncodeHelp": "Will format special characters in URLs", + "templateEditor_usedIfAllEmpty": "Will only be used when the field values above are empty", + "templateEditor_usedIfEmpty": "This field will only be used if the primary field is empty", + "templateEditor_withTime": "Yes, with time. Seperator: ", + "translation_assignedTasks": "Tasks assigned to you", + "translation_assignedTasksHelp": " The list below shows translation tasks assigned to you. To see a detailed view including comments, click on 'Details' or just the page name. You can also download the page as XML directly by clicking the 'Download Xml' link.
    To close a translation task, please go to the Details view and click the 'Close' button. ", + "translation_closeTask": "close task", + "translation_details": "Translation details", + "translation_downloadAllAsXml": "Download all translation tasks as xml", + "translation_downloadTaskAsXml": "Download xml", + "translation_DownloadXmlDTD": "Download xml DTD", + "translation_fields": "Fields", + "translation_includeSubpages": "Include subpages", + "translation_mailBody": " Hi %0% This is an automated mail to inform you that the document '%1%' has been requested for translation into '%5%' by %2%. Go to http://%3%/translation/details.aspx?id=%4% to edit. Or log into umbraco to get an overview of your translation tasks http://%3% Have a nice day! Cheers from the umbraco robot ", + "translation_mailSubject": "[%0%] Translation task for %1%", + "translation_noTranslators": "No translator users found. Please create a translator user before you start sending content to translation", + "translation_ownedTasks": "Tasks created by you", + "translation_ownedTasksHelp": " The list below shows pages created by you. To see a detailed view including comments, click on 'Details' or just the page name. You can also download the page as XML directly by clicking the 'Download Xml' link. To close a translation task, please go to the Details view and click the 'Close' button. ", + "translation_pageHasBeenSendToTranslation": "The page '%0%' has been send to translation", + "translation_sendToTranslate": "Send the page '%0%' to translation", + "translation_taskAssignedBy": "Assigned by", + "translation_taskOpened": "Task opened", + "translation_totalWords": "Total words", + "translation_translateTo": "Translate to", + "translation_translationDone": "Translation completed.", + "translation_translationDoneHelp": "You can preview the pages, you've just translated, by clicking below. If the original page is found, you will get a comparison of the 2 pages.", + "translation_translationFailed": "Translation failed, the xml file might be corrupt", + "translation_translationOptions": "Translation options", + "translation_translator": "Translator", + "translation_uploadTranslationXml": "Upload translation xml", + "treeHeaders_cacheBrowser": "Cache Browser", + "treeHeaders_contentRecycleBin": "Recycle Bin", + "treeHeaders_createdPackages": "Created packages", + "treeHeaders_datatype": "Data Types", + "treeHeaders_dictionary": "Dictionary", + "treeHeaders_installedPackages": "Installed packages", + "treeHeaders_installSkin": "Install skin", + "treeHeaders_installStarterKit": "Install starter kit", + "treeHeaders_languages": "Languages", + "treeHeaders_localPackage": "Install local package", + "treeHeaders_macros": "Macros", + "treeHeaders_mediaTypes": "Media Types", + "treeHeaders_member": "Members", + "treeHeaders_memberGroup": "Member Groups", + "treeHeaders_memberRoles": "Roles", + "treeHeaders_memberType": "Member Types", + "treeHeaders_nodeTypes": "Document Types", + "treeHeaders_packager": "Packages", + "treeHeaders_packages": "Packages", + "treeHeaders_python": "Python Files", + "treeHeaders_repositories": "Install from repository", + "treeHeaders_runway": "Install Runway", + "treeHeaders_runwayModules": "Runway modules", + "treeHeaders_scripting": "Scripting Files", + "treeHeaders_scripts": "Scripts", + "treeHeaders_stylesheets": "Stylesheets", + "treeHeaders_templates": "Templates", + "treeHeaders_xslt": "XSLT Files", + "update_updateAvailable": "New update ready", + "update_updateDownloadText": "%0% is ready, click here for download", + "update_updateNoServer": "No connection to server", + "update_updateNoServerError": "Error checking for update. Please review trace-stack for further information", + "user_administrators": "Administrator", + "user_categoryField": "Category field", + "user_changePassword": "Change Your Password", + "user_newPassword": "Change Your Password", + "user_confirmNewPassword": "Confirm new password", + "user_changePasswordDescription": "You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button", + "user_contentChannel": "Content Channel", + "user_descriptionField": "Description field", + "user_disabled": "Disable User", + "user_documentType": "Document Type", + "user_editors": "Editor", + "user_excerptField": "Excerpt field", + "user_language": "Language", + "user_loginname": "Login", + "user_mediastartnode": "Start Node in Media Library", + "user_modules": "Sections", + "user_noConsole": "Disable Umbraco Access", + "user_password": "Password", + "user_resetPassword": "Reset password", + "user_passwordChanged": "Your password has been changed!", + "user_passwordConfirm": "Please confirm the new password", + "user_passwordEnterNew": "Enter your new password", + "user_passwordIsBlank": "Your new password cannot be blank!", + "user_passwordCurrent": "Current password", + "user_passwordInvalid": "Invalid current password", + "user_passwordIsDifferent": "There was a difference between the new password and the confirmed password. Please try again!", + "user_passwordMismatch": "The confirmed password doesn't match the new password!", + "user_permissionReplaceChildren": "Replace child node permssions", + "user_permissionSelectedPages": "You are currently modifying permissions for the pages:", + "user_permissionSelectPages": "Select pages to modify their permissions", + "user_searchAllChildren": "Search all children", + "user_startnode": "Start Node in Content", + "user_username": "Username", + "user_userPermissions": "User permissions", + "user_usertype": "User type", + "user_userTypes": "User types", + "user_writer": "Writer", + "user_yourProfile": "Your profile", + "user_yourHistory": "Your recent history", + "user_sessionExpires": "Session expires in" + }, null]; + } + } + + return { + register: function() { + $httpBackend + .whenGET(mocksUtils.urlRegex('js/language.aspx')) + .respond(getLanguageResource); + } + }; + }]); +/** +* @ngdoc service +* @name umbraco.mocks.mediaHelperService +* @description A helper object used for dealing with media items +**/ +function mediaHelper(umbRequestHelper) { + return { + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getImagePropertyValue + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the file path associated with the media property if there is one + * + * @param {object} options Options object + * @param {object} options.mediaModel The media object to retrieve the image path from + * @param {object} options.imageOnly Optional, if true then will only return a path if the media item is an image + */ + getMediaPropertyValue: function (options) { + return "assets/img/mocks/big-image.jpg"; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getImagePropertyValue + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the actual image path associated with the image property if there is one + * + * @param {object} options Options object + * @param {object} options.imageModel The media object to retrieve the image path from + */ + getImagePropertyValue: function (options) { + return "assets/img/mocks/big-image.jpg"; + }, + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getThumbnail + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * formats the display model used to display the content to the model used to save the content + * + * @param {object} options Options object + * @param {object} options.imageModel The media object to retrieve the image path from + */ + getThumbnail: function (options) { + + if (!options || !options.imageModel) { + throw "The options objet does not contain the required parameters: imageModel"; + } + + var imagePropVal = this.getImagePropertyValue(options); + if (imagePropVal !== "") { + return this.getThumbnailFromPath(imagePropVal); + } + return ""; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#scaleToMaxSize + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Finds the corrct max width and max height, given maximum dimensions and keeping aspect ratios + * + * @param {number} maxSize Maximum width & height + * @param {number} width Current width + * @param {number} height Current height + */ + scaleToMaxSize: function (maxSize, width, height) { + var retval = { width: width, height: height }; + + var maxWidth = maxSize; // Max width for the image + var maxHeight = maxSize; // Max height for the image + var ratio = 0; // Used for aspect ratio + + // Check if the current width is larger than the max + if (width > maxWidth) { + ratio = maxWidth / width; // get ratio for scaling image + + retval.width = maxWidth; + retval.height = height * ratio; + + height = height * ratio; // Reset height to match scaled image + width = width * ratio; // Reset width to match scaled image + } + + // Check if current height is larger than max + if (height > maxHeight) { + ratio = maxHeight / height; // get ratio for scaling image + + retval.height = maxHeight; + retval.width = width * ratio; + width = width * ratio; // Reset width to match scaled image + } + + return retval; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#getThumbnailFromPath + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns the path to the thumbnail version of a given media library image path + * + * @param {string} imagePath Image path, ex: /media/1234/my-image.jpg + */ + getThumbnailFromPath: function (imagePath) { + return "assets/img/mocks/big-thumb.jpg"; + }, + + /** + * @ngdoc function + * @name umbraco.services.mediaHelper#detectIfImageByExtension + * @methodOf umbraco.services.mediaHelper + * @function + * + * @description + * Returns true/false, indicating if the given path has an allowed image extension + * + * @param {string} imagePath Image path, ex: /media/1234/my-image.jpg + */ + detectIfImageByExtension: function (imagePath) { + var lowered = imagePath.toLowerCase(); + var ext = lowered.substr(lowered.lastIndexOf(".") + 1); + return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1; + } + }; +} +angular.module('umbraco.mocks').factory('mediaHelper', mediaHelper); +angular.module('umbraco.mocks'). + factory('utilMocks', ['$httpBackend', 'mocksUtils', function ($httpBackend, mocksUtils) { + 'use strict'; + + function getUpdateCheck(status, data, headers) { + //check for existence of a cookie so we can do login/logout in the belle app (ignore for tests). + if (!mocksUtils.checkAuth()) { + return [401, null, null]; + } + else { + return [200, null, null]; + } + } + + return { + register: function() { + $httpBackend + .whenGET(mocksUtils.urlRegex('/umbraco/Api/UpdateCheck/GetCheck')) + .respond(getUpdateCheck); + } + }; + }]); + +})(); \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/js/umbracoUpgradeChecker.js b/OurUmbraco.Site/umbraco/js/umbracoUpgradeChecker.js index 8d962b45..687cdd20 100644 --- a/OurUmbraco.Site/umbraco/js/umbracoUpgradeChecker.js +++ b/OurUmbraco.Site/umbraco/js/umbracoUpgradeChecker.js @@ -1,14 +1,15 @@ function umbracoCheckUpgrade(result) { - if (result.UpgradeType.toLowerCase() != 'none') { - if (UmbSpeechBubble == null) { - InitUmbracoSpeechBubble(); + if (result) { + if (result.UpgradeType.toLowerCase() != 'none') { + if (UmbSpeechBubble == null) { + InitUmbracoSpeechBubble(); + } + var icon = 'info'; + if (result.UpgradeType.toLowerCase() == 'critical') { + icon = 'error'; + } + + UmbSpeechBubble.ShowMessage(icon, 'Upgrade Available!', '' + result.UpgradeComment + '', true); } - var icon = 'info'; - if (result.UpgradeType.toLowerCase() == 'critical') { - icon = 'error'; - } - - UmbSpeechBubble.ShowMessage(icon, 'Upgrade Available!', '' + result.UpgradeComment + '', true); } - } \ No newline at end of file diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.js new file mode 100644 index 00000000..78686e23 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.js @@ -0,0 +1,185 @@ +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) { +'use strict'; + +/** + * @ngdoc overview + * @name ngCookies + */ + + +angular.module('ngCookies', ['ng']). + /** + * @ngdoc object + * @name ngCookies.$cookies + * @requires $browser + * + * @description + * Provides read/write access to browser's cookies. + * + * Only a simple Object is exposed and by adding or removing properties to/from + * this object, new cookies are created/deleted at the end of current $eval. + * + * @example + + + + + + */ + factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) { + var cookies = {}, + lastCookies = {}, + lastBrowserCookies, + runEval = false, + copy = angular.copy, + isUndefined = angular.isUndefined; + + //creates a poller fn that copies all cookies from the $browser to service & inits the service + $browser.addPollFn(function() { + var currentCookies = $browser.cookies(); + if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl + lastBrowserCookies = currentCookies; + copy(currentCookies, lastCookies); + copy(currentCookies, cookies); + if (runEval) $rootScope.$apply(); + } + })(); + + runEval = true; + + //at the end of each eval, push cookies + //TODO: this should happen before the "delayed" watches fire, because if some cookies are not + // strings or browser refuses to store some cookies, we update the model in the push fn. + $rootScope.$watch(push); + + return cookies; + + + /** + * Pushes all the cookies from the service to the browser and verifies if all cookies were stored. + */ + function push() { + var name, + value, + browserCookies, + updated; + + //delete any cookies deleted in $cookies + for (name in lastCookies) { + if (isUndefined(cookies[name])) { + $browser.cookies(name, undefined); + } + } + + //update all cookies updated in $cookies + for(name in cookies) { + value = cookies[name]; + if (!angular.isString(value)) { + if (angular.isDefined(lastCookies[name])) { + cookies[name] = lastCookies[name]; + } else { + delete cookies[name]; + } + } else if (value !== lastCookies[name]) { + $browser.cookies(name, value); + updated = true; + } + } + + //verify what was actually stored + if (updated){ + updated = false; + browserCookies = $browser.cookies(); + + for (name in cookies) { + if (cookies[name] !== browserCookies[name]) { + //delete or reset all cookies that the browser dropped from $cookies + if (isUndefined(browserCookies[name])) { + delete cookies[name]; + } else { + cookies[name] = browserCookies[name]; + } + updated = true; + } + } + } + } + }]). + + + /** + * @ngdoc object + * @name ngCookies.$cookieStore + * @requires $cookies + * + * @description + * Provides a key-value (string-object) storage, that is backed by session cookies. + * Objects put or retrieved from this storage are automatically serialized or + * deserialized by angular's toJson/fromJson. + * @example + */ + factory('$cookieStore', ['$cookies', function($cookies) { + + return { + /** + * @ngdoc method + * @name ngCookies.$cookieStore#get + * @methodOf ngCookies.$cookieStore + * + * @description + * Returns the value of given cookie key + * + * @param {string} key Id to use for lookup. + * @returns {Object} Deserialized cookie value. + */ + get: function(key) { + var value = $cookies[key]; + return value ? angular.fromJson(value) : value; + }, + + /** + * @ngdoc method + * @name ngCookies.$cookieStore#put + * @methodOf ngCookies.$cookieStore + * + * @description + * Sets a value for given cookie key + * + * @param {string} key Id for the `value`. + * @param {Object} value Value to be stored. + */ + put: function(key, value) { + $cookies[key] = angular.toJson(value); + }, + + /** + * @ngdoc method + * @name ngCookies.$cookieStore#remove + * @methodOf ngCookies.$cookieStore + * + * @description + * Remove given cookie + * + * @param {string} key Id of the key-value pair to delete. + */ + remove: function(key) { + delete $cookies[key]; + } + }; + + }]); + + +})(window, window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.min.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.min.js new file mode 100644 index 00000000..9d908260 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-cookies.min.js @@ -0,0 +1,7 @@ +/* + AngularJS v1.1.5 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(m,f,l){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,i=!1,j=f.copy,k=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,j(a,g),j(a,c),i&&d.$apply())})();i=!0;d.$watch(function(){var a,e,d;for(a in g)k(c[a])&&b.cookies(a,l);for(a in c)e=c[a],f.isString(e)?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(k(e[a])?delete c[a]:c[a]=e[a])});return c}]).factory("$cookieStore", +["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.js new file mode 100644 index 00000000..4d7184f0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.js @@ -0,0 +1,304 @@ +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ + +( + +/** + * @ngdoc interface + * @name angular.Module + * @description + * + * Interface for configuring angular {@link angular.module modules}. + */ + +function setupModuleLoader(window) { + + function ensure(obj, name, factory) { + return obj[name] || (obj[name] = factory()); + } + + return ensure(ensure(window, 'angular', Object), 'module', function() { + /** @type {Object.} */ + var modules = {}; + + /** + * @ngdoc function + * @name angular.module + * @description + * + * The `angular.module` is a global place for creating and registering Angular modules. All + * modules (angular core or 3rd party) that should be available to an application must be + * registered using this mechanism. + * + * + * # Module + * + * A module is a collocation of services, directives, filters, and configuration information. Module + * is used to configure the {@link AUTO.$injector $injector}. + * + *
    +     * // Create a new module
    +     * var myModule = angular.module('myModule', []);
    +     *
    +     * // register a new service
    +     * myModule.value('appName', 'MyCoolApp');
    +     *
    +     * // configure existing services inside initialization blocks.
    +     * myModule.config(function($locationProvider) {
    +'use strict';
    +     *   // Configure existing providers
    +     *   $locationProvider.hashPrefix('!');
    +     * });
    +     * 
    + * + * Then you can create an injector and load your modules like this: + * + *
    +     * var injector = angular.injector(['ng', 'MyModule'])
    +     * 
    + * + * However it's more likely that you'll just use + * {@link ng.directive:ngApp ngApp} or + * {@link angular.bootstrap} to simplify this process for you. + * + * @param {!string} name The name of the module to create or retrieve. + * @param {Array.=} requires If specified then new module is being created. If unspecified then the + * the module is being retrieved for further configuration. + * @param {Function} configFn Optional configuration function for the module. Same as + * {@link angular.Module#config Module#config()}. + * @returns {module} new module with the {@link angular.Module} api. + */ + return function module(name, requires, configFn) { + if (requires && modules.hasOwnProperty(name)) { + modules[name] = null; + } + return ensure(modules, name, function() { + if (!requires) { + throw Error('No module: ' + name); + } + + /** @type {!Array.>} */ + var invokeQueue = []; + + /** @type {!Array.} */ + var runBlocks = []; + + var config = invokeLater('$injector', 'invoke'); + + /** @type {angular.Module} */ + var moduleInstance = { + // Private state + _invokeQueue: invokeQueue, + _runBlocks: runBlocks, + + /** + * @ngdoc property + * @name angular.Module#requires + * @propertyOf angular.Module + * @returns {Array.} List of module names which must be loaded before this module. + * @description + * Holds the list of modules which the injector will load before the current module is loaded. + */ + requires: requires, + + /** + * @ngdoc property + * @name angular.Module#name + * @propertyOf angular.Module + * @returns {string} Name of the module. + * @description + */ + name: name, + + + /** + * @ngdoc method + * @name angular.Module#provider + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} providerType Construction function for creating new instance of the service. + * @description + * See {@link AUTO.$provide#provider $provide.provider()}. + */ + provider: invokeLater('$provide', 'provider'), + + /** + * @ngdoc method + * @name angular.Module#factory + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} providerFunction Function for creating new instance of the service. + * @description + * See {@link AUTO.$provide#factory $provide.factory()}. + */ + factory: invokeLater('$provide', 'factory'), + + /** + * @ngdoc method + * @name angular.Module#service + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} constructor A constructor function that will be instantiated. + * @description + * See {@link AUTO.$provide#service $provide.service()}. + */ + service: invokeLater('$provide', 'service'), + + /** + * @ngdoc method + * @name angular.Module#value + * @methodOf angular.Module + * @param {string} name service name + * @param {*} object Service instance object. + * @description + * See {@link AUTO.$provide#value $provide.value()}. + */ + value: invokeLater('$provide', 'value'), + + /** + * @ngdoc method + * @name angular.Module#constant + * @methodOf angular.Module + * @param {string} name constant name + * @param {*} object Constant value. + * @description + * Because the constant are fixed, they get applied before other provide methods. + * See {@link AUTO.$provide#constant $provide.constant()}. + */ + constant: invokeLater('$provide', 'constant', 'unshift'), + + /** + * @ngdoc method + * @name angular.Module#animation + * @methodOf angular.Module + * @param {string} name animation name + * @param {Function} animationFactory Factory function for creating new instance of an animation. + * @description + * + * Defines an animation hook that can be later used with {@link ng.directive:ngAnimate ngAnimate} + * alongside {@link ng.directive:ngAnimate#Description common ng directives} as well as custom directives. + *
    +           * module.animation('animation-name', function($inject1, $inject2) {
    +           *   return {
    +           *     //this gets called in preparation to setup an animation
    +           *     setup : function(element) { ... },
    +           *
    +           *     //this gets called once the animation is run
    +           *     start : function(element, done, memo) { ... }
    +           *   }
    +           * })
    +           * 
    + * + * See {@link ng.$animationProvider#register $animationProvider.register()} and + * {@link ng.directive:ngAnimate ngAnimate} for more information. + */ + animation: invokeLater('$animationProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#filter + * @methodOf angular.Module + * @param {string} name Filter name. + * @param {Function} filterFactory Factory function for creating new instance of filter. + * @description + * See {@link ng.$filterProvider#register $filterProvider.register()}. + */ + filter: invokeLater('$filterProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#controller + * @methodOf angular.Module + * @param {string} name Controller name. + * @param {Function} constructor Controller constructor function. + * @description + * See {@link ng.$controllerProvider#register $controllerProvider.register()}. + */ + controller: invokeLater('$controllerProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#directive + * @methodOf angular.Module + * @param {string} name directive name + * @param {Function} directiveFactory Factory function for creating new instance of + * directives. + * @description + * See {@link ng.$compileProvider#directive $compileProvider.directive()}. + */ + directive: invokeLater('$compileProvider', 'directive'), + + /** + * @ngdoc method + * @name angular.Module#config + * @methodOf angular.Module + * @param {Function} configFn Execute this function on module load. Useful for service + * configuration. + * @description + * Use this method to register work which needs to be performed on module loading. + */ + config: config, + + /** + * @ngdoc method + * @name angular.Module#run + * @methodOf angular.Module + * @param {Function} initializationFn Execute this function after injector creation. + * Useful for application initialization. + * @description + * Use this method to register work which should be performed when the injector is done + * loading all modules. + */ + run: function(block) { + runBlocks.push(block); + return this; + } + }; + + if (configFn) { + config(configFn); + } + + return moduleInstance; + + /** + * @param {string} provider + * @param {string} method + * @param {String=} insertMethod + * @returns {angular.Module} + */ + function invokeLater(provider, method, insertMethod) { + return function() { + invokeQueue[insertMethod || 'push']([provider, method, arguments]); + return moduleInstance; + } + } + }); + }; + }); + +} + +)(window); + +/** + * Closure compiler type information + * + * @typedef { { + * requires: !Array., + * invokeQueue: !Array.>, + * + * service: function(string, Function):angular.Module, + * factory: function(string, Function):angular.Module, + * value: function(string, *):angular.Module, + * + * filter: function(string, Function):angular.Module, + * + * init: function(Function):angular.Module + * } } + */ +angular.Module; + diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.min.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.min.js new file mode 100644 index 00000000..0c262d49 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-loader.min.js @@ -0,0 +1,7 @@ +/* + AngularJS v1.1.5 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(i){'use strict';function d(c,b,e){return c[b]||(c[b]=e())}return d(d(i,"angular",Object),"module",function(){var c={};return function(b,e,f){e&&c.hasOwnProperty(b)&&(c[b]=null);return d(c,b,function(){function a(a,b,d){return function(){c[d||"push"]([a,b,arguments]);return g}}if(!e)throw Error("No module: "+b);var c=[],d=[],h=a("$injector","invoke"),g={_invokeQueue:c,_runBlocks:d,requires:e,name:b,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"), +value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animationProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:h,run:function(a){d.push(a);return this}};f&&h(f);return g})}})})(window); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.js new file mode 100644 index 00000000..8cfb20cb --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.js @@ -0,0 +1,462 @@ +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) { +'use strict'; + +/** + * @ngdoc overview + * @name ngMobile + * @description + * Touch events and other mobile helpers. + * Based on jQuery Mobile touch event handling (jquerymobile.com) + */ + +// define ngMobile module +var ngMobile = angular.module('ngMobile', []); + +/** + * @ngdoc directive + * @name ngMobile.directive:ngClick + * + * @description + * A more powerful replacement for the default ngClick designed to be used on touchscreen + * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending + * the click event. This version handles them immediately, and then prevents the + * following click event from propagating. + * + * This directive can fall back to using an ordinary click event, and so works on desktop + * browsers as well as mobile. + * + * This directive also sets the CSS class `ng-click-active` while the element is being held + * down (by a mouse click or touch) so you can restyle the depressed element if you wish. + * + * @element ANY + * @param {expression} ngClick {@link guide/expression Expression} to evaluate + * upon tap. (Event object is available as `$event`) + * + * @example + + + + count: {{ count }} + + + */ + +ngMobile.config(['$provide', function($provide) { + $provide.decorator('ngClickDirective', ['$delegate', function($delegate) { + // drop the default ngClick directive + $delegate.shift(); + return $delegate; + }]); +}]); + +ngMobile.directive('ngClick', ['$parse', '$timeout', '$rootElement', + function($parse, $timeout, $rootElement) { + var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag. + var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers. + var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click + var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks. + + var ACTIVE_CLASS_NAME = 'ng-click-active'; + var lastPreventedTime; + var touchCoordinates; + + + // TAP EVENTS AND GHOST CLICKS + // + // Why tap events? + // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're + // double-tapping, and then fire a click event. + // + // This delay sucks and makes mobile apps feel unresponsive. + // So we detect touchstart, touchmove, touchcancel and touchend ourselves and determine when + // the user has tapped on something. + // + // What happens when the browser then generates a click event? + // The browser, of course, also detects the tap and fires a click after a delay. This results in + // tapping/clicking twice. So we do "clickbusting" to prevent it. + // + // How does it work? + // We attach global touchstart and click handlers, that run during the capture (early) phase. + // So the sequence for a tap is: + // - global touchstart: Sets an "allowable region" at the point touched. + // - element's touchstart: Starts a touch + // (- touchmove or touchcancel ends the touch, no click follows) + // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold + // too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). + // - preventGhostClick() removes the allowable region the global touchstart created. + // - The browser generates a click event. + // - The global click handler catches the click, and checks whether it was in an allowable region. + // - If preventGhostClick was called, the region will have been removed, the click is busted. + // - If the region is still there, the click proceeds normally. Therefore clicks on links and + // other elements without ngTap on them work normally. + // + // This is an ugly, terrible hack! + // Yeah, tell me about it. The alternatives are using the slow click events, or making our users + // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular + // encapsulates this ugly logic away from the user. + // + // Why not just put click handlers on the element? + // We do that too, just to be sure. The problem is that the tap event might have caused the DOM + // to change, so that the click fires in the same position but something else is there now. So + // the handlers are global and care only about coordinates and not elements. + + // Checks if the coordinates are close enough to be within the region. + function hit(x1, y1, x2, y2) { + return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD; + } + + // Checks a list of allowable regions against a click location. + // Returns true if the click should be allowed. + // Splices out the allowable region from the list after it has been used. + function checkAllowableRegions(touchCoordinates, x, y) { + for (var i = 0; i < touchCoordinates.length; i += 2) { + if (hit(touchCoordinates[i], touchCoordinates[i+1], x, y)) { + touchCoordinates.splice(i, i + 2); + return true; // allowable region + } + } + return false; // No allowable region; bust it. + } + + // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick + // was called recently. + function onClick(event) { + if (Date.now() - lastPreventedTime > PREVENT_DURATION) { + return; // Too old. + } + + var touches = event.touches && event.touches.length ? event.touches : [event]; + var x = touches[0].clientX; + var y = touches[0].clientY; + // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label + // and on the input element). Depending on the exact browser, this second click we don't want + // to bust has either (0,0) or negative coordinates. + if (x < 1 && y < 1) { + return; // offscreen + } + + // Look for an allowable region containing this click. + // If we find one, that means it was created by touchstart and not removed by + // preventGhostClick, so we don't bust it. + if (checkAllowableRegions(touchCoordinates, x, y)) { + return; + } + + // If we didn't find an allowable region, bust the click. + event.stopPropagation(); + event.preventDefault(); + } + + + // Global touchstart handler that creates an allowable region for a click event. + // This allowable region can be removed by preventGhostClick if we want to bust it. + function onTouchStart(event) { + var touches = event.touches && event.touches.length ? event.touches : [event]; + var x = touches[0].clientX; + var y = touches[0].clientY; + touchCoordinates.push(x, y); + + $timeout(function() { + // Remove the allowable region. + for (var i = 0; i < touchCoordinates.length; i += 2) { + if (touchCoordinates[i] == x && touchCoordinates[i+1] == y) { + touchCoordinates.splice(i, i + 2); + return; + } + } + }, PREVENT_DURATION, false); + } + + // On the first call, attaches some event handlers. Then whenever it gets called, it creates a + // zone around the touchstart where clicks will get busted. + function preventGhostClick(x, y) { + if (!touchCoordinates) { + $rootElement[0].addEventListener('click', onClick, true); + $rootElement[0].addEventListener('touchstart', onTouchStart, true); + touchCoordinates = []; + } + + lastPreventedTime = Date.now(); + + checkAllowableRegions(touchCoordinates, x, y); + } + + // Actual linking function. + return function(scope, element, attr) { + var clickHandler = $parse(attr.ngClick), + tapping = false, + tapElement, // Used to blur the element after a tap. + startTime, // Used to check if the tap was held too long. + touchStartX, + touchStartY; + + function resetState() { + tapping = false; + element.removeClass(ACTIVE_CLASS_NAME); + } + + element.bind('touchstart', function(event) { + tapping = true; + tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement. + // Hack for Safari, which can target text nodes instead of containers. + if(tapElement.nodeType == 3) { + tapElement = tapElement.parentNode; + } + + element.addClass(ACTIVE_CLASS_NAME); + + startTime = Date.now(); + + var touches = event.touches && event.touches.length ? event.touches : [event]; + var e = touches[0].originalEvent || touches[0]; + touchStartX = e.clientX; + touchStartY = e.clientY; + }); + + element.bind('touchmove', function(event) { + resetState(); + }); + + element.bind('touchcancel', function(event) { + resetState(); + }); + + element.bind('touchend', function(event) { + var diff = Date.now() - startTime; + + var touches = (event.changedTouches && event.changedTouches.length) ? event.changedTouches : + ((event.touches && event.touches.length) ? event.touches : [event]); + var e = touches[0].originalEvent || touches[0]; + var x = e.clientX; + var y = e.clientY; + var dist = Math.sqrt( Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2) ); + + if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) { + // Call preventGhostClick so the clickbuster will catch the corresponding click. + preventGhostClick(x, y); + + // Blur the focused element (the button, probably) before firing the callback. + // This doesn't work perfectly on Android Chrome, but seems to work elsewhere. + // I couldn't get anything to work reliably on Android Chrome. + if (tapElement) { + tapElement.blur(); + } + + scope.$apply(function() { + // TODO(braden): This is sending the touchend, not a tap or click. Is that kosher? + clickHandler(scope, {$event: event}); + }); + } + + resetState(); + }); + + // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click + // something else nearby. + element.onclick = function(event) { }; + + // Fallback click handler. + // Busted clicks don't get this far, and adding this handler allows ng-tap to be used on + // desktop as well, to allow more portable sites. + element.bind('click', function(event) { + scope.$apply(function() { + clickHandler(scope, {$event: event}); + }); + }); + +/* + element.bind('mousedown', function(event) { + element.addClass(ACTIVE_CLASS_NAME); + }); + + element.bind('mousemove mouseup', function(event) { + element.removeClass(ACTIVE_CLASS_NAME); + }); +*/ + + }; +}]); + +/** + * @ngdoc directive + * @name ngMobile.directive:ngSwipeLeft + * + * @description + * Specify custom behavior when an element is swiped to the left on a touchscreen device. + * A leftward swipe is a quick, right-to-left slide of the finger. + * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag too. + * + * @element ANY + * @param {expression} ngSwipeLeft {@link guide/expression Expression} to evaluate + * upon left swipe. (Event object is available as `$event`) + * + * @example + + +
    + Some list content, like an email in the inbox +
    +
    + + +
    +
    +
    + */ + +/** + * @ngdoc directive + * @name ngMobile.directive:ngSwipeRight + * + * @description + * Specify custom behavior when an element is swiped to the right on a touchscreen device. + * A rightward swipe is a quick, left-to-right slide of the finger. + * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag too. + * + * @element ANY + * @param {expression} ngSwipeRight {@link guide/expression Expression} to evaluate + * upon right swipe. (Event object is available as `$event`) + * + * @example + + +
    + Some list content, like an email in the inbox +
    +
    + + +
    +
    +
    + */ + +function makeSwipeDirective(directiveName, direction) { + ngMobile.directive(directiveName, ['$parse', function($parse) { + // The maximum vertical delta for a swipe should be less than 75px. + var MAX_VERTICAL_DISTANCE = 75; + // Vertical distance should not be more than a fraction of the horizontal distance. + var MAX_VERTICAL_RATIO = 0.3; + // At least a 30px lateral motion is necessary for a swipe. + var MIN_HORIZONTAL_DISTANCE = 30; + // The total distance in any direction before we make the call on swipe vs. scroll. + var MOVE_BUFFER_RADIUS = 10; + + function getCoordinates(event) { + var touches = event.touches && event.touches.length ? event.touches : [event]; + var e = (event.changedTouches && event.changedTouches[0]) || + (event.originalEvent && event.originalEvent.changedTouches && + event.originalEvent.changedTouches[0]) || + touches[0].originalEvent || touches[0]; + + return { + x: e.clientX, + y: e.clientY + }; + } + + return function(scope, element, attr) { + var swipeHandler = $parse(attr[directiveName]); + var startCoords, valid; + var totalX, totalY; + var lastX, lastY; + + function validSwipe(event) { + // Check that it's within the coordinates. + // Absolute vertical distance must be within tolerances. + // Horizontal distance, we take the current X - the starting X. + // This is negative for leftward swipes and positive for rightward swipes. + // After multiplying by the direction (-1 for left, +1 for right), legal swipes + // (ie. same direction as the directive wants) will have a positive delta and + // illegal ones a negative delta. + // Therefore this delta must be positive, and larger than the minimum. + if (!startCoords) return false; + var coords = getCoordinates(event); + var deltaY = Math.abs(coords.y - startCoords.y); + var deltaX = (coords.x - startCoords.x) * direction; + return valid && // Short circuit for already-invalidated swipes. + deltaY < MAX_VERTICAL_DISTANCE && + deltaX > 0 && + deltaX > MIN_HORIZONTAL_DISTANCE && + deltaY / deltaX < MAX_VERTICAL_RATIO; + } + + element.bind('touchstart mousedown', function(event) { + startCoords = getCoordinates(event); + valid = true; + totalX = 0; + totalY = 0; + lastX = startCoords.x; + lastY = startCoords.y; + }); + + element.bind('touchcancel', function(event) { + valid = false; + }); + + element.bind('touchmove mousemove', function(event) { + if (!valid) return; + + // Android will send a touchcancel if it thinks we're starting to scroll. + // So when the total distance (+ or - or both) exceeds 10px in either direction, + // we either: + // - On totalX > totalY, we send preventDefault() and treat this as a swipe. + // - On totalY > totalX, we let the browser handle it as a scroll. + + // Invalidate a touch while it's in progress if it strays too far away vertically. + // We don't want a scroll down and back up while drifting sideways to be a swipe just + // because you happened to end up vertically close in the end. + if (!startCoords) return; + var coords = getCoordinates(event); + + if (Math.abs(coords.y - startCoords.y) > MAX_VERTICAL_DISTANCE) { + valid = false; + return; + } + + totalX += Math.abs(coords.x - lastX); + totalY += Math.abs(coords.y - lastY); + + lastX = coords.x; + lastY = coords.y; + + if (totalX < MOVE_BUFFER_RADIUS && totalY < MOVE_BUFFER_RADIUS) { + return; + } + + // One of totalX or totalY has exceeded the buffer, so decide on swipe vs. scroll. + if (totalY > totalX) { + valid = false; + return; + } else { + event.preventDefault(); + } + }); + + element.bind('touchend mouseup', function(event) { + if (validSwipe(event)) { + // Prevent this swipe from bubbling up to any other elements with ngSwipes. + event.stopPropagation(); + scope.$apply(function() { + swipeHandler(scope, {$event:event}); + }); + } + }); + }; + }]); +} + +// Left is negative X-coordinate, right is positive. +makeSwipeDirective('ngSwipeLeft', -1); +makeSwipeDirective('ngSwipeRight', 1); + + + +})(window, window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.min.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.min.js new file mode 100644 index 00000000..bc777ea3 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-mobile.min.js @@ -0,0 +1,11 @@ +/* + AngularJS v1.1.5 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(u,s){'use strict';function k(i,t){j.directive(i,["$parse",function(l){function g(b){var h=b.touches&&b.touches.length?b.touches:[b],b=b.changedTouches&&b.changedTouches[0]||b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]||h[0].originalEvent||h[0];return{x:b.clientX,y:b.clientY}}var m=75,j=0.3,p=30;return function(b,h,n){function o(e){if(!a)return!1;var b=g(e),e=Math.abs(b.y-a.y),b=(b.x-a.x)*t;return c&&e0&&b>p&&e/bm?c=!1:(f+=Math.abs(d.x-q),e+=Math.abs(d.y-r),q=d.x,r=d.y,f<10&&e<10||(e>f?c=!1:b.preventDefault()))}});h.bind("touchend mouseup",function(a){o(a)&&(a.stopPropagation(),b.$apply(function(){d(b,{$event:a})}))})}}])}var j=s.module("ngMobile",[]);j.config(["$provide",function(i){i.decorator("ngClickDirective",["$delegate",function(i){i.shift(); +return i}])}]);j.directive("ngClick",["$parse","$timeout","$rootElement",function(i,j,l){function g(a,c,b){for(var e=0;eb)){var c=a.touches&&a.touches.length?a.touches:[a],f=c[0].clientX,c=c[0].clientY;!(f<1&&c<1)&&!g(d,f,c)&&(a.stopPropagation(),a.preventDefault())}}function k(a){var a=a.touches&&a.touches.length?a.touches:[a],c=a[0].clientX,f=a[0].clientY;d.push(c,f);j(function(){for(var a= +0;a + * describe('$exceptionHandlerProvider', function() { + * + * it('should capture log messages and exceptions', function() { + * + * module(function($exceptionHandlerProvider) { + * $exceptionHandlerProvider.mode('log'); + * }); + * + * inject(function($log, $exceptionHandler, $timeout) { + * $timeout(function() { $log.log(1); }); + * $timeout(function() { $log.log(2); throw 'banana peel'; }); + * $timeout(function() { $log.log(3); }); + * expect($exceptionHandler.errors).toEqual([]); + * expect($log.assertEmpty()); + * $timeout.flush(); + * expect($exceptionHandler.errors).toEqual(['banana peel']); + * expect($log.log.logs).toEqual([[1], [2], [3]]); + * }); + * }); + * }); + * + */ + +angular.mock.$ExceptionHandlerProvider = function() { + var handler; + + /** + * @ngdoc method + * @name ngMock.$exceptionHandlerProvider#mode + * @methodOf ngMock.$exceptionHandlerProvider + * + * @description + * Sets the logging mode. + * + * @param {string} mode Mode of operation, defaults to `rethrow`. + * + * - `rethrow`: If any errors are passed into the handler in tests, it typically + * means that there is a bug in the application or test, so this mock will + * make these tests fail. + * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` mode stores an + * array of errors in `$exceptionHandler.errors`, to allow later assertion of them. + * See {@link ngMock.$log#assertEmpty assertEmpty()} and + * {@link ngMock.$log#reset reset()} + */ + this.mode = function(mode) { + switch(mode) { + case 'rethrow': + handler = function(e) { + throw e; + }; + break; + case 'log': + var errors = []; + + handler = function(e) { + if (arguments.length == 1) { + errors.push(e); + } else { + errors.push([].slice.call(arguments, 0)); + } + }; + + handler.errors = errors; + break; + default: + throw Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!"); + } + }; + + this.$get = function() { + return handler; + }; + + this.mode('rethrow'); +}; + + +/** + * @ngdoc service + * @name ngMock.$log + * + * @description + * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays + * (one array per logging level). These arrays are exposed as `logs` property of each of the + * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`. + * + */ +angular.mock.$LogProvider = function() { + + function concat(array1, array2, index) { + return array1.concat(Array.prototype.slice.call(array2, index)); + } + + + this.$get = function () { + var $log = { + log: function() { $log.log.logs.push(concat([], arguments, 0)); }, + warn: function() { $log.warn.logs.push(concat([], arguments, 0)); }, + info: function() { $log.info.logs.push(concat([], arguments, 0)); }, + error: function() { $log.error.logs.push(concat([], arguments, 0)); } + }; + + /** + * @ngdoc method + * @name ngMock.$log#reset + * @methodOf ngMock.$log + * + * @description + * Reset all of the logging arrays to empty. + */ + $log.reset = function () { + /** + * @ngdoc property + * @name ngMock.$log#log.logs + * @propertyOf ngMock.$log + * + * @description + * Array of messages logged using {@link ngMock.$log#log}. + * + * @example + *
    +       * $log.log('Some Log');
    +       * var first = $log.log.logs.unshift();
    +       * 
    + */ + $log.log.logs = []; + /** + * @ngdoc property + * @name ngMock.$log#warn.logs + * @propertyOf ngMock.$log + * + * @description + * Array of messages logged using {@link ngMock.$log#warn}. + * + * @example + *
    +       * $log.warn('Some Warning');
    +       * var first = $log.warn.logs.unshift();
    +       * 
    + */ + $log.warn.logs = []; + /** + * @ngdoc property + * @name ngMock.$log#info.logs + * @propertyOf ngMock.$log + * + * @description + * Array of messages logged using {@link ngMock.$log#info}. + * + * @example + *
    +       * $log.info('Some Info');
    +       * var first = $log.info.logs.unshift();
    +       * 
    + */ + $log.info.logs = []; + /** + * @ngdoc property + * @name ngMock.$log#error.logs + * @propertyOf ngMock.$log + * + * @description + * Array of messages logged using {@link ngMock.$log#error}. + * + * @example + *
    +       * $log.log('Some Error');
    +       * var first = $log.error.logs.unshift();
    +       * 
    + */ + $log.error.logs = []; + }; + + /** + * @ngdoc method + * @name ngMock.$log#assertEmpty + * @methodOf ngMock.$log + * + * @description + * Assert that the all of the logging methods have no logged messages. If messages present, an exception is thrown. + */ + $log.assertEmpty = function() { + var errors = []; + angular.forEach(['error', 'warn', 'info', 'log'], function(logLevel) { + angular.forEach($log[logLevel].logs, function(log) { + angular.forEach(log, function (logItem) { + errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\n' + (logItem.stack || '')); + }); + }); + }); + if (errors.length) { + errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or an expected " + + "log message was not checked and removed:"); + errors.push(''); + throw new Error(errors.join('\n---------\n')); + } + }; + + $log.reset(); + return $log; + }; +}; + + +(function() { + var R_ISO8061_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?:\:?(\d\d)(?:\:?(\d\d)(?:\.(\d{3}))?)?)?(Z|([+-])(\d\d):?(\d\d)))?$/; + + function jsonStringToDate(string){ + var match; + if (match = string.match(R_ISO8061_STR)) { + var date = new Date(0), + tzHour = 0, + tzMin = 0; + if (match[9]) { + tzHour = int(match[9] + match[10]); + tzMin = int(match[9] + match[11]); + } + date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])); + date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0)); + return date; + } + return string; + } + + function int(str) { + return parseInt(str, 10); + } + + function padNumber(num, digits, trim) { + var neg = ''; + if (num < 0) { + neg = '-'; + num = -num; + } + num = '' + num; + while(num.length < digits) num = '0' + num; + if (trim) + num = num.substr(num.length - digits); + return neg + num; + } + + + /** + * @ngdoc object + * @name angular.mock.TzDate + * @description + * + * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`. + * + * Mock of the Date type which has its timezone specified via constructor arg. + * + * The main purpose is to create Date-like instances with timezone fixed to the specified timezone + * offset, so that we can test code that depends on local timezone settings without dependency on + * the time zone settings of the machine where the code is running. + * + * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored) + * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC* + * + * @example + * !!!! WARNING !!!!! + * This is not a complete Date object so only methods that were implemented can be called safely. + * To make matters worse, TzDate instances inherit stuff from Date via a prototype. + * + * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is + * incomplete we might be missing some non-standard methods. This can result in errors like: + * "Date.prototype.foo called on incompatible Object". + * + *
    +   * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
    +   * newYearInBratislava.getTimezoneOffset() => -60;
    +   * newYearInBratislava.getFullYear() => 2010;
    +   * newYearInBratislava.getMonth() => 0;
    +   * newYearInBratislava.getDate() => 1;
    +   * newYearInBratislava.getHours() => 0;
    +   * newYearInBratislava.getMinutes() => 0;
    +   * newYearInBratislava.getSeconds() => 0;
    +   * 
    + * + */ + angular.mock.TzDate = function (offset, timestamp) { + var self = new Date(0); + if (angular.isString(timestamp)) { + var tsStr = timestamp; + + self.origDate = jsonStringToDate(timestamp); + + timestamp = self.origDate.getTime(); + if (isNaN(timestamp)) + throw { + name: "Illegal Argument", + message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string" + }; + } else { + self.origDate = new Date(timestamp); + } + + var localOffset = new Date(timestamp).getTimezoneOffset(); + self.offsetDiff = localOffset*60*1000 - offset*1000*60*60; + self.date = new Date(timestamp + self.offsetDiff); + + self.getTime = function() { + return self.date.getTime() - self.offsetDiff; + }; + + self.toLocaleDateString = function() { + return self.date.toLocaleDateString(); + }; + + self.getFullYear = function() { + return self.date.getFullYear(); + }; + + self.getMonth = function() { + return self.date.getMonth(); + }; + + self.getDate = function() { + return self.date.getDate(); + }; + + self.getHours = function() { + return self.date.getHours(); + }; + + self.getMinutes = function() { + return self.date.getMinutes(); + }; + + self.getSeconds = function() { + return self.date.getSeconds(); + }; + + self.getMilliseconds = function() { + return self.date.getMilliseconds(); + }; + + self.getTimezoneOffset = function() { + return offset * 60; + }; + + self.getUTCFullYear = function() { + return self.origDate.getUTCFullYear(); + }; + + self.getUTCMonth = function() { + return self.origDate.getUTCMonth(); + }; + + self.getUTCDate = function() { + return self.origDate.getUTCDate(); + }; + + self.getUTCHours = function() { + return self.origDate.getUTCHours(); + }; + + self.getUTCMinutes = function() { + return self.origDate.getUTCMinutes(); + }; + + self.getUTCSeconds = function() { + return self.origDate.getUTCSeconds(); + }; + + self.getUTCMilliseconds = function() { + return self.origDate.getUTCMilliseconds(); + }; + + self.getDay = function() { + return self.date.getDay(); + }; + + // provide this method only on browsers that already have it + if (self.toISOString) { + self.toISOString = function() { + return padNumber(self.origDate.getUTCFullYear(), 4) + '-' + + padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' + + padNumber(self.origDate.getUTCDate(), 2) + 'T' + + padNumber(self.origDate.getUTCHours(), 2) + ':' + + padNumber(self.origDate.getUTCMinutes(), 2) + ':' + + padNumber(self.origDate.getUTCSeconds(), 2) + '.' + + padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z' + } + } + + //hide all methods not implemented in this mock that the Date prototype exposes + var unimplementedMethods = ['getUTCDay', + 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', + 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', + 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', + 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString', + 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf']; + + angular.forEach(unimplementedMethods, function(methodName) { + self[methodName] = function() { + throw Error("Method '" + methodName + "' is not implemented in the TzDate mock"); + }; + }); + + return self; + }; + + //make "tzDateInstance instanceof Date" return true + angular.mock.TzDate.prototype = Date.prototype; +})(); + +/** + * @ngdoc function + * @name angular.mock.createMockWindow + * @description + * + * This function creates a mock window object useful for controlling access ot setTimeout, but mocking out + * sufficient window's properties to allow Angular to execute. + * + * @example + * + *
    +    beforeEach(module(function($provide) {
    +      $provide.value('$window', window = angular.mock.createMockWindow());
    +    }));
    +
    +    it('should do something', inject(function($window) {
    +      var val = null;
    +      $window.setTimeout(function() { val = 123; }, 10);
    +      expect(val).toEqual(null);
    +      window.setTimeout.expect(10).process();
    +      expect(val).toEqual(123);
    +    });
    + * 
    + * + */ +angular.mock.createMockWindow = function() { + var mockWindow = {}; + var setTimeoutQueue = []; + + mockWindow.document = window.document; + mockWindow.getComputedStyle = angular.bind(window, window.getComputedStyle); + mockWindow.scrollTo = angular.bind(window, window.scrollTo); + mockWindow.navigator = window.navigator; + mockWindow.setTimeout = function(fn, delay) { + setTimeoutQueue.push({fn: fn, delay: delay}); + }; + mockWindow.setTimeout.queue = setTimeoutQueue; + mockWindow.setTimeout.expect = function(delay) { + if (setTimeoutQueue.length > 0) { + return { + process: function() { + var tick = setTimeoutQueue.shift(); + expect(tick.delay).toEqual(delay); + tick.fn(); + } + }; + } else { + expect('SetTimoutQueue empty. Expecting delay of ').toEqual(delay); + } + }; + + return mockWindow; +}; + +/** + * @ngdoc function + * @name angular.mock.dump + * @description + * + * *NOTE*: this is not an injectable instance, just a globally available function. + * + * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for debugging. + * + * This method is also available on window, where it can be used to display objects on debug console. + * + * @param {*} object - any object to turn into string. + * @return {string} a serialized string of the argument + */ +angular.mock.dump = function(object) { + return serialize(object); + + function serialize(object) { + var out; + + if (angular.isElement(object)) { + object = angular.element(object); + out = angular.element('
    '); + angular.forEach(object, function(element) { + out.append(angular.element(element).clone()); + }); + out = out.html(); + } else if (angular.isArray(object)) { + out = []; + angular.forEach(object, function(o) { + out.push(serialize(o)); + }); + out = '[ ' + out.join(', ') + ' ]'; + } else if (angular.isObject(object)) { + if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) { + out = serializeScope(object); + } else if (object instanceof Error) { + out = object.stack || ('' + object.name + ': ' + object.message); + } else { + out = angular.toJson(object, true); + } + } else { + out = String(object); + } + + return out; + } + + function serializeScope(scope, offset) { + offset = offset || ' '; + var log = [offset + 'Scope(' + scope.$id + '): {']; + for ( var key in scope ) { + if (scope.hasOwnProperty(key) && !key.match(/^(\$|this)/)) { + log.push(' ' + key + ': ' + angular.toJson(scope[key])); + } + } + var child = scope.$$childHead; + while(child) { + log.push(serializeScope(child, offset + ' ')); + child = child.$$nextSibling; + } + log.push('}'); + return log.join('\n' + offset); + } +}; + +/** + * @ngdoc object + * @name ngMock.$httpBackend + * @description + * Fake HTTP backend implementation suitable for unit testing applications that use the + * {@link ng.$http $http service}. + * + * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less + * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}. + * + * During unit testing, we want our unit tests to run quickly and have no external dependencies so + * we don’t want to send {@link https://developer.mozilla.org/en/xmlhttprequest XHR} or + * {@link http://en.wikipedia.org/wiki/JSONP JSONP} requests to a real server. All we really need is + * to verify whether a certain request has been sent or not, or alternatively just let the + * application make requests, respond with pre-trained responses and assert that the end result is + * what we expect it to be. + * + * This mock implementation can be used to respond with static or dynamic responses via the + * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc). + * + * When an Angular application needs some data from a server, it calls the $http service, which + * sends the request to a real server using $httpBackend service. With dependency injection, it is + * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify + * the requests and respond with some testing data without sending a request to real server. + * + * There are two ways to specify what test data should be returned as http responses by the mock + * backend when the code under test makes http requests: + * + * - `$httpBackend.expect` - specifies a request expectation + * - `$httpBackend.when` - specifies a backend definition + * + * + * # Request Expectations vs Backend Definitions + * + * Request expectations provide a way to make assertions about requests made by the application and + * to define responses for those requests. The test will fail if the expected requests are not made + * or they are made in the wrong order. + * + * Backend definitions allow you to define a fake backend for your application which doesn't assert + * if a particular request was made or not, it just returns a trained response if a request is made. + * The test will pass whether or not the request gets made during testing. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Request expectationsBackend definitions
    Syntax.expect(...).respond(...).when(...).respond(...)
    Typical usagestrict unit testsloose (black-box) unit testing
    Fulfills multiple requestsNOYES
    Order of requests mattersYESNO
    Request requiredYESNO
    Response requiredoptional (see below)YES
    + * + * In cases where both backend definitions and request expectations are specified during unit + * testing, the request expectations are evaluated first. + * + * If a request expectation has no response specified, the algorithm will search your backend + * definitions for an appropriate response. + * + * If a request didn't match any expectation or if the expectation doesn't have the response + * defined, the backend definitions are evaluated in sequential order to see if any of them match + * the request. The response from the first matched definition is returned. + * + * + * # Flushing HTTP requests + * + * The $httpBackend used in production, always responds to requests with responses asynchronously. + * If we preserved this behavior in unit testing, we'd have to create async unit tests, which are + * hard to write, follow and maintain. At the same time the testing mock, can't respond + * synchronously because that would change the execution of the code under test. For this reason the + * mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending + * requests and thus preserving the async api of the backend, while allowing the test to execute + * synchronously. + * + * + * # Unit testing with mock $httpBackend + * + *
    +   // controller
    +   function MyController($scope, $http) {
    +     $http.get('/auth.py').success(function(data) {
    +       $scope.user = data;
    +     });
    +
    +     this.saveMessage = function(message) {
    +       $scope.status = 'Saving...';
    +       $http.post('/add-msg.py', message).success(function(response) {
    +         $scope.status = '';
    +       }).error(function() {
    +         $scope.status = 'ERROR!';
    +       });
    +     };
    +   }
    +
    +   // testing controller
    +   var $httpBackend;
    +
    +   beforeEach(inject(function($injector) {
    +     $httpBackend = $injector.get('$httpBackend');
    +
    +     // backend definition common for all tests
    +     $httpBackend.when('GET', '/auth.py').respond({userId: 'userX'}, {'A-Token': 'xxx'});
    +   }));
    +
    +
    +   afterEach(function() {
    +     $httpBackend.verifyNoOutstandingExpectation();
    +     $httpBackend.verifyNoOutstandingRequest();
    +   });
    +
    +
    +   it('should fetch authentication token', function() {
    +     $httpBackend.expectGET('/auth.py');
    +     var controller = scope.$new(MyController);
    +     $httpBackend.flush();
    +   });
    +
    +
    +   it('should send msg to server', function() {
    +     // now you don’t care about the authentication, but
    +     // the controller will still send the request and
    +     // $httpBackend will respond without you having to
    +     // specify the expectation and response for this request
    +     $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');
    +
    +     var controller = scope.$new(MyController);
    +     $httpBackend.flush();
    +     controller.saveMessage('message content');
    +     expect(controller.status).toBe('Saving...');
    +     $httpBackend.flush();
    +     expect(controller.status).toBe('');
    +   });
    +
    +
    +   it('should send auth header', function() {
    +     $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {
    +       // check if the header was send, if it wasn't the expectation won't
    +       // match the request and the test will fail
    +       return headers['Authorization'] == 'xxx';
    +     }).respond(201, '');
    +
    +     var controller = scope.$new(MyController);
    +     controller.saveMessage('whatever');
    +     $httpBackend.flush();
    +   });
    +   
    + */ +angular.mock.$HttpBackendProvider = function() { + this.$get = ['$rootScope', createHttpBackendMock]; +}; + +/** + * General factory function for $httpBackend mock. + * Returns instance for unit testing (when no arguments specified): + * - passing through is disabled + * - auto flushing is disabled + * + * Returns instance for e2e testing (when `$delegate` and `$browser` specified): + * - passing through (delegating request to real backend) is enabled + * - auto flushing is enabled + * + * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified) + * @param {Object=} $browser Auto-flushing enabled if specified + * @return {Object} Instance of $httpBackend mock + */ +function createHttpBackendMock($rootScope, $delegate, $browser) { + var definitions = [], + expectations = [], + responses = [], + responsesPush = angular.bind(responses, responses.push); + + function createResponse(status, data, headers) { + if (angular.isFunction(status)) return status; + + return function() { + return angular.isNumber(status) + ? [status, data, headers] + : [200, status, data]; + }; + } + + // TODO(vojta): change params to: method, url, data, headers, callback + function $httpBackend(method, url, data, callback, headers, timeout) { + var xhr = new MockXhr(), + expectation = expectations[0], + wasExpected = false; + + function prettyPrint(data) { + return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp) + ? data + : angular.toJson(data); + } + + function wrapResponse(wrapped) { + if (!$browser && timeout && timeout.then) timeout.then(handleTimeout); + + return handleResponse; + + function handleResponse() { + var response = wrapped.response(method, url, data, headers); + xhr.$$respHeaders = response[2]; + callback(response[0], response[1], xhr.getAllResponseHeaders()); + } + + function handleTimeout() { + for (var i = 0, ii = responses.length; i < ii; i++) { + if (responses[i] === handleResponse) { + responses.splice(i, 1); + callback(-1, undefined, ''); + break; + } + } + } + } + + if (expectation && expectation.match(method, url)) { + if (!expectation.matchData(data)) + throw Error('Expected ' + expectation + ' with different data\n' + + 'EXPECTED: ' + prettyPrint(expectation.data) + '\nGOT: ' + data); + + if (!expectation.matchHeaders(headers)) + throw Error('Expected ' + expectation + ' with different headers\n' + + 'EXPECTED: ' + prettyPrint(expectation.headers) + '\nGOT: ' + + prettyPrint(headers)); + + expectations.shift(); + + if (expectation.response) { + responses.push(wrapResponse(expectation)); + return; + } + wasExpected = true; + } + + var i = -1, definition; + while ((definition = definitions[++i])) { + if (definition.match(method, url, data, headers || {})) { + if (definition.response) { + // if $browser specified, we do auto flush all requests + ($browser ? $browser.defer : responsesPush)(wrapResponse(definition)); + } else if (definition.passThrough) { + $delegate(method, url, data, callback, headers, timeout); + } else throw Error('No response defined !'); + return; + } + } + throw wasExpected ? + Error('No response defined !') : + Error('Unexpected request: ' + method + ' ' + url + '\n' + + (expectation ? 'Expected ' + expectation : 'No more request expected')); + } + + /** + * @ngdoc method + * @name ngMock.$httpBackend#when + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition. + * + * @param {string} method HTTP method. + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header + * object and returns true if the headers match the current definition. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + * + * - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` + * – The respond method takes a set of static data to be returned or a function that can return + * an array containing response status (number), response data (string) and response headers + * (Object). + */ + $httpBackend.when = function(method, url, data, headers) { + var definition = new MockHttpExpectation(method, url, data, headers), + chain = { + respond: function(status, data, headers) { + definition.response = createResponse(status, data, headers); + } + }; + + if ($browser) { + chain.passThrough = function() { + definition.passThrough = true; + }; + } + + definitions.push(definition); + return chain; + }; + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenGET + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for GET requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenHEAD + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for HEAD requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenDELETE + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for DELETE requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenPOST + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for POST requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenPUT + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for PUT requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#whenJSONP + * @methodOf ngMock.$httpBackend + * @description + * Creates a new backend definition for JSONP requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + createShortMethods('when'); + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expect + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation. + * + * @param {string} method HTTP method. + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header + * object and returns true if the headers match the current expectation. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + * + * - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` + * – The respond method takes a set of static data to be returned or a function that can return + * an array containing response status (number), response data (string) and response headers + * (Object). + */ + $httpBackend.expect = function(method, url, data, headers) { + var expectation = new MockHttpExpectation(method, url, data, headers); + expectations.push(expectation); + return { + respond: function(status, data, headers) { + expectation.response = createResponse(status, data, headers); + } + }; + }; + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectGET + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for GET requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. See #expect for more info. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectHEAD + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for HEAD requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectDELETE + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for DELETE requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectPOST + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for POST requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectPUT + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for PUT requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectPATCH + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for PATCH requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {Object=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + + /** + * @ngdoc method + * @name ngMock.$httpBackend#expectJSONP + * @methodOf ngMock.$httpBackend + * @description + * Creates a new request expectation for JSONP requests. For more info see `expect()`. + * + * @param {string|RegExp} url HTTP url. + * @returns {requestHandler} Returns an object with `respond` method that control how a matched + * request is handled. + */ + createShortMethods('expect'); + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#flush + * @methodOf ngMock.$httpBackend + * @description + * Flushes all pending requests using the trained responses. + * + * @param {number=} count Number of responses to flush (in the order they arrived). If undefined, + * all pending requests will be flushed. If there are no pending requests when the flush method + * is called an exception is thrown (as this typically a sign of programming error). + */ + $httpBackend.flush = function(count) { + $rootScope.$digest(); + if (!responses.length) throw Error('No pending request to flush !'); + + if (angular.isDefined(count)) { + while (count--) { + if (!responses.length) throw Error('No more pending request to flush !'); + responses.shift()(); + } + } else { + while (responses.length) { + responses.shift()(); + } + } + $httpBackend.verifyNoOutstandingExpectation(); + }; + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#verifyNoOutstandingExpectation + * @methodOf ngMock.$httpBackend + * @description + * Verifies that all of the requests defined via the `expect` api were made. If any of the + * requests were not made, verifyNoOutstandingExpectation throws an exception. + * + * Typically, you would call this method following each test case that asserts requests using an + * "afterEach" clause. + * + *
    +   *   afterEach($httpBackend.verifyExpectations);
    +   * 
    + */ + $httpBackend.verifyNoOutstandingExpectation = function() { + $rootScope.$digest(); + if (expectations.length) { + throw Error('Unsatisfied requests: ' + expectations.join(', ')); + } + }; + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#verifyNoOutstandingRequest + * @methodOf ngMock.$httpBackend + * @description + * Verifies that there are no outstanding requests that need to be flushed. + * + * Typically, you would call this method following each test case that asserts requests using an + * "afterEach" clause. + * + *
    +   *   afterEach($httpBackend.verifyNoOutstandingRequest);
    +   * 
    + */ + $httpBackend.verifyNoOutstandingRequest = function() { + if (responses.length) { + throw Error('Unflushed requests: ' + responses.length); + } + }; + + + /** + * @ngdoc method + * @name ngMock.$httpBackend#resetExpectations + * @methodOf ngMock.$httpBackend + * @description + * Resets all request expectations, but preserves all backend definitions. Typically, you would + * call resetExpectations during a multiple-phase test when you want to reuse the same instance of + * $httpBackend mock. + */ + $httpBackend.resetExpectations = function() { + expectations.length = 0; + responses.length = 0; + }; + + return $httpBackend; + + + function createShortMethods(prefix) { + angular.forEach(['GET', 'DELETE', 'JSONP'], function(method) { + $httpBackend[prefix + method] = function(url, headers) { + return $httpBackend[prefix](method, url, undefined, headers) + } + }); + + angular.forEach(['PUT', 'POST', 'PATCH'], function(method) { + $httpBackend[prefix + method] = function(url, data, headers) { + return $httpBackend[prefix](method, url, data, headers) + } + }); + } +} + +function MockHttpExpectation(method, url, data, headers) { + + this.data = data; + this.headers = headers; + + this.match = function(m, u, d, h) { + if (method != m) return false; + if (!this.matchUrl(u)) return false; + if (angular.isDefined(d) && !this.matchData(d)) return false; + if (angular.isDefined(h) && !this.matchHeaders(h)) return false; + return true; + }; + + this.matchUrl = function(u) { + if (!url) return true; + if (angular.isFunction(url.test)) return url.test(u); + return url == u; + }; + + this.matchHeaders = function(h) { + if (angular.isUndefined(headers)) return true; + if (angular.isFunction(headers)) return headers(h); + return angular.equals(headers, h); + }; + + this.matchData = function(d) { + if (angular.isUndefined(data)) return true; + if (data && angular.isFunction(data.test)) return data.test(d); + if (data && !angular.isString(data)) return angular.toJson(data) == d; + return data == d; + }; + + this.toString = function() { + return method + ' ' + url; + }; +} + +function MockXhr() { + + // hack for testing $http, $httpBackend + MockXhr.$$lastInstance = this; + + this.open = function(method, url, async) { + this.$$method = method; + this.$$url = url; + this.$$async = async; + this.$$reqHeaders = {}; + this.$$respHeaders = {}; + }; + + this.send = function(data) { + this.$$data = data; + }; + + this.setRequestHeader = function(key, value) { + this.$$reqHeaders[key] = value; + }; + + this.getResponseHeader = function(name) { + // the lookup must be case insensitive, that's why we try two quick lookups and full scan at last + var header = this.$$respHeaders[name]; + if (header) return header; + + name = angular.lowercase(name); + header = this.$$respHeaders[name]; + if (header) return header; + + header = undefined; + angular.forEach(this.$$respHeaders, function(headerVal, headerName) { + if (!header && angular.lowercase(headerName) == name) header = headerVal; + }); + return header; + }; + + this.getAllResponseHeaders = function() { + var lines = []; + + angular.forEach(this.$$respHeaders, function(value, key) { + lines.push(key + ': ' + value); + }); + return lines.join('\n'); + }; + + this.abort = angular.noop; +} + + +/** + * @ngdoc function + * @name ngMock.$timeout + * @description + * + * This service is just a simple decorator for {@link ng.$timeout $timeout} service + * that adds a "flush" and "verifyNoPendingTasks" methods. + */ + +angular.mock.$TimeoutDecorator = function($delegate, $browser) { + + /** + * @ngdoc method + * @name ngMock.$timeout#flush + * @methodOf ngMock.$timeout + * @description + * + * Flushes the queue of pending tasks. + */ + $delegate.flush = function() { + $browser.defer.flush(); + }; + + /** + * @ngdoc method + * @name ngMock.$timeout#verifyNoPendingTasks + * @methodOf ngMock.$timeout + * @description + * + * Verifies that there are no pending tasks that need to be flushed. + */ + $delegate.verifyNoPendingTasks = function() { + if ($browser.deferredFns.length) { + throw Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' + + formatPendingTasksAsString($browser.deferredFns)); + } + }; + + function formatPendingTasksAsString(tasks) { + var result = []; + angular.forEach(tasks, function(task) { + result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}'); + }); + + return result.join(', '); + } + + return $delegate; +}; + +/** + * + */ +angular.mock.$RootElementProvider = function() { + this.$get = function() { + return angular.element('
    '); + } +}; + +/** + * @ngdoc overview + * @name ngMock + * @description + * + * The `ngMock` is an angular module which is used with `ng` module and adds unit-test configuration as well as useful + * mocks to the {@link AUTO.$injector $injector}. + */ +angular.module('ngMock', ['ng']).provider({ + $browser: angular.mock.$BrowserProvider, + $exceptionHandler: angular.mock.$ExceptionHandlerProvider, + $log: angular.mock.$LogProvider, + $httpBackend: angular.mock.$HttpBackendProvider, + $rootElement: angular.mock.$RootElementProvider +}).config(function($provide) { + $provide.decorator('$timeout', angular.mock.$TimeoutDecorator); +}); + +/** + * @ngdoc overview + * @name ngMockE2E + * @description + * + * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing. + * Currently there is only one mock present in this module - + * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock. + */ +angular.module('ngMockE2E', ['ng']).config(function($provide) { + $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator); +}); + +/** + * @ngdoc object + * @name ngMockE2E.$httpBackend + * @description + * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of + * applications that use the {@link ng.$http $http service}. + * + * *Note*: For fake http backend implementation suitable for unit testing please see + * {@link ngMock.$httpBackend unit-testing $httpBackend mock}. + * + * This implementation can be used to respond with static or dynamic responses via the `when` api + * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the + * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch + * templates from a webserver). + * + * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application + * is being developed with the real backend api replaced with a mock, it is often desirable for + * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch + * templates or static files from the webserver). To configure the backend with this behavior + * use the `passThrough` request handler of `when` instead of `respond`. + * + * Additionally, we don't want to manually have to flush mocked out requests like we do during unit + * testing. For this reason the e2e $httpBackend automatically flushes mocked out requests + * automatically, closely simulating the behavior of the XMLHttpRequest object. + * + * To setup the application to run with this http backend, you have to create a module that depends + * on the `ngMockE2E` and your application modules and defines the fake backend: + * + *
    + *   myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);
    + *   myAppDev.run(function($httpBackend) {
    + *     phones = [{name: 'phone1'}, {name: 'phone2'}];
    + *
    + *     // returns the current list of phones
    + *     $httpBackend.whenGET('/phones').respond(phones);
    + *
    + *     // adds a new phone to the phones array
    + *     $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
    + *       phones.push(angular.fromJSON(data));
    + *     });
    + *     $httpBackend.whenGET(/^\/templates\//).passThrough();
    + *     //...
    + *   });
    + * 
    + * + * Afterwards, bootstrap your app with this new module. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#when + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition. + * + * @param {string} method HTTP method. + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header + * object and returns true if the headers match the current definition. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + * + * - respond – `{function([status,] data[, headers])|function(function(method, url, data, headers)}` + * – The respond method takes a set of static data to be returned or a function that can return + * an array containing response status (number), response data (string) and response headers + * (Object). + * - passThrough – `{function()}` – Any request matching a backend definition with `passThrough` + * handler, will be pass through to the real backend (an XHR request will be made to the + * server. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenGET + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for GET requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenHEAD + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for HEAD requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenDELETE + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for DELETE requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenPOST + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for POST requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenPUT + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for PUT requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenPATCH + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for PATCH requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @param {(string|RegExp)=} data HTTP request body. + * @param {(Object|function(Object))=} headers HTTP headers. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ + +/** + * @ngdoc method + * @name ngMockE2E.$httpBackend#whenJSONP + * @methodOf ngMockE2E.$httpBackend + * @description + * Creates a new backend definition for JSONP requests. For more info see `when()`. + * + * @param {string|RegExp} url HTTP url. + * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that + * control how a matched request is handled. + */ +angular.mock.e2e = {}; +angular.mock.e2e.$httpBackendDecorator = ['$rootScope', '$delegate', '$browser', createHttpBackendMock]; + + +angular.mock.clearDataCache = function() { + var key, + cache = angular.element.cache; + + for(key in cache) { + if (cache.hasOwnProperty(key)) { + var handle = cache[key].handle; + + handle && angular.element(handle.elem).unbind(); + delete cache[key]; + } + } +}; + + +window.jstestdriver && (function(window) { + /** + * Global method to output any number of objects into JSTD console. Useful for debugging. + */ + window.dump = function() { + var args = []; + angular.forEach(arguments, function(arg) { + args.push(angular.mock.dump(arg)); + }); + jstestdriver.console.log.apply(jstestdriver.console, args); + if (window.console) { + window.console.log.apply(window.console, args); + } + }; +})(window); + + +(window.jasmine || window.mocha) && (function(window) { + + var currentSpec = null; + + beforeEach(function() { + currentSpec = this; + }); + + afterEach(function() { + var injector = currentSpec.$injector; + + currentSpec.$injector = null; + currentSpec.$modules = null; + currentSpec = null; + + if (injector) { + injector.get('$rootElement').unbind(); + injector.get('$browser').pollFns.length = 0; + } + + angular.mock.clearDataCache(); + + // clean up jquery's fragment cache + angular.forEach(angular.element.fragments, function(val, key) { + delete angular.element.fragments[key]; + }); + + MockXhr.$$lastInstance = null; + + angular.forEach(angular.callbacks, function(val, key) { + delete angular.callbacks[key]; + }); + angular.callbacks.counter = 0; + }); + + function isSpecRunning() { + return currentSpec && (window.mocha || currentSpec.queue.running); + } + + /** + * @ngdoc function + * @name angular.mock.module + * @description + * + * *NOTE*: This function is also published on window for easy access.
    + * + * This function registers a module configuration code. It collects the configuration information + * which will be used when the injector is created by {@link angular.mock.inject inject}. + * + * See {@link angular.mock.inject inject} for usage example + * + * @param {...(string|Function)} fns any number of modules which are represented as string + * aliases or as anonymous module initialization functions. The modules are used to + * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. + */ + window.module = angular.mock.module = function() { + var moduleFns = Array.prototype.slice.call(arguments, 0); + return isSpecRunning() ? workFn() : workFn; + ///////////////////// + function workFn() { + if (currentSpec.$injector) { + throw Error('Injector already created, can not register a module!'); + } else { + var modules = currentSpec.$modules || (currentSpec.$modules = []); + angular.forEach(moduleFns, function(module) { + modules.push(module); + }); + } + } + }; + + /** + * @ngdoc function + * @name angular.mock.inject + * @description + * + * *NOTE*: This function is also published on window for easy access.
    + * + * The inject function wraps a function into an injectable function. The inject() creates new + * instance of {@link AUTO.$injector $injector} per test, which is then used for + * resolving references. + * + * See also {@link angular.mock.module module} + * + * Example of what a typical jasmine tests looks like with the inject method. + *
    +   *
    +   *   angular.module('myApplicationModule', [])
    +   *       .value('mode', 'app')
    +   *       .value('version', 'v1.0.1');
    +   *
    +   *
    +   *   describe('MyApp', function() {
    +   *
    +   *     // You need to load modules that you want to test,
    +   *     // it loads only the "ng" module by default.
    +   *     beforeEach(module('myApplicationModule'));
    +   *
    +   *
    +   *     // inject() is used to inject arguments of all given functions
    +   *     it('should provide a version', inject(function(mode, version) {
    +   *       expect(version).toEqual('v1.0.1');
    +   *       expect(mode).toEqual('app');
    +   *     }));
    +   *
    +   *
    +   *     // The inject and module method can also be used inside of the it or beforeEach
    +   *     it('should override a version and test the new version is injected', function() {
    +   *       // module() takes functions or strings (module aliases)
    +   *       module(function($provide) {
    +   *         $provide.value('version', 'overridden'); // override version here
    +   *       });
    +   *
    +   *       inject(function(version) {
    +   *         expect(version).toEqual('overridden');
    +   *       });
    +   *     ));
    +   *   });
    +   *
    +   * 
    + * + * @param {...Function} fns any number of functions which will be injected using the injector. + */ + window.inject = angular.mock.inject = function() { + var blockFns = Array.prototype.slice.call(arguments, 0); + var errorForStack = new Error('Declaration Location'); + return isSpecRunning() ? workFn() : workFn; + ///////////////////// + function workFn() { + var modules = currentSpec.$modules || []; + + modules.unshift('ngMock'); + modules.unshift('ng'); + var injector = currentSpec.$injector; + if (!injector) { + injector = currentSpec.$injector = angular.injector(modules); + } + for(var i = 0, ii = blockFns.length; i < ii; i++) { + try { + injector.invoke(blockFns[i] || angular.noop, this); + } catch (e) { + if(e.stack && errorForStack) e.stack += '\n' + errorForStack.stack; + throw e; + } finally { + errorForStack = null; + } + } + } + }; +})(window); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.js new file mode 100644 index 00000000..acaa84cd --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.js @@ -0,0 +1,537 @@ +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) { +'use strict'; + +/** + * @ngdoc overview + * @name ngResource + * @description + */ + +/** + * @ngdoc object + * @name ngResource.$resource + * @requires $http + * + * @description + * A factory which creates a resource object that lets you interact with + * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. + * + * The returned resource object has action methods which provide high-level behaviors without + * the need to interact with the low level {@link ng.$http $http} service. + * + * # Installation + * To use $resource make sure you have included the `angular-resource.js` that comes in Angular + * package. You can also find this file on Google CDN, bower as well as at + * {@link http://code.angularjs.org/ code.angularjs.org}. + * + * Finally load the module in your application: + * + * angular.module('app', ['ngResource']); + * + * and you are ready to get started! + * + * @param {string} url A parametrized URL template with parameters prefixed by `:` as in + * `/user/:username`. If you are using a URL with a port number (e.g. + * `http://example.com:8080/api`), you'll need to escape the colon character before the port + * number, like this: `$resource('http://example.com\\:8080/api')`. + * + * If you are using a url with a suffix, just add the suffix, like this: + * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json') + * or even `$resource('http://example.com/resource/:resource_id.:format')` + * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be + * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you + * can escape it with `/\.`. + * + * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in + * `actions` methods. If any of the parameter value is a function, it will be executed every time + * when a param value needs to be obtained for a request (unless the param was overridden). + * + * Each key value in the parameter object is first bound to url template if present and then any + * excess keys are appended to the url search query after the `?`. + * + * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in + * URL `/path/greet?salutation=Hello`. + * + * If the parameter value is prefixed with `@` then the value of that parameter is extracted from + * the data object (useful for non-GET operations). + * + * @param {Object.=} actions Hash with declaration of custom action that should extend the + * default set of resource actions. The declaration should be created in the format of {@link + * ng.$http#Parameters $http.config}: + * + * {action1: {method:?, params:?, isArray:?, headers:?, ...}, + * action2: {method:?, params:?, isArray:?, headers:?, ...}, + * ...} + * + * Where: + * + * - **`action`** – {string} – The name of action. This name becomes the name of the method on your + * resource object. + * - **`method`** – {string} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`, `DELETE`, + * and `JSONP`. + * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of the + * parameter value is a function, it will be executed every time when a param value needs to be + * obtained for a request (unless the param was overridden). + * - **`url`** – {string} – action specific `url` override. The url templating is supported just like + * for the resource-level urls. + * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, see + * `returns` section. + * - **`transformRequest`** – `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * request body and headers and returns its transformed (typically serialized) version. + * - **`transformResponse`** – `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * response body and headers and returns its transformed (typically deserialized) version. + * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the + * GET request, otherwise if a cache instance built with + * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for + * caching. + * - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that + * should abort the request when resolved. + * - **`withCredentials`** - `{boolean}` - whether to to set the `withCredentials` flag on the + * XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5 + * requests with credentials} for more information. + * - **`responseType`** - `{string}` - see {@link + * https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}. + * + * @returns {Object} A resource "class" object with methods for the default set of resource actions + * optionally extended with custom `actions`. The default set contains these actions: + * + * { 'get': {method:'GET'}, + * 'save': {method:'POST'}, + * 'query': {method:'GET', isArray:true}, + * 'remove': {method:'DELETE'}, + * 'delete': {method:'DELETE'} }; + * + * Calling these methods invoke an {@link ng.$http} with the specified http method, + * destination and parameters. When the data is returned from the server then the object is an + * instance of the resource class. The actions `save`, `remove` and `delete` are available on it + * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create, + * read, update, delete) on server-side data like this: + *
    +        var User = $resource('/user/:userId', {userId:'@id'});
    +        var user = User.get({userId:123}, function() {
    +          user.abc = true;
    +          user.$save();
    +        });
    +     
    + * + * It is important to realize that invoking a $resource object method immediately returns an + * empty reference (object or array depending on `isArray`). Once the data is returned from the + * server the existing reference is populated with the actual data. This is a useful trick since + * usually the resource is assigned to a model which is then rendered by the view. Having an empty + * object results in no rendering, once the data arrives from the server then the object is + * populated with the data and the view automatically re-renders itself showing the new data. This + * means that in most case one never has to write a callback function for the action methods. + * + * The action methods on the class object or instance object can be invoked with the following + * parameters: + * + * - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])` + * - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])` + * - non-GET instance actions: `instance.$action([parameters], [success], [error])` + * + * + * The Resource instances and collection have these additional properties: + * + * - `$then`: the `then` method of a {@link ng.$q promise} derived from the underlying + * {@link ng.$http $http} call. + * + * The success callback for the `$then` method will be resolved if the underlying `$http` requests + * succeeds. + * + * The success callback is called with a single object which is the {@link ng.$http http response} + * object extended with a new property `resource`. This `resource` property is a reference to the + * result of the resource action — resource object or array of resources. + * + * The error callback is called with the {@link ng.$http http response} object when an http + * error occurs. + * + * - `$resolved`: true if the promise has been resolved (either with success or rejection); + * Knowing if the Resource has been resolved is useful in data-binding. + * + * @example + * + * # Credit card resource + * + *
    +     // Define CreditCard class
    +     var CreditCard = $resource('/user/:userId/card/:cardId',
    +      {userId:123, cardId:'@id'}, {
    +       charge: {method:'POST', params:{charge:true}}
    +      });
    +
    +     // We can retrieve a collection from the server
    +     var cards = CreditCard.query(function() {
    +       // GET: /user/123/card
    +       // server returns: [ {id:456, number:'1234', name:'Smith'} ];
    +
    +       var card = cards[0];
    +       // each item is an instance of CreditCard
    +       expect(card instanceof CreditCard).toEqual(true);
    +       card.name = "J. Smith";
    +       // non GET methods are mapped onto the instances
    +       card.$save();
    +       // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
    +       // server returns: {id:456, number:'1234', name: 'J. Smith'};
    +
    +       // our custom method is mapped as well.
    +       card.$charge({amount:9.99});
    +       // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
    +     });
    +
    +     // we can create an instance as well
    +     var newCard = new CreditCard({number:'0123'});
    +     newCard.name = "Mike Smith";
    +     newCard.$save();
    +     // POST: /user/123/card {number:'0123', name:'Mike Smith'}
    +     // server returns: {id:789, number:'01234', name: 'Mike Smith'};
    +     expect(newCard.id).toEqual(789);
    + * 
    + * + * The object returned from this function execution is a resource "class" which has "static" method + * for each action in the definition. + * + * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and `headers`. + * When the data is returned from the server then the object is an instance of the resource type and + * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD + * operations (create, read, update, delete) on server-side data. + +
    +     var User = $resource('/user/:userId', {userId:'@id'});
    +     var user = User.get({userId:123}, function() {
    +       user.abc = true;
    +       user.$save();
    +     });
    +   
    + * + * It's worth noting that the success callback for `get`, `query` and other method gets passed + * in the response that came from the server as well as $http header getter function, so one + * could rewrite the above example and get access to http headers as: + * +
    +     var User = $resource('/user/:userId', {userId:'@id'});
    +     User.get({userId:123}, function(u, getResponseHeaders){
    +       u.abc = true;
    +       u.$save(function(u, putResponseHeaders) {
    +         //u => saved user object
    +         //putResponseHeaders => $http header getter
    +       });
    +     });
    +   
    + + * # Buzz client + + Let's look at what a buzz client created with the `$resource` service looks like: + + + + +
    + + +
    +
    +

    + + {{item.actor.name}} + Expand replies: {{item.links.replies[0].count}} +

    + {{item.object.content | html}} +
    + + {{reply.actor.name}}: {{reply.content | html}} +
    +
    +
    +
    + + +
    + */ +angular.module('ngResource', ['ng']). + factory('$resource', ['$http', '$parse', function($http, $parse) { + var DEFAULT_ACTIONS = { + 'get': {method:'GET'}, + 'save': {method:'POST'}, + 'query': {method:'GET', isArray:true}, + 'remove': {method:'DELETE'}, + 'delete': {method:'DELETE'} + }; + var noop = angular.noop, + forEach = angular.forEach, + extend = angular.extend, + copy = angular.copy, + isFunction = angular.isFunction, + getter = function(obj, path) { + return $parse(path)(obj); + }; + + /** + * We need our custom method because encodeURIComponent is too aggressive and doesn't follow + * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path + * segments: + * segment = *pchar + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * pct-encoded = "%" HEXDIG HEXDIG + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ + function encodeUriSegment(val) { + return encodeUriQuery(val, true). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'); + } + + + /** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ + function encodeUriQuery(val, pctEncodeSpaces) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); + } + + function Route(template, defaults) { + this.template = template; + this.defaults = defaults || {}; + this.urlParams = {}; + } + + Route.prototype = { + setUrlParams: function(config, params, actionUrl) { + var self = this, + url = actionUrl || self.template, + val, + encodedVal; + + var urlParams = self.urlParams = {}; + forEach(url.split(/\W/), function(param){ + if (param && (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) { + urlParams[param] = true; + } + }); + url = url.replace(/\\:/g, ':'); + + params = params || {}; + forEach(self.urlParams, function(_, urlParam){ + val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam]; + if (angular.isDefined(val) && val !== null) { + encodedVal = encodeUriSegment(val); + url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), encodedVal + "$1"); + } else { + url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match, + leadingSlashes, tail) { + if (tail.charAt(0) == '/') { + return tail; + } else { + return leadingSlashes + tail; + } + }); + } + }); + + // strip trailing slashes and set the url + url = url.replace(/\/+$/, ''); + // then replace collapse `/.` if found in the last URL path segment before the query + // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x` + url = url.replace(/\/\.(?=\w+($|\?))/, '.'); + // replace escaped `/\.` with `/.` + config.url = url.replace(/\/\\\./, '/.'); + + + // set params - delegate param encoding to $http + forEach(params, function(value, key){ + if (!self.urlParams[key]) { + config.params = config.params || {}; + config.params[key] = value; + } + }); + } + }; + + + function ResourceFactory(url, paramDefaults, actions) { + var route = new Route(url); + + actions = extend({}, DEFAULT_ACTIONS, actions); + + function extractParams(data, actionParams){ + var ids = {}; + actionParams = extend({}, paramDefaults, actionParams); + forEach(actionParams, function(value, key){ + if (isFunction(value)) { value = value(); } + ids[key] = value && value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value; + }); + return ids; + } + + function Resource(value){ + copy(value || {}, this); + } + + forEach(actions, function(action, name) { + action.method = angular.uppercase(action.method); + var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH'; + Resource[name] = function(a1, a2, a3, a4) { + var params = {}; + var data; + var success = noop; + var error = null; + var promise; + + switch(arguments.length) { + case 4: + error = a4; + success = a3; + //fallthrough + case 3: + case 2: + if (isFunction(a2)) { + if (isFunction(a1)) { + success = a1; + error = a2; + break; + } + + success = a2; + error = a3; + //fallthrough + } else { + params = a1; + data = a2; + success = a3; + break; + } + case 1: + if (isFunction(a1)) success = a1; + else if (hasBody) data = a1; + else params = a1; + break; + case 0: break; + default: + throw "Expected between 0-4 arguments [params, data, success, error], got " + + arguments.length + " arguments."; + } + + var value = this instanceof Resource ? this : (action.isArray ? [] : new Resource(data)); + var httpConfig = {}, + promise; + + forEach(action, function(value, key) { + if (key != 'params' && key != 'isArray' ) { + httpConfig[key] = copy(value); + } + }); + httpConfig.data = data; + route.setUrlParams(httpConfig, extend({}, extractParams(data, action.params || {}), params), action.url); + + function markResolved() { value.$resolved = true; } + + promise = $http(httpConfig); + value.$resolved = false; + + promise.then(markResolved, markResolved); + value.$then = promise.then(function(response) { + var data = response.data; + var then = value.$then, resolved = value.$resolved; + + if (data) { + if (action.isArray) { + value.length = 0; + forEach(data, function(item) { + value.push(new Resource(item)); + }); + } else { + copy(data, value); + value.$then = then; + value.$resolved = resolved; + } + } + + (success||noop)(value, response.headers); + + response.resource = value; + return response; + }, error).then; + + return value; + }; + + + Resource.prototype['$' + name] = function(a1, a2, a3) { + var params = extractParams(this), + success = noop, + error; + + switch(arguments.length) { + case 3: params = a1; success = a2; error = a3; break; + case 2: + case 1: + if (isFunction(a1)) { + success = a1; + error = a2; + } else { + params = a1; + success = a2 || noop; + } + case 0: break; + default: + throw "Expected between 1-3 arguments [params, success, error], got " + + arguments.length + " arguments."; + } + var data = hasBody ? this : undefined; + Resource[name].call(this, params, data, success, error); + }; + }); + + Resource.bind = function(additionalParamDefaults){ + return ResourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions); + }; + + return Resource; + } + + return ResourceFactory; + }]); + + +})(window, window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.min.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.min.js new file mode 100644 index 00000000..a8848fa0 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-resource.min.js @@ -0,0 +1,11 @@ +/* + AngularJS v1.1.5 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(B,f,w){'use strict';f.module("ngResource",["ng"]).factory("$resource",["$http","$parse",function(x,y){function u(b,d){this.template=b;this.defaults=d||{};this.urlParams={}}function v(b,d,e){function j(c,b){var p={},b=m({},d,b);l(b,function(a,b){k(a)&&(a=a());var g;a&&a.charAt&&a.charAt(0)=="@"?(g=a.substr(1),g=y(g)(c)):g=a;p[b]=g});return p}function c(c){t(c||{},this)}var n=new u(b),e=m({},z,e);l(e,function(b,d){b.method=f.uppercase(b.method);var p=b.method=="POST"||b.method=="PUT"||b.method== +"PATCH";c[d]=function(a,d,g,A){function f(){h.$resolved=!0}var i={},e,o=q,r=null;switch(arguments.length){case 4:r=A,o=g;case 3:case 2:if(k(d)){if(k(a)){o=a;r=d;break}o=d;r=g}else{i=a;e=d;o=g;break}case 1:k(a)?o=a:p?e=a:i=a;break;case 0:break;default:throw"Expected between 0-4 arguments [params, data, success, error], got "+arguments.length+" arguments.";}var h=this instanceof c?this:b.isArray?[]:new c(e),s={};l(b,function(a,b){b!="params"&&b!="isArray"&&(s[b]=t(a))});s.data=e;n.setUrlParams(s,m({}, +j(e,b.params||{}),i),b.url);i=x(s);h.$resolved=!1;i.then(f,f);h.$then=i.then(function(a){var d=a.data,g=h.$then,e=h.$resolved;if(d)b.isArray?(h.length=0,l(d,function(a){h.push(new c(a))})):(t(d,h),h.$then=g,h.$resolved=e);(o||q)(h,a.headers);a.resource=h;return a},r).then;return h};c.prototype["$"+d]=function(a,b,g){var e=j(this),f=q,i;switch(arguments.length){case 3:e=a;f=b;i=g;break;case 2:case 1:k(a)?(f=a,i=b):(e=a,f=b||q);case 0:break;default:throw"Expected between 1-3 arguments [params, success, error], got "+ +arguments.length+" arguments.";}c[d].call(this,e,p?this:w,f,i)}});c.bind=function(c){return v(b,m({},d,c),e)};return c}var z={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},q=f.noop,l=f.forEach,m=f.extend,t=f.copy,k=f.isFunction;u.prototype={setUrlParams:function(b,d,e){var j=this,c=e||j.template,n,k,m=j.urlParams={};l(c.split(/\W/),function(b){b&&RegExp("(^|[^\\\\]):"+b+"(\\W|$)").test(c)&&(m[b]=!0)});c=c.replace(/\\:/g, +":");d=d||{};l(j.urlParams,function(b,a){n=d.hasOwnProperty(a)?d[a]:j.defaults[a];f.isDefined(n)&&n!==null?(k=encodeURIComponent(n).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(RegExp(":"+a+"(\\W|$)","g"),k+"$1")):c=c.replace(RegExp("(/?):"+a+"(\\W|$)","g"),function(b,a,c){return c.charAt(0)=="/"?c:a+c})});c=c.replace(/\/+$/,"");c=c.replace(/\/\.(?=\w+($|\?))/,"."); +b.url=c.replace(/\/\\\./,"/.");l(d,function(c,a){if(!j.urlParams[a])b.params=b.params||{},b.params[a]=c})}};return v}])})(window,window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.js new file mode 100644 index 00000000..8bb03a7d --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.js @@ -0,0 +1,558 @@ +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) { +'use strict'; + +/** + * @ngdoc overview + * @name ngSanitize + * @description + */ + +/* + * HTML Parser By Misko Hevery (misko@hevery.com) + * based on: HTML Parser By John Resig (ejohn.org) + * Original code by Erik Arvidsson, Mozilla Public License + * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js + * + * // Use like so: + * htmlParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + */ + + +/** + * @ngdoc service + * @name ngSanitize.$sanitize + * @function + * + * @description + * The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are + * then serialized back to properly escaped html string. This means that no unsafe input can make + * it into the returned string, however, since our parser is more strict than a typical browser + * parser, it's possible that some obscure input, which would be recognized as valid HTML by a + * browser, won't make it through the sanitizer. + * + * @param {string} html Html input. + * @returns {string} Sanitized html. + * + * @example + + + +
    + Snippet: + + + + + + + + + + + + + + + + + + + + + +
    FilterSourceRendered
    html filter +
    <div ng-bind-html="snippet">
    </div>
    +
    +
    +
    no filter
    <div ng-bind="snippet">
    </div>
    unsafe html filter
    <div ng-bind-html-unsafe="snippet">
    </div>
    +
    +
    + + it('should sanitize the html snippet ', function() { + expect(using('#html-filter').element('div').html()). + toBe('

    an html\nclick here\nsnippet

    '); + }); + + it('should escape snippet without any filter', function() { + expect(using('#escaped-html').element('div').html()). + toBe("<p style=\"color:blue\">an html\n" + + "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + + "snippet</p>"); + }); + + it('should inline raw snippet if filtered as unsafe', function() { + expect(using('#html-unsafe-filter').element("div").html()). + toBe("

    an html\n" + + "click here\n" + + "snippet

    "); + }); + + it('should update', function() { + input('snippet').enter('new text'); + expect(using('#html-filter').binding('snippet')).toBe('new text'); + expect(using('#escaped-html').element('div').html()).toBe("new <b>text</b>"); + expect(using('#html-unsafe-filter').binding("snippet")).toBe('new text'); + }); +
    +
    + */ +var $sanitize = function(html) { + var buf = []; + htmlParser(html, htmlSanitizeWriter(buf)); + return buf.join(''); +}; + + +// Regular Expressions for parsing tags and attributes +var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/, + END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/, + ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g, + BEGIN_TAG_REGEXP = /^/g, + CDATA_REGEXP = //g, + URI_REGEXP = /^((ftp|https?):\/\/|mailto:|tel:|#)/, + NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; // Match everything outside of normal chars and " (quote character) + + +// Good source of info about elements and attributes +// http://dev.w3.org/html5/spec/Overview.html#semantics +// http://simon.html5.org/html-elements + +// Safe Void Elements - HTML5 +// http://dev.w3.org/html5/spec/Overview.html#void-elements +var voidElements = makeMap("area,br,col,hr,img,wbr"); + +// Elements that you can, intentionally, leave open (and which close themselves) +// http://dev.w3.org/html5/spec/Overview.html#optional-tags +var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), + optionalEndTagInlineElements = makeMap("rp,rt"), + optionalEndTagElements = angular.extend({}, optionalEndTagInlineElements, optionalEndTagBlockElements); + +// Safe Block Elements - HTML5 +var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article,aside," + + "blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6," + + "header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")); + +// Inline Elements - HTML5 +var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b,bdi,bdo," + + "big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small," + + "span,strike,strong,sub,sup,time,tt,u,var")); + + +// Special Elements (can contain anything) +var specialElements = makeMap("script,style"); + +var validElements = angular.extend({}, voidElements, blockElements, inlineElements, optionalEndTagElements); + +//Attributes that have href and hence need to be sanitized +var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap"); +var validAttrs = angular.extend({}, uriAttrs, makeMap( + 'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+ + 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+ + 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+ + 'scope,scrolling,shape,span,start,summary,target,title,type,'+ + 'valign,value,vspace,width')); + +function makeMap(str) { + var obj = {}, items = str.split(','), i; + for (i = 0; i < items.length; i++) obj[items[i]] = true; + return obj; +} + + +/** + * @example + * htmlParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + * @param {string} html string + * @param {object} handler + */ +function htmlParser( html, handler ) { + var index, chars, match, stack = [], last = html; + stack.last = function() { return stack[ stack.length - 1 ]; }; + + while ( html ) { + chars = true; + + // Make sure we're not in a script or style element + if ( !stack.last() || !specialElements[ stack.last() ] ) { + + // Comment + if ( html.indexOf(""); + + if ( index >= 0 ) { + if (handler.comment) handler.comment( html.substring( 4, index ) ); + html = html.substring( index + 3 ); + chars = false; + } + + // end tag + } else if ( BEGING_END_TAGE_REGEXP.test(html) ) { + match = html.match( END_TAG_REGEXP ); + + if ( match ) { + html = html.substring( match[0].length ); + match[0].replace( END_TAG_REGEXP, parseEndTag ); + chars = false; + } + + // start tag + } else if ( BEGIN_TAG_REGEXP.test(html) ) { + match = html.match( START_TAG_REGEXP ); + + if ( match ) { + html = html.substring( match[0].length ); + match[0].replace( START_TAG_REGEXP, parseStartTag ); + chars = false; + } + } + + if ( chars ) { + index = html.indexOf("<"); + + var text = index < 0 ? html : html.substring( 0, index ); + html = index < 0 ? "" : html.substring( index ); + + if (handler.chars) handler.chars( decodeEntities(text) ); + } + + } else { + html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), function(all, text){ + text = text. + replace(COMMENT_REGEXP, "$1"). + replace(CDATA_REGEXP, "$1"); + + if (handler.chars) handler.chars( decodeEntities(text) ); + + return ""; + }); + + parseEndTag( "", stack.last() ); + } + + if ( html == last ) { + throw "Parse Error: " + html; + } + last = html; + } + + // Clean up any remaining tags + parseEndTag(); + + function parseStartTag( tag, tagName, rest, unary ) { + tagName = angular.lowercase(tagName); + if ( blockElements[ tagName ] ) { + while ( stack.last() && inlineElements[ stack.last() ] ) { + parseEndTag( "", stack.last() ); + } + } + + if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) { + parseEndTag( "", tagName ); + } + + unary = voidElements[ tagName ] || !!unary; + + if ( !unary ) + stack.push( tagName ); + + var attrs = {}; + + rest.replace(ATTR_REGEXP, function(match, name, doubleQuotedValue, singleQoutedValue, unqoutedValue) { + var value = doubleQuotedValue + || singleQoutedValue + || unqoutedValue + || ''; + + attrs[name] = decodeEntities(value); + }); + if (handler.start) handler.start( tagName, attrs, unary ); + } + + function parseEndTag( tag, tagName ) { + var pos = 0, i; + tagName = angular.lowercase(tagName); + if ( tagName ) + // Find the closest opened tag of the same type + for ( pos = stack.length - 1; pos >= 0; pos-- ) + if ( stack[ pos ] == tagName ) + break; + + if ( pos >= 0 ) { + // Close all the open elements, up the stack + for ( i = stack.length - 1; i >= pos; i-- ) + if (handler.end) handler.end( stack[ i ] ); + + // Remove the open elements from the stack + stack.length = pos; + } + } +} + +/** + * decodes all entities into regular string + * @param value + * @returns {string} A string with decoded entities. + */ +var hiddenPre=document.createElement("pre"); +function decodeEntities(value) { + hiddenPre.innerHTML=value.replace(//g, '>'); +} + +/** + * create an HTML/XML writer which writes to buffer + * @param {Array} buf use buf.jain('') to get out sanitized html string + * @returns {object} in the form of { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * } + */ +function htmlSanitizeWriter(buf){ + var ignore = false; + var out = angular.bind(buf, buf.push); + return { + start: function(tag, attrs, unary){ + tag = angular.lowercase(tag); + if (!ignore && specialElements[tag]) { + ignore = tag; + } + if (!ignore && validElements[tag] == true) { + out('<'); + out(tag); + angular.forEach(attrs, function(value, key){ + var lkey=angular.lowercase(key); + if (validAttrs[lkey]==true && (uriAttrs[lkey]!==true || value.match(URI_REGEXP))) { + out(' '); + out(key); + out('="'); + out(encodeEntities(value)); + out('"'); + } + }); + out(unary ? '/>' : '>'); + } + }, + end: function(tag){ + tag = angular.lowercase(tag); + if (!ignore && validElements[tag] == true) { + out(''); + } + if (tag == ignore) { + ignore = false; + } + }, + chars: function(chars){ + if (!ignore) { + out(encodeEntities(chars)); + } + } + }; +} + + +// define ngSanitize module and register $sanitize service +angular.module('ngSanitize', []).value('$sanitize', $sanitize); + +/** + * @ngdoc directive + * @name ngSanitize.directive:ngBindHtml + * + * @description + * Creates a binding that will sanitize the result of evaluating the `expression` with the + * {@link ngSanitize.$sanitize $sanitize} service and innerHTML the result into the current element. + * + * See {@link ngSanitize.$sanitize $sanitize} docs for examples. + * + * @element ANY + * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate. + */ +angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($sanitize) { + return function(scope, element, attr) { + element.addClass('ng-binding').data('$binding', attr.ngBindHtml); + scope.$watch(attr.ngBindHtml, function ngBindHtmlWatchAction(value) { + value = $sanitize(value); + element.html(value || ''); + }); + }; +}]); + +/** + * @ngdoc filter + * @name ngSanitize.filter:linky + * @function + * + * @description + * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and + * plain email address links. + * + * @param {string} text Input text. + * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in. + * @returns {string} Html-linkified text. + * + * @usage + + * + * @example + + + +
    + Snippet: + + + + + + + + + + + + + + + + + + + + + +
    FilterSourceRendered
    linky filter +
    <div ng-bind-html="snippet | linky">
    </div>
    +
    +
    +
    linky target +
    <div ng-bind-html="snippetWithTarget | linky:'_blank'">
    </div>
    +
    +
    +
    no filter
    <div ng-bind="snippet">
    </div>
    + + + it('should linkify the snippet with urls', function() { + expect(using('#linky-filter').binding('snippet | linky')). + toBe('Pretty text with some links: ' + + 'http://angularjs.org/, ' + + 'us@somewhere.org, ' + + 'another@somewhere.org, ' + + 'and one more: ftp://127.0.0.1/.'); + }); + + it ('should not linkify snippet without the linky filter', function() { + expect(using('#escaped-html').binding('snippet')). + toBe("Pretty text with some links:\n" + + "http://angularjs.org/,\n" + + "mailto:us@somewhere.org,\n" + + "another@somewhere.org,\n" + + "and one more: ftp://127.0.0.1/."); + }); + + it('should update', function() { + input('snippet').enter('new http://link.'); + expect(using('#linky-filter').binding('snippet | linky')). + toBe('new http://link.'); + expect(using('#escaped-html').binding('snippet')).toBe('new http://link.'); + }); + + it('should work with the target property', function() { + expect(using('#linky-target').binding("snippetWithTarget | linky:'_blank'")). + toBe('http://angularjs.org/'); + }); + + + */ +angular.module('ngSanitize').filter('linky', function() { + var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/, + MAILTO_REGEXP = /^mailto:/; + + return function(text, target) { + if (!text) return text; + var match; + var raw = text; + var html = []; + // TODO(vojta): use $sanitize instead + var writer = htmlSanitizeWriter(html); + var url; + var i; + var properties = {}; + if (angular.isDefined(target)) { + properties.target = target; + } + while ((match = raw.match(LINKY_URL_REGEXP))) { + // We can not end in these as they are sometimes found at the end of the sentence + url = match[0]; + // if we did not match ftp/http/mailto then assume mailto + if (match[2] == match[3]) url = 'mailto:' + url; + i = match.index; + writer.chars(raw.substr(0, i)); + properties.href = url; + writer.start('a', properties); + writer.chars(match[0].replace(MAILTO_REGEXP, '')); + writer.end('a'); + raw = raw.substring(i + match[0].length); + } + writer.chars(raw); + return html.join(''); + }; +}); + + +})(window, window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.min.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.min.js new file mode 100644 index 00000000..593c4ef6 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-sanitize.min.js @@ -0,0 +1,13 @@ +/* + AngularJS v1.1.5 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(I,h){'use strict';function i(a){var d={},a=a.split(","),c;for(c=0;c=0;c--)if(e[c]==b)break;if(c>=0){for(g=e.length-1;g>=c;g--)d.end&&d.end(e[g]);e.length= +c}}var b,f,e=[],j=a;for(e.last=function(){return e[e.length-1]};a;){f=!0;if(!e.last()||!q[e.last()]){if(a.indexOf("<\!--")===0)b=a.indexOf("--\>"),b>=0&&(d.comment&&d.comment(a.substring(4,b)),a=a.substring(b+3),f=!1);else if(B.test(a)){if(b=a.match(r))a=a.substring(b[0].length),b[0].replace(r,g),f=!1}else if(C.test(a)&&(b=a.match(s)))a=a.substring(b[0].length),b[0].replace(s,c),f=!1;f&&(b=a.indexOf("<"),f=b<0?a:a.substring(0,b),a=b<0?"":a.substring(b),d.chars&&d.chars(k(f)))}else a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+ +e.last()+"[^>]*>","i"),function(a,b){b=b.replace(D,"$1").replace(E,"$1");d.chars&&d.chars(k(b));return""}),g("",e.last());if(a==j)throw"Parse Error: "+a;j=a}g()}function k(a){l.innerHTML=a.replace(//g,">")}function u(a){var d=!1,c=h.bind(a,a.push);return{start:function(a,b,f){a=h.lowercase(a);!d&&q[a]&&(d=a);!d&&v[a]== +!0&&(c("<"),c(a),h.forEach(b,function(a,b){var d=h.lowercase(b);if(G[d]==!0&&(w[d]!==!0||a.match(H)))c(" "),c(b),c('="'),c(t(a)),c('"')}),c(f?"/>":">"))},end:function(a){a=h.lowercase(a);!d&&v[a]==!0&&(c(""));a==d&&(d=!1)},chars:function(a){d||c(t(a))}}}var s=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,r=/^<\s*\/\s*([\w:-]+)[^>]*>/,A=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,C=/^/g, +E=//g,H=/^((ftp|https?):\/\/|mailto:|tel:|#)/,F=/([^\#-~| |!])/g,p=i("area,br,col,hr,img,wbr"),x=i("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),y=i("rp,rt"),o=h.extend({},y,x),m=h.extend({},x,i("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),n=h.extend({},y,i("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")), +q=i("script,style"),v=h.extend({},p,m,n,o),w=i("background,cite,href,longdesc,src,usemap"),G=h.extend({},w,i("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,span,start,summary,target,title,type,valign,value,vspace,width")),l=document.createElement("pre");h.module("ngSanitize",[]).value("$sanitize",function(a){var d=[]; +z(a,u(d));return d.join("")});h.module("ngSanitize").directive("ngBindHtml",["$sanitize",function(a){return function(d,c,g){c.addClass("ng-binding").data("$binding",g.ngBindHtml);d.$watch(g.ngBindHtml,function(b){b=a(b);c.html(b||"")})}}]);h.module("ngSanitize").filter("linky",function(){var a=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/,d=/^mailto:/;return function(c,g){if(!c)return c;var b,f=c,e=[],j=u(e),i,k,l={};if(h.isDefined(g))l.target=g;for(;b=f.match(a);)i= +b[0],b[2]==b[3]&&(i="mailto:"+i),k=b.index,j.chars(f.substr(0,k)),l.href=i,j.start("a",l),j.chars(b[0].replace(d,"")),j.end("a"),f=f.substring(k+b[0].length);j.chars(f);return e.join("")}})})(window,window.angular); diff --git a/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-scenario.js b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-scenario.js new file mode 100644 index 00000000..3ead0033 --- /dev/null +++ b/OurUmbraco.Site/umbraco/lib/angular/1.1.5/angular-scenario.js @@ -0,0 +1,28463 @@ +/*! + * jQuery JavaScript Library v1.8.2 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time) + */ +(function( window, undefined ) { +'use strict'; +var + // A central reference to the root jQuery(document) + rootjQuery, + + // The deferred used on DOM ready + readyList, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, + navigator = window.navigator, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // Save a reference to some core methods + core_push = Array.prototype.push, + core_slice = Array.prototype.slice, + core_indexOf = Array.prototype.indexOf, + core_toString = Object.prototype.toString, + core_hasOwn = Object.prototype.hasOwnProperty, + core_trim = String.prototype.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, + + // Used for detecting and trimming whitespace + core_rnotwhite = /\S/, + core_rspace = /\s+/, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // The ready event handler and self cleanup method + DOMContentLoaded = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + } else if ( document.readyState === "complete" ) { + // we're here because readyState === "complete" in oldIE + // which is good enough for us to call the dom ready! + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context && context.nodeType ? context.ownerDocument || context : document ); + + // scripts is true for back-compat + selector = jQuery.parseHTML( match[1], doc, true ); + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + this.attr.call( selector, context, true ); + } + + return jQuery.merge( this, selector ); + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.8.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return core_slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( core_slice.apply( this, arguments ), + "slice", core_slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: core_push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ core_toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || core_hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // scripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, scripts ) { + var parsed; + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + scripts = context; + context = 0; + } + context = context || document; + + // Single tag + if ( (parsed = rsingleTag.exec( data )) ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] ); + return jQuery.merge( [], + (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes ); + }, + + parseJSON: function( data ) { + if ( !data || typeof data !== "string") { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && core_rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var name, + i = 0, + length = obj.length, + isObj = length === undefined || jQuery.isFunction( obj ); + + if ( args ) { + if ( isObj ) { + for ( name in obj ) { + if ( callback.apply( obj[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( obj[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in obj ) { + if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + core_trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var type, + ret = results || []; + + if ( arr != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + type = jQuery.type( arr ); + + if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) { + core_push.call( ret, arr ); + } else { + jQuery.merge( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var l = second.length, + i = first.length, + j = 0; + + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var retVal, + ret = [], + i = 0, + length = elems.length; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, + ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context, args.concat( core_slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + // Multifunctional method to get and set values of a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, pass ) { + var exec, + bulk = key == null, + i = 0, + length = elems.length; + + // Sets many values + if ( key && typeof key === "object" ) { + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); + } + chainable = 1; + + // Sets one value + } else if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = pass === undefined && jQuery.isFunction( value ); + + if ( bulk ) { + // Bulk operations only iterate when executing function values + if ( exec ) { + exec = fn; + fn = function( elem, key, value ) { + return exec.call( jQuery( elem ), value ); + }; + + // Otherwise they run against the entire set + } else { + fn.call( elems, value ); + fn = null; + } + } + + if ( fn ) { + for (; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + } + + chainable = 1; + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + } +}); + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready, 1 ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.split( core_rspace ), function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) { + list.push( arg ); + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + return jQuery.inArray( fn, list ) > -1; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? + function() { + var returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + } : + newDefer[ action ] + ); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] = list.fire + deferred[ tuple[0] ] = list.fire; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + fragment, + eventName, + i, + isSupported, + clickFn, + div = document.createElement("div"); + + // Preliminary tests + div.setAttribute( "className", "t" ); + div.innerHTML = "
    a"; + + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + a.style.cssText = "top:1px;float:left;opacity:.5"; + + // Can't get basic test support + if ( !all || !all.length ) { + return {}; + } + + // First batch of supports tests + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.5/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: ( document.compatMode === "CSS1Compat" ), + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + boxSizingReliable: true, + pixelPosition: false + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", clickFn = function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent("onclick"); + div.detachEvent( "onclick", clickFn ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + input.setAttribute( "checked", "checked" ); + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for ( i in { + submit: true, + change: true, + focusin: true + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + // Run tests that need a body at doc ready + jQuery(function() { + var container, div, tds, marginDiv, + divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + container = document.createElement("div"); + container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "
    t
    "; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // NOTE: To any future maintainer, we've window.getComputedStyle + // because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = document.createElement("div"); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + } + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.innerHTML = ""; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = "block"; + div.style.overflow = "visible"; + div.innerHTML = "
    "; + div.firstChild.style.width = "5px"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + + container.style.zoom = 1; + } + + // Null elements to avoid leaks in IE + body.removeChild( container ); + container = div = tds = marginDiv = null; + }); + + // Null elements to avoid leaks in IE + fragment.removeChild( div ); + all = a = select = opt = input = fragment = div = null; + + return support; +})(); +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + deletedIds: [], + + // Remove at next major release (1.9/2.0) + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; + + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, part, attr, name, l, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attr = elem.attributes; + for ( l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( !name.indexOf( "data-" ) ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split( ".", 2 ); + parts[1] = parts[1] ? "." + parts[1] : ""; + part = parts[1] + "!"; + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + data = this.triggerHandler( "getData" + part, [ parts[0] ] ); + + // Try to fetch any internally stored data first + if ( data === undefined && elem ) { + data = jQuery.data( elem, key ); + data = dataAttr( elem, key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } + + parts[1] = value; + this.each(function() { + var self = jQuery( this ); + + self.triggerHandler( "setData" + part, parts ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + part, parts ); + }); + }, null, value, arguments.length > 1, null, false ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery.removeData( elem, type + "queue", true ); + jQuery.removeData( elem, key, true ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var nodeHook, boolHook, fixSpecified, + rclass = /[\t\r\n]/g, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea|)$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( core_rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var removes, className, elem, c, cl, i, l; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + if ( (value && typeof value === "string") || value === undefined ) { + removes = ( value || "" ).split( core_rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + if ( elem.nodeType === 1 && elem.className ) { + + className = (" " + elem.className + " ").replace( rclass, " " ); + + // loop over each item in the removal list + for ( c = 0, cl = removes.length; c < cl; c++ ) { + // Remove until there is nothing to remove, + while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) { + className = className.replace( " " + removes[ c ] + " " , " " ); + } + } + elem.className = value ? jQuery.trim( className ) : ""; + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( core_rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val, + self = jQuery(this); + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9 + attrFn: {}, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, isBool, + i = 0; + + if ( value && elem.nodeType === 1 ) { + + attrNames = value.split( core_rspace ); + + for ( ; i < attrNames.length; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + isBool = rboolean.test( name ); + + // See #9699 for explanation of this approach (setting first, then removal) + // Do not do this for boolean attributes (see #10870) + if ( !isBool ) { + jQuery.attr( elem, name, "" ); + } + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( isBool && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true, + coords: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ? + ret.value : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.value = value + "" ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, + rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var t, tns, type, origType, namespaces, origCount, + j, events, special, eventType, handleObj, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, "events", true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, + type = event.type || event, + namespaces = []; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + for ( old = elem; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old === (elem.ownerDocument || document) ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, + handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = core_slice.call( arguments ), + run_all = !event.exclusive && !event.namespace, + special = jQuery.event.special[ event.type ] || {}, + handlerQueue = []; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers that should run if there are delegated events + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !(event.button && event.type === "click") ) { + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + + // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { + selMatch = {}; + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) + event.metaKey = !!event.metaKey; + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 – + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "_submit_attached" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "_submit_attached", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "_change_attached", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { // && selector != null + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +(function( window, undefined ) { + +var cachedruns, + assertGetIdNotName, + Expr, + getText, + isXML, + contains, + compile, + sortOrder, + hasDuplicate, + outermostContext, + + baseHasDuplicate = true, + strundefined = "undefined", + + expando = ( "sizcache" + Math.random() ).replace( ".", "" ), + + Token = String, + document = window.document, + docElem = document.documentElement, + dirruns = 0, + done = 0, + pop = [].pop, + push = [].push, + slice = [].slice, + // Use a stripped-down indexOf if a native one is unavailable + indexOf = [].indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + // Augment a function for special use by Sizzle + markFunction = function( fn, value ) { + fn[ expando ] = value == null || value; + return fn; + }, + + createCache = function() { + var cache = {}, + keys = []; + + return markFunction(function( key, value ) { + // Only keep the most recent entries + if ( keys.push( key ) > Expr.cacheLength ) { + delete cache[ keys.shift() ]; + } + + return (cache[ key ] = value); + }, cache ); + }, + + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + + // Regex + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments not in parens/brackets, + // then attribute selectors and non-pseudos (denoted by :), + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)", + + // For matchExpr.POS and matchExpr.needsContext + pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, + + rnot = /^:not/, + rsibling = /[\x20\t\r\n\f]*[+~]/, + rendsWithNot = /:not\($/, + + rheader = /h\d/i, + rinputs = /input|select|textarea|button/i, + + rbackslash = /\\(?!\\)/g, + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "POS": new RegExp( pos, "i" ), + "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" ) + }, + + // Support + + // Used for testing something on an element + assert = function( fn ) { + var div = document.createElement("div"); + + try { + return fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } + }, + + // Check if getElementsByTagName("*") returns only elements + assertTagNameNoComments = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }), + + // Check if getAttribute returns normalized href attributes + assertHrefNotNormalized = assert(function( div ) { + div.innerHTML = ""; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }), + + // Check if attributes should be retrieved by attribute nodes + assertAttributes = assert(function( div ) { + div.innerHTML = ""; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }), + + // Check if getElementsByClassName can be trusted + assertUsableClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = ""; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }), + + // Check if getElementById returns elements by name + // Check if getElementsByName privileges form controls or returns elements by ID + assertUsableName = assert(function( div ) { + // Inject content + div.id = expando + 0; + div.innerHTML = "
    "; + docElem.insertBefore( div, docElem.firstChild ); + + // Test + var pass = document.getElementsByName && + // buggy browsers will return fewer than the correct 2 + document.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + document.getElementsByName( expando + 0 ).length; + assertGetIdNotName = !document.getElementById( expando ); + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + +// If slice is not available, provide a backup +try { + slice.call( docElem.childNodes, 0 )[0].nodeType; +} catch ( e ) { + slice = function( i ) { + var elem, + results = []; + for ( ; (elem = this[i]); i++ ) { + results.push( elem ); + } + return results; + }; +} + +function Sizzle( selector, context, results, seed ) { + results = results || []; + context = context || document; + var match, elem, xml, m, + nodeType = context.nodeType; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( nodeType !== 1 && nodeType !== 9 ) { + return []; + } + + xml = isXML( context ); + + if ( !xml && !seed ) { + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) { + push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); + return results; + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed, xml ); +} + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + return Sizzle( expr, null, null, [ elem ] ).length > 0; +}; + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + } else { + + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } + return ret; +}; + +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +// Element contains another +contains = Sizzle.contains = docElem.contains ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) ); + } : + docElem.compareDocumentPosition ? + function( a, b ) { + return b && !!( a.compareDocumentPosition( b ) & 16 ); + } : + function( a, b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + return false; + }; + +Sizzle.attr = function( elem, name ) { + var val, + xml = isXML( elem ); + + if ( !xml ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( xml || assertAttributes ) { + return elem.getAttribute( name ); + } + val = elem.getAttributeNode( name ); + return val ? + typeof elem[ name ] === "boolean" ? + elem[ name ] ? name : null : + val.specified ? val.value : null : + null; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + // IE6/7 return a modified href + attrHandle: assertHrefNotNormalized ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }, + + find: { + "ID": assertGetIdNotName ? + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + } : + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }, + + "TAG": assertTagNameNoComments ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + var elem, + tmp = [], + i = 0; + + for ( ; (elem = results[i]); i++ ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }, + + "NAME": assertUsableName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }, + + "CLASS": assertUsableClassName && function( className, context, xml ) { + if ( typeof context.getElementsByClassName !== strundefined && !xml ) { + return context.getElementsByClassName( className ); + } + } + }, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( rbackslash, "" ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 3 xn-component of xn+y argument ([+-]?\d*n|) + 4 sign of xn-component + 5 x of xn-component + 6 sign of y-component + 7 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1] === "nth" ) { + // nth-child requires argument + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) ); + match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" ); + + // other types prohibit arguments + } else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var unquoted, excess; + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + if ( match[3] ) { + match[2] = match[3]; + } else if ( (unquoted = match[4]) ) { + // Only check arguments that contain a pseudo + if ( rpseudo.test(unquoted) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + unquoted = unquoted.slice( 0, excess ); + match[0] = match[0].slice( 0, excess ); + } + match[2] = unquoted; + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + "ID": assertGetIdNotName ? + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + return elem.getAttribute("id") === id; + }; + } : + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === id; + }; + }, + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + nodeName = nodeName.replace( rbackslash, "" ).toLowerCase(); + + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ expando ][ className ]; + if ( !pattern ) { + pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") ); + } + return function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }; + }, + + "ATTR": function( name, operator, check ) { + return function( elem, context ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.substr( result.length - check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, argument, first, last ) { + + if ( type === "nth" ) { + return function( elem ) { + var node, diff, + parent = elem.parentNode; + + if ( first === 1 && last === 0 ) { + return true; + } + + if ( parent ) { + diff = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + diff++; + if ( elem === node ) { + break; + } + } + } + } + + // Incorporate the offset (or cast to NaN), then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + }; + } + + return function( elem ) { + var node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + /* falls through */ + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + var nodeType; + elem = elem.firstChild; + while ( elem ) { + if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) { + return false; + } + elem = elem.nextSibling; + } + return true; + }, + + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "text": function( elem ) { + var type, attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + (type = elem.type) === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type ); + }, + + // Input types + "radio": createInputPseudo("radio"), + "checkbox": createInputPseudo("checkbox"), + "file": createInputPseudo("file"), + "password": createInputPseudo("password"), + "image": createInputPseudo("image"), + + "submit": createButtonPseudo("submit"), + "reset": createButtonPseudo("reset"), + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "focus": function( elem ) { + var doc = elem.ownerDocument; + return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href); + }, + + "active": function( elem ) { + return elem === elem.ownerDocument.activeElement; + }, + + // Positional types + "first": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 0; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 1; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +function siblingCheck( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; +} + +sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + return ( !a.compareDocumentPosition || !b.compareDocumentPosition ? + a.compareDocumentPosition : + a.compareDocumentPosition(b) & 4 + ) ? -1 : 1; + } : + function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + +// Always assume the presence of duplicates if sort doesn't +// pass them to our comparison function (as in Google Chrome). +[0, 0].sort( sortOrder ); +baseHasDuplicate = !hasDuplicate; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + i = 1; + + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + + return results; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, soFar, groups, preFilters, + cached = tokenCache[ expando ][ selector ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + soFar = soFar.slice( match[0].length ); + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + + // Cast descendant combinators to space + matched.type = match[0].replace( rtrim, " " ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + // The last two arguments here are (context, xml) for backCompat + (match = preFilters[ type ]( match, document, true ))) ) { + + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + matched.type = type; + matched.matches = match; + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && combinator.dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( !xml ) { + var cache, + dirkey = dirruns + " " + doneName + " ", + cachedkey = dirkey + cachedruns; + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( (cache = elem[ expando ]) === cachedkey ) { + return elem.sizset; + } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) { + if ( elem.sizset ) { + return elem; + } + } else { + elem[ expando ] = cachedkey; + if ( matcher( elem, context, xml ) ) { + elem.sizset = true; + return elem; + } + elem.sizset = false; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( matcher( elem, context, xml ) ) { + return elem; + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones + if ( seed && postFinder ) { + return; + } + + var i, elem, postFilterIn, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + postFilterIn = condense( matcherOut, postMap ); + postFilter( postFilterIn, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = postFilterIn.length; + while ( i-- ) { + if ( (elem = postFilterIn[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + // Keep seed and results synchronized + if ( seed ) { + // Ignore postFinder because it can't coexist with seed + i = preFilter && matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + seed[ preMap[i] ] = !(results[ preMap[i] ] = elem); + } + } + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + // The concatenated values are (context, xml) for backCompat + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && tokens.join("") + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Nested matchers should use non-integer dirruns + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = superMatcher.el; + } + + // Add elements passing elementMatchers directly to results + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + for ( j = 0; (matcher = elementMatchers[j]); j++ ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++superMatcher.el; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + for ( j = 0; (matcher = setMatchers[j]); j++ ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + superMatcher.el = 0; + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ expando ][ selector ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results, seed ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results, seed ); + } + return results; +} + +function select( selector, context, results, seed, xml ) { + var i, tokens, token, type, find, + match = tokenize( selector ), + j = match.length; + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && !xml && + Expr.relative[ tokens[1].type ] ) { + + context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().length ); + } + + // Fetch a seed set for right-to-left matching + for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( rbackslash, "" ), + rsibling.test( tokens[0].type ) && context.parentNode || context, + xml + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && tokens.join(""); + if ( !selector ) { + push.apply( results, slice.call( seed, 0 ) ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + xml, + results, + rsibling.test( selector ) + ); + return results; +} + +if ( document.querySelectorAll ) { + (function() { + var disconnectedMatch, + oldSelect = select, + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // qSa(:focus) reports false when true (Chrome 21), + // A support test would require too much code (would include document ready) + rbuggyQSA = [":focus"], + + // matchesSelector(:focus) reports false when true (Chrome 21), + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + // A support test would require too much code (would include document ready) + // just skip matchesSelector for :active + rbuggyMatches = [ ":active", ":focus" ], + matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector; + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explictly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = ""; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here (do not put tests after this one) + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE9 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = "

    "; + if ( div.querySelectorAll("[test^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here (do not put tests after this one) + div.innerHTML = ""; + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push(":enabled", ":disabled"); + } + }); + + // rbuggyQSA always contains :focus, so no need for a length check + rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") ); + + select = function( selector, context, results, seed, xml ) { + // Only use querySelectorAll when not filtering, + // when this is not xml, + // and when no QSA bugs apply + if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + var groups, i, + old = true, + nid = expando, + newContext = context, + newSelector = context.nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + groups[i].join(""); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, slice.call( newContext.querySelectorAll( + newSelector + ), 0 ) ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + + return oldSelect( selector, context, results, seed, xml ); + }; + + if ( matches ) { + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + try { + matches.call( div, "[test!='']:sizzle" ); + rbuggyMatches.push( "!=", pseudos ); + } catch ( e ) {} + }); + + // rbuggyMatches always contains :active and :focus, so no need for a length check + rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") ); + + Sizzle.matchesSelector = function( elem, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyMatches always contains :active, so no need for an existence check + if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, null, null, [ elem ] ).length > 0; + }; + } + })(); +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Back-compat +function setFilters() {} +Expr.filters = setFilters.prototype = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})( window ); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, + isSimple = /^.[^:#\[\.,]*$/, + rneedsContext = jQuery.expr.match.needsContext, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var i, l, length, n, r, ret, + self = this; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + ret = this.pushStack( "", "find", selector ); + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + rneedsContext.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + cur = this[i]; + + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + } + cur = cur.parentNode; + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +jQuery.fn.andSelf = jQuery.fn.addBack; + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( this.length > 1 && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, core_slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /]", "i"), + rcheckableType = /^(?:checkbox|radio)$/, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /\/(java|ecma)script/i, + rcleanScript = /^\s*\s*$/g, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
    ", "
    " ], + thead: [ 1, "", "
    " ], + tr: [ 2, "", "
    " ], + td: [ 3, "", "
    " ], + col: [ 2, "", "
    " ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, +// unless wrapped in a div with non-breaking characters in front of it. +if ( !jQuery.support.htmlSerialize ) { + wrapMap._default = [ 1, "X
    ", "
    " ]; +} + +jQuery.fn.extend({ + text: function( value ) { + return jQuery.access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + }, + + append: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { + this.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { + this.insertBefore( elem, this.firstChild ); + } + }); + }, + + before: function() { + if ( !isDisconnected( this[0] ) ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this ); + }); + } + + if ( arguments.length ) { + var set = jQuery.clean( arguments ); + return this.pushStack( jQuery.merge( set, this ), "before", this.selector ); + } + }, + + after: function() { + if ( !isDisconnected( this[0] ) ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + } + + if ( arguments.length ) { + var set = jQuery.clean( arguments ); + return this.pushStack( jQuery.merge( this, set ), "after", this.selector ); + } + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + jQuery.cleanData( [ elem ] ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function () { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return jQuery.access( this, function( value ) { + var elem = this[0] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName( "*" ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function( value ) { + if ( !isDisconnected( this[0] ) ) { + // Make sure that the elements are removed from the DOM before they are inserted + // this can help fix replacing a parent with child elements + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this), old = self.html(); + self.replaceWith( value.call( this, i, old ) ); + }); + } + + if ( typeof value !== "string" ) { + value = jQuery( value ).detach(); + } + + return this.each(function() { + var next = this.nextSibling, + parent = this.parentNode; + + jQuery( this ).remove(); + + if ( next ) { + jQuery(next).before( value ); + } else { + jQuery(parent).append( value ); + } + }); + } + + return this.length ? + this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : + this; + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, table, callback ) { + + // Flatten any nested arrays + args = [].concat.apply( [], args ); + + var results, first, fragment, iNoClone, + i = 0, + value = args[0], + scripts = [], + l = this.length; + + // We can't cloneNode fragments that contain checked, in WebKit + if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) { + return this.each(function() { + jQuery(this).domManip( args, table, callback ); + }); + } + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + args[0] = value.call( this, i, table ? self.html() : undefined ); + self.domManip( args, table, callback ); + }); + } + + if ( this[0] ) { + results = jQuery.buildFragment( args, this, scripts ); + fragment = results.fragment; + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + table = table && jQuery.nodeName( first, "tr" ); + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + // Fragments from the fragment cache must always be cloned and never used in place. + for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) { + callback.call( + table && jQuery.nodeName( this[i], "table" ) ? + findOrAppend( this[i], "tbody" ) : + this[i], + i === iNoClone ? + fragment : + jQuery.clone( fragment, true, true ) + ); + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + + if ( scripts.length ) { + jQuery.each( scripts, function( i, elem ) { + if ( elem.src ) { + if ( jQuery.ajax ) { + jQuery.ajax({ + url: elem.src, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } else { + jQuery.error("no ajax"); + } + } else { + jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + }); + } + } + + return this; + } +}); + +function findOrAppend( elem, tag ) { + return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function cloneFixAttributes( src, dest ) { + var nodeName; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + // clearAttributes removes the attributes, which we don't want, + // but also removes the attachEvent events, which we *do* want + if ( dest.clearAttributes ) { + dest.clearAttributes(); + } + + // mergeAttributes, in contrast, only merges back on the + // original attributes, not the events + if ( dest.mergeAttributes ) { + dest.mergeAttributes( src ); + } + + nodeName = dest.nodeName.toLowerCase(); + + if ( nodeName === "object" ) { + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + + // IE blanks contents when cloning scripts + } else if ( nodeName === "script" && dest.text !== src.text ) { + dest.text = src.text; + } + + // Event data gets referenced instead of copied if the expando + // gets copied too + dest.removeAttribute( jQuery.expando ); +} + +jQuery.buildFragment = function( args, context, scripts ) { + var fragment, cacheable, cachehit, + first = args[ 0 ]; + + // Set context from what may come in as undefined or a jQuery collection or a node + // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 & + // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception + context = context || document; + context = !context.nodeType && context[0] || context; + context = context.ownerDocument || context; + + // Only cache "small" (1/2 KB) HTML strings that are associated with the main document + // Cloning options loses the selected state, so don't cache them + // IE 6 doesn't like it when you put or elements in a fragment + // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache + // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 + if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document && + first.charAt(0) === "<" && !rnocache.test( first ) && + (jQuery.support.checkClone || !rchecked.test( first )) && + (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { + + // Mark cacheable and look for a hit + cacheable = true; + fragment = jQuery.fragments[ first ]; + cachehit = fragment !== undefined; + } + + if ( !fragment ) { + fragment = context.createDocumentFragment(); + jQuery.clean( args, context, fragment, scripts ); + + // Update the cache, but only store false + // unless this is a second parsing of the same content + if ( cacheable ) { + jQuery.fragments[ first ] = cachehit && fragment; + } + } + + return { fragment: fragment, cacheable: cacheable }; +}; + +jQuery.fragments = {}; + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + l = insert.length, + parent = this.length === 1 && this[0].parentNode; + + if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) { + insert[ original ]( this[0] ); + return this; + } else { + for ( ; i < l; i++ ) { + elems = ( i > 0 ? this.clone(true) : this ).get(); + jQuery( insert[i] )[ original ]( elems ); + ret = ret.concat( elems ); + } + + return this.pushStack( ret, name, insert.selector ); + } + }; +}); + +function getAll( elem ) { + if ( typeof elem.getElementsByTagName !== "undefined" ) { + return elem.getElementsByTagName( "*" ); + + } else if ( typeof elem.querySelectorAll !== "undefined" ) { + return elem.querySelectorAll( "*" ); + + } else { + return []; + } +} + +// Used in clean, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var srcElements, + destElements, + i, + clone; + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + // IE copies events bound via attachEvent when using cloneNode. + // Calling detachEvent on the clone will also remove the events + // from the original. In order to get around this, we use some + // proprietary methods to clear the events. Thanks to MooTools + // guys for this hotness. + + cloneFixAttributes( elem, clone ); + + // Using Sizzle here is crazy slow, so we use getElementsByTagName instead + srcElements = getAll( elem ); + destElements = getAll( clone ); + + // Weird iteration because IE will replace the length property + // with an element if you are cloning the body and one of the + // elements on the page has a name or id of "length" + for ( i = 0; srcElements[i]; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + cloneFixAttributes( srcElements[i], destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + cloneCopyEvent( elem, clone ); + + if ( deepDataAndEvents ) { + srcElements = getAll( elem ); + destElements = getAll( clone ); + + for ( i = 0; srcElements[i]; ++i ) { + cloneCopyEvent( srcElements[i], destElements[i] ); + } + } + } + + srcElements = destElements = null; + + // Return the cloned set + return clone; + }, + + clean: function( elems, context, fragment, scripts ) { + var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags, + safe = context === document && safeFragment, + ret = []; + + // Ensure that context is a document + if ( !context || typeof context.createDocumentFragment === "undefined" ) { + context = document; + } + + // Use the already-created safe fragment if context permits + for ( i = 0; (elem = elems[i]) != null; i++ ) { + if ( typeof elem === "number" ) { + elem += ""; + } + + if ( !elem ) { + continue; + } + + // Convert html string into DOM nodes + if ( typeof elem === "string" ) { + if ( !rhtml.test( elem ) ) { + elem = context.createTextNode( elem ); + } else { + // Ensure a safe container in which to render the html + safe = safe || createSafeFragment( context ); + div = context.createElement("div"); + safe.appendChild( div ); + + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(rxhtmlTag, "<$1>"); + + // Go to html and back, then peel off extra wrappers + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + depth = wrap[0]; + div.innerHTML = wrap[1] + elem + wrap[2]; + + // Move to the right depth + while ( depth-- ) { + div = div.lastChild; + } + + // Remove IE's autoinserted from table fragments + if ( !jQuery.support.tbody ) { + + // String was a , *may* have spurious + hasBody = rtbody.test(elem); + tbody = tag === "table" && !hasBody ? + div.firstChild && div.firstChild.childNodes : + + // String was a bare or + wrap[1] === "
    " && !hasBody ? + div.childNodes : + []; + + for ( j = tbody.length - 1; j >= 0 ; --j ) { + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { + tbody[ j ].parentNode.removeChild( tbody[ j ] ); + } + } + } + + // IE completely kills leading whitespace when innerHTML is used + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); + } + + elem = div.childNodes; + + // Take out of fragment container (we need a fresh div each time) + div.parentNode.removeChild( div ); + } + } + + if ( elem.nodeType ) { + ret.push( elem ); + } else { + jQuery.merge( ret, elem ); + } + } + + // Fix #11356: Clear elements from safeFragment + if ( div ) { + elem = div = safe = null; + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + for ( i = 0; (elem = ret[i]) != null; i++ ) { + if ( jQuery.nodeName( elem, "input" ) ) { + fixDefaultChecked( elem ); + } else if ( typeof elem.getElementsByTagName !== "undefined" ) { + jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); + } + } + } + + // Append elements to a provided document fragment + if ( fragment ) { + // Special handling of each script element + handleScript = function( elem ) { + // Check if we consider it executable + if ( !elem.type || rscriptType.test( elem.type ) ) { + // Detach the script and store it in the scripts array (if provided) or the fragment + // Return truthy to indicate that it has been handled + return scripts ? + scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : + fragment.appendChild( elem ); + } + }; + + for ( i = 0; (elem = ret[i]) != null; i++ ) { + // Check if we're done after handling an executable script + if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { + // Append to fragment and handle embedded scripts + fragment.appendChild( elem ); + if ( typeof elem.getElementsByTagName !== "undefined" ) { + // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration + jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); + + // Splice the scripts into ret after their former ancestor and advance our index beyond them + ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); + i += jsTags.length; + } + } + } + } + + return ret; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var data, id, elem, type, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + jQuery.deletedIds.push( id ); + } + } + } + } + } +}); +// Limit scope pollution from any deprecated API +(function() { + +var matched, browser; + +// Use of jQuery.browser is frowned upon. +// More details: http://api.jquery.com/jQuery.browser +// jQuery.uaMatch maintained for back-compat +jQuery.uaMatch = function( ua ) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; +}; + +matched = jQuery.uaMatch( navigator.userAgent ); +browser = {}; + +if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; +} + +// Chrome is Webkit, but Webkit is also Safari. +if ( browser.chrome ) { + browser.webkit = true; +} else if ( browser.webkit ) { + browser.safari = true; +} + +jQuery.browser = browser; + +jQuery.sub = function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; +}; + +})(); +var curCSS, iframe, iframeDoc, + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity=([^)]*)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), + elemdisplay = {}, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], + + eventsToggle = jQuery.fn.toggle; + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var elem, display, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + values[ index ] = jQuery._data( elem, "olddisplay" ); + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && elem.style.display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else { + display = curCSS( elem, "display" ); + + if ( !values[ index ] && display !== "none" ) { + jQuery._data( elem, "olddisplay", display ); + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state, fn2 ) { + var bool = typeof state === "boolean"; + + if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) { + return eventsToggle.apply( this, arguments ); + } + + return this.each(function() { + if ( bool ? state : isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + + } + } + } + }, + + // Exclude the following css properties to add px + cssNumber: { + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that NaN and null values aren't set. See: #7116 + if ( value == null || type === "number" && isNaN( value ) ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, numeric, extra ) { + var val, num, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( numeric || extra !== undefined ) { + num = parseFloat( val ); + return numeric || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; + } +}); + +// NOTE: To any future maintainer, we've window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + curCSS = function( elem, name ) { + var ret, width, minWidth, maxWidth, + computed = window.getComputedStyle( elem, null ), + style = elem.style; + + if ( computed ) { + + ret = computed[ name ]; + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret; + }; +} else if ( document.documentElement.currentStyle ) { + curCSS = function( elem, name ) { + var left, rsLeft, + ret = elem.currentStyle && elem.currentStyle[ name ], + style = elem.style; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + elem.runtimeStyle.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + elem.runtimeStyle.left = rsLeft; + } + } + + return ret === "" ? "auto" : ret; + }; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + // we use jQuery.css instead of curCSS here + // because of the reliableMarginRight CSS hook! + val += jQuery.css( elem, extra + cssExpand[ i ], true ); + } + + // From this point on we use curCSS for maximum performance (relevant in animations) + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } else { + // at this point, extra isn't content, so add padding + val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + valueIsBorderBox = true, + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox + ) + ) + "px"; +} + + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + if ( elemdisplay[ nodeName ] ) { + return elemdisplay[ nodeName ]; + } + + var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), + display = elem.css("display"); + elem.remove(); + + // If the simple way fails, + // get element's real default display by attaching it to a temp iframe + if ( display === "none" || display === "" ) { + // Use the already-created iframe if possible + iframe = document.body.appendChild( + iframe || jQuery.extend( document.createElement("iframe"), { + frameBorder: 0, + width: 0, + height: 0 + }) + ); + + // Create a cacheable copy of the iframe document on first call. + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML + // document to it; WebKit & Firefox won't allow reusing the iframe document. + if ( !iframeDoc || !iframe.createElement ) { + iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; + iframeDoc.write(""); + iframeDoc.close(); + } + + elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); + + display = curCSS( elem, "display" ); + document.body.removeChild( iframe ); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + + return display; +} + +jQuery.each([ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + // certain elements can have dimension info if we invisibly show them + // however, it must have a current display style that would benefit from this + if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) { + return jQuery.swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + }); + } else { + return getWidthOrHeight( elem, name, extra ); + } + } + }, + + set: function( elem, value, extra ) { + return setPositiveNumber( elem, value, extra ? + augmentWidthOrHeight( + elem, + name, + extra, + jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box" + ) : 0 + ); + } + }; +}); + +if ( !jQuery.support.opacity ) { + jQuery.cssHooks.opacity = { + get: function( elem, computed ) { + // IE uses filters for opacity + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : + computed ? "1" : ""; + }, + + set: function( elem, value ) { + var style = elem.style, + currentStyle = elem.currentStyle, + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", + filter = currentStyle && currentStyle.filter || style.filter || ""; + + // IE has trouble with opacity if it does not have layout + // Force it by setting the zoom level + style.zoom = 1; + + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 + if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && + style.removeAttribute ) { + + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText + // if "filter:" is present at all, clearType is disabled, we want to avoid this + // style.removeAttribute is IE Only, but so apparently is this code path... + style.removeAttribute( "filter" ); + + // if there there is no filter style applied in a css rule, we are done + if ( currentStyle && !currentStyle.filter ) { + return; + } + } + + // otherwise, set new filter values + style.filter = ralpha.test( filter ) ? + filter.replace( ralpha, opacity ) : + filter + " " + opacity; + } + }; +} + +// These hooks cannot be added until DOM ready because the support test +// for it is not run until after DOM ready +jQuery(function() { + if ( !jQuery.support.reliableMarginRight ) { + jQuery.cssHooks.marginRight = { + get: function( elem, computed ) { + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Work around by temporarily setting element display to inline-block + return jQuery.swap( elem, { "display": "inline-block" }, function() { + if ( computed ) { + return curCSS( elem, "marginRight" ); + } + }); + } + }; + } + + // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 + // getComputedStyle returns percent when specified for top/left/bottom/right + // rather than make the css module depend on the offset module, we just check for it here + if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { + jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = { + get: function( elem, computed ) { + if ( computed ) { + var ret = curCSS( elem, prop ); + // if curCSS returns percentage, fallback to offset + return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret; + } + } + }; + }); + } + +}); + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.hidden = function( elem ) { + return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none"); + }; + + jQuery.expr.filters.visible = function( elem ) { + return !jQuery.expr.filters.hidden( elem ); + }; +} + +// These hooks are used by animate to expand properties +jQuery.each({ + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i, + + // assumes a single number if not a string + parts = typeof value === "string" ? value.split(" ") : [ value ], + expanded = {}; + + for ( i = 0; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +}); +var r20 = /%20/g, + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, + rselectTextarea = /^(?:select|textarea)/i; + +jQuery.fn.extend({ + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map(function(){ + return this.elements ? jQuery.makeArray( this.elements ) : this; + }) + .filter(function(){ + return this.name && !this.disabled && + ( this.checked || rselectTextarea.test( this.nodeName ) || + rinput.test( this.type ) ); + }) + .map(function( i, elem ){ + var val = jQuery( this ).val(); + + return val == null ? + null : + jQuery.isArray( val ) ? + jQuery.map( val, function( val, i ){ + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }) : + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }).get(); + } +}); + +//Serialize an array of form elements or a set of +//key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ).replace( r20, "+" ); +}; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( jQuery.isArray( obj ) ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // If array item is non-scalar (array or object), encode its + // numeric index to resolve deserialization ambiguity issues. + // Note that rack (as of 1.0.0) can't currently deserialize + // nested arrays properly, and attempting to do so may cause + // a server error. Possible fixes are to modify rack's + // deserialization algorithm or to provide an option or flag + // to force array serialization to be shallow. + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} +var + // Document location + ajaxLocParts, + ajaxLocation, + + rhash = /#.*$/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + rquery = /\?/, + rscript = /)<[^<]*)*<\/script>/gi, + rts = /([?&])_=[^&]*/, + rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, + + // Keep a copy of the old load method + _load = jQuery.fn.load, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = ["*/"] + ["*"]; + +// #8138, IE may throw an exception when accessing +// a field from window.location if document.domain has been set +try { + ajaxLocation = location.href; +} catch( e ) { + // Use the href attribute of an A element + // since IE will modify it given document.location + ajaxLocation = document.createElement( "a" ); + ajaxLocation.href = ""; + ajaxLocation = ajaxLocation.href; +} + +// Segment location into parts +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, list, placeBefore, + dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ), + i = 0, + length = dataTypes.length; + + if ( jQuery.isFunction( func ) ) { + // For each dataType in the dataTypeExpression + for ( ; i < length; i++ ) { + dataType = dataTypes[ i ]; + // We control if we're asked to add before + // any existing element + placeBefore = /^\+/.test( dataType ); + if ( placeBefore ) { + dataType = dataType.substr( 1 ) || "*"; + } + list = structure[ dataType ] = structure[ dataType ] || []; + // then we add to the structure accordingly + list[ placeBefore ? "unshift" : "push" ]( func ); + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, + dataType /* internal */, inspected /* internal */ ) { + + dataType = dataType || options.dataTypes[ 0 ]; + inspected = inspected || {}; + + inspected[ dataType ] = true; + + var selection, + list = structure[ dataType ], + i = 0, + length = list ? list.length : 0, + executeOnly = ( structure === prefilters ); + + for ( ; i < length && ( executeOnly || !selection ); i++ ) { + selection = list[ i ]( options, originalOptions, jqXHR ); + // If we got redirected to another dataType + // we try there if executing only and not done already + if ( typeof selection === "string" ) { + if ( !executeOnly || inspected[ selection ] ) { + selection = undefined; + } else { + options.dataTypes.unshift( selection ); + selection = inspectPrefiltersOrTransports( + structure, options, originalOptions, jqXHR, selection, inspected ); + } + } + } + // If we're only executing or nothing was selected + // we try the catchall dataType if not done already + if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { + selection = inspectPrefiltersOrTransports( + structure, options, originalOptions, jqXHR, "*", inspected ); + } + // unnecessary when only executing (prefilters) + // but it'll be ignored by the caller in that case + return selection; +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } +} + +jQuery.fn.load = function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + } + + // Don't do a request if no elements are being requested + if ( !this.length ) { + return this; + } + + var selector, type, response, + self = this, + off = url.indexOf(" "); + + if ( off >= 0 ) { + selector = url.slice( off, url.length ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // Request the remote document + jQuery.ajax({ + url: url, + + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params, + complete: function( jqXHR, status ) { + if ( callback ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); + } + } + }).done(function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + // See if a selector was specified + self.html( selector ? + + // Create a dummy div to hold the results + jQuery("
    ") + + // inject the contents of the document in, removing the scripts + // to avoid any 'Permission Denied' errors in IE + .append( responseText.replace( rscript, "" ) ) + + // Locate the specified elements + .find( selector ) : + + // If not, just inject the full result + responseText ); + + }); + + return this; +}; + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ + jQuery.fn[ o ] = function( f ){ + return this.on( o, f ); + }; +}); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + // shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + return jQuery.ajax({ + type: method, + url: url, + data: data, + success: callback, + dataType: type + }); + }; +}); + +jQuery.extend({ + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + if ( settings ) { + // Building a settings object + ajaxExtend( target, jQuery.ajaxSettings ); + } else { + // Extending ajaxSettings + settings = target; + target = jQuery.ajaxSettings; + } + ajaxExtend( target, settings ); + return target; + }, + + ajaxSettings: { + url: ajaxLocation, + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), + global: true, + type: "GET", + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + processData: true, + async: true, + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + xml: "application/xml, text/xml", + html: "text/html", + text: "text/plain", + json: "application/json, text/javascript", + "*": allTypes + }, + + contents: { + xml: /xml/, + html: /html/, + json: /json/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText" + }, + + // List of data converters + // 1) key format is "source_type destination_type" (a single space in-between) + // 2) the catchall symbol "*" can be used for source_type + converters: { + + // Convert anything to text + "* text": window.String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": jQuery.parseJSON, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + context: true, + url: true + } + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var // ifModified key + ifModifiedKey, + // Response headers + responseHeadersString, + responseHeaders, + // transport + transport, + // timeout handle + timeoutTimer, + // Cross-domain detection vars + parts, + // To know if global events are to be dispatched + fireGlobals, + // Loop variable + i, + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + // Callbacks context + callbackContext = s.context || s, + // Context for global events + // It's the callbackContext if one was provided in the options + // and if it's a DOM node or a jQuery collection + globalEventContext = callbackContext !== s && + ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? + jQuery( callbackContext ) : jQuery.event, + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + // Status-dependent callbacks + statusCode = s.statusCode || {}, + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + // The jqXHR state + state = 0, + // Default abort message + strAbort = "canceled", + // Fake xhr + jqXHR = { + + readyState: 0, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( !state ) { + var lname = name.toLowerCase(); + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Raw string + getAllResponseHeaders: function() { + return state === 2 ? responseHeadersString : null; + }, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( state === 2 ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match === undefined ? null : match; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( !state ) { + s.mimeType = type; + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + statusText = statusText || strAbort; + if ( transport ) { + transport.abort( statusText ); + } + done( 0, statusText ); + return this; + } + }; + + // Callback for when everything is done + // It is defined here because jslint complains if it is declared + // at the end of the function (which would be more logical and readable) + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Called once + if ( state === 2 ) { + return; + } + + // State is "done" now + state = 2; + + // Clear timeout if it exists + if ( timeoutTimer ) { + clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // If successful, handle type chaining + if ( status >= 200 && status < 300 || status === 304 ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ ifModifiedKey ] = modified; + } + modified = jqXHR.getResponseHeader("Etag"); + if ( modified ) { + jQuery.etag[ ifModifiedKey ] = modified; + } + } + + // If not modified + if ( status === 304 ) { + + statusText = "notmodified"; + isSuccess = true; + + // If we have data + } else { + + isSuccess = ajaxConvert( s, response ); + statusText = isSuccess.state; + success = isSuccess.data; + error = isSuccess.error; + isSuccess = !error; + } + } else { + // We extract error from statusText + // then normalize statusText and status for non-aborts + error = statusText; + if ( !statusText || status ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + // Attach deferreds + deferred.promise( jqXHR ); + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; + jqXHR.complete = completeDeferred.add; + + // Status-dependent callbacks + jqXHR.statusCode = function( map ) { + if ( map ) { + var tmp; + if ( state < 2 ) { + for ( tmp in map ) { + statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; + } + } else { + tmp = map[ jqXHR.status ]; + jqXHR.always( tmp ); + } + } + return this; + }; + + // Remove hash character (#7531: and string promotion) + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) + // We also use the url parameter if available + s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); + + // Extract dataTypes list + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace ); + + // A cross-domain request is in order when we have a protocol:host:port mismatch + if ( s.crossDomain == null ) { + parts = rurl.exec( s.url.toLowerCase() ) || false; + s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !== + ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ); + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( state === 2 ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + fireGlobals = s.global; + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // If data is available, append data to url + if ( s.data ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Get ifModifiedKey before adding the anti-cache parameter + ifModifiedKey = s.url; + + // Add anti-cache in url if needed + if ( s.cache === false ) { + + var ts = jQuery.now(), + // try replacing _= if it is there + ret = s.url.replace( rts, "$1_=" + ts ); + + // if nothing was replaced, add timestamp to the end + s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + ifModifiedKey = ifModifiedKey || s.url; + if ( jQuery.lastModified[ ifModifiedKey ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); + } + if ( jQuery.etag[ ifModifiedKey ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); + } + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { + // Abort if not done already and return + return jqXHR.abort(); + + } + + // aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = setTimeout( function(){ + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + state = 1; + transport.send( requestHeaders, done ); + } catch (e) { + // Propagate exception as error if not done + if ( state < 2 ) { + done( -1, e ); + // Simply rethrow otherwise + } else { + throw e; + } + } + } + + return jqXHR; + }, + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {} + +}); + +/* Handles responses to an ajax request: + * - sets all responseXXX fields accordingly + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes, + responseFields = s.responseFields; + + // Fill responseXXX fields + for ( type in responseFields ) { + if ( type in responses ) { + jqXHR[ responseFields[type] ] = responses[ type ]; + } + } + + // Remove auto dataType and get content-type in the process + while( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +// Chain conversions given the request and the original response +function ajaxConvert( s, response ) { + + var conv, conv2, current, tmp, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(), + prev = dataTypes[ 0 ], + converters = {}, + i = 0; + + // Apply the dataFilter if provided + if ( s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + // Convert to each sequential dataType, tolerating list modification + for ( ; (current = dataTypes[++i]); ) { + + // There's only work to do if current dataType is non-auto + if ( current !== "*" ) { + + // Convert response if prev dataType is non-auto and differs from current + if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split(" "); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.splice( i--, 0, current ); + } + + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s["throws"] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + + // Update prev for next iteration + prev = current; + } + } + + return { state: "success", data: response }; +} +var oldCallbacks = [], + rquestion = /\?/, + rjsonp = /(=)\?(?=&|$)|\?\?/, + nonce = jQuery.now(); + +// Default jsonp settings +jQuery.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +}); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + data = s.data, + url = s.url, + hasCallback = s.jsonp !== false, + replaceInUrl = hasCallback && rjsonp.test( url ), + replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && + !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && + rjsonp.test( data ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + overwritten = window[ callbackName ]; + + // Insert callback into url or form data + if ( replaceInUrl ) { + s.url = url.replace( rjsonp, "$1" + callbackName ); + } else if ( replaceInData ) { + s.data = data.replace( rjsonp, "$1" + callbackName ); + } else if ( hasCallback ) { + s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters["script json"] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); +// Install script dataType +jQuery.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /javascript|ecmascript/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +}); + +// Handle cache's special case and global +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + s.global = false; + } +}); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function(s) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + + var script, + head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; + + return { + + send: function( _, callback ) { + + script = document.createElement( "script" ); + + script.async = "async"; + + if ( s.scriptCharset ) { + script.charset = s.scriptCharset; + } + + script.src = s.url; + + // Attach handlers for all browsers + script.onload = script.onreadystatechange = function( _, isAbort ) { + + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + + // Remove the script + if ( head && script.parentNode ) { + head.removeChild( script ); + } + + // Dereference the script + script = undefined; + + // Callback if not abort + if ( !isAbort ) { + callback( 200, "success" ); + } + } + }; + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709 and #4378). + head.insertBefore( script, head.firstChild ); + }, + + abort: function() { + if ( script ) { + script.onload( 0, 1 ); + } + } + }; + } +}); +var xhrCallbacks, + // #5280: Internet Explorer will keep connections alive if we don't abort on unload + xhrOnUnloadAbort = window.ActiveXObject ? function() { + // Abort all pending requests + for ( var key in xhrCallbacks ) { + xhrCallbacks[ key ]( 0, 1 ); + } + } : false, + xhrId = 0; + +// Functions to create xhrs +function createStandardXHR() { + try { + return new window.XMLHttpRequest(); + } catch( e ) {} +} + +function createActiveXHR() { + try { + return new window.ActiveXObject( "Microsoft.XMLHTTP" ); + } catch( e ) {} +} + +// Create the request object +// (This is still attached to ajaxSettings for backward compatibility) +jQuery.ajaxSettings.xhr = window.ActiveXObject ? + /* Microsoft failed to properly + * implement the XMLHttpRequest in IE7 (can't request local files), + * so we use the ActiveXObject when it is available + * Additionally XMLHttpRequest can be disabled in IE7/IE8 so + * we need a fallback. + */ + function() { + return !this.isLocal && createStandardXHR() || createActiveXHR(); + } : + // For all other browsers, use the standard XMLHttpRequest object + createStandardXHR; + +// Determine support properties +(function( xhr ) { + jQuery.extend( jQuery.support, { + ajax: !!xhr, + cors: !!xhr && ( "withCredentials" in xhr ) + }); +})( jQuery.ajaxSettings.xhr() ); + +// Create transport if the browser can provide an xhr +if ( jQuery.support.ajax ) { + + jQuery.ajaxTransport(function( s ) { + // Cross domain only allowed if supported through XMLHttpRequest + if ( !s.crossDomain || jQuery.support.cors ) { + + var callback; + + return { + send: function( headers, complete ) { + + // Get a new xhr + var handle, i, + xhr = s.xhr(); + + // Open the socket + // Passing null username, generates a login popup on Opera (#2865) + if ( s.username ) { + xhr.open( s.type, s.url, s.async, s.username, s.password ); + } else { + xhr.open( s.type, s.url, s.async ); + } + + // Apply custom fields if provided + if ( s.xhrFields ) { + for ( i in s.xhrFields ) { + xhr[ i ] = s.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( s.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( s.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !s.crossDomain && !headers["X-Requested-With"] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Need an extra try/catch for cross domain requests in Firefox 3 + try { + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + } catch( _ ) {} + + // Do send the request + // This may raise an exception which is actually + // handled in jQuery.ajax (so no try/catch here) + xhr.send( ( s.hasContent && s.data ) || null ); + + // Listener + callback = function( _, isAbort ) { + + var status, + statusText, + responseHeaders, + responses, + xml; + + // Firefox throws exceptions when accessing properties + // of an xhr when a network error occurred + // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) + try { + + // Was never called and is aborted or complete + if ( callback && ( isAbort || xhr.readyState === 4 ) ) { + + // Only called once + callback = undefined; + + // Do not keep as active anymore + if ( handle ) { + xhr.onreadystatechange = jQuery.noop; + if ( xhrOnUnloadAbort ) { + delete xhrCallbacks[ handle ]; + } + } + + // If it's an abort + if ( isAbort ) { + // Abort it manually if needed + if ( xhr.readyState !== 4 ) { + xhr.abort(); + } + } else { + status = xhr.status; + responseHeaders = xhr.getAllResponseHeaders(); + responses = {}; + xml = xhr.responseXML; + + // Construct response list + if ( xml && xml.documentElement /* #4958 */ ) { + responses.xml = xml; + } + + // When requesting binary data, IE6-9 will throw an exception + // on any attempt to access responseText (#11426) + try { + responses.text = xhr.responseText; + } catch( _ ) { + } + + // Firefox throws an exception when accessing + // statusText for faulty cross-domain requests + try { + statusText = xhr.statusText; + } catch( e ) { + // We normalize with Webkit giving an empty statusText + statusText = ""; + } + + // Filter status for non standard behaviors + + // If the request is local and we have data: assume a success + // (success with no data won't get notified, that's the best we + // can do given current implementations) + if ( !status && s.isLocal && !s.crossDomain ) { + status = responses.text ? 200 : 404; + // IE - #1450: sometimes returns 1223 when it should be 204 + } else if ( status === 1223 ) { + status = 204; + } + } + } + } catch( firefoxAccessException ) { + if ( !isAbort ) { + complete( -1, firefoxAccessException ); + } + } + + // Call complete if needed + if ( responses ) { + complete( status, statusText, responses, responseHeaders ); + } + }; + + if ( !s.async ) { + // if we're in sync mode we fire the callback + callback(); + } else if ( xhr.readyState === 4 ) { + // (IE6 & IE7) if it's in cache and has been + // retrieved directly we need to fire the callback + setTimeout( callback, 0 ); + } else { + handle = ++xhrId; + if ( xhrOnUnloadAbort ) { + // Create the active xhrs callbacks list if needed + // and attach the unload handler + if ( !xhrCallbacks ) { + xhrCallbacks = {}; + jQuery( window ).unload( xhrOnUnloadAbort ); + } + // Add to list of active xhrs callbacks + xhrCallbacks[ handle ] = callback; + } + xhr.onreadystatechange = callback; + } + }, + + abort: function() { + if ( callback ) { + callback(0,1); + } + } + }; + } + }); +} +var fxNow, timerId, + rfxtypes = /^(?:toggle|show|hide)$/, + rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), + rrun = /queueHooks$/, + animationPrefilters = [ defaultPrefilter ], + tweeners = { + "*": [function( prop, value ) { + var end, unit, + tween = this.createTween( prop, value ), + parts = rfxnum.exec( value ), + target = tween.cur(), + start = +target || 0, + scale = 1, + maxIterations = 20; + + if ( parts ) { + end = +parts[2]; + unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + + // We need to compute starting value + if ( unit !== "px" && start ) { + // Iteratively approximate from a nonzero starting point + // Prefer the current property, because this process will be trivial if it uses the same units + // Fallback to end or a simple constant + start = jQuery.css( tween.elem, prop, true ) || end || 1; + + do { + // If previous iteration zeroed out, double until we get *something* + // Use a string for doubling factor so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + start = start / scale; + jQuery.style( tween.elem, prop, start + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); + } + + tween.unit = unit; + tween.start = start; + // If a +=/-= token was provided, we're doing a relative animation + tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; + } + return tween; + }] + }; + +// Animations created synchronously will run synchronously +function createFxNow() { + setTimeout(function() { + fxNow = undefined; + }, 0 ); + return ( fxNow = jQuery.now() ); +} + +function createTweens( animation, props ) { + jQuery.each( props, function( prop, value ) { + var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( collection[ index ].call( animation, prop, value ) ) { + + // we're done with this property + return; + } + } + }); +} + +function Animation( elem, properties, options ) { + var result, + index = 0, + tweenerIndex = 0, + length = animationPrefilters.length, + deferred = jQuery.Deferred().always( function() { + // don't match elem in the :animated selector + delete tick.elem; + }), + tick = function() { + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + percent = 1 - ( remaining / animation.duration || 0 ), + index = 0, + length = animation.tweens.length; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ]); + + if ( percent < 1 && length ) { + return remaining; + } else { + deferred.resolveWith( elem, [ animation ] ); + return false; + } + }, + animation = deferred.promise({ + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { specialEasing: {} }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end, easing ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + // if we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // resolve when we played the last frame + // otherwise, reject + if ( gotoEnd ) { + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + }), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length ; index++ ) { + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + return result; + } + } + + createTweens( animation, props ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + jQuery.fx.timer( + jQuery.extend( tick, { + anim: animation, + queue: animation.opts.queue, + elem: elem + }) + ); + + // attach callbacks from options + return animation.progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( jQuery.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'index' from above because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.split(" "); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length ; index++ ) { + prop = props[ index ]; + tweeners[ prop ] = tweeners[ prop ] || []; + tweeners[ prop ].unshift( callback ); + } + }, + + prefilter: function( callback, prepend ) { + if ( prepend ) { + animationPrefilters.unshift( callback ); + } else { + animationPrefilters.push( callback ); + } + } +}); + +function defaultPrefilter( elem, props, opts ) { + var index, prop, value, length, dataShow, tween, hooks, oldfire, + anim = this, + style = elem.style, + orig = {}, + handled = [], + hidden = elem.nodeType && isHidden( elem ); + + // handle queue: false promises + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always(function() { + // doing this makes sure that the complete handler will be called + // before this completes + anim.always(function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + }); + }); + } + + // height/width overflow pass + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height animated + if ( jQuery.css( elem, "display" ) === "inline" && + jQuery.css( elem, "float" ) === "none" ) { + + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { + style.display = "inline-block"; + + } else { + style.zoom = 1; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + if ( !jQuery.support.shrinkWrapBlocks ) { + anim.done(function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + }); + } + } + + + // show/hide pass + for ( index in props ) { + value = props[ index ]; + if ( rfxtypes.exec( value ) ) { + delete props[ index ]; + if ( value === ( hidden ? "hide" : "show" ) ) { + continue; + } + handled.push( index ); + } + } + + length = handled.length; + if ( length ) { + dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); + if ( hidden ) { + jQuery( elem ).show(); + } else { + anim.done(function() { + jQuery( elem ).hide(); + }); + } + anim.done(function() { + var prop; + jQuery.removeData( elem, "fxshow", true ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + }); + for ( index = 0 ; index < length ; index++ ) { + prop = handled[ index ]; + tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); + orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); + + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = tween.start; + if ( hidden ) { + tween.end = tween.start; + tween.start = prop === "width" || prop === "height" ? 1 : 0; + } + } + } + } +} + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || "swing"; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + if ( tween.elem[ tween.prop ] != null && + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + return tween.elem[ tween.prop ]; + } + + // passing any value as a 4th parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails + // so, simple values such as "10px" are parsed to Float. + // complex values such as "rotate(1rad)" are returned as is. + result = jQuery.css( tween.elem, tween.prop, false, "" ); + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + // use step hook for back compat - use cssHook if its there - use .style if its + // available and use plain properties where available + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Remove in 2.0 - this supports IE8's panic based approach +// to setting things on disconnected nodes + +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" || + // special check for .toggle( handler, handler, ... ) + ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +}); + +jQuery.fn.extend({ + fadeTo: function( speed, to, easing, callback ) { + + // show any hidden elements after setting opacity to 0 + return this.filter( isHidden ).css( "opacity", 0 ).show() + + // animate to the value specified + .end().animate({ opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations resolve immediately + if ( empty ) { + anim.stop( true ); + } + }; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each(function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = jQuery._data( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // start the next in the queue if the last step wasn't forced + // timers currently will call their complete callbacks, which will dequeue + // but only if they were gotoEnd + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + }); + } +}); + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + attrs = { height: type }, + i = 0; + + // if we include width, step value is 1 to do all cssExpand values, + // if we don't include width, step value is 2 to skip over Left and Right + includeWidth = includeWidth? 1 : 0; + for( ; i < 4 ; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show"), + slideUp: genFx("hide"), + slideToggle: genFx("toggle"), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +}); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; + + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p*Math.PI ) / 2; + } +}; + +jQuery.timers = []; +jQuery.fx = Tween.prototype.init; +jQuery.fx.tick = function() { + var timer, + timers = jQuery.timers, + i = 0; + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + // Checks the timer has not already been removed + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } +}; + +jQuery.fx.timer = function( timer ) { + if ( timer() && jQuery.timers.push( timer ) && !timerId ) { + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); + } +}; + +jQuery.fx.interval = 13; + +jQuery.fx.stop = function() { + clearInterval( timerId ); + timerId = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + // Default speed + _default: 400 +}; + +// Back Compat <1.8 extension point +jQuery.fx.step = {}; + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.animated = function( elem ) { + return jQuery.grep(jQuery.timers, function( fn ) { + return elem === fn.elem; + }).length; + }; +} +var rroot = /^(?:body|html)$/i; + +jQuery.fn.offset = function( options ) { + if ( arguments.length ) { + return options === undefined ? + this : + this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, + box = { top: 0, left: 0 }, + elem = this[ 0 ], + doc = elem && elem.ownerDocument; + + if ( !doc ) { + return; + } + + if ( (body = doc.body) === elem ) { + return jQuery.offset.bodyOffset( elem ); + } + + docElem = doc.documentElement; + + // Make sure it's not a disconnected DOM node + if ( !jQuery.contains( docElem, elem ) ) { + return box; + } + + // If we don't have gBCR, just use 0,0 rather than error + // BlackBerry 5, iOS 3 (original iPhone) + if ( typeof elem.getBoundingClientRect !== "undefined" ) { + box = elem.getBoundingClientRect(); + } + win = getWindow( doc ); + clientTop = docElem.clientTop || body.clientTop || 0; + clientLeft = docElem.clientLeft || body.clientLeft || 0; + scrollTop = win.pageYOffset || docElem.scrollTop; + scrollLeft = win.pageXOffset || docElem.scrollLeft; + return { + top: box.top + scrollTop - clientTop, + left: box.left + scrollLeft - clientLeft + }; +}; + +jQuery.offset = { + + bodyOffset: function( body ) { + var top = body.offsetTop, + left = body.offsetLeft; + + if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { + top += parseFloat( jQuery.css(body, "marginTop") ) || 0; + left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; + } + + return { top: top, left: left }; + }, + + setOffset: function( elem, options, i ) { + var position = jQuery.css( elem, "position" ); + + // set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + var curElem = jQuery( elem ), + curOffset = curElem.offset(), + curCSSTop = jQuery.css( elem, "top" ), + curCSSLeft = jQuery.css( elem, "left" ), + calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, + props = {}, curPosition = {}, curTop, curLeft; + + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( jQuery.isFunction( options ) ) { + options = options.call( elem, i, curOffset ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + } +}; + + +jQuery.fn.extend({ + + position: function() { + if ( !this[0] ) { + return; + } + + var elem = this[0], + + // Get *real* offsetParent + offsetParent = this.offsetParent(), + + // Get correct offsets + offset = this.offset(), + parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; + offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; + + // Add offsetParent borders + parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; + parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + }, + + offsetParent: function() { + return this.map(function() { + var offsetParent = this.offsetParent || document.body; + while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent || document.body; + }); + } +}); + + +// Create scrollLeft and scrollTop methods +jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { + var top = /Y/.test( prop ); + + jQuery.fn[ method ] = function( val ) { + return jQuery.access( this, function( elem, method, val ) { + var win = getWindow( elem ); + + if ( val === undefined ) { + return win ? (prop in win) ? win[ prop ] : + win.document.documentElement[ method ] : + elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : jQuery( win ).scrollLeft(), + top ? val : jQuery( win ).scrollTop() + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length, null ); + }; +}); + +function getWindow( elem ) { + return jQuery.isWindow( elem ) ? + elem : + elem.nodeType === 9 ? + elem.defaultView || elem.parentWindow : + false; +} +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return jQuery.access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there + // isn't a whole lot we can do. See pull request at this URL for discussion: + // https://github.com/jquery/jquery/pull/764 + return elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, value, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable, null ); + }; + }); +}); +// Expose jQuery to the global object +window.jQuery = window.$ = jQuery; + +// Expose jQuery as an AMD module, but only for AMD loaders that +// understand the issues with loading multiple versions of jQuery +// in a page that all might call define(). The loader will indicate +// they have special allowances for multiple jQuery versions by +// specifying define.amd.jQuery = true. Register as a named module, +// since jQuery can be concatenated with other files that may use define, +// but not use a proper concatenation script that understands anonymous +// AMD modules. A named AMD is safest and most robust way to register. +// Lowercase jquery is used because AMD module names are derived from +// file names, and jQuery is normally delivered in a lowercase file name. +// Do this after creating the global so that if an AMD module wants to call +// noConflict to hide this version of jQuery, it will work. +if ( typeof define === "function" && define.amd && define.amd.jQuery ) { + define( "jquery", [], function () { return jQuery; } ); +} + +})( window ); + +/** + * @license AngularJS v1.1.5 + * (c) 2010-2012 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, document){ + var _jQuery = window.jQuery.noConflict(true); + +//////////////////////////////////// + +/** + * @ngdoc function + * @name angular.lowercase + * @function + * + * @description Converts the specified string to lowercase. + * @param {string} string String to be converted to lowercase. + * @returns {string} Lowercased string. + */ +var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;}; + + +/** + * @ngdoc function + * @name angular.uppercase + * @function + * + * @description Converts the specified string to uppercase. + * @param {string} string String to be converted to uppercase. + * @returns {string} Uppercased string. + */ +var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;}; + + +var manualLowercase = function(s) { + return isString(s) + ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) + : s; +}; +var manualUppercase = function(s) { + return isString(s) + ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) + : s; +}; + + +// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish +// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods +// with correct but slower alternatives. +if ('i' !== 'I'.toLowerCase()) { + lowercase = manualLowercase; + uppercase = manualUppercase; +} + + +var /** holds major version number for IE or NaN for real browsers */ + msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]), + jqLite, // delay binding since jQuery could be loaded after us. + jQuery, // delay binding + slice = [].slice, + push = [].push, + toString = Object.prototype.toString, + + + _angular = window.angular, + /** @name angular */ + angular = window.angular || (window.angular = {}), + angularModule, + nodeName_, + uid = ['0', '0', '0']; + +/** + * @ngdoc function + * @name angular.noConflict + * @function + * + * @description + * Restores the previous global value of angular and returns the current instance. Other libraries may already use the + * angular namespace. Or a previous version of angular is already loaded on the page. In these cases you may want to + * restore the previous namespace and keep a reference to angular. + * + * @return {Object} The current angular namespace + */ +function noConflict() { + var a = window.angular; + window.angular = _angular; + return a; +} + +/** + * @private + * @param {*} obj + * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...) + */ +function isArrayLike(obj) { + if (!obj || (typeof obj.length !== 'number')) return false; + + // We have on object which has length property. Should we treat it as array? + if (typeof obj.hasOwnProperty != 'function' && + typeof obj.constructor != 'function') { + // This is here for IE8: it is a bogus object treat it as array; + return true; + } else { + return obj instanceof JQLite || // JQLite + (jQuery && obj instanceof jQuery) || // jQuery + toString.call(obj) !== '[object Object]' || // some browser native object + typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj) + } +} + +/** + * @ngdoc function + * @name angular.forEach + * @function + * + * @description + * Invokes the `iterator` function once for each item in `obj` collection, which can be either an + * object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value` + * is the value of an object property or an array element and `key` is the object property key or + * array element index. Specifying a `context` for the function is optional. + * + * Note: this function was previously known as `angular.foreach`. + * +
    +     var values = {name: 'misko', gender: 'male'};
    +     var log = [];
    +     angular.forEach(values, function(value, key){
    +       this.push(key + ': ' + value);
    +     }, log);
    +     expect(log).toEqual(['name: misko', 'gender:male']);
    +   
    + * + * @param {Object|Array} obj Object to iterate over. + * @param {Function} iterator Iterator function. + * @param {Object=} context Object to become context (`this`) for the iterator function. + * @returns {Object|Array} Reference to `obj`. + */ +function forEach(obj, iterator, context) { + var key; + if (obj) { + if (isFunction(obj)){ + for (key in obj) { + if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) { + iterator.call(context, obj[key], key); + } + } + } else if (obj.forEach && obj.forEach !== forEach) { + obj.forEach(iterator, context); + } else if (isArrayLike(obj)) { + for (key = 0; key < obj.length; key++) + iterator.call(context, obj[key], key); + } else { + for (key in obj) { + if (obj.hasOwnProperty(key)) { + iterator.call(context, obj[key], key); + } + } + } + } + return obj; +} + +function sortedKeys(obj) { + var keys = []; + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + keys.push(key); + } + } + return keys.sort(); +} + +function forEachSorted(obj, iterator, context) { + var keys = sortedKeys(obj); + for ( var i = 0; i < keys.length; i++) { + iterator.call(context, obj[keys[i]], keys[i]); + } + return keys; +} + + +/** + * when using forEach the params are value, key, but it is often useful to have key, value. + * @param {function(string, *)} iteratorFn + * @returns {function(*, string)} + */ +function reverseParams(iteratorFn) { + return function(value, key) { iteratorFn(key, value) }; +} + +/** + * A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric + * characters such as '012ABC'. The reason why we are not using simply a number counter is that + * the number string gets longer over time, and it can also overflow, where as the nextId + * will grow much slower, it is a string, and it will never overflow. + * + * @returns an unique alpha-numeric string + */ +function nextUid() { + var index = uid.length; + var digit; + + while(index) { + index--; + digit = uid[index].charCodeAt(0); + if (digit == 57 /*'9'*/) { + uid[index] = 'A'; + return uid.join(''); + } + if (digit == 90 /*'Z'*/) { + uid[index] = '0'; + } else { + uid[index] = String.fromCharCode(digit + 1); + return uid.join(''); + } + } + uid.unshift('0'); + return uid.join(''); +} + + +/** + * Set or clear the hashkey for an object. + * @param obj object + * @param h the hashkey (!truthy to delete the hashkey) + */ +function setHashKey(obj, h) { + if (h) { + obj.$$hashKey = h; + } + else { + delete obj.$$hashKey; + } +} + +/** + * @ngdoc function + * @name angular.extend + * @function + * + * @description + * Extends the destination object `dst` by copying all of the properties from the `src` object(s) + * to `dst`. You can specify multiple `src` objects. + * + * @param {Object} dst Destination object. + * @param {...Object} src Source object(s). + * @returns {Object} Reference to `dst`. + */ +function extend(dst) { + var h = dst.$$hashKey; + forEach(arguments, function(obj){ + if (obj !== dst) { + forEach(obj, function(value, key){ + dst[key] = value; + }); + } + }); + + setHashKey(dst,h); + return dst; +} + +function int(str) { + return parseInt(str, 10); +} + + +function inherit(parent, extra) { + return extend(new (extend(function() {}, {prototype:parent}))(), extra); +} + +var START_SPACE = /^\s*/; +var END_SPACE = /\s*$/; +function stripWhitespace(str) { + return isString(str) ? str.replace(START_SPACE, '').replace(END_SPACE, '') : str; +} + +/** + * @ngdoc function + * @name angular.noop + * @function + * + * @description + * A function that performs no operations. This function can be useful when writing code in the + * functional style. +
    +     function foo(callback) {
    +       var result = calculateResult();
    +       (callback || angular.noop)(result);
    +     }
    +   
    + */ +function noop() {} +noop.$inject = []; + + +/** + * @ngdoc function + * @name angular.identity + * @function + * + * @description + * A function that returns its first argument. This function is useful when writing code in the + * functional style. + * +
    +     function transformer(transformationFn, value) {
    +       return (transformationFn || identity)(value);
    +     };
    +   
    + */ +function identity($) {return $;} +identity.$inject = []; + + +function valueFn(value) {return function() {return value;};} + +/** + * @ngdoc function + * @name angular.isUndefined + * @function + * + * @description + * Determines if a reference is undefined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is undefined. + */ +function isUndefined(value){return typeof value == 'undefined';} + + +/** + * @ngdoc function + * @name angular.isDefined + * @function + * + * @description + * Determines if a reference is defined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is defined. + */ +function isDefined(value){return typeof value != 'undefined';} + + +/** + * @ngdoc function + * @name angular.isObject + * @function + * + * @description + * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not + * considered to be objects. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Object` but not `null`. + */ +function isObject(value){return value != null && typeof value == 'object';} + + +/** + * @ngdoc function + * @name angular.isString + * @function + * + * @description + * Determines if a reference is a `String`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `String`. + */ +function isString(value){return typeof value == 'string';} + + +/** + * @ngdoc function + * @name angular.isNumber + * @function + * + * @description + * Determines if a reference is a `Number`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Number`. + */ +function isNumber(value){return typeof value == 'number';} + + +/** + * @ngdoc function + * @name angular.isDate + * @function + * + * @description + * Determines if a value is a date. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Date`. + */ +function isDate(value){ + return toString.apply(value) == '[object Date]'; +} + + +/** + * @ngdoc function + * @name angular.isArray + * @function + * + * @description + * Determines if a reference is an `Array`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Array`. + */ +function isArray(value) { + return toString.apply(value) == '[object Array]'; +} + + +/** + * @ngdoc function + * @name angular.isFunction + * @function + * + * @description + * Determines if a reference is a `Function`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Function`. + */ +function isFunction(value){return typeof value == 'function';} + + +/** + * Checks if `obj` is a window object. + * + * @private + * @param {*} obj Object to check + * @returns {boolean} True if `obj` is a window obj. + */ +function isWindow(obj) { + return obj && obj.document && obj.location && obj.alert && obj.setInterval; +} + + +function isScope(obj) { + return obj && obj.$evalAsync && obj.$watch; +} + + +function isFile(obj) { + return toString.apply(obj) === '[object File]'; +} + + +function isBoolean(value) { + return typeof value == 'boolean'; +} + + +function trim(value) { + return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; +} + +/** + * @ngdoc function + * @name angular.isElement + * @function + * + * @description + * Determines if a reference is a DOM element (or wrapped jQuery element). + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). + */ +function isElement(node) { + return node && + (node.nodeName // we are a direct element + || (node.bind && node.find)); // we have a bind and find method part of jQuery API +} + +/** + * @param str 'key1,key2,...' + * @returns {object} in the form of {key1:true, key2:true, ...} + */ +function makeMap(str){ + var obj = {}, items = str.split(","), i; + for ( i = 0; i < items.length; i++ ) + obj[ items[i] ] = true; + return obj; +} + + +if (msie < 9) { + nodeName_ = function(element) { + element = element.nodeName ? element : element[0]; + return (element.scopeName && element.scopeName != 'HTML') + ? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName; + }; +} else { + nodeName_ = function(element) { + return element.nodeName ? element.nodeName : element[0].nodeName; + }; +} + + +function map(obj, iterator, context) { + var results = []; + forEach(obj, function(value, index, list) { + results.push(iterator.call(context, value, index, list)); + }); + return results; +} + + +/** + * @description + * Determines the number of elements in an array, the number of properties an object has, or + * the length of a string. + * + * Note: This function is used to augment the Object type in Angular expressions. See + * {@link angular.Object} for more information about Angular arrays. + * + * @param {Object|Array|string} obj Object, array, or string to inspect. + * @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object + * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array. + */ +function size(obj, ownPropsOnly) { + var size = 0, key; + + if (isArray(obj) || isString(obj)) { + return obj.length; + } else if (isObject(obj)){ + for (key in obj) + if (!ownPropsOnly || obj.hasOwnProperty(key)) + size++; + } + + return size; +} + + +function includes(array, obj) { + return indexOf(array, obj) != -1; +} + +function indexOf(array, obj) { + if (array.indexOf) return array.indexOf(obj); + + for ( var i = 0; i < array.length; i++) { + if (obj === array[i]) return i; + } + return -1; +} + +function arrayRemove(array, value) { + var index = indexOf(array, value); + if (index >=0) + array.splice(index, 1); + return value; +} + +function isLeafNode (node) { + if (node) { + switch (node.nodeName) { + case "OPTION": + case "PRE": + case "TITLE": + return true; + } + } + return false; +} + +/** + * @ngdoc function + * @name angular.copy + * @function + * + * @description + * Creates a deep copy of `source`, which should be an object or an array. + * + * * If no destination is supplied, a copy of the object or array is created. + * * If a destination is provided, all of its elements (for array) or properties (for objects) + * are deleted and then all elements/properties from the source are copied to it. + * * If `source` is not an object or array, `source` is returned. + * + * Note: this function is used to augment the Object type in Angular expressions. See + * {@link ng.$filter} for more information about Angular arrays. + * + * @param {*} source The source that will be used to make a copy. + * Can be any type, including primitives, `null`, and `undefined`. + * @param {(Object|Array)=} destination Destination into which the source is copied. If + * provided, must be of the same type as `source`. + * @returns {*} The copy or updated `destination`, if `destination` was specified. + */ +function copy(source, destination){ + if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope"); + if (!destination) { + destination = source; + if (source) { + if (isArray(source)) { + destination = copy(source, []); + } else if (isDate(source)) { + destination = new Date(source.getTime()); + } else if (isObject(source)) { + destination = copy(source, {}); + } + } + } else { + if (source === destination) throw Error("Can't copy equivalent objects or arrays"); + if (isArray(source)) { + destination.length = 0; + for ( var i = 0; i < source.length; i++) { + destination.push(copy(source[i])); + } + } else { + var h = destination.$$hashKey; + forEach(destination, function(value, key){ + delete destination[key]; + }); + for ( var key in source) { + destination[key] = copy(source[key]); + } + setHashKey(destination,h); + } + } + return destination; +} + +/** + * Create a shallow copy of an object + */ +function shallowCopy(src, dst) { + dst = dst || {}; + + for(var key in src) { + if (src.hasOwnProperty(key) && key.substr(0, 2) !== '$$') { + dst[key] = src[key]; + } + } + + return dst; +} + + +/** + * @ngdoc function + * @name angular.equals + * @function + * + * @description + * Determines if two objects or two values are equivalent. Supports value types, arrays and + * objects. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties pass `===` comparison. + * * Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal) + * + * During a property comparison, properties of `function` type and properties with names + * that begin with `$` are ignored. + * + * Scope and DOMWindow objects are being compared only by identify (`===`). + * + * @param {*} o1 Object or value to compare. + * @param {*} o2 Object or value to compare. + * @returns {boolean} True if arguments are equal. + */ +function equals(o1, o2) { + if (o1 === o2) return true; + if (o1 === null || o2 === null) return false; + if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN + var t1 = typeof o1, t2 = typeof o2, length, key, keySet; + if (t1 == t2) { + if (t1 == 'object') { + if (isArray(o1)) { + if ((length = o1.length) == o2.length) { + for(key=0; key 2 ? sliceArgs(arguments, 2) : []; + if (isFunction(fn) && !(fn instanceof RegExp)) { + return curryArgs.length + ? function() { + return arguments.length + ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0))) + : fn.apply(self, curryArgs); + } + : function() { + return arguments.length + ? fn.apply(self, arguments) + : fn.call(self); + }; + } else { + // in IE, native methods are not functions so they cannot be bound (note: they don't need to be) + return fn; + } +} + + +function toJsonReplacer(key, value) { + var val = value; + + if (/^\$+/.test(key)) { + val = undefined; + } else if (isWindow(value)) { + val = '$WINDOW'; + } else if (value && document === value) { + val = '$DOCUMENT'; + } else if (isScope(value)) { + val = '$SCOPE'; + } + + return val; +} + + +/** + * @ngdoc function + * @name angular.toJson + * @function + * + * @description + * Serializes input into a JSON-formatted string. + * + * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON. + * @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace. + * @returns {string} Jsonified string representing `obj`. + */ +function toJson(obj, pretty) { + return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null); +} + + +/** + * @ngdoc function + * @name angular.fromJson + * @function + * + * @description + * Deserializes a JSON string. + * + * @param {string} json JSON string to deserialize. + * @returns {Object|Array|Date|string|number} Deserialized thingy. + */ +function fromJson(json) { + return isString(json) + ? JSON.parse(json) + : json; +} + + +function toBoolean(value) { + if (value && value.length !== 0) { + var v = lowercase("" + value); + value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]'); + } else { + value = false; + } + return value; +} + +/** + * @returns {string} Returns the string representation of the element. + */ +function startingTag(element) { + element = jqLite(element).clone(); + try { + // turns out IE does not let you set .html() on elements which + // are not allowed to have children. So we just ignore it. + element.html(''); + } catch(e) {} + // As Per DOM Standards + var TEXT_NODE = 3; + var elemHtml = jqLite('
    ').append(element).html(); + try { + return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) : + elemHtml. + match(/^(<[^>]+>)/)[1]. + replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); + } catch(e) { + return lowercase(elemHtml); + } + +} + + +///////////////////////////////////////////////// + +/** + * Parses an escaped url query string into key-value pairs. + * @returns Object.<(string|boolean)> + */ +function parseKeyValue(/**string*/keyValue) { + var obj = {}, key_value, key; + forEach((keyValue || "").split('&'), function(keyValue){ + if (keyValue) { + key_value = keyValue.split('='); + key = decodeURIComponent(key_value[0]); + obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true; + } + }); + return obj; +} + +function toKeyValue(obj) { + var parts = []; + forEach(obj, function(value, key) { + parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true))); + }); + return parts.length ? parts.join('&') : ''; +} + + +/** + * We need our custom method because encodeURIComponent is too aggressive and doesn't follow + * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path + * segments: + * segment = *pchar + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * pct-encoded = "%" HEXDIG HEXDIG + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriSegment(val) { + return encodeUriQuery(val, true). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'); +} + + +/** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriQuery(val, pctEncodeSpaces) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); +} + + +/** + * @ngdoc directive + * @name ng.directive:ngApp + * + * @element ANY + * @param {angular.Module} ngApp an optional application + * {@link angular.module module} name to load. + * + * @description + * + * Use this directive to auto-bootstrap an application. Only + * one directive can be used per HTML document. The directive + * designates the root of the application and is typically placed + * at the root of the page. + * + * In the example below if the `ngApp` directive would not be placed + * on the `html` element then the document would not be compiled + * and the `{{ 1+2 }}` would not be resolved to `3`. + * + * `ngApp` is the easiest way to bootstrap an application. + * + + + I can add: 1 + 2 = {{ 1+2 }} + + + * + */ +function angularInit(element, bootstrap) { + var elements = [element], + appElement, + module, + names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'], + NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/; + + function append(element) { + element && elements.push(element); + } + + forEach(names, function(name) { + names[name] = true; + append(document.getElementById(name)); + name = name.replace(':', '\\:'); + if (element.querySelectorAll) { + forEach(element.querySelectorAll('.' + name), append); + forEach(element.querySelectorAll('.' + name + '\\:'), append); + forEach(element.querySelectorAll('[' + name + ']'), append); + } + }); + + forEach(elements, function(element) { + if (!appElement) { + var className = ' ' + element.className + ' '; + var match = NG_APP_CLASS_REGEXP.exec(className); + if (match) { + appElement = element; + module = (match[2] || '').replace(/\s+/g, ','); + } else { + forEach(element.attributes, function(attr) { + if (!appElement && names[attr.name]) { + appElement = element; + module = attr.value; + } + }); + } + } + }); + if (appElement) { + bootstrap(appElement, module ? [module] : []); + } +} + +/** + * @ngdoc function + * @name angular.bootstrap + * @description + * Use this function to manually start up angular application. + * + * See: {@link guide/bootstrap Bootstrap} + * + * @param {Element} element DOM element which is the root of angular application. + * @param {Array=} modules an array of module declarations. See: {@link angular.module modules} + * @returns {AUTO.$injector} Returns the newly created injector for this app. + */ +function bootstrap(element, modules) { + var resumeBootstrapInternal = function() { + element = jqLite(element); + modules = modules || []; + modules.unshift(['$provide', function($provide) { + $provide.value('$rootElement', element); + }]); + modules.unshift('ng'); + var injector = createInjector(modules); + injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', '$animator', + function(scope, element, compile, injector, animator) { + scope.$apply(function() { + element.data('$injector', injector); + compile(element)(scope); + }); + animator.enabled(true); + }] + ); + return injector; + }; + + var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; + + if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { + return resumeBootstrapInternal(); + } + + window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); + angular.resumeBootstrap = function(extraModules) { + forEach(extraModules, function(module) { + modules.push(module); + }); + resumeBootstrapInternal(); + }; +} + +var SNAKE_CASE_REGEXP = /[A-Z]/g; +function snake_case(name, separator){ + separator = separator || '_'; + return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { + return (pos ? separator : '') + letter.toLowerCase(); + }); +} + +function bindJQuery() { + // bind to jQuery if present; + jQuery = window.jQuery; + // reset to jQuery or default to us. + if (jQuery) { + jqLite = jQuery; + extend(jQuery.fn, { + scope: JQLitePrototype.scope, + controller: JQLitePrototype.controller, + injector: JQLitePrototype.injector, + inheritedData: JQLitePrototype.inheritedData + }); + JQLitePatchJQueryRemove('remove', true); + JQLitePatchJQueryRemove('empty'); + JQLitePatchJQueryRemove('html'); + } else { + jqLite = JQLite; + } + angular.element = jqLite; +} + +/** + * throw error if the argument is falsy. + */ +function assertArg(arg, name, reason) { + if (!arg) { + throw new Error("Argument '" + (name || '?') + "' is " + (reason || "required")); + } + return arg; +} + +function assertArgFn(arg, name, acceptArrayAnnotation) { + if (acceptArrayAnnotation && isArray(arg)) { + arg = arg[arg.length - 1]; + } + + assertArg(isFunction(arg), name, 'not a function, got ' + + (arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg)); + return arg; +} + +/** + * @ngdoc interface + * @name angular.Module + * @description + * + * Interface for configuring angular {@link angular.module modules}. + */ + +function setupModuleLoader(window) { + + function ensure(obj, name, factory) { + return obj[name] || (obj[name] = factory()); + } + + return ensure(ensure(window, 'angular', Object), 'module', function() { + /** @type {Object.} */ + var modules = {}; + + /** + * @ngdoc function + * @name angular.module + * @description + * + * The `angular.module` is a global place for creating and registering Angular modules. All + * modules (angular core or 3rd party) that should be available to an application must be + * registered using this mechanism. + * + * + * # Module + * + * A module is a collocation of services, directives, filters, and configuration information. Module + * is used to configure the {@link AUTO.$injector $injector}. + * + *
    +     * // Create a new module
    +     * var myModule = angular.module('myModule', []);
    +     *
    +     * // register a new service
    +     * myModule.value('appName', 'MyCoolApp');
    +     *
    +     * // configure existing services inside initialization blocks.
    +     * myModule.config(function($locationProvider) {
    +     *   // Configure existing providers
    +     *   $locationProvider.hashPrefix('!');
    +     * });
    +     * 
    + * + * Then you can create an injector and load your modules like this: + * + *
    +     * var injector = angular.injector(['ng', 'MyModule'])
    +     * 
    + * + * However it's more likely that you'll just use + * {@link ng.directive:ngApp ngApp} or + * {@link angular.bootstrap} to simplify this process for you. + * + * @param {!string} name The name of the module to create or retrieve. + * @param {Array.=} requires If specified then new module is being created. If unspecified then the + * the module is being retrieved for further configuration. + * @param {Function} configFn Optional configuration function for the module. Same as + * {@link angular.Module#config Module#config()}. + * @returns {module} new module with the {@link angular.Module} api. + */ + return function module(name, requires, configFn) { + if (requires && modules.hasOwnProperty(name)) { + modules[name] = null; + } + return ensure(modules, name, function() { + if (!requires) { + throw Error('No module: ' + name); + } + + /** @type {!Array.>} */ + var invokeQueue = []; + + /** @type {!Array.} */ + var runBlocks = []; + + var config = invokeLater('$injector', 'invoke'); + + /** @type {angular.Module} */ + var moduleInstance = { + // Private state + _invokeQueue: invokeQueue, + _runBlocks: runBlocks, + + /** + * @ngdoc property + * @name angular.Module#requires + * @propertyOf angular.Module + * @returns {Array.} List of module names which must be loaded before this module. + * @description + * Holds the list of modules which the injector will load before the current module is loaded. + */ + requires: requires, + + /** + * @ngdoc property + * @name angular.Module#name + * @propertyOf angular.Module + * @returns {string} Name of the module. + * @description + */ + name: name, + + + /** + * @ngdoc method + * @name angular.Module#provider + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} providerType Construction function for creating new instance of the service. + * @description + * See {@link AUTO.$provide#provider $provide.provider()}. + */ + provider: invokeLater('$provide', 'provider'), + + /** + * @ngdoc method + * @name angular.Module#factory + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} providerFunction Function for creating new instance of the service. + * @description + * See {@link AUTO.$provide#factory $provide.factory()}. + */ + factory: invokeLater('$provide', 'factory'), + + /** + * @ngdoc method + * @name angular.Module#service + * @methodOf angular.Module + * @param {string} name service name + * @param {Function} constructor A constructor function that will be instantiated. + * @description + * See {@link AUTO.$provide#service $provide.service()}. + */ + service: invokeLater('$provide', 'service'), + + /** + * @ngdoc method + * @name angular.Module#value + * @methodOf angular.Module + * @param {string} name service name + * @param {*} object Service instance object. + * @description + * See {@link AUTO.$provide#value $provide.value()}. + */ + value: invokeLater('$provide', 'value'), + + /** + * @ngdoc method + * @name angular.Module#constant + * @methodOf angular.Module + * @param {string} name constant name + * @param {*} object Constant value. + * @description + * Because the constant are fixed, they get applied before other provide methods. + * See {@link AUTO.$provide#constant $provide.constant()}. + */ + constant: invokeLater('$provide', 'constant', 'unshift'), + + /** + * @ngdoc method + * @name angular.Module#animation + * @methodOf angular.Module + * @param {string} name animation name + * @param {Function} animationFactory Factory function for creating new instance of an animation. + * @description + * + * Defines an animation hook that can be later used with {@link ng.directive:ngAnimate ngAnimate} + * alongside {@link ng.directive:ngAnimate#Description common ng directives} as well as custom directives. + *
    +           * module.animation('animation-name', function($inject1, $inject2) {
    +           *   return {
    +           *     //this gets called in preparation to setup an animation
    +           *     setup : function(element) { ... },
    +           *
    +           *     //this gets called once the animation is run
    +           *     start : function(element, done, memo) { ... }
    +           *   }
    +           * })
    +           * 
    + * + * See {@link ng.$animationProvider#register $animationProvider.register()} and + * {@link ng.directive:ngAnimate ngAnimate} for more information. + */ + animation: invokeLater('$animationProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#filter + * @methodOf angular.Module + * @param {string} name Filter name. + * @param {Function} filterFactory Factory function for creating new instance of filter. + * @description + * See {@link ng.$filterProvider#register $filterProvider.register()}. + */ + filter: invokeLater('$filterProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#controller + * @methodOf angular.Module + * @param {string} name Controller name. + * @param {Function} constructor Controller constructor function. + * @description + * See {@link ng.$controllerProvider#register $controllerProvider.register()}. + */ + controller: invokeLater('$controllerProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#directive + * @methodOf angular.Module + * @param {string} name directive name + * @param {Function} directiveFactory Factory function for creating new instance of + * directives. + * @description + * See {@link ng.$compileProvider#directive $compileProvider.directive()}. + */ + directive: invokeLater('$compileProvider', 'directive'), + + /** + * @ngdoc method + * @name angular.Module#config + * @methodOf angular.Module + * @param {Function} configFn Execute this function on module load. Useful for service + * configuration. + * @description + * Use this method to register work which needs to be performed on module loading. + */ + config: config, + + /** + * @ngdoc method + * @name angular.Module#run + * @methodOf angular.Module + * @param {Function} initializationFn Execute this function after injector creation. + * Useful for application initialization. + * @description + * Use this method to register work which should be performed when the injector is done + * loading all modules. + */ + run: function(block) { + runBlocks.push(block); + return this; + } + }; + + if (configFn) { + config(configFn); + } + + return moduleInstance; + + /** + * @param {string} provider + * @param {string} method + * @param {String=} insertMethod + * @returns {angular.Module} + */ + function invokeLater(provider, method, insertMethod) { + return function() { + invokeQueue[insertMethod || 'push']([provider, method, arguments]); + return moduleInstance; + } + } + }); + }; + }); + +} + +/** + * @ngdoc property + * @name angular.version + * @description + * An object that contains information about the current AngularJS version. This object has the + * following properties: + * + * - `full` – `{string}` – Full version string, such as "0.9.18". + * - `major` – `{number}` – Major version number, such as "0". + * - `minor` – `{number}` – Minor version number, such as "9". + * - `dot` – `{number}` – Dot version number, such as "18". + * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". + */ +var version = { + full: '1.1.5', // all of these placeholder strings will be replaced by grunt's + major: 1, // package task + minor: 1, + dot: 5, + codeName: 'triangle-squarification' +}; + + +function publishExternalAPI(angular){ + extend(angular, { + 'bootstrap': bootstrap, + 'copy': copy, + 'extend': extend, + 'equals': equals, + 'element': jqLite, + 'forEach': forEach, + 'injector': createInjector, + 'noop':noop, + 'bind':bind, + 'toJson': toJson, + 'fromJson': fromJson, + 'identity':identity, + 'isUndefined': isUndefined, + 'isDefined': isDefined, + 'isString': isString, + 'isFunction': isFunction, + 'isObject': isObject, + 'isNumber': isNumber, + 'isElement': isElement, + 'isArray': isArray, + 'version': version, + 'isDate': isDate, + 'lowercase': lowercase, + 'uppercase': uppercase, + 'callbacks': {counter: 0}, + 'noConflict': noConflict + }); + + angularModule = setupModuleLoader(window); + try { + angularModule('ngLocale'); + } catch (e) { + angularModule('ngLocale', []).provider('$locale', $LocaleProvider); + } + + angularModule('ng', ['ngLocale'], ['$provide', + function ngModule($provide) { + $provide.provider('$compile', $CompileProvider). + directive({ + a: htmlAnchorDirective, + input: inputDirective, + textarea: inputDirective, + form: formDirective, + script: scriptDirective, + select: selectDirective, + style: styleDirective, + option: optionDirective, + ngBind: ngBindDirective, + ngBindHtmlUnsafe: ngBindHtmlUnsafeDirective, + ngBindTemplate: ngBindTemplateDirective, + ngClass: ngClassDirective, + ngClassEven: ngClassEvenDirective, + ngClassOdd: ngClassOddDirective, + ngCsp: ngCspDirective, + ngCloak: ngCloakDirective, + ngController: ngControllerDirective, + ngForm: ngFormDirective, + ngHide: ngHideDirective, + ngIf: ngIfDirective, + ngInclude: ngIncludeDirective, + ngInit: ngInitDirective, + ngNonBindable: ngNonBindableDirective, + ngPluralize: ngPluralizeDirective, + ngRepeat: ngRepeatDirective, + ngShow: ngShowDirective, + ngSubmit: ngSubmitDirective, + ngStyle: ngStyleDirective, + ngSwitch: ngSwitchDirective, + ngSwitchWhen: ngSwitchWhenDirective, + ngSwitchDefault: ngSwitchDefaultDirective, + ngOptions: ngOptionsDirective, + ngView: ngViewDirective, + ngTransclude: ngTranscludeDirective, + ngModel: ngModelDirective, + ngList: ngListDirective, + ngChange: ngChangeDirective, + required: requiredDirective, + ngRequired: requiredDirective, + ngValue: ngValueDirective + }). + directive(ngAttributeAliasDirectives). + directive(ngEventDirectives); + $provide.provider({ + $anchorScroll: $AnchorScrollProvider, + $animation: $AnimationProvider, + $animator: $AnimatorProvider, + $browser: $BrowserProvider, + $cacheFactory: $CacheFactoryProvider, + $controller: $ControllerProvider, + $document: $DocumentProvider, + $exceptionHandler: $ExceptionHandlerProvider, + $filter: $FilterProvider, + $interpolate: $InterpolateProvider, + $http: $HttpProvider, + $httpBackend: $HttpBackendProvider, + $location: $LocationProvider, + $log: $LogProvider, + $parse: $ParseProvider, + $route: $RouteProvider, + $routeParams: $RouteParamsProvider, + $rootScope: $RootScopeProvider, + $q: $QProvider, + $sniffer: $SnifferProvider, + $templateCache: $TemplateCacheProvider, + $timeout: $TimeoutProvider, + $window: $WindowProvider + }); + } + ]); +} + +////////////////////////////////// +//JQLite +////////////////////////////////// + +/** + * @ngdoc function + * @name angular.element + * @function + * + * @description + * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. + * `angular.element` can be either an alias for [jQuery](http://api.jquery.com/jQuery/) function, if + * jQuery is available, or a function that wraps the element or string in Angular's jQuery lite + * implementation (commonly referred to as jqLite). + * + * Real jQuery always takes precedence over jqLite, provided it was loaded before `DOMContentLoaded` + * event fired. + * + * jqLite is a tiny, API-compatible subset of jQuery that allows + * Angular to manipulate the DOM. jqLite implements only the most commonly needed functionality + * within a very small footprint, so only a subset of the jQuery API - methods, arguments and + * invocation styles - are supported. + * + * Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never + * raw DOM references. + * + * ## Angular's jQuery lite provides the following methods: + * + * - [addClass()](http://api.jquery.com/addClass/) + * - [after()](http://api.jquery.com/after/) + * - [append()](http://api.jquery.com/append/) + * - [attr()](http://api.jquery.com/attr/) + * - [bind()](http://api.jquery.com/bind/) - Does not support namespaces + * - [children()](http://api.jquery.com/children/) - Does not support selectors + * - [clone()](http://api.jquery.com/clone/) + * - [contents()](http://api.jquery.com/contents/) + * - [css()](http://api.jquery.com/css/) + * - [data()](http://api.jquery.com/data/) + * - [eq()](http://api.jquery.com/eq/) + * - [find()](http://api.jquery.com/find/) - Limited to lookups by tag name + * - [hasClass()](http://api.jquery.com/hasClass/) + * - [html()](http://api.jquery.com/html/) + * - [next()](http://api.jquery.com/next/) - Does not support selectors + * - [parent()](http://api.jquery.com/parent/) - Does not support selectors + * - [prepend()](http://api.jquery.com/prepend/) + * - [prop()](http://api.jquery.com/prop/) + * - [ready()](http://api.jquery.com/ready/) + * - [remove()](http://api.jquery.com/remove/) + * - [removeAttr()](http://api.jquery.com/removeAttr/) + * - [removeClass()](http://api.jquery.com/removeClass/) + * - [removeData()](http://api.jquery.com/removeData/) + * - [replaceWith()](http://api.jquery.com/replaceWith/) + * - [text()](http://api.jquery.com/text/) + * - [toggleClass()](http://api.jquery.com/toggleClass/) + * - [triggerHandler()](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. + * - [unbind()](http://api.jquery.com/unbind/) - Does not support namespaces + * - [val()](http://api.jquery.com/val/) + * - [wrap()](http://api.jquery.com/wrap/) + * + * ## In addition to the above, Angular provides additional methods to both jQuery and jQuery lite: + * + * - `controller(name)` - retrieves the controller of the current element or its parent. By default + * retrieves controller associated with the `ngController` directive. If `name` is provided as + * camelCase directive name, then the controller for this directive will be retrieved (e.g. + * `'ngModel'`). + * - `injector()` - retrieves the injector of the current element or its parent. + * - `scope()` - retrieves the {@link api/ng.$rootScope.Scope scope} of the current + * element or its parent. + * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top + * parent element is reached. + * + * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @returns {Object} jQuery object. + */ + +var jqCache = JQLite.cache = {}, + jqName = JQLite.expando = 'ng-' + new Date().getTime(), + jqId = 1, + addEventListenerFn = (window.document.addEventListener + ? function(element, type, fn) {element.addEventListener(type, fn, false);} + : function(element, type, fn) {element.attachEvent('on' + type, fn);}), + removeEventListenerFn = (window.document.removeEventListener + ? function(element, type, fn) {element.removeEventListener(type, fn, false); } + : function(element, type, fn) {element.detachEvent('on' + type, fn); }); + +function jqNextId() { return ++jqId; } + + +var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; +var MOZ_HACK_REGEXP = /^moz([A-Z])/; + +/** + * Converts snake_case to camelCase. + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ +function camelCase(name) { + return name. + replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { + return offset ? letter.toUpperCase() : letter; + }). + replace(MOZ_HACK_REGEXP, 'Moz$1'); +} + +///////////////////////////////////////////// +// jQuery mutation patch +// +// In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a +// $destroy event on all DOM nodes being removed. +// +///////////////////////////////////////////// + +function JQLitePatchJQueryRemove(name, dispatchThis) { + var originalJqFn = jQuery.fn[name]; + originalJqFn = originalJqFn.$original || originalJqFn; + removePatch.$original = originalJqFn; + jQuery.fn[name] = removePatch; + + function removePatch() { + var list = [this], + fireEvent = dispatchThis, + set, setIndex, setLength, + element, childIndex, childLength, children, + fns, events; + + while(list.length) { + set = list.shift(); + for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) { + element = jqLite(set[setIndex]); + if (fireEvent) { + element.triggerHandler('$destroy'); + } else { + fireEvent = !fireEvent; + } + for(childIndex = 0, childLength = (children = element.children()).length; + childIndex < childLength; + childIndex++) { + list.push(jQuery(children[childIndex])); + } + } + } + return originalJqFn.apply(this, arguments); + } +} + +///////////////////////////////////////////// +function JQLite(element) { + if (element instanceof JQLite) { + return element; + } + if (!(this instanceof JQLite)) { + if (isString(element) && element.charAt(0) != '<') { + throw Error('selectors not implemented'); + } + return new JQLite(element); + } + + if (isString(element)) { + var div = document.createElement('div'); + // Read about the NoScope elements here: + // http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx + div.innerHTML = '
     
    ' + element; // IE insanity to make NoScope elements work! + div.removeChild(div.firstChild); // remove the superfluous div + JQLiteAddNodes(this, div.childNodes); + this.remove(); // detach the elements from the temporary DOM div. + } else { + JQLiteAddNodes(this, element); + } +} + +function JQLiteClone(element) { + return element.cloneNode(true); +} + +function JQLiteDealoc(element){ + JQLiteRemoveData(element); + for ( var i = 0, children = element.childNodes || []; i < children.length; i++) { + JQLiteDealoc(children[i]); + } +} + +function JQLiteUnbind(element, type, fn) { + var events = JQLiteExpandoStore(element, 'events'), + handle = JQLiteExpandoStore(element, 'handle'); + + if (!handle) return; //no listeners registered + + if (isUndefined(type)) { + forEach(events, function(eventHandler, type) { + removeEventListenerFn(element, type, eventHandler); + delete events[type]; + }); + } else { + if (isUndefined(fn)) { + removeEventListenerFn(element, type, events[type]); + delete events[type]; + } else { + arrayRemove(events[type], fn); + } + } +} + +function JQLiteRemoveData(element) { + var expandoId = element[jqName], + expandoStore = jqCache[expandoId]; + + if (expandoStore) { + if (expandoStore.handle) { + expandoStore.events.$destroy && expandoStore.handle({}, '$destroy'); + JQLiteUnbind(element); + } + delete jqCache[expandoId]; + element[jqName] = undefined; // ie does not allow deletion of attributes on elements. + } +} + +function JQLiteExpandoStore(element, key, value) { + var expandoId = element[jqName], + expandoStore = jqCache[expandoId || -1]; + + if (isDefined(value)) { + if (!expandoStore) { + element[jqName] = expandoId = jqNextId(); + expandoStore = jqCache[expandoId] = {}; + } + expandoStore[key] = value; + } else { + return expandoStore && expandoStore[key]; + } +} + +function JQLiteData(element, key, value) { + var data = JQLiteExpandoStore(element, 'data'), + isSetter = isDefined(value), + keyDefined = !isSetter && isDefined(key), + isSimpleGetter = keyDefined && !isObject(key); + + if (!data && !isSimpleGetter) { + JQLiteExpandoStore(element, 'data', data = {}); + } + + if (isSetter) { + data[key] = value; + } else { + if (keyDefined) { + if (isSimpleGetter) { + // don't create data in this case. + return data && data[key]; + } else { + extend(data, key); + } + } else { + return data; + } + } +} + +function JQLiteHasClass(element, selector) { + return ((" " + element.className + " ").replace(/[\n\t]/g, " "). + indexOf( " " + selector + " " ) > -1); +} + +function JQLiteRemoveClass(element, cssClasses) { + if (cssClasses) { + forEach(cssClasses.split(' '), function(cssClass) { + element.className = trim( + (" " + element.className + " ") + .replace(/[\n\t]/g, " ") + .replace(" " + trim(cssClass) + " ", " ") + ); + }); + } +} + +function JQLiteAddClass(element, cssClasses) { + if (cssClasses) { + forEach(cssClasses.split(' '), function(cssClass) { + if (!JQLiteHasClass(element, cssClass)) { + element.className = trim(element.className + ' ' + trim(cssClass)); + } + }); + } +} + +function JQLiteAddNodes(root, elements) { + if (elements) { + elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements)) + ? elements + : [ elements ]; + for(var i=0; i < elements.length; i++) { + root.push(elements[i]); + } + } +} + +function JQLiteController(element, name) { + return JQLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller'); +} + +function JQLiteInheritedData(element, name, value) { + element = jqLite(element); + + // if element is the document object work with the html element instead + // this makes $(document).scope() possible + if(element[0].nodeType == 9) { + element = element.find('html'); + } + + while (element.length) { + if (value = element.data(name)) return value; + element = element.parent(); + } +} + +////////////////////////////////////////// +// Functions which are declared directly. +////////////////////////////////////////// +var JQLitePrototype = JQLite.prototype = { + ready: function(fn) { + var fired = false; + + function trigger() { + if (fired) return; + fired = true; + fn(); + } + + // check if document already is loaded + if (document.readyState === 'complete'){ + setTimeout(trigger); + } else { + this.bind('DOMContentLoaded', trigger); // works for modern browsers and IE9 + // we can not use jqLite since we are not done loading and jQuery could be loaded later. + JQLite(window).bind('load', trigger); // fallback to window.onload for others + } + }, + toString: function() { + var value = []; + forEach(this, function(e){ value.push('' + e);}); + return '[' + value.join(', ') + ']'; + }, + + eq: function(index) { + return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); + }, + + length: 0, + push: push, + sort: [].sort, + splice: [].splice +}; + +////////////////////////////////////////// +// Functions iterating getter/setters. +// these functions return self on setter and +// value on get. +////////////////////////////////////////// +var BOOLEAN_ATTR = {}; +forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { + BOOLEAN_ATTR[lowercase(value)] = value; +}); +var BOOLEAN_ELEMENTS = {}; +forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { + BOOLEAN_ELEMENTS[uppercase(value)] = true; +}); + +function getBooleanAttrName(element, name) { + // check dom last since we will most likely fail on name + var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; + + // booleanAttr is here twice to minimize DOM access + return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr; +} + +forEach({ + data: JQLiteData, + inheritedData: JQLiteInheritedData, + + scope: function(element) { + return JQLiteInheritedData(element, '$scope'); + }, + + controller: JQLiteController , + + injector: function(element) { + return JQLiteInheritedData(element, '$injector'); + }, + + removeAttr: function(element,name) { + element.removeAttribute(name); + }, + + hasClass: JQLiteHasClass, + + css: function(element, name, value) { + name = camelCase(name); + + if (isDefined(value)) { + element.style[name] = value; + } else { + var val; + + if (msie <= 8) { + // this is some IE specific weirdness that jQuery 1.6.4 does not sure why + val = element.currentStyle && element.currentStyle[name]; + if (val === '') val = 'auto'; + } + + val = val || element.style[name]; + + if (msie <= 8) { + // jquery weirdness :-/ + val = (val === '') ? undefined : val; + } + + return val; + } + }, + + attr: function(element, name, value){ + var lowercasedName = lowercase(name); + if (BOOLEAN_ATTR[lowercasedName]) { + if (isDefined(value)) { + if (!!value) { + element[name] = true; + element.setAttribute(name, lowercasedName); + } else { + element[name] = false; + element.removeAttribute(lowercasedName); + } + } else { + return (element[name] || + (element.attributes.getNamedItem(name)|| noop).specified) + ? lowercasedName + : undefined; + } + } else if (isDefined(value)) { + element.setAttribute(name, value); + } else if (element.getAttribute) { + // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code + // some elements (e.g. Document) don't have get attribute, so return undefined + var ret = element.getAttribute(name, 2); + // normalize non-existing attributes to undefined (as jQuery) + return ret === null ? undefined : ret; + } + }, + + prop: function(element, name, value) { + if (isDefined(value)) { + element[name] = value; + } else { + return element[name]; + } + }, + + text: extend((msie < 9) + ? function(element, value) { + if (element.nodeType == 1 /** Element */) { + if (isUndefined(value)) + return element.innerText; + element.innerText = value; + } else { + if (isUndefined(value)) + return element.nodeValue; + element.nodeValue = value; + } + } + : function(element, value) { + if (isUndefined(value)) { + return element.textContent; + } + element.textContent = value; + }, {$dv:''}), + + val: function(element, value) { + if (isUndefined(value)) { + return element.value; + } + element.value = value; + }, + + html: function(element, value) { + if (isUndefined(value)) { + return element.innerHTML; + } + for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) { + JQLiteDealoc(childNodes[i]); + } + element.innerHTML = value; + } +}, function(fn, name){ + /** + * Properties: writes return selection, reads return first value + */ + JQLite.prototype[name] = function(arg1, arg2) { + var i, key; + + // JQLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it + // in a way that survives minification. + if (((fn.length == 2 && (fn !== JQLiteHasClass && fn !== JQLiteController)) ? arg1 : arg2) === undefined) { + if (isObject(arg1)) { + + // we are a write, but the object properties are the key/values + for(i=0; i < this.length; i++) { + if (fn === JQLiteData) { + // data() takes the whole object in jQuery + fn(this[i], arg1); + } else { + for (key in arg1) { + fn(this[i], key, arg1[key]); + } + } + } + // return self for chaining + return this; + } else { + // we are a read, so read the first child. + if (this.length) + return fn(this[0], arg1, arg2); + } + } else { + // we are a write, so apply to all children + for(i=0; i < this.length; i++) { + fn(this[i], arg1, arg2); + } + // return self for chaining + return this; + } + return fn.$dv; + }; +}); + +function createEventHandler(element, events) { + var eventHandler = function (event, type) { + if (!event.preventDefault) { + event.preventDefault = function() { + event.returnValue = false; //ie + }; + } + + if (!event.stopPropagation) { + event.stopPropagation = function() { + event.cancelBubble = true; //ie + }; + } + + if (!event.target) { + event.target = event.srcElement || document; + } + + if (isUndefined(event.defaultPrevented)) { + var prevent = event.preventDefault; + event.preventDefault = function() { + event.defaultPrevented = true; + prevent.call(event); + }; + event.defaultPrevented = false; + } + + event.isDefaultPrevented = function() { + return event.defaultPrevented || event.returnValue == false; + }; + + forEach(events[type || event.type], function(fn) { + fn.call(element, event); + }); + + // Remove monkey-patched methods (IE), + // as they would cause memory leaks in IE8. + if (msie <= 8) { + // IE7/8 does not allow to delete property on native object + event.preventDefault = null; + event.stopPropagation = null; + event.isDefaultPrevented = null; + } else { + // It shouldn't affect normal browsers (native methods are defined on prototype). + delete event.preventDefault; + delete event.stopPropagation; + delete event.isDefaultPrevented; + } + }; + eventHandler.elem = element; + return eventHandler; +} + +////////////////////////////////////////// +// Functions iterating traversal. +// These functions chain results into a single +// selector. +////////////////////////////////////////// +forEach({ + removeData: JQLiteRemoveData, + + dealoc: JQLiteDealoc, + + bind: function bindFn(element, type, fn){ + var events = JQLiteExpandoStore(element, 'events'), + handle = JQLiteExpandoStore(element, 'handle'); + + if (!events) JQLiteExpandoStore(element, 'events', events = {}); + if (!handle) JQLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events)); + + forEach(type.split(' '), function(type){ + var eventFns = events[type]; + + if (!eventFns) { + if (type == 'mouseenter' || type == 'mouseleave') { + var contains = document.body.contains || document.body.compareDocumentPosition ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + events[type] = []; + + // Refer to jQuery's implementation of mouseenter & mouseleave + // Read about mouseenter and mouseleave: + // http://www.quirksmode.org/js/events_mouse.html#link8 + var eventmap = { mouseleave : "mouseout", mouseenter : "mouseover"} + bindFn(element, eventmap[type], function(event) { + var ret, target = this, related = event.relatedTarget; + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !contains(target, related)) ){ + handle(event, type); + } + + }); + + } else { + addEventListenerFn(element, type, handle); + events[type] = []; + } + eventFns = events[type] + } + eventFns.push(fn); + }); + }, + + unbind: JQLiteUnbind, + + replaceWith: function(element, replaceNode) { + var index, parent = element.parentNode; + JQLiteDealoc(element); + forEach(new JQLite(replaceNode), function(node){ + if (index) { + parent.insertBefore(node, index.nextSibling); + } else { + parent.replaceChild(node, element); + } + index = node; + }); + }, + + children: function(element) { + var children = []; + forEach(element.childNodes, function(element){ + if (element.nodeType === 1) + children.push(element); + }); + return children; + }, + + contents: function(element) { + return element.childNodes || []; + }, + + append: function(element, node) { + forEach(new JQLite(node), function(child){ + if (element.nodeType === 1 || element.nodeType === 11) { + element.appendChild(child); + } + }); + }, + + prepend: function(element, node) { + if (element.nodeType === 1) { + var index = element.firstChild; + forEach(new JQLite(node), function(child){ + if (index) { + element.insertBefore(child, index); + } else { + element.appendChild(child); + index = child; + } + }); + } + }, + + wrap: function(element, wrapNode) { + wrapNode = jqLite(wrapNode)[0]; + var parent = element.parentNode; + if (parent) { + parent.replaceChild(wrapNode, element); + } + wrapNode.appendChild(element); + }, + + remove: function(element) { + JQLiteDealoc(element); + var parent = element.parentNode; + if (parent) parent.removeChild(element); + }, + + after: function(element, newElement) { + var index = element, parent = element.parentNode; + forEach(new JQLite(newElement), function(node){ + parent.insertBefore(node, index.nextSibling); + index = node; + }); + }, + + addClass: JQLiteAddClass, + removeClass: JQLiteRemoveClass, + + toggleClass: function(element, selector, condition) { + if (isUndefined(condition)) { + condition = !JQLiteHasClass(element, selector); + } + (condition ? JQLiteAddClass : JQLiteRemoveClass)(element, selector); + }, + + parent: function(element) { + var parent = element.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + + next: function(element) { + if (element.nextElementSibling) { + return element.nextElementSibling; + } + + // IE8 doesn't have nextElementSibling + var elm = element.nextSibling; + while (elm != null && elm.nodeType !== 1) { + elm = elm.nextSibling; + } + return elm; + }, + + find: function(element, selector) { + return element.getElementsByTagName(selector); + }, + + clone: JQLiteClone, + + triggerHandler: function(element, eventName) { + var eventFns = (JQLiteExpandoStore(element, 'events') || {})[eventName]; + var event; + + forEach(eventFns, function(fn) { + fn.call(element, {preventDefault: noop}); + }); + } +}, function(fn, name){ + /** + * chaining functions + */ + JQLite.prototype[name] = function(arg1, arg2) { + var value; + for(var i=0; i < this.length; i++) { + if (value == undefined) { + value = fn(this[i], arg1, arg2); + if (value !== undefined) { + // any function which returns a value needs to be wrapped + value = jqLite(value); + } + } else { + JQLiteAddNodes(value, fn(this[i], arg1, arg2)); + } + } + return value == undefined ? this : value; + }; +}); + +/** + * Computes a hash of an 'obj'. + * Hash of a: + * string is string + * number is number as string + * object is either result of calling $$hashKey function on the object or uniquely generated id, + * that is also assigned to the $$hashKey property of the object. + * + * @param obj + * @returns {string} hash string such that the same input will have the same hash string. + * The resulting string key is in 'type:hashKey' format. + */ +function hashKey(obj) { + var objType = typeof obj, + key; + + if (objType == 'object' && obj !== null) { + if (typeof (key = obj.$$hashKey) == 'function') { + // must invoke on object to keep the right this + key = obj.$$hashKey(); + } else if (key === undefined) { + key = obj.$$hashKey = nextUid(); + } + } else { + key = obj; + } + + return objType + ':' + key; +} + +/** + * HashMap which can use objects as keys + */ +function HashMap(array){ + forEach(array, this.put, this); +} +HashMap.prototype = { + /** + * Store key value pair + * @param key key to store can be any type + * @param value value to store can be any type + */ + put: function(key, value) { + this[hashKey(key)] = value; + }, + + /** + * @param key + * @returns the value for the key + */ + get: function(key) { + return this[hashKey(key)]; + }, + + /** + * Remove the key/value pair + * @param key + */ + remove: function(key) { + var value = this[key = hashKey(key)]; + delete this[key]; + return value; + } +}; + +/** + * @ngdoc function + * @name angular.injector + * @function + * + * @description + * Creates an injector function that can be used for retrieving services as well as for + * dependency injection (see {@link guide/di dependency injection}). + * + + * @param {Array.} modules A list of module functions or their aliases. See + * {@link angular.module}. The `ng` module must be explicitly added. + * @returns {function()} Injector function. See {@link AUTO.$injector $injector}. + * + * @example + * Typical usage + *
    + *   // create an injector
    + *   var $injector = angular.injector(['ng']);
    + *
    + *   // use the injector to kick off your application
    + *   // use the type inference to auto inject arguments, or use implicit injection
    + *   $injector.invoke(function($rootScope, $compile, $document){
    + *     $compile($document)($rootScope);
    + *     $rootScope.$digest();
    + *   });
    + * 
    + */ + + +/** + * @ngdoc overview + * @name AUTO + * @description + * + * Implicit module which gets automatically added to each {@link AUTO.$injector $injector}. + */ + +var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; +var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; +function annotate(fn) { + var $inject, + fnText, + argDecl, + last; + + if (typeof fn == 'function') { + if (!($inject = fn.$inject)) { + $inject = []; + fnText = fn.toString().replace(STRIP_COMMENTS, ''); + argDecl = fnText.match(FN_ARGS); + forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){ + arg.replace(FN_ARG, function(all, underscore, name){ + $inject.push(name); + }); + }); + fn.$inject = $inject; + } + } else if (isArray(fn)) { + last = fn.length - 1; + assertArgFn(fn[last], 'fn'); + $inject = fn.slice(0, last); + } else { + assertArgFn(fn, 'fn', true); + } + return $inject; +} + +/////////////////////////////////////// + +/** + * @ngdoc object + * @name AUTO.$injector + * @function + * + * @description + * + * `$injector` is used to retrieve object instances as defined by + * {@link AUTO.$provide provider}, instantiate types, invoke methods, + * and load modules. + * + * The following always holds true: + * + *
    + *   var $injector = angular.injector();
    + *   expect($injector.get('$injector')).toBe($injector);
    + *   expect($injector.invoke(function($injector){
    + *     return $injector;
    + *   }).toBe($injector);
    + * 
    + * + * # Injection Function Annotation + * + * JavaScript does not have annotations, and annotations are needed for dependency injection. The + * following are all valid ways of annotating function with injection arguments and are equivalent. + * + *
    + *   // inferred (only works if code not minified/obfuscated)
    + *   $injector.invoke(function(serviceA){});
    + *
    + *   // annotated
    + *   function explicit(serviceA) {};
    + *   explicit.$inject = ['serviceA'];
    + *   $injector.invoke(explicit);
    + *
    + *   // inline
    + *   $injector.invoke(['serviceA', function(serviceA){}]);
    + * 
    + * + * ## Inference + * + * In JavaScript calling `toString()` on a function returns the function definition. The definition can then be + * parsed and the function arguments can be extracted. *NOTE:* This does not work with minification, and obfuscation + * tools since these tools change the argument names. + * + * ## `$inject` Annotation + * By adding a `$inject` property onto a function the injection parameters can be specified. + * + * ## Inline + * As an array of injection names, where the last item in the array is the function to call. + */ + +/** + * @ngdoc method + * @name AUTO.$injector#get + * @methodOf AUTO.$injector + * + * @description + * Return an instance of the service. + * + * @param {string} name The name of the instance to retrieve. + * @return {*} The instance. + */ + +/** + * @ngdoc method + * @name AUTO.$injector#invoke + * @methodOf AUTO.$injector + * + * @description + * Invoke the method and supply the method arguments from the `$injector`. + * + * @param {!function} fn The function to invoke. The function arguments come form the function annotation. + * @param {Object=} self The `this` for the invoked method. + * @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before + * the `$injector` is consulted. + * @returns {*} the value returned by the invoked `fn` function. + */ + +/** + * @ngdoc method + * @name AUTO.$injector#has + * @methodOf AUTO.$injector + * + * @description + * Allows the user to query if the particular service exist. + * + * @param {string} Name of the service to query. + * @returns {boolean} returns true if injector has given service. + */ + +/** + * @ngdoc method + * @name AUTO.$injector#instantiate + * @methodOf AUTO.$injector + * @description + * Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies + * all of the arguments to the constructor function as specified by the constructor annotation. + * + * @param {function} Type Annotated constructor function. + * @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before + * the `$injector` is consulted. + * @returns {Object} new instance of `Type`. + */ + +/** + * @ngdoc method + * @name AUTO.$injector#annotate + * @methodOf AUTO.$injector + * + * @description + * Returns an array of service names which the function is requesting for injection. This API is used by the injector + * to determine which services need to be injected into the function when the function is invoked. There are three + * ways in which the function can be annotated with the needed dependencies. + * + * # Argument names + * + * The simplest form is to extract the dependencies from the arguments of the function. This is done by converting + * the function into a string using `toString()` method and extracting the argument names. + *
    + *   // Given
    + *   function MyController($scope, $route) {
    + *     // ...
    + *   }
    + *
    + *   // Then
    + *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
    + * 
    + * + * This method does not work with code minfication / obfuscation. For this reason the following annotation strategies + * are supported. + * + * # The `$inject` property + * + * If a function has an `$inject` property and its value is an array of strings, then the strings represent names of + * services to be injected into the function. + *
    + *   // Given
    + *   var MyController = function(obfuscatedScope, obfuscatedRoute) {
    + *     // ...
    + *   }
    + *   // Define function dependencies
    + *   MyController.$inject = ['$scope', '$route'];
    + *
    + *   // Then
    + *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
    + * 
    + * + * # The array notation + * + * It is often desirable to inline Injected functions and that's when setting the `$inject` property is very + * inconvenient. In these situations using the array notation to specify the dependencies in a way that survives + * minification is a better choice: + * + *
    + *   // We wish to write this (not minification / obfuscation safe)
    + *   injector.invoke(function($compile, $rootScope) {
    + *     // ...
    + *   });
    + *
    + *   // We are forced to write break inlining
    + *   var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {
    + *     // ...
    + *   };
    + *   tmpFn.$inject = ['$compile', '$rootScope'];
    + *   injector.invoke(tmpFn);
    + *
    + *   // To better support inline function the inline annotation is supported
    + *   injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {
    + *     // ...
    + *   }]);
    + *
    + *   // Therefore
    + *   expect(injector.annotate(
    + *      ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])
    + *    ).toEqual(['$compile', '$rootScope']);
    + * 
    + * + * @param {function|Array.} fn Function for which dependent service names need to be retrieved as described + * above. + * + * @returns {Array.} The names of the services which the function requires. + */ + + + + +/** + * @ngdoc object + * @name AUTO.$provide + * + * @description + * + * Use `$provide` to register new providers with the `$injector`. The providers are the factories for the instance. + * The providers share the same name as the instance they create with `Provider` suffixed to them. + * + * A provider is an object with a `$get()` method. The injector calls the `$get` method to create a new instance of + * a service. The Provider can have additional methods which would allow for configuration of the provider. + * + *
    + *   function GreetProvider() {
    + *     var salutation = 'Hello';
    + *
    + *     this.salutation = function(text) {
    + *       salutation = text;
    + *     };
    + *
    + *     this.$get = function() {
    + *       return function (name) {
    + *         return salutation + ' ' + name + '!';
    + *       };
    + *     };
    + *   }
    + *
    + *   describe('Greeter', function(){
    + *
    + *     beforeEach(module(function($provide) {
    + *       $provide.provider('greet', GreetProvider);
    + *     }));
    + *
    + *     it('should greet', inject(function(greet) {
    + *       expect(greet('angular')).toEqual('Hello angular!');
    + *     }));
    + *
    + *     it('should allow configuration of salutation', function() {
    + *       module(function(greetProvider) {
    + *         greetProvider.salutation('Ahoj');
    + *       });
    + *       inject(function(greet) {
    + *         expect(greet('angular')).toEqual('Ahoj angular!');
    + *       });
    + *     });
    + * 
    + */ + +/** + * @ngdoc method + * @name AUTO.$provide#provider + * @methodOf AUTO.$provide + * @description + * + * Register a provider for a service. The providers can be retrieved and can have additional configuration methods. + * + * @param {string} name The name of the instance. NOTE: the provider will be available under `name + 'Provider'` key. + * @param {(Object|function())} provider If the provider is: + * + * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using + * {@link AUTO.$injector#invoke $injector.invoke()} when an instance needs to be created. + * - `Constructor`: a new instance of the provider will be created using + * {@link AUTO.$injector#instantiate $injector.instantiate()}, then treated as `object`. + * + * @returns {Object} registered provider instance + */ + +/** + * @ngdoc method + * @name AUTO.$provide#factory + * @methodOf AUTO.$provide + * @description + * + * A short hand for configuring services if only `$get` method is required. + * + * @param {string} name The name of the instance. + * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand for + * `$provide.provider(name, {$get: $getFn})`. + * @returns {Object} registered provider instance + */ + + +/** + * @ngdoc method + * @name AUTO.$provide#service + * @methodOf AUTO.$provide + * @description + * + * A short hand for registering service of given class. + * + * @param {string} name The name of the instance. + * @param {Function} constructor A class (constructor function) that will be instantiated. + * @returns {Object} registered provider instance + */ + + +/** + * @ngdoc method + * @name AUTO.$provide#value + * @methodOf AUTO.$provide + * @description + * + * A short hand for configuring services if the `$get` method is a constant. + * + * @param {string} name The name of the instance. + * @param {*} value The value. + * @returns {Object} registered provider instance + */ + + +/** + * @ngdoc method + * @name AUTO.$provide#constant + * @methodOf AUTO.$provide + * @description + * + * A constant value, but unlike {@link AUTO.$provide#value value} it can be injected + * into configuration function (other modules) and it is not interceptable by + * {@link AUTO.$provide#decorator decorator}. + * + * @param {string} name The name of the constant. + * @param {*} value The constant value. + * @returns {Object} registered instance + */ + + +/** + * @ngdoc method + * @name AUTO.$provide#decorator + * @methodOf AUTO.$provide + * @description + * + * Decoration of service, allows the decorator to intercept the service instance creation. The + * returned instance may be the original instance, or a new instance which delegates to the + * original instance. + * + * @param {string} name The name of the service to decorate. + * @param {function()} decorator This function will be invoked when the service needs to be + * instantiated. The function is called using the {@link AUTO.$injector#invoke + * injector.invoke} method and is therefore fully injectable. Local injection arguments: + * + * * `$delegate` - The original service instance, which can be monkey patched, configured, + * decorated or delegated to. + */ + + +function createInjector(modulesToLoad) { + var INSTANTIATING = {}, + providerSuffix = 'Provider', + path = [], + loadedModules = new HashMap(), + providerCache = { + $provide: { + provider: supportObject(provider), + factory: supportObject(factory), + service: supportObject(service), + value: supportObject(value), + constant: supportObject(constant), + decorator: decorator + } + }, + providerInjector = (providerCache.$injector = + createInternalInjector(providerCache, function() { + throw Error("Unknown provider: " + path.join(' <- ')); + })), + instanceCache = {}, + instanceInjector = (instanceCache.$injector = + createInternalInjector(instanceCache, function(servicename) { + var provider = providerInjector.get(servicename + providerSuffix); + return instanceInjector.invoke(provider.$get, provider); + })); + + + forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); }); + + return instanceInjector; + + //////////////////////////////////// + // $provider + //////////////////////////////////// + + function supportObject(delegate) { + return function(key, value) { + if (isObject(key)) { + forEach(key, reverseParams(delegate)); + } else { + return delegate(key, value); + } + } + } + + function provider(name, provider_) { + if (isFunction(provider_) || isArray(provider_)) { + provider_ = providerInjector.instantiate(provider_); + } + if (!provider_.$get) { + throw Error('Provider ' + name + ' must define $get factory method.'); + } + return providerCache[name + providerSuffix] = provider_; + } + + function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); } + + function service(name, constructor) { + return factory(name, ['$injector', function($injector) { + return $injector.instantiate(constructor); + }]); + } + + function value(name, value) { return factory(name, valueFn(value)); } + + function constant(name, value) { + providerCache[name] = value; + instanceCache[name] = value; + } + + function decorator(serviceName, decorFn) { + var origProvider = providerInjector.get(serviceName + providerSuffix), + orig$get = origProvider.$get; + + origProvider.$get = function() { + var origInstance = instanceInjector.invoke(orig$get, origProvider); + return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); + }; + } + + //////////////////////////////////// + // Module Loading + //////////////////////////////////// + function loadModules(modulesToLoad){ + var runBlocks = []; + forEach(modulesToLoad, function(module) { + if (loadedModules.get(module)) return; + loadedModules.put(module, true); + if (isString(module)) { + var moduleFn = angularModule(module); + runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); + + try { + for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) { + var invokeArgs = invokeQueue[i], + provider = providerInjector.get(invokeArgs[0]); + + provider[invokeArgs[1]].apply(provider, invokeArgs[2]); + } + } catch (e) { + if (e.message) e.message += ' from ' + module; + throw e; + } + } else if (isFunction(module)) { + try { + runBlocks.push(providerInjector.invoke(module)); + } catch (e) { + if (e.message) e.message += ' from ' + module; + throw e; + } + } else if (isArray(module)) { + try { + runBlocks.push(providerInjector.invoke(module)); + } catch (e) { + if (e.message) e.message += ' from ' + String(module[module.length - 1]); + throw e; + } + } else { + assertArgFn(module, 'module'); + } + }); + return runBlocks; + } + + //////////////////////////////////// + // internal Injector + //////////////////////////////////// + + function createInternalInjector(cache, factory) { + + function getService(serviceName) { + if (typeof serviceName !== 'string') { + throw Error('Service name expected'); + } + if (cache.hasOwnProperty(serviceName)) { + if (cache[serviceName] === INSTANTIATING) { + throw Error('Circular dependency: ' + path.join(' <- ')); + } + return cache[serviceName]; + } else { + try { + path.unshift(serviceName); + cache[serviceName] = INSTANTIATING; + return cache[serviceName] = factory(serviceName); + } finally { + path.shift(); + } + } + } + + function invoke(fn, self, locals){ + var args = [], + $inject = annotate(fn), + length, i, + key; + + for(i = 0, length = $inject.length; i < length; i++) { + key = $inject[i]; + args.push( + locals && locals.hasOwnProperty(key) + ? locals[key] + : getService(key) + ); + } + if (!fn.$inject) { + // this means that we must be an array. + fn = fn[length]; + } + + + // Performance optimization: http://jsperf.com/apply-vs-call-vs-invoke + switch (self ? -1 : args.length) { + case 0: return fn(); + case 1: return fn(args[0]); + case 2: return fn(args[0], args[1]); + case 3: return fn(args[0], args[1], args[2]); + case 4: return fn(args[0], args[1], args[2], args[3]); + case 5: return fn(args[0], args[1], args[2], args[3], args[4]); + case 6: return fn(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + case 8: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + case 9: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); + case 10: return fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); + default: return fn.apply(self, args); + } + } + + function instantiate(Type, locals) { + var Constructor = function() {}, + instance, returnedValue; + + // Check if Type is annotated and use just the given function at n-1 as parameter + // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); + Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; + instance = new Constructor(); + returnedValue = invoke(Type, instance, locals); + + return isObject(returnedValue) ? returnedValue : instance; + } + + return { + invoke: invoke, + instantiate: instantiate, + get: getService, + annotate: annotate, + has: function(name) { + return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); + } + }; + } +} + +/** + * @ngdoc function + * @name ng.$anchorScroll + * @requires $window + * @requires $location + * @requires $rootScope + * + * @description + * When called, it checks current value of `$location.hash()` and scroll to related element, + * according to rules specified in + * {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}. + * + * It also watches the `$location.hash()` and scroll whenever it changes to match any anchor. + * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`. + */ +function $AnchorScrollProvider() { + + var autoScrollingEnabled = true; + + this.disableAutoScrolling = function() { + autoScrollingEnabled = false; + }; + + this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { + var document = $window.document; + + // helper function to get first anchor from a NodeList + // can't use filter.filter, as it accepts only instances of Array + // and IE can't convert NodeList to an array using [].slice + // TODO(vojta): use filter if we change it to accept lists as well + function getFirstAnchor(list) { + var result = null; + forEach(list, function(element) { + if (!result && lowercase(element.nodeName) === 'a') result = element; + }); + return result; + } + + function scroll() { + var hash = $location.hash(), elm; + + // empty hash, scroll to the top of the page + if (!hash) $window.scrollTo(0, 0); + + // element with given id + else if ((elm = document.getElementById(hash))) elm.scrollIntoView(); + + // first anchor with given name :-D + else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView(); + + // no element and hash == 'top', scroll to the top of the page + else if (hash === 'top') $window.scrollTo(0, 0); + } + + // does not scroll when user clicks on anchor link that is currently on + // (no url change, no $location.hash() change), browser native does scroll + if (autoScrollingEnabled) { + $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, + function autoScrollWatchAction() { + $rootScope.$evalAsync(scroll); + }); + } + + return scroll; + }]; +} + + +/** + * @ngdoc object + * @name ng.$animationProvider + * @description + * + * The $AnimationProvider provider allows developers to register and access custom JavaScript animations directly inside + * of a module. + * + */ +$AnimationProvider.$inject = ['$provide']; +function $AnimationProvider($provide) { + var suffix = 'Animation'; + + /** + * @ngdoc function + * @name ng.$animation#register + * @methodOf ng.$animationProvider + * + * @description + * Registers a new injectable animation factory function. The factory function produces the animation object which + * has these two properties: + * + * * `setup`: `function(Element):*` A function which receives the starting state of the element. The purpose + * of this function is to get the element ready for animation. Optionally the function returns an memento which + * is passed to the `start` function. + * * `start`: `function(Element, doneFunction, *)` The element to animate, the `doneFunction` to be called on + * element animation completion, and an optional memento from the `setup` function. + * + * @param {string} name The name of the animation. + * @param {function} factory The factory function that will be executed to return the animation object. + * + */ + this.register = function(name, factory) { + $provide.factory(camelCase(name) + suffix, factory); + }; + + this.$get = ['$injector', function($injector) { + /** + * @ngdoc function + * @name ng.$animation + * @function + * + * @description + * The $animation service is used to retrieve any defined animation functions. When executed, the $animation service + * will return a object that contains the setup and start functions that were defined for the animation. + * + * @param {String} name Name of the animation function to retrieve. Animation functions are registered and stored + * inside of the AngularJS DI so a call to $animate('custom') is the same as injecting `customAnimation` + * via dependency injection. + * @return {Object} the animation object which contains the `setup` and `start` functions that perform the animation. + */ + return function $animation(name) { + if (name) { + var animationName = camelCase(name) + suffix; + if ($injector.has(animationName)) { + return $injector.get(animationName); + } + } + }; + }]; +} + +// NOTE: this is a pseudo directive. + +/** + * @ngdoc directive + * @name ng.directive:ngAnimate + * + * @description + * The `ngAnimate` directive works as an attribute that is attached alongside pre-existing directives. + * It effects how the directive will perform DOM manipulation. This allows for complex animations to take place + * without burdening the directive which uses the animation with animation details. The built in directives + * `ngRepeat`, `ngInclude`, `ngSwitch`, `ngShow`, `ngHide` and `ngView` already accept `ngAnimate` directive. + * Custom directives can take advantage of animation through {@link ng.$animator $animator service}. + * + * Below is a more detailed breakdown of the supported callback events provided by pre-exisitng ng directives: + * + * | Directive | Supported Animations | + * |========================================================== |====================================================| + * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move | + * | {@link ng.directive:ngView#animations ngView} | enter and leave | + * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave | + * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave | + * | {@link ng.directive:ngIf#animations ngIf} | enter and leave | + * | {@link ng.directive:ngShow#animations ngShow & ngHide} | show and hide | + * + * You can find out more information about animations upon visiting each directive page. + * + * Below is an example of a directive that makes use of the ngAnimate attribute: + * + *
    + * 
    + * 
    + *
    + * 
    + * 
    + * 
    + * 
    + *
    + * 
    + * 
    + * 
    + * + * The `event1` and `event2` attributes refer to the animation events specific to the directive that has been assigned. + * + * Keep in mind that if an animation is running, no child element of such animation can also be animated. + * + *

    CSS-defined Animations

    + * By default, ngAnimate attaches two CSS classes per animation event to the DOM element to achieve the animation. + * It is up to you, the developer, to ensure that the animations take place using cross-browser CSS3 transitions as + * well as CSS animations. + * + * The following code below demonstrates how to perform animations using **CSS transitions** with ngAnimate: + * + *
    + * 
    + *
    + * 
    + *
    + * + * The following code below demonstrates how to perform animations using **CSS animations** with ngAnimate: + * + *
    + * 
    + *
    + * 
    + *
    + * + * ngAnimate will first examine any CSS animation code and then fallback to using CSS transitions. + * + * Upon DOM mutation, the event class is added first, then the browser is allowed to reflow the content and then, + * the active class is added to trigger the animation. The ngAnimate directive will automatically extract the duration + * of the animation to determine when the animation ends. Once the animation is over then both CSS classes will be + * removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end + * immediately resulting in a DOM element that is at it's final state. This final state is when the DOM element + * has no CSS transition/animation classes surrounding it. + * + *

    JavaScript-defined Animations

    + * In the event that you do not want to use CSS3 transitions or CSS3 animations or if you wish to offer animations to browsers that do not + * yet support them, then you can make use of JavaScript animations defined inside of your AngularJS module. + * + *
    + * var ngModule = angular.module('YourApp', []);
    + * ngModule.animation('animate-enter', function() {
    + *   return {
    + *     setup : function(element) {
    + *       //prepare the element for animation
    + *       element.css({ 'opacity': 0 });
    + *       var memo = "..."; //this value is passed to the start function
    + *       return memo;
    + *     },
    + *     start : function(element, done, memo) {
    + *       //start the animation
    + *       element.animate({
    + *         'opacity' : 1
    + *       }, function() {
    + *         //call when the animation is complete
    + *         done()
    + *       });
    + *     }
    + *   }
    + * });
    + * 
    + * + * As you can see, the JavaScript code follows a similar template to the CSS3 animations. Once defined, the animation + * can be used in the same way with the ngAnimate attribute. Keep in mind that, when using JavaScript-enabled + * animations, ngAnimate will also add in the same CSS classes that CSS-enabled animations do (even if you're not using + * CSS animations) to animated the element, but it will not attempt to find any CSS3 transition or animation duration/delay values. + * It will instead close off the animation once the provided done function is executed. So it's important that you + * make sure your animations remember to fire off the done function once the animations are complete. + * + * @param {expression} ngAnimate Used to configure the DOM manipulation animations. + * + */ + +var $AnimatorProvider = function() { + var NG_ANIMATE_CONTROLLER = '$ngAnimateController'; + var rootAnimateController = {running:true}; + + this.$get = ['$animation', '$window', '$sniffer', '$rootElement', '$rootScope', + function($animation, $window, $sniffer, $rootElement, $rootScope) { + $rootElement.data(NG_ANIMATE_CONTROLLER, rootAnimateController); + + /** + * @ngdoc function + * @name ng.$animator + * @function + * + * @description + * The $animator.create service provides the DOM manipulation API which is decorated with animations. + * + * @param {Scope} scope the scope for the ng-animate. + * @param {Attributes} attr the attributes object which contains the ngAnimate key / value pair. (The attributes are + * passed into the linking function of the directive using the `$animator`.) + * @return {object} the animator object which contains the enter, leave, move, show, hide and animate methods. + */ + var AnimatorService = function(scope, attrs) { + var animator = {}; + + /** + * @ngdoc function + * @name ng.animator#enter + * @methodOf ng.$animator + * @function + * + * @description + * Injects the element object into the DOM (inside of the parent element) and then runs the enter animation. + * + * @param {jQuery/jqLite element} element the element that will be the focus of the enter animation + * @param {jQuery/jqLite element} parent the parent element of the element that will be the focus of the enter animation + * @param {jQuery/jqLite element} after the sibling element (which is the previous element) of the element that will be the focus of the enter animation + */ + animator.enter = animateActionFactory('enter', insert, noop); + + /** + * @ngdoc function + * @name ng.animator#leave + * @methodOf ng.$animator + * @function + * + * @description + * Runs the leave animation operation and, upon completion, removes the element from the DOM. + * + * @param {jQuery/jqLite element} element the element that will be the focus of the leave animation + * @param {jQuery/jqLite element} parent the parent element of the element that will be the focus of the leave animation + */ + animator.leave = animateActionFactory('leave', noop, remove); + + /** + * @ngdoc function + * @name ng.animator#move + * @methodOf ng.$animator + * @function + * + * @description + * Fires the move DOM operation. Just before the animation starts, the animator will either append it into the parent container or + * add the element directly after the after element if present. Then the move animation will be run. + * + * @param {jQuery/jqLite element} element the element that will be the focus of the move animation + * @param {jQuery/jqLite element} parent the parent element of the element that will be the focus of the move animation + * @param {jQuery/jqLite element} after the sibling element (which is the previous element) of the element that will be the focus of the move animation + */ + animator.move = animateActionFactory('move', move, noop); + + /** + * @ngdoc function + * @name ng.animator#show + * @methodOf ng.$animator + * @function + * + * @description + * Reveals the element by setting the CSS property `display` to `block` and then starts the show animation directly after. + * + * @param {jQuery/jqLite element} element the element that will be rendered visible or hidden + */ + animator.show = animateActionFactory('show', show, noop); + + /** + * @ngdoc function + * @name ng.animator#hide + * @methodOf ng.$animator + * + * @description + * Starts the hide animation first and sets the CSS `display` property to `none` upon completion. + * + * @param {jQuery/jqLite element} element the element that will be rendered visible or hidden + */ + animator.hide = animateActionFactory('hide', noop, hide); + + /** + * @ngdoc function + * @name ng.animator#animate + * @methodOf ng.$animator + * + * @description + * Triggers a custom animation event to be executed on the given element + * + * @param {jQuery/jqLite element} element that will be animated + */ + animator.animate = function(event, element) { + animateActionFactory(event, noop, noop)(element); + } + return animator; + + function animateActionFactory(type, beforeFn, afterFn) { + return function(element, parent, after) { + var ngAnimateValue = scope.$eval(attrs.ngAnimate); + var className = ngAnimateValue + ? isObject(ngAnimateValue) ? ngAnimateValue[type] : ngAnimateValue + '-' + type + : ''; + var animationPolyfill = $animation(className); + var polyfillSetup = animationPolyfill && animationPolyfill.setup; + var polyfillStart = animationPolyfill && animationPolyfill.start; + var polyfillCancel = animationPolyfill && animationPolyfill.cancel; + + if (!className) { + beforeFn(element, parent, after); + afterFn(element, parent, after); + } else { + var activeClassName = className + '-active'; + + if (!parent) { + parent = after ? after.parent() : element.parent(); + } + if ((!$sniffer.transitions && !polyfillSetup && !polyfillStart) || + (parent.inheritedData(NG_ANIMATE_CONTROLLER) || noop).running) { + beforeFn(element, parent, after); + afterFn(element, parent, after); + return; + } + + var animationData = element.data(NG_ANIMATE_CONTROLLER) || {}; + if(animationData.running) { + (polyfillCancel || noop)(element); + animationData.done(); + } + + element.data(NG_ANIMATE_CONTROLLER, {running:true, done:done}); + element.addClass(className); + beforeFn(element, parent, after); + if (element.length == 0) return done(); + + var memento = (polyfillSetup || noop)(element); + + // $window.setTimeout(beginAnimation, 0); this was causing the element not to animate + // keep at 1 for animation dom rerender + $window.setTimeout(beginAnimation, 1); + } + + function parseMaxTime(str) { + var total = 0, values = isString(str) ? str.split(/\s*,\s*/) : []; + forEach(values, function(value) { + total = Math.max(parseFloat(value) || 0, total); + }); + return total; + } + + function beginAnimation() { + element.addClass(activeClassName); + if (polyfillStart) { + polyfillStart(element, done, memento); + } else if (isFunction($window.getComputedStyle)) { + //one day all browsers will have these properties + var w3cAnimationProp = 'animation'; + var w3cTransitionProp = 'transition'; + + //but some still use vendor-prefixed styles + var vendorAnimationProp = $sniffer.vendorPrefix + 'Animation'; + var vendorTransitionProp = $sniffer.vendorPrefix + 'Transition'; + + var durationKey = 'Duration', + delayKey = 'Delay', + animationIterationCountKey = 'IterationCount', + duration = 0; + + //we want all the styles defined before and after + var ELEMENT_NODE = 1; + forEach(element, function(element) { + if (element.nodeType == ELEMENT_NODE) { + var w3cProp = w3cTransitionProp, + vendorProp = vendorTransitionProp, + iterations = 1, + elementStyles = $window.getComputedStyle(element) || {}; + + //use CSS Animations over CSS Transitions + if(parseFloat(elementStyles[w3cAnimationProp + durationKey]) > 0 || + parseFloat(elementStyles[vendorAnimationProp + durationKey]) > 0) { + w3cProp = w3cAnimationProp; + vendorProp = vendorAnimationProp; + iterations = Math.max(parseInt(elementStyles[w3cProp + animationIterationCountKey]) || 0, + parseInt(elementStyles[vendorProp + animationIterationCountKey]) || 0, + iterations); + } + + var parsedDelay = Math.max(parseMaxTime(elementStyles[w3cProp + delayKey]), + parseMaxTime(elementStyles[vendorProp + delayKey])); + + var parsedDuration = Math.max(parseMaxTime(elementStyles[w3cProp + durationKey]), + parseMaxTime(elementStyles[vendorProp + durationKey])); + + duration = Math.max(parsedDelay + (iterations * parsedDuration), duration); + } + }); + $window.setTimeout(done, duration * 1000); + } else { + done(); + } + } + + function done() { + if(!done.run) { + done.run = true; + afterFn(element, parent, after); + element.removeClass(className); + element.removeClass(activeClassName); + element.removeData(NG_ANIMATE_CONTROLLER); + } + } + }; + } + + function show(element) { + element.css('display', ''); + } + + function hide(element) { + element.css('display', 'none'); + } + + function insert(element, parent, after) { + if (after) { + after.after(element); + } else { + parent.append(element); + } + } + + function remove(element) { + element.remove(); + } + + function move(element, parent, after) { + // Do not remove element before insert. Removing will cause data associated with the + // element to be dropped. Insert will implicitly do the remove. + insert(element, parent, after); + } + }; + + /** + * @ngdoc function + * @name ng.animator#enabled + * @methodOf ng.$animator + * @function + * + * @param {Boolean=} If provided then set the animation on or off. + * @return {Boolean} Current animation state. + * + * @description + * Globally enables/disables animations. + * + */ + AnimatorService.enabled = function(value) { + if (arguments.length) { + rootAnimateController.running = !value; + } + return !rootAnimateController.running; + }; + + return AnimatorService; + }]; +}; + +/** + * ! This is a private undocumented service ! + * + * @name ng.$browser + * @requires $log + * @description + * This object has two goals: + * + * - hide all the global state in the browser caused by the window object + * - abstract away all the browser specific features and inconsistencies + * + * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` + * service, which can be used for convenient testing of the application without the interaction with + * the real browser apis. + */ +/** + * @param {object} window The global window object. + * @param {object} document jQuery wrapped document. + * @param {function()} XHR XMLHttpRequest constructor. + * @param {object} $log console.log or an object with the same interface. + * @param {object} $sniffer $sniffer service + */ +function Browser(window, document, $log, $sniffer) { + var self = this, + rawDocument = document[0], + location = window.location, + history = window.history, + setTimeout = window.setTimeout, + clearTimeout = window.clearTimeout, + pendingDeferIds = {}; + + self.isMock = false; + + var outstandingRequestCount = 0; + var outstandingRequestCallbacks = []; + + // TODO(vojta): remove this temporary api + self.$$completeOutstandingRequest = completeOutstandingRequest; + self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; + + /** + * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` + * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. + */ + function completeOutstandingRequest(fn) { + try { + fn.apply(null, sliceArgs(arguments, 1)); + } finally { + outstandingRequestCount--; + if (outstandingRequestCount === 0) { + while(outstandingRequestCallbacks.length) { + try { + outstandingRequestCallbacks.pop()(); + } catch (e) { + $log.error(e); + } + } + } + } + } + + /** + * @private + * Note: this method is used only by scenario runner + * TODO(vojta): prefix this method with $$ ? + * @param {function()} callback Function that will be called when no outstanding request + */ + self.notifyWhenNoOutstandingRequests = function(callback) { + // force browser to execute all pollFns - this is needed so that cookies and other pollers fire + // at some deterministic time in respect to the test runner's actions. Leaving things up to the + // regular poller would result in flaky tests. + forEach(pollFns, function(pollFn){ pollFn(); }); + + if (outstandingRequestCount === 0) { + callback(); + } else { + outstandingRequestCallbacks.push(callback); + } + }; + + ////////////////////////////////////////////////////////////// + // Poll Watcher API + ////////////////////////////////////////////////////////////// + var pollFns = [], + pollTimeout; + + /** + * @name ng.$browser#addPollFn + * @methodOf ng.$browser + * + * @param {function()} fn Poll function to add + * + * @description + * Adds a function to the list of functions that poller periodically executes, + * and starts polling if not started yet. + * + * @returns {function()} the added function + */ + self.addPollFn = function(fn) { + if (isUndefined(pollTimeout)) startPoller(100, setTimeout); + pollFns.push(fn); + return fn; + }; + + /** + * @param {number} interval How often should browser call poll functions (ms) + * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. + * + * @description + * Configures the poller to run in the specified intervals, using the specified + * setTimeout fn and kicks it off. + */ + function startPoller(interval, setTimeout) { + (function check() { + forEach(pollFns, function(pollFn){ pollFn(); }); + pollTimeout = setTimeout(check, interval); + })(); + } + + ////////////////////////////////////////////////////////////// + // URL API + ////////////////////////////////////////////////////////////// + + var lastBrowserUrl = location.href, + baseElement = document.find('base'); + + /** + * @name ng.$browser#url + * @methodOf ng.$browser + * + * @description + * GETTER: + * Without any argument, this method just returns current value of location.href. + * + * SETTER: + * With at least one argument, this method sets url to new value. + * If html5 history api supported, pushState/replaceState is used, otherwise + * location.href/location.replace is used. + * Returns its own instance to allow chaining + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to change url. + * + * @param {string} url New url (when used as setter) + * @param {boolean=} replace Should new url replace current history record ? + */ + self.url = function(url, replace) { + // setter + if (url) { + if (lastBrowserUrl == url) return; + lastBrowserUrl = url; + if ($sniffer.history) { + if (replace) history.replaceState(null, '', url); + else { + history.pushState(null, '', url); + // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462 + baseElement.attr('href', baseElement.attr('href')); + } + } else { + if (replace) location.replace(url); + else location.href = url; + } + return self; + // getter + } else { + // the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 + return location.href.replace(/%27/g,"'"); + } + }; + + var urlChangeListeners = [], + urlChangeInit = false; + + function fireUrlChange() { + if (lastBrowserUrl == self.url()) return; + + lastBrowserUrl = self.url(); + forEach(urlChangeListeners, function(listener) { + listener(self.url()); + }); + } + + /** + * @name ng.$browser#onUrlChange + * @methodOf ng.$browser + * @TODO(vojta): refactor to use node's syntax for events + * + * @description + * Register callback function that will be called, when url changes. + * + * It's only called when the url is changed by outside of angular: + * - user types different url into address bar + * - user clicks on history (forward/back) button + * - user clicks on a link + * + * It's not called when url is changed by $browser.url() method + * + * The listener gets called with new url as parameter. + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to monitor url changes in angular apps. + * + * @param {function(string)} listener Listener function to be called when url changes. + * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. + */ + self.onUrlChange = function(callback) { + if (!urlChangeInit) { + // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) + // don't fire popstate when user change the address bar and don't fire hashchange when url + // changed by push/replaceState + + // html5 history api - popstate event + if ($sniffer.history) jqLite(window).bind('popstate', fireUrlChange); + // hashchange event + if ($sniffer.hashchange) jqLite(window).bind('hashchange', fireUrlChange); + // polling + else self.addPollFn(fireUrlChange); + + urlChangeInit = true; + } + + urlChangeListeners.push(callback); + return callback; + }; + + ////////////////////////////////////////////////////////////// + // Misc API + ////////////////////////////////////////////////////////////// + + /** + * Returns current + * (always relative - without domain) + * + * @returns {string=} + */ + self.baseHref = function() { + var href = baseElement.attr('href'); + return href ? href.replace(/^https?\:\/\/[^\/]*/, '') : ''; + }; + + ////////////////////////////////////////////////////////////// + // Cookies API + ////////////////////////////////////////////////////////////// + var lastCookies = {}; + var lastCookieString = ''; + var cookiePath = self.baseHref(); + + /** + * @name ng.$browser#cookies + * @methodOf ng.$browser + * + * @param {string=} name Cookie name + * @param {string=} value Cookie value + * + * @description + * The cookies method provides a 'private' low level access to browser cookies. + * It is not meant to be used directly, use the $cookie service instead. + * + * The return values vary depending on the arguments that the method was called with as follows: + *
      + *
    • cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify it
    • + *
    • cookies(name, value) -> set name to value, if value is undefined delete the cookie
    • + *
    • cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)
    • + *
    + * + * @returns {Object} Hash of all cookies (if called without any parameter) + */ + self.cookies = function(name, value) { + var cookieLength, cookieArray, cookie, i, index; + + if (name) { + if (value === undefined) { + rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; + } else { + if (isString(value)) { + cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) + ';path=' + cookiePath).length + 1; + + // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: + // - 300 cookies + // - 20 cookies per unique domain + // - 4096 bytes per cookie + if (cookieLength > 4096) { + $log.warn("Cookie '"+ name +"' possibly not set or overflowed because it was too large ("+ + cookieLength + " > 4096 bytes)!"); + } + } + } + } else { + if (rawDocument.cookie !== lastCookieString) { + lastCookieString = rawDocument.cookie; + cookieArray = lastCookieString.split("; "); + lastCookies = {}; + + for (i = 0; i < cookieArray.length; i++) { + cookie = cookieArray[i]; + index = cookie.indexOf('='); + if (index > 0) { //ignore nameless cookies + var name = unescape(cookie.substring(0, index)); + // the first value that is seen for a cookie is the most + // specific one. values for the same cookie name that + // follow are for less specific paths. + if (lastCookies[name] === undefined) { + lastCookies[name] = unescape(cookie.substring(index + 1)); + } + } + } + } + return lastCookies; + } + }; + + + /** + * @name ng.$browser#defer + * @methodOf ng.$browser + * @param {function()} fn A function, who's execution should be defered. + * @param {number=} [delay=0] of milliseconds to defer the function execution. + * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. + * + * @description + * Executes a fn asynchronously via `setTimeout(fn, delay)`. + * + * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using + * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed + * via `$browser.defer.flush()`. + * + */ + self.defer = function(fn, delay) { + var timeoutId; + outstandingRequestCount++; + timeoutId = setTimeout(function() { + delete pendingDeferIds[timeoutId]; + completeOutstandingRequest(fn); + }, delay || 0); + pendingDeferIds[timeoutId] = true; + return timeoutId; + }; + + + /** + * @name ng.$browser#defer.cancel + * @methodOf ng.$browser.defer + * + * @description + * Cancels a defered task identified with `deferId`. + * + * @param {*} deferId Token returned by the `$browser.defer` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully canceled. + */ + self.defer.cancel = function(deferId) { + if (pendingDeferIds[deferId]) { + delete pendingDeferIds[deferId]; + clearTimeout(deferId); + completeOutstandingRequest(noop); + return true; + } + return false; + }; + +} + +function $BrowserProvider(){ + this.$get = ['$window', '$log', '$sniffer', '$document', + function( $window, $log, $sniffer, $document){ + return new Browser($window, $document, $log, $sniffer); + }]; +} + +/** + * @ngdoc object + * @name ng.$cacheFactory + * + * @description + * Factory that constructs cache objects. + * + * + * @param {string} cacheId Name or id of the newly created cache. + * @param {object=} options Options object that specifies the cache behavior. Properties: + * + * - `{number=}` `capacity` — turns the cache into LRU cache. + * + * @returns {object} Newly created cache object with the following set of methods: + * + * - `{object}` `info()` — Returns id, size, and options of cache. + * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns it. + * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. + * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. + * - `{void}` `removeAll()` — Removes all cached values. + * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. + * + */ +function $CacheFactoryProvider() { + + this.$get = function() { + var caches = {}; + + function cacheFactory(cacheId, options) { + if (cacheId in caches) { + throw Error('cacheId ' + cacheId + ' taken'); + } + + var size = 0, + stats = extend({}, options, {id: cacheId}), + data = {}, + capacity = (options && options.capacity) || Number.MAX_VALUE, + lruHash = {}, + freshEnd = null, + staleEnd = null; + + return caches[cacheId] = { + + put: function(key, value) { + var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); + + refresh(lruEntry); + + if (isUndefined(value)) return; + if (!(key in data)) size++; + data[key] = value; + + if (size > capacity) { + this.remove(staleEnd.key); + } + + return value; + }, + + + get: function(key) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + refresh(lruEntry); + + return data[key]; + }, + + + remove: function(key) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + if (lruEntry == freshEnd) freshEnd = lruEntry.p; + if (lruEntry == staleEnd) staleEnd = lruEntry.n; + link(lruEntry.n,lruEntry.p); + + delete lruHash[key]; + delete data[key]; + size--; + }, + + + removeAll: function() { + data = {}; + size = 0; + lruHash = {}; + freshEnd = staleEnd = null; + }, + + + destroy: function() { + data = null; + stats = null; + lruHash = null; + delete caches[cacheId]; + }, + + + info: function() { + return extend({}, stats, {size: size}); + } + }; + + + /** + * makes the `entry` the freshEnd of the LRU linked list + */ + function refresh(entry) { + if (entry != freshEnd) { + if (!staleEnd) { + staleEnd = entry; + } else if (staleEnd == entry) { + staleEnd = entry.n; + } + + link(entry.n, entry.p); + link(entry, freshEnd); + freshEnd = entry; + freshEnd.n = null; + } + } + + + /** + * bidirectionally links two entries of the LRU linked list + */ + function link(nextEntry, prevEntry) { + if (nextEntry != prevEntry) { + if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify + if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify + } + } + } + + + cacheFactory.info = function() { + var info = {}; + forEach(caches, function(cache, cacheId) { + info[cacheId] = cache.info(); + }); + return info; + }; + + + cacheFactory.get = function(cacheId) { + return caches[cacheId]; + }; + + + return cacheFactory; + }; +} + +/** + * @ngdoc object + * @name ng.$templateCache + * + * @description + * Cache used for storing html templates. + * + * See {@link ng.$cacheFactory $cacheFactory}. + * + */ +function $TemplateCacheProvider() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('templates'); + }]; +} + +/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! + * + * DOM-related variables: + * + * - "node" - DOM Node + * - "element" - DOM Element or Node + * - "$node" or "$element" - jqLite-wrapped node or element + * + * + * Compiler related stuff: + * + * - "linkFn" - linking fn of a single directive + * - "nodeLinkFn" - function that aggregates all linking fns for a particular node + * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node + * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) + */ + + +var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; + + +/** + * @ngdoc function + * @name ng.$compile + * @function + * + * @description + * Compiles a piece of HTML string or DOM into a template and produces a template function, which + * can then be used to link {@link ng.$rootScope.Scope scope} and the template together. + * + * The compilation is a process of walking the DOM tree and trying to match DOM elements to + * {@link ng.$compileProvider#directive directives}. For each match it + * executes corresponding template function and collects the + * instance functions into a single template function which is then returned. + * + * The template function can then be used once to produce the view or as it is the case with + * {@link ng.directive:ngRepeat repeater} many-times, in which + * case each call results in a view that is a DOM clone of the original template. + * + + + +
    +
    +
    +
    +
    +
    + + it('should auto compile', function() { + expect(element('div[compile]').text()).toBe('Hello Angular'); + input('html').enter('{{name}}!'); + expect(element('div[compile]').text()).toBe('Angular!'); + }); + +
    + + * + * + * @param {string|DOMElement} element Element or HTML string to compile into a template function. + * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. + * @param {number} maxPriority only apply directives lower then given priority (Only effects the + * root element(s), not their children) + * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template + * (a DOM element/tree) to a scope. Where: + * + * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. + * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the + * `template` and call the `cloneAttachFn` function allowing the caller to attach the + * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is + * called as:
    `cloneAttachFn(clonedElement, scope)` where: + * + * * `clonedElement` - is a clone of the original `element` passed into the compiler. + * * `scope` - is the current scope with which the linking function is working with. + * + * Calling the linking function returns the element of the template. It is either the original element + * passed in, or the clone of the element if the `cloneAttachFn` is provided. + * + * After linking the view is not updated until after a call to $digest which typically is done by + * Angular automatically. + * + * If you need access to the bound view, there are two ways to do it: + * + * - If you are not asking the linking function to clone the template, create the DOM element(s) + * before you send them to the compiler and keep this reference around. + *
    + *     var element = $compile('

    {{total}}

    ')(scope); + *
    + * + * - if on the other hand, you need the element to be cloned, the view reference from the original + * example would not point to the clone, but rather to the original template that was cloned. In + * this case, you can access the clone via the cloneAttachFn: + *
    + *     var templateHTML = angular.element('

    {{total}}

    '), + * scope = ....; + * + * var clonedElement = $compile(templateHTML)(scope, function(clonedElement, scope) { + * //attach the clone to DOM document at the right place + * }); + * + * //now we have reference to the cloned DOM via `clone` + *
    + * + * + * For information on how the compiler works, see the + * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide. + */ + + +/** + * @ngdoc service + * @name ng.$compileProvider + * @function + * + * @description + */ +$CompileProvider.$inject = ['$provide']; +function $CompileProvider($provide) { + var hasDirectives = {}, + Suffix = 'Directive', + COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, + CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/, + MULTI_ROOT_TEMPLATE_ERROR = 'Template must have exactly one root element. was: ', + urlSanitizationWhitelist = /^\s*(https?|ftp|mailto|file):/; + + + /** + * @ngdoc function + * @name ng.$compileProvider#directive + * @methodOf ng.$compileProvider + * @function + * + * @description + * Register a new directives with the compiler. + * + * @param {string} name Name of the directive in camel-case. (ie ngBind which will match as + * ng-bind). + * @param {function} directiveFactory An injectable directive factory function. See {@link guide/directive} for more + * info. + * @returns {ng.$compileProvider} Self for chaining. + */ + this.directive = function registerDirective(name, directiveFactory) { + if (isString(name)) { + assertArg(directiveFactory, 'directive'); + if (!hasDirectives.hasOwnProperty(name)) { + hasDirectives[name] = []; + $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', + function($injector, $exceptionHandler) { + var directives = []; + forEach(hasDirectives[name], function(directiveFactory) { + try { + var directive = $injector.invoke(directiveFactory); + if (isFunction(directive)) { + directive = { compile: valueFn(directive) }; + } else if (!directive.compile && directive.link) { + directive.compile = valueFn(directive.link); + } + directive.priority = directive.priority || 0; + directive.name = directive.name || name; + directive.require = directive.require || (directive.controller && directive.name); + directive.restrict = directive.restrict || 'A'; + directives.push(directive); + } catch (e) { + $exceptionHandler(e); + } + }); + return directives; + }]); + } + hasDirectives[name].push(directiveFactory); + } else { + forEach(name, reverseParams(registerDirective)); + } + return this; + }; + + + /** + * @ngdoc function + * @name ng.$compileProvider#urlSanitizationWhitelist + * @methodOf ng.$compileProvider + * @function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into an + * absolute url. Afterwards the url is matched against the `urlSanitizationWhitelist` regular + * expression. If a match is found the original url is written into the dom. Otherwise the + * absolute url is prefixed with `'unsafe:'` string and only then it is written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.urlSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + urlSanitizationWhitelist = regexp; + return this; + } + return urlSanitizationWhitelist; + }; + + + this.$get = [ + '$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse', + '$controller', '$rootScope', '$document', + function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse, + $controller, $rootScope, $document) { + + var Attributes = function(element, attr) { + this.$$element = element; + this.$attr = attr || {}; + }; + + Attributes.prototype = { + $normalize: directiveNormalize, + + + /** + * Set a normalized attribute on the element in a way such that all directives + * can share the attribute. This function properly handles boolean attributes. + * @param {string} key Normalized key. (ie ngAttribute) + * @param {string|boolean} value The value to set. If `null` attribute will be deleted. + * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. + * Defaults to true. + * @param {string=} attrName Optional none normalized name. Defaults to key. + */ + $set: function(key, value, writeAttr, attrName) { + var booleanKey = getBooleanAttrName(this.$$element[0], key), + $$observers = this.$$observers, + normalizedVal; + + if (booleanKey) { + this.$$element.prop(key, value); + attrName = booleanKey; + } + + this[key] = value; + + // translate normalized key to actual key + if (attrName) { + this.$attr[key] = attrName; + } else { + attrName = this.$attr[key]; + if (!attrName) { + this.$attr[key] = attrName = snake_case(key, '-'); + } + } + + + // sanitize a[href] values + if (nodeName_(this.$$element[0]) === 'A' && key === 'href') { + urlSanitizationNode.setAttribute('href', value); + + // href property always returns normalized absolute url, so we can match against that + normalizedVal = urlSanitizationNode.href; + if (!normalizedVal.match(urlSanitizationWhitelist)) { + this[key] = value = 'unsafe:' + normalizedVal; + } + } + + + if (writeAttr !== false) { + if (value === null || value === undefined) { + this.$$element.removeAttr(attrName); + } else { + this.$$element.attr(attrName, value); + } + } + + // fire observers + $$observers && forEach($$observers[key], function(fn) { + try { + fn(value); + } catch (e) { + $exceptionHandler(e); + } + }); + }, + + + /** + * Observe an interpolated attribute. + * The observer will never be called, if given attribute is not interpolated. + * + * @param {string} key Normalized key. (ie ngAttribute) . + * @param {function(*)} fn Function that will be called whenever the attribute value changes. + * @returns {function(*)} the `fn` Function passed in. + */ + $observe: function(key, fn) { + var attrs = this, + $$observers = (attrs.$$observers || (attrs.$$observers = {})), + listeners = ($$observers[key] || ($$observers[key] = [])); + + listeners.push(fn); + $rootScope.$evalAsync(function() { + if (!listeners.$$inter) { + // no one registered attribute interpolation function, so lets call it manually + fn(attrs[key]); + } + }); + return fn; + } + }; + + var urlSanitizationNode = $document[0].createElement('a'), + startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(), + denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}') + ? identity + : function denormalizeTemplate(template) { + return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); + }, + NG_ATTR_BINDING = /^ngAttr[A-Z]/; + + + return compile; + + //================================ + + function compile($compileNodes, transcludeFn, maxPriority) { + if (!($compileNodes instanceof jqLite)) { + // jquery always rewraps, whereas we need to preserve the original selector so that we can modify it. + $compileNodes = jqLite($compileNodes); + } + // We can not compile top level text elements since text nodes can be merged and we will + // not be able to attach scope data to them, so we will wrap them in + forEach($compileNodes, function(node, index){ + if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) { + $compileNodes[index] = jqLite(node).wrap('').parent()[0]; + } + }); + var compositeLinkFn = compileNodes($compileNodes, transcludeFn, $compileNodes, maxPriority); + return function publicLinkFn(scope, cloneConnectFn){ + assertArg(scope, 'scope'); + // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart + // and sometimes changes the structure of the DOM. + var $linkNode = cloneConnectFn + ? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!! + : $compileNodes; + + // Attach scope only to non-text nodes. + for(var i = 0, ii = $linkNode.length; i + addDirective(directives, + directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority); + + // iterate over the attributes + for (var attr, name, nName, ngAttrName, value, nAttrs = node.attributes, + j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { + attr = nAttrs[j]; + if (attr.specified) { + name = attr.name; + // support ngAttr attribute binding + ngAttrName = directiveNormalize(name); + if (NG_ATTR_BINDING.test(ngAttrName)) { + name = ngAttrName.substr(6).toLowerCase(); + } + nName = directiveNormalize(name.toLowerCase()); + attrsMap[nName] = name; + attrs[nName] = value = trim((msie && name == 'href') + ? decodeURIComponent(node.getAttribute(name, 2)) + : attr.value); + if (getBooleanAttrName(node, nName)) { + attrs[nName] = true; // presence means true + } + addAttrInterpolateDirective(node, directives, value, nName); + addDirective(directives, nName, 'A', maxPriority); + } + } + + // use class as directive + className = node.className; + if (isString(className) && className !== '') { + while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) { + nName = directiveNormalize(match[2]); + if (addDirective(directives, nName, 'C', maxPriority)) { + attrs[nName] = trim(match[3]); + } + className = className.substr(match.index + match[0].length); + } + } + break; + case 3: /* Text Node */ + addTextInterpolateDirective(directives, node.nodeValue); + break; + case 8: /* Comment */ + try { + match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); + if (match) { + nName = directiveNormalize(match[1]); + if (addDirective(directives, nName, 'M', maxPriority)) { + attrs[nName] = trim(match[2]); + } + } + } catch (e) { + // turns out that under some circumstances IE9 throws errors when one attempts to read comment's node value. + // Just ignore it and continue. (Can't seem to reproduce in test case.) + } + break; + } + + directives.sort(byPriority); + return directives; + } + + + /** + * Once the directives have been collected, their compile functions are executed. This method + * is responsible for inlining directive templates as well as terminating the application + * of the directives if the terminal directive has been reached. + * + * @param {Array} directives Array of collected directives to execute their compile function. + * this needs to be pre-sorted by priority order. + * @param {Node} compileNode The raw DOM node to apply the compile functions to + * @param {Object} templateAttrs The shared attribute function + * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * scope argument is auto-generated to the new child of the transcluded parent scope. + * @param {JQLite} jqCollection If we are working on the root of the compile tree then this + * argument has the root jqLite array so that we can replace nodes on it. + * @returns linkFn + */ + function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, jqCollection) { + var terminalPriority = -Number.MAX_VALUE, + preLinkFns = [], + postLinkFns = [], + newScopeDirective = null, + newIsolateScopeDirective = null, + templateDirective = null, + $compileNode = templateAttrs.$$element = jqLite(compileNode), + directive, + directiveName, + $template, + transcludeDirective, + childTranscludeFn = transcludeFn, + controllerDirectives, + linkFn, + directiveValue; + + // executes all directives on the current element + for(var i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + $template = undefined; + + if (terminalPriority > directive.priority) { + break; // prevent further processing of directives + } + + if (directiveValue = directive.scope) { + assertNoDuplicate('isolated scope', newIsolateScopeDirective, directive, $compileNode); + if (isObject(directiveValue)) { + safeAddClass($compileNode, 'ng-isolate-scope'); + newIsolateScopeDirective = directive; + } + safeAddClass($compileNode, 'ng-scope'); + newScopeDirective = newScopeDirective || directive; + } + + directiveName = directive.name; + + if (directiveValue = directive.controller) { + controllerDirectives = controllerDirectives || {}; + assertNoDuplicate("'" + directiveName + "' controller", + controllerDirectives[directiveName], directive, $compileNode); + controllerDirectives[directiveName] = directive; + } + + if (directiveValue = directive.transclude) { + assertNoDuplicate('transclusion', transcludeDirective, directive, $compileNode); + transcludeDirective = directive; + terminalPriority = directive.priority; + if (directiveValue == 'element') { + $template = jqLite(compileNode); + $compileNode = templateAttrs.$$element = + jqLite(document.createComment(' ' + directiveName + ': ' + templateAttrs[directiveName] + ' ')); + compileNode = $compileNode[0]; + replaceWith(jqCollection, jqLite($template[0]), compileNode); + childTranscludeFn = compile($template, transcludeFn, terminalPriority); + } else { + $template = jqLite(JQLiteClone(compileNode)).contents(); + $compileNode.html(''); // clear contents + childTranscludeFn = compile($template, transcludeFn); + } + } + + if (directive.template) { + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + directiveValue = (isFunction(directive.template)) + ? directive.template($compileNode, templateAttrs) + : directive.template; + + directiveValue = denormalizeTemplate(directiveValue); + + if (directive.replace) { + $template = jqLite('
    ' + + trim(directiveValue) + + '
    ').contents(); + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== 1) { + throw new Error(MULTI_ROOT_TEMPLATE_ERROR + directiveValue); + } + + replaceWith(jqCollection, $compileNode, compileNode); + + var newTemplateAttrs = {$attr: {}}; + + // combine directives from the original node and from the template: + // - take the array of directives for this element + // - split it into two parts, those that were already applied and those that weren't + // - collect directives from the template, add them to the second group and sort them + // - append the second group with new directives to the first group + directives = directives.concat( + collectDirectives( + compileNode, + directives.splice(i + 1, directives.length - (i + 1)), + newTemplateAttrs + ) + ); + mergeTemplateAttributes(templateAttrs, newTemplateAttrs); + + ii = directives.length; + } else { + $compileNode.html(directiveValue); + } + } + + if (directive.templateUrl) { + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), + nodeLinkFn, $compileNode, templateAttrs, jqCollection, directive.replace, + childTranscludeFn); + ii = directives.length; + } else if (directive.compile) { + try { + linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); + if (isFunction(linkFn)) { + addLinkFns(null, linkFn); + } else if (linkFn) { + addLinkFns(linkFn.pre, linkFn.post); + } + } catch (e) { + $exceptionHandler(e, startingTag($compileNode)); + } + } + + if (directive.terminal) { + nodeLinkFn.terminal = true; + terminalPriority = Math.max(terminalPriority, directive.priority); + } + + } + + nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope; + nodeLinkFn.transclude = transcludeDirective && childTranscludeFn; + + // might be normal or delayed nodeLinkFn depending on if templateUrl is present + return nodeLinkFn; + + //////////////////// + + function addLinkFns(pre, post) { + if (pre) { + pre.require = directive.require; + preLinkFns.push(pre); + } + if (post) { + post.require = directive.require; + postLinkFns.push(post); + } + } + + + function getControllers(require, $element) { + var value, retrievalMethod = 'data', optional = false; + if (isString(require)) { + while((value = require.charAt(0)) == '^' || value == '?') { + require = require.substr(1); + if (value == '^') { + retrievalMethod = 'inheritedData'; + } + optional = optional || value == '?'; + } + value = $element[retrievalMethod]('$' + require + 'Controller'); + if (!value && !optional) { + throw Error("No controller: " + require); + } + return value; + } else if (isArray(require)) { + value = []; + forEach(require, function(require) { + value.push(getControllers(require, $element)); + }); + } + return value; + } + + + function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { + var attrs, $element, i, ii, linkFn, controller; + + if (compileNode === linkNode) { + attrs = templateAttrs; + } else { + attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr)); + } + $element = attrs.$$element; + + if (newIsolateScopeDirective) { + var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/; + + var parentScope = scope.$parent || scope; + + forEach(newIsolateScopeDirective.scope, function(definiton, scopeName) { + var match = definiton.match(LOCAL_REGEXP) || [], + attrName = match[3] || scopeName, + optional = (match[2] == '?'), + mode = match[1], // @, =, or & + lastValue, + parentGet, parentSet; + + scope.$$isolateBindings[scopeName] = mode + attrName; + + switch (mode) { + + case '@': { + attrs.$observe(attrName, function(value) { + scope[scopeName] = value; + }); + attrs.$$observers[attrName].$$scope = parentScope; + if( attrs[attrName] ) { + // If the attribute has been provided then we trigger an interpolation to ensure the value is there for use in the link fn + scope[scopeName] = $interpolate(attrs[attrName])(parentScope); + } + break; + } + + case '=': { + if (optional && !attrs[attrName]) { + return; + } + parentGet = $parse(attrs[attrName]); + parentSet = parentGet.assign || function() { + // reset the change, or we will throw this exception on every $digest + lastValue = scope[scopeName] = parentGet(parentScope); + throw Error(NON_ASSIGNABLE_MODEL_EXPRESSION + attrs[attrName] + + ' (directive: ' + newIsolateScopeDirective.name + ')'); + }; + lastValue = scope[scopeName] = parentGet(parentScope); + scope.$watch(function parentValueWatch() { + var parentValue = parentGet(parentScope); + + if (parentValue !== scope[scopeName]) { + // we are out of sync and need to copy + if (parentValue !== lastValue) { + // parent changed and it has precedence + lastValue = scope[scopeName] = parentValue; + } else { + // if the parent can be assigned then do so + parentSet(parentScope, parentValue = lastValue = scope[scopeName]); + } + } + return parentValue; + }); + break; + } + + case '&': { + parentGet = $parse(attrs[attrName]); + scope[scopeName] = function(locals) { + return parentGet(parentScope, locals); + }; + break; + } + + default: { + throw Error('Invalid isolate scope definition for directive ' + + newIsolateScopeDirective.name + ': ' + definiton); + } + } + }); + } + + if (controllerDirectives) { + forEach(controllerDirectives, function(directive) { + var locals = { + $scope: scope, + $element: $element, + $attrs: attrs, + $transclude: boundTranscludeFn + }; + + controller = directive.controller; + if (controller == '@') { + controller = attrs[directive.name]; + } + + $element.data( + '$' + directive.name + 'Controller', + $controller(controller, locals)); + }); + } + + // PRELINKING + for(i = 0, ii = preLinkFns.length; i < ii; i++) { + try { + linkFn = preLinkFns[i]; + linkFn(scope, $element, attrs, + linkFn.require && getControllers(linkFn.require, $element)); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + + // RECURSION + childLinkFn && childLinkFn(scope, linkNode.childNodes, undefined, boundTranscludeFn); + + // POSTLINKING + for(i = 0, ii = postLinkFns.length; i < ii; i++) { + try { + linkFn = postLinkFns[i]; + linkFn(scope, $element, attrs, + linkFn.require && getControllers(linkFn.require, $element)); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + } + } + + + /** + * looks up the directive and decorates it with exception handling and proper parameters. We + * call this the boundDirective. + * + * @param {string} name name of the directive to look up. + * @param {string} location The directive must be found in specific format. + * String containing any of theses characters: + * + * * `E`: element name + * * `A': attribute + * * `C`: class + * * `M`: comment + * @returns true if directive was added. + */ + function addDirective(tDirectives, name, location, maxPriority) { + var match = false; + if (hasDirectives.hasOwnProperty(name)) { + for(var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i directive.priority) && + directive.restrict.indexOf(location) != -1) { + tDirectives.push(directive); + match = true; + } + } catch(e) { $exceptionHandler(e); } + } + } + return match; + } + + + /** + * When the element is replaced with HTML template then the new attributes + * on the template need to be merged with the existing attributes in the DOM. + * The desired effect is to have both of the attributes present. + * + * @param {object} dst destination attributes (original DOM) + * @param {object} src source attributes (from the directive template) + */ + function mergeTemplateAttributes(dst, src) { + var srcAttr = src.$attr, + dstAttr = dst.$attr, + $element = dst.$$element; + + // reapply the old attributes to the new element + forEach(dst, function(value, key) { + if (key.charAt(0) != '$') { + if (src[key]) { + value += (key === 'style' ? ';' : ' ') + src[key]; + } + dst.$set(key, value, true, srcAttr[key]); + } + }); + + // copy the new attributes on the old attrs object + forEach(src, function(value, key) { + if (key == 'class') { + safeAddClass($element, value); + dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value; + } else if (key == 'style') { + $element.attr('style', $element.attr('style') + ';' + value); + } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { + dst[key] = value; + dstAttr[key] = srcAttr[key]; + } + }); + } + + + function compileTemplateUrl(directives, beforeTemplateNodeLinkFn, $compileNode, tAttrs, + $rootElement, replace, childTranscludeFn) { + var linkQueue = [], + afterTemplateNodeLinkFn, + afterTemplateChildLinkFn, + beforeTemplateCompileNode = $compileNode[0], + origAsyncDirective = directives.shift(), + // The fact that we have to copy and patch the directive seems wrong! + derivedSyncDirective = extend({}, origAsyncDirective, { + controller: null, templateUrl: null, transclude: null, scope: null + }), + templateUrl = (isFunction(origAsyncDirective.templateUrl)) + ? origAsyncDirective.templateUrl($compileNode, tAttrs) + : origAsyncDirective.templateUrl; + + $compileNode.html(''); + + $http.get(templateUrl, {cache: $templateCache}). + success(function(content) { + var compileNode, tempTemplateAttrs, $template; + + content = denormalizeTemplate(content); + + if (replace) { + $template = jqLite('
    ' + trim(content) + '
    ').contents(); + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== 1) { + throw new Error(MULTI_ROOT_TEMPLATE_ERROR + content); + } + + tempTemplateAttrs = {$attr: {}}; + replaceWith($rootElement, $compileNode, compileNode); + collectDirectives(compileNode, directives, tempTemplateAttrs); + mergeTemplateAttributes(tAttrs, tempTemplateAttrs); + } else { + compileNode = beforeTemplateCompileNode; + $compileNode.html(content); + } + + directives.unshift(derivedSyncDirective); + afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, childTranscludeFn); + afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); + + + while(linkQueue.length) { + var scope = linkQueue.shift(), + beforeTemplateLinkNode = linkQueue.shift(), + linkRootElement = linkQueue.shift(), + controller = linkQueue.shift(), + linkNode = compileNode; + + if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { + // it was cloned therefore we have to clone as well. + linkNode = JQLiteClone(compileNode); + replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); + } + + afterTemplateNodeLinkFn(function() { + beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, controller); + }, scope, linkNode, $rootElement, controller); + } + linkQueue = null; + }). + error(function(response, code, headers, config) { + throw Error('Failed to load template: ' + config.url); + }); + + return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, controller) { + if (linkQueue) { + linkQueue.push(scope); + linkQueue.push(node); + linkQueue.push(rootElement); + linkQueue.push(controller); + } else { + afterTemplateNodeLinkFn(function() { + beforeTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, controller); + }, scope, node, rootElement, controller); + } + }; + } + + + /** + * Sorting function for bound directives. + */ + function byPriority(a, b) { + return b.priority - a.priority; + } + + + function assertNoDuplicate(what, previousDirective, directive, element) { + if (previousDirective) { + throw Error('Multiple directives [' + previousDirective.name + ', ' + + directive.name + '] asking for ' + what + ' on: ' + startingTag(element)); + } + } + + + function addTextInterpolateDirective(directives, text) { + var interpolateFn = $interpolate(text, true); + if (interpolateFn) { + directives.push({ + priority: 0, + compile: valueFn(function textInterpolateLinkFn(scope, node) { + var parent = node.parent(), + bindings = parent.data('$binding') || []; + bindings.push(interpolateFn); + safeAddClass(parent.data('$binding', bindings), 'ng-binding'); + scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { + node[0].nodeValue = value; + }); + }) + }); + } + } + + + function addAttrInterpolateDirective(node, directives, value, name) { + var interpolateFn = $interpolate(value, true); + + // no interpolation found -> ignore + if (!interpolateFn) return; + + + directives.push({ + priority: 100, + compile: valueFn(function attrInterpolateLinkFn(scope, element, attr) { + var $$observers = (attr.$$observers || (attr.$$observers = {})); + + // we need to interpolate again, in case the attribute value has been updated + // (e.g. by another directive's compile function) + interpolateFn = $interpolate(attr[name], true); + + // if attribute was updated so that there is no interpolation going on we don't want to + // register any observers + if (!interpolateFn) return; + + attr[name] = interpolateFn(scope); + ($$observers[name] || ($$observers[name] = [])).$$inter = true; + (attr.$$observers && attr.$$observers[name].$$scope || scope). + $watch(interpolateFn, function interpolateFnWatchAction(value) { + attr.$set(name, value); + }); + }) + }); + } + + + /** + * This is a special jqLite.replaceWith, which can replace items which + * have no parents, provided that the containing jqLite collection is provided. + * + * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes + * in the root of the tree. + * @param {JqLite} $element The jqLite element which we are going to replace. We keep the shell, + * but replace its DOM node reference. + * @param {Node} newNode The new DOM node. + */ + function replaceWith($rootElement, $element, newNode) { + var oldNode = $element[0], + parent = oldNode.parentNode, + i, ii; + + if ($rootElement) { + for(i = 0, ii = $rootElement.length; i < ii; i++) { + if ($rootElement[i] == oldNode) { + $rootElement[i] = newNode; + break; + } + } + } + + if (parent) { + parent.replaceChild(newNode, oldNode); + } + + newNode[jqLite.expando] = oldNode[jqLite.expando]; + $element[0] = newNode; + } + }]; +} + +var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i; +/** + * Converts all accepted directives format into proper directive name. + * All of these will become 'myDirective': + * my:DiRective + * my-directive + * x-my-directive + * data-my:directive + * + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ +function directiveNormalize(name) { + return camelCase(name.replace(PREFIX_REGEXP, '')); +} + +/** + * @ngdoc object + * @name ng.$compile.directive.Attributes + * @description + * + * A shared object between directive compile / linking functions which contains normalized DOM element + * attributes. The the values reflect current binding state `{{ }}`. The normalization is needed + * since all of these are treated as equivalent in Angular: + * + * + */ + +/** + * @ngdoc property + * @name ng.$compile.directive.Attributes#$attr + * @propertyOf ng.$compile.directive.Attributes + * @returns {object} A map of DOM element attribute names to the normalized name. This is + * needed to do reverse lookup from normalized name back to actual name. + */ + + +/** + * @ngdoc function + * @name ng.$compile.directive.Attributes#$set + * @methodOf ng.$compile.directive.Attributes + * @function + * + * @description + * Set DOM element attribute value. + * + * + * @param {string} name Normalized element attribute name of the property to modify. The name is + * revers translated using the {@link ng.$compile.directive.Attributes#$attr $attr} + * property to the original name. + * @param {string} value Value to set the attribute to. The value can be an interpolated string. + */ + + + +/** + * Closure compiler type information + */ + +function nodesetLinkingFn( + /* angular.Scope */ scope, + /* NodeList */ nodeList, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +){} + +function directiveLinkingFn( + /* nodesetLinkingFn */ nodesetLinkingFn, + /* angular.Scope */ scope, + /* Node */ node, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +){} + +/** + * @ngdoc object + * @name ng.$controllerProvider + * @description + * The {@link ng.$controller $controller service} is used by Angular to create new + * controllers. + * + * This provider allows controller registration via the + * {@link ng.$controllerProvider#register register} method. + */ +function $ControllerProvider() { + var controllers = {}, + CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; + + + /** + * @ngdoc function + * @name ng.$controllerProvider#register + * @methodOf ng.$controllerProvider + * @param {string} name Controller name + * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI + * annotations in the array notation). + */ + this.register = function(name, constructor) { + if (isObject(name)) { + extend(controllers, name) + } else { + controllers[name] = constructor; + } + }; + + + this.$get = ['$injector', '$window', function($injector, $window) { + + /** + * @ngdoc function + * @name ng.$controller + * @requires $injector + * + * @param {Function|string} constructor If called with a function then it's considered to be the + * controller constructor function. Otherwise it's considered to be a string which is used + * to retrieve the controller constructor using the following steps: + * + * * check if a controller with given name is registered via `$controllerProvider` + * * check if evaluating the string on the current scope returns a constructor + * * check `window[constructor]` on the global `window` object + * + * @param {Object} locals Injection locals for Controller. + * @return {Object} Instance of given controller. + * + * @description + * `$controller` service is responsible for instantiating controllers. + * + * It's just a simple call to {@link AUTO.$injector $injector}, but extracted into + * a service, so that one can override this service with {@link https://gist.github.com/1649788 + * BC version}. + */ + return function(expression, locals) { + var instance, match, constructor, identifier; + + if(isString(expression)) { + match = expression.match(CNTRL_REG), + constructor = match[1], + identifier = match[3]; + expression = controllers.hasOwnProperty(constructor) + ? controllers[constructor] + : getter(locals.$scope, constructor, true) || getter($window, constructor, true); + + assertArgFn(expression, constructor, true); + } + + instance = $injector.instantiate(expression, locals); + + if (identifier) { + if (typeof locals.$scope !== 'object') { + throw new Error('Can not export controller as "' + identifier + '". ' + + 'No scope object provided!'); + } + + locals.$scope[identifier] = instance; + } + + return instance; + }; + }]; +} + +/** + * @ngdoc object + * @name ng.$document + * @requires $window + * + * @description + * A {@link angular.element jQuery (lite)}-wrapped reference to the browser's `window.document` + * element. + */ +function $DocumentProvider(){ + this.$get = ['$window', function(window){ + return jqLite(window.document); + }]; +} + +/** + * @ngdoc function + * @name ng.$exceptionHandler + * @requires $log + * + * @description + * Any uncaught exception in angular expressions is delegated to this service. + * The default implementation simply delegates to `$log.error` which logs it into + * the browser console. + * + * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by + * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. + * + * @param {Error} exception Exception associated with the error. + * @param {string=} cause optional information about the context in which + * the error was thrown. + * + */ +function $ExceptionHandlerProvider() { + this.$get = ['$log', function($log) { + return function(exception, cause) { + $log.error.apply($log, arguments); + }; + }]; +} + +/** + * @ngdoc object + * @name ng.$interpolateProvider + * @function + * + * @description + * + * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. + */ +function $InterpolateProvider() { + var startSymbol = '{{'; + var endSymbol = '}}'; + + /** + * @ngdoc method + * @name ng.$interpolateProvider#startSymbol + * @methodOf ng.$interpolateProvider + * @description + * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. + * + * @param {string=} value new value to set the starting symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.startSymbol = function(value){ + if (value) { + startSymbol = value; + return this; + } else { + return startSymbol; + } + }; + + /** + * @ngdoc method + * @name ng.$interpolateProvider#endSymbol + * @methodOf ng.$interpolateProvider + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * @param {string=} value new value to set the ending symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.endSymbol = function(value){ + if (value) { + endSymbol = value; + return this; + } else { + return endSymbol; + } + }; + + + this.$get = ['$parse', '$exceptionHandler', function($parse, $exceptionHandler) { + var startSymbolLength = startSymbol.length, + endSymbolLength = endSymbol.length; + + /** + * @ngdoc function + * @name ng.$interpolate + * @function + * + * @requires $parse + * + * @description + * + * Compiles a string with markup into an interpolation function. This service is used by the + * HTML {@link ng.$compile $compile} service for data binding. See + * {@link ng.$interpolateProvider $interpolateProvider} for configuring the + * interpolation markup. + * + * +
    +         var $interpolate = ...; // injected
    +         var exp = $interpolate('Hello {{name}}!');
    +         expect(exp({name:'Angular'}).toEqual('Hello Angular!');
    +       
    + * + * + * @param {string} text The text with markup to interpolate. + * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have + * embedded expression in order to return an interpolation function. Strings with no + * embedded expression will return null for the interpolation function. + * @returns {function(context)} an interpolation function which is used to compute the interpolated + * string. The function has these parameters: + * + * * `context`: an object against which any expressions embedded in the strings are evaluated + * against. + * + */ + function $interpolate(text, mustHaveExpression) { + var startIndex, + endIndex, + index = 0, + parts = [], + length = text.length, + hasInterpolation = false, + fn, + exp, + concat = []; + + while(index < length) { + if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) && + ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) { + (index != startIndex) && parts.push(text.substring(index, startIndex)); + parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex))); + fn.exp = exp; + index = endIndex + endSymbolLength; + hasInterpolation = true; + } else { + // we did not find anything, so we have to add the remainder to the parts array + (index != length) && parts.push(text.substring(index)); + index = length; + } + } + + if (!(length = parts.length)) { + // we added, nothing, must have been an empty string. + parts.push(''); + length = 1; + } + + if (!mustHaveExpression || hasInterpolation) { + concat.length = length; + fn = function(context) { + try { + for(var i = 0, ii = length, part; i=} search New search params - string or hash object + * @param {string=} paramValue If `search` is a string, then `paramValue` will override only a + * single search parameter. If the value is `null`, the parameter will be deleted. + * + * @return {string} search + */ + search: function(search, paramValue) { + if (isUndefined(search)) + return this.$$search; + + if (isDefined(paramValue)) { + if (paramValue === null) { + delete this.$$search[search]; + } else { + this.$$search[search] = paramValue; + } + } else { + this.$$search = isString(search) ? parseKeyValue(search) : search; + } + + this.$$compose(); + return this; + }, + + /** + * @ngdoc method + * @name ng.$location#hash + * @methodOf ng.$location + * + * @description + * This method is getter / setter. + * + * Return hash fragment when called without any parameter. + * + * Change hash fragment when called with parameter and return `$location`. + * + * @param {string=} hash New hash fragment + * @return {string} hash + */ + hash: locationGetterSetter('$$hash', identity), + + /** + * @ngdoc method + * @name ng.$location#replace + * @methodOf ng.$location + * + * @description + * If called, all changes to $location during current `$digest` will be replacing current history + * record, instead of adding new one. + */ + replace: function() { + this.$$replace = true; + return this; + } +}; + +function locationGetter(property) { + return function() { + return this[property]; + }; +} + + +function locationGetterSetter(property, preprocess) { + return function(value) { + if (isUndefined(value)) + return this[property]; + + this[property] = preprocess(value); + this.$$compose(); + + return this; + }; +} + + +/** + * @ngdoc object + * @name ng.$location + * + * @requires $browser + * @requires $sniffer + * @requires $rootElement + * + * @description + * The $location service parses the URL in the browser address bar (based on the + * {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL + * available to your application. Changes to the URL in the address bar are reflected into + * $location service and changes to $location are reflected into the browser address bar. + * + * **The $location service:** + * + * - Exposes the current URL in the browser address bar, so you can + * - Watch and observe the URL. + * - Change the URL. + * - Synchronizes the URL with the browser when the user + * - Changes the address bar. + * - Clicks the back or forward button (or clicks a History link). + * - Clicks on a link. + * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). + * + * For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular + * Services: Using $location} + */ + +/** + * @ngdoc object + * @name ng.$locationProvider + * @description + * Use the `$locationProvider` to configure how the application deep linking paths are stored. + */ +function $LocationProvider(){ + var hashPrefix = '', + html5Mode = false; + + /** + * @ngdoc property + * @name ng.$locationProvider#hashPrefix + * @methodOf ng.$locationProvider + * @description + * @param {string=} prefix Prefix for hash part (containing path and search) + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.hashPrefix = function(prefix) { + if (isDefined(prefix)) { + hashPrefix = prefix; + return this; + } else { + return hashPrefix; + } + }; + + /** + * @ngdoc property + * @name ng.$locationProvider#html5Mode + * @methodOf ng.$locationProvider + * @description + * @param {string=} mode Use HTML5 strategy if available. + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.html5Mode = function(mode) { + if (isDefined(mode)) { + html5Mode = mode; + return this; + } else { + return html5Mode; + } + }; + + this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', + function( $rootScope, $browser, $sniffer, $rootElement) { + var $location, + LocationMode, + baseHref = $browser.baseHref(), + initialUrl = $browser.url(), + appBase; + + if (html5Mode) { + appBase = baseHref ? serverBase(initialUrl) + baseHref : initialUrl; + LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; + } else { + appBase = stripHash(initialUrl); + LocationMode = LocationHashbangUrl; + } + $location = new LocationMode(appBase, '#' + hashPrefix); + $location.$$parse($location.$$rewrite(initialUrl)); + + $rootElement.bind('click', function(event) { + // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) + // currently we open nice url link and redirect then + + if (event.ctrlKey || event.metaKey || event.which == 2) return; + + var elm = jqLite(event.target); + + // traverse the DOM up to find first A tag + while (lowercase(elm[0].nodeName) !== 'a') { + // ignore rewriting if no A tag (reached root element, or no parent - removed from document) + if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; + } + + var absHref = elm.prop('href'); + var rewrittenUrl = $location.$$rewrite(absHref); + + if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) { + event.preventDefault(); + if (rewrittenUrl != $browser.url()) { + // update location manually + $location.$$parse(rewrittenUrl); + $rootScope.$apply(); + // hack to work around FF6 bug 684208 when scenario runner clicks on links + window.angular['ff-684208-preventDefault'] = true; + } + } + }); + + + // rewrite hashbang url <> html5 url + if ($location.absUrl() != initialUrl) { + $browser.url($location.absUrl(), true); + } + + // update $location when $browser url changes + $browser.onUrlChange(function(newUrl) { + if ($location.absUrl() != newUrl) { + if ($rootScope.$broadcast('$locationChangeStart', newUrl, $location.absUrl()).defaultPrevented) { + $browser.url($location.absUrl()); + return; + } + $rootScope.$evalAsync(function() { + var oldUrl = $location.absUrl(); + + $location.$$parse(newUrl); + afterLocationChange(oldUrl); + }); + if (!$rootScope.$$phase) $rootScope.$digest(); + } + }); + + // update browser + var changeCounter = 0; + $rootScope.$watch(function $locationWatch() { + var oldUrl = $browser.url(); + var currentReplace = $location.$$replace; + + if (!changeCounter || oldUrl != $location.absUrl()) { + changeCounter++; + $rootScope.$evalAsync(function() { + if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl). + defaultPrevented) { + $location.$$parse(oldUrl); + } else { + $browser.url($location.absUrl(), currentReplace); + afterLocationChange(oldUrl); + } + }); + } + $location.$$replace = false; + + return changeCounter; + }); + + return $location; + + function afterLocationChange(oldUrl) { + $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl); + } +}]; +} + +/** + * @ngdoc object + * @name ng.$log + * @requires $window + * + * @description + * Simple service for logging. Default implementation writes the message + * into the browser's console (if present). + * + * The main purpose of this service is to simplify debugging and troubleshooting. + * + * @example + + + function LogCtrl($scope, $log) { + $scope.$log = $log; + $scope.message = 'Hello World!'; + } + + +
    +

    Reload this page with open console, enter text and hit the log button...

    + Message: + + + + + +
    +
    +
    + */ + +/** + * @ngdoc object + * @name ng.$logProvider + * @description + * Use the `$logProvider` to configure how the application logs messages + */ +function $LogProvider(){ + var debug = true, + self = this; + + /** + * @ngdoc property + * @name ng.$logProvider#debugEnabled + * @methodOf ng.$logProvider + * @description + * @param {string=} flag enable or disable debug level messages + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.debugEnabled = function(flag) { + if (isDefined(flag)) { + debug = flag; + return this; + } else { + return debug; + } + }; + + this.$get = ['$window', function($window){ + return { + /** + * @ngdoc method + * @name ng.$log#log + * @methodOf ng.$log + * + * @description + * Write a log message + */ + log: consoleLog('log'), + + /** + * @ngdoc method + * @name ng.$log#warn + * @methodOf ng.$log + * + * @description + * Write a warning message + */ + warn: consoleLog('warn'), + + /** + * @ngdoc method + * @name ng.$log#info + * @methodOf ng.$log + * + * @description + * Write an information message + */ + info: consoleLog('info'), + + /** + * @ngdoc method + * @name ng.$log#error + * @methodOf ng.$log + * + * @description + * Write an error message + */ + error: consoleLog('error'), + + /** + * @ngdoc method + * @name ng.$log#debug + * @methodOf ng.$log + * + * @description + * Write a debug message + */ + debug: (function () { + var fn = consoleLog('debug'); + + return function() { + if (debug) { + fn.apply(self, arguments); + } + } + }()) + }; + + function formatError(arg) { + if (arg instanceof Error) { + if (arg.stack) { + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) + ? 'Error: ' + arg.message + '\n' + arg.stack + : arg.stack; + } else if (arg.sourceURL) { + arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; + } + } + return arg; + } + + function consoleLog(type) { + var console = $window.console || {}, + logFn = console[type] || console.log || noop; + + if (logFn.apply) { + return function() { + var args = []; + forEach(arguments, function(arg) { + args.push(formatError(arg)); + }); + return logFn.apply(console, args); + }; + } + + // we are IE which either doesn't have window.console => this is noop and we do nothing, + // or we are IE where console.log doesn't have apply so we log at least first 2 args + return function(arg1, arg2) { + logFn(arg1, arg2); + } + } + }]; +} + +var OPERATORS = { + 'null':function(){return null;}, + 'true':function(){return true;}, + 'false':function(){return false;}, + undefined:noop, + '+':function(self, locals, a,b){ + a=a(self, locals); b=b(self, locals); + if (isDefined(a)) { + if (isDefined(b)) { + return a + b; + } + return a; + } + return isDefined(b)?b:undefined;}, + '-':function(self, locals, a,b){a=a(self, locals); b=b(self, locals); return (isDefined(a)?a:0)-(isDefined(b)?b:0);}, + '*':function(self, locals, a,b){return a(self, locals)*b(self, locals);}, + '/':function(self, locals, a,b){return a(self, locals)/b(self, locals);}, + '%':function(self, locals, a,b){return a(self, locals)%b(self, locals);}, + '^':function(self, locals, a,b){return a(self, locals)^b(self, locals);}, + '=':noop, + '===':function(self, locals, a, b){return a(self, locals)===b(self, locals);}, + '!==':function(self, locals, a, b){return a(self, locals)!==b(self, locals);}, + '==':function(self, locals, a,b){return a(self, locals)==b(self, locals);}, + '!=':function(self, locals, a,b){return a(self, locals)!=b(self, locals);}, + '<':function(self, locals, a,b){return a(self, locals)':function(self, locals, a,b){return a(self, locals)>b(self, locals);}, + '<=':function(self, locals, a,b){return a(self, locals)<=b(self, locals);}, + '>=':function(self, locals, a,b){return a(self, locals)>=b(self, locals);}, + '&&':function(self, locals, a,b){return a(self, locals)&&b(self, locals);}, + '||':function(self, locals, a,b){return a(self, locals)||b(self, locals);}, + '&':function(self, locals, a,b){return a(self, locals)&b(self, locals);}, +// '|':function(self, locals, a,b){return a|b;}, + '|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));}, + '!':function(self, locals, a){return !a(self, locals);} +}; +var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; + +function lex(text, csp){ + var tokens = [], + token, + index = 0, + json = [], + ch, + lastCh = ':'; // can start regexp + + while (index < text.length) { + ch = text.charAt(index); + if (is('"\'')) { + readString(ch); + } else if (isNumber(ch) || is('.') && isNumber(peek())) { + readNumber(); + } else if (isIdent(ch)) { + readIdent(); + // identifiers can only be if the preceding char was a { or , + if (was('{,') && json[0]=='{' && + (token=tokens[tokens.length-1])) { + token.json = token.text.indexOf('.') == -1; + } + } else if (is('(){}[].,;:?')) { + tokens.push({ + index:index, + text:ch, + json:(was(':[,') && is('{[')) || is('}]:,') + }); + if (is('{[')) json.unshift(ch); + if (is('}]')) json.shift(); + index++; + } else if (isWhitespace(ch)) { + index++; + continue; + } else { + var ch2 = ch + peek(), + ch3 = ch2 + peek(2), + fn = OPERATORS[ch], + fn2 = OPERATORS[ch2], + fn3 = OPERATORS[ch3]; + if (fn3) { + tokens.push({index:index, text:ch3, fn:fn3}); + index += 3; + } else if (fn2) { + tokens.push({index:index, text:ch2, fn:fn2}); + index += 2; + } else if (fn) { + tokens.push({index:index, text:ch, fn:fn, json: was('[,:') && is('+-')}); + index += 1; + } else { + throwError("Unexpected next character ", index, index+1); + } + } + lastCh = ch; + } + return tokens; + + function is(chars) { + return chars.indexOf(ch) != -1; + } + + function was(chars) { + return chars.indexOf(lastCh) != -1; + } + + function peek(i) { + var num = i || 1; + return index + num < text.length ? text.charAt(index + num) : false; + } + function isNumber(ch) { + return '0' <= ch && ch <= '9'; + } + function isWhitespace(ch) { + return ch == ' ' || ch == '\r' || ch == '\t' || + ch == '\n' || ch == '\v' || ch == '\u00A0'; // IE treats non-breaking space as \u00A0 + } + function isIdent(ch) { + return 'a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + '_' == ch || ch == '$'; + } + function isExpOperator(ch) { + return ch == '-' || ch == '+' || isNumber(ch); + } + + function throwError(error, start, end) { + end = end || index; + throw Error("Lexer Error: " + error + " at column" + + (isDefined(start) + ? "s " + start + "-" + index + " [" + text.substring(start, end) + "]" + : " " + end) + + " in expression [" + text + "]."); + } + + function readNumber() { + var number = ""; + var start = index; + while (index < text.length) { + var ch = lowercase(text.charAt(index)); + if (ch == '.' || isNumber(ch)) { + number += ch; + } else { + var peekCh = peek(); + if (ch == 'e' && isExpOperator(peekCh)) { + number += ch; + } else if (isExpOperator(ch) && + peekCh && isNumber(peekCh) && + number.charAt(number.length - 1) == 'e') { + number += ch; + } else if (isExpOperator(ch) && + (!peekCh || !isNumber(peekCh)) && + number.charAt(number.length - 1) == 'e') { + throwError('Invalid exponent'); + } else { + break; + } + } + index++; + } + number = 1 * number; + tokens.push({index:start, text:number, json:true, + fn:function() {return number;}}); + } + function readIdent() { + var ident = "", + start = index, + lastDot, peekIndex, methodName, ch; + + while (index < text.length) { + ch = text.charAt(index); + if (ch == '.' || isIdent(ch) || isNumber(ch)) { + if (ch == '.') lastDot = index; + ident += ch; + } else { + break; + } + index++; + } + + //check if this is not a method invocation and if it is back out to last dot + if (lastDot) { + peekIndex = index; + while(peekIndex < text.length) { + ch = text.charAt(peekIndex); + if (ch == '(') { + methodName = ident.substr(lastDot - start + 1); + ident = ident.substr(0, lastDot - start); + index = peekIndex; + break; + } + if(isWhitespace(ch)) { + peekIndex++; + } else { + break; + } + } + } + + + var token = { + index:start, + text:ident + }; + + if (OPERATORS.hasOwnProperty(ident)) { + token.fn = token.json = OPERATORS[ident]; + } else { + var getter = getterFn(ident, csp); + token.fn = extend(function(self, locals) { + return (getter(self, locals)); + }, { + assign: function(self, value) { + return setter(self, ident, value); + } + }); + } + + tokens.push(token); + + if (methodName) { + tokens.push({ + index:lastDot, + text: '.', + json: false + }); + tokens.push({ + index: lastDot + 1, + text: methodName, + json: false + }); + } + } + + function readString(quote) { + var start = index; + index++; + var string = ""; + var rawString = quote; + var escape = false; + while (index < text.length) { + var ch = text.charAt(index); + rawString += ch; + if (escape) { + if (ch == 'u') { + var hex = text.substring(index + 1, index + 5); + if (!hex.match(/[\da-f]{4}/i)) + throwError( "Invalid unicode escape [\\u" + hex + "]"); + index += 4; + string += String.fromCharCode(parseInt(hex, 16)); + } else { + var rep = ESCAPE[ch]; + if (rep) { + string += rep; + } else { + string += ch; + } + } + escape = false; + } else if (ch == '\\') { + escape = true; + } else if (ch == quote) { + index++; + tokens.push({ + index:start, + text:rawString, + string:string, + json:true, + fn:function() { return string; } + }); + return; + } else { + string += ch; + } + index++; + } + throwError("Unterminated quote", start); + } +} + +///////////////////////////////////////// + +function parser(text, json, $filter, csp){ + var ZERO = valueFn(0), + value, + tokens = lex(text, csp), + assignment = _assignment, + functionCall = _functionCall, + fieldAccess = _fieldAccess, + objectIndex = _objectIndex, + filterChain = _filterChain; + + if(json){ + // The extra level of aliasing is here, just in case the lexer misses something, so that + // we prevent any accidental execution in JSON. + assignment = logicalOR; + functionCall = + fieldAccess = + objectIndex = + filterChain = + function() { throwError("is not valid json", {text:text, index:0}); }; + value = primary(); + } else { + value = statements(); + } + if (tokens.length !== 0) { + throwError("is an unexpected token", tokens[0]); + } + value.literal = !!value.literal; + value.constant = !!value.constant; + return value; + + /////////////////////////////////// + function throwError(msg, token) { + throw Error("Syntax Error: Token '" + token.text + + "' " + msg + " at column " + + (token.index + 1) + " of the expression [" + + text + "] starting at [" + text.substring(token.index) + "]."); + } + + function peekToken() { + if (tokens.length === 0) + throw Error("Unexpected end of expression: " + text); + return tokens[0]; + } + + function peek(e1, e2, e3, e4) { + if (tokens.length > 0) { + var token = tokens[0]; + var t = token.text; + if (t==e1 || t==e2 || t==e3 || t==e4 || + (!e1 && !e2 && !e3 && !e4)) { + return token; + } + } + return false; + } + + function expect(e1, e2, e3, e4){ + var token = peek(e1, e2, e3, e4); + if (token) { + if (json && !token.json) { + throwError("is not valid json", token); + } + tokens.shift(); + return token; + } + return false; + } + + function consume(e1){ + if (!expect(e1)) { + throwError("is unexpected, expecting [" + e1 + "]", peek()); + } + } + + function unaryFn(fn, right) { + return extend(function(self, locals) { + return fn(self, locals, right); + }, { + constant:right.constant + }); + } + + function ternaryFn(left, middle, right){ + return extend(function(self, locals){ + return left(self, locals) ? middle(self, locals) : right(self, locals); + }, { + constant: left.constant && middle.constant && right.constant + }); + } + + function binaryFn(left, fn, right) { + return extend(function(self, locals) { + return fn(self, locals, left, right); + }, { + constant:left.constant && right.constant + }); + } + + function statements() { + var statements = []; + while(true) { + if (tokens.length > 0 && !peek('}', ')', ';', ']')) + statements.push(filterChain()); + if (!expect(';')) { + // optimize for the common case where there is only one statement. + // TODO(size): maybe we should not support multiple statements? + return statements.length == 1 + ? statements[0] + : function(self, locals){ + var value; + for ( var i = 0; i < statements.length; i++) { + var statement = statements[i]; + if (statement) + value = statement(self, locals); + } + return value; + }; + } + } + } + + function _filterChain() { + var left = expression(); + var token; + while(true) { + if ((token = expect('|'))) { + left = binaryFn(left, token.fn, filter()); + } else { + return left; + } + } + } + + function filter() { + var token = expect(); + var fn = $filter(token.text); + var argsFn = []; + while(true) { + if ((token = expect(':'))) { + argsFn.push(expression()); + } else { + var fnInvoke = function(self, locals, input){ + var args = [input]; + for ( var i = 0; i < argsFn.length; i++) { + args.push(argsFn[i](self, locals)); + } + return fn.apply(self, args); + }; + return function() { + return fnInvoke; + }; + } + } + } + + function expression() { + return assignment(); + } + + function _assignment() { + var left = ternary(); + var right; + var token; + if ((token = expect('='))) { + if (!left.assign) { + throwError("implies assignment but [" + + text.substring(0, token.index) + "] can not be assigned to", token); + } + right = ternary(); + return function(scope, locals){ + return left.assign(scope, right(scope, locals), locals); + }; + } else { + return left; + } + } + + function ternary() { + var left = logicalOR(); + var middle; + var token; + if((token = expect('?'))){ + middle = ternary(); + if((token = expect(':'))){ + return ternaryFn(left, middle, ternary()); + } + else { + throwError('expected :', token); + } + } + else { + return left; + } + } + + function logicalOR() { + var left = logicalAND(); + var token; + while(true) { + if ((token = expect('||'))) { + left = binaryFn(left, token.fn, logicalAND()); + } else { + return left; + } + } + } + + function logicalAND() { + var left = equality(); + var token; + if ((token = expect('&&'))) { + left = binaryFn(left, token.fn, logicalAND()); + } + return left; + } + + function equality() { + var left = relational(); + var token; + if ((token = expect('==','!=','===','!=='))) { + left = binaryFn(left, token.fn, equality()); + } + return left; + } + + function relational() { + var left = additive(); + var token; + if ((token = expect('<', '>', '<=', '>='))) { + left = binaryFn(left, token.fn, relational()); + } + return left; + } + + function additive() { + var left = multiplicative(); + var token; + while ((token = expect('+','-'))) { + left = binaryFn(left, token.fn, multiplicative()); + } + return left; + } + + function multiplicative() { + var left = unary(); + var token; + while ((token = expect('*','/','%'))) { + left = binaryFn(left, token.fn, unary()); + } + return left; + } + + function unary() { + var token; + if (expect('+')) { + return primary(); + } else if ((token = expect('-'))) { + return binaryFn(ZERO, token.fn, unary()); + } else if ((token = expect('!'))) { + return unaryFn(token.fn, unary()); + } else { + return primary(); + } + } + + + function primary() { + var primary; + if (expect('(')) { + primary = filterChain(); + consume(')'); + } else if (expect('[')) { + primary = arrayDeclaration(); + } else if (expect('{')) { + primary = object(); + } else { + var token = expect(); + primary = token.fn; + if (!primary) { + throwError("not a primary expression", token); + } + if (token.json) { + primary.constant = primary.literal = true; + } + } + + var next, context; + while ((next = expect('(', '[', '.'))) { + if (next.text === '(') { + primary = functionCall(primary, context); + context = null; + } else if (next.text === '[') { + context = primary; + primary = objectIndex(primary); + } else if (next.text === '.') { + context = primary; + primary = fieldAccess(primary); + } else { + throwError("IMPOSSIBLE"); + } + } + return primary; + } + + function _fieldAccess(object) { + var field = expect().text; + var getter = getterFn(field, csp); + return extend( + function(scope, locals, self) { + return getter(self || object(scope, locals), locals); + }, + { + assign:function(scope, value, locals) { + return setter(object(scope, locals), field, value); + } + } + ); + } + + function _objectIndex(obj) { + var indexFn = expression(); + consume(']'); + return extend( + function(self, locals){ + var o = obj(self, locals), + i = indexFn(self, locals), + v, p; + + if (!o) return undefined; + v = o[i]; + if (v && v.then) { + p = v; + if (!('$$v' in v)) { + p.$$v = undefined; + p.then(function(val) { p.$$v = val; }); + } + v = v.$$v; + } + return v; + }, { + assign:function(self, value, locals){ + return obj(self, locals)[indexFn(self, locals)] = value; + } + }); + } + + function _functionCall(fn, contextGetter) { + var argsFn = []; + if (peekToken().text != ')') { + do { + argsFn.push(expression()); + } while (expect(',')); + } + consume(')'); + return function(scope, locals){ + var args = [], + context = contextGetter ? contextGetter(scope, locals) : scope; + + for ( var i = 0; i < argsFn.length; i++) { + args.push(argsFn[i](scope, locals)); + } + var fnPtr = fn(scope, locals, context) || noop; + // IE stupidity! + return fnPtr.apply + ? fnPtr.apply(context, args) + : fnPtr(args[0], args[1], args[2], args[3], args[4]); + }; + } + + // This is used with json array declaration + function arrayDeclaration () { + var elementFns = []; + var allConstant = true; + if (peekToken().text != ']') { + do { + var elementFn = expression(); + elementFns.push(elementFn); + if (!elementFn.constant) { + allConstant = false; + } + } while (expect(',')); + } + consume(']'); + return extend(function(self, locals){ + var array = []; + for ( var i = 0; i < elementFns.length; i++) { + array.push(elementFns[i](self, locals)); + } + return array; + }, { + literal:true, + constant:allConstant + }); + } + + function object () { + var keyValues = []; + var allConstant = true; + if (peekToken().text != '}') { + do { + var token = expect(), + key = token.string || token.text; + consume(":"); + var value = expression(); + keyValues.push({key:key, value:value}); + if (!value.constant) { + allConstant = false; + } + } while (expect(',')); + } + consume('}'); + return extend(function(self, locals){ + var object = {}; + for ( var i = 0; i < keyValues.length; i++) { + var keyValue = keyValues[i]; + object[keyValue.key] = keyValue.value(self, locals); + } + return object; + }, { + literal:true, + constant:allConstant + }); + } +} + +////////////////////////////////////////////////// +// Parser helper functions +////////////////////////////////////////////////// + +function setter(obj, path, setValue) { + var element = path.split('.'); + for (var i = 0; element.length > 1; i++) { + var key = element.shift(); + var propertyObj = obj[key]; + if (!propertyObj) { + propertyObj = {}; + obj[key] = propertyObj; + } + obj = propertyObj; + } + obj[element.shift()] = setValue; + return setValue; +} + +/** + * Return the value accessible from the object by path. Any undefined traversals are ignored + * @param {Object} obj starting object + * @param {string} path path to traverse + * @param {boolean=true} bindFnToScope + * @returns value as accessible by path + */ +//TODO(misko): this function needs to be removed +function getter(obj, path, bindFnToScope) { + if (!path) return obj; + var keys = path.split('.'); + var key; + var lastInstance = obj; + var len = keys.length; + + for (var i = 0; i < len; i++) { + key = keys[i]; + if (obj) { + obj = (lastInstance = obj)[key]; + } + } + if (!bindFnToScope && isFunction(obj)) { + return bind(lastInstance, obj); + } + return obj; +} + +var getterFnCache = {}; + +/** + * Implementation of the "Black Hole" variant from: + * - http://jsperf.com/angularjs-parse-getter/4 + * - http://jsperf.com/path-evaluation-simplified/7 + */ +function cspSafeGetterFn(key0, key1, key2, key3, key4) { + return function(scope, locals) { + var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope, + promise; + + if (pathVal === null || pathVal === undefined) return pathVal; + + pathVal = pathVal[key0]; + if (pathVal && pathVal.then) { + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + if (!key1 || pathVal === null || pathVal === undefined) return pathVal; + + pathVal = pathVal[key1]; + if (pathVal && pathVal.then) { + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + if (!key2 || pathVal === null || pathVal === undefined) return pathVal; + + pathVal = pathVal[key2]; + if (pathVal && pathVal.then) { + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + if (!key3 || pathVal === null || pathVal === undefined) return pathVal; + + pathVal = pathVal[key3]; + if (pathVal && pathVal.then) { + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + if (!key4 || pathVal === null || pathVal === undefined) return pathVal; + + pathVal = pathVal[key4]; + if (pathVal && pathVal.then) { + if (!("$$v" in pathVal)) { + promise = pathVal; + promise.$$v = undefined; + promise.then(function(val) { promise.$$v = val; }); + } + pathVal = pathVal.$$v; + } + return pathVal; + }; +} + +function getterFn(path, csp) { + if (getterFnCache.hasOwnProperty(path)) { + return getterFnCache[path]; + } + + var pathKeys = path.split('.'), + pathKeysLength = pathKeys.length, + fn; + + if (csp) { + fn = (pathKeysLength < 6) + ? cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4]) + : function(scope, locals) { + var i = 0, val; + do { + val = cspSafeGetterFn( + pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++] + )(scope, locals); + + locals = undefined; // clear after first iteration + scope = val; + } while (i < pathKeysLength); + return val; + } + } else { + var code = 'var l, fn, p;\n'; + forEach(pathKeys, function(key, index) { + code += 'if(s === null || s === undefined) return s;\n' + + 'l=s;\n' + + 's='+ (index + // we simply dereference 's' on any .dot notation + ? 's' + // but if we are first then we check locals first, and if so read it first + : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' + + 'if (s && s.then) {\n' + + ' if (!("$$v" in s)) {\n' + + ' p=s;\n' + + ' p.$$v = undefined;\n' + + ' p.then(function(v) {p.$$v=v;});\n' + + '}\n' + + ' s=s.$$v\n' + + '}\n'; + }); + code += 'return s;'; + fn = Function('s', 'k', code); // s=scope, k=locals + fn.toString = function() { return code; }; + } + + return getterFnCache[path] = fn; +} + +/////////////////////////////////// + +/** + * @ngdoc function + * @name ng.$parse + * @function + * + * @description + * + * Converts Angular {@link guide/expression expression} into a function. + * + *
    + *   var getter = $parse('user.name');
    + *   var setter = getter.assign;
    + *   var context = {user:{name:'angular'}};
    + *   var locals = {user:{name:'local'}};
    + *
    + *   expect(getter(context)).toEqual('angular');
    + *   setter(context, 'newValue');
    + *   expect(context.user.name).toEqual('newValue');
    + *   expect(getter(context, locals)).toEqual('local');
    + * 
    + * + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + * + * The returned function also has the following properties: + * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript + * literal. + * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript + * constant literals. + * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be + * set to a function to change its value on the given context. + * + */ +function $ParseProvider() { + var cache = {}; + this.$get = ['$filter', '$sniffer', function($filter, $sniffer) { + return function(exp) { + switch(typeof exp) { + case 'string': + return cache.hasOwnProperty(exp) + ? cache[exp] + : cache[exp] = parser(exp, false, $filter, $sniffer.csp); + case 'function': + return exp; + default: + return noop; + } + }; + }]; +} + +/** + * @ngdoc service + * @name ng.$q + * @requires $rootScope + * + * @description + * A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q). + * + * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an + * interface for interacting with an object that represents the result of an action that is + * performed asynchronously, and may or may not be finished at any given point in time. + * + * From the perspective of dealing with error handling, deferred and promise APIs are to + * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. + * + *
    + *   // for the purpose of this example let's assume that variables `$q` and `scope` are
    + *   // available in the current lexical scope (they could have been injected or passed in).
    + *
    + *   function asyncGreet(name) {
    + *     var deferred = $q.defer();
    + *
    + *     setTimeout(function() {
    + *       // since this fn executes async in a future turn of the event loop, we need to wrap
    + *       // our code into an $apply call so that the model changes are properly observed.
    + *       scope.$apply(function() {
    + *         if (okToGreet(name)) {
    + *           deferred.resolve('Hello, ' + name + '!');
    + *         } else {
    + *           deferred.reject('Greeting ' + name + ' is not allowed.');
    + *         }
    + *       });
    + *     }, 1000);
    + *
    + *     return deferred.promise;
    + *   }
    + *
    + *   var promise = asyncGreet('Robin Hood');
    + *   promise.then(function(greeting) {
    + *     alert('Success: ' + greeting);
    + *   }, function(reason) {
    + *     alert('Failed: ' + reason);
    + *   });
    + * 
    + * + * At first it might not be obvious why this extra complexity is worth the trouble. The payoff + * comes in the way of + * [guarantees that promise and deferred APIs make](https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md). + * + * Additionally the promise api allows for composition that is very hard to do with the + * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. + * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the + * section on serial or parallel joining of promises. + * + * + * # The Deferred API + * + * A new instance of deferred is constructed by calling `$q.defer()`. + * + * The purpose of the deferred object is to expose the associated Promise instance as well as APIs + * that can be used for signaling the successful or unsuccessful completion of the task. + * + * **Methods** + * + * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection + * constructed via `$q.reject`, the promise will be rejected instead. + * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to + * resolving it with a rejection constructed via `$q.reject`. + * + * **Properties** + * + * - promise – `{Promise}` – promise object associated with this deferred. + * + * + * # The Promise API + * + * A new promise instance is created when a deferred instance is created and can be retrieved by + * calling `deferred.promise`. + * + * The purpose of the promise object is to allow for interested parties to get access to the result + * of the deferred task when it completes. + * + * **Methods** + * + * - `then(successCallback, errorCallback)` – regardless of when the promise was or will be resolved + * or rejected calls one of the success or error callbacks asynchronously as soon as the result + * is available. The callbacks are called with a single argument the result or rejection reason. + * + * This method *returns a new promise* which is resolved or rejected via the return value of the + * `successCallback` or `errorCallback`. + * + * - `always(callback)` – allows you to observe either the fulfillment or rejection of a promise, + * but to do so without modifying the final value. This is useful to release resources or do some + * clean-up that needs to be done whether the promise was rejected or resolved. See the [full + * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for + * more information. + * + * # Chaining promises + * + * Because calling `then` api of a promise returns a new derived promise, it is easily possible + * to create a chain of promises: + * + *
    + *   promiseB = promiseA.then(function(result) {
    + *     return result + 1;
    + *   });
    + *
    + *   // promiseB will be resolved immediately after promiseA is resolved and its value will be
    + *   // the result of promiseA incremented by 1
    + * 
    + * + * It is possible to create chains of any length and since a promise can be resolved with another + * promise (which will defer its resolution further), it is possible to pause/defer resolution of + * the promises at any point in the chain. This makes it possible to implement powerful apis like + * $http's response interceptors. + * + * + * # Differences between Kris Kowal's Q and $q + * + * There are three main differences: + * + * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation + * mechanism in angular, which means faster propagation of resolution or rejection into your + * models and avoiding unnecessary browser repaints, which would result in flickering UI. + * - $q promises are recognized by the templating engine in angular, which means that in templates + * you can treat promises attached to a scope as if they were the resulting values. + * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains + * all the important functionality needed for common async tasks. + * + * # Testing + * + *
    + *    it('should simulate promise', inject(function($q, $rootScope) {
    + *      var deferred = $q.defer();
    + *      var promise = deferred.promise;
    + *      var resolvedValue;
    + * 
    + *      promise.then(function(value) { resolvedValue = value; });
    + *      expect(resolvedValue).toBeUndefined();
    + * 
    + *      // Simulate resolving of promise
    + *      deferred.resolve(123);
    + *      // Note that the 'then' function does not get called synchronously.
    + *      // This is because we want the promise API to always be async, whether or not
    + *      // it got called synchronously or asynchronously.
    + *      expect(resolvedValue).toBeUndefined();
    + * 
    + *      // Propagate promise resolution to 'then' functions using $apply().
    + *      $rootScope.$apply();
    + *      expect(resolvedValue).toEqual(123);
    + *    });
    + *  
    + */ +function $QProvider() { + + this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { + return qFactory(function(callback) { + $rootScope.$evalAsync(callback); + }, $exceptionHandler); + }]; +} + + +/** + * Constructs a promise manager. + * + * @param {function(function)} nextTick Function for executing functions in the next turn. + * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for + * debugging purposes. + * @returns {object} Promise manager. + */ +function qFactory(nextTick, exceptionHandler) { + + /** + * @ngdoc + * @name ng.$q#defer + * @methodOf ng.$q + * @description + * Creates a `Deferred` object which represents a task which will finish in the future. + * + * @returns {Deferred} Returns a new instance of deferred. + */ + var defer = function() { + var pending = [], + value, deferred; + + deferred = { + + resolve: function(val) { + if (pending) { + var callbacks = pending; + pending = undefined; + value = ref(val); + + if (callbacks.length) { + nextTick(function() { + var callback; + for (var i = 0, ii = callbacks.length; i < ii; i++) { + callback = callbacks[i]; + value.then(callback[0], callback[1]); + } + }); + } + } + }, + + + reject: function(reason) { + deferred.resolve(reject(reason)); + }, + + + promise: { + then: function(callback, errback) { + var result = defer(); + + var wrappedCallback = function(value) { + try { + result.resolve((callback || defaultCallback)(value)); + } catch(e) { + exceptionHandler(e); + result.reject(e); + } + }; + + var wrappedErrback = function(reason) { + try { + result.resolve((errback || defaultErrback)(reason)); + } catch(e) { + exceptionHandler(e); + result.reject(e); + } + }; + + if (pending) { + pending.push([wrappedCallback, wrappedErrback]); + } else { + value.then(wrappedCallback, wrappedErrback); + } + + return result.promise; + }, + always: function(callback) { + + function makePromise(value, resolved) { + var result = defer(); + if (resolved) { + result.resolve(value); + } else { + result.reject(value); + } + return result.promise; + } + + function handleCallback(value, isResolved) { + var callbackOutput = null; + try { + callbackOutput = (callback ||defaultCallback)(); + } catch(e) { + return makePromise(e, false); + } + if (callbackOutput && callbackOutput.then) { + return callbackOutput.then(function() { + return makePromise(value, isResolved); + }, function(error) { + return makePromise(error, false); + }); + } else { + return makePromise(value, isResolved); + } + } + + return this.then(function(value) { + return handleCallback(value, true); + }, function(error) { + return handleCallback(error, false); + }); + } + } + }; + + return deferred; + }; + + + var ref = function(value) { + if (value && value.then) return value; + return { + then: function(callback) { + var result = defer(); + nextTick(function() { + result.resolve(callback(value)); + }); + return result.promise; + } + }; + }; + + + /** + * @ngdoc + * @name ng.$q#reject + * @methodOf ng.$q + * @description + * Creates a promise that is resolved as rejected with the specified `reason`. This api should be + * used to forward rejection in a chain of promises. If you are dealing with the last promise in + * a promise chain, you don't need to worry about it. + * + * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of + * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via + * a promise error callback and you want to forward the error to the promise derived from the + * current promise, you have to "rethrow" the error by returning a rejection constructed via + * `reject`. + * + *
    +   *   promiseB = promiseA.then(function(result) {
    +   *     // success: do something and resolve promiseB
    +   *     //          with the old or a new result
    +   *     return result;
    +   *   }, function(reason) {
    +   *     // error: handle the error if possible and
    +   *     //        resolve promiseB with newPromiseOrValue,
    +   *     //        otherwise forward the rejection to promiseB
    +   *     if (canHandle(reason)) {
    +   *      // handle the error and recover
    +   *      return newPromiseOrValue;
    +   *     }
    +   *     return $q.reject(reason);
    +   *   });
    +   * 
    + * + * @param {*} reason Constant, message, exception or an object representing the rejection reason. + * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. + */ + var reject = function(reason) { + return { + then: function(callback, errback) { + var result = defer(); + nextTick(function() { + result.resolve((errback || defaultErrback)(reason)); + }); + return result.promise; + } + }; + }; + + + /** + * @ngdoc + * @name ng.$q#when + * @methodOf ng.$q + * @description + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. + * This is useful when you are dealing with an object that might or might not be a promise, or if + * the promise comes from a source that can't be trusted. + * + * @param {*} value Value or a promise + * @returns {Promise} Returns a promise of the passed value or promise + */ + var when = function(value, callback, errback) { + var result = defer(), + done; + + var wrappedCallback = function(value) { + try { + return (callback || defaultCallback)(value); + } catch (e) { + exceptionHandler(e); + return reject(e); + } + }; + + var wrappedErrback = function(reason) { + try { + return (errback || defaultErrback)(reason); + } catch (e) { + exceptionHandler(e); + return reject(e); + } + }; + + nextTick(function() { + ref(value).then(function(value) { + if (done) return; + done = true; + result.resolve(ref(value).then(wrappedCallback, wrappedErrback)); + }, function(reason) { + if (done) return; + done = true; + result.resolve(wrappedErrback(reason)); + }); + }); + + return result.promise; + }; + + + function defaultCallback(value) { + return value; + } + + + function defaultErrback(reason) { + return reject(reason); + } + + + /** + * @ngdoc + * @name ng.$q#all + * @methodOf ng.$q + * @description + * Combines multiple promises into a single promise that is resolved when all of the input + * promises are resolved. + * + * @param {Array.|Object.} promises An array or hash of promises. + * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, + * each value corresponding to the promise at the same index/key in the `promises` array/hash. If any of + * the promises is resolved with a rejection, this resulting promise will be resolved with the + * same rejection. + */ + function all(promises) { + var deferred = defer(), + counter = 0, + results = isArray(promises) ? [] : {}; + + forEach(promises, function(promise, key) { + counter++; + ref(promise).then(function(value) { + if (results.hasOwnProperty(key)) return; + results[key] = value; + if (!(--counter)) deferred.resolve(results); + }, function(reason) { + if (results.hasOwnProperty(key)) return; + deferred.reject(reason); + }); + }); + + if (counter === 0) { + deferred.resolve(results); + } + + return deferred.promise; + } + + return { + defer: defer, + reject: reject, + when: when, + all: all + }; +} + +/** + * @ngdoc object + * @name ng.$routeProvider + * @function + * + * @description + * + * Used for configuring routes. See {@link ng.$route $route} for an example. + */ +function $RouteProvider(){ + var routes = {}; + + /** + * @ngdoc method + * @name ng.$routeProvider#when + * @methodOf ng.$routeProvider + * + * @param {string} path Route path (matched against `$location.path`). If `$location.path` + * contains redundant trailing slash or is missing one, the route will still match and the + * `$location.path` will be updated to add or drop the trailing slash to exactly match the + * route definition. + * + * * `path` can contain named groups starting with a colon (`:name`). All characters up + * to the next slash are matched and stored in `$routeParams` under the given `name` + * when the route matches. + * * `path` can contain named groups starting with a star (`*name`). All characters are + * eagerly stored in `$routeParams` under the given `name` when the route matches. + * + * For example, routes like `/color/:color/largecode/*largecode/edit` will match + * `/color/brown/largecode/code/with/slashs/edit` and extract: + * + * * `color: brown` + * * `largecode: code/with/slashs`. + * + * + * @param {Object} route Mapping information to be assigned to `$route.current` on route + * match. + * + * Object properties: + * + * - `controller` – `{(string|function()=}` – Controller fn that should be associated with newly + * created scope or the name of a {@link angular.Module#controller registered controller} + * if passed as a string. + * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be + * published to scope under the `controllerAs` name. + * - `template` – `{string=|function()=}` – html template as a string or function that returns + * an html template as a string which should be used by {@link ng.directive:ngView ngView} or + * {@link ng.directive:ngInclude ngInclude} directives. + * This property takes precedence over `templateUrl`. + * + * If `template` is a function, it will be called with the following parameters: + * + * - `{Array.}` - route parameters extracted from the current + * `$location.path()` by applying the current route + * + * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html + * template that should be used by {@link ng.directive:ngView ngView}. + * + * If `templateUrl` is a function, it will be called with the following parameters: + * + * - `{Array.}` - route parameters extracted from the current + * `$location.path()` by applying the current route + * + * - `resolve` - `{Object.=}` - An optional map of dependencies which should + * be injected into the controller. If any of these dependencies are promises, they will be + * resolved and converted to a value before the controller is instantiated and the + * `$routeChangeSuccess` event is fired. The map object is: + * + * - `key` – `{string}`: a name of a dependency to be injected into the controller. + * - `factory` - `{string|function}`: If `string` then it is an alias for a service. + * Otherwise if function, then it is {@link api/AUTO.$injector#invoke injected} + * and the return value is treated as the dependency. If the result is a promise, it is resolved + * before its value is injected into the controller. + * + * - `redirectTo` – {(string|function())=} – value to update + * {@link ng.$location $location} path with and trigger route redirection. + * + * If `redirectTo` is a function, it will be called with the following parameters: + * + * - `{Object.}` - route parameters extracted from the current + * `$location.path()` by applying the current route templateUrl. + * - `{string}` - current `$location.path()` + * - `{Object}` - current `$location.search()` + * + * The custom `redirectTo` function is expected to return a string which will be used + * to update `$location.path()` and `$location.search()`. + * + * - `[reloadOnSearch=true]` - {boolean=} - reload route when only $location.search() + * changes. + * + * If the option is set to `false` and url in the browser changes, then + * `$routeUpdate` event is broadcasted on the root scope. + * + * - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive + * + * If the option is set to `true`, then the particular route can be matched without being + * case sensitive + * + * @returns {Object} self + * + * @description + * Adds a new route definition to the `$route` service. + */ + this.when = function(path, route) { + routes[path] = extend({reloadOnSearch: true, caseInsensitiveMatch: false}, route); + + // create redirection for trailing slashes + if (path) { + var redirectPath = (path[path.length-1] == '/') + ? path.substr(0, path.length-1) + : path +'/'; + + routes[redirectPath] = {redirectTo: path}; + } + + return this; + }; + + /** + * @ngdoc method + * @name ng.$routeProvider#otherwise + * @methodOf ng.$routeProvider + * + * @description + * Sets route definition that will be used on route change when no other route definition + * is matched. + * + * @param {Object} params Mapping information to be assigned to `$route.current`. + * @returns {Object} self + */ + this.otherwise = function(params) { + this.when(null, params); + return this; + }; + + + this.$get = ['$rootScope', '$location', '$routeParams', '$q', '$injector', '$http', '$templateCache', + function( $rootScope, $location, $routeParams, $q, $injector, $http, $templateCache) { + + /** + * @ngdoc object + * @name ng.$route + * @requires $location + * @requires $routeParams + * + * @property {Object} current Reference to the current route definition. + * The route definition contains: + * + * - `controller`: The controller constructor as define in route definition. + * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for + * controller instantiation. The `locals` contain + * the resolved values of the `resolve` map. Additionally the `locals` also contain: + * + * - `$scope` - The current route scope. + * - `$template` - The current route template HTML. + * + * @property {Array.} routes Array of all configured routes. + * + * @description + * Is used for deep-linking URLs to controllers and views (HTML partials). + * It watches `$location.url()` and tries to map the path to an existing route definition. + * + * You can define routes through {@link ng.$routeProvider $routeProvider}'s API. + * + * The `$route` service is typically used in conjunction with {@link ng.directive:ngView ngView} + * directive and the {@link ng.$routeParams $routeParams} service. + * + * @example + This example shows how changing the URL hash causes the `$route` to match a route against the + URL, and the `ngView` pulls in the partial. + + Note that this example is using {@link ng.directive:script inlined templates} + to get it working on jsfiddle as well. + + + +
    + Choose: + Moby | + Moby: Ch1 | + Gatsby | + Gatsby: Ch4 | + Scarlet Letter
    + +
    +
    + +
    $location.path() = {{$location.path()}}
    +
    $route.current.templateUrl = {{$route.current.templateUrl}}
    +
    $route.current.params = {{$route.current.params}}
    +
    $route.current.scope.name = {{$route.current.scope.name}}
    +
    $routeParams = {{$routeParams}}
    +
    +
    + + + controller: {{name}}
    + Book Id: {{params.bookId}}
    +
    + + + controller: {{name}}
    + Book Id: {{params.bookId}}
    + Chapter Id: {{params.chapterId}} +
    + + + angular.module('ngView', [], function($routeProvider, $locationProvider) { + $routeProvider.when('/Book/:bookId', { + templateUrl: 'book.html', + controller: BookCntl, + resolve: { + // I will cause a 1 second delay + delay: function($q, $timeout) { + var delay = $q.defer(); + $timeout(delay.resolve, 1000); + return delay.promise; + } + } + }); + $routeProvider.when('/Book/:bookId/ch/:chapterId', { + templateUrl: 'chapter.html', + controller: ChapterCntl + }); + + // configure html5 to get links working on jsfiddle + $locationProvider.html5Mode(true); + }); + + function MainCntl($scope, $route, $routeParams, $location) { + $scope.$route = $route; + $scope.$location = $location; + $scope.$routeParams = $routeParams; + } + + function BookCntl($scope, $routeParams) { + $scope.name = "BookCntl"; + $scope.params = $routeParams; + } + + function ChapterCntl($scope, $routeParams) { + $scope.name = "ChapterCntl"; + $scope.params = $routeParams; + } + + + + it('should load and compile correct template', function() { + element('a:contains("Moby: Ch1")').click(); + var content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: ChapterCntl/); + expect(content).toMatch(/Book Id\: Moby/); + expect(content).toMatch(/Chapter Id\: 1/); + + element('a:contains("Scarlet")').click(); + sleep(2); // promises are not part of scenario waiting + content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: BookCntl/); + expect(content).toMatch(/Book Id\: Scarlet/); + }); + +
    + */ + + /** + * @ngdoc event + * @name ng.$route#$routeChangeStart + * @eventOf ng.$route + * @eventType broadcast on root scope + * @description + * Broadcasted before a route change. At this point the route services starts + * resolving all of the dependencies needed for the route change to occurs. + * Typically this involves fetching the view template as well as any dependencies + * defined in `resolve` route property. Once all of the dependencies are resolved + * `$routeChangeSuccess` is fired. + * + * @param {Route} next Future route information. + * @param {Route} current Current route information. + */ + + /** + * @ngdoc event + * @name ng.$route#$routeChangeSuccess + * @eventOf ng.$route + * @eventType broadcast on root scope + * @description + * Broadcasted after a route dependencies are resolved. + * {@link ng.directive:ngView ngView} listens for the directive + * to instantiate the controller and render the view. + * + * @param {Object} angularEvent Synthetic event object. + * @param {Route} current Current route information. + * @param {Route|Undefined} previous Previous route information, or undefined if current is first route entered. + */ + + /** + * @ngdoc event + * @name ng.$route#$routeChangeError + * @eventOf ng.$route + * @eventType broadcast on root scope + * @description + * Broadcasted if any of the resolve promises are rejected. + * + * @param {Route} current Current route information. + * @param {Route} previous Previous route information. + * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise. + */ + + /** + * @ngdoc event + * @name ng.$route#$routeUpdate + * @eventOf ng.$route + * @eventType broadcast on root scope + * @description + * + * The `reloadOnSearch` property has been set to false, and we are reusing the same + * instance of the Controller. + */ + + var forceReload = false, + $route = { + routes: routes, + + /** + * @ngdoc method + * @name ng.$route#reload + * @methodOf ng.$route + * + * @description + * Causes `$route` service to reload the current route even if + * {@link ng.$location $location} hasn't changed. + * + * As a result of that, {@link ng.directive:ngView ngView} + * creates new scope, reinstantiates the controller. + */ + reload: function() { + forceReload = true; + $rootScope.$evalAsync(updateRoute); + } + }; + + $rootScope.$on('$locationChangeSuccess', updateRoute); + + return $route; + + ///////////////////////////////////////////////////// + + /** + * @param on {string} current url + * @param when {string} route when template to match the url against + * @param whenProperties {Object} properties to define when's matching behavior + * @return {?Object} + */ + function switchRouteMatcher(on, when, whenProperties) { + // TODO(i): this code is convoluted and inefficient, we should construct the route matching + // regex only once and then reuse it + + // Escape regexp special characters. + when = '^' + when.replace(/[-\/\\^$:*+?.()|[\]{}]/g, "\\$&") + '$'; + + var regex = '', + params = [], + dst = {}; + + var re = /\\([:*])(\w+)/g, + paramMatch, + lastMatchedIndex = 0; + + while ((paramMatch = re.exec(when)) !== null) { + // Find each :param in `when` and replace it with a capturing group. + // Append all other sections of when unchanged. + regex += when.slice(lastMatchedIndex, paramMatch.index); + switch(paramMatch[1]) { + case ':': + regex += '([^\\/]*)'; + break; + case '*': + regex += '(.*)'; + break; + } + params.push(paramMatch[2]); + lastMatchedIndex = re.lastIndex; + } + // Append trailing path part. + regex += when.substr(lastMatchedIndex); + + var match = on.match(new RegExp(regex, whenProperties.caseInsensitiveMatch ? 'i' : '')); + if (match) { + forEach(params, function(name, index) { + dst[name] = match[index + 1]; + }); + } + return match ? dst : null; + } + + function updateRoute() { + var next = parseRoute(), + last = $route.current; + + if (next && last && next.$$route === last.$$route + && equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) { + last.params = next.params; + copy(last.params, $routeParams); + $rootScope.$broadcast('$routeUpdate', last); + } else if (next || last) { + forceReload = false; + $rootScope.$broadcast('$routeChangeStart', next, last); + $route.current = next; + if (next) { + if (next.redirectTo) { + if (isString(next.redirectTo)) { + $location.path(interpolate(next.redirectTo, next.params)).search(next.params) + .replace(); + } else { + $location.url(next.redirectTo(next.pathParams, $location.path(), $location.search())) + .replace(); + } + } + } + + $q.when(next). + then(function() { + if (next) { + var locals = extend({}, next.resolve), + template; + + forEach(locals, function(value, key) { + locals[key] = isString(value) ? $injector.get(value) : $injector.invoke(value); + }); + + if (isDefined(template = next.template)) { + if (isFunction(template)) { + template = template(next.params); + } + } else if (isDefined(template = next.templateUrl)) { + if (isFunction(template)) { + template = template(next.params); + } + if (isDefined(template)) { + next.loadedTemplateUrl = template; + template = $http.get(template, {cache: $templateCache}). + then(function(response) { return response.data; }); + } + } + if (isDefined(template)) { + locals['$template'] = template; + } + return $q.all(locals); + } + }). + // after route change + then(function(locals) { + if (next == $route.current) { + if (next) { + next.locals = locals; + copy(next.params, $routeParams); + } + $rootScope.$broadcast('$routeChangeSuccess', next, last); + } + }, function(error) { + if (next == $route.current) { + $rootScope.$broadcast('$routeChangeError', next, last, error); + } + }); + } + } + + + /** + * @returns the current active route, by matching it against the URL + */ + function parseRoute() { + // Match a route + var params, match; + forEach(routes, function(route, path) { + if (!match && (params = switchRouteMatcher($location.path(), path, route))) { + match = inherit(route, { + params: extend({}, $location.search(), params), + pathParams: params}); + match.$$route = route; + } + }); + // No route matched; fallback to "otherwise" route + return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}}); + } + + /** + * @returns interpolation of the redirect path with the parameters + */ + function interpolate(string, params) { + var result = []; + forEach((string||'').split(':'), function(segment, i) { + if (i == 0) { + result.push(segment); + } else { + var segmentMatch = segment.match(/(\w+)(.*)/); + var key = segmentMatch[1]; + result.push(params[key]); + result.push(segmentMatch[2] || ''); + delete params[key]; + } + }); + return result.join(''); + } + }]; +} + +/** + * @ngdoc object + * @name ng.$routeParams + * @requires $route + * + * @description + * Current set of route parameters. The route parameters are a combination of the + * {@link ng.$location $location} `search()`, and `path()`. The `path` parameters + * are extracted when the {@link ng.$route $route} path is matched. + * + * In case of parameter name collision, `path` params take precedence over `search` params. + * + * The service guarantees that the identity of the `$routeParams` object will remain unchanged + * (but its properties will likely change) even when a route change occurs. + * + * @example + *
    + *  // Given:
    + *  // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
    + *  // Route: /Chapter/:chapterId/Section/:sectionId
    + *  //
    + *  // Then
    + *  $routeParams ==> {chapterId:1, sectionId:2, search:'moby'}
    + * 
    + */ +function $RouteParamsProvider() { + this.$get = valueFn({}); +} + +/** + * DESIGN NOTES + * + * The design decisions behind the scope are heavily favored for speed and memory consumption. + * + * The typical use of scope is to watch the expressions, which most of the time return the same + * value as last time so we optimize the operation. + * + * Closures construction is expensive in terms of speed as well as memory: + * - No closures, instead use prototypical inheritance for API + * - Internal state needs to be stored on scope directly, which means that private state is + * exposed as $$____ properties + * + * Loop operations are optimized by using while(count--) { ... } + * - this means that in order to keep the same order of execution as addition we have to add + * items to the array at the beginning (shift) instead of at the end (push) + * + * Child scopes are created and removed often + * - Using an array would be slow since inserts in middle are expensive so we use linked list + * + * There are few watches then a lot of observers. This is why you don't want the observer to be + * implemented in the same way as watch. Watch requires return of initialization function which + * are expensive to construct. + */ + + +/** + * @ngdoc object + * @name ng.$rootScopeProvider + * @description + * + * Provider for the $rootScope service. + */ + +/** + * @ngdoc function + * @name ng.$rootScopeProvider#digestTtl + * @methodOf ng.$rootScopeProvider + * @description + * + * Sets the number of digest iterations the scope should attempt to execute before giving up and + * assuming that the model is unstable. + * + * The current default is 10 iterations. + * + * @param {number} limit The number of digest iterations. + */ + + +/** + * @ngdoc object + * @name ng.$rootScope + * @description + * + * Every application has a single root {@link ng.$rootScope.Scope scope}. + * All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide + * event processing life-cycle. See {@link guide/scope developer guide on scopes}. + */ +function $RootScopeProvider(){ + var TTL = 10; + + this.digestTtl = function(value) { + if (arguments.length) { + TTL = value; + } + return TTL; + }; + + this.$get = ['$injector', '$exceptionHandler', '$parse', + function( $injector, $exceptionHandler, $parse) { + + /** + * @ngdoc function + * @name ng.$rootScope.Scope + * + * @description + * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the + * {@link AUTO.$injector $injector}. Child scopes are created using the + * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when + * compiled HTML template is executed.) + * + * Here is a simple scope snippet to show how you can interact with the scope. + *
    +     * 
    +     * 
    + * + * # Inheritance + * A scope can inherit from a parent scope, as in this example: + *
    +         var parent = $rootScope;
    +         var child = parent.$new();
    +
    +         parent.salutation = "Hello";
    +         child.name = "World";
    +         expect(child.salutation).toEqual('Hello');
    +
    +         child.salutation = "Welcome";
    +         expect(child.salutation).toEqual('Welcome');
    +         expect(parent.salutation).toEqual('Hello');
    +     * 
    + * + * + * @param {Object.=} providers Map of service factory which need to be provided + * for the current scope. Defaults to {@link ng}. + * @param {Object.=} instanceCache Provides pre-instantiated services which should + * append/override services provided by `providers`. This is handy when unit-testing and having + * the need to override a default service. + * @returns {Object} Newly created scope. + * + */ + function Scope() { + this.$id = nextUid(); + this.$$phase = this.$parent = this.$$watchers = + this.$$nextSibling = this.$$prevSibling = + this.$$childHead = this.$$childTail = null; + this['this'] = this.$root = this; + this.$$destroyed = false; + this.$$asyncQueue = []; + this.$$listeners = {}; + this.$$isolateBindings = {}; + } + + /** + * @ngdoc property + * @name ng.$rootScope.Scope#$id + * @propertyOf ng.$rootScope.Scope + * @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for + * debugging. + */ + + + Scope.prototype = { + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$new + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Creates a new child {@link ng.$rootScope.Scope scope}. + * + * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and + * {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope + * hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. + * + * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for + * the scope and its child scopes to be permanently detached from the parent and thus stop + * participating in model change detection and listener notification by invoking. + * + * @param {boolean} isolate if true then the scope does not prototypically inherit from the + * parent scope. The scope is isolated, as it can not see parent scope properties. + * When creating widgets it is useful for the widget to not accidentally read parent + * state. + * + * @returns {Object} The newly created child scope. + * + */ + $new: function(isolate) { + var Child, + child; + + if (isFunction(isolate)) { + // TODO: remove at some point + throw Error('API-CHANGE: Use $controller to instantiate controllers.'); + } + if (isolate) { + child = new Scope(); + child.$root = this.$root; + } else { + Child = function() {}; // should be anonymous; This is so that when the minifier munges + // the name it does not become random set of chars. These will then show up as class + // name in the debugger. + Child.prototype = this; + child = new Child(); + child.$id = nextUid(); + } + child['this'] = child; + child.$$listeners = {}; + child.$parent = this; + child.$$watchers = child.$$nextSibling = child.$$childHead = child.$$childTail = null; + child.$$prevSibling = this.$$childTail; + if (this.$$childHead) { + this.$$childTail.$$nextSibling = child; + this.$$childTail = child; + } else { + this.$$childHead = this.$$childTail = child; + } + return child; + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$watch + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Registers a `listener` callback to be executed whenever the `watchExpression` changes. + * + * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest $digest()} and + * should return the value which will be watched. (Since {@link ng.$rootScope.Scope#$digest $digest()} + * reruns when it detects changes the `watchExpression` can execute multiple times per + * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.) + * - The `listener` is called only when the value from the current `watchExpression` and the + * previous call to `watchExpression` are not equal (with the exception of the initial run, + * see below). The inequality is determined according to + * {@link angular.equals} function. To save the value of the object for later comparison, the + * {@link angular.copy} function is used. It also means that watching complex options will + * have adverse memory and performance implications. + * - The watch `listener` may change the model, which may trigger other `listener`s to fire. This + * is achieved by rerunning the watchers until no changes are detected. The rerun iteration + * limit is 10 to prevent an infinite loop deadlock. + * + * + * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, + * you can register a `watchExpression` function with no `listener`. (Since `watchExpression` + * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a change is + * detected, be prepared for multiple calls to your listener.) + * + * After a watcher is registered with the scope, the `listener` fn is called asynchronously + * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the + * watcher. In rare cases, this is undesirable because the listener is called when the result + * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you + * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the + * listener was called due to initialization. + * + * + * # Example + *
    +           // let's assume that scope was dependency injected as the $rootScope
    +           var scope = $rootScope;
    +           scope.name = 'misko';
    +           scope.counter = 0;
    +
    +           expect(scope.counter).toEqual(0);
    +           scope.$watch('name', function(newValue, oldValue) { scope.counter = scope.counter + 1; });
    +           expect(scope.counter).toEqual(0);
    +
    +           scope.$digest();
    +           // no variable change
    +           expect(scope.counter).toEqual(0);
    +
    +           scope.name = 'adam';
    +           scope.$digest();
    +           expect(scope.counter).toEqual(1);
    +       * 
    + * + * + * + * @param {(function()|string)} watchExpression Expression that is evaluated on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a + * call to the `listener`. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(scope)`: called with current `scope` as a parameter. + * @param {(function()|string)=} listener Callback called whenever the return value of + * the `watchExpression` changes. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(newValue, oldValue, scope)`: called with current and previous values as parameters. + * + * @param {boolean=} objectEquality Compare object for equality rather than for reference. + * @returns {function()} Returns a deregistration function for this listener. + */ + $watch: function(watchExp, listener, objectEquality) { + var scope = this, + get = compileToFn(watchExp, 'watch'), + array = scope.$$watchers, + watcher = { + fn: listener, + last: initWatchVal, + get: get, + exp: watchExp, + eq: !!objectEquality + }; + + // in the case user pass string, we need to compile it, do we really need this ? + if (!isFunction(listener)) { + var listenFn = compileToFn(listener || noop, 'listener'); + watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);}; + } + + if (typeof watchExp == 'string' && get.constant) { + var originalFn = watcher.fn; + watcher.fn = function(newVal, oldVal, scope) { + originalFn.call(this, newVal, oldVal, scope); + arrayRemove(array, watcher); + }; + } + + if (!array) { + array = scope.$$watchers = []; + } + // we use unshift since we use a while loop in $digest for speed. + // the while loop reads in reverse order. + array.unshift(watcher); + + return function() { + arrayRemove(array, watcher); + }; + }, + + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$watchCollection + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Shallow watches the properties of an object and fires whenever any of the properties change + * (for arrays this implies watching the array items, for object maps this implies watching the properties). + * If a change is detected the `listener` callback is fired. + * + * - The `obj` collection is observed via standard $watch operation and is examined on every call to $digest() to + * see if any items have been added, removed, or moved. + * - The `listener` is called whenever anything within the `obj` has changed. Examples include adding new items + * into the object or array, removing and moving items around. + * + * + * # Example + *
    +          $scope.names = ['igor', 'matias', 'misko', 'james'];
    +          $scope.dataCount = 4;
    +
    +          $scope.$watchCollection('names', function(newNames, oldNames) {
    +            $scope.dataCount = newNames.length;
    +          });
    +
    +          expect($scope.dataCount).toEqual(4);
    +          $scope.$digest();
    +
    +          //still at 4 ... no changes
    +          expect($scope.dataCount).toEqual(4);
    +
    +          $scope.names.pop();
    +          $scope.$digest();
    +
    +          //now there's been a change
    +          expect($scope.dataCount).toEqual(3);
    +       * 
    + * + * + * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The expression value + * should evaluate to an object or an array which is observed on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the collection will trigger + * a call to the `listener`. + * + * @param {function(newCollection, oldCollection, scope)} listener a callback function that is fired with both + * the `newCollection` and `oldCollection` as parameters. + * The `newCollection` object is the newly modified data obtained from the `obj` expression and the + * `oldCollection` object is a copy of the former collection data. + * The `scope` refers to the current scope. + * + * @returns {function()} Returns a de-registration function for this listener. When the de-registration function is executed + * then the internal watch operation is terminated. + */ + $watchCollection: function(obj, listener) { + var self = this; + var oldValue; + var newValue; + var changeDetected = 0; + var objGetter = $parse(obj); + var internalArray = []; + var internalObject = {}; + var oldLength = 0; + + function $watchCollectionWatch() { + newValue = objGetter(self); + var newLength, key; + + if (!isObject(newValue)) { + if (oldValue !== newValue) { + oldValue = newValue; + changeDetected++; + } + } else if (isArrayLike(newValue)) { + if (oldValue !== internalArray) { + // we are transitioning from something which was not an array into array. + oldValue = internalArray; + oldLength = oldValue.length = 0; + changeDetected++; + } + + newLength = newValue.length; + + if (oldLength !== newLength) { + // if lengths do not match we need to trigger change notification + changeDetected++; + oldValue.length = oldLength = newLength; + } + // copy the items to oldValue and look for changes. + for (var i = 0; i < newLength; i++) { + if (oldValue[i] !== newValue[i]) { + changeDetected++; + oldValue[i] = newValue[i]; + } + } + } else { + if (oldValue !== internalObject) { + // we are transitioning from something which was not an object into object. + oldValue = internalObject = {}; + oldLength = 0; + changeDetected++; + } + // copy the items to oldValue and look for changes. + newLength = 0; + for (key in newValue) { + if (newValue.hasOwnProperty(key)) { + newLength++; + if (oldValue.hasOwnProperty(key)) { + if (oldValue[key] !== newValue[key]) { + changeDetected++; + oldValue[key] = newValue[key]; + } + } else { + oldLength++; + oldValue[key] = newValue[key]; + changeDetected++; + } + } + } + if (oldLength > newLength) { + // we used to have more keys, need to find them and destroy them. + changeDetected++; + for(key in oldValue) { + if (oldValue.hasOwnProperty(key) && !newValue.hasOwnProperty(key)) { + oldLength--; + delete oldValue[key]; + } + } + } + } + return changeDetected; + } + + function $watchCollectionAction() { + listener(newValue, oldValue, self); + } + + return this.$watch($watchCollectionWatch, $watchCollectionAction); + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$digest + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and its children. + * Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the + * `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} until no more listeners are + * firing. This means that it is possible to get into an infinite loop. This function will throw + * `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 10. + * + * Usually you don't call `$digest()` directly in + * {@link ng.directive:ngController controllers} or in + * {@link ng.$compileProvider#directive directives}. + * Instead a call to {@link ng.$rootScope.Scope#$apply $apply()} (typically from within a + * {@link ng.$compileProvider#directive directives}) will force a `$digest()`. + * + * If you want to be notified whenever `$digest()` is called, + * you can register a `watchExpression` function with {@link ng.$rootScope.Scope#$watch $watch()} + * with no `listener`. + * + * You may have a need to call `$digest()` from within unit-tests, to simulate the scope + * life-cycle. + * + * # Example + *
    +           var scope = ...;
    +           scope.name = 'misko';
    +           scope.counter = 0;
    +
    +           expect(scope.counter).toEqual(0);
    +           scope.$watch('name', function(newValue, oldValue) {
    +             scope.counter = scope.counter + 1;
    +           });
    +           expect(scope.counter).toEqual(0);
    +
    +           scope.$digest();
    +           // no variable change
    +           expect(scope.counter).toEqual(0);
    +
    +           scope.name = 'adam';
    +           scope.$digest();
    +           expect(scope.counter).toEqual(1);
    +       * 
    + * + */ + $digest: function() { + var watch, value, last, + watchers, + asyncQueue = this.$$asyncQueue, + length, + dirty, ttl = TTL, + next, current, target = this, + watchLog = [], + logIdx, logMsg; + + beginPhase('$digest'); + + do { // "while dirty" loop + dirty = false; + current = target; + + while(asyncQueue.length) { + try { + current.$eval(asyncQueue.shift()); + } catch (e) { + $exceptionHandler(e); + } + } + + do { // "traverse the scopes" loop + if ((watchers = current.$$watchers)) { + // process our watches + length = watchers.length; + while (length--) { + try { + watch = watchers[length]; + // Most common watches are on primitives, in which case we can short + // circuit it with === operator, only when === fails do we use .equals + if ((value = watch.get(current)) !== (last = watch.last) && + !(watch.eq + ? equals(value, last) + : (typeof value == 'number' && typeof last == 'number' + && isNaN(value) && isNaN(last)))) { + dirty = true; + watch.last = watch.eq ? copy(value) : value; + watch.fn(value, ((last === initWatchVal) ? value : last), current); + if (ttl < 5) { + logIdx = 4 - ttl; + if (!watchLog[logIdx]) watchLog[logIdx] = []; + logMsg = (isFunction(watch.exp)) + ? 'fn: ' + (watch.exp.name || watch.exp.toString()) + : watch.exp; + logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last); + watchLog[logIdx].push(logMsg); + } + } + } catch (e) { + $exceptionHandler(e); + } + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $broadcast + if (!(next = (current.$$childHead || (current !== target && current.$$nextSibling)))) { + while(current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } while ((current = next)); + + if(dirty && !(ttl--)) { + clearPhase(); + throw Error(TTL + ' $digest() iterations reached. Aborting!\n' + + 'Watchers fired in the last 5 iterations: ' + toJson(watchLog)); + } + } while (dirty || asyncQueue.length); + + clearPhase(); + }, + + + /** + * @ngdoc event + * @name ng.$rootScope.Scope#$destroy + * @eventOf ng.$rootScope.Scope + * @eventType broadcast on scope being destroyed + * + * @description + * Broadcasted when a scope and its children are being destroyed. + */ + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$destroy + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Removes the current scope (and all of its children) from the parent scope. Removal implies + * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer + * propagate to the current scope and its children. Removal also implies that the current + * scope is eligible for garbage collection. + * + * The `$destroy()` is usually used by directives such as + * {@link ng.directive:ngRepeat ngRepeat} for managing the + * unrolling of the loop. + * + * Just before a scope is destroyed a `$destroy` event is broadcasted on this scope. + * Application code can register a `$destroy` event handler that will give it chance to + * perform any necessary cleanup. + */ + $destroy: function() { + // we can't destroy the root scope or a scope that has been already destroyed + if ($rootScope == this || this.$$destroyed) return; + var parent = this.$parent; + + this.$broadcast('$destroy'); + this.$$destroyed = true; + + if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling; + if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling; + if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; + if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; + + // This is bogus code that works around Chrome's GC leak + // see: https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 + this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = + this.$$childTail = null; + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$eval + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Executes the `expression` on the current scope returning the result. Any exceptions in the + * expression are propagated (uncaught). This is useful when evaluating Angular expressions. + * + * # Example + *
    +           var scope = ng.$rootScope.Scope();
    +           scope.a = 1;
    +           scope.b = 2;
    +
    +           expect(scope.$eval('a+b')).toEqual(3);
    +           expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
    +       * 
    + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @returns {*} The result of evaluating the expression. + */ + $eval: function(expr, locals) { + return $parse(expr)(this, locals); + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$evalAsync + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Executes the expression on the current scope at a later point in time. + * + * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that: + * + * - it will execute in the current script execution context (before any DOM rendering). + * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after + * `expression` execution. + * + * Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + */ + $evalAsync: function(expr) { + this.$$asyncQueue.push(expr); + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$apply + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * `$apply()` is used to execute an expression in angular from outside of the angular framework. + * (For example from browser DOM events, setTimeout, XHR or third party libraries). + * Because we are calling into the angular framework we need to perform proper scope life-cycle + * of {@link ng.$exceptionHandler exception handling}, + * {@link ng.$rootScope.Scope#$digest executing watches}. + * + * ## Life cycle + * + * # Pseudo-Code of `$apply()` + *
    +           function $apply(expr) {
    +             try {
    +               return $eval(expr);
    +             } catch (e) {
    +               $exceptionHandler(e);
    +             } finally {
    +               $root.$digest();
    +             }
    +           }
    +       * 
    + * + * + * Scope's `$apply()` method transitions through the following stages: + * + * 1. The {@link guide/expression expression} is executed using the + * {@link ng.$rootScope.Scope#$eval $eval()} method. + * 2. Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression + * was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. + * + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + * + * @returns {*} The result of evaluating the expression. + */ + $apply: function(expr) { + try { + beginPhase('$apply'); + return this.$eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + clearPhase(); + try { + $rootScope.$digest(); + } catch (e) { + $exceptionHandler(e); + throw e; + } + } + }, + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$on + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for discussion of + * event life cycle. + * + * The event listener function format is: `function(event, args...)`. The `event` object + * passed into the listener has the following attributes: + * + * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or `$broadcast`-ed. + * - `currentScope` - `{Scope}`: the current scope which is handling the event. + * - `name` - `{string}`: Name of the event. + * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel further event + * propagation (available only for events that were `$emit`-ed). + * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag to true. + * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. + * + * @param {string} name Event name to listen on. + * @param {function(event, args...)} listener Function to call when the event is emitted. + * @returns {function()} Returns a deregistration function for this listener. + */ + $on: function(name, listener) { + var namedListeners = this.$$listeners[name]; + if (!namedListeners) { + this.$$listeners[name] = namedListeners = []; + } + namedListeners.push(listener); + + return function() { + namedListeners[indexOf(namedListeners, listener)] = null; + }; + }, + + + /** + * @ngdoc function + * @name ng.$rootScope.Scope#$emit + * @methodOf ng.$rootScope.Scope + * @function + * + * @description + * Dispatches an event `name` upwards through the scope hierarchy notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$emit` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified. + * Afterwards, the event traverses upwards toward the root scope and calls all registered + * listeners along the way. The event will stop propagating if one of the listeners cancels it. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to emit. + * @param {...*} args Optional set of arguments which will be passed onto the event listeners. + * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} + */ + $emit: function(name, args) { + var empty = [], + namedListeners, + scope = this, + stopPropagation = false, + event = { + name: name, + targetScope: scope, + stopPropagation: function() {stopPropagation = true;}, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }, + listenerArgs = concat([event], arguments, 1), + i, length; + + do { + namedListeners = scope.$$listeners[name] || empty; + event.currentScope = scope; + for (i=0, length=namedListeners.length; i 7), + hasEvent: function(event) { + // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have + // it. In particular the event is not fired when backspace or delete key are pressed or + // when cut operation is performed. + if (event == 'input' && msie == 9) return false; + + if (isUndefined(eventSupport[event])) { + var divElm = document.createElement('div'); + eventSupport[event] = 'on' + event in divElm; + } + + return eventSupport[event]; + }, + csp: document.securityPolicy ? document.securityPolicy.isActive : false, + vendorPrefix: vendorPrefix, + transitions : transitions, + animations : animations + }; + }]; +} + +/** + * @ngdoc object + * @name ng.$window + * + * @description + * A reference to the browser's `window` object. While `window` + * is globally available in JavaScript, it causes testability problems, because + * it is a global variable. In angular we always refer to it through the + * `$window` service, so it may be overridden, removed or mocked for testing. + * + * All expressions are evaluated with respect to current scope so they don't + * suffer from window globality. + * + * @example + + + +
    + + +
    +
    + + it('should display the greeting in the input box', function() { + input('greeting').enter('Hello, E2E Tests'); + // If we click the button it will block the test runner + // element(':button').click(); + }); + +
    + */ +function $WindowProvider(){ + this.$get = valueFn(window); +} + +/** + * Parse headers into key value object + * + * @param {string} headers Raw headers as a string + * @returns {Object} Parsed headers as key value object + */ +function parseHeaders(headers) { + var parsed = {}, key, val, i; + + if (!headers) return parsed; + + forEach(headers.split('\n'), function(line) { + i = line.indexOf(':'); + key = lowercase(trim(line.substr(0, i))); + val = trim(line.substr(i + 1)); + + if (key) { + if (parsed[key]) { + parsed[key] += ', ' + val; + } else { + parsed[key] = val; + } + } + }); + + return parsed; +} + + +var IS_SAME_DOMAIN_URL_MATCH = /^(([^:]+):)?\/\/(\w+:{0,1}\w*@)?([\w\.-]*)?(:([0-9]+))?(.*)$/; + + +/** + * Parse a request and location URL and determine whether this is a same-domain request. + * + * @param {string} requestUrl The url of the request. + * @param {string} locationUrl The current browser location url. + * @returns {boolean} Whether the request is for the same domain. + */ +function isSameDomain(requestUrl, locationUrl) { + var match = IS_SAME_DOMAIN_URL_MATCH.exec(requestUrl); + // if requestUrl is relative, the regex does not match. + if (match == null) return true; + + var domain1 = { + protocol: match[2], + host: match[4], + port: int(match[6]) || DEFAULT_PORTS[match[2]] || null, + // IE8 sets unmatched groups to '' instead of undefined. + relativeProtocol: match[2] === undefined || match[2] === '' + }; + + match = SERVER_MATCH.exec(locationUrl); + var domain2 = { + protocol: match[1], + host: match[3], + port: int(match[5]) || DEFAULT_PORTS[match[1]] || null + }; + + return (domain1.protocol == domain2.protocol || domain1.relativeProtocol) && + domain1.host == domain2.host && + (domain1.port == domain2.port || (domain1.relativeProtocol && + domain2.port == DEFAULT_PORTS[domain2.protocol])); +} + + +/** + * Returns a function that provides access to parsed headers. + * + * Headers are lazy parsed when first requested. + * @see parseHeaders + * + * @param {(string|Object)} headers Headers to provide access to. + * @returns {function(string=)} Returns a getter function which if called with: + * + * - if called with single an argument returns a single header value or null + * - if called with no arguments returns an object containing all headers. + */ +function headersGetter(headers) { + var headersObj = isObject(headers) ? headers : undefined; + + return function(name) { + if (!headersObj) headersObj = parseHeaders(headers); + + if (name) { + return headersObj[lowercase(name)] || null; + } + + return headersObj; + }; +} + + +/** + * Chain all given functions + * + * This function is used for both request and response transforming + * + * @param {*} data Data to transform. + * @param {function(string=)} headers Http headers getter fn. + * @param {(function|Array.)} fns Function or an array of functions. + * @returns {*} Transformed data. + */ +function transformData(data, headers, fns) { + if (isFunction(fns)) + return fns(data, headers); + + forEach(fns, function(fn) { + data = fn(data, headers); + }); + + return data; +} + + +function isSuccess(status) { + return 200 <= status && status < 300; +} + + +function $HttpProvider() { + var JSON_START = /^\s*(\[|\{[^\{])/, + JSON_END = /[\}\]]\s*$/, + PROTECTION_PREFIX = /^\)\]\}',?\n/, + CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': 'application/json;charset=utf-8'}; + + var defaults = this.defaults = { + // transform incoming response data + transformResponse: [function(data) { + if (isString(data)) { + // strip json vulnerability protection prefix + data = data.replace(PROTECTION_PREFIX, ''); + if (JSON_START.test(data) && JSON_END.test(data)) + data = fromJson(data, true); + } + return data; + }], + + // transform outgoing request data + transformRequest: [function(d) { + return isObject(d) && !isFile(d) ? toJson(d) : d; + }], + + // default headers + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + }, + post: CONTENT_TYPE_APPLICATION_JSON, + put: CONTENT_TYPE_APPLICATION_JSON, + patch: CONTENT_TYPE_APPLICATION_JSON + }, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN' + }; + + /** + * Are order by request. I.E. they are applied in the same order as + * array on request, but revers order on response. + */ + var interceptorFactories = this.interceptors = []; + /** + * For historical reasons, response interceptors ordered by the order in which + * they are applied to response. (This is in revers to interceptorFactories) + */ + var responseInterceptorFactories = this.responseInterceptors = []; + + this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector', + function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) { + + var defaultCache = $cacheFactory('$http'); + + /** + * Interceptors stored in reverse order. Inner interceptors before outer interceptors. + * The reversal is needed so that we can build up the interception chain around the + * server request. + */ + var reversedInterceptors = []; + + forEach(interceptorFactories, function(interceptorFactory) { + reversedInterceptors.unshift(isString(interceptorFactory) + ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); + }); + + forEach(responseInterceptorFactories, function(interceptorFactory, index) { + var responseFn = isString(interceptorFactory) + ? $injector.get(interceptorFactory) + : $injector.invoke(interceptorFactory); + + /** + * Response interceptors go before "around" interceptors (no real reason, just + * had to pick one.) But they are already revesed, so we can't use unshift, hence + * the splice. + */ + reversedInterceptors.splice(index, 0, { + response: function(response) { + return responseFn($q.when(response)); + }, + responseError: function(response) { + return responseFn($q.reject(response)); + } + }); + }); + + + /** + * @ngdoc function + * @name ng.$http + * @requires $httpBackend + * @requires $browser + * @requires $cacheFactory + * @requires $rootScope + * @requires $q + * @requires $injector + * + * @description + * The `$http` service is a core Angular service that facilitates communication with the remote + * HTTP servers via the browser's {@link https://developer.mozilla.org/en/xmlhttprequest + * XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}. + * + * For unit testing applications that use `$http` service, see + * {@link ngMock.$httpBackend $httpBackend mock}. + * + * For a higher level of abstraction, please check out the {@link ngResource.$resource + * $resource} service. + * + * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by + * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage + * it is important to familiarize yourself with these APIs and the guarantees they provide. + * + * + * # General usage + * The `$http` service is a function which takes a single argument — a configuration object — + * that is used to generate an HTTP request and returns a {@link ng.$q promise} + * with two $http specific methods: `success` and `error`. + * + *
    +     *   $http({method: 'GET', url: '/someUrl'}).
    +     *     success(function(data, status, headers, config) {
    +     *       // this callback will be called asynchronously
    +     *       // when the response is available
    +     *     }).
    +     *     error(function(data, status, headers, config) {
    +     *       // called asynchronously if an error occurs
    +     *       // or server returns response with an error status.
    +     *     });
    +     * 
    + * + * Since the returned value of calling the $http function is a `promise`, you can also use + * the `then` method to register callbacks, and these callbacks will receive a single argument – + * an object representing the response. See the API signature and type info below for more + * details. + * + * A response status code between 200 and 299 is considered a success status and + * will result in the success callback being called. Note that if the response is a redirect, + * XMLHttpRequest will transparently follow it, meaning that the error callback will not be + * called for such responses. + * + * # Shortcut methods + * + * Since all invocations of the $http service require passing in an HTTP method and URL, and + * POST/PUT requests require request data to be provided as well, shortcut methods + * were created: + * + *
    +     *   $http.get('/someUrl').success(successCallback);
    +     *   $http.post('/someUrl', data).success(successCallback);
    +     * 
    + * + * Complete list of shortcut methods: + * + * - {@link ng.$http#get $http.get} + * - {@link ng.$http#head $http.head} + * - {@link ng.$http#post $http.post} + * - {@link ng.$http#put $http.put} + * - {@link ng.$http#delete $http.delete} + * - {@link ng.$http#jsonp $http.jsonp} + * + * + * # Setting HTTP Headers + * + * The $http service will automatically add certain HTTP headers to all requests. These defaults + * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration + * object, which currently contains this default configuration: + * + * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): + * - `Accept: application/json, text/plain, * / *` + * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) + * - `Content-Type: application/json` + * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) + * - `Content-Type: application/json` + * + * To add or overwrite these defaults, simply add or remove a property from these configuration + * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object + * with the lowercased HTTP method name as the key, e.g. + * `$httpProvider.defaults.headers.get['My-Header']='value'`. + * + * Additionally, the defaults can be set at runtime via the `$http.defaults` object in the same + * fashion. + * + * + * # Transforming Requests and Responses + * + * Both requests and responses can be transformed using transform functions. By default, Angular + * applies these transformations: + * + * Request transformations: + * + * - If the `data` property of the request configuration object contains an object, serialize it into + * JSON format. + * + * Response transformations: + * + * - If XSRF prefix is detected, strip it (see Security Considerations section below). + * - If JSON response is detected, deserialize it using a JSON parser. + * + * To globally augment or override the default transforms, modify the `$httpProvider.defaults.transformRequest` and + * `$httpProvider.defaults.transformResponse` properties. These properties are by default an + * array of transform functions, which allows you to `push` or `unshift` a new transformation function into the + * transformation chain. You can also decide to completely override any default transformations by assigning your + * transformation functions to these properties directly without the array wrapper. + * + * Similarly, to locally override the request/response transforms, augment the `transformRequest` and/or + * `transformResponse` properties of the configuration object passed into `$http`. + * + * + * # Caching + * + * To enable caching, set the configuration property `cache` to `true`. When the cache is + * enabled, `$http` stores the response from the server in local cache. Next time the + * response is served from the cache without sending a request to the server. + * + * Note that even if the response is served from cache, delivery of the data is asynchronous in + * the same way that real requests are. + * + * If there are multiple GET requests for the same URL that should be cached using the same + * cache, but the cache is not populated yet, only one request to the server will be made and + * the remaining requests will be fulfilled using the response from the first request. + * + * A custom default cache built with $cacheFactory can be provided in $http.defaults.cache. + * To skip it, set configuration property `cache` to `false`. + * + * + * # Interceptors + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication, or any kind of synchronous or + * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be + * able to intercept requests before they are handed to the server and + * responses before they are handed over to the application code that + * initiated these requests. The interceptors leverage the {@link ng.$q + * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. + * + * The interceptors are service factories that are registered with the `$httpProvider` by + * adding them to the `$httpProvider.interceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor. + * + * There are two kinds of interceptors (and two kinds of rejection interceptors): + * + * * `request`: interceptors get called with http `config` object. The function is free to modify + * the `config` or create a new one. The function needs to return the `config` directly or as a + * promise. + * * `requestError`: interceptor gets called when a previous interceptor threw an error or resolved + * with a rejection. + * * `response`: interceptors get called with http `response` object. The function is free to modify + * the `response` or create a new one. The function needs to return the `response` directly or as a + * promise. + * * `responseError`: interceptor gets called when a previous interceptor threw an error or resolved + * with a rejection. + * + * + *
    +     *   // register the interceptor as a service
    +     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
    +     *     return {
    +     *       // optional method
    +     *       'request': function(config) {
    +     *         // do something on success
    +     *         return config || $q.when(config);
    +     *       },
    +     *
    +     *       // optional method
    +     *      'requestError': function(rejection) {
    +     *         // do something on error
    +     *         if (canRecover(rejection)) {
    +     *           return responseOrNewPromise
    +     *         }
    +     *         return $q.reject(rejection);
    +     *       },
    +     *
    +     *
    +     *
    +     *       // optional method
    +     *       'response': function(response) {
    +     *         // do something on success
    +     *         return response || $q.when(response);
    +     *       },
    +     *
    +     *       // optional method
    +     *      'responseError': function(rejection) {
    +     *         // do something on error
    +     *         if (canRecover(rejection)) {
    +     *           return responseOrNewPromise
    +     *         }
    +     *         return $q.reject(rejection);
    +     *       };
    +     *     }
    +     *   });
    +     *
    +     *   $httpProvider.interceptors.push('myHttpInterceptor');
    +     *
    +     *
    +     *   // register the interceptor via an anonymous factory
    +     *   $httpProvider.interceptors.push(function($q, dependency1, dependency2) {
    +     *     return {
    +     *      'request': function(config) {
    +     *          // same as above
    +     *       },
    +     *       'response': function(response) {
    +     *          // same as above
    +     *       }
    +     *   });
    +     * 
    + * + * # Response interceptors (DEPRECATED) + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication or any kind of synchronous or + * asynchronous preprocessing of received responses, it is desirable to be able to intercept + * responses for http requests before they are handed over to the application code that + * initiated these requests. The response interceptors leverage the {@link ng.$q + * promise apis} to fulfil this need for both synchronous and asynchronous preprocessing. + * + * The interceptors are service factories that are registered with the $httpProvider by + * adding them to the `$httpProvider.responseInterceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor — a function that + * takes a {@link ng.$q promise} and returns the original or a new promise. + * + *
    +     *   // register the interceptor as a service
    +     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
    +     *     return function(promise) {
    +     *       return promise.then(function(response) {
    +     *         // do something on success
    +     *       }, function(response) {
    +     *         // do something on error
    +     *         if (canRecover(response)) {
    +     *           return responseOrNewPromise
    +     *         }
    +     *         return $q.reject(response);
    +     *       });
    +     *     }
    +     *   });
    +     *
    +     *   $httpProvider.responseInterceptors.push('myHttpInterceptor');
    +     *
    +     *
    +     *   // register the interceptor via an anonymous factory
    +     *   $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {
    +     *     return function(promise) {
    +     *       // same as above
    +     *     }
    +     *   });
    +     * 
    + * + * + * # Security Considerations + * + * When designing web applications, consider security threats from: + * + * - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx + * JSON vulnerability} + * - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} + * + * Both server and the client must cooperate in order to eliminate these threats. Angular comes + * pre-configured with strategies that address these issues, but for this to work backend server + * cooperation is required. + * + * ## JSON Vulnerability Protection + * + * A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx + * JSON vulnerability} allows third party website to turn your JSON resource URL into + * {@link http://en.wikipedia.org/wiki/JSONP JSONP} request under some conditions. To + * counter this your server can prefix all JSON requests with following string `")]}',\n"`. + * Angular will automatically strip the prefix before processing it as JSON. + * + * For example if your server needs to return: + *
    +     * ['one','two']
    +     * 
    + * + * which is vulnerable to attack, your server can return: + *
    +     * )]}',
    +     * ['one','two']
    +     * 
    + * + * Angular will strip the prefix, before processing the JSON. + * + * + * ## Cross Site Request Forgery (XSRF) Protection + * + * {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which + * an unauthorized site can gain your user's private data. Angular provides a mechanism + * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie + * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only + * JavaScript that runs on your domain could read the cookie, your server can be assured that + * the XHR came from JavaScript running on your domain. The header will not be set for + * cross-domain requests. + * + * To take advantage of this, your server needs to set a token in a JavaScript readable session + * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the + * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure + * that only JavaScript running on your domain could have sent the request. The token must be + * unique for each user and must be verifiable by the server (to prevent the JavaScript from making + * up its own tokens). We recommend that the token is a digest of your site's authentication + * cookie with a {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt} for added security. + * + * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName + * properties of either $httpProvider.defaults, or the per-request config object. + * + * + * @param {object} config Object describing the request to be made and how it should be + * processed. The object has following properties: + * + * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) + * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. + * - **params** – `{Object.}` – Map of strings or objects which will be turned to + * `?key1=value1&key2=value2` after the url. If the value is not a string, it will be JSONified. + * - **data** – `{string|Object}` – Data to be sent as the request message data. + * - **headers** – `{Object}` – Map of strings representing HTTP headers to send to the server. + * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. + * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. + * - **transformRequest** – `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * request body and headers and returns its transformed (typically serialized) version. + * - **transformResponse** – `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * response body and headers and returns its transformed (typically deserialized) version. + * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the + * GET request, otherwise if a cache instance built with + * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for + * caching. + * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} + * that should abort the request when resolved. + * - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the + * XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5 + * requests with credentials} for more information. + * - **responseType** - `{string}` - see {@link + * https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}. + * + * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the + * standard `then` method and two http specific methods: `success` and `error`. The `then` + * method takes two arguments a success and an error callback which will be called with a + * response object. The `success` and `error` methods take a single argument - a function that + * will be called when the request succeeds or fails respectively. The arguments passed into + * these functions are destructured representation of the response object passed into the + * `then` method. The response object has these properties: + * + * - **data** – `{string|Object}` – The response body transformed with the transform functions. + * - **status** – `{number}` – HTTP status code of the response. + * - **headers** – `{function([headerName])}` – Header getter function. + * - **config** – `{Object}` – The configuration object that was used to generate the request. + * + * @property {Array.} pendingRequests Array of config objects for currently pending + * requests. This is primarily meant to be used for debugging purposes. + * + * + * @example + + +
    + + +
    + + + +
    http status code: {{status}}
    +
    http response data: {{data}}
    +
    +
    + + function FetchCtrl($scope, $http, $templateCache) { + $scope.method = 'GET'; + $scope.url = 'http-hello.html'; + + $scope.fetch = function() { + $scope.code = null; + $scope.response = null; + + $http({method: $scope.method, url: $scope.url, cache: $templateCache}). + success(function(data, status) { + $scope.status = status; + $scope.data = data; + }). + error(function(data, status) { + $scope.data = data || "Request failed"; + $scope.status = status; + }); + }; + + $scope.updateModel = function(method, url) { + $scope.method = method; + $scope.url = url; + }; + } + + + Hello, $http! + + + it('should make an xhr GET request', function() { + element(':button:contains("Sample GET")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('200'); + expect(binding('data')).toMatch(/Hello, \$http!/); + }); + + it('should make a JSONP request to angularjs.org', function() { + element(':button:contains("Sample JSONP")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('200'); + expect(binding('data')).toMatch(/Super Hero!/); + }); + + it('should make JSONP request to invalid URL and invoke the error handler', + function() { + element(':button:contains("Invalid JSONP")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('0'); + expect(binding('data')).toBe('Request failed'); + }); + +
    + */ + function $http(requestConfig) { + var config = { + transformRequest: defaults.transformRequest, + transformResponse: defaults.transformResponse + }; + var headers = {}; + + extend(config, requestConfig); + config.headers = headers; + config.method = uppercase(config.method); + + extend(headers, + defaults.headers.common, + defaults.headers[lowercase(config.method)], + requestConfig.headers); + + var xsrfValue = isSameDomain(config.url, $browser.url()) + ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName] + : undefined; + if (xsrfValue) { + headers[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; + } + + + var serverRequest = function(config) { + var reqData = transformData(config.data, headersGetter(headers), config.transformRequest); + + // strip content-type if data is undefined + if (isUndefined(config.data)) { + delete headers['Content-Type']; + } + + if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { + config.withCredentials = defaults.withCredentials; + } + + // send request + return sendReq(config, reqData, headers).then(transformResponse, transformResponse); + }; + + var chain = [serverRequest, undefined]; + var promise = $q.when(config); + + // apply interceptors + forEach(reversedInterceptors, function(interceptor) { + if (interceptor.request || interceptor.requestError) { + chain.unshift(interceptor.request, interceptor.requestError); + } + if (interceptor.response || interceptor.responseError) { + chain.push(interceptor.response, interceptor.responseError); + } + }); + + while(chain.length) { + var thenFn = chain.shift(); + var rejectFn = chain.shift(); + + promise = promise.then(thenFn, rejectFn); + } + + promise.success = function(fn) { + promise.then(function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + promise.error = function(fn) { + promise.then(null, function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + return promise; + + function transformResponse(response) { + // make a copy since the response must be cacheable + var resp = extend({}, response, { + data: transformData(response.data, response.headers, config.transformResponse) + }); + return (isSuccess(response.status)) + ? resp + : $q.reject(resp); + } + } + + $http.pendingRequests = []; + + /** + * @ngdoc method + * @name ng.$http#get + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `GET` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name ng.$http#delete + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `DELETE` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name ng.$http#head + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `HEAD` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name ng.$http#jsonp + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `JSONP` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request. + * Should contain `JSON_CALLBACK` string. + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethods('get', 'delete', 'head', 'jsonp'); + + /** + * @ngdoc method + * @name ng.$http#post + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `POST` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name ng.$http#put + * @methodOf ng.$http + * + * @description + * Shortcut method to perform `PUT` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethodsWithData('post', 'put'); + + /** + * @ngdoc property + * @name ng.$http#defaults + * @propertyOf ng.$http + * + * @description + * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of + * default headers, withCredentials as well as request and response transformations. + * + * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. + */ + $http.defaults = defaults; + + + return $http; + + + function createShortMethods(names) { + forEach(arguments, function(name) { + $http[name] = function(url, config) { + return $http(extend(config || {}, { + method: name, + url: url + })); + }; + }); + } + + + function createShortMethodsWithData(name) { + forEach(arguments, function(name) { + $http[name] = function(url, data, config) { + return $http(extend(config || {}, { + method: name, + url: url, + data: data + })); + }; + }); + } + + + /** + * Makes the request. + * + * !!! ACCESSES CLOSURE VARS: + * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests + */ + function sendReq(config, reqData, reqHeaders) { + var deferred = $q.defer(), + promise = deferred.promise, + cache, + cachedResp, + url = buildUrl(config.url, config.params); + + $http.pendingRequests.push(config); + promise.then(removePendingReq, removePendingReq); + + + if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') { + cache = isObject(config.cache) ? config.cache + : isObject(defaults.cache) ? defaults.cache + : defaultCache; + } + + if (cache) { + cachedResp = cache.get(url); + if (cachedResp) { + if (cachedResp.then) { + // cached request has already been sent, but there is no response yet + cachedResp.then(removePendingReq, removePendingReq); + return cachedResp; + } else { + // serving from cache + if (isArray(cachedResp)) { + resolvePromise(cachedResp[1], cachedResp[0], copy(cachedResp[2])); + } else { + resolvePromise(cachedResp, 200, {}); + } + } + } else { + // put the promise for the non-transformed response into cache as a placeholder + cache.put(url, promise); + } + } + + // if we won't have the response in cache, send the request to the backend + if (!cachedResp) { + $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, + config.withCredentials, config.responseType); + } + + return promise; + + + /** + * Callback registered to $httpBackend(): + * - caches the response if desired + * - resolves the raw $http promise + * - calls $apply + */ + function done(status, response, headersString) { + if (cache) { + if (isSuccess(status)) { + cache.put(url, [status, response, parseHeaders(headersString)]); + } else { + // remove promise from the cache + cache.remove(url); + } + } + + resolvePromise(response, status, headersString); + if (!$rootScope.$$phase) $rootScope.$apply(); + } + + + /** + * Resolves the raw $http promise. + */ + function resolvePromise(response, status, headers) { + // normalize internal statuses to 0 + status = Math.max(status, 0); + + (isSuccess(status) ? deferred.resolve : deferred.reject)({ + data: response, + status: status, + headers: headersGetter(headers), + config: config + }); + } + + + function removePendingReq() { + var idx = indexOf($http.pendingRequests, config); + if (idx !== -1) $http.pendingRequests.splice(idx, 1); + } + } + + + function buildUrl(url, params) { + if (!params) return url; + var parts = []; + forEachSorted(params, function(value, key) { + if (value == null || value == undefined) return; + if (!isArray(value)) value = [value]; + + forEach(value, function(v) { + if (isObject(v)) { + v = toJson(v); + } + parts.push(encodeUriQuery(key) + '=' + + encodeUriQuery(v)); + }); + }); + return url + ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&'); + } + + + }]; +} + +var XHR = window.XMLHttpRequest || function() { + try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {} + try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {} + try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {} + throw new Error("This browser does not support XMLHttpRequest."); +}; + + +/** + * @ngdoc object + * @name ng.$httpBackend + * @requires $browser + * @requires $window + * @requires $document + * + * @description + * HTTP backend used by the {@link ng.$http service} that delegates to + * XMLHttpRequest object or JSONP and deals with browser incompatibilities. + * + * You should never need to use this service directly, instead use the higher-level abstractions: + * {@link ng.$http $http} or {@link ngResource.$resource $resource}. + * + * During testing this implementation is swapped with {@link ngMock.$httpBackend mock + * $httpBackend} which can be trained with responses. + */ +function $HttpBackendProvider() { + this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) { + return createHttpBackend($browser, XHR, $browser.defer, $window.angular.callbacks, + $document[0], $window.location.protocol.replace(':', '')); + }]; +} + +function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol) { + // TODO(vojta): fix the signature + return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { + var status; + $browser.$$incOutstandingRequestCount(); + url = url || $browser.url(); + + if (lowercase(method) == 'jsonp') { + var callbackId = '_' + (callbacks.counter++).toString(36); + callbacks[callbackId] = function(data) { + callbacks[callbackId].data = data; + }; + + var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId), + function() { + if (callbacks[callbackId].data) { + completeRequest(callback, 200, callbacks[callbackId].data); + } else { + completeRequest(callback, status || -2); + } + delete callbacks[callbackId]; + }); + } else { + var xhr = new XHR(); + xhr.open(method, url, true); + forEach(headers, function(value, key) { + if (value) xhr.setRequestHeader(key, value); + }); + + // In IE6 and 7, this might be called synchronously when xhr.send below is called and the + // response is in the cache. the promise api will ensure that to the app code the api is + // always async + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + var responseHeaders = xhr.getAllResponseHeaders(); + + // TODO(vojta): remove once Firefox 21 gets released. + // begin: workaround to overcome Firefox CORS http response headers bug + // https://bugzilla.mozilla.org/show_bug.cgi?id=608735 + // Firefox already patched in nightly. Should land in Firefox 21. + + // CORS "simple response headers" http://www.w3.org/TR/cors/ + var value, + simpleHeaders = ["Cache-Control", "Content-Language", "Content-Type", + "Expires", "Last-Modified", "Pragma"]; + if (!responseHeaders) { + responseHeaders = ""; + forEach(simpleHeaders, function (header) { + var value = xhr.getResponseHeader(header); + if (value) { + responseHeaders += header + ": " + value + "\n"; + } + }); + } + // end of the workaround. + + // responseText is the old-school way of retrieving response (supported by IE8 & 9) + // response and responseType properties were introduced in XHR Level2 spec (supported by IE10) + completeRequest(callback, + status || xhr.status, + (xhr.responseType ? xhr.response : xhr.responseText), + responseHeaders); + } + }; + + if (withCredentials) { + xhr.withCredentials = true; + } + + if (responseType) { + xhr.responseType = responseType; + } + + xhr.send(post || ''); + } + + if (timeout > 0) { + var timeoutId = $browserDefer(timeoutRequest, timeout); + } else if (timeout && timeout.then) { + timeout.then(timeoutRequest); + } + + + function timeoutRequest() { + status = -1; + jsonpDone && jsonpDone(); + xhr && xhr.abort(); + } + + function completeRequest(callback, status, response, headersString) { + // URL_MATCH is defined in src/service/location.js + var protocol = (url.match(SERVER_MATCH) || ['', locationProtocol])[1]; + + // cancel timeout and subsequent timeout promise resolution + timeoutId && $browserDefer.cancel(timeoutId); + jsonpDone = xhr = null; + + // fix status code for file protocol (it's always 0) + status = (protocol == 'file') ? (response ? 200 : 404) : status; + + // normalize IE bug (http://bugs.jquery.com/ticket/1450) + status = status == 1223 ? 204 : status; + + callback(status, response, headersString); + $browser.$$completeOutstandingRequest(noop); + } + }; + + function jsonpReq(url, done) { + // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.: + // - fetches local scripts via XHR and evals them + // - adds and immediately removes script elements from the document + var script = rawDocument.createElement('script'), + doneWrapper = function() { + rawDocument.body.removeChild(script); + if (done) done(); + }; + + script.type = 'text/javascript'; + script.src = url; + + if (msie) { + script.onreadystatechange = function() { + if (/loaded|complete/.test(script.readyState)) doneWrapper(); + }; + } else { + script.onload = script.onerror = doneWrapper; + } + + rawDocument.body.appendChild(script); + return doneWrapper; + } +} + +/** + * @ngdoc object + * @name ng.$locale + * + * @description + * $locale service provides localization rules for various Angular components. As of right now the + * only public api is: + * + * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) + */ +function $LocaleProvider(){ + this.$get = function() { + return { + id: 'en-us', + + NUMBER_FORMATS: { + DECIMAL_SEP: '.', + GROUP_SEP: ',', + PATTERNS: [ + { // Decimal Pattern + minInt: 1, + minFrac: 0, + maxFrac: 3, + posPre: '', + posSuf: '', + negPre: '-', + negSuf: '', + gSize: 3, + lgSize: 3 + },{ //Currency Pattern + minInt: 1, + minFrac: 2, + maxFrac: 2, + posPre: '\u00A4', + posSuf: '', + negPre: '(\u00A4', + negSuf: ')', + gSize: 3, + lgSize: 3 + } + ], + CURRENCY_SYM: '$' + }, + + DATETIME_FORMATS: { + MONTH: 'January,February,March,April,May,June,July,August,September,October,November,December' + .split(','), + SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), + DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), + SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), + AMPMS: ['AM','PM'], + medium: 'MMM d, y h:mm:ss a', + short: 'M/d/yy h:mm a', + fullDate: 'EEEE, MMMM d, y', + longDate: 'MMMM d, y', + mediumDate: 'MMM d, y', + shortDate: 'M/d/yy', + mediumTime: 'h:mm:ss a', + shortTime: 'h:mm a' + }, + + pluralCat: function(num) { + if (num === 1) { + return 'one'; + } + return 'other'; + } + }; + }; +} + +function $TimeoutProvider() { + this.$get = ['$rootScope', '$browser', '$q', '$exceptionHandler', + function($rootScope, $browser, $q, $exceptionHandler) { + var deferreds = {}; + + + /** + * @ngdoc function + * @name ng.$timeout + * @requires $browser + * + * @description + * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch + * block and delegates any exceptions to + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * The return value of registering a timeout function is a promise, which will be resolved when + * the timeout is reached and the timeout function is executed. + * + * To cancel a timeout request, call `$timeout.cancel(promise)`. + * + * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to + * synchronously flush the queue of deferred functions. + * + * @param {function()} fn A function, whose execution should be delayed. + * @param {number=} [delay=0] Delay in milliseconds. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this + * promise will be resolved with is the return value of the `fn` function. + */ + function timeout(fn, delay, invokeApply) { + var deferred = $q.defer(), + promise = deferred.promise, + skipApply = (isDefined(invokeApply) && !invokeApply), + timeoutId, cleanup; + + timeoutId = $browser.defer(function() { + try { + deferred.resolve(fn()); + } catch(e) { + deferred.reject(e); + $exceptionHandler(e); + } + + if (!skipApply) $rootScope.$apply(); + }, delay); + + cleanup = function() { + delete deferreds[promise.$$timeoutId]; + }; + + promise.$$timeoutId = timeoutId; + deferreds[timeoutId] = deferred; + promise.then(cleanup, cleanup); + + return promise; + } + + + /** + * @ngdoc function + * @name ng.$timeout#cancel + * @methodOf ng.$timeout + * + * @description + * Cancels a task associated with the `promise`. As a result of this, the promise will be + * resolved with a rejection. + * + * @param {Promise=} promise Promise returned by the `$timeout` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + timeout.cancel = function(promise) { + if (promise && promise.$$timeoutId in deferreds) { + deferreds[promise.$$timeoutId].reject('canceled'); + return $browser.defer.cancel(promise.$$timeoutId); + } + return false; + }; + + return timeout; + }]; +} + +/** + * @ngdoc object + * @name ng.$filterProvider + * @description + * + * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To + * achieve this a filter definition consists of a factory function which is annotated with dependencies and is + * responsible for creating a filter function. + * + *
    + *   // Filter registration
    + *   function MyModule($provide, $filterProvider) {
    + *     // create a service to demonstrate injection (not always needed)
    + *     $provide.value('greet', function(name){
    + *       return 'Hello ' + name + '!';
    + *     });
    + *
    + *     // register a filter factory which uses the
    + *     // greet service to demonstrate DI.
    + *     $filterProvider.register('greet', function(greet){
    + *       // return the filter function which uses the greet service
    + *       // to generate salutation
    + *       return function(text) {
    + *         // filters need to be forgiving so check input validity
    + *         return text && greet(text) || text;
    + *       };
    + *     });
    + *   }
    + * 
    + * + * The filter function is registered with the `$injector` under the filter name suffixe with `Filter`. + *
    + *   it('should be the same instance', inject(
    + *     function($filterProvider) {
    + *       $filterProvider.register('reverse', function(){
    + *         return ...;
    + *       });
    + *     },
    + *     function($filter, reverseFilter) {
    + *       expect($filter('reverse')).toBe(reverseFilter);
    + *     });
    + * 
    + * + * + * For more information about how angular filters work, and how to create your own filters, see + * {@link guide/dev_guide.templates.filters Understanding Angular Filters} in the angular Developer + * Guide. + */ +/** + * @ngdoc method + * @name ng.$filterProvider#register + * @methodOf ng.$filterProvider + * @description + * Register filter factory function. + * + * @param {String} name Name of the filter. + * @param {function} fn The filter factory function which is injectable. + */ + + +/** + * @ngdoc function + * @name ng.$filter + * @function + * @description + * Filters are used for formatting data displayed to the user. + * + * The general syntax in templates is as follows: + * + * {{ expression [| filter_name[:parameter_value] ... ] }} + * + * @param {String} name Name of the filter function to retrieve + * @return {Function} the filter function + */ +$FilterProvider.$inject = ['$provide']; +function $FilterProvider($provide) { + var suffix = 'Filter'; + + function register(name, factory) { + return $provide.factory(name + suffix, factory); + } + this.register = register; + + this.$get = ['$injector', function($injector) { + return function(name) { + return $injector.get(name + suffix); + } + }]; + + //////////////////////////////////////// + + register('currency', currencyFilter); + register('date', dateFilter); + register('filter', filterFilter); + register('json', jsonFilter); + register('limitTo', limitToFilter); + register('lowercase', lowercaseFilter); + register('number', numberFilter); + register('orderBy', orderByFilter); + register('uppercase', uppercaseFilter); +} + +/** + * @ngdoc filter + * @name ng.filter:filter + * @function + * + * @description + * Selects a subset of items from `array` and returns it as a new array. + * + * Note: This function is used to augment the `Array` type in Angular expressions. See + * {@link ng.$filter} for more information about Angular arrays. + * + * @param {Array} array The source array. + * @param {string|Object|function()} expression The predicate to be used for selecting items from + * `array`. + * + * Can be one of: + * + * - `string`: Predicate that results in a substring match using the value of `expression` + * string. All strings or objects with string properties in `array` that contain this string + * will be returned. The predicate can be negated by prefixing the string with `!`. + * + * - `Object`: A pattern object can be used to filter specific properties on objects contained + * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items + * which have property `name` containing "M" and property `phone` containing "1". A special + * property name `$` can be used (as in `{$:"text"}`) to accept a match against any + * property of the object. That's equivalent to the simple substring match with a `string` + * as described above. + * + * - `function`: A predicate function can be used to write arbitrary filters. The function is + * called for each element of `array`. The final result is an array of those elements that + * the predicate returned true for. + * + * @param {function(expected, actual)|true|undefined} comparator Comparator which is used in + * determining if the expected value (from the filter expression) and actual value (from + * the object in the array) should be considered a match. + * + * Can be one of: + * + * - `function(expected, actual)`: + * The function will be given the object value and the predicate value to compare and + * should return true if the item should be included in filtered result. + * + * - `true`: A shorthand for `function(expected, actual) { return angular.equals(expected, actual)}`. + * this is essentially strict comparison of expected and actual. + * + * - `false|undefined`: A short hand for a function which will look for a substring match in case + * insensitive way. + * + * @example + + +
    + + Search: +
    + + + + + +
    NamePhone
    {{friend.name}}{{friend.phone}}
    +
    + Any:
    + Name only
    + Phone only
    + Equality
    + + + + + + +
    NamePhone
    {{friend.name}}{{friend.phone}}
    + + + it('should search across all fields when filtering with a string', function() { + input('searchText').enter('m'); + expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')). + toEqual(['Mary', 'Mike', 'Adam']); + + input('searchText').enter('76'); + expect(repeater('#searchTextResults tr', 'friend in friends').column('friend.name')). + toEqual(['John', 'Julie']); + }); + + it('should search in specific fields when filtering with a predicate object', function() { + input('search.$').enter('i'); + expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')). + toEqual(['Mary', 'Mike', 'Julie', 'Juliette']); + }); + it('should use a equal comparison when comparator is true', function() { + input('search.name').enter('Julie'); + input('strict').check(); + expect(repeater('#searchObjResults tr', 'friend in friends').column('friend.name')). + toEqual(['Julie']); + }); + + + */ +function filterFilter() { + return function(array, expression, comperator) { + if (!isArray(array)) return array; + var predicates = []; + predicates.check = function(value) { + for (var j = 0; j < predicates.length; j++) { + if(!predicates[j](value)) { + return false; + } + } + return true; + }; + switch(typeof comperator) { + case "function": + break; + case "boolean": + if(comperator == true) { + comperator = function(obj, text) { + return angular.equals(obj, text); + } + break; + } + default: + comperator = function(obj, text) { + text = (''+text).toLowerCase(); + return (''+obj).toLowerCase().indexOf(text) > -1 + }; + } + var search = function(obj, text){ + if (typeof text == 'string' && text.charAt(0) === '!') { + return !search(obj, text.substr(1)); + } + switch (typeof obj) { + case "boolean": + case "number": + case "string": + return comperator(obj, text); + case "object": + switch (typeof text) { + case "object": + return comperator(obj, text); + break; + default: + for ( var objKey in obj) { + if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) { + return true; + } + } + break; + } + return false; + case "array": + for ( var i = 0; i < obj.length; i++) { + if (search(obj[i], text)) { + return true; + } + } + return false; + default: + return false; + } + }; + switch (typeof expression) { + case "boolean": + case "number": + case "string": + expression = {$:expression}; + case "object": + for (var key in expression) { + if (key == '$') { + (function() { + if (!expression[key]) return; + var path = key + predicates.push(function(value) { + return search(value, expression[path]); + }); + })(); + } else { + (function() { + if (!expression[key]) return; + var path = key; + predicates.push(function(value) { + return search(getter(value,path), expression[path]); + }); + })(); + } + } + break; + case 'function': + predicates.push(expression); + break; + default: + return array; + } + var filtered = []; + for ( var j = 0; j < array.length; j++) { + var value = array[j]; + if (predicates.check(value)) { + filtered.push(value); + } + } + return filtered; + } +} + +/** + * @ngdoc filter + * @name ng.filter:currency + * @function + * + * @description + * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default + * symbol for current locale is used. + * + * @param {number} amount Input to filter. + * @param {string=} symbol Currency symbol or identifier to be displayed. + * @returns {string} Formatted number. + * + * + * @example + + + +
    +
    + default currency symbol ($): {{amount | currency}}
    + custom currency identifier (USD$): {{amount | currency:"USD$"}} +
    +
    + + it('should init with 1234.56', function() { + expect(binding('amount | currency')).toBe('$1,234.56'); + expect(binding('amount | currency:"USD$"')).toBe('USD$1,234.56'); + }); + it('should update', function() { + input('amount').enter('-1234'); + expect(binding('amount | currency')).toBe('($1,234.00)'); + expect(binding('amount | currency:"USD$"')).toBe('(USD$1,234.00)'); + }); + +
    + */ +currencyFilter.$inject = ['$locale']; +function currencyFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(amount, currencySymbol){ + if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM; + return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2). + replace(/\u00A4/g, currencySymbol); + }; +} + +/** + * @ngdoc filter + * @name ng.filter:number + * @function + * + * @description + * Formats a number as text. + * + * If the input is not a number an empty string is returned. + * + * @param {number|string} number Number to format. + * @param {(number|string)=} [fractionSize=2] Number of decimal places to round the number to. + * @returns {string} Number rounded to decimalPlaces and places a “,†after each third digit. + * + * @example + + + +
    + Enter number:
    + Default formatting: {{val | number}}
    + No fractions: {{val | number:0}}
    + Negative number: {{-val | number:4}} +
    +
    + + it('should format numbers', function() { + expect(binding('val | number')).toBe('1,234.568'); + expect(binding('val | number:0')).toBe('1,235'); + expect(binding('-val | number:4')).toBe('-1,234.5679'); + }); + + it('should update', function() { + input('val').enter('3374.333'); + expect(binding('val | number')).toBe('3,374.333'); + expect(binding('val | number:0')).toBe('3,374'); + expect(binding('-val | number:4')).toBe('-3,374.3330'); + }); + +
    + */ + + +numberFilter.$inject = ['$locale']; +function numberFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(number, fractionSize) { + return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, + fractionSize); + }; +} + +var DECIMAL_SEP = '.'; +function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { + if (isNaN(number) || !isFinite(number)) return ''; + + var isNegative = number < 0; + number = Math.abs(number); + var numStr = number + '', + formatedText = '', + parts = []; + + var hasExponent = false; + if (numStr.indexOf('e') !== -1) { + var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); + if (match && match[2] == '-' && match[3] > fractionSize + 1) { + numStr = '0'; + } else { + formatedText = numStr; + hasExponent = true; + } + } + + if (!hasExponent) { + var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; + + // determine fractionSize if it is not specified + if (isUndefined(fractionSize)) { + fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac); + } + + var pow = Math.pow(10, fractionSize); + number = Math.round(number * pow) / pow; + var fraction = ('' + number).split(DECIMAL_SEP); + var whole = fraction[0]; + fraction = fraction[1] || ''; + + var pos = 0, + lgroup = pattern.lgSize, + group = pattern.gSize; + + if (whole.length >= (lgroup + group)) { + pos = whole.length - lgroup; + for (var i = 0; i < pos; i++) { + if ((pos - i)%group === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + } + + for (i = pos; i < whole.length; i++) { + if ((whole.length - i)%lgroup === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + + // format fraction part. + while(fraction.length < fractionSize) { + fraction += '0'; + } + + if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize); + } + + parts.push(isNegative ? pattern.negPre : pattern.posPre); + parts.push(formatedText); + parts.push(isNegative ? pattern.negSuf : pattern.posSuf); + return parts.join(''); +} + +function padNumber(num, digits, trim) { + var neg = ''; + if (num < 0) { + neg = '-'; + num = -num; + } + num = '' + num; + while(num.length < digits) num = '0' + num; + if (trim) + num = num.substr(num.length - digits); + return neg + num; +} + + +function dateGetter(name, size, offset, trim) { + offset = offset || 0; + return function(date) { + var value = date['get' + name](); + if (offset > 0 || value > -offset) + value += offset; + if (value === 0 && offset == -12 ) value = 12; + return padNumber(value, size, trim); + }; +} + +function dateStrGetter(name, shortForm) { + return function(date, formats) { + var value = date['get' + name](); + var get = uppercase(shortForm ? ('SHORT' + name) : name); + + return formats[get][value]; + }; +} + +function timeZoneGetter(date) { + var zone = -1 * date.getTimezoneOffset(); + var paddedZone = (zone >= 0) ? "+" : ""; + + paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + + padNumber(Math.abs(zone % 60), 2); + + return paddedZone; +} + +function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; +} + +var DATE_FORMATS = { + yyyy: dateGetter('FullYear', 4), + yy: dateGetter('FullYear', 2, 0, true), + y: dateGetter('FullYear', 1), + MMMM: dateStrGetter('Month'), + MMM: dateStrGetter('Month', true), + MM: dateGetter('Month', 2, 1), + M: dateGetter('Month', 1, 1), + dd: dateGetter('Date', 2), + d: dateGetter('Date', 1), + HH: dateGetter('Hours', 2), + H: dateGetter('Hours', 1), + hh: dateGetter('Hours', 2, -12), + h: dateGetter('Hours', 1, -12), + mm: dateGetter('Minutes', 2), + m: dateGetter('Minutes', 1), + ss: dateGetter('Seconds', 2), + s: dateGetter('Seconds', 1), + // while ISO 8601 requires fractions to be prefixed with `.` or `,` + // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions + sss: dateGetter('Milliseconds', 3), + EEEE: dateStrGetter('Day'), + EEE: dateStrGetter('Day', true), + a: ampmGetter, + Z: timeZoneGetter +}; + +var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/, + NUMBER_STRING = /^\d+$/; + +/** + * @ngdoc filter + * @name ng.filter:date + * @function + * + * @description + * Formats `date` to a string based on the requested `format`. + * + * `format` string can be composed of the following elements: + * + * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + * * `'MMMM'`: Month in year (January-December) + * * `'MMM'`: Month in year (Jan-Dec) + * * `'MM'`: Month in year, padded (01-12) + * * `'M'`: Month in year (1-12) + * * `'dd'`: Day in month, padded (01-31) + * * `'d'`: Day in month (1-31) + * * `'EEEE'`: Day in Week,(Sunday-Saturday) + * * `'EEE'`: Day in Week, (Sun-Sat) + * * `'HH'`: Hour in day, padded (00-23) + * * `'H'`: Hour in day (0-23) + * * `'hh'`: Hour in am/pm, padded (01-12) + * * `'h'`: Hour in am/pm, (1-12) + * * `'mm'`: Minute in hour, padded (00-59) + * * `'m'`: Minute in hour (0-59) + * * `'ss'`: Second in minute, padded (00-59) + * * `'s'`: Second in minute (0-59) + * * `'.sss' or ',sss'`: Millisecond in second, padded (000-999) + * * `'a'`: am/pm marker + * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) + * + * `format` string can also be one of the following predefined + * {@link guide/i18n localizable formats}: + * + * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale + * (e.g. Sep 3, 2010 12:05:08 pm) + * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm) + * * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale + * (e.g. Friday, September 3, 2010) + * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010 + * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) + * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) + * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm) + * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm) + * + * `format` string can contain literal values. These need to be quoted with single quotes (e.g. + * `"h 'in the morning'"`). In order to output single quote, use two single quotes in a sequence + * (e.g. `"h o''clock"`). + * + * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or + * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.SSSZ and its + * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is + * specified in the string input, the time is considered to be in the local timezone. + * @param {string=} format Formatting rules (see Description). If not specified, + * `mediumDate` is used. + * @returns {string} Formatted string or the input if input is not recognized as date/millis. + * + * @example + + + {{1288323623006 | date:'medium'}}: + {{1288323623006 | date:'medium'}}
    + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
    + {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: + {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
    +
    + + it('should format date', function() { + expect(binding("1288323623006 | date:'medium'")). + toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); + expect(binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")). + toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/); + expect(binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")). + toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); + }); + +
    + */ +dateFilter.$inject = ['$locale']; +function dateFilter($locale) { + + + var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; + // 1 2 3 4 5 6 7 8 9 10 11 + function jsonStringToDate(string) { + var match; + if (match = string.match(R_ISO8601_STR)) { + var date = new Date(0), + tzHour = 0, + tzMin = 0, + dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, + timeSetter = match[8] ? date.setUTCHours : date.setHours; + + if (match[9]) { + tzHour = int(match[9] + match[10]); + tzMin = int(match[9] + match[11]); + } + dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); + var h = int(match[4]||0) - tzHour; + var m = int(match[5]||0) - tzMin + var s = int(match[6]||0); + var ms = Math.round(parseFloat('0.' + (match[7]||0)) * 1000); + timeSetter.call(date, h, m, s, ms); + return date; + } + return string; + } + + + return function(date, format) { + var text = '', + parts = [], + fn, match; + + format = format || 'mediumDate'; + format = $locale.DATETIME_FORMATS[format] || format; + if (isString(date)) { + if (NUMBER_STRING.test(date)) { + date = int(date); + } else { + date = jsonStringToDate(date); + } + } + + if (isNumber(date)) { + date = new Date(date); + } + + if (!isDate(date)) { + return date; + } + + while(format) { + match = DATE_FORMATS_SPLIT.exec(format); + if (match) { + parts = concat(parts, match, 1); + format = parts.pop(); + } else { + parts.push(format); + format = null; + } + } + + forEach(parts, function(value){ + fn = DATE_FORMATS[value]; + text += fn ? fn(date, $locale.DATETIME_FORMATS) + : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); + }); + + return text; + }; +} + + +/** + * @ngdoc filter + * @name ng.filter:json + * @function + * + * @description + * Allows you to convert a JavaScript object into JSON string. + * + * This filter is mostly useful for debugging. When using the double curly {{value}} notation + * the binding is automatically converted to JSON. + * + * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. + * @returns {string} JSON string. + * + * + * @example: + + +
    {{ {'name':'value'} | json }}
    +
    + + it('should jsonify filtered objects', function() { + expect(binding("{'name':'value'}")).toMatch(/\{\n "name": ?"value"\n}/); + }); + +
    + * + */ +function jsonFilter() { + return function(object) { + return toJson(object, true); + }; +} + + +/** + * @ngdoc filter + * @name ng.filter:lowercase + * @function + * @description + * Converts string to lowercase. + * @see angular.lowercase + */ +var lowercaseFilter = valueFn(lowercase); + + +/** + * @ngdoc filter + * @name ng.filter:uppercase + * @function + * @description + * Converts string to uppercase. + * @see angular.uppercase + */ +var uppercaseFilter = valueFn(uppercase); + +/** + * @ngdoc function + * @name ng.filter:limitTo + * @function + * + * @description + * Creates a new array or string containing only a specified number of elements. The elements + * are taken from either the beginning or the end of the source array or string, as specified by + * the value and sign (positive or negative) of `limit`. + * + * Note: This function is used to augment the `Array` type in Angular expressions. See + * {@link ng.$filter} for more information about Angular arrays. + * + * @param {Array|string} input Source array or string to be limited. + * @param {string|number} limit The length of the returned array or string. If the `limit` number + * is positive, `limit` number of items from the beginning of the source array/string are copied. + * If the number is negative, `limit` number of items from the end of the source array/string + * are copied. The `limit` will be trimmed if it exceeds `array.length` + * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array + * had less than `limit` elements. + * + * @example + + + +
    + Limit {{numbers}} to: +

    Output numbers: {{ numbers | limitTo:numLimit }}

    + Limit {{letters}} to: +

    Output letters: {{ letters | limitTo:letterLimit }}

    +
    +
    + + it('should limit the number array to first three items', function() { + expect(element('.doc-example-live input[ng-model=numLimit]').val()).toBe('3'); + expect(element('.doc-example-live input[ng-model=letterLimit]').val()).toBe('3'); + expect(binding('numbers | limitTo:numLimit')).toEqual('[1,2,3]'); + expect(binding('letters | limitTo:letterLimit')).toEqual('abc'); + }); + + it('should update the output when -3 is entered', function() { + input('numLimit').enter(-3); + input('letterLimit').enter(-3); + expect(binding('numbers | limitTo:numLimit')).toEqual('[7,8,9]'); + expect(binding('letters | limitTo:letterLimit')).toEqual('ghi'); + }); + + it('should not exceed the maximum size of input array', function() { + input('numLimit').enter(100); + input('letterLimit').enter(100); + expect(binding('numbers | limitTo:numLimit')).toEqual('[1,2,3,4,5,6,7,8,9]'); + expect(binding('letters | limitTo:letterLimit')).toEqual('abcdefghi'); + }); + +
    + */ +function limitToFilter(){ + return function(input, limit) { + if (!isArray(input) && !isString(input)) return input; + + limit = int(limit); + + if (isString(input)) { + //NaN check on limit + if (limit) { + return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length); + } else { + return ""; + } + } + + var out = [], + i, n; + + // if abs(limit) exceeds maximum length, trim it + if (limit > input.length) + limit = input.length; + else if (limit < -input.length) + limit = -input.length; + + if (limit > 0) { + i = 0; + n = limit; + } else { + i = input.length + limit; + n = input.length; + } + + for (; i} expression A predicate to be + * used by the comparator to determine the order of elements. + * + * Can be one of: + * + * - `function`: Getter function. The result of this function will be sorted using the + * `<`, `=`, `>` operator. + * - `string`: An Angular expression which evaluates to an object to order by, such as 'name' + * to sort by a property called 'name'. Optionally prefixed with `+` or `-` to control + * ascending or descending sort order (for example, +name or -name). + * - `Array`: An array of function or string predicates. The first predicate in the array + * is used for sorting, but when two items are equivalent, the next predicate is used. + * + * @param {boolean=} reverse Reverse the order the array. + * @returns {Array} Sorted copy of the source array. + * + * @example + + + +
    +
    Sorting predicate = {{predicate}}; reverse = {{reverse}}
    +
    + [ unsorted ] + + + + + + + + + + + +
    Name + (^)Phone NumberAge
    {{friend.name}}{{friend.phone}}{{friend.age}}
    +
    +
    + + it('should be reverse ordered by aged', function() { + expect(binding('predicate')).toBe('-age'); + expect(repeater('table.friend', 'friend in friends').column('friend.age')). + toEqual(['35', '29', '21', '19', '10']); + expect(repeater('table.friend', 'friend in friends').column('friend.name')). + toEqual(['Adam', 'Julie', 'Mike', 'Mary', 'John']); + }); + + it('should reorder the table when user selects different predicate', function() { + element('.doc-example-live a:contains("Name")').click(); + expect(repeater('table.friend', 'friend in friends').column('friend.name')). + toEqual(['Adam', 'John', 'Julie', 'Mary', 'Mike']); + expect(repeater('table.friend', 'friend in friends').column('friend.age')). + toEqual(['35', '10', '29', '19', '21']); + + element('.doc-example-live a:contains("Phone")').click(); + expect(repeater('table.friend', 'friend in friends').column('friend.phone')). + toEqual(['555-9876', '555-8765', '555-5678', '555-4321', '555-1212']); + expect(repeater('table.friend', 'friend in friends').column('friend.name')). + toEqual(['Mary', 'Julie', 'Adam', 'Mike', 'John']); + }); + +
    + */ +orderByFilter.$inject = ['$parse']; +function orderByFilter($parse){ + return function(array, sortPredicate, reverseOrder) { + if (!isArray(array)) return array; + if (!sortPredicate) return array; + sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate]; + sortPredicate = map(sortPredicate, function(predicate){ + var descending = false, get = predicate || identity; + if (isString(predicate)) { + if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) { + descending = predicate.charAt(0) == '-'; + predicate = predicate.substring(1); + } + get = $parse(predicate); + } + return reverseComparator(function(a,b){ + return compare(get(a),get(b)); + }, descending); + }); + var arrayCopy = []; + for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); } + return arrayCopy.sort(reverseComparator(comparator, reverseOrder)); + + function comparator(o1, o2){ + for ( var i = 0; i < sortPredicate.length; i++) { + var comp = sortPredicate[i](o1, o2); + if (comp !== 0) return comp; + } + return 0; + } + function reverseComparator(comp, descending) { + return toBoolean(descending) + ? function(a,b){return comp(b,a);} + : comp; + } + function compare(v1, v2){ + var t1 = typeof v1; + var t2 = typeof v2; + if (t1 == t2) { + if (t1 == "string") v1 = v1.toLowerCase(); + if (t1 == "string") v2 = v2.toLowerCase(); + if (v1 === v2) return 0; + return v1 < v2 ? -1 : 1; + } else { + return t1 < t2 ? -1 : 1; + } + } + } +} + +function ngDirective(directive) { + if (isFunction(directive)) { + directive = { + link: directive + } + } + directive.restrict = directive.restrict || 'AC'; + return valueFn(directive); +} + +/** + * @ngdoc directive + * @name ng.directive:a + * @restrict E + * + * @description + * Modifies the default behavior of html A tag, so that the default action is prevented when href + * attribute is empty. + * + * The reasoning for this change is to allow easy creation of action links with `ngClick` directive + * without changing the location or causing page reloads, e.g.: + * `Save` + */ +var htmlAnchorDirective = valueFn({ + restrict: 'E', + compile: function(element, attr) { + + if (msie <= 8) { + + // turn link into a stylable link in IE + // but only if it doesn't have name attribute, in which case it's an anchor + if (!attr.href && !attr.name) { + attr.$set('href', ''); + } + + // add a comment node to anchors to workaround IE bug that causes element content to be reset + // to new attribute content if attribute is updated with value containing @ and element also + // contains value with @ + // see issue #1949 + element.append(document.createComment('IE fix')); + } + + return function(scope, element) { + element.bind('click', function(event){ + // if we have no href url, then don't navigate anywhere. + if (!element.attr('href')) { + event.preventDefault(); + } + }); + } + } +}); + +/** + * @ngdoc directive + * @name ng.directive:ngHref + * @restrict A + * + * @description + * Using Angular markup like {{hash}} in an href attribute makes + * the page open to a wrong URL, if the user clicks that link before + * angular has a chance to replace the {{hash}} with actual URL, the + * link will be broken and will most likely return a 404 error. + * The `ngHref` directive solves this problem. + * + * The buggy way to write it: + *
    + * 
    + * 
    + * + * The correct way to write it: + *
    + * 
    + * 
    + * + * @element A + * @param {template} ngHref any string which can contain `{{}}` markup. + * + * @example + * This example uses `link` variable inside `href` attribute: + + +
    +
    link 1 (link, don't reload)
    + link 2 (link, don't reload)
    + link 3 (link, reload!)
    + anchor (link, don't reload)
    + anchor (no link)
    + link (link, change location) + + + it('should execute ng-click but not reload when href without value', function() { + element('#link-1').click(); + expect(input('value').val()).toEqual('1'); + expect(element('#link-1').attr('href')).toBe(""); + }); + + it('should execute ng-click but not reload when href empty string', function() { + element('#link-2').click(); + expect(input('value').val()).toEqual('2'); + expect(element('#link-2').attr('href')).toBe(""); + }); + + it('should execute ng-click and change url when ng-href specified', function() { + expect(element('#link-3').attr('href')).toBe("/123"); + + element('#link-3').click(); + expect(browser().window().path()).toEqual('/123'); + }); + + it('should execute ng-click but not reload when href empty string and name specified', function() { + element('#link-4').click(); + expect(input('value').val()).toEqual('4'); + expect(element('#link-4').attr('href')).toBe(''); + }); + + it('should execute ng-click but not reload when no href but name specified', function() { + element('#link-5').click(); + expect(input('value').val()).toEqual('5'); + expect(element('#link-5').attr('href')).toBe(undefined); + }); + + it('should only change url when only ng-href', function() { + input('value').enter('6'); + expect(element('#link-6').attr('href')).toBe('6'); + + element('#link-6').click(); + expect(browser().location().url()).toEqual('/6'); + }); + + + */ + +/** + * @ngdoc directive + * @name ng.directive:ngSrc + * @restrict A + * + * @description + * Using Angular markup like `{{hash}}` in a `src` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrc` directive solves this problem. + * + * The buggy way to write it: + *
    + * 
    + * 
    + * + * The correct way to write it: + *
    + * 
    + * 
    + * + * @element IMG + * @param {template} ngSrc any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ng.directive:ngSrcset + * @restrict A + * + * @description + * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrcset` directive solves this problem. + * + * The buggy way to write it: + *
    + * 
    + * 
    + * + * The correct way to write it: + *
    + * 
    + * 
    + * + * @element IMG + * @param {template} ngSrcset any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ng.directive:ngDisabled + * @restrict A + * + * @description + * + * The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs: + *
    + * 
    + * + *
    + *
    + * + * The HTML specs do not require browsers to preserve the special attributes such as disabled. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngDisabled` directive. + * + * @example + + + Click me to toggle:
    + +
    + + it('should toggle button', function() { + expect(element('.doc-example-live :button').prop('disabled')).toBeFalsy(); + input('checked').check(); + expect(element('.doc-example-live :button').prop('disabled')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {expression} ngDisabled Angular expression that will be evaluated. + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngChecked + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as checked. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngChecked` directive. + * @example + + + Check me to check both:
    + +
    + + it('should check both checkBoxes', function() { + expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy(); + input('master').check(); + expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {expression} ngChecked Angular expression that will be evaluated. + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMultiple + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as multiple. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngMultiple` directive. + * + * @example + + + Check me check multiple:
    + +
    + + it('should toggle multiple', function() { + expect(element('.doc-example-live #select').prop('multiple')).toBeFalsy(); + input('checked').check(); + expect(element('.doc-example-live #select').prop('multiple')).toBeTruthy(); + }); + +
    + * + * @element SELECT + * @param {expression} ngMultiple Angular expression that will be evaluated. + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngReadonly + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as readonly. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngReadonly` directive. + * @example + + + Check me to make text readonly:
    + +
    + + it('should toggle readonly attr', function() { + expect(element('.doc-example-live :text').prop('readonly')).toBeFalsy(); + input('checked').check(); + expect(element('.doc-example-live :text').prop('readonly')).toBeTruthy(); + }); + +
    + * + * @element INPUT + * @param {string} expression Angular expression that will be evaluated. + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngSelected + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as selected. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduced the `ngSelected` directive. + * @example + + + Check me to select:
    + +
    + + it('should select Greetings!', function() { + expect(element('.doc-example-live #greet').prop('selected')).toBeFalsy(); + input('selected').check(); + expect(element('.doc-example-live #greet').prop('selected')).toBeTruthy(); + }); + +
    + * + * @element OPTION + * @param {string} expression Angular expression that will be evaluated. + */ + +/** + * @ngdoc directive + * @name ng.directive:ngOpen + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as open. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngOpen` directive. + * + * @example + + + Check me check multiple:
    +
    + Show/Hide me +
    +
    + + it('should toggle open', function() { + expect(element('#details').prop('open')).toBeFalsy(); + input('open').check(); + expect(element('#details').prop('open')).toBeTruthy(); + }); + +
    + * + * @element DETAILS + * @param {string} expression Angular expression that will be evaluated. + */ + +var ngAttributeAliasDirectives = {}; + + +// boolean attrs are evaluated +forEach(BOOLEAN_ATTR, function(propName, attrName) { + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 100, + compile: function() { + return function(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + }; + } + }; + }; +}); + + +// ng-src, ng-srcset, ng-href are interpolated +forEach(['src', 'srcset', 'href'], function(attrName) { + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 99, // it needs to run after the attributes are interpolated + link: function(scope, element, attr) { + attr.$observe(normalized, function(value) { + if (!value) + return; + + attr.$set(attrName, value); + + // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist + // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need + // to set the property as well to achieve the desired effect. + // we use attr[attrName] value since $set can sanitize the url. + if (msie) element.prop(attrName, attr[attrName]); + }); + } + }; + }; +}); + +var nullFormCtrl = { + $addControl: noop, + $removeControl: noop, + $setValidity: noop, + $setDirty: noop, + $setPristine: noop +}; + +/** + * @ngdoc object + * @name ng.directive:form.FormController + * + * @property {boolean} $pristine True if user has not interacted with the form yet. + * @property {boolean} $dirty True if user has already interacted with the form. + * @property {boolean} $valid True if all of the containing forms and controls are valid. + * @property {boolean} $invalid True if at least one containing control or form is invalid. + * + * @property {Object} $error Is an object hash, containing references to all invalid controls or + * forms, where: + * + * - keys are validation tokens (error names) — such as `required`, `url` or `email`), + * - values are arrays of controls or forms that are invalid with given error. + * + * @description + * `FormController` keeps track of all its controls and nested forms as well as state of them, + * such as being valid/invalid or dirty/pristine. + * + * Each {@link ng.directive:form form} directive creates an instance + * of `FormController`. + * + */ +//asks for $scope to fool the BC controller module +FormController.$inject = ['$element', '$attrs', '$scope']; +function FormController(element, attrs) { + var form = this, + parentForm = element.parent().controller('form') || nullFormCtrl, + invalidCount = 0, // used to easily determine if we are valid + errors = form.$error = {}, + controls = []; + + // init state + form.$name = attrs.name; + form.$dirty = false; + form.$pristine = true; + form.$valid = true; + form.$invalid = false; + + parentForm.$addControl(form); + + // Setup initial state of the control + element.addClass(PRISTINE_CLASS); + toggleValidCss(true); + + // convenience method for easy toggling of classes + function toggleValidCss(isValid, validationErrorKey) { + validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; + element. + removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey). + addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey); + } + + form.$addControl = function(control) { + controls.push(control); + + if (control.$name && !form.hasOwnProperty(control.$name)) { + form[control.$name] = control; + } + }; + + form.$removeControl = function(control) { + if (control.$name && form[control.$name] === control) { + delete form[control.$name]; + } + forEach(errors, function(queue, validationToken) { + form.$setValidity(validationToken, true, control); + }); + + arrayRemove(controls, control); + }; + + form.$setValidity = function(validationToken, isValid, control) { + var queue = errors[validationToken]; + + if (isValid) { + if (queue) { + arrayRemove(queue, control); + if (!queue.length) { + invalidCount--; + if (!invalidCount) { + toggleValidCss(isValid); + form.$valid = true; + form.$invalid = false; + } + errors[validationToken] = false; + toggleValidCss(true, validationToken); + parentForm.$setValidity(validationToken, true, form); + } + } + + } else { + if (!invalidCount) { + toggleValidCss(isValid); + } + if (queue) { + if (includes(queue, control)) return; + } else { + errors[validationToken] = queue = []; + invalidCount++; + toggleValidCss(false, validationToken); + parentForm.$setValidity(validationToken, false, form); + } + queue.push(control); + + form.$valid = false; + form.$invalid = true; + } + }; + + form.$setDirty = function() { + element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS); + form.$dirty = true; + form.$pristine = false; + parentForm.$setDirty(); + }; + + /** + * @ngdoc function + * @name ng.directive:form.FormController#$setPristine + * @methodOf ng.directive:form.FormController + * + * @description + * Sets the form to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the form to its pristine + * state (ng-pristine class). This method will also propagate to all the controls contained + * in this form. + * + * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after + * saving or resetting it. + */ + form.$setPristine = function () { + element.removeClass(DIRTY_CLASS).addClass(PRISTINE_CLASS); + form.$dirty = false; + form.$pristine = true; + forEach(controls, function(control) { + control.$setPristine(); + }); + }; +} + + +/** + * @ngdoc directive + * @name ng.directive:ngForm + * @restrict EAC + * + * @description + * Nestable alias of {@link ng.directive:form `form`} directive. HTML + * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a + * sub-group of controls needs to be determined. + * + * @param {string=} name|ngForm Name of the form. If specified, the form controller will be published into + * related scope, under this name. + * + */ + + /** + * @ngdoc directive + * @name ng.directive:form + * @restrict E + * + * @description + * Directive that instantiates + * {@link ng.directive:form.FormController FormController}. + * + * If `name` attribute is specified, the form controller is published onto the current scope under + * this name. + * + * # Alias: {@link ng.directive:ngForm `ngForm`} + * + * In angular forms can be nested. This means that the outer form is valid when all of the child + * forms are valid as well. However browsers do not allow nesting of `
    ` elements, for this + * reason angular provides {@link ng.directive:ngForm `ngForm`} alias + * which behaves identical to `` but allows form nesting. + * + * + * # CSS classes + * - `ng-valid` Is set if the form is valid. + * - `ng-invalid` Is set if the form is invalid. + * - `ng-pristine` Is set if the form is pristine. + * - `ng-dirty` Is set if the form is dirty. + * + * + * # Submitting a form and preventing default action + * + * Since the role of forms in client-side Angular applications is different than in classical + * roundtrip apps, it is desirable for the browser not to translate the form submission into a full + * page reload that sends the data to the server. Instead some javascript logic should be triggered + * to handle the form submission in application specific way. + * + * For this reason, Angular prevents the default action (form submission to the server) unless the + * `` element has an `action` attribute specified. + * + * You can use one of the following two ways to specify what javascript method should be called when + * a form is submitted: + * + * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element + * - {@link ng.directive:ngClick ngClick} directive on the first + * button or input field of type submit (input[type=submit]) + * + * To prevent double execution of the handler, use only one of ngSubmit or ngClick directives. This + * is because of the following form submission rules coming from the html spec: + * + * - If a form has only one input field then hitting enter in this field triggers form submit + * (`ngSubmit`) + * - if a form has has 2+ input fields and no buttons or input[type=submit] then hitting enter + * doesn't trigger submit + * - if a form has one or more input fields and one or more buttons or input[type=submit] then + * hitting enter in any of the input fields will trigger the click handler on the *first* button or + * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) + * + * @param {string=} name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + * + * @example + + + + + userType: + Required!
    + userType = {{userType}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + +
    + + it('should initialize to model', function() { + expect(binding('userType')).toEqual('guest'); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('userType').enter(''); + expect(binding('userType')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + +
    + */ +var formDirectiveFactory = function(isNgForm) { + return ['$timeout', function($timeout) { + var formDirective = { + name: 'form', + restrict: 'E', + controller: FormController, + compile: function() { + return { + pre: function(scope, formElement, attr, controller) { + if (!attr.action) { + // we can't use jq events because if a form is destroyed during submission the default + // action is not prevented. see #1238 + // + // IE 9 is not affected because it doesn't fire a submit event and try to do a full + // page reload if the form was destroyed by submission of the form via a click handler + // on a button in the form. Looks like an IE9 specific bug. + var preventDefaultListener = function(event) { + event.preventDefault + ? event.preventDefault() + : event.returnValue = false; // IE + }; + + addEventListenerFn(formElement[0], 'submit', preventDefaultListener); + + // unregister the preventDefault listener so that we don't not leak memory but in a + // way that will achieve the prevention of the default action. + formElement.bind('$destroy', function() { + $timeout(function() { + removeEventListenerFn(formElement[0], 'submit', preventDefaultListener); + }, 0, false); + }); + } + + var parentFormCtrl = formElement.parent().controller('form'), + alias = attr.name || attr.ngForm; + + if (alias) { + scope[alias] = controller; + } + if (parentFormCtrl) { + formElement.bind('$destroy', function() { + parentFormCtrl.$removeControl(controller); + if (alias) { + scope[alias] = undefined; + } + extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards + }); + } + } + }; + } + }; + + return isNgForm ? extend(copy(formDirective), {restrict: 'EAC'}) : formDirective; + }]; +}; + +var formDirective = formDirectiveFactory(); +var ngFormDirective = formDirectiveFactory(true); + +var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; +var EMAIL_REGEXP = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/; +var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/; + +var inputType = { + + /** + * @ngdoc inputType + * @name ng.directive:input.text + * + * @description + * Standard HTML text input with angular data binding. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Adds `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trimming the + * input. + * + * @example + + + +
    + Single word: + + Required! + + Single word only! + + text = {{text}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('text')).toEqual('guest'); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('text').enter(''); + expect(binding('text')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + + it('should be invalid if multi word', function() { + input('text').enter('hello world'); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + + it('should not be trimmed', function() { + input('text').enter('untrimmed '); + expect(binding('text')).toEqual('untrimmed '); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + +
    + */ + 'text': textInputType, + + + /** + * @ngdoc inputType + * @name ng.directive:input.number + * + * @description + * Text input with number validation and transformation. Sets the `number` validation + * error if not a valid number. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + Number: + + Required! + + Not valid number! + value = {{value}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('value')).toEqual('12'); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('value').enter(''); + expect(binding('value')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + + it('should be invalid if over max', function() { + input('value').enter('123'); + expect(binding('value')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + +
    + */ + 'number': numberInputType, + + + /** + * @ngdoc inputType + * @name ng.directive:input.url + * + * @description + * Text input with URL validation. Sets the `url` validation error key if the content is not a + * valid URL. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + URL: + + Required! + + Not valid url! + text = {{text}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + myForm.$error.url = {{!!myForm.$error.url}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('text')).toEqual('http://google.com'); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('text').enter(''); + expect(binding('text')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + + it('should be invalid if not url', function() { + input('text').enter('xxx'); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + +
    + */ + 'url': urlInputType, + + + /** + * @ngdoc inputType + * @name ng.directive:input.email + * + * @description + * Text input with email validation. Sets the `email` validation error key if not a valid email + * address. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * + * @example + + + +
    + Email: + + Required! + + Not valid email! + text = {{text}}
    + myForm.input.$valid = {{myForm.input.$valid}}
    + myForm.input.$error = {{myForm.input.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + myForm.$error.email = {{!!myForm.$error.email}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('text')).toEqual('me@example.com'); + expect(binding('myForm.input.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('text').enter(''); + expect(binding('text')).toEqual(''); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + + it('should be invalid if not email', function() { + input('text').enter('xxx'); + expect(binding('myForm.input.$valid')).toEqual('false'); + }); + +
    + */ + 'email': emailInputType, + + + /** + * @ngdoc inputType + * @name ng.directive:input.radio + * + * @description + * HTML radio button. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string} value The value to which the expression should be set when selected. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + Red
    + Green
    + Blue
    + color = {{color}}
    +
    +
    + + it('should change state', function() { + expect(binding('color')).toEqual('blue'); + + input('color').select('red'); + expect(binding('color')).toEqual('red'); + }); + +
    + */ + 'radio': radioInputType, + + + /** + * @ngdoc inputType + * @name ng.directive:input.checkbox + * + * @description + * HTML checkbox. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngTrueValue The value to which the expression should be set when selected. + * @param {string=} ngFalseValue The value to which the expression should be set when not selected. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    + Value1:
    + Value2:
    + value1 = {{value1}}
    + value2 = {{value2}}
    +
    +
    + + it('should change state', function() { + expect(binding('value1')).toEqual('true'); + expect(binding('value2')).toEqual('YES'); + + input('value1').check(); + input('value2').check(); + expect(binding('value1')).toEqual('false'); + expect(binding('value2')).toEqual('NO'); + }); + +
    + */ + 'checkbox': checkboxInputType, + + 'hidden': noop, + 'button': noop, + 'submit': noop, + 'reset': noop +}; + + +function isEmpty(value) { + return isUndefined(value) || value === '' || value === null || value !== value; +} + + +function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { + + var listener = function() { + var value = element.val(); + + // By default we will trim the value + // If the attribute ng-trim exists we will avoid trimming + // e.g. + if (toBoolean(attr.ngTrim || 'T')) { + value = trim(value); + } + + if (ctrl.$viewValue !== value) { + scope.$apply(function() { + ctrl.$setViewValue(value); + }); + } + }; + + // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the + // input event on backspace, delete or cut + if ($sniffer.hasEvent('input')) { + element.bind('input', listener); + } else { + var timeout; + + var deferListener = function() { + if (!timeout) { + timeout = $browser.defer(function() { + listener(); + timeout = null; + }); + } + }; + + element.bind('keydown', function(event) { + var key = event.keyCode; + + // ignore + // command modifiers arrows + if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; + + deferListener(); + }); + + // if user paste into input using mouse, we need "change" event to catch it + element.bind('change', listener); + + // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it + if ($sniffer.hasEvent('paste')) { + element.bind('paste cut', deferListener); + } + } + + + ctrl.$render = function() { + element.val(isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue); + }; + + // pattern validator + var pattern = attr.ngPattern, + patternValidator, + match; + + var validate = function(regexp, value) { + if (isEmpty(value) || regexp.test(value)) { + ctrl.$setValidity('pattern', true); + return value; + } else { + ctrl.$setValidity('pattern', false); + return undefined; + } + }; + + if (pattern) { + match = pattern.match(/^\/(.*)\/([gim]*)$/); + if (match) { + pattern = new RegExp(match[1], match[2]); + patternValidator = function(value) { + return validate(pattern, value) + }; + } else { + patternValidator = function(value) { + var patternObj = scope.$eval(pattern); + + if (!patternObj || !patternObj.test) { + throw new Error('Expected ' + pattern + ' to be a RegExp but was ' + patternObj); + } + return validate(patternObj, value); + }; + } + + ctrl.$formatters.push(patternValidator); + ctrl.$parsers.push(patternValidator); + } + + // min length validator + if (attr.ngMinlength) { + var minlength = int(attr.ngMinlength); + var minLengthValidator = function(value) { + if (!isEmpty(value) && value.length < minlength) { + ctrl.$setValidity('minlength', false); + return undefined; + } else { + ctrl.$setValidity('minlength', true); + return value; + } + }; + + ctrl.$parsers.push(minLengthValidator); + ctrl.$formatters.push(minLengthValidator); + } + + // max length validator + if (attr.ngMaxlength) { + var maxlength = int(attr.ngMaxlength); + var maxLengthValidator = function(value) { + if (!isEmpty(value) && value.length > maxlength) { + ctrl.$setValidity('maxlength', false); + return undefined; + } else { + ctrl.$setValidity('maxlength', true); + return value; + } + }; + + ctrl.$parsers.push(maxLengthValidator); + ctrl.$formatters.push(maxLengthValidator); + } +} + +function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + ctrl.$parsers.push(function(value) { + var empty = isEmpty(value); + if (empty || NUMBER_REGEXP.test(value)) { + ctrl.$setValidity('number', true); + return value === '' ? null : (empty ? value : parseFloat(value)); + } else { + ctrl.$setValidity('number', false); + return undefined; + } + }); + + ctrl.$formatters.push(function(value) { + return isEmpty(value) ? '' : '' + value; + }); + + if (attr.min) { + var min = parseFloat(attr.min); + var minValidator = function(value) { + if (!isEmpty(value) && value < min) { + ctrl.$setValidity('min', false); + return undefined; + } else { + ctrl.$setValidity('min', true); + return value; + } + }; + + ctrl.$parsers.push(minValidator); + ctrl.$formatters.push(minValidator); + } + + if (attr.max) { + var max = parseFloat(attr.max); + var maxValidator = function(value) { + if (!isEmpty(value) && value > max) { + ctrl.$setValidity('max', false); + return undefined; + } else { + ctrl.$setValidity('max', true); + return value; + } + }; + + ctrl.$parsers.push(maxValidator); + ctrl.$formatters.push(maxValidator); + } + + ctrl.$formatters.push(function(value) { + + if (isEmpty(value) || isNumber(value)) { + ctrl.$setValidity('number', true); + return value; + } else { + ctrl.$setValidity('number', false); + return undefined; + } + }); +} + +function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + var urlValidator = function(value) { + if (isEmpty(value) || URL_REGEXP.test(value)) { + ctrl.$setValidity('url', true); + return value; + } else { + ctrl.$setValidity('url', false); + return undefined; + } + }; + + ctrl.$formatters.push(urlValidator); + ctrl.$parsers.push(urlValidator); +} + +function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { + textInputType(scope, element, attr, ctrl, $sniffer, $browser); + + var emailValidator = function(value) { + if (isEmpty(value) || EMAIL_REGEXP.test(value)) { + ctrl.$setValidity('email', true); + return value; + } else { + ctrl.$setValidity('email', false); + return undefined; + } + }; + + ctrl.$formatters.push(emailValidator); + ctrl.$parsers.push(emailValidator); +} + +function radioInputType(scope, element, attr, ctrl) { + // make the name unique, if not defined + if (isUndefined(attr.name)) { + element.attr('name', nextUid()); + } + + element.bind('click', function() { + if (element[0].checked) { + scope.$apply(function() { + ctrl.$setViewValue(attr.value); + }); + } + }); + + ctrl.$render = function() { + var value = attr.value; + element[0].checked = (value == ctrl.$viewValue); + }; + + attr.$observe('value', ctrl.$render); +} + +function checkboxInputType(scope, element, attr, ctrl) { + var trueValue = attr.ngTrueValue, + falseValue = attr.ngFalseValue; + + if (!isString(trueValue)) trueValue = true; + if (!isString(falseValue)) falseValue = false; + + element.bind('click', function() { + scope.$apply(function() { + ctrl.$setViewValue(element[0].checked); + }); + }); + + ctrl.$render = function() { + element[0].checked = ctrl.$viewValue; + }; + + ctrl.$formatters.push(function(value) { + return value === trueValue; + }); + + ctrl.$parsers.push(function(value) { + return value ? trueValue : falseValue; + }); +} + + +/** + * @ngdoc directive + * @name ng.directive:textarea + * @restrict E + * + * @description + * HTML textarea element control with angular data-binding. The data-binding and validation + * properties of this element are exactly the same as those of the + * {@link ng.directive:input input element}. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + */ + + +/** + * @ngdoc directive + * @name ng.directive:input + * @restrict E + * + * @description + * HTML input element control with angular data-binding. Input control follows HTML5 input types + * and polyfills the HTML5 validation behavior for older browsers. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {boolean=} ngRequired Sets `required` attribute if set to true + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
    +
    + User name: + + Required!
    + Last name: + + Too short! + + Too long!
    +
    +
    + user = {{user}}
    + myForm.userName.$valid = {{myForm.userName.$valid}}
    + myForm.userName.$error = {{myForm.userName.$error}}
    + myForm.lastName.$valid = {{myForm.lastName.$valid}}
    + myForm.lastName.$error = {{myForm.lastName.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    + myForm.$error.minlength = {{!!myForm.$error.minlength}}
    + myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}'); + expect(binding('myForm.userName.$valid')).toEqual('true'); + expect(binding('myForm.$valid')).toEqual('true'); + }); + + it('should be invalid if empty when required', function() { + input('user.name').enter(''); + expect(binding('user')).toEqual('{"last":"visitor"}'); + expect(binding('myForm.userName.$valid')).toEqual('false'); + expect(binding('myForm.$valid')).toEqual('false'); + }); + + it('should be valid if empty when min length is set', function() { + input('user.last').enter(''); + expect(binding('user')).toEqual('{"name":"guest","last":""}'); + expect(binding('myForm.lastName.$valid')).toEqual('true'); + expect(binding('myForm.$valid')).toEqual('true'); + }); + + it('should be invalid if less than required min length', function() { + input('user.last').enter('xx'); + expect(binding('user')).toEqual('{"name":"guest"}'); + expect(binding('myForm.lastName.$valid')).toEqual('false'); + expect(binding('myForm.lastName.$error')).toMatch(/minlength/); + expect(binding('myForm.$valid')).toEqual('false'); + }); + + it('should be invalid if longer than max length', function() { + input('user.last').enter('some ridiculously long name'); + expect(binding('user')) + .toEqual('{"name":"guest"}'); + expect(binding('myForm.lastName.$valid')).toEqual('false'); + expect(binding('myForm.lastName.$error')).toMatch(/maxlength/); + expect(binding('myForm.$valid')).toEqual('false'); + }); + +
    + */ +var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) { + return { + restrict: 'E', + require: '?ngModel', + link: function(scope, element, attr, ctrl) { + if (ctrl) { + (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer, + $browser); + } + } + }; +}]; + +var VALID_CLASS = 'ng-valid', + INVALID_CLASS = 'ng-invalid', + PRISTINE_CLASS = 'ng-pristine', + DIRTY_CLASS = 'ng-dirty'; + +/** + * @ngdoc object + * @name ng.directive:ngModel.NgModelController + * + * @property {string} $viewValue Actual string value in the view. + * @property {*} $modelValue The value in the model, that the control is bound to. + * @property {Array.} $parsers Whenever the control reads value from the DOM, it executes + * all of these functions to sanitize / convert the value as well as validate. + * + * @property {Array.} $formatters Whenever the model value changes, it executes all of + * these functions to convert the value as well as validate. + * + * @property {Object} $error An object hash with all errors as keys. + * + * @property {boolean} $pristine True if user has not interacted with the control yet. + * @property {boolean} $dirty True if user has already interacted with the control. + * @property {boolean} $valid True if there is no error. + * @property {boolean} $invalid True if at least one error on the control. + * + * @description + * + * `NgModelController` provides API for the `ng-model` directive. The controller contains + * services for data-binding, validation, CSS update, value formatting and parsing. It + * specifically does not contain any logic which deals with DOM rendering or listening to + * DOM events. The `NgModelController` is meant to be extended by other directives where, the + * directive provides DOM manipulation and the `NgModelController` provides the data-binding. + * + * This example shows how to use `NgModelController` with a custom control to achieve + * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`) + * collaborate together to achieve the desired result. + * + * + + [contenteditable] { + border: 1px solid black; + background-color: white; + min-height: 20px; + } + + .ng-invalid { + border: 1px solid red; + } + + + + angular.module('customControl', []). + directive('contenteditable', function() { + return { + restrict: 'A', // only activate on element attribute + require: '?ngModel', // get a hold of NgModelController + link: function(scope, element, attrs, ngModel) { + if(!ngModel) return; // do nothing if no ng-model + + // Specify how UI should be updated + ngModel.$render = function() { + element.html(ngModel.$viewValue || ''); + }; + + // Listen for change events to enable binding + element.bind('blur keyup change', function() { + scope.$apply(read); + }); + read(); // initialize + + // Write data to the model + function read() { + ngModel.$setViewValue(element.html()); + } + } + }; + }); + + +
    +
    Change me!
    + Required! +
    + +
    +
    + + it('should data-bind and become invalid', function() { + var contentEditable = element('[contenteditable]'); + + expect(contentEditable.text()).toEqual('Change me!'); + input('userContent').enter(''); + expect(contentEditable.text()).toEqual(''); + expect(contentEditable.prop('className')).toMatch(/ng-invalid-required/); + }); + + *
    + * + */ +var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', + function($scope, $exceptionHandler, $attr, $element, $parse) { + this.$viewValue = Number.NaN; + this.$modelValue = Number.NaN; + this.$parsers = []; + this.$formatters = []; + this.$viewChangeListeners = []; + this.$pristine = true; + this.$dirty = false; + this.$valid = true; + this.$invalid = false; + this.$name = $attr.name; + + var ngModelGet = $parse($attr.ngModel), + ngModelSet = ngModelGet.assign; + + if (!ngModelSet) { + throw Error(NON_ASSIGNABLE_MODEL_EXPRESSION + $attr.ngModel + + ' (' + startingTag($element) + ')'); + } + + /** + * @ngdoc function + * @name ng.directive:ngModel.NgModelController#$render + * @methodOf ng.directive:ngModel.NgModelController + * + * @description + * Called when the view needs to be updated. It is expected that the user of the ng-model + * directive will implement this method. + */ + this.$render = noop; + + var parentForm = $element.inheritedData('$formController') || nullFormCtrl, + invalidCount = 0, // used to easily determine if we are valid + $error = this.$error = {}; // keep invalid keys here + + + // Setup initial state of the control + $element.addClass(PRISTINE_CLASS); + toggleValidCss(true); + + // convenience method for easy toggling of classes + function toggleValidCss(isValid, validationErrorKey) { + validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; + $element. + removeClass((isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey). + addClass((isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey); + } + + /** + * @ngdoc function + * @name ng.directive:ngModel.NgModelController#$setValidity + * @methodOf ng.directive:ngModel.NgModelController + * + * @description + * Change the validity state, and notifies the form when the control changes validity. (i.e. it + * does not notify form if given validator is already marked as invalid). + * + * This method should be called by validators - i.e. the parser or formatter functions. + * + * @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign + * to `$error[validationErrorKey]=isValid` so that it is available for data-binding. + * The `validationErrorKey` should be in camelCase and will get converted into dash-case + * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` + * class and can be bound to as `{{someForm.someControl.$error.myError}}` . + * @param {boolean} isValid Whether the current state is valid (true) or invalid (false). + */ + this.$setValidity = function(validationErrorKey, isValid) { + if ($error[validationErrorKey] === !isValid) return; + + if (isValid) { + if ($error[validationErrorKey]) invalidCount--; + if (!invalidCount) { + toggleValidCss(true); + this.$valid = true; + this.$invalid = false; + } + } else { + toggleValidCss(false); + this.$invalid = true; + this.$valid = false; + invalidCount++; + } + + $error[validationErrorKey] = !isValid; + toggleValidCss(isValid, validationErrorKey); + + parentForm.$setValidity(validationErrorKey, isValid, this); + }; + + /** + * @ngdoc function + * @name ng.directive:ngModel.NgModelController#$setPristine + * @methodOf ng.directive:ngModel.NgModelController + * + * @description + * Sets the control to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the control to its pristine + * state (ng-pristine class). + */ + this.$setPristine = function () { + this.$dirty = false; + this.$pristine = true; + $element.removeClass(DIRTY_CLASS).addClass(PRISTINE_CLASS); + }; + + /** + * @ngdoc function + * @name ng.directive:ngModel.NgModelController#$setViewValue + * @methodOf ng.directive:ngModel.NgModelController + * + * @description + * Read a value from view. + * + * This method should be called from within a DOM event handler. + * For example {@link ng.directive:input input} or + * {@link ng.directive:select select} directives call it. + * + * It internally calls all `parsers` and if resulted value is valid, updates the model and + * calls all registered change listeners. + * + * @param {string} value Value from the view. + */ + this.$setViewValue = function(value) { + this.$viewValue = value; + + // change to dirty + if (this.$pristine) { + this.$dirty = true; + this.$pristine = false; + $element.removeClass(PRISTINE_CLASS).addClass(DIRTY_CLASS); + parentForm.$setDirty(); + } + + forEach(this.$parsers, function(fn) { + value = fn(value); + }); + + if (this.$modelValue !== value) { + this.$modelValue = value; + ngModelSet($scope, value); + forEach(this.$viewChangeListeners, function(listener) { + try { + listener(); + } catch(e) { + $exceptionHandler(e); + } + }) + } + }; + + // model -> value + var ctrl = this; + + $scope.$watch(function ngModelWatch() { + var value = ngModelGet($scope); + + // if scope model value and ngModel value are out of sync + if (ctrl.$modelValue !== value) { + + var formatters = ctrl.$formatters, + idx = formatters.length; + + ctrl.$modelValue = value; + while(idx--) { + value = formatters[idx](value); + } + + if (ctrl.$viewValue !== value) { + ctrl.$viewValue = value; + ctrl.$render(); + } + } + }); +}]; + + +/** + * @ngdoc directive + * @name ng.directive:ngModel + * + * @element input + * + * @description + * Is directive that tells Angular to do two-way data binding. It works together with `input`, + * `select`, `textarea`. You can easily write your own directives to use `ngModel` as well. + * + * `ngModel` is responsible for: + * + * - binding the view into the model, which other directives such as `input`, `textarea` or `select` + * require, + * - providing validation behavior (i.e. required, number, email, url), + * - keeping state of the control (valid/invalid, dirty/pristine, validation errors), + * - setting related css class onto the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`), + * - register the control with parent {@link ng.directive:form form}. + * + * For basic examples, how to use `ngModel`, see: + * + * - {@link ng.directive:input input} + * - {@link ng.directive:input.text text} + * - {@link ng.directive:input.checkbox checkbox} + * - {@link ng.directive:input.radio radio} + * - {@link ng.directive:input.number number} + * - {@link ng.directive:input.email email} + * - {@link ng.directive:input.url url} + * - {@link ng.directive:select select} + * - {@link ng.directive:textarea textarea} + * + */ +var ngModelDirective = function() { + return { + require: ['ngModel', '^?form'], + controller: NgModelController, + link: function(scope, element, attr, ctrls) { + // notify others, especially parent forms + + var modelCtrl = ctrls[0], + formCtrl = ctrls[1] || nullFormCtrl; + + formCtrl.$addControl(modelCtrl); + + element.bind('$destroy', function() { + formCtrl.$removeControl(modelCtrl); + }); + } + }; +}; + + +/** + * @ngdoc directive + * @name ng.directive:ngChange + * @restrict E + * + * @description + * Evaluate given expression when user changes the input. + * The expression is not evaluated when the value change is coming from the model. + * + * Note, this directive requires `ngModel` to be present. + * + * @element input + * + * @example + * + * + * + *
    + * + * + *
    + * debug = {{confirmed}}
    + * counter = {{counter}} + *
    + *
    + * + * it('should evaluate the expression if changing from view', function() { + * expect(binding('counter')).toEqual('0'); + * element('#ng-change-example1').click(); + * expect(binding('counter')).toEqual('1'); + * expect(binding('confirmed')).toEqual('true'); + * }); + * + * it('should not evaluate the expression if changing from model', function() { + * element('#ng-change-example2').click(); + * expect(binding('counter')).toEqual('0'); + * expect(binding('confirmed')).toEqual('true'); + * }); + * + *
    + */ +var ngChangeDirective = valueFn({ + require: 'ngModel', + link: function(scope, element, attr, ctrl) { + ctrl.$viewChangeListeners.push(function() { + scope.$eval(attr.ngChange); + }); + } +}); + + +var requiredDirective = function() { + return { + require: '?ngModel', + link: function(scope, elm, attr, ctrl) { + if (!ctrl) return; + attr.required = true; // force truthy in case we are on non input element + + var validator = function(value) { + if (attr.required && (isEmpty(value) || value === false)) { + ctrl.$setValidity('required', false); + return; + } else { + ctrl.$setValidity('required', true); + return value; + } + }; + + ctrl.$formatters.push(validator); + ctrl.$parsers.unshift(validator); + + attr.$observe('required', function() { + validator(ctrl.$viewValue); + }); + } + }; +}; + + +/** + * @ngdoc directive + * @name ng.directive:ngList + * + * @description + * Text input that converts between comma-separated string into an array of strings. + * + * @element input + * @param {string=} ngList optional delimiter that should be used to split the value. If + * specified in form `/something/` then the value will be converted into a regular expression. + * + * @example + + + +
    + List: + + Required! + names = {{names}}
    + myForm.namesInput.$valid = {{myForm.namesInput.$valid}}
    + myForm.namesInput.$error = {{myForm.namesInput.$error}}
    + myForm.$valid = {{myForm.$valid}}
    + myForm.$error.required = {{!!myForm.$error.required}}
    +
    +
    + + it('should initialize to model', function() { + expect(binding('names')).toEqual('["igor","misko","vojta"]'); + expect(binding('myForm.namesInput.$valid')).toEqual('true'); + }); + + it('should be invalid if empty', function() { + input('names').enter(''); + expect(binding('names')).toEqual('[]'); + expect(binding('myForm.namesInput.$valid')).toEqual('false'); + }); + +
    + */ +var ngListDirective = function() { + return { + require: 'ngModel', + link: function(scope, element, attr, ctrl) { + var match = /\/(.*)\//.exec(attr.ngList), + separator = match && new RegExp(match[1]) || attr.ngList || ','; + + var parse = function(viewValue) { + var list = []; + + if (viewValue) { + forEach(viewValue.split(separator), function(value) { + if (value) list.push(trim(value)); + }); + } + + return list; + }; + + ctrl.$parsers.push(parse); + ctrl.$formatters.push(function(value) { + if (isArray(value)) { + return value.join(', '); + } + + return undefined; + }); + } + }; +}; + + +var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; + +var ngValueDirective = function() { + return { + priority: 100, + compile: function(tpl, tplAttr) { + if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) { + return function(scope, elm, attr) { + attr.$set('value', scope.$eval(attr.ngValue)); + }; + } else { + return function(scope, elm, attr) { + scope.$watch(attr.ngValue, function valueWatchAction(value) { + attr.$set('value', value, false); + }); + }; + } + } + }; +}; + +/** + * @ngdoc directive + * @name ng.directive:ngBind + * + * @description + * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element + * with the value of a given expression, and to update the text content when the value of that + * expression changes. + * + * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like + * `{{ expression }}` which is similar but less verbose. + * + * One scenario in which the use of `ngBind` is preferred over `{{ expression }}` binding is when + * it's desirable to put bindings into template that is momentarily displayed by the browser in its + * raw state before Angular compiles it. Since `ngBind` is an element attribute, it makes the + * bindings invisible to the user while the page is loading. + * + * An alternative solution to this problem would be using the + * {@link ng.directive:ngCloak ngCloak} directive. + * + * + * @element ANY + * @param {expression} ngBind {@link guide/expression Expression} to evaluate. + * + * @example + * Enter a name in the Live Preview text box; the greeting below the text box changes instantly. + + + +
    + Enter name:
    + Hello ! +
    +
    + + it('should check ng-bind', function() { + expect(using('.doc-example-live').binding('name')).toBe('Whirled'); + using('.doc-example-live').input('name').enter('world'); + expect(using('.doc-example-live').binding('name')).toBe('world'); + }); + +
    + */ +var ngBindDirective = ngDirective(function(scope, element, attr) { + element.addClass('ng-binding').data('$binding', attr.ngBind); + scope.$watch(attr.ngBind, function ngBindWatchAction(value) { + element.text(value == undefined ? '' : value); + }); +}); + + +/** + * @ngdoc directive + * @name ng.directive:ngBindTemplate + * + * @description + * The `ngBindTemplate` directive specifies that the element + * text should be replaced with the template in ngBindTemplate. + * Unlike ngBind the ngBindTemplate can contain multiple `{{` `}}` + * expressions. (This is required since some HTML elements + * can not have SPAN elements such as TITLE, or OPTION to name a few.) + * + * @element ANY + * @param {string} ngBindTemplate template of form + * {{ expression }} to eval. + * + * @example + * Try it here: enter text in text box and watch the greeting change. + + + +
    + Salutation:
    + Name:
    +
    
    +       
    +
    + + it('should check ng-bind', function() { + expect(using('.doc-example-live').binding('salutation')). + toBe('Hello'); + expect(using('.doc-example-live').binding('name')). + toBe('World'); + using('.doc-example-live').input('salutation').enter('Greetings'); + using('.doc-example-live').input('name').enter('user'); + expect(using('.doc-example-live').binding('salutation')). + toBe('Greetings'); + expect(using('.doc-example-live').binding('name')). + toBe('user'); + }); + +
    + */ +var ngBindTemplateDirective = ['$interpolate', function($interpolate) { + return function(scope, element, attr) { + // TODO: move this to scenario runner + var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate)); + element.addClass('ng-binding').data('$binding', interpolateFn); + attr.$observe('ngBindTemplate', function(value) { + element.text(value); + }); + } +}]; + + +/** + * @ngdoc directive + * @name ng.directive:ngBindHtmlUnsafe + * + * @description + * Creates a binding that will innerHTML the result of evaluating the `expression` into the current + * element. *The innerHTML-ed content will not be sanitized!* You should use this directive only if + * {@link ngSanitize.directive:ngBindHtml ngBindHtml} directive is too + * restrictive and when you absolutely trust the source of the content you are binding to. + * + * See {@link ngSanitize.$sanitize $sanitize} docs for examples. + * + * @element ANY + * @param {expression} ngBindHtmlUnsafe {@link guide/expression Expression} to evaluate. + */ +var ngBindHtmlUnsafeDirective = [function() { + return function(scope, element, attr) { + element.addClass('ng-binding').data('$binding', attr.ngBindHtmlUnsafe); + scope.$watch(attr.ngBindHtmlUnsafe, function ngBindHtmlUnsafeWatchAction(value) { + element.html(value || ''); + }); + }; +}]; + +function classDirective(name, selector) { + name = 'ngClass' + name; + return ngDirective(function(scope, element, attr) { + var oldVal = undefined; + + scope.$watch(attr[name], ngClassWatchAction, true); + + attr.$observe('class', function(value) { + var ngClass = scope.$eval(attr[name]); + ngClassWatchAction(ngClass, ngClass); + }); + + + if (name !== 'ngClass') { + scope.$watch('$index', function($index, old$index) { + var mod = $index & 1; + if (mod !== old$index & 1) { + if (mod === selector) { + addClass(scope.$eval(attr[name])); + } else { + removeClass(scope.$eval(attr[name])); + } + } + }); + } + + + function ngClassWatchAction(newVal) { + if (selector === true || scope.$index % 2 === selector) { + if (oldVal && !equals(newVal,oldVal)) { + removeClass(oldVal); + } + addClass(newVal); + } + oldVal = copy(newVal); + } + + + function removeClass(classVal) { + if (isObject(classVal) && !isArray(classVal)) { + classVal = map(classVal, function(v, k) { if (v) return k }); + } + element.removeClass(isArray(classVal) ? classVal.join(' ') : classVal); + } + + + function addClass(classVal) { + if (isObject(classVal) && !isArray(classVal)) { + classVal = map(classVal, function(v, k) { if (v) return k }); + } + if (classVal) { + element.addClass(isArray(classVal) ? classVal.join(' ') : classVal); + } + } + }); +} + +/** + * @ngdoc directive + * @name ng.directive:ngClass + * + * @description + * The `ngClass` allows you to set CSS class on HTML element dynamically by databinding an + * expression that represents all classes to be added. + * + * The directive won't add duplicate classes if a particular class was already set. + * + * When the expression changes, the previously added classes are removed and only then the + * new classes are added. + * + * @element ANY + * @param {expression} ngClass {@link guide/expression Expression} to eval. The result + * of the evaluation can be a string representing space delimited class + * names, an array, or a map of class names to boolean values. + * + * @example + + + + +
    + Sample Text +
    + + .my-class { + color: red; + } + + + it('should check ng-class', function() { + expect(element('.doc-example-live span').prop('className')).not(). + toMatch(/my-class/); + + using('.doc-example-live').element(':button:first').click(); + + expect(element('.doc-example-live span').prop('className')). + toMatch(/my-class/); + + using('.doc-example-live').element(':button:last').click(); + + expect(element('.doc-example-live span').prop('className')).not(). + toMatch(/my-class/); + }); + +
    + */ +var ngClassDirective = classDirective('', true); + +/** + * @ngdoc directive + * @name ng.directive:ngClassOdd + * + * @description + * The `ngClassOdd` and `ngClassEven` directives work exactly as + * {@link ng.directive:ngClass ngClass}, except it works in + * conjunction with `ngRepeat` and takes affect only on odd (even) rows. + * + * This directive can be applied only within a scope of an + * {@link ng.directive:ngRepeat ngRepeat}. + * + * @element ANY + * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result + * of the evaluation can be a string representing space delimited class names or an array. + * + * @example + + +
      +
    1. + + {{name}} + +
    2. +
    +
    + + .odd { + color: red; + } + .even { + color: blue; + } + + + it('should check ng-class-odd and ng-class-even', function() { + expect(element('.doc-example-live li:first span').prop('className')). + toMatch(/odd/); + expect(element('.doc-example-live li:last span').prop('className')). + toMatch(/even/); + }); + +
    + */ +var ngClassOddDirective = classDirective('Odd', 0); + +/** + * @ngdoc directive + * @name ng.directive:ngClassEven + * + * @description + * The `ngClassOdd` and `ngClassEven` directives work exactly as + * {@link ng.directive:ngClass ngClass}, except it works in + * conjunction with `ngRepeat` and takes affect only on odd (even) rows. + * + * This directive can be applied only within a scope of an + * {@link ng.directive:ngRepeat ngRepeat}. + * + * @element ANY + * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The + * result of the evaluation can be a string representing space delimited class names or an array. + * + * @example + + +
      +
    1. + + {{name}}       + +
    2. +
    +
    + + .odd { + color: red; + } + .even { + color: blue; + } + + + it('should check ng-class-odd and ng-class-even', function() { + expect(element('.doc-example-live li:first span').prop('className')). + toMatch(/odd/); + expect(element('.doc-example-live li:last span').prop('className')). + toMatch(/even/); + }); + +
    + */ +var ngClassEvenDirective = classDirective('Even', 1); + +/** + * @ngdoc directive + * @name ng.directive:ngCloak + * + * @description + * The `ngCloak` directive is used to prevent the Angular html template from being briefly + * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this + * directive to avoid the undesirable flicker effect caused by the html template display. + * + * The directive can be applied to the `` element, but typically a fine-grained application is + * preferred in order to benefit from progressive rendering of the browser view. + * + * `ngCloak` works in cooperation with a css rule that is embedded within `angular.js` and + * `angular.min.js` files. Following is the css rule: + * + *
    + * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
    + *   display: none;
    + * }
    + * 
    + * + * When this css rule is loaded by the browser, all html elements (including their children) that + * are tagged with the `ng-cloak` directive are hidden. When Angular comes across this directive + * during the compilation of the template it deletes the `ngCloak` element attribute, which + * makes the compiled element visible. + * + * For the best result, `angular.js` script must be loaded in the head section of the html file; + * alternatively, the css rule (above) must be included in the external stylesheet of the + * application. + * + * Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they + * cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css + * class `ngCloak` in addition to `ngCloak` directive as shown in the example below. + * + * @element ANY + * + * @example + + +
    {{ 'hello' }}
    +
    {{ 'hello IE7' }}
    +
    + + it('should remove the template directive and css class', function() { + expect(element('.doc-example-live #template1').attr('ng-cloak')). + not().toBeDefined(); + expect(element('.doc-example-live #template2').attr('ng-cloak')). + not().toBeDefined(); + }); + +
    + * + */ +var ngCloakDirective = ngDirective({ + compile: function(element, attr) { + attr.$set('ngCloak', undefined); + element.removeClass('ng-cloak'); + } +}); + +/** + * @ngdoc directive + * @name ng.directive:ngController + * + * @description + * The `ngController` directive assigns behavior to a scope. This is a key aspect of how angular + * supports the principles behind the Model-View-Controller design pattern. + * + * MVC components in angular: + * + * * Model — The Model is data in scope properties; scopes are attached to the DOM. + * * View — The template (HTML with data bindings) is rendered into the View. + * * Controller — The `ngController` directive specifies a Controller class; the class has + * methods that typically express the business logic behind the application. + * + * Note that an alternative way to define controllers is via the {@link ng.$route $route} service. + * + * @element ANY + * @scope + * @param {expression} ngController Name of a globally accessible constructor function or an + * {@link guide/expression expression} that on the current scope evaluates to a + * constructor function. The controller instance can further be published into the scope + * by adding `as localName` the controller name attribute. + * + * @example + * Here is a simple form for editing user contact information. Adding, removing, clearing, and + * greeting are methods declared on the controller (see source tab). These methods can + * easily be called from the angular markup. Notice that the scope becomes the `this` for the + * controller's instance. This allows for easy access to the view data from the controller. Also + * notice that any changes to the data are automatically reflected in the View without the need + * for a manual update. The example is included in two different declaration styles based on + * your style preferences. + + + +
    + Name: + [ greet ]
    + Contact: +
      +
    • + + + [ clear + | X ] +
    • +
    • [ add ]
    • +
    +
    +
    + + it('should check controller', function() { + expect(element('.doc-example-live div>:input').val()).toBe('John Smith'); + expect(element('.doc-example-live li:nth-child(1) input').val()) + .toBe('408 555 1212'); + expect(element('.doc-example-live li:nth-child(2) input').val()) + .toBe('john.smith@example.org'); + + element('.doc-example-live li:first a:contains("clear")').click(); + expect(element('.doc-example-live li:first input').val()).toBe(''); + + element('.doc-example-live li:last a:contains("add")').click(); + expect(element('.doc-example-live li:nth-child(3) input').val()) + .toBe('yourname@example.org'); + }); + +
    + + + + + + +
    + Name: + [ greet ]
    + Contact: +
      +
    • + + + [ clear + | X ] +
    • +
    • [ add ]
    • +
    +
    +
    + + it('should check controller', function() { + expect(element('.doc-example-live div>:input').val()).toBe('John Smith'); + expect(element('.doc-example-live li:nth-child(1) input').val()) + .toBe('408 555 1212'); + expect(element('.doc-example-live li:nth-child(2) input').val()) + .toBe('john.smith@example.org'); + + element('.doc-example-live li:first a:contains("clear")').click(); + expect(element('.doc-example-live li:first input').val()).toBe(''); + + element('.doc-example-live li:last a:contains("add")').click(); + expect(element('.doc-example-live li:nth-child(3) input').val()) + .toBe('yourname@example.org'); + }); + +
    + + */ +var ngControllerDirective = [function() { + return { + scope: true, + controller: '@' + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngCsp + * @priority 1000 + * + * @element html + * @description + * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support. + * + * This is necessary when developing things like Google Chrome Extensions. + * + * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things). + * For us to be compatible, we just need to implement the "getterFn" in $parse without violating + * any of these restrictions. + * + * AngularJS uses `Function(string)` generated functions as a speed optimization. By applying `ngCsp` + * it is be possible to opt into the CSP compatible mode. When this mode is on AngularJS will + * evaluate all expressions up to 30% slower than in non-CSP mode, but no security violations will + * be raised. + * + * In order to use this feature put `ngCsp` directive on the root element of the application. + * + * @example + * This example shows how to apply the `ngCsp` directive to the `html` tag. +
    +     
    +     
    +     ...
    +     ...
    +     
    +   
    + */ + +var ngCspDirective = ['$sniffer', function($sniffer) { + return { + priority: 1000, + compile: function() { + $sniffer.csp = true; + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngClick + * + * @description + * The ngClick allows you to specify custom behavior when + * element is clicked. + * + * @element ANY + * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon + * click. (Event object is available as `$event`) + * + * @example + + + + count: {{count}} + + + it('should check ng-click', function() { + expect(binding('count')).toBe('0'); + element('.doc-example-live :button').click(); + expect(binding('count')).toBe('1'); + }); + + + */ +/* + * A directive that allows creation of custom onclick handlers that are defined as angular + * expressions and are compiled and executed within the current scope. + * + * Events that are handled via these handler are always configured not to propagate further. + */ +var ngEventDirectives = {}; +forEach( + 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress'.split(' '), + function(name) { + var directiveName = directiveNormalize('ng-' + name); + ngEventDirectives[directiveName] = ['$parse', function($parse) { + return function(scope, element, attr) { + var fn = $parse(attr[directiveName]); + element.bind(lowercase(name), function(event) { + scope.$apply(function() { + fn(scope, {$event:event}); + }); + }); + }; + }]; + } +); + +/** + * @ngdoc directive + * @name ng.directive:ngDblclick + * + * @description + * The `ngDblclick` directive allows you to specify custom behavior on dblclick event. + * + * @element ANY + * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon + * dblclick. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMousedown + * + * @description + * The ngMousedown directive allows you to specify custom behavior on mousedown event. + * + * @element ANY + * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon + * mousedown. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMouseup + * + * @description + * Specify custom behavior on mouseup event. + * + * @element ANY + * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon + * mouseup. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + +/** + * @ngdoc directive + * @name ng.directive:ngMouseover + * + * @description + * Specify custom behavior on mouseover event. + * + * @element ANY + * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon + * mouseover. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMouseenter + * + * @description + * Specify custom behavior on mouseenter event. + * + * @element ANY + * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon + * mouseenter. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMouseleave + * + * @description + * Specify custom behavior on mouseleave event. + * + * @element ANY + * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon + * mouseleave. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngMousemove + * + * @description + * Specify custom behavior on mousemove event. + * + * @element ANY + * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon + * mousemove. (Event object is available as `$event`) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngKeydown + * + * @description + * Specify custom behavior on keydown event. + * + * @element ANY + * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon + * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngKeyup + * + * @description + * Specify custom behavior on keyup event. + * + * @element ANY + * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon + * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngKeypress + * + * @description + * Specify custom behavior on keypress event. + * + * @element ANY + * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon + * keypress. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.) + * + * @example + * See {@link ng.directive:ngClick ngClick} + */ + + +/** + * @ngdoc directive + * @name ng.directive:ngSubmit + * + * @description + * Enables binding angular expressions to onsubmit events. + * + * Additionally it prevents the default action (which for form means sending the request to the + * server and reloading the current page). + * + * @element form + * @param {expression} ngSubmit {@link guide/expression Expression} to eval. + * + * @example + + + +
    + Enter text and hit enter: + + +
    list={{list}}
    +
    +
    + + it('should check ng-submit', function() { + expect(binding('list')).toBe('[]'); + element('.doc-example-live #submit').click(); + expect(binding('list')).toBe('["hello"]'); + expect(input('text').val()).toBe(''); + }); + it('should ignore empty strings', function() { + expect(binding('list')).toBe('[]'); + element('.doc-example-live #submit').click(); + element('.doc-example-live #submit').click(); + expect(binding('list')).toBe('["hello"]'); + }); + +
    + */ +var ngSubmitDirective = ngDirective(function(scope, element, attrs) { + element.bind('submit', function() { + scope.$apply(attrs.ngSubmit); + }); +}); + +/** + * @ngdoc directive + * @name ng.directive:ngIf + * @restrict A + * + * @description + * The `ngIf` directive removes and recreates a portion of the DOM tree (HTML) + * conditionally based on **"falsy"** and **"truthy"** values, respectively, evaluated within + * an {expression}. In other words, if the expression assigned to **ngIf evaluates to a false + * value** then **the element is removed from the DOM** and **if true** then **a clone of the + * element is reinserted into the DOM**. + * + * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the + * element in the DOM rather than changing its visibility via the `display` css property. A common + * case when this difference is significant is when using css selectors that rely on an element's + * position within the DOM (HTML), such as the `:first-child` or `:last-child` pseudo-classes. + * + * Note that **when an element is removed using ngIf its scope is destroyed** and **a new scope + * is created when the element is restored**. The scope created within `ngIf` inherits from + * its parent scope using + * {@link https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance prototypal inheritance}. + * An important implication of this is if `ngModel` is used within `ngIf` to bind to + * a javascript primitive defined in the parent scope. In this case any modifications made to the + * variable within the child scope will override (hide) the value in the parent scope. + * + * Also, `ngIf` recreates elements using their compiled state. An example scenario of this behavior + * is if an element's class attribute is directly modified after it's compiled, using something like + * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element + * the added class will be lost because the original compiled state is used to regenerate the element. + * + * Additionally, you can provide animations via the ngAnimate attribute to animate the **enter** + * and **leave** effects. + * + * @animations + * enter - happens just after the ngIf contents change and a new DOM element is created and injected into the ngIf container + * leave - happens just before the ngIf contents are removed from the DOM + * + * @element ANY + * @scope + * @param {expression} ngIf If the {@link guide/expression expression} is falsy then + * the element is removed from the DOM tree (HTML). + * + * @example + + + Click me:
    + Show when checked: + + I'm removed when the checkbox is unchecked. + +
    + + .example-leave, .example-enter { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + } + + .example-enter { + opacity:0; + } + .example-enter.example-enter-active { + opacity:1; + } + + .example-leave { + opacity:1; + } + .example-leave.example-leave-active { + opacity:0; + } + +
    + */ +var ngIfDirective = ['$animator', function($animator) { + return { + transclude: 'element', + priority: 1000, + terminal: true, + restrict: 'A', + compile: function (element, attr, transclude) { + return function ($scope, $element, $attr) { + var animate = $animator($scope, $attr); + var childElement, childScope; + $scope.$watch($attr.ngIf, function ngIfWatchAction(value) { + if (childElement) { + animate.leave(childElement); + childElement = undefined; + } + if (childScope) { + childScope.$destroy(); + childScope = undefined; + } + if (toBoolean(value)) { + childScope = $scope.$new(); + transclude(childScope, function (clone) { + childElement = clone; + animate.enter(clone, $element.parent(), $element); + }); + } + }); + } + } + } +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngInclude + * @restrict ECA + * + * @description + * Fetches, compiles and includes an external HTML fragment. + * + * Keep in mind that Same Origin Policy applies to included resources + * (e.g. ngInclude won't work for cross-domain requests on all browsers and for + * file:// access on some browsers). + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter** + * and **leave** effects. + * + * @animations + * enter - happens just after the ngInclude contents change and a new DOM element is created and injected into the ngInclude container + * leave - happens just after the ngInclude contents change and just before the former contents are removed from the DOM + * + * @scope + * + * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant, + * make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`. + * @param {string=} onload Expression to evaluate when a new partial is loaded. + * + * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll + * $anchorScroll} to scroll the viewport after the content is loaded. + * + * - If the attribute is not set, disable scrolling. + * - If the attribute is set without value, enable scrolling. + * - Otherwise enable scrolling only if the expression evaluates to truthy value. + * + * @example + + +
    + + url of the template: {{template.url}} +
    +
    +
    +
    + + function Ctrl($scope) { + $scope.templates = + [ { name: 'template1.html', url: 'template1.html'} + , { name: 'template2.html', url: 'template2.html'} ]; + $scope.template = $scope.templates[0]; + } + + +
    Content of template1.html
    +
    + +
    Content of template2.html
    +
    + + .example-leave, + .example-enter { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + } + + .example-animate-container > * { + display:block; + padding:10px; + } + + .example-enter { + top:-50px; + } + .example-enter.example-enter-active { + top:0; + } + + .example-leave { + top:0; + } + .example-leave.example-leave-active { + top:50px; + } + + + it('should load template1.html', function() { + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template1.html/); + }); + it('should load template2.html', function() { + select('template').option('1'); + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template2.html/); + }); + it('should change to blank', function() { + select('template').option(''); + expect(element('.doc-example-live [ng-include]').text()).toEqual(''); + }); + +
    + */ + + +/** + * @ngdoc event + * @name ng.directive:ngInclude#$includeContentRequested + * @eventOf ng.directive:ngInclude + * @eventType emit on the scope ngInclude was declared in + * @description + * Emitted every time the ngInclude content is requested. + */ + + +/** + * @ngdoc event + * @name ng.directive:ngInclude#$includeContentLoaded + * @eventOf ng.directive:ngInclude + * @eventType emit on the current ngInclude scope + * @description + * Emitted every time the ngInclude content is reloaded. + */ +var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile', '$animator', + function($http, $templateCache, $anchorScroll, $compile, $animator) { + return { + restrict: 'ECA', + terminal: true, + compile: function(element, attr) { + var srcExp = attr.ngInclude || attr.src, + onloadExp = attr.onload || '', + autoScrollExp = attr.autoscroll; + + return function(scope, element, attr) { + var animate = $animator(scope, attr); + var changeCounter = 0, + childScope; + + var clearContent = function() { + if (childScope) { + childScope.$destroy(); + childScope = null; + } + animate.leave(element.contents(), element); + }; + + scope.$watch(srcExp, function ngIncludeWatchAction(src) { + var thisChangeId = ++changeCounter; + + if (src) { + $http.get(src, {cache: $templateCache}).success(function(response) { + if (thisChangeId !== changeCounter) return; + + if (childScope) childScope.$destroy(); + childScope = scope.$new(); + animate.leave(element.contents(), element); + + var contents = jqLite('
    ').html(response).contents(); + + animate.enter(contents, element); + $compile(contents)(childScope); + + if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) { + $anchorScroll(); + } + + childScope.$emit('$includeContentLoaded'); + scope.$eval(onloadExp); + }).error(function() { + if (thisChangeId === changeCounter) clearContent(); + }); + scope.$emit('$includeContentRequested'); + } else { + clearContent(); + } + }); + }; + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngInit + * + * @description + * The `ngInit` directive specifies initialization tasks to be executed + * before the template enters execution mode during bootstrap. + * + * @element ANY + * @param {expression} ngInit {@link guide/expression Expression} to eval. + * + * @example + + +
    + {{greeting}} {{person}}! +
    +
    + + it('should check greeting', function() { + expect(binding('greeting')).toBe('Hello'); + expect(binding('person')).toBe('World'); + }); + +
    + */ +var ngInitDirective = ngDirective({ + compile: function() { + return { + pre: function(scope, element, attrs) { + scope.$eval(attrs.ngInit); + } + } + } +}); + +/** + * @ngdoc directive + * @name ng.directive:ngNonBindable + * @priority 1000 + * + * @description + * Sometimes it is necessary to write code which looks like bindings but which should be left alone + * by angular. Use `ngNonBindable` to make angular ignore a chunk of HTML. + * + * @element ANY + * + * @example + * In this example there are two location where a simple binding (`{{}}`) is present, but the one + * wrapped in `ngNonBindable` is left alone. + * + * @example + + +
    Normal: {{1 + 2}}
    +
    Ignored: {{1 + 2}}
    +
    + + it('should check ng-non-bindable', function() { + expect(using('.doc-example-live').binding('1 + 2')).toBe('3'); + expect(using('.doc-example-live').element('div:last').text()). + toMatch(/1 \+ 2/); + }); + +
    + */ +var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 }); + +/** + * @ngdoc directive + * @name ng.directive:ngPluralize + * @restrict EA + * + * @description + * # Overview + * `ngPluralize` is a directive that displays messages according to en-US localization rules. + * These rules are bundled with angular.js and the rules can be overridden + * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive + * by specifying the mappings between + * {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html + * plural categories} and the strings to be displayed. + * + * # Plural categories and explicit number rules + * There are two + * {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html + * plural categories} in Angular's default en-US locale: "one" and "other". + * + * While a plural category may match many numbers (for example, in en-US locale, "other" can match + * any number that is not 1), an explicit number rule can only match one number. For example, the + * explicit number rule for "3" matches the number 3. You will see the use of plural categories + * and explicit number rules throughout later parts of this documentation. + * + * # Configuring ngPluralize + * You configure ngPluralize by providing 2 attributes: `count` and `when`. + * You can also provide an optional attribute, `offset`. + * + * The value of the `count` attribute can be either a string or an {@link guide/expression + * Angular expression}; these are evaluated on the current scope for its bound value. + * + * The `when` attribute specifies the mappings between plural categories and the actual + * string to be displayed. The value of the attribute should be a JSON object so that Angular + * can interpret it correctly. + * + * The following example shows how to configure ngPluralize: + * + *
    + * 
    + * 
    + *
    + * + * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not + * specify this rule, 0 would be matched to the "other" category and "0 people are viewing" + * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for + * other numbers, for example 12, so that instead of showing "12 people are viewing", you can + * show "a dozen people are viewing". + * + * You can use a set of closed braces(`{}`) as a placeholder for the number that you want substituted + * into pluralized strings. In the previous example, Angular will replace `{}` with + * `{{personCount}}`. The closed braces `{}` is a placeholder + * for {{numberExpression}}. + * + * # Configuring ngPluralize with offset + * The `offset` attribute allows further customization of pluralized text, which can result in + * a better user experience. For example, instead of the message "4 people are viewing this document", + * you might display "John, Kate and 2 others are viewing this document". + * The offset attribute allows you to offset a number by any desired value. + * Let's take a look at an example: + * + *
    + * 
    + * 
    + * 
    + * + * Notice that we are still using two plural categories(one, other), but we added + * three explicit number rules 0, 1 and 2. + * When one person, perhaps John, views the document, "John is viewing" will be shown. + * When three people view the document, no explicit number rule is found, so + * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category. + * In this case, plural category 'one' is matched and "John, Marry and one other person are viewing" + * is shown. + * + * Note that when you specify offsets, you must provide explicit number rules for + * numbers from 0 up to and including the offset. If you use an offset of 3, for example, + * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for + * plural categories "one" and "other". + * + * @param {string|expression} count The variable to be bounded to. + * @param {string} when The mapping between plural category to its corresponding strings. + * @param {number=} offset Offset to deduct from the total number. + * + * @example + + + +
    + Person 1:
    + Person 2:
    + Number of People:
    + + + Without Offset: + +
    + + + With Offset(2): + + +
    +
    + + it('should show correct pluralized string', function() { + expect(element('.doc-example-live ng-pluralize:first').text()). + toBe('1 person is viewing.'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Igor is viewing.'); + + using('.doc-example-live').input('personCount').enter('0'); + expect(element('.doc-example-live ng-pluralize:first').text()). + toBe('Nobody is viewing.'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Nobody is viewing.'); + + using('.doc-example-live').input('personCount').enter('2'); + expect(element('.doc-example-live ng-pluralize:first').text()). + toBe('2 people are viewing.'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Igor and Misko are viewing.'); + + using('.doc-example-live').input('personCount').enter('3'); + expect(element('.doc-example-live ng-pluralize:first').text()). + toBe('3 people are viewing.'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Igor, Misko and one other person are viewing.'); + + using('.doc-example-live').input('personCount').enter('4'); + expect(element('.doc-example-live ng-pluralize:first').text()). + toBe('4 people are viewing.'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Igor, Misko and 2 other people are viewing.'); + }); + + it('should show data-binded names', function() { + using('.doc-example-live').input('personCount').enter('4'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Igor, Misko and 2 other people are viewing.'); + + using('.doc-example-live').input('person1').enter('Di'); + using('.doc-example-live').input('person2').enter('Vojta'); + expect(element('.doc-example-live ng-pluralize:last').text()). + toBe('Di, Vojta and 2 other people are viewing.'); + }); + +
    + */ +var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) { + var BRACE = /{}/g; + return { + restrict: 'EA', + link: function(scope, element, attr) { + var numberExp = attr.count, + whenExp = element.attr(attr.$attr.when), // this is because we have {{}} in attrs + offset = attr.offset || 0, + whens = scope.$eval(whenExp), + whensExpFns = {}, + startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(); + + forEach(whens, function(expression, key) { + whensExpFns[key] = + $interpolate(expression.replace(BRACE, startSymbol + numberExp + '-' + + offset + endSymbol)); + }); + + scope.$watch(function ngPluralizeWatch() { + var value = parseFloat(scope.$eval(numberExp)); + + if (!isNaN(value)) { + //if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise, + //check it against pluralization rules in $locale service + if (!(value in whens)) value = $locale.pluralCat(value - offset); + return whensExpFns[value](scope, element, true); + } else { + return ''; + } + }, function ngPluralizeWatchAction(newVal) { + element.text(newVal); + }); + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngRepeat + * + * @description + * The `ngRepeat` directive instantiates a template once per item from a collection. Each template + * instance gets its own scope, where the given loop variable is set to the current collection item, + * and `$index` is set to the item index or key. + * + * Special properties are exposed on the local scope of each template instance, including: + * + * * `$index` – `{number}` – iterator offset of the repeated element (0..length-1) + * * `$first` – `{boolean}` – true if the repeated element is first in the iterator. + * * `$middle` – `{boolean}` – true if the repeated element is between the first and last in the iterator. + * * `$last` – `{boolean}` – true if the repeated element is last in the iterator. + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter**, + * **leave** and **move** effects. + * + * @animations + * enter - when a new item is added to the list or when an item is revealed after a filter + * leave - when an item is removed from the list or when an item is filtered out + * move - when an adjacent item is filtered out causing a reorder or when the item contents are reordered + * + * @element ANY + * @scope + * @priority 1000 + * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These + * formats are currently supported: + * + * * `variable in expression` – where variable is the user defined loop variable and `expression` + * is a scope expression giving the collection to enumerate. + * + * For example: `track in cd.tracks`. + * + * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers, + * and `expression` is the scope expression giving the collection to enumerate. + * + * For example: `(name, age) in {'adam':10, 'amalie':12}`. + * + * * `variable in expression track by tracking_expression` – You can also provide an optional tracking function + * which can be used to associate the objects in the collection with the DOM elements. If no tractking function + * is specified the ng-repeat associates elements by identity in the collection. It is an error to have + * more then one tractking function to resolve to the same key. (This would mean that two distinct objects are + * mapped to the same DOM element, which is not possible.) + * + * For example: `item in items` is equivalent to `item in items track by $id(item)'. This implies that the DOM elements + * will be associated by item identity in the array. + * + * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique + * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements + * with the corresponding item in the array by identity. Moving the same object in array would move the DOM + * element in the same way ian the DOM. + * + * For example: `item in items track by item.id` Is a typical pattern when the items come from the database. In this + * case the object identity does not matter. Two objects are considered equivalent as long as their `id` + * property is same. + * + * @example + * This example initializes the scope to a list of names and + * then uses `ngRepeat` to display every person: + + +
    + I have {{friends.length}} friends. They are: + +
      +
    • + [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old. +
    • +
    +
    +
    + + .example-repeat-enter, + .example-repeat-leave, + .example-repeat-move { + -webkit-transition:all linear 0.5s; + -moz-transition:all linear 0.5s; + -ms-transition:all linear 0.5s; + -o-transition:all linear 0.5s; + transition:all linear 0.5s; + } + + .example-repeat-enter { + line-height:0; + opacity:0; + } + .example-repeat-enter.example-repeat-enter-active { + line-height:20px; + opacity:1; + } + + .example-repeat-leave { + opacity:1; + line-height:20px; + } + .example-repeat-leave.example-repeat-leave-active { + opacity:0; + line-height:0; + } + + .example-repeat-move { } + .example-repeat-move.example-repeat-move-active { } + + + it('should render initial data set', function() { + var r = using('.doc-example-live').repeater('ul li'); + expect(r.count()).toBe(10); + expect(r.row(0)).toEqual(["1","John","25"]); + expect(r.row(1)).toEqual(["2","Jessie","30"]); + expect(r.row(9)).toEqual(["10","Samantha","60"]); + expect(binding('friends.length')).toBe("10"); + }); + + it('should update repeater when filter predicate changes', function() { + var r = using('.doc-example-live').repeater('ul li'); + expect(r.count()).toBe(10); + + input('q').enter('ma'); + + expect(r.count()).toBe(2); + expect(r.row(0)).toEqual(["1","Mary","28"]); + expect(r.row(1)).toEqual(["2","Samantha","60"]); + }); + +
    + */ +var ngRepeatDirective = ['$parse', '$animator', function($parse, $animator) { + var NG_REMOVED = '$$NG_REMOVED'; + return { + transclude: 'element', + priority: 1000, + terminal: true, + compile: function(element, attr, linker) { + return function($scope, $element, $attr){ + var animate = $animator($scope, $attr); + var expression = $attr.ngRepeat; + var match = expression.match(/^\s*(.+)\s+in\s+(.*?)\s*(\s+track\s+by\s+(.+)\s*)?$/), + trackByExp, trackByExpGetter, trackByIdFn, lhs, rhs, valueIdentifier, keyIdentifier, + hashFnLocals = {$id: hashKey}; + + if (!match) { + throw Error("Expected ngRepeat in form of '_item_ in _collection_[ track by _id_]' but got '" + + expression + "'."); + } + + lhs = match[1]; + rhs = match[2]; + trackByExp = match[4]; + + if (trackByExp) { + trackByExpGetter = $parse(trackByExp); + trackByIdFn = function(key, value, index) { + // assign key, value, and $index to the locals so that they can be used in hash functions + if (keyIdentifier) hashFnLocals[keyIdentifier] = key; + hashFnLocals[valueIdentifier] = value; + hashFnLocals.$index = index; + return trackByExpGetter($scope, hashFnLocals); + }; + } else { + trackByIdFn = function(key, value) { + return hashKey(value); + } + } + + match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); + if (!match) { + throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" + + lhs + "'."); + } + valueIdentifier = match[3] || match[1]; + keyIdentifier = match[2]; + + // Store a list of elements from previous run. This is a hash where key is the item from the + // iterator, and the value is objects with following properties. + // - scope: bound scope + // - element: previous element. + // - index: position + var lastBlockMap = {}; + + //watch props + $scope.$watchCollection(rhs, function ngRepeatAction(collection){ + var index, length, + cursor = $element, // current position of the node + nextCursor, + // Same as lastBlockMap but it has the current state. It will become the + // lastBlockMap on the next iteration. + nextBlockMap = {}, + arrayLength, + childScope, + key, value, // key/value of iteration + trackById, + collectionKeys, + block, // last object information {scope, element, id} + nextBlockOrder = []; + + + if (isArrayLike(collection)) { + collectionKeys = collection; + } else { + // if object, extract keys, sort them and use to determine order of iteration over obj props + collectionKeys = []; + for (key in collection) { + if (collection.hasOwnProperty(key) && key.charAt(0) != '$') { + collectionKeys.push(key); + } + } + collectionKeys.sort(); + } + + arrayLength = collectionKeys.length; + + // locate existing items + length = nextBlockOrder.length = collectionKeys.length; + for(index = 0; index < length; index++) { + key = (collection === collectionKeys) ? index : collectionKeys[index]; + value = collection[key]; + trackById = trackByIdFn(key, value, index); + if(lastBlockMap.hasOwnProperty(trackById)) { + block = lastBlockMap[trackById] + delete lastBlockMap[trackById]; + nextBlockMap[trackById] = block; + nextBlockOrder[index] = block; + } else if (nextBlockMap.hasOwnProperty(trackById)) { + // restore lastBlockMap + forEach(nextBlockOrder, function(block) { + if (block && block.element) lastBlockMap[block.id] = block; + }); + // This is a duplicate and we need to throw an error + throw new Error('Duplicates in a repeater are not allowed. Repeater: ' + expression + + ' key: ' + trackById); + } else { + // new never before seen block + nextBlockOrder[index] = { id: trackById }; + nextBlockMap[trackById] = false; + } + } + + // remove existing items + for (key in lastBlockMap) { + if (lastBlockMap.hasOwnProperty(key)) { + block = lastBlockMap[key]; + animate.leave(block.element); + block.element[0][NG_REMOVED] = true; + block.scope.$destroy(); + } + } + + // we are not using forEach for perf reasons (trying to avoid #call) + for (index = 0, length = collectionKeys.length; index < length; index++) { + key = (collection === collectionKeys) ? index : collectionKeys[index]; + value = collection[key]; + block = nextBlockOrder[index]; + + if (block.element) { + // if we have already seen this object, then we need to reuse the + // associated scope/element + childScope = block.scope; + + nextCursor = cursor[0]; + do { + nextCursor = nextCursor.nextSibling; + } while(nextCursor && nextCursor[NG_REMOVED]); + + if (block.element[0] == nextCursor) { + // do nothing + cursor = block.element; + } else { + // existing item which got moved + animate.move(block.element, null, cursor); + cursor = block.element; + } + } else { + // new item which we don't know about + childScope = $scope.$new(); + } + + childScope[valueIdentifier] = value; + if (keyIdentifier) childScope[keyIdentifier] = key; + childScope.$index = index; + childScope.$first = (index === 0); + childScope.$last = (index === (arrayLength - 1)); + childScope.$middle = !(childScope.$first || childScope.$last); + + if (!block.element) { + linker(childScope, function(clone) { + animate.enter(clone, null, cursor); + cursor = clone; + block.scope = childScope; + block.element = clone; + nextBlockMap[block.id] = block; + }); + } + } + lastBlockMap = nextBlockMap; + }); + }; + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngShow + * + * @description + * The `ngShow` and `ngHide` directives show or hide a portion of the DOM tree (HTML) + * conditionally based on **"truthy"** values evaluated within an {expression}. In other + * words, if the expression assigned to **ngShow evaluates to a true value** then **the element is set to visible** + * (via `display:block` in css) and **if false** then **the element is set to hidden** (so display:none). + * With ngHide this is the reverse whereas true values cause the element itself to become + * hidden. + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **show** + * and **hide** effects. + * + * @animations + * show - happens after the ngShow expression evaluates to a truthy value and the contents are set to visible + * hide - happens before the ngShow expression evaluates to a non truthy value and just before the contents are set to hidden + * + * @element ANY + * @param {expression} ngShow If the {@link guide/expression expression} is truthy + * then the element is shown or hidden respectively. + * + * @example + + + Click me:
    +
    + Show: + + I show up when your checkbox is checked. + +
    +
    + Hide: + + I hide when your checkbox is checked. + +
    +
    + + .example-show, .example-hide { + -webkit-transition:all linear 0.5s; + -moz-transition:all linear 0.5s; + -ms-transition:all linear 0.5s; + -o-transition:all linear 0.5s; + transition:all linear 0.5s; + } + + .example-show { + line-height:0; + opacity:0; + padding:0 10px; + } + .example-show-active.example-show-active { + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + + .example-hide { + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + .example-hide-active.example-hide-active { + line-height:0; + opacity:0; + padding:0 10px; + } + + .check-element { + padding:10px; + border:1px solid black; + background:white; + } + + + it('should check ng-show / ng-hide', function() { + expect(element('.doc-example-live span:first:hidden').count()).toEqual(1); + expect(element('.doc-example-live span:last:visible').count()).toEqual(1); + + input('checked').check(); + + expect(element('.doc-example-live span:first:visible').count()).toEqual(1); + expect(element('.doc-example-live span:last:hidden').count()).toEqual(1); + }); + +
    + */ +//TODO(misko): refactor to remove element from the DOM +var ngShowDirective = ['$animator', function($animator) { + return function(scope, element, attr) { + var animate = $animator(scope, attr); + scope.$watch(attr.ngShow, function ngShowWatchAction(value){ + animate[toBoolean(value) ? 'show' : 'hide'](element); + }); + }; +}]; + + +/** + * @ngdoc directive + * @name ng.directive:ngHide + * + * @description + * The `ngShow` and `ngHide` directives show or hide a portion of the DOM tree (HTML) + * conditionally based on **"truthy"** values evaluated within an {expression}. In other + * words, if the expression assigned to **ngShow evaluates to a true value** then **the element is set to visible** + * (via `display:block` in css) and **if false** then **the element is set to hidden** (so display:none). + * With ngHide this is the reverse whereas true values cause the element itself to become + * hidden. + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **show** + * and **hide** effects. + * + * @animations + * show - happens after the ngHide expression evaluates to a non truthy value and the contents are set to visible + * hide - happens after the ngHide expression evaluates to a truthy value and just before the contents are set to hidden + * + * @element ANY + * @param {expression} ngHide If the {@link guide/expression expression} is truthy then + * the element is shown or hidden respectively. + * + * @example + + + Click me:
    +
    + Show: + + I show up when your checkbox is checked. + +
    +
    + Hide: + + I hide when your checkbox is checked. + +
    +
    + + .example-show, .example-hide { + -webkit-transition:all linear 0.5s; + -moz-transition:all linear 0.5s; + -ms-transition:all linear 0.5s; + -o-transition:all linear 0.5s; + transition:all linear 0.5s; + } + + .example-show { + line-height:0; + opacity:0; + padding:0 10px; + } + .example-show.example-show-active { + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + + .example-hide { + line-height:20px; + opacity:1; + padding:10px; + border:1px solid black; + background:white; + } + .example-hide.example-hide-active { + line-height:0; + opacity:0; + padding:0 10px; + } + + .check-element { + padding:10px; + border:1px solid black; + background:white; + } + + + it('should check ng-show / ng-hide', function() { + expect(element('.doc-example-live .check-element:first:hidden').count()).toEqual(1); + expect(element('.doc-example-live .check-element:last:visible').count()).toEqual(1); + + input('checked').check(); + + expect(element('.doc-example-live .check-element:first:visible').count()).toEqual(1); + expect(element('.doc-example-live .check-element:last:hidden').count()).toEqual(1); + }); + +
    + */ +//TODO(misko): refactor to remove element from the DOM +var ngHideDirective = ['$animator', function($animator) { + return function(scope, element, attr) { + var animate = $animator(scope, attr); + scope.$watch(attr.ngHide, function ngHideWatchAction(value){ + animate[toBoolean(value) ? 'hide' : 'show'](element); + }); + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:ngStyle + * + * @description + * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally. + * + * @element ANY + * @param {expression} ngStyle {@link guide/expression Expression} which evals to an + * object whose keys are CSS style names and values are corresponding values for those CSS + * keys. + * + * @example + + + + +
    + Sample Text +
    myStyle={{myStyle}}
    +
    + + span { + color: black; + } + + + it('should check ng-style', function() { + expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); + element('.doc-example-live :button[value=set]').click(); + expect(element('.doc-example-live span').css('color')).toBe('rgb(255, 0, 0)'); + element('.doc-example-live :button[value=clear]').click(); + expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); + }); + +
    + */ +var ngStyleDirective = ngDirective(function(scope, element, attr) { + scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) { + if (oldStyles && (newStyles !== oldStyles)) { + forEach(oldStyles, function(val, style) { element.css(style, '');}); + } + if (newStyles) element.css(newStyles); + }, true); +}); + +/** + * @ngdoc directive + * @name ng.directive:ngSwitch + * @restrict EA + * + * @description + * The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression. + * Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location + * as specified in the template. + * + * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it + * from the template cache), ngSwitch simply choses one of the nested elements and makes it visible based on which element + * matches the value obtained from the evaluated expression. In other words, you define a container element + * (where you place the directive), place an expression on the **on="..." attribute** + * (or the **ng-switch="..." attribute**), define any inner elements inside of the directive and place + * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on + * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default + * attribute is displayed. + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter** + * and **leave** effects. + * + * @animations + * enter - happens after the ngSwtich contents change and the matched child element is placed inside the container + * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM + * + * @usage + * + * ... + * ... + * ... + * + * + * @scope + * @param {*} ngSwitch|on expression to match against ng-switch-when. + * @paramDescription + * On child elements add: + * + * * `ngSwitchWhen`: the case statement to match against. If match then this + * case will be displayed. If the same match appears multiple times, all the + * elements will be displayed. + * * `ngSwitchDefault`: the default case when no other case match. If there + * are multiple default cases, all of them will be displayed when no other + * case match. + * + * + * @example + + +
    + + selection={{selection}} +
    +
    +
    Settings Div
    +
    Home Span
    +
    default
    +
    +
    +
    + + function Ctrl($scope) { + $scope.items = ['settings', 'home', 'other']; + $scope.selection = $scope.items[0]; + } + + + .example-leave, .example-enter { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + } + + .example-animate-container > * { + display:block; + padding:10px; + } + + .example-enter { + top:-50px; + } + .example-enter.example-enter-active { + top:0; + } + + .example-leave { + top:0; + } + .example-leave.example-leave-active { + top:50px; + } + + + it('should start in settings', function() { + expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Settings Div/); + }); + it('should change to home', function() { + select('selection').option('home'); + expect(element('.doc-example-live [ng-switch]').text()).toMatch(/Home Span/); + }); + it('should select default', function() { + select('selection').option('other'); + expect(element('.doc-example-live [ng-switch]').text()).toMatch(/default/); + }); + +
    + */ +var ngSwitchDirective = ['$animator', function($animator) { + return { + restrict: 'EA', + require: 'ngSwitch', + + // asks for $scope to fool the BC controller module + controller: ['$scope', function ngSwitchController() { + this.cases = {}; + }], + link: function(scope, element, attr, ngSwitchController) { + var animate = $animator(scope, attr); + var watchExpr = attr.ngSwitch || attr.on, + selectedTranscludes, + selectedElements, + selectedScopes = []; + + scope.$watch(watchExpr, function ngSwitchWatchAction(value) { + for (var i= 0, ii=selectedScopes.length; i + + +
    +
    +
    + {{text}} +
    +
    + + it('should have transcluded', function() { + input('title').enter('TITLE'); + input('text').enter('TEXT'); + expect(binding('title')).toEqual('TITLE'); + expect(binding('text')).toEqual('TEXT'); + }); + + + * + */ +var ngTranscludeDirective = ngDirective({ + controller: ['$transclude', '$element', function($transclude, $element) { + $transclude(function(clone) { + $element.append(clone); + }); + }] +}); + +/** + * @ngdoc directive + * @name ng.directive:ngView + * @restrict ECA + * + * @description + * # Overview + * `ngView` is a directive that complements the {@link ng.$route $route} service by + * including the rendered template of the current route into the main layout (`index.html`) file. + * Every time the current route changes, the included view changes with it according to the + * configuration of the `$route` service. + * + * Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter** + * and **leave** effects. + * + * @animations + * enter - happens just after the ngView contents are changed (when the new view DOM element is inserted into the DOM) + * leave - happens just after the current ngView contents change and just before the former contents are removed from the DOM + * + * @scope + * @example + + +
    + Choose: + Moby | + Moby: Ch1 | + Gatsby | + Gatsby: Ch4 | + Scarlet Letter
    + +
    +
    + +
    $location.path() = {{main.$location.path()}}
    +
    $route.current.templateUrl = {{main.$route.current.templateUrl}}
    +
    $route.current.params = {{main.$route.current.params}}
    +
    $route.current.scope.name = {{main.$route.current.scope.name}}
    +
    $routeParams = {{main.$routeParams}}
    +
    +
    + + +
    + controller: {{book.name}}
    + Book Id: {{book.params.bookId}}
    +
    +
    + + +
    + controller: {{chapter.name}}
    + Book Id: {{chapter.params.bookId}}
    + Chapter Id: {{chapter.params.chapterId}} +
    +
    + + + .example-leave, .example-enter { + -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -ms-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + -o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; + } + + .example-animate-container { + position:relative; + height:100px; + } + + .example-animate-container > * { + display:block; + width:100%; + border-left:1px solid black; + + position:absolute; + top:0; + left:0; + right:0; + bottom:0; + padding:10px; + } + + .example-enter { + left:100%; + } + .example-enter.example-enter-active { + left:0; + } + + .example-leave { } + .example-leave.example-leave-active { + left:-100%; + } + + + + angular.module('ngView', [], function($routeProvider, $locationProvider) { + $routeProvider.when('/Book/:bookId', { + templateUrl: 'book.html', + controller: BookCntl, + controllerAs: 'book' + }); + $routeProvider.when('/Book/:bookId/ch/:chapterId', { + templateUrl: 'chapter.html', + controller: ChapterCntl, + controllerAs: 'chapter' + }); + + // configure html5 to get links working on jsfiddle + $locationProvider.html5Mode(true); + }); + + function MainCntl($route, $routeParams, $location) { + this.$route = $route; + this.$location = $location; + this.$routeParams = $routeParams; + } + + function BookCntl($routeParams) { + this.name = "BookCntl"; + this.params = $routeParams; + } + + function ChapterCntl($routeParams) { + this.name = "ChapterCntl"; + this.params = $routeParams; + } + + + + it('should load and compile correct template', function() { + element('a:contains("Moby: Ch1")').click(); + var content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: ChapterCntl/); + expect(content).toMatch(/Book Id\: Moby/); + expect(content).toMatch(/Chapter Id\: 1/); + + element('a:contains("Scarlet")').click(); + content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: BookCntl/); + expect(content).toMatch(/Book Id\: Scarlet/); + }); + +
    + */ + + +/** + * @ngdoc event + * @name ng.directive:ngView#$viewContentLoaded + * @eventOf ng.directive:ngView + * @eventType emit on the current ngView scope + * @description + * Emitted every time the ngView content is reloaded. + */ +var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$compile', + '$controller', '$animator', + function($http, $templateCache, $route, $anchorScroll, $compile, + $controller, $animator) { + return { + restrict: 'ECA', + terminal: true, + link: function(scope, element, attr) { + var lastScope, + onloadExp = attr.onload || '', + animate = $animator(scope, attr); + + scope.$on('$routeChangeSuccess', update); + update(); + + + function destroyLastScope() { + if (lastScope) { + lastScope.$destroy(); + lastScope = null; + } + } + + function clearContent() { + animate.leave(element.contents(), element); + destroyLastScope(); + } + + function update() { + var locals = $route.current && $route.current.locals, + template = locals && locals.$template; + + if (template) { + clearContent(); + var enterElements = jqLite('
    ').html(template).contents(); + animate.enter(enterElements, element); + + var link = $compile(enterElements), + current = $route.current, + controller; + + lastScope = current.scope = scope.$new(); + if (current.controller) { + locals.$scope = lastScope; + controller = $controller(current.controller, locals); + if (current.controllerAs) { + lastScope[current.controllerAs] = controller; + } + element.children().data('$ngControllerController', controller); + } + + link(lastScope); + lastScope.$emit('$viewContentLoaded'); + lastScope.$eval(onloadExp); + + // $anchorScroll might listen on event... + $anchorScroll(); + } else { + clearContent(); + } + } + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:script + * + * @description + * Load content of a script tag, with type `text/ng-template`, into `$templateCache`, so that the + * template can be used by `ngInclude`, `ngView` or directive templates. + * + * @restrict E + * @param {'text/ng-template'} type must be set to `'text/ng-template'` + * + * @example + + + + + Load inlined template +
    +
    + + it('should load template defined inside script tag', function() { + element('#tpl-link').click(); + expect(element('#tpl-content').text()).toMatch(/Content of the template/); + }); + +
    + */ +var scriptDirective = ['$templateCache', function($templateCache) { + return { + restrict: 'E', + terminal: true, + compile: function(element, attr) { + if (attr.type == 'text/ng-template') { + var templateUrl = attr.id, + // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent + text = element[0].text; + + $templateCache.put(templateUrl, text); + } + } + }; +}]; + +/** + * @ngdoc directive + * @name ng.directive:select + * @restrict E + * + * @description + * HTML `SELECT` element with angular data-binding. + * + * # `ngOptions` + * + * Optionally `ngOptions` attribute can be used to dynamically generate a list of `
    + + + it('should check ng-options', function() { + expect(binding('{selected_color:color}')).toMatch('red'); + select('color').option('0'); + expect(binding('{selected_color:color}')).toMatch('black'); + using('.nullable').select('color').option(''); + expect(binding('{selected_color:color}')).toMatch('null'); + }); + + + */ + +var ngOptionsDirective = valueFn({ terminal: true }); +var selectDirective = ['$compile', '$parse', function($compile, $parse) { + //0000111110000000000022220000000000000000000000333300000000000000444444444444444440000000005555555555555555500000006666666666666666600000000000000007777000000000000000000088888 + var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/, + nullModelCtrl = {$setViewValue: noop}; + + return { + restrict: 'E', + require: ['select', '?ngModel'], + controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) { + var self = this, + optionsMap = {}, + ngModelCtrl = nullModelCtrl, + nullOption, + unknownOption; + + + self.databound = $attrs.ngModel; + + + self.init = function(ngModelCtrl_, nullOption_, unknownOption_) { + ngModelCtrl = ngModelCtrl_; + nullOption = nullOption_; + unknownOption = unknownOption_; + } + + + self.addOption = function(value) { + optionsMap[value] = true; + + if (ngModelCtrl.$viewValue == value) { + $element.val(value); + if (unknownOption.parent()) unknownOption.remove(); + } + }; + + + self.removeOption = function(value) { + if (this.hasOption(value)) { + delete optionsMap[value]; + if (ngModelCtrl.$viewValue == value) { + this.renderUnknownOption(value); + } + } + }; + + + self.renderUnknownOption = function(val) { + var unknownVal = '? ' + hashKey(val) + ' ?'; + unknownOption.val(unknownVal); + $element.prepend(unknownOption); + $element.val(unknownVal); + unknownOption.prop('selected', true); // needed for IE + } + + + self.hasOption = function(value) { + return optionsMap.hasOwnProperty(value); + } + + $scope.$on('$destroy', function() { + // disable unknown option so that we don't do work when the whole select is being destroyed + self.renderUnknownOption = noop; + }); + }], + + link: function(scope, element, attr, ctrls) { + // if ngModel is not defined, we don't need to do anything + if (!ctrls[1]) return; + + var selectCtrl = ctrls[0], + ngModelCtrl = ctrls[1], + multiple = attr.multiple, + optionsExp = attr.ngOptions, + nullOption = false, // if false, user will not be able to select it (used by ngOptions) + emptyOption, + // we can't just jqLite('